AppEvents
Constants
CallAlerting
Triggered when an incoming call arrives.
Parameters
call:
Incoming call that triggered the event.
callerid:
string
CallerID for current call.
customData:
string
OptionalOptional. Custom data for the current call object. 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
Source 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:
string
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
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, value: 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 the domain name). E.g. '/request/1d61f27ba2faad53.1500645140.80028_185.164.148.244/eb4b0539b13e2401'.
NewWebSocketFailed
Triggered when a WebSocket fails. It can happen when the number of incoming WebSocket connections exceeds the number of calls in one session + 3.
Parameters
content:
string
HTTP request content. E.g. '{"param1": "value1", "param2": "value2"}'.
headers:
{key: string, value: 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 the domain name). E.g. '/request/1d61f27ba2faad53.1500645140.80028_185.164.148.244/eb4b0539b13e2401'.
reason:
string
Started
The very first event is triggered due to incoming call or HTTP request to Voximplant cloud over the internet. Triggers only once in a session, so if you execute the same HTTP request again it creates 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 external systems.
accessURL:
string
HTTP URL that can be used to send commands to this scenario from the external systems.
accountId:
number
Unique identification number of the Voximplant account. Can be used as one of the authentication parameters in management API methods.
applicationId:
number
Unique identification number of Voximplant application. Can be used in Managing Applications in management API methods.
conference_name:
string
Conference name that is passed to the conference session created via the management API.
logURL:
string
Direct link to the call's log.
sessionId:
number
Identification number of JS session that is unique within an account and its child accounts. Can be used in Managing History in management API methods.
Terminated
Triggered when a session is terminated and after the AppEvents.Terminating event is 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
Triggered when a session is about to terminate. Triggers in two cases:
1) when there are no calls and/or ACD requests in a call session. See the session limits for details;
2) when the VoxEngine.terminate method is called. Timers and any other external resources are not available after this event is 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 is made), the AppEvents.Terminated event is triggered.
WebSocket
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, value: 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 the domain name). E.g. '/request/1d61f27ba2faad53.1500645140.80028_185.164.148.244/eb4b0539b13e2401'.
websocket: