copyright | lastupdated | subcollection | ||
---|---|---|---|---|
|
2021-02-04 |
assistant |
{:shortdesc: .shortdesc} {:new_window: target="_blank"} {:external: target="_blank" .external} {:deprecated: .deprecated} {:important: .important} {:note: .note} {:tip: .tip} {:pre: .pre} {:codeblock: .codeblock} {:screen: .screen} {:javascript: .ph data-hd-programlang='javascript'} {:java: .ph data-hd-programlang='java'} {:python: .ph data-hd-programlang='python'} {:swift: .ph data-hd-programlang='swift'}
{: #commands-voice}
Add action commands to the message context
object to manage the flow of conversations with customers who interact with your assistant over the telephone.
{: shortdesc}
Learn about the supported commands and reserved context variables that are used by the phone integration.
{: #commands-voice-actions}
Each action consists of a command
property, followed by an optional parameter
property to define parameters for commands that require them. The commands that are described in the following table are supported by the phone integration.
Action command | Description | Parameters |
---|---|---|
vgwActCollectDTMF |
Instructs the phone integration to collect dual-tone multi-frequency signaling (DTMF) input. |
|
vgwActDisableDTMFBargeIn |
Disables DTMF barge-in so that playback from the phone integration isn't interrupted when callers press keys. | No parameters. |
vgwActDisableSpeechBargeIn |
Disables speech barge-in so that playback from the phone integration isn't interrupted when callers speak. | No parameters. |
vgwActDisableSTTDuringPlayback |
Pauses speech-to-text processing before playing back audio, which prevents speech barge-in while the audio plays. After the playback transaction is completed, the phone integration resumes speech-to-text processing. If speech-to-text processing was disabled by the vgwActPauseSTT action, it does not resume after the playback transactions are completed unless it's reenabled by the vgwActUnPauseSTT action. |
No parameters. |
vgwActEnableDTMFBargeIn |
Enables DTMF barge-in so that callers can interrupt playback from the phone integration by pressing a key. | No parameters. |
vgwActEnableSpeechBargeIn |
Enables speech barge-in so that callers can interrupt playback from the phone integration by speaking. | No parameters. |
vgwActEnableSTTDuringPlayback |
Reenables speech-to-text processing during audio playback transactions. | No parameters. |
vgwActExcludeFromTTSCache |
Instructs the phone integration not to cache the response from the {{site.data.keyword.texttospeechshort}} service. For example, responses that contain sensitive PHI, PII, and PCI DSS data or dynamic information such as customer names or birth dates should be excluded. This action tag must be set on the dialog node for each utterance that you don't want to cache. |
No parameters. |
vgwActForceNoInputTurn |
Forces a new turn in the conversation without waiting for input from the caller. The phone integration sends a message request with "vgwNoInputTurn" in the text field so that you can map this request to an intent in your dialog. | No parameters. |
vgwActHangup |
Hangs up the call. | No parameters. |
vgwActPlayText |
Plays an utterance string from a list of utterances that are defined in the output.generic field. If multiple strings are defined, the utterance is chosen based on the selection_policy value. |
|
vgwActPlayUrl |
Plays an audio file as soon as the included text is played back, such as for playing music on hold (MOH) or common one-time utterances. If no text is included, the audio is played immediately. The file must be single channel (mono), PCM-encoded, and have a 8,000 Hz sampling rate with 16 bits per sample. |
|
vgwActPauseDTMF |
Disables DTMF input. All DTMF input is ignored until it's reenabled by the vgwActUnPauseDTMF action. |
No supported parameters. |
vgwActPauseSTT |
Pauses speech-to-text processing until it's reenabled by the vgwActUnPauseSTT action. If recording is enabled and speech-to-text processing is paused, the audio from the caller isn't captured. |
participants : For SIPREC sessions, a comma-separated list of participants that the action is applied to. If the participants list isn't provided, the action is applied to all participants or SIPREC streams. |
vgwActSendSIPInfo |
Send UUI data in a SIP INFO request. |
|
vgwActSendSMS |
Enables the assistant to send an SMS message to the user. |
|
vgwActSetDisambiguationConfig |
Applies configuration settings to the disambiguation list. |
|
vgwActSetOptionsConfig |
Applies configuration settings to the options response type. |
|
vgwActSetSTTConfig |
Applies a set of parameters for the phone integration to pass to the {{site.data.keyword.speechtotextshort}} service. {{site.data.keyword.conversationshort}} dynamically defines the parameters based on the call. | Parameters are transparently passed as JSON properties to the {{site.data.keyword.speechtotextshort}} service.
|
vgwActSetTTSConfig |
Applies a set of parameters for the phone integration to pass to the {{site.data.keyword.texttospeechshort}} service. {{site.data.keyword.conversationshort}} dynamically defines the parameters based on the call. | Parameters are passed as JSON properties to the {{site.data.keyword.texttospeechshort}} service.
|
vgwActTransfer |
Transfers the call to the defined transfer target. |
|
vgwActUnPauseDTMF |
Reenables DTMF input that was disabled by the vgwActPauseDTMF action. |
No supported parameters. |
vgwActUnPauseSTT |
Resumes speech-to-text processing that was previously paused by the vgwActPauseSTT action. |
No supported parameters. |
{: caption="Table 1. Actions that you can initiate from dialog" caption-side="top"} |
{: #commands-voice-context-variables}
The following table describes the context variables that have special meaning in the context of the phone integration. They should not be used for any purpose other than the documented use.
Table 2 describes the context variables that are set from your dialog. Table 3 describes the context variables that you can set by the phone integration.
{: #commands-voice-context-variables-set-by-dialog}
Context variable name | Expected value | Description |
---|---|---|
vgwByeCustomHeader |
User-defined value | Defines a custom header in an outgoing SIP BYE message. The custom header value is defined by the vgwByeCustomHeaderVal context variables. |
vgwByeCustomHeaderVal |
User-defined value | Defines the value of a custom header in an outgoing SIP BYE message. The custom header is defined by the vgwByeCustomHeader context variables. |
vgwConversationFailedAudioURL |
User-defined value | A URL to an audio file that is played if the {{site.data.keyword.texttospeechshort}} service can't be contacted when the phone integration attempts to play back the vgwConversationFailedMessage message. Configure your dialog to set this variable on the first turn. |
vgwConversationFailedMessage |
Text string | Message streamed to the caller when a call is being transferred or disconnected due to a failure of one of the Watson services. Configure your dialog to set this variable on the first turn. |
vgwConversationResponseTimeout |
Time in ms | The amount of time in milliseconds that the phone integration waits to receive a response from {{site.data.keyword.conversationshort}}. If the time is exceeded, the phone integration tries again to contact {{site.data.keyword.conversationshort}}. If the service still can't be reached, the call fails. |
vgwDisconnectCallOnNoUserInputTurnCount |
User-defined value | Informs the phone integration whether to disconnect the call on consecutive post response timeouts. Determines the number of consecutive post response timeouts to allow before the call is disconnected. |
vgwDisconnectCallOnTransferFailure |
Yes or No |
Informs the phone integration whether to disconnect the call when a call transfer fails. When set to No , the phone integration initiates a conversation turn by sending "vgwCallTransferFailed" text to {{site.data.keyword.conversationshort}}. Then, {{site.data.keyword.conversationshort}} can either disconnect the call or transfer it to a different destination as configured in the dialog. |
vgwErrAudioURL |
User-defined value | A URL to an audio file that is played if the {{site.data.keyword.texttospeechshort}} service can't be contacted when the phone integration attempts to play back a response. The audio file must be in WAV format. |
vgwFinalUtteranceTimeout |
Time in ms | The amount of time in milliseconds that the phone integration waits to receive a final utterance from the {{site.data.keyword.speechtotextshort}} service. The timeout occurs if the phone integration does not receive a final utterance within the specified time limit, even if hypotheses continue to be generated. When the timeout occurs, the phone integration sends {{site.data.keyword.conversationshort}} a text update with the word "vgwFinalUtteranceTimeout" to indicate that no final utterance was received. |
vgwPostResponseTimeoutCount |
Time in ms | The amount of time in milliseconds to wait for a new utterance after the response is played back to the caller. If this value is exceeded, the {{site.data.keyword.conversationshort}} receives a text update with the word "vgwPostResponseTimeout" to indicate that a timeout occurred. |
vgwSessionInactivityTimeout |
Time in min | Inactivity timeout interval. The timeout interval value specifies in minutes how long the phone integration allows a session to be inactive. When the timeout expires, the phone integration ends the session. |
vgwTransferFailedAudioURL |
User-defined value | A URL to an audio file that is played if the {{site.data.keyword.texttospeechshort}} service can't be contacted when the phone integration attempts to play back the vgwTransferFailedMessage message. Configure your dialog to set this variable on the first turn. |
vgwTransferFailedMessage |
Text string | If the vgwDisconnectCallOnTransferFailure parameter is set to Yes , the message that is streamed to the caller if the call transfer fails. You define this message when you set up the phone integration. |
{: caption="Table 2. Voice context variables set by the dialog" caption-side="top"} |
{: #commands-voice-context-variables-set-by-integration}
Context variable name | Expected value | Description |
---|---|---|
vgwBargeInOccurred |
Yes or No |
Indicates whether barge-in occurred. |
vgwCallTransferFailed |
Yes |
Indicates that the call transfer failed. When this variable is set, the text field contains the string "vgwCallTransferFailed". |
vgwCallTransferred |
Yes |
Indicates that the call was transferred. |
vgwDTMFCollectionSucceeded |
Yes /No |
Variable sent to the phone integration from {{site.data.keyword.conversationshort}} to indicate whether the DTMF collection succeeded or failed. When Yes , a DTMF collection succeeded, and returns the expected number of digits. When No , a DTMF collection failed to collect the specified number of digits. Even when No , all collected digits are passed to the dialog in the input string of the turn request. |
vgwHangUp |
Yes or No |
Indicates whether the conversation session was ended. |
vgwHangupReason |
String | When a hangup is initiated either by the caller or because of an error, this variable is sent to {{site.data.keyword.conversationshort}} to indicate why the call was disconnected. The text in the message request that is sent to {{site.data.keyword.conversationshort}} also includes "vgwHangUp". |
vgwIsOutboundCall |
Yes or No |
Indicates whether the call is an outbound call. |
vgwIsDTMF |
Yes or No |
Indicates whether the input to {{site.data.keyword.conversationshort}} is dual-tone multi-frequency signaling (DTMF). |
vgwNetworkWarnings |
JSON array | An array of network warnings that occurred during the {{site.data.keyword.conversationshort}} turn. To send network warnings, RTCP must be enabled. |
vgwReceivedOnChannel |
SMS |
If an utterance is received over the SMS channel, this variable presents and is set to SMS . |
vgwSessionID |
User-defined value | A custom session ID header pulled from the SIP INVITE request. The value represents the global session ID that is used in all the phone integration audit logs related to the session. |
vgwSIPCallID |
SIP Call-ID | The SIP call ID associated with the conversation session. |
vgwSIPCustomInviteHeader |
User-defined value | A user-defined SIP header that is pulled from the initial SIP INVITE request and passed to the {{site.data.keyword.conversationshort}} service. |
vgwSIPCustomInviteHeaders |
User-defined value | A user-defined list of SIP headers that are pulled from the initial SIP INVITE request and passed to the {{site.data.keyword.conversationshort}} service. For example: "vgwSIPCustomInviteHeaders ":{ |
vgwSIPFromURI |
SIP From URI | The SIP From URI associated with the {{site.data.keyword.conversationshort}} service. |
vgwSIPRequestURI |
SIP Request URI | The SIP request URI that started the conversation session. |
vgwSIPToURI |
SIP To URI | The SIP To URI associated with the conversation session. |
vgwSMSContext |
String | The context extracted from the opaque data, smsOpaqueData , received from Twilio. |
vgwSMSMessage |
String | The SMS message received from the caller. |
vgwSMSMedia |
JSON array | The MMS message received from the caller.{ |
vgwSMSUserPhoneNumber |
String | The phone number that the SMS message was received from. |
vgwSTTProvider |
String | The name of the provider that is used for the call. The context variable is set if the provider name is configured. |
vgwSTTResponse |
JSON object | The final response from the {{site.data.keyword.speechtotextshort}} service in JSON format, including the transcript and confidence score for the top hypothesis and any alternatives. The format matches exactly the format that is received from the {{site.data.keyword.speechtotextshort}} service:
|
vgwTransferReason |
String | Indicates the reason why a call was transferred. |
vgwTTSProvider |
String | The name of the provider that is used for the call. The context variable is set if the provider name is configured. |
{: caption="Table 3. Voice context variables set by the integration" caption-side="top"} |