Use the ADSI_Get_Text state table to receive encoded DTMF data from an ADSI telephone and store that data as ASCII characters.
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_Text state table stores the data as the ASCII character 1. Compare this with the ADSI_Get_HEX state table in ADSI_Get_HEX.
If the ADSI_Get_Text 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_Text, 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:
This example is taken from the ADSI_Banking state table. In this example, the state table waits approximately 30 minutes to receive 20 characters from the telephone, and converts those characters to ASCII format:
InvokeStateTable("DIRECT", ADSI_Get_Text, get,
surname,
"20",
"30")