hangup() public method

Hangups the current channel. Uses agi command "HANGUP".
public hangup ( ) : void
return void
Example #1
0
 /**
  * Process the result of the given node. Returns false if no other nodes
  * should be run, or a string with the next node name.
  *
  * @param Node $node Node that was run.
  *
  * @return string|false
  */
 protected function processNodeResult(Node $node)
 {
     $ret = false;
     $name = $node->getName();
     if (isset($this->nodeResults[$name])) {
         foreach ($this->nodeResults[$name] as $resultInfo) {
             /* @var $resultInfo NodeActionCommand */
             if ($resultInfo->appliesTo($node)) {
                 if ($resultInfo->isActionHangup()) {
                     $this->logDebug("Hanging up after {$name}");
                     $this->client->hangup();
                 } elseif ($resultInfo->isActionJumpTo()) {
                     $data = $resultInfo->getActionData();
                     if (isset($data['nodeEval'])) {
                         $callback = $data['nodeEval'];
                         $nodeName = $callback($node);
                     } else {
                         $nodeName = $data['nodeName'];
                     }
                     $this->logDebug("Jumping from {$name} to {$nodeName}");
                     $ret = $nodeName;
                     break;
                 } elseif ($resultInfo->isActionExecute()) {
                     $this->logDebug("Executing callback after {$name}");
                     $data = $resultInfo->getActionData();
                     $callback = $data['callback'];
                     $callback($node);
                 }
             }
         }
     }
     return $ret;
 }