@phone::play

Places a phone call by dialing the dialString.

Syntax:

@phone::play(String playType, Object playData[, Object playOption] [, Boolean useAsync])

Parameters:

Returns:

None

Example:

The async flag allows scripts to play a pre-recorded file asynchronously, which allows Users to continue performing other actions while the file is playing. This feature can be used to enchance a caller's phone experience by minimizing processing delays, as the following examples illustrate:

Example 1 - play message synchronously

# the print statements will not be executed until the message has

# completed.

@phone::play("phrase", "Please wait while we retrieve your messages", false)

print("Print this message synchronously")

print("1")

print("2")

print("3")

@phone::getDigits(1)

Example 2 - play message asynchronously

# the print statements will execute right away while the message

# is still being played.

# the getDigits statement will block waiting for the play

# statement to complete

@phone::play("phrase", "Please wait while we retrieve your messages", true)

print("Print this message asynchronously")

print("1")

print("2")

print("3")

@phone::getDigits(1)

 

Best practices for playOption parameter

The following lines of code illustrate the rules used by the playOption parameter when determining whether to play a recording, use Text-To-Speech, or to spell out a phrase - in this example, the name of a Device.

Usage 1

@phone::play(" phrase ", $theDevice)

 

For this usage (which is the most common), xMatters will play the recording if it exists. If the recording does not exist, xMatters will use TTS. If TTS is not supported, xMatters will spell out the Device name.

Usage 2

@phone::play( " phrase ", $theDevice, "tts")

 

This usage produces the same results as Usage 1.

Usage 3

@phone::play( " phrase ", $theDevice, "spell")

 

For this usage, xMatters will play the recording, if it exists. If the recording does not exist, xMatters will bypass TTS and spell out the Device name.

Note:

When spelling out phrases, xMatters uses an index file containing phrases recorded by the same personality as the regular recordings. While this ensures compatibility, it also precludes the possibility of using a different voice to spell out phrases, other than re-recording all of the phrases at a significant cost.