Don’t wish to add your business partners/users as co-workers in Exotel but still want us to route customer calls only to available users? Sure, we’ve got you covered!
With our enhanced Voice APIs, you don’t have to worry about adding users as co-workers into our dashboard if you want us to stop customer calls being routed to users who may already be busy on another call. This benefit is in addition to the number masking for you to safeguard your customer’s identity, and prevent misuse of sensitive information, enabled by anonymization of customer’s phone number. For more details on number masking, please refer to this use case
This use case discusses the implementation framework through which you can route calls only to your available users, i.e. who are not in an active call via Exotel platform, without adding them on the Exotel dashboard
Exotel provides an API for making outbound calls where specifying the phone number of A (caller) and B (callee) will connect them over a phone call. This API first calls the A number (caller), a user working on your application/CRM. Once A picks up the call, another call is made to B (callee) resulting in a bridge. The resultant Caller Id will be the Virtual Number provided by Exotel, hence actual phone number is masked.
Exotel provides an API for handling incoming calls where you can build call flows using various applets. The CCM programmable version of the Connect applet enables the call flow to be configured. The call flow connects the caller (your customer) to a user (working on your application/CRM) along with additional parameters returned from your URL, which can be configured dynamically per call.
You pass the caller and callee numbers and Virtual Number to be connected to the Click to Call API in a POST request. The numbers are passed as A-party (‘from’) and B-party (‘to’) numbers which are the two distinct sides of the conversation (for example: relationship managers and their customers). The number of the user who is initiating the click to call should always be passed in the ‘from’ parameter. You can specify if you want Exotel to manage the state of that user’s number (busy, available etc.) by passing the attribute state_management as ‘true’ as per the API contract.
Apart from the parties’ numbers you can also pass other desired parameters like:
https://<your_api_key>:<your_api_token>@<subdomain>/v3/accounts/<your_sid>/calls
{ "from":{ "contact_uri":"xxxxx43026", "state_management":true }, "to":{ "contact_uri":"xxxxx16844" }, "recording":{ "record":true, "channels":"single" }, "virtual_number":"+91xxxx499102", "max_time_limit":4000, "attempt_time_out":45, "custom_field":"test_call", "status_callback":[ { "event":"terminal", "url":"https://webhook.site/aecd85dc-f959-48b5-abaf-d45189037e09" } ] }
In response to this request, Exotel will now place a call connecting both the parties via the Virtual Number.
{ "request_id":"5894a7b946f248e38a7e185b22d4d309", "method":"POST", "http_code":200, "metadata":null, "response":{ "code":200, "error_data":null, "status":"success", "call_details":{ "sid":"5e9ec1f6e4af55fe9c6d5e2ba00e16bn", "direction":"outbound", "virtual_number":"022xxxx9102", "state":"active", "status":null, "legs":"/v3/accounts/Exotel/calls/5e9ec1f6e4af55fe9c6d5e2ba00e16bn/legs", "created_time":"2022-11-23T11:44:39+05:30", "updated_time":"2022-11-23T11:44:39+05:30", "start_time":"2022-11-23T11:44:39+05:30", "end_time":null, "total_duration":null, "total_talk_time":null, "custom_field":"test_call", "app_id":null, "app_name":null, "digits":null, "recordings":null } } }
{ "request_id": "5894a7b946f248e38a7e185b22d4d309", "method": "POST", "http_code": 200, "metadata": null, "response": { "code": 200, "error_data": null, "status": "success", "call_details": { "sid": "5e9ec1f6e4af55fe9c6d5e2ba00e16bn", "direction": "outbound", "virtual_number": "022xxxx9102", "state": "active", "status": null, "legs": "/v3/accounts/Exotel/calls/5e9ec1f6e4af55fe9c6d5e2ba00e16bn/legs", "created_time": "2022-11-23T11:44:39+05:30", "updated_time": "2022-11-23T11:44:39+05:30", "start_time": "2022-11-23T11:44:39+05:30", "end_time": null, "total_duration": null, "total_talk_time": null, "custom_field": "test_call", "app_id": null, "app_name": null, "digits": null, "recordings": null } } }
{ "request_id": "d1ee94394086491b88ac3439508975cf", "method": "POST", "http_code": 400, "metadata": null, "response": { "code": 400, "error_data": { "code": 10725, "description": " to to.contact_uri is invalid", "message": "Invalid request body,failed parsing" }, "status": "failure", "call_details": null } }
curl -XGET "https://customerWebhook.com/ccm-programmable-connect?CallSid=07a971107d0f3ee459a21b90c0d616ba&Created=Thu%2C%2010%20Nov%202022%2012%3A18%3A36&CurrentTime=2022-11-10%2012%3A18%3A44&DialCallDuration=0&DialWhomNumber=&Direction=incoming&From=08516043026&StartTime=2022-11-10%2012%3A18%3A36&To=01135124157"
{ "fetch_after_attempt": false, "destination": [ { "contact_uri": "+91xxxxx43210" }, { "contact_uri": "sip:gauravjfb55d386" }, { "contact_uri": "+91xxxxx78763" } ], "state_management": true, "outgoing_phone_number": "xxxxx54123", "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" } }
Anytime during an ongoing call of after the call is over, you can get the details of the call or the different parties/legs associated with a call using the following APIs:
https://<your_api_key>:<your_api_token><subdomain>/v3/accounts/<your_sid>/calls/<call_sid>
https://<your_api_key>:<your_api_token><subdomain>/v1/Accounts/<your_sid>/Calls
https://<your_api_key>:<your_api_token><subdomain>/v3/accounts/<your_sid>/calls/<callSid>/legs
There are three SKUs under this solution: