What is usual?
Typically, while configuring your app, you would enter the text or upload the audio that you want your callers to listen. This is static in nature - ie, all your callers will hear the same message / audio. And whenever you want to change it
How to make it dynamic?
In Exotel, you have an option to make this greeting dynamic - ie, you can potentially play a different greeting to different callers.
In the Greeting (or Menu) applet, you can specify a URL (instead of a static text) in the "Read text like a robot" option. See below.
When the text box contains a URL, Exotel will make a 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 out Text-To-Speech (TTS) engine and then played out.
The applets mentioned above are a part of 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:
|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 web server
- MUST set the Content-Type HTTP header to 'text/plain' and nothing else.
- MUST support a HEAD request from Exotel and return the exact same headers that it would for a GET request.
In case you want to read out a text,
- The HTTP response body must contain the text to be read out in plain English - and nothing else. Such as this:
Thanks for calling Super Kart. Your order has already been shipped. It will reach you in 2 to 3 business days.
In case you want to play an audio
- The HTTP response body must contain the URL of the audio file (one per line). Such as this:
- The Audio files MUST be in the .wav, 8Khz Mono format. The bit depth must be 16 bit.