Integration - Call Events
Friday, July 24, 2020 1:47 AM


Overview

Telephony module supports reporting of call events to 3rd party HTTP endpoints via web hooks registered with the rule action Set URL to Open. The action depends on URL adapter object responsible for holding a specific endpoint URL and assigning parameter names the corresponding content placeholders.

When configured, the action will trigger a HTTP GET request to the endpoint at the following events:

  • immediately after executing Set URL to open action, which is at the call start
  • on call pickup
  • on call hangup
  • in case it's a missed call there will be an additional request to report the fact, immediately following the hangup request

Action setup

It is possible to configure one or more web hooks either globally for all calls or inside individual routing rules. In either case it's required to add Set URL to open to the action list, specify on call state events, in backend as the 1st action parameter and pick an URL adapter holding a 3rd party endpoint configuration as the 2nd parameter.

Examples of configuration:

  • a global action for all types of calls:
  • a rule specific action for incoming calls only:

Adapter setup

  • copy-paste the endpoint URL into the URL field of the adapter
  • parameter list will be populated automatically
  • for each parameter specify a placeholder


NOTE: to quickly load list of all supported placeholders click one of Load example links in the adapter notes when the URL field is empty.

Supported placeholders

NameTypeValues (comma separated)
{{DialApiEventName}}stringstart,hangup,pickup,missed
{{DialApiEventCode}}integer0,1,2,3
{{CallID}}long integer
{{CallUUID}}GUID
{{CallerID}}string
{{DID}}stringa.k.a. line ID
{{ResponderAgentExt}}
string
e.g. 1001
{{ResponderAgent}}stringe.g. Kasper
{{LastQueueName}}string
{{CallTypeName}}stringIncoming,Outgoing,Internal,Login,API,Conference
{{CallTypeCode}}integer1,2,3,4,5,6
{{StartTimestampUTC}}long integer,Java timestamp,UTCe.g.1595496055313
{{PickupTimestampUTC}}long integer,Java timestamp,UTCe.g.1595496055313
{{TotalWaitTimeMs}}long integer,duration in millisecondse.g. 12833
{{EndTimestampUTC}}long integer,Java timestamp,UTCe.g.1595496055313
{{IsCallAnswered}}bit0,1
{{IsCallRecorded}}bit0,1
{{RecordingURL}}stringe.g. https://localhost:8080/_cros_/master/?uid=form_faster_downloadcall&target=self&sectok=3511b272f4fb03ecf900b80b1cc5b8fe&nId=103870
NOTE: if in a certain context a placeholder can't have a meaningful value it'll be replaced with an empty string (e.g. if a call is not recorded the {{RecordingURL}} will be empty).

Request URL samples

The following samples have been obtained using an URL adapter shown on the screenshot below:

  • call start:
https://server/endpoint?Event=start&EventCode=0&CallId=103871&CallGuid=7be71282-c9a8-4a95-8ace-0f4e2ebc0bc5&CallerID=dev2Incoming&DID=855555&ResponderAgent=&QueueName=&CallTypeCode=1&CallTypeName=Incoming&StartTimestampUTC=1595496055313&PickupTimestampUTC=&TotalWaitTimeMs=&EndTimestampUTC=1595496055313&IsCallAnswered=0&IsCallRecorded=&RecordingURL=
  • missed call hangup:
https://server/endpoint?Event=hangup&EventCode=1&CallId=103871&CallGuid=7be71282-c9a8-4a95-8ace-0f4e2ebc0bc5&CallerID=dev2Incoming&DID=855555&ResponderAgent=Root&QueueName=Simple%20queue&CallTypeCode=1&CallTypeName=Incoming&StartTimestampUTC=1595496055313&PickupTimestampUTC=&TotalWaitTimeMs=12833&EndTimestampUTC=1595496069313&IsCallAnswered=0&IsCallRecorded=0&RecordingURL=
  • missed call event sent after hangup:
https://server/endpoint?Event=missed&EventCode=3&CallId=103871&CallGuid=7be71282-c9a8-4a95-8ace-0f4e2ebc0bc5&CallerID=dev2Incoming&DID=855555&ResponderAgent=Root&QueueName=Simple%20queue&CallTypeCode=1&CallTypeName=Incoming&StartTimestampUTC=1595496055313&PickupTimestampUTC=&TotalWaitTimeMs=12833&EndTimestampUTC=1595496069313&IsCallAnswered=0&IsCallRecorded=&RecordingURL=
  • call pickup:
https://server/endpoint?Event=pickup&EventCode=2&CallId=103870&CallGuid=2f9ad1e4-ccc1-4019-9817-0d028f7448d3&CallerID=dev2Incoming&DID=855555&ResponderAgent=Root&QueueName=Simple%20queue&CallTypeCode=1&CallTypeName=Incoming&StartTimestampUTC=1595496018843&PickupTimestampUTC=1595496027493&TotalWaitTimeMs=7553&EndTimestampUTC=1595496027843&IsCallAnswered=1&IsCallRecorded=&RecordingURL=
  • answered call hangup:
https://server/endpoint?Event=hangup&EventCode=1&CallId=103870&CallGuid=2f9ad1e4-ccc1-4019-9817-0d028f7448d3&CallerID=dev2Incoming&DID=855555&ResponderAgent=Root&QueueName=Simple%20queue&CallTypeCode=1&CallTypeName=Incoming&StartTimestampUTC=1595496018843&PickupTimestampUTC=1595496027990&TotalWaitTimeMs=7700&EndTimestampUTC=1595496035843&IsCallAnswered=1&IsCallRecorded=1&RecordingURL=https://localhost:8080/_cros_/master/?uid=form_faster_downloadcall&target=self&sectok=3511b272f4fb03ecf900b80b1cc5b8fe&nId=103870