API FAQs
Programmable Connect: Working with Connect Applet (Dynamic URL)
5 min
you can choose to configure the connect applet parameters using the flow builder itself or control it dynamically through a url however, you will 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 connect applet parameters against which your endpoint’s response will be validated current version 1 0 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 direction the direction of the call possible values ‘incoming’ or ‘outbound dial’ created timestamp when the call is created (format yyyy mm dd hh\ mm\ ss) dialcallduration value in seconds from the time 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 (format yyyy mm dd hh\ mm\ ss) 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 the 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 shows the number of the agent who was dialed to last flow id flow id associated with the call 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 the first leg of the call to in case of an incoming call, it is the exophone into which the call came 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' 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 "voicemail" it will contain the url of the voicemail recording there could be a delay before the recording can be accessed depending on the length of the recording file 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" { "numbers" \["+919812345678"] }, "outgoing phone number" "+918047115777", "record" true, "recording channels" "dual", "max ringing duration" 45, "max conversation duration" 3600, "music on hold" { "type" "operator tone" }, "start call playback" { "playback to" "both" "type" "text", "value" "this text would be spoken out to the callee" }} generic explanation parameter mandatory/optional description fetch after attempt optional; default = false this parameter will indicate if, after each unsuccessful dial attempt within connect, the parameters should be fetched again including destination numbers `false` will indicate, dial attempt to happen based on the initial response no subsequent hits to the url `true` will indicate if connect parameters including a number to dial should be fetched again (hit the configured url again) if the dial attempt is unsuccessful 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 get /\<customer url> apart from standard request params, it’ll include \<connect> params from the previous dial attempts response \<same as above> destination mandatory indicates the destination(s) to dial out numbers an array of numbers to be dialed out in e 164 format the dial will happen in the order they appear in the array sample “destination” { “numbers” \[“+622131921111”, “+622131921112”] } outgoing phone number optional; default = incoming exophone exophone to be used for dialing out in e 164 format validations the exophone added should be present in your account restrictions will depend on telecom regulations i e another call can only be dial ed out from the same telecom circle/region for example, outgoing exophone cannot be set to delhi where incoming exophone is in bangalore both the first leg and the second leg exophones can be connected on the same server note if exophone is not present in your account or the 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) note consult with exotel support to use this feature record optional; default = false true/false; record the call or not recording channels optional; default = single to record the caller and callee in separate channels in the recording file possible values single dual max ringing duration optional; default = 30 value in seconds to limit the ringing duration this can be increased up to 60 seconds max conversation duration optional; default = 900 (15 minutes) value in seconds to limit the conversation duration to this can be increased up to 75 minutes (4500 s) music on hold optional; default = default tone possible values default tone exotel default music on hold as present here operator tone audio returned by the operator on the dialing channel as is custom tone audio url as provided in the response 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" 5 } max parallel attempts value can be between 1 10 default 5 please note this feature is chargeable and consult with your account manager or email to hello\@exotel in before using this parameter dial passthru event url optional; the url passed here will be requested for dial start and dial end events for more details on request, refer to this start call playback optional; play a recording to the number that is being called { “playback to” “both”, “type” “audio url”, “value” “http // mp3” } or { “playback to” “both”, “type” “text”, “value” “hello, this is a sample text” } or { “playback to” “callee”, “type” “audio url”, “value” “http // mp3” } or { “playback to” “callee”, “type” “text”, “value” “hello, this is a sample text” } configuration for audio file supported in this playback are sample rate = 8 khz bit depth = 16 bit bit rate = 128 kbps channel = mono file format = wav note if the file name returned in case of `audio url` is the same, it will be cached by our servers kindly, provide dynamic file names if the audio to be played is different each time above set of parameters can also be controlled through the dashboard if one opts to configure the connect applet using the flow builder instead of the application url cases, where fallback url will be triggered, are primary url does not return http 200 ok 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 next applet 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 conversation doesn’t occur if no applet is present in "we didn't dial anyone", it will fallback 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 primary and fallback url endpoint times out or returns non 2xx response code if both 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
🤔
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.