/** * 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(); }
/** * Set the right SIP call leg * * @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_Sip_Call_Leg) { throw new InvalidArgumentException(__METHOD__ . ' requires parameter 1 to be an instance of Streamwide_Engine_Sip_Call_Leg'); } if (!$rightCallLeg->isAlive()) { throw new InvalidArgumentException(__METHOD__ . ' requires parameter 1 to be an alive SIP call leg'); } if (!$rightCallLeg->hasSentOrReceivedOk()) { throw new InvalidArgumentException(__METHOD__ . ' requires parameter 1 to be an alive SIP call leg that has received the OK signal'); } parent::setRightCallLeg($rightCallLeg); }
/** * Set the right call leg * * @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_Sip_Call_Leg) { throw new InvalidArgumentException(__METHOD__ . ' requires parameter 1 to be an instance of Streamwide_Engine_Sip_Call_Leg'); } if ($rightCallLeg->isAlive()) { throw new InvalidArgumentException(__METHOD__ . ' requires parameter 1 to be a dead SIP call leg'); } parent::setRightCallLeg($rightCallLeg); }
/** * 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']); } }