- Print
- DarkLight
- PDF
The Generic Event attempts to cover the majority of use cases where a 3rd party application needs call events at all 3 levels. The 3 levels are:
- Level 1: The first leg into Callable, known as the 'A Leg' in the telecoms world
- Level 2: The outbound leg(s) to a PBX or other endpoint such as a gateway or sip device.
- Level 3: The customer PBX or device (if integrated with callable)
By having the 3 levels of events, 3rd parties can act on the entire lifecycle of the call meaning they can build applications for reporting, live call control, and screen popping at an extension level.
Level 1 - Leg A
The ingress leg, or Leg A is the first leg of the call. This may be an outbound call from a PBX or SIP device, or it may be an inbound call from the PSTN to an IVR. Calls always contain Leg A, without fail, always! With that in mind, lets look at what a generic event looks like for Leg A
{
"accountId":"9539ee93-64c8-802b-360b-c6f2f7cf2507",
"accountName":"Test Account",
"parentCallSid":"e5bc544c-2186-47e8-8784-6182cf8190cb",
"callSid":"e5bc544c-2186-47e8-8784-6182cf8190cb",
"childSid": null,
"type" : "voice",
"event":"call",
"status":"in-progress",
"from":"441234567890",
"to":"441234567891",
"extension": null,
"meta" : {
"key1" : "value"
},
"timestamp":1623163324316
}
Field | Type | Description | Values |
---|---|---|---|
accountId | UUID | The account identifier | 9539ee93-64c8-802b-360b-c6f2f7cf2507 |
accountName | String | Name of account | Test Account |
parentCallSid | UUID | The current call leg identifier | e5bc544c-2186-47e8-8784-6182cf8190cb |
callSid | UUID | The current call leg identifier - Same as parentCallSid as this is an A Leg | e5bc544c-2186-47e8-8784-6182cf8190cb |
type | String | Type of event | voice |
event | String | The actual call event | call |
status | String | The status of the call | trying, in-progress, completed, failed |
from | String | E164 formatted number or URI | 441234567890 or user@mydomain.connect.callable.io |
to | String | E164 formatted number or URI | 441234567890 or user@mydomain.connect.callable.io |
meta | KeyValue Map | Map of Strings or "Call Tags" | { "key" : "value" } |
timestamp | Number | Milliseconds since epoch | 1623163324316 |
Level 2 - B Legs
Some calls may never have a B Leg such as IVR, Announcements and Features. However some calls could have 1 or many B Legs, or sometimes we call these OutDial legs. In the telecoms world, no matter how many OutDial legs there are in addition to the A Leg, these are always called 'B'.
B Legs in callable outdial legs to PBXs, PSTNS, WebRTC, Sip Devices or MS Teams.
Lets see what a B Leg looks like, for brevity we will omit any fields which reoccur:
{
"accountId":"9539ee93-64c8-802b-360b-c6f2f7cf2507",
"accountName":"Test Account",
"parentCallSid":"e5bc544c-2186-47e8-8784-6182cf8190cb",
"callSid":"85cb3194-76e2-43e1-ad56-59556af617b9",
"childSid": null,
"type" : "voice",
"event":"call",
"status":"in-progress",
"from":"441234567890",
"to":"441234567891",
"extension": null,
"meta" : {
"key1" : "value"
},
"timestamp":1623163324316
}
Field | Type | Description | Values |
---|---|---|---|
parentCallSid | UUID | The parent call leg identifier (A Leg) | e5bc544c-2186-47e8-8784-6182cf8190cb |
callSid | UUID | The current call leg identifier | 85cb3194-76e2-43e1-ad56-59556af617b9 |
status | String | The status of the call | trying ringing, in-progress, completed, failed |
Level 2 - Recording Events
Recording events are tied to B Legs and there are 3 key events - start, end & transcoded
{
"accountId":"9539ee93-64c8-802b-360b-c6f2f7cf2507",
"accountName":"Test Account",
"parentCallSid":"e5bc544c-2186-47e8-8784-6182cf8190cb",
"callSid":"85cb3194-76e2-43e1-ad56-59556af617b9",
"childSid": null,
"type" : "voice",
"event":"record",
"status":"in-progress",
"from":"441234567890",
"to":"441234567891",
"extension": null,
"meta" : {
"key1" : "value"
},
"timestamp":1623163324316
}
Field | Type | Description | Values |
---|---|---|---|
event | String | The event related to this call | record |
status | String | The status of the recording | start, end, trancoded |
Level 3 - PBX Events
Level 3 events are where we extend our reach into 3rd party applications. These are predominatley PBXs but can be any 3rd party software which generates an event which can be related to the the ongoing call such as IOT (Internet of things). A crude example such as the heart rate of call center staff handling complaints could be mapped, allowing you to recieve these events within the context of a call.
For now, lets stick with simple PBX phone events, such as connected and disconnectd
To enable PBX events, you will need a integrated PBX. Curently we provide integrations for Avaya R9, Avaya R11 and 3CX with more to come.
Please read the specific documentation on how to enable the individual PBX listeners.
Avaya Listener
3CX PBX Listener
Once the listener is mapping events, lets see what a Level 3 event looks like;
{
"accountId":"9539ee93-64c8-802b-360b-c6f2f7cf2507",
"accountName":"Test Account",
"parentCallSid":"e5bc544c-2186-47e8-8784-6182cf8190cb",
"callSid":"85cb3194-76e2-43e1-ad56-59556af617b9",
"childSid": "ea707e77-18c1-4ad8-9072-6c396ee3fdd5",
"type" : "voice",
"event":"phone",
"status":"connected",
"from":"441234567890",
"to":"441234567891",
"extension": "201",
"meta" : {
"key1" : "value"
},
"timestamp":1623163324316
}
Field | Type | Description | Values |
---|---|---|---|
event | String | The level 3 event | phone , extension |
status | String | The status of event | connected, disconnected, parked |
extension | String | The extension number of device | 201 |
parentCallSid | UUID | The A Leg identifier | e5bc544c-2186-47e8-8784-6182cf8190cb |
callSid | UUID | The B leg identifier | 85cb3194-76e2-43e1-ad56-59556af617b9 |
childSid | String/UUID | The PBX Identifier | ea707e77-18c1-4ad8-9072-6c396ee3fdd5 |