コード例 #1
0
ファイル: registration.php プロジェクト: lightcyphers/yate
 * This use of this software may be subject to additional restrictions.
 * See the LEGAL file in the main directory for details.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 */
/* Test script for the Yate PHP interface
   To test add in extmodule.conf

   [scripts]
   test.php=
*/
require_once "libyate.php";
/* Always the first action to do */
Yate::Init();
/* Install a handler for the engine generated timer message */
//Yate::Install("engine.timer",10);
Yate::Install("user.auth", 10);
/* Create and dispatch an initial test message */
/* The main loop. We pick events and handle them */
for (;;) {
    $ev = Yate::GetEvent();
    /* If Yate disconnected us then exit cleanly */
    if ($ev === false) {
        break;
    }
    /* Empty events are normal in non-blocking operation.
       This is an opportunity to do idle tasks and check timers */
    if ($ev === true) {
        //        Yate::Output("PHP event: empty");
コード例 #2
0
ファイル: libyatechan.php プロジェクト: biddyweb/vmukti
 /**
  * This static function initializes globals in the PHP Yate Channel Module.
  * It should be called before any other method.
  * It will call Yate::Init internally.
  * @param $prefix (optional) Prefix used for the unique channel identifier
  * @param $async (optional) True if asynchronous, polled mode is desired
  * @param $addr Hostname to connect to or UNIX socket path
  * @param $port TCP port to connect to, zero to use UNIX sockets
  */
 static function Init($prefix = "extchan", $async = false, $addr = "", $port = 0)
 {
     global $chan_instance;
     Yate::Init($async, $addr, $port, "channel");
     $chan_instance = new YateChan($prefix);
     YateChan::RunEvents();
     if ($chan_instance->exiting) {
         return;
     }
     Yate::Install("chan.dtmf");
     Yate::Install("chan.notify");
 }