Send Events (WebHook)¶
The webservice will be called by While1 Voice on the events below, on the URL set in Edit project, the Send Event API URL (webhook) field. Several URLs can be set, separated by ||. The webservice's response must have header 200 (or 201); the content is not checked.
Events are sent only if the project is connected via API (Caller Info API) with a type that supports webhooks: Generic, iStoma or Soap.
Events are sent for the following types of actions:- Answer Events (queue_answer, queue_answer_end, dial_answer, call_forward_answer)
- Outgoing Calls (dialout_answer, outgoing_end)
- Missed Calls (missed_calls)
GET or POST method¶
- GET (default): the parameters are added to the URL, as in the examples below. With the API parameter event_prefix (e.g. event_prefix=ctk_) a prefix is added to all parameters (e.g. ctk_event, ctk_telephone).
- POST: the data is sent as form-data (application/x-www-form-urlencoded), with the keys event_type (the event type) and event_data (array with the same parameters as for GET, without event). If the Include raw data with Send Event (webhook) parameter is enabled (Settings :: Parameters, AGI group), event_data also contains raw_data (all the call data), and events of type external_calls, recording_consent, send_recording, custom_email, fax_tx are also sent.
1. Answer Events¶
URL Example:
http://example.com/api/while1voice_ev?event=queue_answer&direction=IN&project_id=1&agent=test-user&remote_number=&telephone=0700000000&dnid=0300000000&dnid_identifier=&contact_id=&queue=callcenter-queue&uniqueid=1234567890.12Sent parameters (GET method):
- event => it can be: queue_answer (answered in queue), queue_answer_end (end of a call answered in queue), dial_answer (answer to a direct call to a user) or call_forward_answer (answer to a forwarded call)
- direction => IN
- project_id => external identifier of the project
- agent => the user who answered the call
- remote_number => the external mobile number that answered the call (fallback_number or remote_agent)
- telephone => caller's number
- dnid => the dialed number
- dnid_identifier => PBX :: Inbound routes :: Edit route - External identifier
- contact_id => the ID provided by the Caller Data Retrieval Webservice
- queue => the name of the called queue
- uniqueid => unique call ID
2. Missed calls¶
URL Example:
http://example.com/api/while1voice_ev?event=missed_calls&project_id=123&queue=test-queue&queue_hold_time=1&telephone=0700000000&dnid=0210000000&dnid_identifier=&contact_id=123456&fail_reason=queue_hangup&explain_reason=&uniqueid=1234567890.12Sent parameters (GET method):
- event => it can be: missed_calls
- project_id => external identifier of the project
- queue => the queue name
- queue_hold_time => the waiting time in the queue, in seconds
- telephone => caller's number
- dnid => the dialed number
- dnid_identifier => PBX :: Inbound routes :: Edit route - External identifier
- contact_id => the ID provided by the Caller Data Retrieval Webservice
- dnid_description => the description of the number in the Inbound route
- ivr_menu_id => the ID of the IVR menu, if the call went through an IVR
- fail_reason => the reason for the missed call (e.g. queue_hangup, forward_hangup, no_schedule, queue_busy)
- explain_reason => the explanation for fail_reason (the status of the queue or of the call)
- uniqueid => unique call ID
3. Outgoing calls¶
URL Example:
http://example.com/api/while1voice_ev?event=outgoing_end&direction=OUT&project_id=123&agent=test-user&telephone=0700000000&dnid=0210000000&dnid_identifier=&contact_id=123456&dialstatus=BUSY&external_id=ticket-123&external_info=CRM+Call&duration=8&uniqueid=1234567890.12Sent parameters (GET method):
- event => it can be: dialout_answer (answer to the outbound call) or outgoing_end (end of the outbound call)
- direction => OUT
- project_id => external identifier of the project
- agent => the user who made the call
- telephone => the called number
- dnid => the number the call was made from
- dnid_identifier => PBX :: Inbound routes :: Edit route - External identifier
- contact_id => the ID provided by the Callee Data Retrieval Webservice
- dialstatus => the call status (e.g. ANSWER, BUSY, NOANSWER, CANCEL, CONGESTION); only for outgoing_end
- external_id => external ID sent to API - OriginateCall, from Call Queue or returned by the Caller Data Retrieval Webservice; empty if not available
- external_info => external info sent to API - OriginateCall (e.g. the CRM record type); for calls started from While1 Voice it can be crm or dialer; empty if not available
- duration => call duration in seconds (talk time if answered, otherwise the dialing time); only for outgoing_end
- uniqueid => unique call ID
Available in other languages: RO