ADSI_HEX

Use the ADSI_HEX state table to download SDC functions to the ADSI telephone and to execute those functions.

This state table is similar to the ADSI and ADSI_I state tables, but the parameter string it sends to the ADSI telephone is a hexadecimal representation of binary characters. You might want to use this state table to download a function that contains a special character, such as the currency symbol for a U.K. pound (£).

ASCII syntax

InvokeStateTable ("DIRECT", ADSI_HEX, mode, file, func, parms, interrupt);

Entry point

mode
Specify one of the following values:
data_mode
Download function in data mode.

When you select data mode, the state table assumes that the ADSI telephone has been put into data mode using the switch_to_data SDC command. When the ADSI telephone is in data mode, data transfer is significantly faster because the initial CAS tone/DTMF exchange is not necessary.

voice_mode
Download function in voice mode.

In voice mode, each data transmission is preceded by a CAS tone/DTMF sequence.

Description

file
The name of the SDC script file from which the ADSI function (specified in func) will be executed. The name is appended to the directory name $CUR_DIR/adsi/.
func
The name of the function to be executed.
parms
A string of parameters (containing printable hexadecimal characters) to be passed to the ADSI function.

If you want to pass multiple parameters, you must concatenate them into one string, and separate each parameter using a 001 (X'01') delimiter. You could use the ADSI_Parameters state table to do this (see ADSI_Parameters).

If no parameters are to be passed to the ADSI function, set the parms parameter to a null string.

interrupt
Set this parameter to allow use of the telephone in an emergency while data is being downloaded.

Specify one of the following values:

0
Transmission of data for an on-hook download is not interrupted when the telephone user presses a DTMF key or lifts the handset. This is the default.
1
Transmission of data is interrupted when the user presses a DTMF key or lifts the handset.

Results

The InvokeStateTable action terminates with a result that indicates whether or not the operation was successful. If it was not, the result shows the reason:

0
Success
1
SDC function file not found
2
Function not found within the SDC function file
4
Error communicating with the ADSI device (no CAS tone acknowledgment)
5
Error communicating with the ADSI device (after 5 retries)
6
Line problem
7
Caller hung up

Example

In this example, the ADSI_HEX state table downloads the function named show from the file puthex.sdc. The hexdata parameter contains the hexadecimal representation of the binary data.

AssignData(hexdata, "ASSIGN", "243132332c209c9d9e9f2E")
InvokeStateTable("DIRECT", ADSI_HEX, voice_mode,
                "puthex.sdc",
                "show",
                hexdata,
                0 )

Related state tables