当前位置: 首页>>代码示例>>PHP>>正文


PHP Event\EventMessage类代码示例

本文整理汇总了PHP中PAMI\Message\Event\EventMessage的典型用法代码示例。如果您正苦于以下问题:PHP EventMessage类的具体用法?PHP EventMessage怎么用?PHP EventMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了EventMessage类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
             }
         }
     }
 }
开发者ID:bit0rez,项目名称:PAMI,代码行数:34,代码来源:example.php

示例2: handle

 /**
  * Forward PAMI event to EventManager.
  *
  * @param EventMessage $e PAMI event
  */
 public function handle(EventMessage $e)
 {
     $eventPrefix = 'event.';
     $eventName = $eventPrefix . $e->getName();
     $event = new PamiEvent();
     $event->setName($eventName);
     $event->setTarget($this->client);
     $event->setEvent($e);
     $this->client->getEventManager()->triggerEvent($event);
 }
开发者ID:thomasvargiu,项目名称:pami-module,代码行数:15,代码来源:EventForwarder.php

示例3: handle

 public function handle(EventMessage $event)
 {
     //This Handler will print the incoming message.
     echo "Message Received from :" . $event->getFrom() . " \n";
     if ($event->getContentEncoding() == 'base64') {
         echo base64_decode($event->getContent());
     } else {
         echo 'Unrecognized encoding - printing message in this encoding :  ';
         $event->getContentEncoding();
         echo '\\n Message:  ';
         $event->getContent();
     }
 }
开发者ID:alesf,项目名称:PAMI,代码行数:13,代码来源:example.php

示例4: handle

 /**
  * Handles pami events.
  *
  * @param EventMessage $event
  *
  * @return void
  */
 public function handle(EventMessage $event)
 {
     if ($event instanceof \PAMI\Message\Event\AsyncAGIEvent) {
         if ($event->getCommandId() == $this->_lastCommandId) {
             $this->_lastAgiResult = trim($event->getResult());
         }
     }
 }
开发者ID:nimdraugsael,项目名称:furiko-server,代码行数:15,代码来源:AsyncClientImpl.php

示例5: addEvent

 /**
  * Adds an event to this response.
  *
  * @param EventMessage $event Child event to add.
  *
  * @return void
  */
 public function addEvent(EventMessage $event)
 {
     $this->events[] = $event;
     if (stristr($event->getEventList(), 'complete') !== false || stristr($event->getName(), 'complete') !== false || stristr($event->getName(), 'DBGetResponse') !== false) {
         $this->completed = true;
     }
 }
开发者ID:alesf,项目名称:PAMI,代码行数:14,代码来源:ResponseMessage.php

示例6: __construct

 /**
  * Constructor.
  *
  * @param string $rawContent Literal message as received from ami.
  *
  * @return void
  */
 public function __construct($rawContent)
 {
     parent::__construct($rawContent);
 }
开发者ID:nimdraugsael,项目名称:furiko-server,代码行数:11,代码来源:OriginateResponseEvent.php

示例7: getMessageKeys

 public static function getMessageKeys()
 {
     return array_merge(parent::getMessageKeys(), ['privilege', 'channel', 'calleridnum', 'calleridname', 'context', 'accountcode', 'uniqueid', 'linkedid', 'destchannel', 'destuniqueid', 'dialstring']);
 }
开发者ID:ryzhov,项目名称:pami,代码行数:4,代码来源:DialBeginEvent.php

示例8: __construct

 /**
  * Constructor.
  *
  * @param string $rawContent Literal message as received from ami.
  *
  * @return void
  */
 public function __construct($rawContent)
 {
     parent::__construct($rawContent);
     $this->setKey('Env', urldecode($this->getEnvironment()));
     $this->setKey('Result', urldecode($this->getResult()));
 }
开发者ID:bit0rez,项目名称:PAMI,代码行数:13,代码来源:AsyncAGIEvent.php

示例9: getMessageKeys

 public static function getMessageKeys()
 {
     return array_merge(parent::getMessageKeys(), ['privilege', 'channel', 'calleridnum', 'calleridname', 'uniqueid', 'cause', 'causetext']);
 }
开发者ID:ryzhov,项目名称:pami,代码行数:4,代码来源:HangupEvent.php


注:本文中的PAMI\Message\Event\EventMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。