Calls
Answered/Ringing event in CRM
8 min
today exotel gives status callbacks when the call reaches terminal event when used for outbound connecting two numbers and when used in connect applet exotel gives status callback for dial and terminal event now exotel powers answered and ringing event as an intermediate state when the agent/customer is ringing or picking up the call so that more definitive action can be taken on the call in the crms ( like assigning a ticket to the agent, etc ) how to get answered event in crm 1\ using connect applet the agent pass through is a part of the 'connect' applet when configured with a url, exotel will pass on to that url details of the agent who is currently being called it makes a get request to the url with the following query parameters parameter name value callsid string; unique identifier of the call callfrom string; the number of the calling party callto string; the callerid the customer had called to this will be the exotel vn associated with the flow direction string; this is the direction of the call for connect applet, this shall say "outbound dial" created time; the time when the event created from string; the number of the calling party to string; the callerid the customer had called to this will be the exotel vn associated with the flow currenttime time; time when the event was fired dialwhomnumber string; this is the agent's number being dialed by exotel for this attempt status busy/free this is sent as 'busy' when the above agent is being called it is sent as 'free' when the call to the above agent ends (either the call ends, the call didn't go through, or the agent didn't pick up the phone) eventtype string, this shall have values of " dial", "ringing", "answered", "terminal" note to get answered event in the connect applet, this needs to be enabled by exotel for your account 2\ using outbound api connecting agent to customer note please refer to this to understand the connect api in detail https //developer exotel com/api/#call agent https //developer exotel com/api/#call agent while using the api, one can subscribe now for more event types and specify in the below parameter in the api request statuscallback optional string; an http post request will be made to this url depending on what events are subscribed using ‘statuscallbackevents’ refer here to the complete list of parameters that will be sent to your endpoint statuscallbackevents new optional array; call events for which we will send details to the url as set in the ‘statuscallback’ parameter can be terminal this event will be triggered once the call is over answered this event will be triggered for each leg of the call ringing this event will be triggered for each leg of the call if no event is specified, we will send the default parameters as specified here when the answered event is subscribed, the exotel platform shall send a post request to the status callback url a sample request for connecting two numbers via api with the answered event curl x post 'https //\<your api key> \<your api token>@api exotel com/v1/accounts/\<your account sid>/calls/connect json?from=\<from no>\&to=\<to number>\&statuscallback=\<your url endpoint>\&statuscallbackevents\\\[0\\]=terminal\&statuscallbackevents\\\[1\\]=answered' a sample post request when the first leg is answered { 	"callsid" "xxxxxxxxxxxxxxxx", 	"eventtype" “answered", 	"datecreated" "2019 04 08 03 17 59", 	"dateupdated" "2019 04 08 03 18 35", 	"eventtime" "2019 04 08 03 18 35", 	"status" "no answer", 	"to" "+91886799xxxx", 	"from" "+91941374xxxx", 	"phonenumbersid" "0113083xxxx", 	"starttime" "2019 04 08 03 17 59", 	"endtime" "null", 	"direction" "outbound api", 	"recordingurl" null, 	"conversationduration" 32, 	"legs" \[ 	 { 	 "oncallduration" null, 	 "status" "in progress" 	 }, 	 { 	 "oncallduration" null, 	 "status" "null" 	 } 	] } a sample example when the second leg is answered { 	"callsid" "xxxxxxxxxxxxxxxxxxxxx", 	"eventtype" “answered", 	"datecreated" "2019 04 08 03 17 59", 	"dateupdated" "2019 04 08 03 18 35", 	"eventtime" "2019 04 08 03 18 35", 	"status" "no answer", 	"to" "+91886799xxxx", 	"from" "+91941374xxxx", 	"phonenumbersid" "0113083xxxx", 	"starttime" "2019 04 08 03 17 59", 	"endtime" "null", 	"direction" "outbound api", 	"recordingurl" null, 	"conversationduration" 32, 	"legs" \[ 	 { 	 "oncallduration" null, 	 "status" "in progress" 	 }, 	 { 	 "oncallduration" null, 	 "status" "in progress" 	 } 	] } a sample request for connecting two numbers via api with a ringing event curl x post 'https //\<your api key> \<your api token>@api exotel com/v1/accounts/\<your account sid>/calls/connect json?from=\<from no>\&to=\<to number>\&statuscallback=\<your url endpoint>\&statuscallbackevents\\\[0\\]=terminal\&statuscallbackevents\\\[1\\]=ringing' a sample example is when the first leg is ringing { 	"callsid" "09c14403fb2a31097ba5ed64f9251646", 	"eventtype" "ringing", 	"datecreated" "2022 04 06 10 44 40", 	"dateupdated" "2022 04 06 10 44 41", 	"status" "in progress", 	"to" "08780296135", 	"from" "07874762218", 	"phonenumbersid" "08044556678", 	"starttime" "2022 04 06 10 44 41", 	"endtime" null, 	"eventtime" "2022 04 06 10 44 41", 	"direction" "outbound api", 	"recordingurl" null, 	"conversationduration" null, 	"legs" \[ 	 { 	 "oncallduration" null, 	 "status" "in progress" 	 }, 	 { 	 "oncallduration" null, 	 "status" null 	 } 	] } a sample example is when the second leg is ringing { 	"callsid" "09c14403fb2a31097ba5ed64f9251646", 	"eventtype" "ringing", 	"datecreated" "2022 04 06 10 44 40", 	"dateupdated" "2022 04 06 10 44 46", 	"status" "in progress", 	"to" "08780296135", 	"from" "07874762218", 	"phonenumbersid" "08044556678", 	"starttime" "2022 04 06 10 44 44", 	"endtime" null, 	"eventtime" "2022 04 06 10 44 46", 	"direction" "outbound api", 	"recordingurl" null, 	"conversationduration" null, 	"legs" \[ 	 { 	 "oncallduration" null, 	 "status" "in progress" 	 }, 	 { 	 "oncallduration" null, 	 "status" "in progress" 	 } 	] } a sample example of terminal statuscallback with ringing duration { 	"callsid" "054cfcd8910389ff64882d8e25211646", 	"eventtype" "terminal", 	"datecreated" "2022 04 06 10 48 00", 	"dateupdated" "2022 04 06 10 48 16", 	"status" "completed", 	"to" "08780296135", 	"from" "07874762218", 	"phonenumbersid" "08044556678", 	"starttime" "2022 04 06 10 48 04", 	"endtime" "2022 04 06 10 48 16", 	"eventtime" "2022 04 06 10 48 16", 	"direction" "outbound api", 	"recordingurl" "https //s3 us west 2 amazonaws com/exotel us3 recordings/ree5e1us3/054cfcd8910389ff64882d8e25211646 mp3", 	"conversationduration" 6, 	"legs" \[ 	 { 	 "oncallduration" 12, 	 "ringingduration" 4, 	 "status" "completed" 	 }, 	 { 	 "oncallduration" 6, 	 "ringingduration" 3, 	 "status" "completed" 	 } 	] } note the ringing event is dependent on the operator and it may not be reported if the operator doesn't provide it in certain cases if the ringing event is not available then the ringduration is set as 0 how to get this enabled for an account? you can raise a request with hello\@exotel com or reach out to your account managers in exotel to enable this feature in your account
🤔
Have a question?
Our knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.