Receiving call disconnect notification
When the call is disconnected, VoiceAI Connect can send an indication to the bot indicating the reason for the termination of the call.
How do I use it?
Termination reasons
The reason of the termination is sent in the following fields:
Field |
Type |
Description |
---|---|---|
|
String |
A string value indicating the reason of the call termination. Can have one of the following values:
For an outbound call that was terminated before it was answered, these are the possible values:
VoiceAI Connect Enterprise supports this parameter from Version 2.4 and later.
|
|
String |
Free text describing the reason for the failure. |
Receiving the notification
VoiceAI Connect sends the end-of-conversation according to the bot framework:
The conversation is terminated according to the AudioCodes Bot API specification.
This is done by sending an HTTP POST request to the disconnectUrl
endpoint.
The request body contains the reason fields.
The endOfConversation activity is sent when the call ends.
The reason fields are sent inside the channelData
field
The free-text reason is also sent in the text
field.
Example:
{ "type": "endOfConversation", "text": "Client Side", "channelData": { "reason": "Client Side", "reasonCode": "client-disconnected" } }
The endOfConversation activity is sent when the call ends.
The reason fields are sent inside the channelData
field
The free-text reason is also sent in the text
field.
See Receiving notifications from VoiceAI Connect.
Example:
{ "type": "endOfConversation", "text": "Client Side", "channelData": { "reason": "Client Side", "reasonCode": "client-disconnected" } }
The endOfConversation activity is sent when the call ends.
The reason fields are sent inside the channelData
field
The free-text reason is also sent in the text
field.
See Receiving notifications from VoiceAI Connect.
Example:
{ "type": "endOfConversation", "text": "Client Side", "channelData": { "reason": "Client Side", "reasonCode": "client-disconnected" } }
The conversationEnd
event is sent to the bot when the call ends, if it is specified on the sendEventsToBot
parameter.
See Controlling events sent to bot for more details regarding the parameter.
The reason fields are sent as the event parameters.
Example:
{ "queryInput": { "event": { "name": "conversationEnd", "parameters": { "reason": "Client Side", "reasonCode": "client-disconnected" } } } }
For Dialogflow CX, the fields are also sent inside the event-conversationEnd
session parameter, and can be accessed using a syntax such as this:
$session.params.event-conversationEnd.reasonCode
The conversationEnd
event is sent to the bot when the call ends, if it is specified on the sendEventsToBot
parameter.
See Controlling events sent to bot for more details regarding the parameter.
The reason fields are sent as the event parameters.
Example:
{ "queryInput": { "event": { "name": "conversationEnd", "parameters": { "reason": "Client Side", "reasonCode": "client-disconnected" } } } }
Waiting for speech-to-text final response before disconnecting the bot
The delayBotDisconnectMs
parameter sets the maximum time VoiceAI Connect waits for a response from the speech-to-text service before disconnecting the call.
This feature is configured per bot by the Administrator, or dynamically by the bot during conversation:
Field |
Type |
Description |
---|---|---|
|
Number |
Defines the maximum time (msec) VoiceAI Connect waits for the final response from the speech-to-text service (i.e., speech-to-text is done), before disconnecting the bot call. The value range is 0 to 10,000 milliseconds. The default is 0 (i.e., disconnect call immediately. No waiting for speech-to-text reply). VoiceAI Connect Enterprise supports this parameter from Version 3.14 and later.
|