Beispiel #1
0
 /**
  * Listen for a TRANSFER request
  *
  * @return void
  */
 protected function _subscribeToEngineEvents()
 {
     $controller = $this->getController();
     // Start listen to TRANSFER signal
     $transferNotifyFilter = Streamwide_Engine_NotifyFilter_Factory::factory(Streamwide_Engine_NotifyFilter_Factory::T_EVT_SIG_PARAM_REMOTE, Streamwide_Engine_NotifyFilter_Factory::FILTER_EQUAL_TO, $this->_transferSource->getName());
     $controller->addEventListener(Streamwide_Engine_Events_Event::TRANSFER, array('callback' => array($this, 'onTransferRequested'), 'options' => array('autoRemove' => 'before', 'notifyFilter' => $transferNotifyFilter)));
     // End listen to TRANSFER signal
 }
Beispiel #2
0
 /**
  * Subscribe to FAIL, PRSDP/SDP/RING/PROGRESS events
  *
  * @return void
  */
 protected function _subscribeToEngineEvents()
 {
     $controller = $this->getController();
     $controller->addEventListener(Streamwide_Engine_Events_Event::FAIL, array('callback' => array($this, 'onSignalReceived'), 'options' => array('priority' => '1', 'notifyFilter' => Streamwide_Engine_NotifyFilter_Factory::factory(Streamwide_Engine_NotifyFilter_Factory::T_EVT_SIG_PARAM_REMOTE, Streamwide_Engine_NotifyFilter_Factory::FILTER_EQUAL_TO, $this->_remoteSipCallLeg->getName()))));
     for ($i = 0, $n = count($this->_provisionalResponses); $i < $n; $i++) {
         $event = $this->_provisionalResponses[$i];
         $controller->addEventListener($event, array('callback' => array($this, 'onSignalReceived'), 'options' => array('autoRemove' => 'before', 'priority' => '1', 'notifyFilter' => Streamwide_Engine_NotifyFilter_Factory::factory(Streamwide_Engine_NotifyFilter_Factory::T_EVT_SIG_PARAM_REMOTE, Streamwide_Engine_NotifyFilter_Factory::FILTER_EQUAL_TO, $this->_remoteSipCallLeg->getName()))));
     }
 }
Beispiel #3
0
 /**
  * @see Engine/Streamwide_Engine_Widget#_subscribeToEngineEvents()
  */
 protected function _subscribeToEngineEvents()
 {
     $controller = $this->getController();
     $okTransferNotifyFilter = Streamwide_Engine_NotifyFilter_Factory::factory(Streamwide_Engine_NotifyFilter_Factory::T_EVT_SIG_PARAM_REMOTE, Streamwide_Engine_NotifyFilter_Factory::FILTER_EQUAL_TO, $this->_sipCallLeg->getName());
     $controller->addEventListener(Streamwide_Engine_Events_Event::OKTRANSFER, array('callback' => array($this, 'onTransferSuccess'), 'options' => array('autoRemove' => 'before', 'notifyFilter' => $okTransferNotifyFilter)));
     $failTransferNotifyFilter = Streamwide_Engine_NotifyFilter_Factory::factory(Streamwide_Engine_NotifyFilter_Factory::T_EVT_SIG_PARAM_REMOTE, Streamwide_Engine_NotifyFilter_Factory::FILTER_EQUAL_TO, $this->_sipCallLeg->getName());
     $controller->addEventListener(Streamwide_Engine_Events_Event::FAILTRANSFER, array('callback' => array($this, 'onTransferFailure'), 'options' => array('autoRemove' => 'before', 'notifyFilter' => $failTransferNotifyFilter)));
     $trfInfoNotifyFilter = Streamwide_Engine_NotifyFilter_Factory::factory(Streamwide_Engine_NotifyFilter_Factory::T_EVT_SIG_PARAM_REMOTE, Streamwide_Engine_NotifyFilter_Factory::FILTER_EQUAL_TO, $this->_sipCallLeg->getName());
     $controller->addEventListener(Streamwide_Engine_Events_Event::TRFINFO, array('callback' => array($this, 'onTransferInfo'), 'options' => array('notifyFilter' => $trfInfoNotifyFilter)));
     $childNotifyFilter = Streamwide_Engine_NotifyFilter_Factory::factory(Streamwide_Engine_NotifyFilter_Factory::T_EVT_SIG_PARAM_REMOTE, Streamwide_Engine_NotifyFilter_Factory::FILTER_EQUAL_TO, $this->_sipCallLeg->getName());
     $controller->addEventListener(Streamwide_Engine_Events_Event::CHILD, array('callback' => array($this, 'onCallLegDeath'), 'options' => array('autoRemove' => 'before', 'notifyFilter' => $childNotifyFilter)));
 }
Beispiel #4
0
 /**
  * Make sure that both the SIP call legs are alive
  *
  * @return boolean
  */
 protected function _ensureAliveCallLegs()
 {
     if ($this->_leftCallLeg->isAlive() && $this->_rightCallLeg->isAlive()) {
         return true;
     }
     $this->dispatchErrorEvent(self::DEAD_CALL_LEG_ERR_CODE);
     return false;
 }