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 |