/** * 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 }
/** * 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())))); } }
/** * @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))); }
/** * @return void */ protected function _killLeftCallLeg() { $shouldKillLeftCallLeg = $this->_options[self::OPT_KILL_LEFT_CALL_LEG]; if ($shouldKillLeftCallLeg) { $killSignal = Streamwide_Engine_Signal::factory(Streamwide_Engine_Signal::KILL, $this->_leftCallLeg->getName()); if ($killSignal->send()) { $this->_leftCallLeg->setDead(); } } }