Use the ADSI_Get_HEX state table to receive encoded DTMF data from an ADSI telephone and store that data in hexadecimal format.
For example, when the caller presses key 1, the send_encoded_user_input statement (see send_encoded_user_input) sends the value 1, and the state table receives the encoded DTMF data string 31.The ADSI_Get_HEX state table stores the data as two hexadecimal characters, 3 and 1. Compare this with the ADSI_Get_Text state table in ADSI_Get_Text.
If the ADSI_Get_HEX state table receives any DTMF data that is not in Table 1, it returns with the result 0. The ADSI_Banking state table uses this feature: it expects the caller to press the Enter softkey to terminate the data they type. This soft key sends the two DTMF tones **.
InvokeStateTable ("DIRECT", ADSI_Get_HEX, get, text, MaximumLength, TimeOut);
The state table returns with result 0 when it receives this many characters.
If more than this many characters are sent, your application must retrieve or discard them:
However, note that the state table returns before this time (with result 0) if it receives DTMF data that is not in Table 1.
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:
In this example, the state table waits approximately one minute to receive the 4 bytes of data into the field named cpeid:
InvokeStateTable("DIRECT", ADSI_Get_HEX, get,
cpeid,
"4",
"1")
Table 1 shows how the ADSI component stores the DTMF data.
DTMF Data Received | Data Stored | DTMF Data Received | Data Stored | |
---|---|---|---|---|
0 |
0 |
*1 |
A |
|
1 |
1 |
*2 |
B |
|
2 |
2 |
*3 |
C |
|
3 |
3 |
*4 |
D |
|
4 |
4 |
*5 |
E |
|
5 |
5 |
*6 |
F |
|
6 |
6 |
|||
7 |
7 |
|||
8 |
8 |
|||
9 |
9 |