本文整理汇总了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;
}
}
}
}