本文整理匯總了PHP中PAMI\Message\Event\EventMessage::getSubEvent方法的典型用法代碼示例。如果您正苦於以下問題:PHP EventMessage::getSubEvent方法的具體用法?PHP EventMessage::getSubEvent怎麽用?PHP EventMessage::getSubEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PAMI\Message\Event\EventMessage
的用法示例。
在下文中一共展示了EventMessage::getSubEvent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: handle
public function handle(EventMessage $event)
{
if ($event instanceof \PAMI\Message\Event\AsyncAGIEvent) {
if ($event->getSubEvent() == 'Start') {
switch ($pid = pcntl_fork()) {
case 0:
$logger = \Logger::getLogger(__CLASS__);
$this->_client = new ClientImpl($this->_pamiOptions);
$this->_client->open();
$agi = new \PAMI\AsyncAgi\AsyncClientImpl(array('pamiClient' => $this->_client, 'asyncAgiEvent' => $event));
$app = new MyPAGIApplication(array('pagiClient' => $agi));
$app->init();
$app->run();
//$agi->indicateProgress();
//$agi->answer();
//$agi->streamFile('welcome');
//$agi->playCustomTones(array("425/50","0/50"));
//sleep(5);
//$agi->indicateCongestion(10);
//$agi->hangup();
$this->_client->close();
echo "Application finished\n";
exit(0);
break;
case -1:
echo "Could not fork application\n";
break;
default:
echo "Forked Application\n";
break;
}
}
}
}