ImpactPBX provides web-hooks for numerous actions made during a call that include originate, ring, answer and hang-up. It sends JSON results to an endpoint for each action. Web-hooks functionality can be configured through the ImpactPBX web platform (please navigate to Integrations -> Webhooks). Please note that the endpoints specified in ImpactPBX should return HTTP status codes (200 for OK and >=400 for failures).
In this section we describe the JSON results of an outbound call originated by extension 1002 to the number 0035799123456 where the caller id number is set to +442035040000. In the case of a failed call a failed event will be sent.
Currently, failed events are sent in the following cases:
When an inbound call is received and the extension is not registered
When there is no route to handle a call. For example, an extension calls another extension that does not exist or when an outbound number is called but there is no any outbound rule to handle that call.
When the hangup cause of a Call Center call is equal to cancel. This is useful in the case all the agents of a Call Center queue are not registered and the caller cancels the call or when the max wait time is reached.
JSON results for originate action
{
"ref":"460a36b6-09e7-466b-97d8-903c8cf4fc6c",
"domain_name":"dev-pbx.impactpbx.com",
"recipient":"0035799123456",
"caller_id_number":"+442035040000",
"ani":"1002",
"recipient_e164":"+35799123456",
"caller_id_number_e164":"+442035040000",
"ani_e164":"1002",
"direction":"outbound",
"channel_uuid":"8967dafb-f8b6-4d68-9eb7-f3cce82596c8",
"originating_leg_uuid":"460a36b6-09e7-466b-97d8-903c8cf4fc6c",
"dialed_user":"",
"call_start":"2020-01-29T07:45:19.000+00:00",
"call_start_uepoch":1580283919489709,
"click_to_call":false,
"click_to_call_data":"",
"timestamp":"2020-01-29T07:45:20.000+00:00",
"action":"originate"
}
Fields | Descriptions |
|---|---|
ref | the unique id of the call |
domain_name | the name of the PBX domain |
recipient | the callee's number |
caller_id_number | the caller's number |
ani | automatic number identification. Usually the extension number. |
recipient_e164 | the recipient field in E.164 format |
caller_id_number_e164 | the caller_id_number in E.164 format |
ani_e164 | the ani field in E.164 format |
direction | call direction (inbound or outbound) |
channel_uuid | the unique id of the channel |
originating_leg_uuid | the unique id of the originating leg/channel |
dialed_user | the extension/SIP user being dialed |
call_start | the timestamp that indicates when the call was started |
call_start_uepoch | the uepoch value of the call_start |
click_to_call | indicates if the call was initiated through the click-to-call functionality |
click_to_call_data | user data sent by the click-to-call functionality |
timestamp | the timestamp when the call action was fired |
action | the supported action |
JSON results for ring action
{
"ref":"460a36b6-09e7-466b-97d8-903c8cf4fc6c",
"domain_name":"dev-pbx.impactpbx.com",
"recipient":"0035799123456",
"caller_id_number":"+442035040000",
"ani":"1002",
"recipient_e164":"+35799123456",
"caller_id_number_e164":"+442035040000",
"ani_e164":"1002",
"direction":"outbound",
"channel_uuid":"8967dafb-f8b6-4d68-9eb7-f3cce82596c8",
"originating_leg_uuid":"460a36b6-09e7-466b-97d8-903c8cf4fc6c",
"dialed_user":"",
"call_start":"2020-01-29T07:45:19.000+00:00",
"call_start_uepoch":1580283919489709,
"ring_start":"2020-01-29T07:45:25.000+00:00",
"ring_start_uepoch":1580283925729764,
"click_to_call":false,
"click_to_call_data":"",
"timestamp":"2020-01-29T07:45:26.000+00:00",
"action":"ring"
}
Fields | Descriptions |
|---|---|
ref | the unique id of the call |
domain_name | the name of the PBX domain |
recipient | the callee's number |
caller_id_number | the caller's number |
ani | automatic number identification. Usually the extension number. |
recipient_e164 | the recipient field in E.164 format |
caller_id_number_e164 | the caller_id_number in E.164 format |
ani_e164 | the ani field in E.164 format |
direction | call direction (inbound or outbound) |
channel_uuid | the unique id of the channel |
originating_leg_uuid | the unique id of the originating leg/channel |
dialed_user | the extension/SIP user being dialed |
call_start | the timestamp that indicates when the call was started |
call_start_uepoch | the uepoch value of the call_start |
ring_start | the timestamp that indicates when the call started ringing |
ring_start_uepoch | the uepoch value of the ring_start |
click_to_call | indicates if the call was initiated through the click-to-call functionality |
click_to_call_data | user data sent by the click-to-call functionality |
timestamp | the timestamp when the call action was fired |
action | the supported action |
JSON results for answer action
{
"ref":"460a36b6-09e7-466b-97d8-903c8cf4fc6c",
"domain_name":"dev-pbx.impactpbx.com",
"recipient":"0035799123456",
"caller_id_number":"+442035040000",
"ani":"1002",
"recipient_e164":"+35799123456",
"caller_id_number_e164":"+442035040000",
"ani_e164":"1002",
"direction":"outbound",
"channel_uuid":"8967dafb-f8b6-4d68-9eb7-f3cce82596c8",
"originating_leg_uuid":"460a36b6-09e7-466b-97d8-903c8cf4fc6c",
"dialed_user":"",
"call_start":"2020-01-29T07:45:19.000+00:00",
"call_start_uepoch":1580283919489709,
"ring_start":"2020-01-29T07:45:25.000+00:00",
"ring_start_uepoch":1580283925729764,
"answer_start":"2020-01-29T07:45:35.000+00:00",
"answer_start_uepoch":1580283935169797,
"click_to_call":false,
"click_to_call_data":"",
"timestamp":"2020-01-29T07:45:36.000+00:00",
"action":"answer"
}
Fields | Descriptions |
|---|---|
ref | the unique id of the call |
domain_name | the name of the PBX domain |
recipient | the callee's number |
caller_id_number | the caller's number |
ani | automatic number identification. Usually the extension number. |
recipient_e164 | the recipient field in E.164 format |
caller_id_number_e164 | the caller_id_number in E.164 format |
ani_e164 | the ani field in E.164 format |
direction | call direction (inbound or outbound) |
channel_uuid | the unique id of the channel |
originating_leg_uuid | the unique id of the originating leg/channel |
dialed_user | the extension/SIP user being dialed |
call_start | the timestamp that indicates when the call was started |
call_start_uepoch | the uepoch value of the call_start |
ring_start | the timestamp that indicates when the call started ringing |
ring_start_uepoch | the uepoch value of the ring_start |
answer_start | the timestamp that indicates when the call was answered |
answer_start_uepoch | the uepoch value of the answer_start |
click_to_call | indicates if the call was initiated through the click-to-call functionality |
click_to_call_data | user data sent by the click-to-call functionality |
timestamp | the timestamp when the call action was fired |
action | the supported action |
JSON results for hang-up action
{
"ref":"460a36b6-09e7-466b-97d8-903c8cf4fc6c",
"domain_name":"dev-pbx.impactpbx.com",
"recipient":"0035799123456",
"caller_id_number":"+442035040000",
"ani":"1002",
"recipient_e164":"+35799123456",
"caller_id_number_e164":"+442035040000",
"ani_e164":"1002",
"direction":"outbound",
"channel_uuid":"8967dafb-f8b6-4d68-9eb7-f3cce82596c8",
"originating_leg_uuid":"460a36b6-09e7-466b-97d8-903c8cf4fc6c",
"dialed_user":"",
"call_start":"2020-01-29T07:45:19.000+00:00",
"call_start_uepoch":1580283919489709,
"ring_start":"2020-01-29T07:45:25.000+00:00",
"ring_start_uepoch":1580283925729764,
"answer_start":"2020-01-29T07:45:35.000+00:00",
"answer_start_uepoch":1580283935169797,
"call_end":"2020-01-29T07:45:39.000+00:00",
"call_end_uepoch":1580283939549758,
"duration":4,
"recording":"460a36b6-09e7-466b-97d8-903c8cf4fc6c",
"cause":"NORMAL_CLEARING",
"click_to_call":false,
"click_to_call_data":"",
"timestamp":"2020-01-29T07:45:40.000+00:00",
"action":"hangup"
}
Fields | Descriptions |
|---|---|
ref | the unique id of the call |
domain_name | the name of the PBX domain |
recipient | the callee's number |
caller_id_number | the caller’s number |
ani | automatic number identification. Usually the extension number. |
recipient_e164 | the recipient field in E.164 format |
caller_id_number_e164 | the caller_id_number in E.164 format |
ani_e164 | the ani field in E.164 format |
direction | call direction (inbound or outbound) |
channel_uuid | the unique id of the channel |
originating_leg_uuid | the unique id of the originating leg/channel |
dialed_user | the extension/SIP user being dialed |
call_start | the timestamp that indicates when the call was started |
call_start_uepoch | the uepoch value of the call_start |
ring_start | the timestamp that indicates when the call started ringing |
ring_start_uepoch | the uepoch value of the ring_start |
answer_start | the timestamp that indicates when the call was answered |
answer_start_uepoch | the uepoch value of the answer_start |
call_end | the timestamp that indicates when the call ended |
call_end_uepoch | the uepoch value of the call_end |
duration | the duration of the call in seconds |
recording | the name of the recording file |
cause | the cause of the hang-up |
click_to_call | indicates if the call was initiated through the click-to-call functionality |
click_to_call_data | user data sent by the click-to-call functionality |
timestamp | the timestamp when the call action was fired |
action | the supported action |
JSON results for a failed call
{
"ref":"460a36b6-09e7-466b-97d8-903c8cf4fc6c",
"domain_name":"dev-pbx.impactpbx.com",
"recipient":"+11111",
"caller_id_number":"1002",
"ani":"1002",
"recipient_e164":"+35799123456",
"caller_id_number_e164":"+442035040000",
"ani_e164":"1002",
"direction":"outbound",
"call_start":"2020-01-29T07:45:19.000+00:00",
"call_start_uepoch":1580283919489709,
"call_end":"2020-01-29T07:45:20.000+00:00",
"call_end_uepoch":1580283919489710,
"cause":"NORMAL_CLEARING",
"reason_failed":"NO_ROUTE"
"click_to_call":false,
"click_to_call_data":"",
"timestamp":"2020-01-29T07:45:20.000+00:00",
"action":"failed"
}
Fields | Descriptions |
|---|---|
ref | the unique id of the call |
domain_name | the name of the PBX domain |
recipient | the callee's number |
caller_id_number | the caller's number |
ani | automatic number identification. Usually the extension number. |
recipient_e164 | the recipient field in E.164 format |
caller_id_number_e164 | the caller_id_number in E.164 format |
ani_e164 | the ani field in E.164 format |
direction | call direction (inbound or outbound) |
call_start | the timestamp that indicates when the call was started |
call_start_uepoch | the uepoch value of the call_start |
call_end | the timestamp that indicates when the call ended |
call_end_uepoch | the uepoch value of the call_end |
cause | the cause of the hang-up |
reason_failed | the reason why this call failed |
click_to_call | indicates if the call was initiated through the click-to-call functionality |
click_to_call_data | user data sent by the click-to-call functionality |
timestamp | the timestamp when the call action was fired |
action | the supported action |