dtmfGetNumber (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 waits for a number typed in via DTMF key during an active GSM voice session. The function waits for a maximum number of milliseconds between each key press, and if no key is pressed within the timeout period, the function returns with -1 which indicates the timeout. If a complete number has been received, this number will be returned to the caller. The input sequence must be terminated by pressing the "#" (hash) key.

 

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

 

 

Input:

timeout : INT (0..32767) Default 3000

Timeout period in milliseconds between DTMF key-press.

 

Returns: DINT (0..999999999)

-1 : Timeout in waiting for a DTMF key-press or an invalid entry (too long).

Otherwise the number typed.

 

Declaration:

FUNCTION dtmfGetNumber : DINT;
VAR_INPUT
  timeout : INT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
VAR
  tmp : DINT;
END_VAR;
 
PROGRAM test;
 
BEGIN
  ...
  // Wait for a DTMF number, timeout between key presses is set to 5 seconds
  tmp := dtmfGetNumber(timeout:=5000);
 
  // Check if timeout in waiting for a number
  IF tmp = -1 THEN
     ...
  // Number received without timeout
  ELSE
     ...
  END_IF;
END;
 
END_PROGRAM;