gsmMakeCall (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All with voice/DTMF capability

Firmware version:

1.00 / 1.00.00


This establishes a voice connection to a telephone. 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 before the call returns FALSE.

 

Input:

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

Number to call.

 

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

Number of seconds to wait for answer before returning FALSE.                

 

Returns: BOOL

TRUE:

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

FALSE:

Connection could not be established (call recipient busy etc.)

 

Declaration:

FUNCTION gsmMakeCall : BOOL;
VAR_INPUT
  phonenumber : STRING;
  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 gsmMakeCall(phonenumber := "+44 22 33 44 55", timeout:=10) THEN
     // Successful, we have established a connection
    // Play the "Hello" message
    voiceTalk(message := "Hello");
    // Hangup the phone
    gsmHangup();
     ...
  END_IF;
END;
 
END_PROGRAM;