Sending metadata

In various call-center scenarios, it's desirable to pass information from the bot to the call-center system. This can be used for several purposes, for example:

The information (metadata) is given as a JSON object and can be forwarded to the call center in one of the following ways:

Alternatively the information (metadata) can be fetched after the call has ended by rest API (see Passing SIP headers to the bot).

This feature is applicable only to VoiceAI Connect Enterprise edition.

How do I use it?

Configuration

For sending the metadata using SIP INFO messages to the peer of the conversation, the administrator should set the sendMetadataAsSipInfo to true.

For sending HTTP POST requests, the administrator should set the sendMetaDataUrl parameter

Parameter

Type

Description

sendMetaDataUrl

String

Defines the URL (of the HTTP server) to where the metadata is sent.

If the parameter is not configured, the sendMetaData event is handled by sending SIP INFO messages.

Note:

The parameter can be populated using placeholders (see Dynamically setting parameters).

For example:

"sendMetaDataUrl": "https://my-host/call/${botMessageMetadata.caller}"

sendMetaDataTimeoutMs

Number

Defines the timeout (in milliseconds) for the HTTP request of the sendMetaData event.

The valid value is 10-60000. The default is 10,000.

Note: The parameter is applicable only if sendMetaDataUrl is configured.

sendMetadataAsSipInfo

Boolean

Enables VoiceAI Connect to send metadata from the bot as a SIP INFO message.

  • true
  • false (Default)

This parameter is supported only by VoiceAI Connect Enterprise (and from Version 3.6 and later).

For using HTTP Basic authentication for HTTP requests, the following parameters should be configured inside the credentials parameter of the bot:

Parameter

Type

Description

sendMetaDataUsername

String

Username for HTTP basic authentication of the metadata HTTP POST request.

Note: This parameter is applicable only if sendMetaDataUrl is configured.

sendMetaDataPassword

String

Password for HTTP basic authentication of the metadata HTTP POST request.

Note: This parameter is applicable only if sendMetaDataUrl is configured.

Event

For sending metadata, the bot should send the sendMetaData event.

See Sending activities page for instructions on how to send events using your bot framework.

The metadata should be specified in the "value" attribute, which can contain any valid JSON object.

For example:

AudioCodes Bot API
{
  "type": "event",
  "name": "sendMetaData",
  "value": {
    "myParamName": "myParamValue"
  }
}
Microsoft Bot Framework
{
  "type": "event",
  "name": "sendMetaData",
  "value": {
    "myParamName": "myParamValue"
  }
}
Microsoft Copilot Studio

Send metadata with sendMetaData event (see Sending event to VoiceAI Connect Enterprise)

{
  "value": {
    "myParamName": "myParamValue"
  }
}
Microsoft Copilot Studio legacy
[Activity
  "type": "event",
  "name": "sendMetaData",
  "value": ${json(`
    "myParamName": "myParamValue"
   `)}
]
Dialogflow CX

Add a Custom Payload fulfillment with the following content:

{
  "activities": [{
    "type": "event",
    "name": "sendMetaData",
    "value": {
      "myParamName": "myParamValue"
    }
  }]
}
Dialogflow ES

Add a Custom Payload response with the following content:

{
  "activities": [{
    "type": "event",
    "name": "sendMetaData",
    "value": {
      "myParamName": "myParamValue"
    }
  }]
}

How the metadata is sent?

When handling the sendMetaData event, VoiceAI Connect performs one of the following (according to configuration):