Avaya Logo

Previous Topic

Next Topic

Book Contents

Book Index

tstop

The tstop instruction stops play on a conversation.

Synopsis

tstop([ wait ])

Description

The tstop instruction lets the script programmer stop any voice function (playing, coding, text-to-speech) on the current play conversation.

The optional wait argument can be used to cause the script to wait for voice activity to cease before continuing. Valid values for the wait flag are 0 (the default) to not wait and 1 to wait. If the wait flag is set, the successful return values of the tstop instruction depend on what voice function has been stopped. If the wait flag is not set, the tstop instruction returns 0 in r.0 for success or -1 for failure.

If voice coding has been stopped, register r.0 contains the phrase number (a positive integer) of the coded phrase, r.1 contains the phrase length, and r.2 is set to 1 (see the vc instruction). Otherwise, r.0 is set to 0 and r.1 and r.2 are not changed.

It is strongly recommended that the tstop instruction always be used with the wait flag set to 1. This ensures that any voice activity on the channel is stopped before the script continues execution. Failure to wait may leave TSM in a state that causes subsequent operations of the script (playing, coding, dialing, etc.) to fail. The default (no wait) is supported for older scripts which depend on its behavior.

One example where it may be useful to use tstop without the wait flag set is in a script event interrupt routine (see the event instruction). If this is done, the interrupt routine should not perform any instructions involving voice activity or telephony functions after doing the tstop (no wait). It also should return with r.0 set to a non-negative value so that original wait continues at the point of interruption (see the rts instruction). The script continues from this point once the speech activity has actually stopped.

Example

In the following example, the script plays the phrase music while it processes the transaction with the host computer. After this processing completes, the music is stopped, and the caller is informed of the results.

................... ...................

talk(int.MUSIC) /* Play music to the caller */
tflush(1,1) /* Do not let touch tones turn off music and don't wait */
dbase(0,FUDB,ch.ACCOUNT_ID,8,int.SELL_PRICE,4) /* Get info from host */

tstop(1)
talk("Your account has now been credited with Avaya stock for the price of")
tnum(int.SELL_PRICE)

...................... ...................

See also

© 2006 Avaya Inc. All Rights Reserved.