Introduction

 

At the end of this article, you will be able to configure webhook events from the PBX.  This feature is currently in Beta and only available to customers that have requested Beta features be activated on their account.  Should you need any assistance, feel free to contact our support department.

 

Configuring Global Webhooks

 

Global webhooks can be configured to trigger for various event types across the whole PBX.  Global webhooks are configured in the Settings for the PBX in the Integrations tab.  Enter the URL of the server to receive the webhook events in the URL field, and a string in the Secret Token field which will be sent with each request via the HTTP header X-Pbx-Token for your server to validate.  Then select the tick box next to each event you would like to trigger a webhook event, further details of each event are shown below.

mceclip0.png

 

User inbound call

 

Webhook event is triggered when a call reaches a User Object and starts ringing.  If the User is targeted via a Queue or Ring Group, the details of the object that the User is configured on will also be passed in the event.  The following data is sent as JSON with the event;

 

(string) type - inbound_call_to_user
(string) unique_call_id - unique identifier of the call
(string) from_number - CallerID of caller (CLI)
(string) from_name - CNAM of caller if it exists
(string) exten - User extension that is ringing
(string) to_number - Dialed Number Identification (DNID)
(string) to_name - name of User object that is ringing
(string) start_at - date and time the call started, in the ISO 8601 format
(string) queue_name - name of the Queue object that has targeted this User, if applicable
(string) ring_group_name - name of Ring Group object that has targeted the User, if applicable


mceclip2.png

 

User inbound call answered

 

Webhook event is triggered when a call is answered by a User.  The following data is sent as JSON with the event;


(string) type - inbound_call_to_user_answer
(string) unique_call_id - unique identifier of the call
(string) from_number - CallerID of caller (CLI)
(string) to_number - Dialed Number Identification (DNID)
(string) to_name - name of User object that answered the call
(string) call_start_at - date and time the call was started, in the ISO 8601 format
(string) conversation_start_at - date and time the call was answered by the User, in the ISO 8601 format
(string) queue_name - name of Queue object that routed the call, if applicable
(string) ring_group_name - name of Ring Group object that routed the call, if applicable


mceclip0.png

 

User inbound call completion

 

Webhook event is triggered when a call to a User is completed.  The following data is sent as JSON with the event;


(string) type - inbound_call_to_user_info
(string) unique_call_id - unique identifier of the call
(string) from_number - CallerID of caller (CLI)
(string) to_number - Dialed Number Identification (DNID)
(string) to_name - name of User object that completed the call
(string) call_start_at - date and time the call was started, in the ISO 8601 format
(int) call_duration - total call duration in seconds
(null|string) conversation_start_at - null or date and time the call was answered by the User, in the ISO 8601 format
(int) conversation_duration - duration of the conversation in seconds


mceclip1.png

 

User outbound call

 

Webhook event is triggered when a User initiates an outbound call.  The following data is sent as JSON with the event;


(string) type - outbound_user_call
(string) unique_call_id - unique identifier of the call
(string) from_number - extension number of user making the call
(string) from_name - name of User object making the call
(string) exten - number dialled by the user (DNID)
(string) start_at - date and time the call was started, in the ISO 8601 format


mceclip1.png

 

 

User outbound call answered

 

Webhook event is triggered when an outbound call from a user is answered by the called party.  The following data is sent as JSON with the event;


(string) type - outbound_user_call_answer
(string) unique_call_id - unique identifier of the call
(string) from_number - extension number of user making the call
(string) from_name - name of User object making the call
(string) to_number - number dialled by the user (DNID)
(string) call_start_at - date and time the call was started, in the ISO 8601 format
(string) conversation_start_at - date and time the call was answered by the called party, in the ISO 8601 format


mceclip0.png

 

User outbound call completion

 

Webhook event is triggered when an outbound call from a user has ended.  The following data is sent as JSON with the event;


(string) type - outbound_user_call_info
(string) unique_call_id - unique identifier of the call
(string) from_number - extension number of user making the call
(string) from_name - name of User object making the call
(string) to_number - number dialled by the user (DNID)
(string) call_start_at - date and time the call was started, in the ISO 8601 format
(int) call_duration - total call duration in seconds
(null|string) conversation_start_at - null or date and time the call was answered by the called party, in the ISO 8601 format
(int) conversation_duration - duration of the conversation in seconds


mceclip2.png

 

Queue call summary

 

Webhook event is triggered when call delivered via a queue object has ended.  The following data is sent as JSON with the event;


(string) type - queue_call_info
(string) unique_call_id - unique identifier of the call
(string) queue_name - name of Queue object that routed the call
(string) callerid - CallerID of caller (CLI)
(string) inbound_number - Dialed Number Identification (DNID)
(string) call_start_at - date and time when the call arrived at the queue, in the ISO 8601 format
(null|string) call_answered_at - null or date and time when the call was answered, in the ISO 8601 format
(null|string) call_finished_at - null or date and time when the call was completed, in the ISO 8601 format
(string) answered_by_user_name - name of User object who answered the call if applicable
(string) status - status of the call (answered|abandoned|timedout)


mceclip3.png

 

Ring group summary

 

Webhook event is triggered when call delivered via a ring group object has ended.  The following data is sent as JSON with the event;


(string) type - ring_group_call_info
(string) unique_call_id - unique identifier of the call
(string) ring_group_name - name of Ring Group object that routed the call
(string) callerid - CallerID of caller (CLI)
(string) inbound_number - Dialed Number Identification (DNID)
(string) call_start_at - date and time when the call arrived at the Ring Group, in the ISO 8601 format
(null|string) call_answered_at - null or date and time when the call was answered, in the ISO 8601 format
(null|string) call_finished_at - null or date and time when the call was completed, in the ISO 8601 format
(string) answered_by_user_name - name of User object who answered the call if applicable
(string) status - status of the call (answered|abandoned|timedout)


mceclip0.png

 

Voicemail

 

Webhook event is triggered when Voicemail is left.  There is an optional tick box when configuring this event to also receive the attachment of the MP3 file containing the messsage left.  The following data is sent as JSON with the event;

 

mceclip3.png



(string) type - voicemail
(string) unique_call_id - unique identifier of the call
(string) from_number - CallerID of caller (CLI)
(string) from_name - CNAM of caller if it exists
(string) time_of_call - date and time when the call arrived on the PBX, in the ISO 8601 format
(int) call_duration - total call duration in seconds
(int) call_duration_billable - duration of call after answering
(string) emails - emails configured on the Voicemail object to receive the messages, comma separated
(string) email_subject - email subject configured on Voicemail Object
(string) email_message - body of the email message sent.


mceclip2.png

 

Inbound call recording

 

Webhook event is triggered when an inbound call has completed recording.  There is an optional tick box when configuring this event to also receive the attachment of the MP3 file containing the recording.  The following data is sent as JSON with the event;


(string) type - inbound_recording
(string) unique_call_id - unique identifier of the call
(string) from_number - CallerID of caller (CLI)
(string) from_name - CNAM of caller if it exists
(string) to_number - Dialed Number Identification (DNID)
(string) to_name - name of User object that took the call
(string) time_of_call - date and time when the call arrived on the PBX, in the ISO 8601 format
(int) call_duration - total call duration in seconds
(int) call_duration_billable - duration of call after answering
(string) emails - emails configured on the recording object, comma separated
(string) email_subject - email subject configured on Recording Object
(string) email_message - body of the email message sent


mceclip0.png

 

Outbound call recording

 

Webhook event is triggered when an outbound call has completed recording.  There is an optional tick box when configuring this event to also receive the attachment of the MP3 file containing the recording.  The following data is sent as JSON with the event;


(string) type - outbound_recording
(string) unique_call_id - unique identifier of the call
(string) from_number - CallerID of caller (CLI)
(string) from_name - CNAM of caller if it exists
(string) to_number - Dialed Number Identification (DNID)
(string) to_name - name of User object that took the call
(string) time_of_call - date and time when the call arrived on the PBX, in the ISO 8601 format
(int) call_duration - total call duration in seconds
(int) call_duration_billable - duration of call after answering
(string) emails - emails configured on the recording setting for the user, comma separated
(string) email_subject - email subject configured on the user settings
(string) email_message - body of the email message sent


mceclip0.png

 

Webhook component event

 

This is a customised webhook event that is triggered when a webhook object is configured within the call flow. Headers can be configured on the object as required.  The object can be placed anywhere in the call flow to meet your specific requirements.


mceclip1.png


The following JSON data is sent with the webhook event;

 

(string) type - webhook_component_event
(string) unique_call_id - unique identifier of the call
(string) component_name - name configured on the Webhook object
(string) from_number - CallerID of caller (CLI)
(string) from_name - CNAM of caller if it exists
(string) exten - Dialed Number Identification (DNID)
(string) time_of_call - date and time when the call arrived on the PBX, in the ISO 8601 format


mceclip2.png