getRegistration() public method

Get registration
public getRegistration ( ) : Registration
return Registration
Esempio n. 1
0
 /**
  * Remove all references to Call to it can be GCed
  *
  * @param Call $call
  */
 public function removeCall(Call $call)
 {
     $newQueue = new \SplQueue();
     while (!$this->callQueue->isEmpty()) {
         $c = $this->callQueue->dequeue();
         if ($c === $call) {
             continue;
         }
         $newQueue->enqueue($c);
     }
     $this->callQueue = $newQueue;
     $registration = $call->getRegistration();
     if ($registration) {
         $registration->removeCall($call);
     }
 }
Esempio n. 2
0
 /**
  * Process call
  *
  * @param Call $call
  * @throws \Exception
  */
 public function processCall(Call $call)
 {
     if ($call->getRegistration() !== null) {
         throw new \Exception("Registration already set when asked to process call");
     }
     $call->setRegistration($this);
     $this->calls[] = $call;
     $this->session->incPendingCallCount();
     $callCount = count($this->calls);
     if ($callCount == 1) {
         // we just became busy
         $this->busyStart = microtime(true);
     }
     if ($callCount > $this->maxSimultaneousCalls) {
         $this->maxSimultaneousCalls = $callCount;
     }
     $this->invocationCount++;
     $this->lastCallStartedAt = new \DateTime();
     $this->getSession()->sendMessage($call->getInvocationMessage());
 }