Default Next Prompt Behavior Snippet

The Default Next Prompt Behavior snippet allows you to customize the default behaviors for all turns in the conversation. If you want to customize the behaviors for a specific turn, use a 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 Transcribeaction or the Voicebot Exchange action.

Add a Default Next Prompt Behaviors Snippet

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

    DYNAMIC defaultNextPromptBehaviors
    <add behaviors as needed>
    ASSIGN defaultNextPromptBehaviorsOutJson="{defaultNextPromptBehaviors.asjson()}"
  4. Add the behaviors you want to be the default for this script, using this syntax:

    ASSIGN defaultNextPromptBehaviors.[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 the defaultNextPromptBehaviors object. In the example code, this is defaultNextPromptBehaviorsOutJson.

Prompt Behavior Properties

The following table describes the properties available for Default Next Prompt Behavior snippets. The properties allow you to configure the default 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 Default 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.

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.