AppEvents
Constants
CallAlerting
Event is triggered when an incoming call arrives.
Parameters
call:
Incoming call that triggered the event
callerid:
string
CallerID for current call
customData:
string
Optional: Custom data that is passed with the call. It can be passed from Web SDK via the Client.call method in the customData parameter.
destination:
string
Dialed number
displayName:
string
Displayable name of the caller
fromURI:
string
CallerID with domain or SIP URI for incoming SIP call
headers:
{[header: string]: string}
Custom SIP headers received with the call (the ones starting with "X-")
name:
string
Name of the event - "Application.CallAlerting"
scheme:
any
Internal information about codecs, should be passed to the VoxEngine.callUser, VoxEngine.callUserDirect, VoxEngine.callSIP, VoxEngine.callConference, Call.answer, Call.answerDirect, Call.startEarlyMedia methods call.
toURI:
string
Dialed SIP URI
HttpRequest
Event is triggered when the managing HTTP request is received by the session. If you start a call session with HTTP request, you get an answer: an object with media_session_access_url property. The property's value is the managing URL for the specified session, so it can be used in managing HTTP request that triggers AppEvents.HttpRequest event.
Parameters
content:
string
HTTP request content. E.g. '{"param1": "value1", "param2": "value2"}'
headers:
{[key: string]: string}
List of dictionaries with key and value fields representing HTTP headers. (the ones starting with "X-")
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
Started
The very first event is triggered due to incoming call or HTTP request to Voximplant cloud over the internet. The event is triggered only once in a session, so if you execute the same HTTP request again it will create the new, separate session. Note that usage of the event in your JS scenario is optional.
Parameters
accessSecureURL:
string
HTTPS URL that can be used to send commands to this scenario from the outer world.
accessURL:
string
HTTP URL that can be used to send commands to this scenario from the outer world.
accountId:
number
Unique identification number of Voximplant account. Can be used as one of the authentication parameters in HTTP API methods.
applicationId:
number
Unique identification number of Voximplant application. Can be used in Managing Applications methods of HTTP API
conference_name:
string
Conference name that is passed to the conference session created via the HTTP API.
logURL:
string
Direct link to the call's log
sessionId:
number
Unique identification number of JS Can be used in Managing History methods of HTTP API.
Terminated
Event is 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. Use the event just for debugging, only the Logger.write method could be used in a handler.
Terminating
Event is 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 was called. Timers and any other external resources are not available after this event was triggered, but you can perform one HTTP request inside the event handler (e.g. to notify an external system about the fact that the session is finished). When that request is finished (or no such request was made), the AppEvents.Terminated event will be triggered.
WebSocket
Event is triggered when there is a new connection to a WebSocket.
Parameters
content:
string
HTTP request content. E.g. '{"param1": "value1", "param2": "value2"}'
headers:
{[key: string]: string}
List of dictionaries with key and value fields representing HTTP headers. (the ones starting with "X-")
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
websocket: