Call initiation
When a call is initiated, VoiceAI Connect sends an event to the bot. The bot typically uses this event to trigger a welcome prompt that will be played to the user. This event includes call details such as the caller and called numbers, and caller display name. For agent-assist scenarios, the event also includes details of the participants of the call (e.g., the end-user and the human agent).
In addition, VoiceAI Connect can be configured for the following behaviors:
-
Play a ringing (ringback) tone to the user until the bot is connected to the call.
-
Manipulate the content of the event or disable the event entirely.
-
Forward to the bot certain information from the SIP INVITE message such as a contact-center call identifier.
-
Send a textual message (e.g., "Hello") to the bot to trigger it to send a welcome prompt. This is typically required in scenarios where the bot cannot handle the event.
-
Send a textual (welcome) message to the user. This is typically required in scenarios where the bot cannot sent a welcome message.
-
Wait for the media to connect before playing the welcome prompt to the user.
How do I use it?
By default, VoiceAI Connect sends an initial event to the bot.
The following data fields are sent with the initial event. However, you can customize this initial event by adding custom fields linked to specified headers (see Sending SIP headers).
Field |
Type |
Description |
---|---|---|
|
String |
A unique identifier (UUID) of the conversation. |
|
String |
Dialed phone number. This is typically obtained from the SIP To header. |
|
String |
Host part of the destination of the call. This is typically obtained from the SIP To header. |
|
String |
Caller's phone number. This is typically obtained from the SIP From header. |
|
String |
Host part of the source of the call. This is typically obtained from the SIP From header. |
|
String |
Caller's display name. This is typically obtained from the SIP From header. |
|
Array of Objects |
For Agent assist: Participants of the conversation. |
|
String |
For Outbound calling: The "target" of the outbound call. |
|
String |
For Outbound calling: Metadata from the dialer application that is sent through VoiceAI Connect to the bot. |
|
Boolean |
For Agent assist using Agent assist API: Whether the agent assist client application is already connected or not. |
<Additional attributes> |
- |
Optional additional attributes such as values from various SIP headers. These can be added by customization. VoiceAI Connect can be configured to extract values from the SIP INVITE message and then send them as additional attributes in the initial message to the bot. |
The syntax of the initial event depends on the bot framework:
The event is sent as a start event, with the data fields inside the parameters property.
Example:
{ "type": "event", "name": "start", "parameters": { "vaigConversationId": "37011f13-2df7-4a23-890e-649daf922ddc", "callee": "12345678", "calleeHost": "10.20.30.40", "caller": "12345678", "callerHost": "10.20.30.40" } }
The message is sent as a channel event, with the data fields inside the channelData property.
Example:
{ "type": "event", "name": "channel", "value": "telephony", "channelData": { "vaigConversationId": "37011f13-2df7-4a23-890e-649daf922ddc", "callee": "12345678", "calleeHost": "10.20.30.40", "caller": "12345678", "callerHost": "10.20.30.40" }, "from": { "id": "12345678" }, "locale": "en-US" }
By default, two events are sent to the Copilot Studio bot:
-
channel
event to pass data. -
startConversation
event to trigger the Greeting topic in the Copilot Studio bot. to disable thestartConversation
event, seecopilotSendStartConversation
in Customizing behavior.
To see how to save and use data from the channel
event, see Saving channel data
Example:
{ "type": "event", "name": "channel", "value": "telephony", "channelData": { "vaigConversationId": "37011f13-2df7-4a23-890e-649daf922ddc", "callee": "12345678", "calleeHost": "10.20.30.40", "caller": "12345678", "callerHost": "10.20.30.40" }, "from": { "id": "12345678" }, "locale": "en-US" }
By default, two events are sent to the PVA bot:
-
channel
event to pass data. -
startConversation
event to trigger the Greeting topic in the PVA bot. to disable thestartConversation
event, seepvaSendStartConversation
in Customizing behavior.
To see how to save and use data from the channel
event, see Saving Channel Data
Example:
{ "type": "event", "name": "channel", "value": "telephony", "channelData": { "vaigConversationId": "37011f13-2df7-4a23-890e-649daf922ddc", "callee": "12345678", "calleeHost": "10.20.30.40", "caller": "12345678", "callerHost": "10.20.30.40" }, "from": { "id": "12345678" }, "locale": "en-US" }
The message is sent as a WELCOME event, with the data fields as event parameters.
Example:
{ "queryInput": { "event": { "languageCode": "en-US", "name": "WELCOME", "parameters": { "vaigConversationId": "37011f13-2df7-4a23-890e-649daf922ddc", "callee": "12345678", "calleeHost": "10.20.30.40", "caller": "12345678", "callerHost": "10.20.30.40" } } } }
The data fields are also sent inside the
event-WELCOME
session parameter, and can be used when generating the response text,
by using a syntax such as this:
$session.params.event-WELCOME.callee
The message is sent as a WELCOME event, with the data fields as event parameters.
Example:
{ "queryInput": { "event": { "languageCode": "en-US", "name": "WELCOME", "parameters": { "vaigConversationId": "37011f13-2df7-4a23-890e-649daf922ddc", "callee": "12345678", "calleeHost": "10.20.30.40", "caller": "12345678", "callerHost": "10.20.30.40" } } } }
The data fields can be used when generating the response text, by using a syntax such as this:
#WELCOME.caller
The call details are added to the sessionAttributes before the start message.
The default start message is: <start>
. You can change this in the bot's configuration by setting initialMessageToBot
. If you set it to an empty string, no start message will be sent.
Customizing behavior
For VoiceAI Connect, the following bot configuration parameters can be used to control the handling of call initiation:
In addition to the above parameters, you can use all the SBC features for customizing the behavior. For example, the SBC can be configured to play a ringback tone to the user until the bot is connected to the call.
Passing SIP headers to the bot
In some setups, it is important to forward SIP header values, extracted from the SIP INVITE message received by VoiceAI Connect, to the bot. For example, in contact centers, an ID is associated with the call which is usually sent in a SIP header, and may be required by the bot application.
VoiceAI Connect can be configured to extract values from the SIP INVITE message and then send them in the initial message to the bot. The values are sent as additional parameters of the initial event.
For more information, please contact AudioCodes support.