When a call is connected to another number using the $call->connect() method, the $call object has $call->peer set to the call object of the 2nd leg. But the peer parameter of the call retrieved using getCall() is not set to the original call. This means it is not possible to reference the original call object using the peer object.
Since it is a "bridged" call, it would seem that these should point to each other.
When a call is connected to another number using the $call->connect() method, the $call object has $call->peer set to the call object of the 2nd leg. But the peer parameter of the call retrieved using getCall() is not set to the original call. This means it is not possible to reference the original call object using the peer object.
Since it is a "bridged" call, it would seem that these should point to each other.
EXAMPLE CODE:
$action = yield $call->connect(...$devices); if ($action->isSuccessful()) { $connected = $action->getCall(); }
$digitdetect1 = yield $connected->detectDigitAsync(); $digitdetect2 = yield $call->detectDigitAsync();
$detectcb = function($call,$params) { $call->peer->playSilence(1); print_r($params); };
$call->on('detect.update',$detectcb);
$connected->on('detect.update', $detectcb);
RESULT: When digits are detected on $connected, the following error occurs:
PHP Fatal error: Uncaught Error: Call to a member function playSilence() on null