Receiving parameters change notification

You can configure VoiceAI Connect to notify the bot of changes to parameter values. For example, after changing the language, VoiceAI Connect can send an event to notify the bot, which "triggers" it to use the new language.

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

How to use this?

Bot configuration

This feature can be configured, using the following bot parameter:

See Changing call settings for details on how this parameter can be applied.

Parameter

Type

Description

notifyParamChange

Array of strings

Defines a list of parameters for which VoiceAI Connect notifies the bot whenever their values change.

By default, this parameter is not defined.

Below shows an example for configuring VoiceAI Connect to notify the bot whenever changes to the language parameter occurs:

AudioCodes Bot API
{
  "type": "config",
  "sessionParams": {
    "language": "fr-FR",
    "notifyParamChange": [
      "language"
    ]
  }
}
Microsoft Bot Framework
{
  "type": "config",
  "channelData": {
    "sessionParams": {
      "language": "fr-FR",
      "notifyParamChange": [
        "language"
      ]
    }
  }
}
Microsoft Copilot Studio

Send the session params with config event (see Sending event to VoiceAI Connect)

{
  "sessionParams": {
    "language": "fr-FR",
    "notifyParamChange": [
      "language"
    ]
  }
}
Microsoft Copilot Studio legacy
[Activity
  "type": "config",
  "channelData": ${json(`{
    "sessionParams": {
      "language": "fr-FR",
      "notifyParamChange": [
        "language"
        ]
      }
    }
  `)}
}
Dialogflow CX

Add a Custom Payload response with the following content:

{
  "sessionParams": {
    "language": "fr-FR",
    "notifyParamChange": [
      "language"
    ]
  }
}
Dialogflow ES

Add a Custom Payload response with the following content:

{
  "sessionParams": {
    "language": "fr-FR",
    "notifyParamChange": [
      "language"
    ]
  }
}

Receiving the notification

VoiceAI Connect notifies the bot of parameter value changes, using the paramChanged event message. The following field is sent with the event:

Field

Type

Description

updatedParams

Object

A key-value object, whereby the key is the parameter whose value changed and the value is the new value of the parameter.

If a parameter was removed from configuration (e.g., if a parameter was only set using activityParams and the activity was done), the value of the parameter will be null.

Note:

  • If the value of a parameter was temporarily changed by the activityParams property, two events are sent -- one for the change and one for the restore of the original value.

  • To prevent loops, it's not recommended for the bot to send activityParams or sessionParams as a result of receiving the paramChanged event.

The syntax per bot framework of the paramChanged event message is shown below:

AudioCodes Bot API

This message is sent as a paramChanged event.

The additional field is sent as the value of the event.

Example:

{
  "type": "event",
  "name": "paramChanged",
  "value": {
    "updatedParams": {
      "language": "fr-FR"
    }
  }
}
Microsoft Bot Framework

This message is sent as a paramChanged event.

The additional field is sent as the value of the event.

Example:

{
  "type": "event",
  "name": "paramChanged",
  "value": {
    "updatedParams": {
      "language": "fr-FR"
    }
  }
}
Microsoft Copilot Studio

This message is sent as a paramChanged event.

Example:

{
  "type": "event",
  "name": "paramChanged",
  "value": {
    "updatedParams": {
      "language": "fr-FR"
    }
  }
}
Microsoft Copilot Studio legacy

This message is sent as a paramChanged event.

The additional field is sent as the value of the event.

Example:

{
  "type": "event",
  "name": "paramChanged",
  "value": {
    "updatedParams": {
      "language": "fr-FR"
    }
  }
}
Dialogflow CX

This message is sent as a paramChanged event.

The additional field is sent inside the parameters of the event.

Example:

{
  "queryInput": {
    "event": {
      "languageCode": "fr-FR",
      "name": "paramChanged",
      "parameters": {
        "updatedParams": {
          "language": "fr-FR"
        }
      }
    }
  }
}

For Dialogflow CX, the fields are also sent inside the event-paramChanged session parameter, and can be accessed using a syntax such as this:

$session.params.event-paramChanged.updatedParams
Dialogflow ES

This message is sent as a paramChanged event.

The additional field is sent inside the parameters of the event.

Example:

{
  "queryInput": {
    "event": {
      "languageCode": "fr-FR",
      "name": "paramChanged",
      "parameters": {
        "updatedParams": {
          "language": "fr-FR"
        }
      }
    }
  }
}