API FAQs
Working with Passthru Applet
4 min
using the passthru applet in the call flow you can get exotel to talk to your application url and pass on details about the call as and when it happens your application can now process this information and decide which path (success/failure) the flow should take next this applet helps to dynamically control the flow as well as store the call details in your crm system or other applications the passthru applet passes the call details to the url configured it makes a get request to the url with the call details as url encoded http query parameters passthru can be used in 2 modes (by toggling the checkbox to 'make passthru async') sync exotel will immediately pass the call details synchronously during the call flow execution in this case, it is possible only to make a binary decision with passthru for example, you can return back a "200 ok" for choice a and "302 found" for choice b read more about http response codes here please note, that the person on call will have to wait for the next action to be executed until your url responds back async exotel will asynchronously pass the call details without interrupting the call flow execution use this option if you don’t want to dynamically change flow execution i e select the next applet based on passthru response this will ensure the person on call doesn’t wait for the time period it takes for passthru to be executed i e your url to respond back the following are the query 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 pass through applet query parameters parameter name description callsid unique identifier of the call callfrom in case of an outgoing call, it’ll be set to the number from which the call is made in case of an incoming call, it’ll be set to the number from which the call is received callto in case of an outgoing call, it’ll be set to the number being dialed out in case of an incoming call, it’ll be set to the number where the call landed callstatus the status of the call depends on what stage it is at possible values 'queued', 'ringing', 'in progress', 'completed', 'busy', 'failed', 'no answer', 'canceled' direction the direction of the call possible values ‘incoming’ or ‘outbound dial created timestamp when the call is created dialcallduration value in seconds from the time the call is triggered to the second leg of the call till it is over (including conversation time) this value can be set to zero depending on the previous applet and if there’s no second leg in the call flow starttime timestamp when the call is started endtime 1970 01 01 05 30 00 // unix time (also known as posix time or epoch time) note that this would be a constant value and you may instead trigger our call details api a few minutes after the call has been completed to get accurate information calltype scenario value ivr only, no connect applet call attempt call conversation happened completed the client hung up during connect applet client hangup connect applet, no agent picked up incomplete went to voicemail applet voicemail dialwhomnumber displays the number of the agent who was dialed to last from in case of an incoming call, it is the number of the caller in the case of an outgoing call, it is the number of the first leg of the call to in case of an incoming call, it is the exophone on which the call landed in case of an outgoing call, it is the number to which the call was made currenttime current server time (format yyyy mm dd hh\ mm\ ss) these parameters will be passed if certain conditions are met as described below parameter name description dialcallstatus this will denote what happened with the second leg of the call if the previous applet was “connect” possible values 'completed', 'busy', 'no answer', 'failed', 'canceled' legs an array that will denote detailed information about each leg attempt if the previous applet was “connect” sample legs\[0]\[causecode]=normal clearing legs\[0]\[cause]=16 legs\[0]\[type]=single legs\[0]\[oncallduration]=21 legs\[0]\[number]=07200498123 meaning legs\[i] i denotes the index of the attempt in the connect applet if there are multiple numbers attempted, the array’s length will be equal to the total attempts causecode cause code enum of the call as derived from the isdn cause code returned by the carriers a list of causecode can be found here cause numeric representation of the causecode a list of causes can be found here type single or parallel oncallduration time spent by the leg on call this value could be 0 if there was no conversation with the attempted leg number phone number of the attempted leg digits ‘digits’ will be passed if there was a 'gather' or ‘ivr’ applet before this applet and will be equal to the input digits that were entered note this parameter comes with a double quote (") before and after the number you'll have to trim() this parameter for double quotes (") to get the actual digits customfield if the call was initiated via api, the value that was passed in customfield in the api call will be set here recordingurl this will be populated if the previous applet was "connect" or "voicemail" it will contain the url of the conversation in the connect applet (if enabled) or voicemail recording there could be a delay before the recording can be accessed depending on the length of the recording file outgoingphonenumber this will be populated if the previous applet was “connect” it indicates which exophone (virtual number) was used to dial out in the connect applet deprecated parameters the following parameters have been deprecated and are no longer supported some of these values might be passed inadvertently and applications should not rely on them anymore recordingavailableby forwardedfrom processstatus tenant id flow id samples responses for different scenarios 1\) sample response for a completed call where the previous applet is a connect applet with recording url 2\) sample response for a completed call where previous applet is a gather/ivr applet 3\) sample response for a completed call where the call was initiated via an api, with the value that was passed in customfield of the api request note the response you get from passthru cannot be customised however, you can add a custom field only via the outgoing call to connect number to a call flow api looking to streaming metadata using passthru? learn how to receive stream metadata post call, link here
🤔
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.