API FAQs
Play dynamic text or audio from URL in connect applet
3 min
what is usual? typically, while configuring your connect applet, you would enter the text or upload the audio that you want your agents to listen before the call gets connected to the customer this is static in nature ie, all your agents will hear the same message / audio how to make it dynamic? in exotel, you have an option to make this dynamic ie, you can potentially play a different greeting to each agent in the connect applet, you can specify a url (instead of a static text) in the "read text like a robot" option see below choose this option if you want to control playback for each user uniquely choose this option if you want to have a static playback when the option is chosen for url, exotel will make an http get request to that url (which is hosted at your server) your server can now return either a text or a url (to an audio file) if it returns a text, the text will be converted to audio using our text to speech (tts) engine and then played out the applets mentioned above are a part of the custom app section also called app builder, to know more about app builder please follow > exotel app builder http request from exotel (to your url) the get request that exotel makes to the url will have the following query parameters parameter name value callsid string; unique identifier of the call from string; the number of the calling party to string; your exotel company number that is being called; this will be from your "company numbers" page dialwhomnumber string; the number that is being called currently (this might be empty also) http response from your web server your webserver must set the content type http header to ' application/json and nothing else must support a head request from exotel and return the exact same headers that it would for a get request the response will look something like { "start call playback" { "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" } “in call playback { “start delay” 5, “repeat frequency” 10, “play to callee”\ true, “play to caller”\ false, “type” “audio url”, “value” “http // mp3” or “type” “text”, “value” “hello, this is a sample text” } “end call playback” { “type” “audio url”, “value” “http // mp3” or “type” “text”, “value” “hello, this is a sample text” } } one can choose to give only start call playback or in call playback or end call playback and accordingly the audio will be played to users note if the customer backend fails to respond to the get request and exotel receives 4xx or 5xx responses, then the audio will not be played to the user, and connect applet will proceed and patch the call between callee and caller the audio files must be in the wav/ mp3, 8khz mono format the bit depth must be 16 bit note all other formats are not supported (like 16kz mono/stereo etc) caching of the audio files exotel caches the audio files that it downloads and plays so that the next time you send the same file, we don't need to download and it will be faster exotel caches the file based on the name of the url so in case you are changing first audio wav, you will need to send in another name the next time (ex http //example com/first audio new\ wav)
🤔
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.