Avaya Logo

Previous Topic

Next Topic

Book Contents

Book Index

Sample script using voice coding instructions

The following example illustrates how the script instructions used for voice coding work together. The example script is a code segment which does the following:

Note that in this example, return codes from instructions such as phreserve, vc, and phremove are not checked by the script. These checks were not shown in order to make this example as simple as possible. Normally, all return codes should be examined so that errors can be detected. The discussion for each instruction describes the details pertinent to the return codes for that instruction.

#include "/att/include/codestyle.h"

tic('a') /*answer the phone*/

tfile("list.example")

talk("enter talkfile")

getinput(ch.TALK,2) /*get talkfile id*/

atoi (int.TFILE,ch.TALK) /*convert TT number to integer value*/

phreserve(200,int.TFILE,100,ADPCM32) /*create phrase 200*/

vctime(5,10) /*initial timeout 5 seconds*/

/*interword timeout 10 seconds*/

vc('b',100,ADPCM32) /*begin coding*/

talk("the new phrase is")

setalk(int.TALK) /*change talkfiles*/

load(ch.OLD,r.0) /*save old talkfile id)*/

talk(int.200) /*play phrase just coded)*/

setalk(int.OLD) /*change back to old talkfile*/

talk("now removing phrase")

phremove(200,int.TFILE) /*remove phrase just created*/

quit()

© 2006 Avaya Inc. All Rights Reserved.