dtmfGetKey (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

MX2 pro, DX4 pro, AX9, MX2 turbo/encore/warp, AX9 turbo/encore, NX-200, NX-400, NX-900, NX-910, LX2, LX4, LX5

Firmware version:

1.00 / 1.00.00


This functions waits for a DTMF key press during an active GSM voice session. The function waits for a maximum number of milliseconds, and if no key is pressed within the timeout period, the function returns with -1 which indicates the timeout. If a key press has been detected before the timeout period, a number identifying the actual key press is returned.

 

Any voice messages being played (or in the queue) with voiceTalk  will be canceled when a DTMF key is pressed during a call to dtmfGetKey. Also see voiceStop.

 

Input:

timeout : INT (0..32767) Default 3000

Timeout period in milliseconds to wait for a DTMF tone.                

 

Returns: INT (-1, 0..15)

-1:

Timeout in waiting for the DTMF tone.

0..9:

DTMF key "0".."9".

10:

DTMF key "*" (star).

11:

DTMF key "#" (hash).

12:

DTMF "A".

13:

DTMF "B".

14:

DTMF "C".

15:

DTMF "D".

 

Declaration:

FUNCTION dtmfGetKey : INT;
VAR_INPUT
  timeout : INT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
BEGIN
  ...
  // Wait for a DTMF key press for maximum 5 seconds
  CASE dtmfGetKey(timeout:=5000) OF
    // Timeout in waiting for a key press
    -1 :
     ...
   // The key "5" has been pressed
  5 :
     ...
  END_CASE;
END;
 
END_PROGRAM;