Error handling and service continuation

This page explains how to maintain continuation of service and how errors can be handled in setups with VoiceAI Connect. Mitigation of errors can be done for both new calls and ongoing calls.

The following configuration options can be used for mitigating problems:

Errors overview

Loss of connectivity

Such errors can occur either when a call is initiated or during a call, and might be temporary or permanent.

For problems that occur before the call was initiated, the SBC can be configured to perform an alternative route to a human agent. See Defining alternative routing below.

For problems that occur during a call, you can Defining fail-over actions as described below.

For problems that only cause a delay with the bot response, you can use the handle the bot delay as described below.

Bot logic errors

As most of the bot frameworks allows code to be executed as part of the bot's logic (e.g., using a webhook), there might be exceptions or connectivity problems during the execution.

We recommended to trap or catch all the exceptions in the code, so errors could be handled according to the bot's internal logic.

Additionally, some bot frameworks allows you to specify an action to be taken when a webhook execution fails (e.g., Dialogflow CX handling).

In case the error was not handled internally by the bot, it is usually reflected to VoiceAI Connect as a bot-framework service error (see next section).

Bot-framework service errors

VoiceAI Connect might receive an error response from the bot-framework service due to either connectivity problems or bot logic errors. Usually, both types of errors will have the same handling, and will disconnect the conversation with the bot.

You can define fail-over actions for handling those timeouts.

VoiceAI Connect failures

VoiceAI Connect High-Availability can be used to maintain continuation of service in case of failure in one of VoiceAI Connect components.

When an error occur in one of the VoiceAI  Connect components during an ongoing conversation, it will usually lead to disconnection of the conversation with the bot.

Mitigation options

VoiceAI Connect High-Availability

High-Availability (HA) is achieved by deploying a cluster of VoiceAI Connect components. All component in the cluster share the same configuration, and new calls are load-balanced between the components.

In case of failure of one component, new calls are seamlessly routed to one of the active components.

Please contact AudioCodes support for more information.

Defining alternative routing

The SBC can be configured to perform alternative routing in cases of call initiation failures. The alternative route can be to a human agent, to another bot or to playing a prompt to the user.

Please contact AudioCodes support for more information.

Defining fail-over actions

You can define what will be the actions to perform in case of failure during an ongoing call (a call that is already connected).

The errors that are handled can be one of the following:

The actions can be any combination of:

General fail-over

Parameter

Type

Description

generalFailoverActivities

String

Defines activities that are executed sequentially in case of an error during an ongoing call.

The value of this parameter should match the name field of one of the activityLists entries, which defines the activities to execute.

By default, the parameter is not defined.

For more information, please contact AudioCodes support.

Alternative speech-to-text providers in case of speech-to-text failure

The Administrator can configure fallback speech-to-text providers using the sttProviders parameter. See Configuring multiple speech providers for more details.

Parameter

Type

Description

sttFallbackProviders

List

The sttFallbackProviders parameter is deprecated, and has been replaced with the sttProviders parameter.

Defines alternative speech-to-text providers in case of a speech-to-text error during an ongoing call.

  • sttProvider: string

  • sttEndpointID: string (optional field)

  • sttContextId: string (optional field)

  • sttModel: string (optional field)

This list will provide up to 5 alternative speech-to-text providers in case of an speech-to-text error.

Voice AI Connect will add the original provider to this list (i.e., if all the providers listed fail, Voice AI Connect will retry with the original speech-to-text provider).

For VoiceAI Connect Enterprise, this feature is supported only from Version 3.8 and later.

The following shows an example of configuration with an alternative speech-to-text provider:

{
  "sttFallbackProvider": [
    {
      "sttProvider": "other provider",
      "sttEndpointId": "Endpoint ID",
      "sttContextId": "Context Id value",
      "sttModel": "stt model type"
    }
  ]
}

Alternative text-to-speech providers in case of text-to-speech fail-over

Parameter

Type

Description

ttsFallbackProviders

List

Defines alternative text-to-speech providers in case of a text-to-speech error during an ongoing call.

  • ttsProvider: string

  • voiceName: string

  • ttsDeploymentId: string (optional field)

This list will provide up to 5 alternative text-to-speech providers in case of an text-to-speech error.

Voice AI Connect will add the original provider to this list (i.e., if all the providers listed fail, Voice AI Connect will retry with the original text-to-speech provider).

For VoiceAI Connect Enterprise, this feature is supported only from Version 3.8 and later.

The following shows an example of configuration with an alternative text-to-speech provider:

{
  "ttsFallbackProviders": [
    {
      "ttsProvider": "provider Name",
      "voiceName": "voice name output",
      "ttsDeploymentId": "deploymentId string"
    }
  ]
}

Handling bot delays

For handling bot delays (or no response from the bot), see Handling bot delay.

Azure-specific configuration

The following bot parameter can be used to define how bot errors are handled:

Parameter

Type

Description

botFailOnErrors

Boolean

Defines what happens when the Azure bot error "retry" occurs.

  • true: (Default) The error is printed to the log and the call is disconnected.

  • false: The error is printed to the log, but the call is not disconnected, unless max retry is exceeded (configured in the maxAzureFailureRetries parameter) while trying to send the 'start' message.

Note: The "retry" error might occur when there is a problem or delay in the bot code. It does not necessarily indicate a non-recoverable problem. Hence, this parameter is only used on specific setups.

This parameter is applicable only to VoiceAI Connect Enterprise (Version 2.8 and later).

The following providers parameter can be used to define retries for sending messages to the bot:

Parameter

Type

Description

maxAzureFailureRetries

Integer

Defines the number of times the VoiceAI Connect attempts to send a message to an Azure bot before failing due to a timeout.

The valid range is 0 to 5. The default is 0.

Note:

  • The parameter is applicable only to Azure.

  • If the bot has handled the original request, the retry might occur after the bot state has changed, hence this parameter should only be used on specific setups.

Defining timeouts

The following provider parameters can be used for setting timeouts for various services. You can define fail-over actions for handling those timeouts.

Parameter

Type

Description

botNoResponseTimeoutMS

Integer

Defines the maximum time (in milliseconds) that VoiceAI Connect waits for bot response before timeout.

The default is 10,000 (10 seconds).

botNoResponseRetries

Integer

Defines the number of retry requests towards the bot in case of no response and connectivity error codes.

The default is 2.

ttsRetries

Integer

Defines the number of retry requests towards the text-to-speech provider in case of no response or a connectivity error response code. Each retry is done after ttsConnectionTimeoutMS expires.

The valid value is 0 to 10. The default is 1.

This parameter is applicable only to VoiceAI Connect Enterprise Version 3.20 and later.

ttsConnectionTimeoutMS

Integer

Defines the maximum time (in milliseconds) that VoiceAI Connect Enterprise waits for a response from the text-to-speech provider.

The valid value is 10 to 600,000. The default is 10,000.

If no response is received when this timeout expires, VoiceAI Connect Enterprise tries again to communicate with the text-to-speech provider (number of retries according to ttsRetries). If still no response, VoiceAI Connect Enterprise disconnects the call with the SBC.

If the call is disconnected, the SIP BYE message sent by the SBC to the user indicates this failure, by prefixing the value in the Reason header with "TTS Err:".

Note: In this scenario (disconnect), you can also configure VoiceAI Connect Enterprise to perform specific activities, for example, playing a prompt to the user or transferring the call (see the generalFailoverActivities parameter).

sttConnectionTimeoutMS

Integer

Defines the maximum time (in milliseconds) that VoiceAI Connect Enterprise waits for a response from the speech-to-text provider.

The valid value is 10 to 600,000. The default is 10,000.

If no response is received when this timeout expires, VoiceAI Connect Enterprise tries one more time to communicate with the speech-to-text. If still no response, VoiceAI Connect Enterprise disconnects the call with the SBC.

If the call is disconnected, the SIP BYE message sent by the SBC to the user indicates this failure, by prefixing the value in the Reason header with "STT Err:".

Note: In this scenario (disconnect), you can also configure VoiceAI Connect Enterprise to perform specific activities, for example, playing a prompt to the user or transferring the call (see the generalFailoverActivities parameter).