/** * Revert the transfer (reconnect the call legs) * * @return void */ protected function _revertTransfer() { $this->_reconnector->reset(); $this->_reconnector->setLeftCallLeg($this->_transferSource); $this->_reconnector->setRightCallLeg($this->_transferSourceLink); $this->_reconnector->addEventListener(Streamwide_Engine_Events_Event::CONNECTED, array('callback' => array($this, 'onReconnectSuccess'), 'options' => array('autoRemove' => 'before'))); $this->_reconnector->addEventListener(Streamwide_Engine_Events_Event::ERROR, array('callback' => array($this, 'onReconnectFailure'), 'options' => array('autoRemove' => 'before'))); $this->_reconnector->connect(); }
/** * A CHILD signal can come from both ends signifying that one of the call legs has been * terminated. In both cases we need to dispatch an error event. * * @param Streamwide_Engine_Signal $signal * @return void */ protected function _handleChildSignal(Streamwide_Engine_Signal $signal) { return parent::_handleChildSignal($signal, self::CALL_LEG_DIED_ERR_CODE); }
/** * @see Engine/Call/Leg/Streamwide_Engine_Call_Leg_Connexant#reset() */ public function reset() { parent::reset(); $this->_okSignal = null; }
/** * Provide the connector with all needed dependencies to do its job * * @param Streamwide_Engine_Call_Leg_Connector $connector * @return void */ protected function _setConnectorDependencies(Streamwide_Engine_Call_Leg_Connector $connector) { if (isset($this->_params['leftCallLeg'])) { $connector->setLeftCallLeg($this->_params['leftCallLeg']); } if (isset($this->_params['rightCallLeg'])) { $connector->setRightCallLeg($this->_params['rightCallLeg']); } if (isset($this->_params['connectionParams'])) { $connector->setConnectionParams($this->_params['connectionParams']); } if (isset($this->_params['options'])) { $connector->setOptions($this->_params['options']); } }
/** * Setter for the _rightCallLeg property * * @param Streamwide_Engine_Call_Leg_Abstract $rightCallLeg * @return void * @throws InvalidArgumentException */ public function setRightCallLeg(Streamwide_Engine_Call_Leg_Abstract $rightCallLeg) { if (!$rightCallLeg instanceof Streamwide_Engine_Media_Server_Call_Leg) { throw new InvalidArgumentException(__METHOD__ . ' requires parameter 1 to be an instance of Streamwide_Engine_Media_Server_Call_Leg'); } if ($rightCallLeg->isAlive()) { throw new InvalidArgumentException(__METHOD__ . ' requires parameter 1 to be a dead MS call leg'); } parent::setRightCallLeg($rightCallLeg); }