Handling bot delay

In case the bot takes time to respond to a message sent to it, you can configure VoiceAI Connect to take an action.

By setting timeouts, the following actions can be configured:

For cases that the call is disconnected due to bot timeout, the administrator can define fail-over actions for handling it.


How do I use it?

To play a message to the user you should configure a timeout on the parameter botNoInputTimeoutMS and define the action:

To play the message again if the timeout passes more than once, you can configure the number of retries on the botNoInputRetries parameter.

A separate timeout can be defined for disconnecting the call. This timeout is set with the botNoInputGiveUpTimeoutMS parameter.

If no message was received from the bot, VoiceAI Connect will resume speech recognition after 10 seconds. You can modify this timeout using the resumeRecognitionTimeoutMS parameter. If the botNoInputTimeout expires before resumeRecognitionTimeout and a prompt is played to the user, the time to resume recognition is counted from the end of the prompt.

In the case where you want the bot to break its response into two messages (with a delay between first and second bot response), use the expectAnotherBotMessage parameter. VoiceAI Connect will stop the User Input timer and will start the Bot Input timer.

Example

The following event can be sent by the bot to configure the following:

AudioCodes Bot API
{
  "type": "event",
  "name": "config",
  "sessionParams": {
    "botNoInputTimeoutMS": 1000,
    "botNoInputSpeech": "Please wait for bot input.",
    "botNoInputGiveUpTimeoutMS": 10000
  }
}
Microsoft Bot Framework
{
  "type": "event",
  "name": "config",
  "channelData": {
    "sessionParams": {
      "botNoInputTimeoutMS": 1000,
      "botNoInputSpeech": "Please wait for bot input.",
      "botNoInputGiveUpTimeoutMS": 10000
    }
  }
}
Dialogflow CX

Add a Custom Payload response with the following content:

{
  "activities": [{
    "type": "event",
    "name": "config",
    "sessionParams": {
      "botNoInputTimeoutMS": 1000,
      "botNoInputSpeech": "Please wait for bot input.",
      "botNoInputGiveUpTimeoutMS": 10000
    }
  }] 
}
Dialogflow ES

Add a Custom Payload response with the following content:

{
  "activities": [{
    "type": "event",
    "name": "config",
    "sessionParams": {
      "botNoInputTimeoutMS": 1000,
      "botNoInputSpeech": "Please wait for bot input.",
      "botNoInputGiveUpTimeoutMS": 10000
    }
  }] 
}
Amazon Lex V2
{
  "activities": [{
    "type": "event",
    "name": "config",
    "sessionParams": {
      "botNoInputTimeoutMS": 1000,
      "botNoInputSpeech": "Please wait for bot input.",
      "botNoInputGiveUpTimeoutMS": 10000
    }
  }] 
}

Parameters description

The following table lists the bot parameters that are used to configure this feature:

See Changing call settings for details on how these parameters can be applied.

Parameter

Type

Description

botNoInputGiveUpTimeoutMS

Number

Defines the timeout (in milliseconds) for bot response before the call is disconnected.

If no response is received when the timeout expires, VoiceAI Connect disconnects the call with the SBC.

The default is 0 (i.e., no timeout for bot response).

If the call is disconnected, the SIP BYE message sent by the SBC to the user indicates this failure.

botNoInputTimeoutMS

Number

Defines the timeout (in milliseconds) for before a prompt is played to the user.

If no input is received from the bot when this timeout expires, VoiceAI Connect can either play a textual prompt (see the botNoInputSpeech parameter) or an audio file (see the botNoInputUrl parameter) to the user.

The default is 0 (i.e., no timeout for bot response).

botNoInputRetries

Number

Defines the maximum number of recurring timeouts (configured by the botNoInputTimeoutMS parameter) for bot response.

If this parameter is configured, the timer will be triggered again after playing the no-bot-input prompt to the user.

For example, if the parameter is set to 2, the timeout is set to 1000 ms, and no response was received from the bot, VoiceAI Connect will play the prompt 3 times: after 1 (initial timeout), 2 (first retry) and 3 (second retry) seconds.

The default is 0 (i.e., only one timeout – no retries).

botNoInputSpeech

String

Defines the textual prompt to play to the user when no input has been received from the bot when the timeout expires (configured by botNoInputTimeoutMS).

The prompt can be configured in plain text or in Speech Synthesis Markup Language (SSML) format (see Using SSML for more details).

By default, the parameter is not configured.

Note:

  • If you have also configured the botNoInputUrl parameter, botNoInputSpeech takes precedence.

  • Playing a textual prompt requires a text-to-speech provider. It will not work when the speech is synthesized by the bot framework.

botNoInputUrl

String

Defines the URL from where the audio file is played to the user when no input has been received from the bot when the timeout expires (configured by botNoInputTimeoutMS).

By default, the parameter is not configured.

Note: If you have also configured the botNoInputSpeech parameter, botNoInputSpeech takes precedence.

resumeRecognitionTimeoutMS

Number

When Barge-In is disabled, speech input is not expected before the bot's response has finished playback. If no reply from the bot arrives within this configured timeout (in milliseconds), VoiceAI Connect expects speech input from the user and speech-to-text recognition is re-activated.

The valid value is 0 (i.e., no automatic resumption of recognition) to 600,000 (i.e., 10 minutes). The default is 10,000.

expectAnotherBotMessage

Boolean

Enables the bot to break its response into two or more messages.

  • true: Signals VoiceAI Connect to stop the user input timer and restart the bot input timer, allowing the bot more time to send a subsequent message. The amount of time is specified by the value of botNoInputTimeoutMS.

  • False (default): The user input timer is started, expecting the next input to come from the caller.

NOTE: if the bot wants to prevent caller speech during the delayed response period, the enableSpeechInput parameter should be set to false.

This feature is applicable to VoiceAI Connect Enterprise Version 3.18 and later.