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 - user_inbound
(string) unique_call_id - unique identifier of the call
(string) caller_id - CallerID of caller (CLI)
(string) caller_name - CNAM of caller if it exists
(string) user_name- name of User object that is ringing
(string) user_number - Number of User object that is ringing
(string) dest_number - Phone number call was received on
(string) call_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


mceclip0.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 - user_inbound_answered
(string) unique_call_id - unique identifier of the call
(string) caller_id - CallerID of caller (CLI)
(string) caller_name - CNAM of caller if it exists
(string) user_name - name of User object that answered the call
(string) user_number - number of User object that is ringing
(string) dest_number - phone number call was received on
(string) call_start_at - date and time the call was started, in the ISO 8601 format
(string) connected_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


mceclip1.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 - user_inbound_completed
(string) unique_call_id - unique identifier of the call
(string) caller_id - CallerID of caller (CLI)
(string) caller_name - CNAM of caller if it exists
(string) user_name - name of User object that answered the call
(string) user_number - number of User object that is ringing
(string) dest_number - phone number call was received on
(string) call_start_at - date and time the call was started, in the ISO 8601 format
(string) connected_at - date and time the call was answered by the User, in the ISO 8601 format
(int) call_duration - total call duration in seconds
(int) conversation_duration - duration of the conversation in seconds
(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 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 - user_outbound
(string) unique_call_id - unique identifier of the call
(string) caller_id - CallerID of caller (CLI)
(string) user_name - name of User object that answered the call
(string) user_number - number of User object that is ringing
(string) dest_number - phone number call was received on
(string) call_start_at - date and time the call was started, in the ISO 8601 format


mceclip2.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 - user_outbound_answered
(string) unique_call_id - unique identifier of the call
(string) caller_id - CallerID of caller (CLI)
(string) user_name - name of User object that answered the call
(string) user_number - number of User object that is ringing
(string) dest_number - phone number call was received on
(string) call_start_at - date and time the call was started, in the ISO 8601 format
(string) connected_at - date and time the call was answered by the called party, in the ISO 8601 format


mceclip3.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 - user_outbound_completed
(string) unique_call_id - unique identifier of the call
(string) caller_id - CallerID of caller (CLI)
(string) user_name - name of User object that answered the call
(string) user_number - number of User object that is ringing
(string) dest_number - phone number call was received on
(string) call_start_at - date and time the call was started, in the ISO 8601 format
(string) connected_at - date and time the call was answered by the called party, in the ISO 8601 format
(int) call_duration - total call duration in seconds
(int) conversation_duration - duration of the conversation in seconds


mceclip4.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
(string) unique_call_id - unique identifier of the call
(string) caller_id - CallerID of caller (CLI)
(string) caller_name - CNAM of caller if it exists
(string) user_name - name of User object that answered the call
(string) user_number - number of User object that is ringing
(string) dest_number - phone number call was received on
(string) call_start_at - date and time the call was started, in the ISO 8601 format
(string) connected_at - date and time the call was answered by the User, in the ISO 8601 format
(int) call_duration - total call duration in seconds
(int) conversation_duration - duration of the conversation in seconds
(string) queue_name - name of Queue object that routed the call
(string) status - status of the call (answered|abandoned|timedout)


mceclip5.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
(string) unique_call_id - unique identifier of the call
(string) caller_id - CallerID of caller (CLI)
(string) caller_name - CNAM of caller if it exists
(string) user_name - name of User object that answered the call
(string) user_number - number of User object that is ringing
(string) dest_number - phone number call was received on
(string) call_start_at - date and time the call was started, in the ISO 8601 format
(string) connected_at - date and time the call was answered by the User, in the ISO 8601 format
(int) call_duration - total call duration in seconds
(int) conversation_duration - duration of the conversation in seconds
(string) ring_group_name - name of Ring Group object that routed the call
(string) status - status of the call (answered|abandoned|timedout)


mceclip0.png

 

Voicemail

 

Webhook event is triggered when Voicemail is left.  The following data is sent as JSON with the event;

(string) type - voicemail
(string) unique_call_id - unique identifier of the call
(string) caller_id - CallerID of caller (CLI)
(string) dest_number - phone number call was received on
(string) recorded_at - date and time when the voicemail was recorded, in the ISO 8601 format
(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.
(string) call_recording_link - Pending future development. Please use recordings to email feature and unique_call_id to match against webhooks


mceclip3.png

 

Inbound call recording

 

Webhook event is triggered when an inbound call has completed recording.  The following data is sent as JSON with the event;


(string) type - recording_inbound
(string) unique_call_id - unique identifier of the call
(string) caller_id - CallerID of caller (CLI)
(string) dest_number - phone number call was received on
(string) recorded_at - date and time when the call was recorded, in the ISO 8601 format
(string) emails - emails configured on the Voicemail object to receive the messages, comma separated
(string) email_subject - email subject configured on Recording Object
(string) call_recording_link - Pending future development. Please use recordings to email feature and unique_call_id to match against webhooks
(string) email_message - body of the email message sent.


mceclip2.png

 

Outbound call recording

 

Webhook event is triggered when an outbound call has completed recording.  The following data is sent as JSON with the event;


(string) type - recording_outbound
(string) unique_call_id - unique identifier of the call
(string) caller_id - CallerID of caller (CLI)
(string) user_name - name of User object that answered the call
(string) user_number - number of User object that is ringing
(string) dest_number - phone number call was received on
(string) recorded_at - date and time when the call was recorded, in the ISO 8601 format
(string) emails - emails configured on the recording setting for the user, comma separated
(string) email_subject - email subject configured on the user settings
(string) call_recording_link - Pending future development. Please use recordings to email feature and unique_call_id to match against webhooks
(string) email_message - body of the email message sent


mceclip4.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 HTTP Headers are sent with the webhook event, along with any additional headers defined on the webhook object;

x-pbx-token - The value defined in the Secret Token field on the webhook object

 

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) user_name - CNAM of caller
(string) user_number - CallerID of caller (CLI)
(string) dest_number - phone number call was received on
(string) call_start_at - date and time when the call arrived on the PBX, in the ISO 8601 format
(string) component_name - name configured on the Webhook object


mceclip5.png