The tic instruction controls a telephone interface line (channel).
Synopsis
tic('C', ctype.dialstr, type.rings)
tic('D', ctype.dialstr)
tic('O', ctype.dialstr)
tic('X', ctype.dialstr, type.xferwhen)
tic('a')
tic('d', ctype.dialstr)
tic('h')
tic('o', ctype.dialstr)
tic('x', ctype.dialstr, type.xferwhen)
Description
The tic instruction provides the script with control functions for the telephone interface line (channel) that the script is currently using. The function that the tic instruction performs depends on the value of its first argument. These argument values and their corresponding functions are listed below.
Note:
This instruction handles differences between telephony types better than tic(`O').
The tic instruction uses script registers 0 (r.0) and 1 (r.1) to return a result. This result may differ according to whether the script is using a T1, E1, or PRI channel. Where such variations exist, they are noted below.
C |
Call a number and wait for the disposition. Dial ctype.dialstr. Wait for number of rings given in type.rings for answer, or call progress tone other than ringing, or no answer. |
D |
Dial ctype.dialstr. Wait for any call progress tone, and then resume the script. |
O |
Originate (go off-hook and dial ctype.dialstr). Wait for the first call progress tone (CPT), and then resume the script. Note that the first CPT could be a Ringback, with no indication of Answer or No answer disposition. |
X |
Transfer to ctype.dialstr based on type.xferwhen, wait for any call progress tone, and then resume the script. |
a |
Answer the line (go off-hook). |
d |
Dial ctype.dialstr, and then resume the script. |
h |
Hang up the line (go on-hook). |
o |
Originate (go off-hook and dial ctype.dialstr), and then resume the script. |
x |
Transfer to ctype.dialstr based on type.xferwhen, and then resume the script. |
The following table lists the possible return values for the different forms of the tic instruction. Note that the set of possible return values depends on the type of channel: T1, E1, or PRI.
Meaning |
Return values |
For tic |
Available on | |
� |
r.0 |
� |
T1 or E1 |
PRI |
Instruction successfully completed |
0 |
'a', 'd', 'h', 'o', 'x' |
yes |
yes |
Answer detected (e.g., voice energy detected or ringing stopped) |
'A' |
'C' , 'X' |
no |
no |
Answer supervision from switch (or DTMF connection tone detected from DEFINITY ECS) |
'P' |
'D', 'O', 'C' |
yes |
yes |
Busy |
'B' |
'D', 'O', 'C' |
no� |
yes |
Fast busy (reorder tone) |
'F' |
'D', 'O', 'C' |
no� |
yes |
Audible ringing |
'R' |
'D', 'O' |
�no |
no� |
Dialtone detected |
'D' |
'D', 'O', 'C' |
�no |
yes |
Stutter dialtone detected |
'S' |
'D', 'O', 'C' |
�no |
no� |
ISDN vacant code |
'v' |
(any) |
�no |
yes |
Provisioning or protocol error |
'p' |
(any) |
�no |
yes |
Internal hardware or software error or dialing error |
-1 |
(all) |
yes |
yes |
Timeout (no call progress tones detected within the timeout period) |
-2 |
(all except 'h') |
yes |
yes |
Illegal dial string passed |
-3 |
'D', 'O', 'C', 'X', 'd', 'o', 'x' |
yes |
yes |
Touch tone entry detected |
't' |
'O', 'C' |
yes |
yes |
Intercept tone heard representing an invalid extension (on DEFINITY ECS or other Avaya PBX) |
's' |
'O', 'D', 'C' |
�no |
no� |
Caller disconnected during transfer |
'h' |
'D' |
�no |
�no |
If your script encounters a secondary dial tone, you can use a sequence of two tic instructions, the first dialing the access number and waiting for secondary dial tone, and the second dialing the remainder of the telephone number.
If you use the tic('d') instruction to send touch tones between two scripts, the tones may be lost if one script sends tones before the other script turns on its DTMF receiver. To avoid this problem, insert a delay of more than 70 milliseconds (for example, use nap(10) to cause the script to sleep for 100 milliseconds) before the tic('d') instruction.
If the system encounters a glare condition (that is, an incoming call is detected at almost the same moment the system is dialing out), the system drops the outgoing call and answers the incoming call. The termination of the script dialing out is treated as a hangup, meaning that if there is an EHANGUP event subroutine defined by the script (see the event instruction), it is executed before the script ends. This may mean that more than the usual number of rings are heard by the caller before the incoming call is answered.
Example
The following example is a portion of a script that uses the tic instruction. In this example, the script copies 9999 into NUMBER, then originates a call to that number. Depending on what is returned, the script either jumps to the end or ok label.
#define NUMBER 5
strcpy(ch.NUMBER, "9999")
tic('O', ch.NUMBER)
jmp(r.0 == -1, end) /* hardware failure */
jmp(r.0 == -2, end) /* timeout, no response */
jmp(r.0 == 'B', end) /* busy */
jmp(r.0 == 'R', ok) /* ring */
end:
quit()
ok:
tic('h')
rts()
Feature related changes for PRI
The following information applies to the tic instruction when using it with PRI in an application.
Using tic with PRI
The supported tic instruction options for PRI are listed in the following table. These options are used in the same manner for PRI as for T1.�
Option |
Function |
a |
Answer an incoming call |
h |
Disconnect (hangup) a call |
o |
Originate a call |
C, O |
Originate a call & wait for Answer Supervision |
d |
Dial touch-tone digits |
Some options to the tic instruction are not applicable to the PRI. These options are listed in the following table.
Option |
Function |
D |
Dial digits and wait for tones |
The tic(`C') and tic(`O') Return Values and ISDN Cause Values
The PRI implementation of the tic(`C') (Call) and tic(`O') (Originate) instructions provide additional return code information for disconnected calls on a T1 interface. Register r.1 returns the ISDN cause value (if available) for an incomplete call. These cause values are returned by the network and are passed to the script. The cause value is also passed in register r.1 for a disconnect event. The following table contains a list of ISDN cause values returned in register r.1. These are arranged in groups according to the more general call disposition value returned in register r.0.
Note:
If the called party is not an ISDN subscriber, there is no ISDN cause value and -2 is returned to the script. Until ISDN is more widely used, -2 is a common return. The include (header) file (/att/include/tas_defs.h) provides macro definitions of these values. This file can be used by your application by including the following line in your script source file: #include "tas_defs.h"
Call disposition value (r.0) |
Return value (r.1) |
Meaning |
Vacant Code (`v') |
CV_UNASSNUM (1) CV_NUMCHANGE (22) |
Unassigned number |
Provisioning or |
CV_UNACCEPTCHAN (6) |
Channel unacceptable |
Dialtone Detected ('D') |
CV_NORMALCLR (16) |
Normal clearing |
Busy ('B') |
CV_USERBUSY (17) |
User busy |
Fast Busy (`F') |
CV_NOROUTE (2) |
No route |
Answer Supervision (`P') |
� |
� |
Hardware Failure, Undetermined Reason (-1) |
� |
� |
Timeout - No Answer, Reason Not Provided (-2) |
� |
� |
Illegal Dial String (-3) |
CV_INVALIDNUM (28) |
Invalid Number |
You should be aware of the following issues when using these ISDN values:
Example of PRI heading
The following example shows how to use this feature in an outbound call script. This script outdials customer numbers retrieved from an account database. If the number dialed is unassigned, invalid, or incomplete, the script sends a message back to the database indicating this. The customer record can then be checked.
#include "tas_defs.h" /* VIS provide header file */
#include "dip_defs.h" /* Application dip header file */
#define DIALED_NUMBER 0 /* location of dialed number string */
/* Specify the speech file you wish to use */
tfile(application)
Begin:
/* Get the number to be dialed from a database */
dbase (DIP14, RETRIEVE_NUMBER, ch.DIALED_NUMBER, ... )
/* Telephone number to be dialed is now in ch.DIAL_NUMBER */
tic(`O', ch.DIALED_NUMBER)
/* Check to see if the call was answered */
jmp (r.0 == 'P', Continue) /* Call answered, speak */
/* Call was not answered */
/* Did PRI indicate that the number does not exist? */
jmp (r.1 == CV_UNASSNUM, NumberUnassigned)
/* Did PRI indicate that the number was incomplete? */
jmp (r.1 == CV_INVALIDNUM, NumberIncomplete)
/* Did PRI indicate that the number has been changed? */
jmp (r.1 == CV_NUMCHANGE, NumberChanged)
/* Otherwise hangup */
tic(`h')
quit()NumberChanged:
/*Send request to database to mark this telephone number as */
/* changed. (Client's number can be updated later) */
dbase (DIP14, CHANGED_NUMBER, ch.RESULT, ch.DIALED_NUMBER, ... )
quit()
NumberUnassigned:
/* Send request to database to mark this telephone number
/* as unassigned. (Check Client's number for accuracy) */
dbase (DIP1, UNASSIGNED_NUMBER, ch.RESULT, ch.DIALED_NUMBER, ... )
quit()
NumberIncomplete:
/* Send request to database to mark this phone number as */
/* bad. (Client's number can be check for completeness) */
dbase (DIP1, INCOMPLETE_NUMBER, ch.RESULT, ch.DIALED_NUMBER, ... )
quit()
Continue:
/* continue with normal call processing */
talk ( "Hello" )
...
quit()
Example
The following example is an excerpt from a script showing how a developer might use the setcca and tic instructions in a Full CCA application.
setcca(1,10,-1)
nextcall:
dbase( .... ) /* get number to dial from DIP */
tic(`O', r.3) /* call number in register 3 */
jmp(r.0 == 'N', noAns) /* no answer after 10 rings */
jmp(r.0 == 'B', busy)
jmp(r.0 == 'F', retry)
jmp(r.0 == 'A', answer)
jmp(r.0 == 's', SIT)
jmp(r.0 == -4, noResource)
noAns:
tic(`h') /* put line on-hook to stop ringing */
busy:
dbase ( .... ) /* report result to controlling DIP */
goto (nextcall)
SIT:
jmp(r.1 == 'R', retry)
jmp(r.1 == 'r', retry)
jmp(r.1 == 'K', retry)
jmp(r.1 == 'k', retry)
dbase ( .... ) /* report result to controlling DIP */
answer:
talk("Hello, you may be the winner of a free trip to Hawaii")
dbase ( .... ) /* report result to controlling DIP */
goto (nextcall)