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

reasonCode

String

A string value indicating the reason of the call termination.

Can have one of the following values:

  • "error": The call was disconnected due to an unexpected error.

  • "bot-disconnected": The call was disconnected from the bot side.

  • "client-disconnected": The call was disconnected from the end-user side.

  • "transferred": The call was disconnected after it was transferred.

  • "machine-detected": The call was disconnected because an answering machine or a fax machine was detected.

For an outbound call that was terminated before it was answered, these are the possible values:

  • "no-answer": There was no answer to the call.

  • "busy": The target number was busy.

  • "declined": The end-user declined or rejected the call.

  • "error": An error occurred before the end-user answered the call (for example, the target number was invalid).

VoiceAI Connect Enterprise supports this parameter from Version 2.4 and later.

reason

String

Free text describing the reason for the failure.

Receiving the notification

VoiceAI Connect sends the end-of-conversation according to the bot framework:

AudioCodes Bot API

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.

Microsoft Bot Framework

The endOfConversation activity is sent when the call ends.

The reason fields are sent inside the channelData field (VoiceAI Connect Enterprise supports these fields only from Version 2.4 and later).

The free-text reason is also sent in the text field.

Example:

{
    "type": "endOfConversation",
    "text": "Client Side",
    "channelData": {
        "reason": "Client Side",
        "reasonCode": "client-disconnected"
    }
}
Microsoft Copilot Studio

The endOfConversation activity is sent when the call ends.

The reason fields are sent inside the channelData field (VoiceAI Connect Enterprise supports these fields only from Version 2.4 and later).

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"
  }
}
Microsoft Copilot Studio legacy

The endOfConversation activity is sent when the call ends.

The reason fields are sent inside the channelData field (VoiceAI Connect Enterprise supports these fields only from Version 2.4 and later).

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"
  }
}
Dialogflow CX

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
VoiceAI Connect Enterprise supports this event from Version 2.4 and later. For earlier versions, no event was sent to the bot.
Dialogflow ES

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"
      }
    }
  }
}
VoiceAI Connect Enterprise supports this event from Version 2.4 and later. For earlier versions, no event was sent to the bot.

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

delayBotDisconnectMs

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.