Short video:
CCM programmable connect is our call centre version of connecting customers with users by returning the phone number of the user dynamically via a webhook. Using CCM programmable connect will ensure your users are marked busy while they are on another call such that no other call (incoming or outgoing) is routed to them until they are free. Such users need not be mandatorily created on Exotel via the dashboard or using APIs.
If this feature is enabled for your account you would see the option as shown above.
You can choose to configure the Connect applet parameters using the flow builder itself or control it dynamically through a URL. However, you'll need to configure the transitions (next applet) while building the flow irrespective.
If you choose to configure the parameters dynamically using your application URL, you can set a ‘Primary URL’ for handling the requests. You can also set a ‘Fallback URL’ (optional) which will be contacted in case something goes wrong with your ‘Primary URL’.
Request
If an application URL is set for Connect applet, Exotel will make a GET request to the URL with the call details as URL-encoded HTTP query parameters.
The following are the parameters of the GET request. Note that only some of this list may be passed to your application - depending on what stage of the flow you have placed the Connect applet.
Header:
exotel-version | This value will indicate the version of connecting applet parameters against which your endpoint’s response will be validated. Current Version: 1.1 |
Query Parameters:
*These parameters will be passed if certain conditions are met as described below:
Response
This is the response Exotel will expect to the GET request from your Connect Application URL. The response will decide what parameters will be set while executing Connect during the call flow.
Response Header:
Content-Type | application/JSON |
Sample
{ "fetch_after_attempt": false, "destination": [ { "contact_uri": "+9198765xxxxx" }, { "contact_uri": "sip:gauravjfb55d386" }, { "contact_uri": "+9197864xxxxx" } ], "state_management": true, "outgoing_phone_number": "90876xxxxx", "sticky_agent": false, "recording": { "record": true, "channels": "single" }, "max_ringing_duration": 30, "max_conversation_duration": 900, "music_on_hold": { "type": "default_tone" }, "parallel_ringing": { "activate": true, "max_parallel_attempts": 5 }, "call_event_passthru_url": "http://dial_passthru_event_url.com", "start_call_playback": { "type": "text", "value": "hello, this is a sample text" } }
Explanation:
Parameter | Mandatory/Optional | Description |
fetch_after_attempt | Optional; | This parameter will indicate if, after each unsuccessful dial attempt within connect, the parameters should be fetched again including destination numbers.
NOTE: If 2 subsequent fetch results contain exactly the same set of destination numbers, Exotel will not make any subsequent attempts even if fetch_after_attempt is set to true. Request: |
destination | Mandatory | Array of JSON block
If any SIP URI is provided, state_management parameter value will be ignored and state management will be done by default. If any contact_uri is already added to the Exotel dashboard as a user number, state_management parameter value will be ignored and state management will be done by default. Ex: "destination": [ { "contact_uri": "+9198765xxxxx" }, { "contact_uri": "sip:gauravjfb55d386" }, { "contact_uri": "+9197864xxxxx" } ] *The dial will happen in the order they appear in the array. |
state_management | Optional; default = false | Allows the state management to be done on the ‘destination’ numbers. Can be:
|
outgoing_phone_number | Optional; | ExoPhone is to be used for dialing out in E.164 format.
NOTE: If ExoPhone is not present in your account ExoPhone is unable to dial out i.e. if the above validation fails, then the call would be dial-ed out using the same ExoPhone as the first leg (where the incoming call landed). |
sticky_agent | Optional; default = false | true/false, enable sticky agent mapping if set to true |
recording | Optional | JSON block containing the recording related attributes. Currently these are record and channels.
Ex; { "recording": { "record": true, "channels": "single" } } |
max_ringing_duration | Optional; | Value in seconds to limit the ringing duration. This can be increased up to 60 seconds. |
max_conversation_duration | Optional; | Value in seconds to limit the conversation duration. This can be increased up to 75 minutes (4500 s). |
music_on_hold | Optional; | Possible Values:
Sample Values: { “type”: “default_tone” } { “type”: “operator_tone” } { "type": "custom_tone", "value": "<audio_url>" } |
parallel_ringing | Optional; | Use this option to dial the numbers in parallel (simultaneously). This will dial all the numbers returned under the destination parameter. "parallel_ringing": { "activate": true, "max_parallel_attempts": 10 } |
call_event_passthru_url | Optional; | The URL passed here will be used to send the details for dial, ringing, answered and terminal events. Sample response that will be sent to the call_event_passthru_url: { "event_details": { "event_type": "terminal" }, "call_details": { "call_sid": "6518aba3264320d7bf8583fa6d8516bg", "direction":"incoming", "from": "08516043026", "to": "9968654311", "virtual_number": "01135124160", "created_time": "2022-11-16T00:19:02+05:30", "current_time": "2022-11-16T00:19:12+05:30", "status": "free" } } Note: 'ringing' and 'answered' events can be enabled for select accounts only. If you wish to subscribe to these two events, please raise a request via [email protected]. |
start_call_playback | Optional; | Play a recording to the number that is being called “type”: “audio_url”, “value”: “http://...mp3” } OR { “type”: “text”, “value”: “hello, this is a sample text” } Configuration for audio files supported in this playback are: Sample Rate = 8 kHz Bit depth = 16 bit Bit rate = 128 kbps Channel = mono File Format = wav |
Cases, where the Fallback URL will be triggered, are:
The primary URL does not return HTTP 200 OK
The primary URL doesn’t return within the timeout period (5 seconds)
Primary URL returns invalid response:
Content-Type should be application/JSON
Mandatory parameters are present
audio_url / text should be HTTP/HTTPS and returns 200 HTTP code
Transition to the next applet
The below transitions are to be set in the call flow builder to decide what to execute next.
Scenarios:
After the call conversation ends: The applet set here will be triggered if a conversation occurs.
If nobody answers: The applet set here will be triggered if we dial the number and a conversation doesn’t occur. If no applet is present in "we didn't dial anyone", it will fall back to this.
We didn’t dial anyone: The applet set here will be triggered if we don’t dial. Cases when this can occur:
If both the Primary and Fallback URL endpoint times out or returns a non-2xx response code.
If both the Primary and Fallback URL endpoint doesn’t return a valid payload.
If the number to dial returned is in invalid format.
If an empty number (destination) is returned in the response
- Invalid phone number of a user which doesn't exist
- The user device is unverified, if the user is added in Exotel
- The user device is OFF (available = false) in Exotel, if the user is added in Exotel
- The number is busy on another call (Incoming or Outgoing) going through Exotel where state_management was requested
If you have any questions or concerns, please connect with us using the chat widget on your Exotel Dashboard or Whatsapp us on 08088919888.