The Voice Call service can be used to set up a voice connection between two telephone connections. For specific details please read the API Documentation.
Normally the Service works as followed:
Call the first participant.
If the connection is successful, call the second participant.
If second participant connects succesfully, both participants are connected.
The call is open until one of the participants hangs up or the expire mechanism intercepts.
Example 790. Call two numbers
<?php
$service = new Zend_Service_DeveloperGarden_VoiceCall($config);
$aNumber = '+49-30-000001';
$bNumber = '+49-30-000002';
$expiration = 30; // seconds
$maxDuration = 300; // 5 mins
$newCall = $service->newCall($aNumber, $bNumber, $expiration, $maxDuration);
echo $newCall->getSessionId();
If the call is initiated, you can ask the result object for the session ID and
use this session ID for an additional call to the callStatus
or tearDownCall() methods. The second parameter on the
callStatus() method call extends the expiration for this call.
Example 791. Call two numbers, ask for status, and cancel
<?php
$service = new Zend_Service_DeveloperGarden_VoiceCall($config);
$aNumber = '+49-30-000001';
$bNumber = '+49-30-000002';
$expiration = 30; // seconds
$maxDuration = 300; // 5 mins
$newCall = $service->newCall($aNumber, $bNumber, $expiration, $maxDuration);
$sessionId = $newCall->getSessionId();
$service->callStatus($sessionId, true); // extend the call
sleep(10); // sleep 10s and then tearDown
$service->tearDownCall($sessionId);




