亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? phpagi.php

?? asterisk用 的voip記費軟件
?? PHP
?? 第 1 頁 / 共 5 頁
字號:
<?php /**  * phpagi.php : PHP AGI Functions for Asterisk  * Website: http://phpagi.sourceforge.net/  *  * $Id: phpagi.php,v 2.14 2005/05/25 20:30:46 pinhole Exp $  *  * Copyright (c) 2003, 2004, 2005 Matthew Asham <matthewa@bcwireless.net>, David Eder <david@eder.us>  * All Rights Reserved.  *  * This software is released under the terms of the GNU Lesser General Public License v2.1  * A copy of which is available from http://www.gnu.org/copyleft/lesser.html  *  * We would be happy to list your phpagi based application on the phpagi  * website.  Drop me an Email if you'd like us to list your program.  *   *  * Written for PHP 4.3.4, should work with older PHP 4.x versions.  *  * Please submit bug reports, patches, etc to http://sourceforge.net/projects/phpagi/  * Gracias. :)  *  *  * @package phpAGI  * @version 2.0  */ /**  */  /*if(!class_exists('AGI_AsteriskManager'))  {    require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'phpagi-asmanager.php');  }*/  define('AST_CONFIG_DIR', '/etc/asterisk/');  define('AST_SPOOL_DIR', '/var/spool/asterisk/');  define('AST_TMP_DIR', AST_SPOOL_DIR . '/tmp/');  define('DEFAULT_PHPAGI_CONFIG', AST_CONFIG_DIR . '/phpagi.conf');  define('AST_DIGIT_ANY', '0123456789#*');  define('AGIRES_OK', 200);  define('AST_STATE_DOWN', 0);  define('AST_STATE_RESERVED', 1);  define('AST_STATE_OFFHOOK', 2);  define('AST_STATE_DIALING', 3);  define('AST_STATE_RING', 4);  define('AST_STATE_RINGING', 5);  define('AST_STATE_UP', 6);  define('AST_STATE_BUSY', 7);  define('AST_STATE_DIALING_OFFHOOK', 8);  define('AST_STATE_PRERING', 9);  define('AUDIO_FILENO', 3); // STDERR_FILENO + 1 /**  * AGI class  *  * @package phpAGI  * @link http://www.voip-info.org/wiki-Asterisk+agi  * @example examples/dtmf.php Get DTMF tones from the user and say the digits  * @example examples/input.php Get text input from the user and say it back  * @example examples/ping.php Ping an IP address  */  class AGI  {   /**    * Request variables read in on initialization.    *    * Often contains any/all of the following:    *   agi_request - name of agi script    *   agi_channel - current channel    *   agi_language - current language    *   agi_type - channel type (SIP, ZAP, IAX, ...)    *   agi_uniqueid - unique id based on unix time    *   agi_callerid - callerID string    *   agi_dnid - dialed number id    *   agi_rdnis - referring DNIS number    *   agi_context - current context    *   agi_extension - extension dialed    *   agi_priority - current priority    *   agi_enhanced - value is 1.0 if started as an EAGI script    *   agi_accountcode - set by SetAccount in the dialplan    *   agi_network - value is yes if this is a fastagi    *   agi_network_script - name of the script to execute    *    * NOTE: program arguments are still in $_SERVER['argv'].    *    * @var array    * @access public    */    var $request;   /**    * Config variables    *    * @var integer    * @access public    */	var $nlinetoread=5;	   /**    * Config variables    *    * @var array    * @access public    */    var $config;   /**    * Asterisk Manager    *    * @var AGI_AsteriskManager    * @access public    */    var $asmanager;   /**    * Input Stream    *    * @access private    */    var $in = NULL;   /**    * Output Stream    *    * @access private    */    var $out = NULL;   /**    * Audio Stream    *    * @access public    */    var $audio = NULL;   /**    * Constructor    *    * @param string $config is the name of the config file to parse    * @param array $optconfig is an array of configuration vars and vals, stuffed into $this->config['phpagi']    */	    function AGI($config=NULL, $optconfig=array())    {      // load config      if(!is_null($config) && file_exists($config))        $this->config = parse_ini_file($config, true);      elseif(file_exists(DEFAULT_PHPAGI_CONFIG))       //--$this->config = parse_ini_file(DEFAULT_PHPAGI_CONFIG, true);		//-- DONT WANT HIM TO OPEN A FILE EACH TIME      // If optconfig is specified, stuff vals and vars into 'phpagi' config array.      foreach($optconfig as $var=>$val)        $this->config['phpagi'][$var] = $val;      // add default values to config for uninitialized values      if(!isset($this->config['phpagi']['error_handler'])) $this->config['phpagi']['error_handler'] = true;      if(!isset($this->config['phpagi']['debug'])) $this->config['phpagi']['debug'] = false;      if(!isset($this->config['phpagi']['admin'])) $this->config['phpagi']['admin'] = NULL;      if(!isset($this->config['phpagi']['tempdir'])) $this->config['phpagi']['tempdir'] = AST_TMP_DIR;      // festival TTS config      if(!isset($this->config['festival']['text2wave'])) $this->config['festival']['text2wave'] = $this->which('text2wave');      // swift TTS config      if(!isset($this->config['cepstral']['swift'])) $this->config['cepstral']['swift'] = $this->which('swift');      ob_implicit_flush(true);      // open stdin & stdout      $this->in = defined('STDIN') ? STDIN : fopen('php://stdin', 'r');      $this->out = defined('STDOUT') ? STDOUT : fopen('php://stdout', 'w');      // initialize error handler      if($this->config['phpagi']['error_handler'] == true)      {        set_error_handler('phpagi_error_handler');        global $phpagi_error_handler_email;        $phpagi_error_handler_email = $this->config['phpagi']['admin'];        error_reporting(E_ALL);      }      // make sure temp folder exists      $this->make_folder($this->config['phpagi']['tempdir']);      // read the request      $str = fgets($this->in);      while($str != "\n")      {        $this->request[substr($str, 0, strpos($str, ':'))] = trim(substr($str, strpos($str, ':') + 1));        $str = fgets($this->in);      }      // open audio if eagi detected      if($this->request['agi_enhanced'] == '1.0')      {        if(file_exists('/proc/' . getmypid() . '/fd/3'))          $this->audio = fopen('/proc/' . getmypid() . '/fd/3', 'r');        elseif(file_exists('/dev/fd/3'))        {          // may need to mount fdescfs          $this->audio = fopen('/dev/fd/3', 'r');        }        else          $this->conlog('Unable to open audio stream');        if($this->audio) stream_set_blocking($this->audio, 0);      }      $this->conlog('AGI Request:');      $this->conlog(print_r($this->request, true));	  // DONT WANT TO READ THE INTERNAL CONFIG      /* $this->conlog('PHPAGI internal configuration:');      $this->conlog(print_r($this->config, true));*/    }   // *********************************************************************************************************   // **                       COMMANDS                                                                      **   // *********************************************************************************************************   /**    * Answer channel if not already in answer state.    *    * @link http://www.voip-info.org/wiki-answer    * @example examples/dtmf.php Get DTMF tones from the user and say the digits    * @example examples/input.php Get text input from the user and say it back    * @example examples/ping.php Ping an IP address    *    * @return array, see evaluate for return information.  ['result'] is 0 on success, -1 on failure.    */    function answer()    {      return $this->evaluate('ANSWER');    }   /**    * Get the status of the specified channel. If no channel name is specified, return the status of the current channel.    *    * @link http://www.voip-info.org/wiki-channel+status    * @param string $channel    * @return array, see evaluate for return information. ['data'] contains description.    */    function channel_status($channel='')    {      $ret = $this->evaluate("CHANNEL STATUS $channel");      switch($ret['result'])      {        case -1: $ret['data'] = trim("There is no channel that matches $channel"); break;        case AST_STATE_DOWN: $ret['data'] = 'Channel is down and available'; break;        case AST_STATE_RESERVED: $ret['data'] = 'Channel is down, but reserved'; break;        case AST_STATE_OFFHOOK: $ret['data'] = 'Channel is off hook'; break;        case AST_STATE_DIALING: $ret['data'] = 'Digits (or equivalent) have been dialed'; break;        case AST_STATE_RING: $ret['data'] = 'Line is ringing'; break;        case AST_STATE_RINGING: $ret['data'] = 'Remote end is ringing'; break;        case AST_STATE_UP: $ret['data'] = 'Line is up'; break;        case AST_STATE_BUSY: $ret['data'] = 'Line is busy'; break;        case AST_STATE_DIALING_OFFHOOK: $ret['data'] = 'Digits (or equivalent) have been dialed while offhook'; break;        case AST_STATE_PRERING: $ret['data'] = 'Channel has detected an incoming call and is waiting for ring'; break;        default: $ret['data'] = "Unknown ({$ret['result']})"; break;      }      return $ret;    }   /**    * Deletes an entry in the Asterisk database for a given family and key.    *    * @link http://www.voip-info.org/wiki-database+del    * @param string $family    * @param string $key    * @return array, see evaluate for return information. ['result'] is 1 on sucess, 0 otherwise.    */    function database_del($family, $key)    {      return $this->evaluate("DATABASE DEL \"$family\" \"$key\"");    }   /**    * Deletes a family or specific keytree within a family in the Asterisk database.    *    * @link http://www.voip-info.org/wiki-database+deltree    * @param string $family    * @param string $keytree    * @return array, see evaluate for return information. ['result'] is 1 on sucess, 0 otherwise.    */    function database_deltree($family, $keytree='')    {      $cmd = "DATABASE DELTREE \"$family\"";      if($keytree != '') $cmd .= " \"$keytree\"";      return $this->evaluate($cmd);    }   /**    * Retrieves an entry in the Asterisk database for a given family and key.    *    * @link http://www.voip-info.org/wiki-database+get    * @param string $family    * @param string $key    * @return array, see evaluate for return information. ['result'] is 1 on sucess, 0 failure. ['data'] holds the value    */    function database_get($family, $key)    {      return $this->evaluate("DATABASE GET \"$family\ \"$key\"");    }   /**    * Adds or updates an entry in the Asterisk database for a given family, key, and value.    *    * @param string $family    * @param string $key    * @param string $value    * @return array, see evaluate for return information. ['result'] is 1 on sucess, 0 otherwise    */    function database_put($family, $key, $value)    {      $value = str_replace("\n", '\n', addslashes($value));      return $this->evaluate("DATABASE PUT \"$family\" \"$key\" \"$value\"");    }   /**    * Executes the specified Asterisk application with given options.    *    * @link http://www.voip-info.org/wiki-exec    * @link http://www.voip-info.org/wiki-Asterisk+-+documentation+of+application+commands    * @param string $application    * @param mixed $options    * @return array, see evaluate for return information. ['result'] is whatever the application returns, or -2 on failure to find application    */    function exec($application, $options='')    {      if(is_array($options)) $options = join('|', $options);      return $this->evaluate("EXEC $application $options");    }   /**    * Plays the given file and receives DTMF data.    *    * This is similar to STREAM FILE, but this command can accept and return many DTMF digits,    * while STREAM FILE returns immediately after the first DTMF digit is detected.    *    * Asterisk looks for the file to play in /var/lib/asterisk/sounds by default.    *    * If the user doesn't press any keys when the message plays, there is $timeout milliseconds    * of silence then the command ends.     *    * The user has the opportunity to press a key at any time during the message or the    * post-message silence. If the user presses a key while the message is playing, the    * message stops playing. When the first key is pressed a timer starts counting for    * $timeout milliseconds. Every time the user presses another key the timer is restarted.    * The command ends when the counter goes to zero or the maximum number of digits is entered,    * whichever happens first.     *    * If you don't specify a time out then a default timeout of 2000 is used following a pressed    * digit. If no digits are pressed then 6 seconds of silence follow the message.     *    * If you don't specify $max_digits then the user can enter as many digits as they want.     *    * Pressing the # key has the same effect as the timer running out: the command ends and    * any previously keyed digits are returned. A side effect of this is that there is no    * way to read a # key using this command.    *    * @example examples/ping.php Ping an IP address    *

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩亚洲综合在线 欧美亚洲特黄一级| 日韩一级片在线观看| 欧美日韩黄色一区二区| 26uuu精品一区二区在线观看| 亚洲精品国产成人久久av盗摄| 极品少妇一区二区三区精品视频 | 国产麻豆日韩欧美久久| 欧美亚洲一区二区三区四区| 亚洲国产精品高清| 九色综合狠狠综合久久| 日本韩国精品在线| 国产精品嫩草影院av蜜臀| 国内偷窥港台综合视频在线播放| 欧美私人免费视频| 一区二区在线观看视频| 成人在线综合网| 国产亚洲欧美日韩在线一区| 久久精品二区亚洲w码| 欧美日本在线一区| 亚洲福中文字幕伊人影院| 91丝袜国产在线播放| 国产日本亚洲高清| 国产成人av电影在线播放| 2023国产精品| 激情综合网天天干| 欧美成人aa大片| 美腿丝袜亚洲色图| 日韩丝袜美女视频| 秋霞国产午夜精品免费视频| 91精品欧美福利在线观看| 亚洲成人在线观看视频| 欧美天堂亚洲电影院在线播放| 亚洲免费av在线| 在线观看亚洲一区| 婷婷国产在线综合| 在线电影欧美成精品| 免费欧美在线视频| 久久久亚洲午夜电影| 国产精品综合在线视频| 中文字幕欧美国产| 日本乱人伦aⅴ精品| 亚洲一区在线视频| 欧美蜜桃一区二区三区| 美女网站色91| 久久精品亚洲国产奇米99| 成人中文字幕电影| 一区二区三国产精华液| 精品视频一区二区三区免费| 奇米影视一区二区三区| 久久蜜桃一区二区| 色婷婷综合久久久久中文一区二区 | 欧美日韩一区二区三区免费看| 夜夜爽夜夜爽精品视频| 正在播放亚洲一区| 国产乱人伦偷精品视频免下载| 日韩精品一区二区三区在线观看| 国产在线日韩欧美| 亚洲女与黑人做爰| 欧美一区二区高清| 大白屁股一区二区视频| 亚洲国产日产av| 久久久五月婷婷| 欧美在线短视频| 国产在线视视频有精品| 玉米视频成人免费看| 日韩欧美美女一区二区三区| 成人看片黄a免费看在线| 亚洲自拍偷拍网站| 久久久久99精品国产片| 欧美偷拍一区二区| 国产精品亚洲成人| 亚洲va欧美va国产va天堂影院| 久久综合久久综合亚洲| 91精品办公室少妇高潮对白| 国产中文一区二区三区| 一区二区欧美视频| 国产亚洲制服色| 欧美日本视频在线| aaa国产一区| 黄色日韩网站视频| 亚洲成人av一区二区三区| 国产视频一区不卡| 欧美一区二区三区思思人| 成人一区二区三区| 久久精品国产一区二区| 亚洲成av人影院在线观看网| 国产精品伦一区二区三级视频| 7777精品伊人久久久大香线蕉的| 99视频精品在线| 激情欧美一区二区| 日韩电影在线看| 亚洲日本免费电影| 日本一区二区高清| 久久欧美中文字幕| 欧美一区二区视频在线观看| 色视频一区二区| 国产成人免费网站| 狠狠色丁香久久婷婷综| 青椒成人免费视频| 图片区小说区国产精品视频| 视频一区二区欧美| 一区二区三区产品免费精品久久75| 日本一区二区三区国色天香 | 91精品国产品国语在线不卡| 91免费在线看| 99久久伊人精品| 99久久亚洲一区二区三区青草| 国产xxx精品视频大全| 激情图片小说一区| 国产精品一二三在| 国产主播一区二区| 国产精品18久久久久久vr | 日本欧美大码aⅴ在线播放| 亚洲精品国产第一综合99久久| 亚洲人成伊人成综合网小说| 《视频一区视频二区| 中文字幕一区免费在线观看 | 国产精品少妇自拍| 欧美国产一区二区在线观看 | 美腿丝袜亚洲色图| 青青草伊人久久| 精品综合免费视频观看| 紧缚捆绑精品一区二区| 国产91综合一区在线观看| 成人午夜视频免费看| 色综合天天综合网国产成人综合天 | 久久九九久精品国产免费直播| 久久一区二区视频| 国产精品久久久久永久免费观看| 国产精品传媒视频| 亚洲自拍偷拍综合| 久久av资源站| 成人久久视频在线观看| 97久久久精品综合88久久| 欧美色电影在线| 欧美tk—视频vk| 国产精品色在线观看| 一区二区三区毛片| 蜜桃传媒麻豆第一区在线观看| 国产麻豆视频一区| 在线免费亚洲电影| 日韩一区二区免费高清| 国产日韩欧美精品一区| 亚洲精品伦理在线| 久久国产精品一区二区| 成人一区在线观看| 91 com成人网| 欧美激情中文字幕一区二区| 亚洲成人免费看| 国产成人免费av在线| 欧美日韩中文字幕一区| 国产色91在线| 亚洲成人av一区二区| 丁香六月综合激情| 777久久久精品| 国产精品成人午夜| 久久69国产一区二区蜜臀| 一本一本大道香蕉久在线精品 | 精品综合免费视频观看| 在线日韩国产精品| 中文字幕欧美激情| 久久国产欧美日韩精品| 欧美性xxxxxx少妇| 1000精品久久久久久久久| 久久99热国产| 欧美丝袜自拍制服另类| 国产精品免费视频一区| 日本成人在线看| 欧美性大战久久久久久久蜜臀| 国产色产综合产在线视频| 久久精品国产秦先生| 欧美性猛交xxxx乱大交退制版| 国产欧美一区二区精品婷婷| 免费精品99久久国产综合精品| 91美女片黄在线观看91美女| 亚洲精品在线免费播放| 日韩精品一二三四| 欧美午夜精品免费| 一区二区三区中文在线观看| 国产91丝袜在线播放九色| 精品国产乱码久久久久久老虎| 亚洲一二三区在线观看| 色婷婷精品久久二区二区蜜臂av| 中文字幕第一区| 成人久久久精品乱码一区二区三区| 精品久久久久久久久久久久包黑料| 日韩精品久久理论片| 欧美日韩美女一区二区| 亚洲第一主播视频| 欧美色男人天堂| 亚洲福利一区二区三区| 欧美日韩一级片网站| 亚洲一区二区三区国产| 欧洲视频一区二区| 亚洲欧美日韩中文字幕一区二区三区| hitomi一区二区三区精品| 国产精品美女视频| 99久久99久久免费精品蜜臀| 中文字幕中文字幕中文字幕亚洲无线| 国产成人av福利|