gsmMakeCallX (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All with voice/DTMF capability

Firmware version:

1.00 / 1.00.00


The gsmMakeCallX function is an extended version of the gsmMakeCall function that will return more detailed information about the result of the call. It will also offer the possibility of suppressing the caller identification of the device for the party called.

 

The function dials the number specified and waits for either completion, timeout, or an error.

The number can contain "-" and " " (dash and space) as part of the number to call.

"Timeout" specifies how many seconds the RTCU should wait for the other party to pick up the phone.

 

 

Input:

phonenumber : STRING (max length is 20, excluding " " and "-")

Number to call.

 

CLIR : BOOL (Default: FALSE)

CLIR = Calling Line Identification Restriction.

When TRUE, the device will suppress presentation of the telephone number to the called party.

 

timeout : SINT (1..65, Default: 45)

Number of seconds to wait for an answer.                

 

Returns: INT

0

- Call was successful. Connection between GSM module and the call recipient established.

1

- No dial tone (network occupied).

2

- Busy (call recipient is busy).

3

- No answer (call recipient is not answering).

4

- No carrier (network problem or voice call already active).

5

- Not connected to GSM network.

6

- Call aborted by caller (gsmHangup() called).

7

- GSM Module occupied by data call.

8

- GSM Module not present on the device.

9

- Unspecified error.

 

Declaration:

FUNCTION gsmMakeCallX : INT;
VAR_INPUT
  phonenumber : STRING;
  CLIR       : BOOL := FALSE;
  timeout     : SINT := 45;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
// Turn on power to the GSM module
gsmPower(power := TRUE);
 
BEGIN
  ...
  // Make a call, wait maximum 10 seconds for an answer
  IF gsmMakeCallX(phonenumber := "+44 22 33 44 55", CLIR := TRUE, timeout:=10) = 0 THEN
     // Successful, we have established a connection
    // Play the "Hello" message
    voiceTalk(message := "Hello");
    // Hangup the phone
    gsmHangup();
     ...
  END_IF;
END;
 
END_PROGRAM;