Ejemplo n.º 1
0
Archivo: Handler.php Proyecto: cwcw/cms
 /**
  * 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();
 }
Ejemplo n.º 2
0
 /**
  * Set the left SIP call leg
  *
  * @param Streamwide_Engine_Call_Leg_Abstract $leftCallLeg
  * @return void
  * @throws InvalidArgumentException
  */
 public function setLeftCallLeg(Streamwide_Engine_Call_Leg_Abstract $leftCallLeg)
 {
     if (!$leftCallLeg instanceof Streamwide_Engine_Sip_Call_Leg) {
         throw new InvalidArgumentException(__METHOD__ . ' requires parameter 1 to be an instance of Streamwide_Engine_Sip_Call_Leg');
     }
     if (!$leftCallLeg->isAlive()) {
         throw new InvalidArgumentException(__METHOD__ . ' requires parameter 1 to be an alive SIP call leg');
     }
     if (!$leftCallLeg->hasSentOrReceivedOk()) {
         throw new InvalidArgumentException(__METHOD__ . ' requires parameter 1 to be an alive SIP call leg that has received the OK signal');
     }
     parent::setLeftCallLeg($leftCallLeg);
 }
Ejemplo n.º 3
0
 /**
  * Set the left call leg
  *
  * @param Streamwide_Engine_Call_Leg_Abstract $leftCallLeg
  * @return void
  */
 public function setLeftCallLeg(Streamwide_Engine_Call_Leg_Abstract $leftCallLeg)
 {
     if (!$leftCallLeg instanceof Streamwide_Engine_Sip_Call_Leg) {
         throw new InvalidArgumentException(__METHOD__ . ' requires parameter 1 to be an instance of Streamwide_Engine_Sip_Call_Leg');
     }
     if ($leftCallLeg->isAlive()) {
         throw new InvalidArgumentException(__METHOD__ . ' requires parameter 1 to be a dead SIP call leg');
     }
     parent::setLeftCallLeg($leftCallLeg);
 }
Ejemplo n.º 4
0
Archivo: Factory.php Proyecto: cwcw/cms
 /**
  * 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']);
     }
 }