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 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, the person on call will have to wait for 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 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

Status of the call depending on what stage it is at.

Possible values: 'queued', 'ringing', 'in-progress', 'completed', 'busy', 'failed', 'no-answer', 'canceled'

Direction

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 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

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 case of an outgoing call, it is the number of 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 on which the call was made to.

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 previous applet was “connect”.

Possible values: 'completed', 'busy', 'no-answer', 'failed', 'canceled'

Legs

An array which 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, array’s length will be equal to total attempts.

  • CauseCode: Cause code enum of the call as derived from the ISDN cause code returned by the carriers. List of CauseCode can be found here

  • Cause: Numeric representation of the CauseCode. List of Cause 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 previous applet was "voicemail". It will contain the URL of the voicemail recording. There could be delay before the recording can be accessed depending on the length of the recording file.


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