API FAQs
Working with Gather Applet
6 min
this applet allows you to take numeric information from the user when they are pressing something on their keypads the information gathered can be used for mobile number input, order id verification etc along with the pass thru applet to process such information in real time and proceed with an appropriate set of actions with the user on call you can choose to configure the gather applet parameters using the flow builder itself or control it dynamically through a url however, you'll need to configure the transitions (next applet) while building the flow irrespective 1\ configure using flow builder play a prompt to the caller to enter the input specify key input behaviour 2 configure parameters dynamically by providing a url in case 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 gather 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 gather applet header exotel version this value will indicate the version of gather 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 dialled out in case of an incoming call, it’ll be set to the number where the call landed call status 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 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 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 dialled 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 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 into which the call came in the 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 “connected” 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 of the call as returned by the operators code numeric representation of the cause code 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 "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 gather application url the response will decide what parameters will be set while executing gather during the call flow response header content type application/json sample {"gather prompt" { "text" "hello kovalan, please provide your order id", },"max input digits" 5,"finish on key" "#","input timeout" 6,"repeat menu" 2,"repeat gather prompt" { "text" "it seems that you have not provided any input, please try again " }} explanation parameter type behaviour description gather prompt string mandatory url of the audio file or text which will be played out possible values { "audio url" "http //your endpoint com/test audio mp3" } or { "text" "please enter your mobile number" } max input digits integer optional; default = 255 a maximum number of digits which are expected by the user to be entered, after which the gather should end successfully finish on key string optional; default = # input key after which the gather should end successfully allowed ‘’ (empty string), 0 9, , # empty would mean there is no finish key if null or not set, it’ll take the default value # input timeout integer optional; default = 5 seconds time period in seconds between each key press within which the user has to enter another input key (first input included) repeat menu integer optional; default = 0 number of times menu has to be repeated if there is no input provided by the user repeat gather prompt string optional; default = gather prompt url or text to be played out if the menu is repeated i e in case repeat menu > 0 possible values { "audio url" "http //your endpoint com/test audio mp3" } or { "text" "please enter your mobile number" } above set of parameters can also be controlled through the dashboard if one opts to configure the gather applet using the flow builder instead of the application url note when mandatory params are missing, url is unresponsive (non 2xx) or type validation fails from both primary and fallback url (if set), it will go to url failure case if optional parameters are not passed in response, it will be set to default if both finish on key and max input digits are passed, whichever criteria are met first will occur i e if finish on key is pressed or max input digits is reached as per the user's input 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
🤔
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.