Rate this page:

Serverless

Voximplant serverless is implemented with the help of a JavaScript runtime environment called VoxEngine. Developers write JavaScript code that manages calls and then upload it to the cloud/ That code is executed on Voximplant media servers where calls are processed. This approach enables both real-time call control and real-time debugging. JavaScript implementation used in VoxEngine is ES2017/2018 compliant.

VoxEngine provides a number of classes and functions that are used to implement required call control logic and to manage Voximplant built-in features like call recording, speech recognition, speech synthesis and much more. Since VoxEngine provides full-featured JavaScript support and built-in functions for data exchange with external web services (for making and receiving HTTP requests or handling websocket connections), some business logic can be implemented along with the call control logic.

Voximplant session execution lifetime is rather long compared to typical serverless functions, the session usually lasts longer than the calls the function controls. The session context is available throughout its lifetime.

VoxEngine is fully asynchronous: there are no waiting or blocking operations. All method calls start corresponding operations and return values immediately. If a developer places two "say" methods one after another, the second playback will immediately replace the first one. Basically it’s similar to event-driven architectures that are used in other JavaScript platforms like Node.JS. In order to maintain real-time execution, there are some limits for each JavaScript session:

VoxEngine session limits

  • The unanswered incoming call is disconnected in 60 seconds.

  • Session without calls and without ACD requests is terminated in 60 seconds.

  • Session without calls and with at least one ACD request is terminated in 120 minutes.

  • JavaScript scenario size is limited to 256*1024 unicode chars.

  • JavaScript memory is limited to 16 megabytes.

  • JavaScript string length is limited to 810,241,023 unicode chars.

  • Callback execution time is limited to 1 second. This means that heavy computations should be moved to your own infrastructure and accessed via HTTP requests.

  • Max number of active timers is 100.

  • Timers and any other external resources are not available for the application after the 'Terminating' event has been triggered, but the application can make one more HTTP request to notify external system about the fact that the session is finished.

  • Max number of active HTTP requests is 3. Requests over the limit are queued, up to the total HTTP requests limit. Before 'Terminating' event is triggered, VoxEngine will wait up to 90 seconds for pending requests to complete and will execute corresponding callback functions. The rest queued requests are silently dropped without any callback functions execution.

  • Max number of simultaneous HTTP requests is 35. The limit includes both pending and queued requests. Initiating more requests will result in “Exceeded the HTTP connection count limit!” exception.

  • Max number of active SMTP requests is 2. Requests over the limit are queued, up to the total SMTP requests limit. Before 'Terminating' event is triggered, VoxEngine will wait up to 90 seconds for pending requests to complete and will execute corresponding callback functions. The rest queued requests are silently dropped without any callback functions execution.

  • Max number of simultaneous SMTP requests is 10. This limit counts both pending and queued requests. Initiating more requests will result in “Exceeded the SMTP connection count limit!” exception.

  • The size of HTTP response handled by VoxEngine is limited to 2 megabytes.

  • Session is limited to a total of 50 inbound and outbound call attempts. Both successful and failed calls are counted. New calls over the limit will fail with 'CallEvents.Failed' event where 'code' is 403 and 'reason' is a description string like "Call limit reached". Use the Call list module for a big number of outbound calls and the Conference module for a big number of participants in a single VoxEngine session.

  • Max number of “progressing” calls that are not answered yet at any given moment is limited to 10. Calls over the limit will fail with 'CallEvents.Failed' event where 'code' is 403 and 'reason' is a description string like "Call limit reached".

  • Single SIP header field is limited to 200 bytes.

  • Destinations that are more expensive than 20 cents per minute and calls to countries in Africa are blocked by default for security reasons. Please contact us at support@voximplant.com to enable them. IMPORTANT: if these settings has been applied to your account, then all child accounts created afterwards will have these settings too.

  • All call* methods trigger the Failed event with 408 code if there is no answer after 60 sec. The methods are: callConference, callPSTN, callSIP, callUser and callUserDirect.

  • Maximum size of data that can be sent using the sendInfo and sendMessage methods of the Call class is 8192 bytes.