Events

AppEvents.CallAlerting

Event triggered when incoming call arrives.

Since each incoming call creates new session, it can be dispatched only once during session lifetime
Properties
  • call: Call

    Incoming call that triggered the event

  • callerid: String

    CallerID for current call

  • customData: String

    Optional: Custom data that was passed from client with the call

  • destination: String

    Dialed number

  • displayName: String

    Displayable name of the caller

  • fromURI: String

    CallerID with domain or SIP URI for incoming SIP call

  • headers: Object

    Custom SIP headers received with the call (the ones starting with "X-")

  • name: String

    The name of the event - "Application.CallAlerting"

  • toURI: String

    Dialed SIP URI

AppEvents.HttpRequest

Event triggered when definite HTTP request is received by the session. When you start the call session with HTTP request you get an answer: an object with media_session_access_url property. Using this property value in HTTP request you trigger the AppEvents.HttpRequest event. HTTP requests to the media_session_access_url can be made multiple times. Requests are used to stop scenario or pass additional data into it. For more details see the AppEvents.Started in this section or this article.

Example of HTTP request to the media_session_access_url:
curl -d '{"param1": "value1", "param2": "value2"}' -H "Content-type: application/json" -X POST http://185.164.148.244:12092/request/1d61f27ba2faad53.1500645140.80028_185.164.148.244/eb4b0539b13e2401
Properties
  • content: String

    HTTP request content. E.g. '{"param1": "value1", "param2": "value2"}'

  • method: String

    HTTP request method. E.g. POST

  • path: String

    HTTP path requested (without domain name). E.g. /request/1d61f27ba2faad53.1500645140.80028_185.164.148.244/eb4b0539b13e2401

AppEvents.Started

The very first event triggered due to HTTP request to Voximplant cloud over the internet. Event triggered only once in a session, if you repeat the same HTTP request it will create the new, separate session (call). Note that usage of the event in your JS scenario is optional. The request starts the initialization then initialization completes and event triggered. See the workflow example in this article.

Properties
  • accessURL: String

    HTTP URL that can be used to send commands to this scenario from outer world

AppEvents.Terminated

Event triggered when a session was terminated and after the AppEvents.Terminating event was triggered. The time between these events depends on handler for AppEvents.Terminating event.

AppEvents.Terminating

Event triggered when a session is about to terminate. The event is triggered in two cases: 1) when there are no calls and/or ACD requests in a call session. See the details in VoxEngine session limits 2) when the VoxEngine.terminate() method is called. After this event is triggered, application has no more access to any timers and external resources. It can only perform one HTTP request to notify external system about the fact that session is finished. After that request is finished (or no such request was made), Application.Terminated event will be triggered.