Whenever incoming call is received on DID number and call comes to server, you just need to generate appropriate response mentioned below as per your need. Every DID number is associated with unique incoming URL, so when call comes to server it will hit that URL to get JSON response and call will be driven accordingly.

Web hook JSON responses:

1. Say
Generate below response for simply announcing dynamic text.

{"response": {"app": "say","refresh": "1","text": "Welcome to Open source communications. Here we are developing cloud communication platform for the enterprises, Thank you!","voice":"Joanna ","repeat":"2","volume":"soft","rate":"slow","pitch":"medium","language_code":"enUS","tts_engine_type":"neural"}}

Here, in the above response there are some parameters. Below are the descriptions for every
parameter.
app: Name of the application which you want to run.
text: The message which you want to announce dynamically with TTS
voice: This is voice id, like male, female voices.
repeat: Number of times the announcement should be played
volume: Provide volume value. Allowed values: ‘silent’, ‘x-soft’,’soft’, ‘medium’, ‘loud’, ‘x-loud’
rate: Provide rate of speed of announcement. Allowed value: ‘x-slow’, ‘slow’, ‘medium’, ‘fast’,
‘x-fast’
pitch: Provide pitch type. Allowed values: ‘x-low’, ‘low’, ‘medium’, ‘high’, ‘x-high’
language_code: Provide language code like ‘en-US’, ‘hi-IN’ in which you want to announce.
tts_engine_type: Allowed values are ‘standard’ and ‘neural’. Neural type is more likely to
human voice

2. Play
Generate the response below to simply play the given file, available via public url.

{"response": {"app":"play","url":"https://public_url/my_file.mp3","refresh":"1"}}

Here, in the above response there are some parameters. Below are the descriptions for every
parameter.
app: Name of the application which you want to run.
url: Publicly accessible url of mp3 file to be played

3. Collect
Generate below response to announce dynamic text and collect user’s DTMF inputs while announcing.
Once the required number of digits are received, it will hit the action url and post the received dtmf
input, that you can use to decide what next action needs to be taken.

DYNAMIC ANNOUNCEMENT:

{"response": {"app": "collect","refresh": "1","text": "Thank you for calling XYZ Bank. For English, press one. For Hindi Press two.","action":"http://localhost:80/api/process_digits_hindi_english_demo?invalid_attempts=0","timeout":"3","attempts":"3","numdigits":"1","voice":"Joanna","volume":"soft","rate":"slow","pitch":"medium ","language_code":"en-US","tts_engine_type":"neural"}}

ANNOUNCEMENT BY RECORDED PROMPT:

{"response": {"app": "collect","refresh": "1","play_url": "https://cpaasdev.s3.ap-south1.amazonaws.com/quality_training8khz.wav","action":"http://localhost:80/api/process_digits_hindi_english_demo?invalid_attempts=0","timeout":"3","attempts":"3","numdigits":"1"}}

Here, in the above response there are some parameters. Below are the descriptions for every
parameter.
app: Name of the application which you want to run.
text: The text which you want to announce dynamically with TTS and then wait for collecting
DTMF inputs from user.
play_url: The prerecorded voice prompt public url
action: The webhook url on which the pressed digits will be posted
timeout: Number of seconds to wait for collection DTMF inputs
attempts: Number of attempts to ask for press options when no input received
numdigits: Total number of DTMF digits to accept, after that action url will hit
voice: This is voice id, like male, female voices.
volume: Provide volume value. Allowed values: ‘silent’, ‘x-soft’,’soft’, ‘medium’, ‘loud’, ‘x-loud’
rate: Provide rate of speed of announcement. Allowed value: ‘x-slow’, ‘slow’, ‘medium’, ‘fast’,
‘x-fast’
pitch: Provide pitch type. Allowed values: ‘x-low’, ‘low’, ‘medium’, ‘high’, ‘x-high’
language_code(optional): this will be the language code for TTS, default is en-US
tts_engine_type(optional): as of now this parameter can accept values ‘standard’ and ‘neural’
the default one is ‘standard’. The neural type sounds more like human then standard

4. Dial Number
Generate the response below to dial and connect external mobile numbers.

{"response": {"app": "dial_number","refresh": "1","numbers": "91997912XXXX,91998912XXXX","action":"http://localhost:80/api/dial_number_action","timeout":"60", "recording_option":"on","transcript":"on","live_transcript":"off","caller_id":"91998222XXXX","announce_caller_side":"quality_training-8khz","announce_callee_side":"quality_training-8khz"}}

Here, in the above response there are some parameters. Below are the descriptions for every
parameter.
app: Name of the application which you want to run.
numbers: Comma separated string of mobile numbers with country code
action: Hit this action URL in case of NOANSWER, BUSY, CHANUNAVAIL dial statuses.
timeout: Rings the dialed numbers till the given amount of timeout. Default is 60 seconds.
recording_option: allowed values are “on” or “off” for the call recording. Default is “off”
transcript: allowed values are “on” or “off” for the call transcription. The default is “off”
live_transcript: allowed values are “on” or “off” for the live call transcription. Default is “off”
caller_id: the caller id which you want to display while making call
announce_caller_side: pre-recorded and pre-uploaded voice filename to announce at caller
side before connecting call
announce_callee_side: pre-recorded and pre-uploaded voice filename to announce at callee
side before connecting call

5. Dial Sip
Generate below response to dial and connect sip agents.

{"response": {"app": "dial_sip","refresh": "1","agents": "105","action":"http://localhost:80/api/dial_sip_action","timeout":"60","recording_option":"on","transcript":"on", "live_transcript":"off","announce_caller_side":"quality_training8khz","announce_callee_side":"quality_training-8khz"}}

Here, in the above response there are some parameters. Below are the descriptions for every
parameter.
app: Name of the application which you want to run
agents: Comma separated string of sip agent extensions
action: Hit this action URL in case of NOANSWER, BUSY, CHANUNAVAIL dial statuses.
timeout: Rings the dialed agents till the given amount of timeout. Default is 60 seconds.
recording_option: allowed values are “on” or “off” for the call recording. Default is “off”
transcript: allowed values are “on” or “off” for the call transcription. The default is “off”
live_transcript: allowed values are “on” or “off” for the live call transcription. Default is “off”
announce_caller_side: pre-recorded and pre-uploaded voice filename to announce at caller
side before connecting call
announce_callee_side: pre-recorded and pre-uploaded voice filename to announce at callee
side before connecting call

6. Team
Generate below response to put call into the queue, once the agent becomes free in the queue the call
connects to agent of queue.

{"response":{"app":"team","team_name":"tatasupport","recording_option":"off","action":"http:\/\/localhost:80\/api\/queue_timeout_action","timeout":"30"}}

Here, in the above response there are some parameters. Below are the descriptions for every
parameter.
app: Name of the application which you want to run
team_name: The name of team created for the account, E.g., sales_team, support_team
recording_option: allowed values are “on” or “off” for the call recording. Default is “off”
action: Hit this action URL in case of TIMEOUT.
timeout: Number of seconds to wait before getting time out from the queue

7. VoiceMail
Generate the response below to put the call into voicemail.

{"response": {"app": "voicemail","refresh": "1","text": "Please leave your message after the beep sound","voice":"Joanna","volume":"soft","rate":"slow","pitch":"medium","maxduration":"30","action":" http://localhost:80/api/voice_mail_recording","errortext":"Something went wrong, we are not able to record your voicemail","successtext":"Thank you for your message","language_code":"enUS","tts_engine_type":"neural"}}

Here, in the above response there are some parameters. Below are the descriptions for every
parameter.
app: Name of the application which you want to run
text: The message you want to announce for leaving voicemail
voice: This is voice id, like male, female voices.
maxduration: The duration of recording the voicemail
action: Hit this url on successfully recorded voicemail by system, here you can get details like
account_id, call_id, caller, did_number, record_status, recorded_file
errortext: The message you want to announce on not successfully recorded voicemail
successtext: The message you want to announce on successfully recorded voicemail
volume: Provide volume value. Allowed values: ‘silent’, ‘x-soft’,’soft’, ‘medium’, ‘loud’, ‘x-loud’
rate: Provide rate of speed of announcement. Allowed value: ‘x-slow’, ‘slow’, ‘medium’, ‘fast’,
‘x-fast’
pitch: Provide pitch type. Allowed values: ‘x-low’, ‘low’, ‘medium’, ‘high’, ‘x-high’
language_code(optional): this will be the language code for TTS, default is en-US
tts_engine_type(optional): as of now this parameter can accept values ‘standard’ and ‘neural’
the default one is ‘standard’. The neural type sounds more like human then standard

8. VoiceBot
Generate the response below to connect the call to the voice bot.

{"response": {"app": "voicebot","refresh": "1","text": "I am voice bot, please let me know how I can help you","silence":"1000","voice":"Joanna","volume":"soft","rate":"slow","pitch":"medium","minspeaktime ":"500","action":"http://localhost:80/api/voice_bot_action","rasahost":"1.2.3.4","rasaport":"5005","language_code":"en-US","tts_engine_type":"neural","nlp_engine":"rasa"}}

Here, in the above response there are some parameters. Below are the descriptions for every
parameter.
app: Name of the application which you want to run
text: The message you want to announce for when the call first connected to bot.
silence(optional): amount of time in ms to be expected as silence after sentence completion,
after this much time the bot can start to detect what the user has spoken and reply
appropriately.
voice: This is voice id, like male, female voices.
volume: Provide volume value. Allowed values: ‘silent’, ‘x-soft’,’soft’, ‘medium’, ‘loud’, ‘x-loud’
rate: Provide rate of speed of announcement. Allowed value: ‘x-slow’, ‘slow’, ‘medium’, ‘fast’,
‘x-fast’
pitch: Provide pitch type. Allowed values: ‘x-low’, ‘low’, ‘medium’, ‘high’, ‘x-high’
minspeaktime(optional): minimum amount of time in ms for which user need to speak
something, after this amount of spoken time only the bot can try to understand user voice.
action: once the user voice recognized and detected some intent from user input, it will hit this
url and post detected intent and entities, based on the detected intent can take further action.
Sample response received on action url is as below,
{‘account_id’: ‘ACamj1a1a1jd’, ‘call_id’: ‘1691895564.856’, ‘caller’: ‘101’, ‘did_number’: ‘15168148111’,
‘callee’: ”, ‘bot_status’: ‘talk’, ‘intent’: ‘greet’, ‘entity_name’: ‘none’, ‘entity_value’: ‘none’, ‘entities’:
‘none’}
rasahost(optional): your rasa host IP address, if not given it will connect default our own Rasa server
rasaport(optional): your rasa port on which the bot is running, if not given it will connect to
default Rasa server port
language_code(optional): this will be the language code for TTS and STT during the voicebot
application, default is en-US
tts_engine_type(optional): as of now this parameter can accept values ‘standard’ and ‘neural’
the default one is ‘standard’. The neural type sounds more like human.
nlp_engine(optional): As of now ‘rasa’ and ‘chatgpt’ options are available. The default is rasa.
These two NLP engines can be used in voicebot