API Documentation (Beta)

transfer

Description

string transfer ( string $destination [, int $type [, string $DTMF_digits [, int $max_duration [, int $time_out [, string $call_tag]]]]] )

transfer is used to connect the call to another destination. In most cases it is used to initiate an outbound call to a phone number.

Parameters

destination

The string that specifies the destination. Destination can be one of the following:

Type Format
Phone Phone number should be of the following format: (country code)(phone number). e.g. To call a San Diego, USA phone number, it should look like 18585551212.
SIP URI It should be specified as sip:<sip uri>
For example, sip:identity@mysipserver.com,
sip:username:password@mysipserver.com,
sip:<number>@<sip-id> - to call a <number> using a SIP server that was added using ‘setsipserver’ TringMe API
Channel Channel as created by 'setchannel' TringMe API
Gtalk It should be specified as gtalk:user@gmail.com

type

This specifies whether the call is a blind transfer or a bridged transfer. Value of 0 indicates a blind transfer and value of 1 indicates a bridged transfer. A bridged transfer allows the application to continue execution when the transfer is completed, whereas a blind transfer terminates the application once the outbound call has been initiated and connected. The default value of this parameter is set to 0 (blind transfer).

DTMF_digits

A string of keys to dial after connecting the call. Valid digits in the string include: any digit (0-9), #, and *. The maximum length of DTMF string can be 32 characters. This is useful in cases where you want to dial an extension after the call is connected. By default, no DTMF digits are dialed.

max_duration

This specifies the maximum amount of time in seconds that VoicePHP will schedule the call for. After the expiration of maxDuration, the call will be disconnected automatically. By default, there is no max duration set.

time_out

This specifies the amount of time in seconds that VoicePHP will attempt to connect the call before returning a NOANSWER return code. By default, timeout is set to 60 sec.

call_tag

This specifies the calltag that should be passed to the call being initiated. If no calltag is specified, any calltag that was passed to launch this VoicePHP script will be automatically sent.

Return Values

If successful, it returns SUCCESS.
On failure, it will return one of the following strings:

  • - BAD DTMF: Invalid DTMF specified. This can also happen if the length of specified DTMF exceeds the maximum acceptable DTMF characters.
  • - BUSY: Destination number is busy.
  • - NOANSWER: Destination did not answer the call.
  • - CONGESTION: Destination network could not place the call.
  • - UNSUPPORTED: An unsupported operation was attempted.