Next Prompt Behavior Snippet

The Next Prompt Behavior snippet allows you to customize the behaviors for a specific turn in the conversation. If you want to define default behaviors for all turns in the conversation, use a Default Next Prompt Behaviors snippet. The behaviors you can define are comfort noise, DTMFClosed Signaling tones that are generated when a user presses or taps a key on their telephone keypad. detection, delays and timeouts, and barge. You can learn more about these behaviors on the Prompt Behaviors help page.

Use this snippet with actions that have the nextPromptBehavior property, such as the Cloud Transcribe action or the Voicebot Exchange action.

Time Needed for Each Conversation Turn

Be sure to calculate the amount of time needed for each turn in the conversation. For example, speaking a 14-digit number may take between eight and fifteen seconds if there are no pauses, but responding Yes or No only takes a second or two. To capture the entire number, the conversation turn where the number is spoken must be longer than the Yes/No turn.

On the turn where the number is spoken, you must increase maxUtteranceMilliseconds to an amount longer than the default setting. Additionally, you may also want to make maxPostEnergySilenceMS longer for that turn. This will help ensure that the contact has time to speak the number.

To change these values for one turn, place a SNIPPET action before and after the Voicebot Exchange action for that turn. In the SNIPPET before Voicebot Exchange, change the settings you need to. In the SNIPPET after Voicebot Exchange, change the settings back.

Add a Next Prompt Behavior Snippet

  1. Open your script in Studio.
  2. Add a Snippet action to your script before the Voicebot Exchange action you want to perform the specified behaviors. If you're using this snippet for non-virtual agent applications, place the Snippet before the Cloud Transcribe action. Connect the actions.
  3. Add the following object declaration to the snippet:

    DYNAMIC nextPromptBehaviors
    <add behaviors as needed>
    ASSIGN nextPromptBehaviorsJson="{nextPromptBehaviors.asjson()}"
  4. Add the behaviors you want the action to perform, using this syntax:

    ASSIGN nextPromptBehaviors.[behavior] = [value]

    where [behavior] includes the property name and all associated member and submember names. See the example snippet code in the following section for more information.

  5. Configure the nextPromptBehavior property of the Voicebot Exchange or Cloud Transcribe action with the variable used to hold the JSON contents of nextPromptBehaviors object. In the example code, this is nextPromptBehaviorsJson.

Prompt Behavior Properties

The following table describes the properties available for Next Prompt Behavior snippets. The properties allow you to configure the next prompt behaviors. The behaviors are fully described on the Virtual Agent Prompt Behaviors help page. The behaviors function as described when used with non-virtual agent applications of Turn-by-Turn Transcription.

The following example of a Next Prompt Behavior snippet shows the full object member and sub-member names to use for each property.

Property Behavior Details
audioFilePath Comfort Noise During Virtual Agent Delays

Enter the location of the comfort noise audio file. The file should be located in your business unitClosed High-level organizational grouping used to manage technical support, billing, and global settings for your CXone environment's file structure. Include the whole path if the file is in a folder. The file structure is enforced as it would be for other prompt behavior.

Use with:

  • botResponseDelayTolerance
  • engageComfortSequence
botResponseDelayTolerance Comfort Noise During Virtual Agent Delays

Enter the amount of time in milliseconds that triggers the comfort noise audio file.

Use with:

  • audioFilePath
  • engageComfortSequence

This property is only for use with the comfort noise behavior. It does not control when the script takes the userInputTimeout branch. millisecondsToWaitForUserResponse is the property that controls when this branch is taken.

clearDigits DTMF Collection

Set this property to true if you want to clear the DTMF tone buffer when the action begins. The buffer caches DTMF tones when the contact presses a key on their phone keypad.

This property is similar to the clearDigits property in the Menu action.

This property must be used with detectDtmf. There are additional DTMF-related options you can configure with additional properties.

Note: Your virtual agent must be configured to handle DTMF inputs in the provider's management console. Even if you have clearDigits set to true, your virtual agent must be able to handle errors due to extra DTMF digits or delays between inputs. The VOICEBOT EXCHANGE action passes the input it collects from the contact to the virtual agent.

detectDtmf DTMF Collection

Set this property to true if you want the action to capture DTMF entries.

This property enables the collection of DTMF tones. To configure other DTMF-related options, you must include other properties: 

  • clearDigits
  • terminationCharacters
  • stripTerminator
  • interDigitTimeoutMilliseconds
  • maxDigits
enableSpeakerBarge Barge

Set this property to true to enable barge. This property should be enabled (true) for most bot interactions, but can be disabled (false) when the audio contains information the caller is required to hear, such as legal disclaimers.

This property can be used alone.

engageComfortSequence Comfort Noise During Virtual Agent Delays

Set the property to true if you want to enable comfort noise for this action. Set it to false if you don't want this action to use comfort noise.

Use with:

  • botResponseDelayTolerance
  • audioFilePath
interDigitTimeoutMilliseconds

DTMF Collection

Contact Timeout Handling

Enter the amount of time in milliseconds that the system waits after a contact enters a digit to determine if the contact will enter another digit.

This property is similar to the InterDigitTimeout property in the Menu action.

This property must be used with detectDtmf. There are additional DTMF-related options you can configure with additional properties.

maxDigits DTMF Collection

Enter the maximum number of digits that the contact can enter for this action's prompt. For example, if the prompt instructs the contact to enter the last four digits of their ID number, set this property to 4. When the maxDigits value is reached, the script continues to execute.

This property is similar to the MaxDigits property in the Menuaction.

This property must be used with detectDtmf. There are additional DTMF-related options you can configure with additional properties.

maxPostEnergySilenceMS Contact Timeout Handling

Configure the amount of time in milliseconds that the bot waits after the contact pauses while speaking. The default value is 500 milliseconds.

You can increase the length of the pause to reduce the chances of the bot interrupting contacts. The longer the pause, the more latency the interaction's exchanges will have. Best practice is to increase this value only when you expect the contact's reply to be digits.

This property can be used alone.

maxUtteranceMilliseconds

Background Noise Handling

Contact Timeout Handling

Configure the amount of time in milliseconds that the bot waits after first detecting audio from the contact. This setting defines how long a response can be.

When the maxUtteranceMilliseconds limit is reached, the virtual agent attempts to determine an intent from the captured audio. This is helpful if there is a lot of background noise on the line. For more details about how this property works, see the Virtual Agent Prompt Behaviors page.

This property defaults to the same setting as millisecondsToWaitForUserResponse, even if you have customized millisecondsToWaitForUserResponse. You may need to change maxUtteranceMilliseconds, depending on how long the expected response from the contact is. For example, 10 seconds (10,000 milliseconds) is reasonable for a short one-word answer such as yes, no, or technical support. Longer expected responses would need more time. The maximum value is five minutes (300,000 milliseconds).

This property must be used with millisecondsToWaitForUserResponse.

millisecondsToWaitForUserResponse

Contact Timeout Handling

Background Noise Handling

Enter the amount of time in milliseconds that the action waits for a response from the contact before timing out. When this timeout is reached, the script takes the userInputTimeout branch.

This property can be used alone.

When configuring your virtual agent to handle noisy environments, this property must be used with maxUtteranceMilliseconds.

stripTerminator DTMF Collection

Set this property to true if you want to remove the value of the termination character from the captured DTMF tones.

This property must be used with detectDtmf. There are additional DTMF-related options you can configure with additional properties.

terminationCharacters DTMF Collection

Enter the character that you want contacts to enter to indicate they are finished entering digits. For example, you might want contacts to press the pound sign (#) when they finish entering an account number.

This property is similar to the Termination property in the Menu action.

This property must be used with detectDtmf. There are additional DTMF-related options you can configure with additional properties.

trimSilence Contact Timeout Handling

Set to true if you want the silence from the beginning of the utterance removed from the audio that's sent to the virtual agent. This is helpful to reduce the amount of time required to process each utterance. It can help reduce latency.

The default value for trimSilence is false.

This property can be used alone.