Command execution

Last updated on
30 April 2025

With the exception of isError() or getErrorMessage(), the majority of VoipScript methods simply add commands to an internal list maintained by each VoipScript object. It is only during the execution of a VoIP call that those commands are going to be executed, one after the other.

For instance, in the following example

$script = new VoipScript('hello_world');
$script->addSay('Hello world');
$script->addHangup();

$call = new VoipCall();
$call->setScript($script);
$number = '+1234567890';
$call->setDestNumber($number);
$rc = voip_dial($call);

The execution of the commands say and hangup will only happen after $call is passed to the voip_dial() command.

Help improve this page

Page status: Not set

You can: