Lua Agents

Introduction

A Lua agent provides a general-purpose asynchronous processing function. Typically these functions interact with one of the other Applications, e.g. to send a DB request, or a REST/SOAP client request.

The key word in the actions performed by these agents is “asynchronous”. Of course a Lua script could perform a REST API request directly using lua-resty-http or some other such package, or could perform a postgres lookup using luapgsql. However, those third-party libraries are synchronous; the script will block until the external access completes. All other Lua script executions running will also be blocked from processing. This of course is not feasible in a real-time environment running many simultaneous call processing scripts. The LogicApp provides a framework to allow scripts to perform supported protocol interactions asynchronously via a simple method call.

This documentation in this section describes the core Lua Agents provided as part of the base n2svcd package. Other protocol-specific Agents are delivered by other packages, e.g. Agents related to SIP functionality are delivered by the n2sip package.