예제 #1
0
파일: Decorator.php 프로젝트: cwcw/cms
 /**
  * Arm the timer
  *
  * @return void
  */
 protected function _armTimer()
 {
     $this->_timer->reset();
     $this->_timer->setOptions(array(Streamwide_Engine_Timer_Timeout::OPT_DELAY => $this->_ringDuration));
     $this->_timer->addEventListener(Streamwide_Engine_Events_Event::TIMEOUT, array('callback' => array($this, 'onTimeout'), 'options' => array('autoRemove' => 'before')));
     $this->_timer->arm();
 }
예제 #2
0
파일: Overlay.php 프로젝트: cwcw/cms
 /**
  * Disarm the internal timer
  *
  * @return boolean
  */
 protected function _disarmTimer()
 {
     if ($this->_timer->isArmed()) {
         return $this->_timer->disarm();
     }
     return true;
 }
예제 #3
0
파일: SdpDirection.php 프로젝트: cwcw/cms
 /**
  * Arm the timer
  *
  * @param float|integer $delay
  * @return boolean
  */
 protected function _armTimer($delay)
 {
     $this->_timer->reset();
     $this->_timer->setOptions(array(Streamwide_Engine_Timer_Timeout::OPT_DELAY => $delay));
     $this->_timer->addEventListener(Streamwide_Engine_Events_Event::TIMEOUT, array('callback' => array($this, 'onTimeout'), 'options' => array('autoRemove' => 'before')));
     $armed = $this->_timer->arm();
     if (!$armed) {
         $this->_timer->flushEventListeners();
     }
     return $armed;
 }
예제 #4
0
파일: Reader.php 프로젝트: cwcw/cms
 /**
  * Rearm the timer
  *
  * @return boolean
  */
 protected function _rearmTimer()
 {
     $delay = $this->_options[self::OPT_INTER_DIGIT_TIMEOUT];
     $this->_timer->setContextParams(array('timeoutType' => self::TIMEOUT_INTERDIGIT));
     if ($this->_timer->isArmed()) {
         return $this->_timer->rearm($delay);
     } else {
         $this->_timer->setOptions(array(Streamwide_Engine_Timer_Timeout::OPT_DELAY => $delay));
         $this->_timer->addEventListener(Streamwide_Engine_Events_Event::TIMEOUT, array('callback' => array($this, 'onTimeout'), 'options' => array('autoRemove' => 'before')));
         return $this->_timer->arm();
     }
 }
예제 #5
0
파일: Interval.php 프로젝트: cwcw/cms
 /**
  * Stop the interval timer
  *
  * @return boolean
  */
 public function stop()
 {
     if (!$this->isRunning()) {
         $this->dispatchErrorEvent(self::ALREADY_STOPPED_ERR_CODE);
         return false;
     }
     // reset the timer
     $this->_timeoutTimer->reset();
     // mark the widget as READY
     $this->_stateManager->setState(self::STATE_READY);
     // dispatch a INTERVAL_TIMER_STOPPED
     $this->dispatchEvent(new Streamwide_Engine_Events_Event(Streamwide_Engine_Events_Event::STOPPED));
     return true;
 }
예제 #6
0
파일: Menu.php 프로젝트: cwcw/cms
 /**
  * Decrement the counter and give the user another try
  *
  * @param boolean $decrement
  * @return boolean
  */
 protected function _retry($decrement = true)
 {
     if (true === $decrement) {
         $this->_counter->decrement();
     }
     if ($this->_counter->hasMoreTries()) {
         $this->_timer->reset();
         $this->_dtmfHandler->reset();
         $this->_mediaPlayer->reset();
         $this->dispatchErrorEvent(self::BAD_TRY_ERR_CODE);
         return $this->enter();
     } else {
         $this->dispatchErrorEvent(self::NO_TRIES_LEFT_ERR_CODE);
         return false;
     }
 }
예제 #7
0
파일: Recorder.php 프로젝트: cwcw/cms
 /**
  * Handle the delaying of the RECORDER_STOPPED event (if it's the case). This is a workaround for a problem
  * in SW Engine where the recorded file is not immediately available after sending the RECORDSTOP signal
  *
  * @return void
  * @throws RuntimeException
  */
 protected function _delayRecorderStoppedEventDispatch()
 {
     $event = new Streamwide_Engine_Events_Event(Streamwide_Engine_Events_Event::STOPPED);
     $event->setParam('recordStartTime', $this->_recordingStartTime);
     $event->setParam('recordStopTime', $this->_recordingStopTime);
     $delay = $this->_options[self::OPT_RECORDER_STOPPED_EVENT_DISPATCH_DELAY];
     if (0 === $delay) {
         $this->dispatchEvent($event);
         return true;
     }
     if (null === $this->_timer) {
         throw new RuntimeException('Timer object not set');
     }
     $this->_timer->reset();
     $this->_timer->setOptions(array(Streamwide_Engine_Timer_Timeout::OPT_DELAY => $delay));
     $this->_timer->addEventListener(Streamwide_Engine_Events_Event::TIMEOUT, array('callback' => array($this, 'dispatchEvent'), 'args' => $event, 'options' => array('autoRemove' => 'before')));
     $armed = $this->_timer->arm();
     if (!$armed) {
         $this->_timer->flushEventListeners();
         return false;
     }
     return true;
 }
예제 #8
0
파일: Sender.php 프로젝트: cwcw/cms
 /**
  * Time the playing of the fax tone. When this timer expires we need to create the
  * fax environment manually (if it has not been created automatically for us)
  *
  * @return void
  */
 protected function _timeFaxTonePlaying()
 {
     $this->_timer->reset();
     $this->_timer->setOptions(array(Streamwide_Engine_Timer_Timeout::OPT_DELAY => self::FAX_TONE_PLAY_TIMEOUT));
     $this->_timer->addEventListener(Streamwide_Engine_Events_Event::TIMEOUT, array('callback' => array($this, 'onFaxPlayingTimeout'), 'options' => array('autoRemove' => 'before')));
     $this->_timer->arm();
 }
예제 #9
0
파일: Detector.php 프로젝트: cwcw/cms
 /**
  * @return void
  */
 protected function _resetDetectionDurationTimer()
 {
     if (isset($this->_timer)) {
         $this->_timer->reset();
     }
 }
예제 #10
0
파일: Forwarder.php 프로젝트: cwcw/cms
 /**
  * @return void
  */
 protected function _resetInternalWidgets()
 {
     $this->_relayer->reset();
     if (isset($this->_timer)) {
         $this->_timer->reset();
     }
 }