Avaya Logo

Previous Topic

Next Topic

Book Contents

Book Index

tic

tic

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_UN (1)
CV_NC (22)

Unassigned number
Number changed

Provisioning or
Protocol Error (`p')

CV_CU (6)
CV_NUR (18)
CV_FR (29)
CV_RTSE (30)
CV_NU (31)
CV_TFAIL (41)
CV_RFNS (50)
CV_OCB (52)
CV_ICB (54)
CV_BCNPA (58)
CV_SOONAU (63)
CV_BCNI (65)
CV_CTNI (66)
CV_RFNI (69)
CV_ICR (81)
CV_ICDNE (82)
CV_ID (88)
CV_MIEIM (96)
CV_MTNEONI (97)
CV_MNCWTCS (98)
CV_IIEC (100)
CV_MNCOMPAT (101)
CV_ROTE (102)

Channel unacceptable
No user response
Facility rejected
Response to status enquiry
Normal, unspecified
Temporary failure
Requested facility not subscribed
Outgoing calls barred
Incoming calls barred
Bearer capability not presently available
Service option not available
Bearer capability not implemented
Channel type not implemented
Requested facility not implemented
Invalid call reference
Identified channel does not exist
Incompatible destination
Manditory IE is missing
Msg. type nonexistent or not implemented
Msg. not compatible with call state
Invalid information element contents
Msg. not compatible with call state
Recovery on timer expiry

Dialtone Detected ('D')

CV_NCC (16)

Normal call clearing

Busy ('B')

CV_UB (17)

User busy

Fast Busy (`F')

CV_NRTSTN (2)
CV_CR (21)
CV_NCOCA (34)
CV_NETFAIL (38)
CV_SEC (42)
CV_UID (43)
CV_RCCNA (44)
CV_CALLPREEMPTED (45)

No route to specific transit network
Call rejected
No circuit or channel available
Network out of order
Switching equipment congestion
User information discarded
Requested circuit not available
Pre-empted

Answer Supervision (`P')

 

 

Hardware Failure, Undetermined Reason (-1)

 

 

Timeout - No Answer, Reason Not Provided (-2)

 

 

Illegal Dial String (-3)

CV_INF (28)

Invalid number format

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 was 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 provided 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_UN, UnassignedNumber)

/* Did PRI indicate that the number was incomplete? */

jmp (r.1 == CV_INF, InvalidNumberFormat)

/* Did PRI indicate that the number has been changed? */

jmp (r.1 == CV_NC, 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, NUMBER_CHANGED, ch.RESULT, ch.DIALED_NUMBER, ... )

quit()

UnassignedNumber:

/* 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()

InvalidNumberFormat:

/* Send request to database to mark this phone number as */

/* bad. (Client's number can be check for completeness) */

dbase (DIP1, INVALID_NUMBER, ch.RESULT, ch.DIALED_NUMBER, ... )

quit()

Continue:

/* continue with normal call processing */

talk ( "Hello" )

...

quit()

Using tic with Full CCA

Be aware that if Full CCA (available only for US and Canada) determines that an outbound call cannot be completed because of a ring-no answer, the transaction should hang up the call using a tic('h') as soon as possible. If the call is not hung up immediately, the called party could answer (their phone is still ringing). The application will be unaware of this and will hang up on the called party as soon as the application completes. This not only annoys the called party but also could result in the calling party being billed for a failed call.

Do not use the tic('W') or tic('w') instruction with Full CCA.

Full CCA Call Dispositions

The following table lists the possible return values for the tic('C'), tic('D'), and tic('O') instructions when Full_CCA is turned on using the setcca instruction. Note that the set of possible return values depends on the type of channel: E1, T1, or PRI.

 

 

 

 

 

Meaning

Return values

Available on

r.0

r.1

T1 or E1

PRI

Answer detected (for example, voice energy detected)

'A'

0

(see footnote 1)

(see footnote 1)

Answer supervision from switch (or DTMF connection tone detected from Avaya DEFINITY ECS or compatible switch)

'P'

0

yes

yes

Busy

'B'

0

yes

yes

Fast busy

'F'

0

yes

yes

Ring no answer

'N'

0

yes

yes

Modem tone

'T'

0

yes

yes

Dialtone detected (see footnote 2)

'D'

0 (see footnote 2)

no

yes

Internal hardware or software error or dialing error

-1

0

yes

yes

Timeout (no call progess tones detected within the timeout period)

-2

0

yes

yes

Illegal dial string passed

-3

0

yes

yes

Touch tone entry detected

't'

0

yes

yes

1. By default, speech energy is disabled for T1 and PRI channels. However, it can be enabled using the setcca script instruction.

2. The disposition of calls on PRI channels is based not only on Full CCA but also on information provided by the switch (the system will respond to the first disposition returned from either source). When the disposition is provided by the switch, more specific information (the ISDN cause value) is available in register r.1. For more information, see "The tic(`C') and tic(`O') Return Values and ISDN Cause Values."

You should be aware of the following issues when using these dispositions:

Example

The following example shows 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)

noAns:

tic('h') /* put line on-hook to stop ringing */

busy:

dbase ( .... ) /* report result to controlling DIP */

goto (nextcall)

answer:

talk("Hello, you may be the winner of a free trip to Hawaii")

dbase ( .... ) /* report result to controlling DIP */

goto (nextcall)

© 2006 Avaya Inc. All Rights Reserved.