Location: PHPKode > scripts > PHP AGI > phpagi-2.20/api-docs/__filesource/fsource_phpAGI__phpagi.php.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>File Source for phpagi.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
						<h1>Source for file phpagi.php</h1>
<p>Documentation is available at <a href="../phpAGI/_phpagi.php.html">phpagi.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">*&nbsp;phpagi.php&nbsp;:&nbsp;PHP&nbsp;AGI&nbsp;Functions&nbsp;for&nbsp;Asterisk</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">*&nbsp;Website:&nbsp;http://phpagi.sourceforge.net/</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">*&nbsp;$Id:&nbsp;phpagi.php,v&nbsp;2.20&nbsp;2010/09/30&nbsp;02:21:00&nbsp;masham&nbsp;Exp&nbsp;$</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-doc">*&nbsp;Copyright&nbsp;(c)&nbsp;2003&nbsp;-&nbsp;2010&nbsp;Matthew&nbsp;Asham&nbsp;&lt;hide@address.com&gt;,&nbsp;David&nbsp;Eder&nbsp;&lt;hide@address.com&gt;&nbsp;and&nbsp;others</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-doc">*&nbsp;All&nbsp;Rights&nbsp;Reserved.</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-doc">*&nbsp;This&nbsp;software&nbsp;is&nbsp;released&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;Lesser&nbsp;General&nbsp;Public&nbsp;License&nbsp;v2.1</span></div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-doc">*&nbsp;A&nbsp;copy&nbsp;of&nbsp;which&nbsp;is&nbsp;available&nbsp;from&nbsp;http://www.gnu.org/copyleft/lesser.html</span></div></li>
<li><div class="src-line"><a name="a14"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-doc">*&nbsp;We&nbsp;would&nbsp;be&nbsp;happy&nbsp;to&nbsp;list&nbsp;your&nbsp;phpagi&nbsp;based&nbsp;application&nbsp;on&nbsp;the&nbsp;phpagi</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-doc">*&nbsp;website.&nbsp;&nbsp;Drop&nbsp;me&nbsp;an&nbsp;Email&nbsp;if&nbsp;you'd&nbsp;like&nbsp;us&nbsp;to&nbsp;list&nbsp;your&nbsp;program.</span></div></li>
<li><div class="src-line"><a name="a17"></a><span class="src-doc">*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a19"></a><span class="src-doc">*&nbsp;Written&nbsp;for&nbsp;PHP&nbsp;4.3.4,&nbsp;should&nbsp;work&nbsp;with&nbsp;older&nbsp;PHP&nbsp;4.x&nbsp;versions.</span></div></li>
<li><div class="src-line"><a name="a20"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a21"></a><span class="src-doc">*&nbsp;Please&nbsp;submit&nbsp;bug&nbsp;reports,&nbsp;patches,&nbsp;etc&nbsp;to&nbsp;http://sourceforge.net/projects/phpagi/</span></div></li>
<li><div class="src-line"><a name="a22"></a><span class="src-doc">*&nbsp;Gracias.&nbsp;:)</span></div></li>
<li><div class="src-line"><a name="a23"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;phpAGI</span></div></li>
<li><div class="src-line"><a name="a26"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-coretag">@version</span><span class="src-doc">&nbsp;2.0</span></div></li>
<li><div class="src-line"><a name="a27"></a><span class="src-doc">*/</span></div></li>
<li><div class="src-line"><a name="a28"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a29"></a><span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/class_exists">class_exists</a><span class="src-sym">(</span><span class="src-str">'AGI_AsteriskManager'</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a31"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">require_once</span><span class="src-sym">(</span><span class="src-id">dirname</span><span class="src-sym">(</span>__FILE__<span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-id">DIRECTORY_SEPARATOR&nbsp;</span>.&nbsp;<span class="src-str">'phpagi-asmanager.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a32"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a33"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a34"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AST_CONFIG_DIR'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'/etc/asterisk/'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a35"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AST_SPOOL_DIR'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'/var/spool/asterisk/'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a36"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AST_TMP_DIR'</span><span class="src-sym">,&nbsp;</span><span class="src-id">AST_SPOOL_DIR&nbsp;</span>.&nbsp;<span class="src-str">'/tmp/'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a37"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'DEFAULT_PHPAGI_CONFIG'</span><span class="src-sym">,&nbsp;</span><span class="src-id">AST_CONFIG_DIR&nbsp;</span>.&nbsp;<span class="src-str">'/phpagi.conf'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a38"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a39"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AST_DIGIT_ANY'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'0123456789#*'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a40"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a41"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AGIRES_OK'</span><span class="src-sym">,&nbsp;</span><span class="src-num">200</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a42"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a43"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AST_STATE_DOWN'</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a44"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AST_STATE_RESERVED'</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a45"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AST_STATE_OFFHOOK'</span><span class="src-sym">,&nbsp;</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a46"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AST_STATE_DIALING'</span><span class="src-sym">,&nbsp;</span><span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a47"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AST_STATE_RING'</span><span class="src-sym">,&nbsp;</span><span class="src-num">4</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a48"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AST_STATE_RINGING'</span><span class="src-sym">,&nbsp;</span><span class="src-num">5</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a49"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AST_STATE_UP'</span><span class="src-sym">,&nbsp;</span><span class="src-num">6</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a50"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AST_STATE_BUSY'</span><span class="src-sym">,&nbsp;</span><span class="src-num">7</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a51"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AST_STATE_DIALING_OFFHOOK'</span><span class="src-sym">,&nbsp;</span><span class="src-num">8</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a52"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AST_STATE_PRERING'</span><span class="src-sym">,&nbsp;</span><span class="src-num">9</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a53"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a54"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'AUDIO_FILENO'</span><span class="src-sym">,&nbsp;</span><span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;STDERR_FILENO&nbsp;+&nbsp;1</span></div></li>
<li><div class="src-line"><a name="a55"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a56"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a57"></a><span class="src-doc">*&nbsp;AGI&nbsp;class</span></div></li>
<li><div class="src-line"><a name="a58"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a59"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;phpAGI</span></div></li>
<li><div class="src-line"><a name="a60"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-Asterisk+agi</span></div></li>
<li><div class="src-line"><a name="a61"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/dtmf.php&nbsp;Get&nbsp;DTMF&nbsp;tones&nbsp;from&nbsp;the&nbsp;user&nbsp;and&nbsp;say&nbsp;the&nbsp;digits</span></div></li>
<li><div class="src-line"><a name="a62"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/input.php&nbsp;Get&nbsp;text&nbsp;input&nbsp;from&nbsp;the&nbsp;user&nbsp;and&nbsp;say&nbsp;it&nbsp;back</span></div></li>
<li><div class="src-line"><a name="a63"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/ping.php&nbsp;Ping&nbsp;an&nbsp;IP&nbsp;address</span></div></li>
<li><div class="src-line"><a name="a64"></a><span class="src-doc">*/</span></div></li>
<li><div class="src-line"><a name="a65"></a><span class="src-key">class&nbsp;</span><a href="../phpAGI/AGI.html">AGI</a></div></li>
<li><div class="src-line"><a name="a66"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a67"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a68"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Request&nbsp;variables&nbsp;read&nbsp;in&nbsp;on&nbsp;initialization.</span></div></li>
<li><div class="src-line"><a name="a69"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a70"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Often&nbsp;contains&nbsp;any/all&nbsp;of&nbsp;the&nbsp;following:</span></div></li>
<li><div class="src-line"><a name="a71"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_request&nbsp;-&nbsp;name&nbsp;of&nbsp;agi&nbsp;script</span></div></li>
<li><div class="src-line"><a name="a72"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_channel&nbsp;-&nbsp;current&nbsp;channel</span></div></li>
<li><div class="src-line"><a name="a73"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_language&nbsp;-&nbsp;current&nbsp;language</span></div></li>
<li><div class="src-line"><a name="a74"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_type&nbsp;-&nbsp;channel&nbsp;type&nbsp;(SIP,&nbsp;ZAP,&nbsp;IAX,&nbsp;...)</span></div></li>
<li><div class="src-line"><a name="a75"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_uniqueid&nbsp;-&nbsp;unique&nbsp;id&nbsp;based&nbsp;on&nbsp;unix&nbsp;time</span></div></li>
<li><div class="src-line"><a name="a76"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_callerid&nbsp;-&nbsp;callerID&nbsp;string</span></div></li>
<li><div class="src-line"><a name="a77"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_dnid&nbsp;-&nbsp;dialed&nbsp;number&nbsp;id</span></div></li>
<li><div class="src-line"><a name="a78"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_rdnis&nbsp;-&nbsp;referring&nbsp;DNIS&nbsp;number</span></div></li>
<li><div class="src-line"><a name="a79"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_context&nbsp;-&nbsp;current&nbsp;context</span></div></li>
<li><div class="src-line"><a name="a80"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_extension&nbsp;-&nbsp;extension&nbsp;dialed</span></div></li>
<li><div class="src-line"><a name="a81"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_priority&nbsp;-&nbsp;current&nbsp;priority</span></div></li>
<li><div class="src-line"><a name="a82"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_enhanced&nbsp;-&nbsp;value&nbsp;is&nbsp;1.0&nbsp;if&nbsp;started&nbsp;as&nbsp;an&nbsp;EAGI&nbsp;script</span></div></li>
<li><div class="src-line"><a name="a83"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_accountcode&nbsp;-&nbsp;set&nbsp;by&nbsp;SetAccount&nbsp;in&nbsp;the&nbsp;dialplan</span></div></li>
<li><div class="src-line"><a name="a84"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_network&nbsp;-&nbsp;value&nbsp;is&nbsp;yes&nbsp;if&nbsp;this&nbsp;is&nbsp;a&nbsp;fastagi</span></div></li>
<li><div class="src-line"><a name="a85"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;agi_network_script&nbsp;-&nbsp;name&nbsp;of&nbsp;the&nbsp;script&nbsp;to&nbsp;execute</span></div></li>
<li><div class="src-line"><a name="a86"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a87"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;NOTE:&nbsp;program&nbsp;arguments&nbsp;are&nbsp;still&nbsp;in&nbsp;$_SERVER['argv'].</span></div></li>
<li><div class="src-line"><a name="a88"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a89"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">array&nbsp;</span></div></li>
<li><div class="src-line"><a name="a90"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;public</span></div></li>
<li><div class="src-line"><a name="a91"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a92"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><a href="../phpAGI/AGI.html#var$request">$request</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a93"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a94"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a95"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Config&nbsp;variables</span></div></li>
<li><div class="src-line"><a name="a96"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a97"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">array&nbsp;</span></div></li>
<li><div class="src-line"><a name="a98"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;public</span></div></li>
<li><div class="src-line"><a name="a99"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a100"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><a href="../phpAGI/AGI.html#var$config">$config</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a101"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a102"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a103"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Asterisk&nbsp;Manager</span></div></li>
<li><div class="src-line"><a name="a104"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a105"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">AGI_AsteriskManager&nbsp;</span></div></li>
<li><div class="src-line"><a name="a106"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;public</span></div></li>
<li><div class="src-line"><a name="a107"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a108"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><a href="../phpAGI/AGI.html#var$asmanager">$asmanager</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a109"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a110"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a111"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Input&nbsp;Stream</span></div></li>
<li><div class="src-line"><a name="a112"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a113"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;private</span></div></li>
<li><div class="src-line"><a name="a114"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a115"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><a href="../phpAGI/AGI.html#var$in">$in</a>&nbsp;=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a116"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a117"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a118"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Output&nbsp;Stream</span></div></li>
<li><div class="src-line"><a name="a119"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a120"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;private</span></div></li>
<li><div class="src-line"><a name="a121"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a122"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><a href="../phpAGI/AGI.html#var$out">$out</a>&nbsp;=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a123"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a124"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a125"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Audio&nbsp;Stream</span></div></li>
<li><div class="src-line"><a name="a126"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a127"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;public</span></div></li>
<li><div class="src-line"><a name="a128"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a129"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><a href="../phpAGI/AGI.html#var$audio">$audio</a>&nbsp;=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a130"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a131"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a132"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a133"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Application&nbsp;option&nbsp;delimiter</span></div></li>
<li><div class="src-line"><a name="a134"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a135"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;public</span></div></li>
<li><div class="src-line"><a name="a136"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a137"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../phpAGI/AGI.html#var$option_delim">$option_delim</a>&nbsp;=&nbsp;<span class="src-str">&quot;,&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a138"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a139"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a140"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Constructor</span></div></li>
<li><div class="src-line"><a name="a141"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a142"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$config&nbsp;</span><span class="src-doc">is&nbsp;the&nbsp;name&nbsp;of&nbsp;the&nbsp;config&nbsp;file&nbsp;to&nbsp;parse</span></div></li>
<li><div class="src-line"><a name="a143"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc-var">$optconfig&nbsp;</span><span class="src-doc">is&nbsp;an&nbsp;array&nbsp;of&nbsp;configuration&nbsp;vars&nbsp;and&nbsp;vals,&nbsp;stuffed&nbsp;into&nbsp;$this-&gt;config['phpagi']</span></div></li>
<li><div class="src-line"><a name="a144"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a145"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-var">$config</span>=<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$optconfig</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a146"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a147"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;load&nbsp;config</span></div></li>
<li><div class="src-line"><a name="a148"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$config</span><span class="src-sym">)&nbsp;</span>&amp;&amp;&nbsp;<a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-var">$config</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a149"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a>&nbsp;=&nbsp;<a href="http://www.php.net/parse_ini_file">parse_ini_file</a><span class="src-sym">(</span><span class="src-var">$config</span><span class="src-sym">,&nbsp;</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a150"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineDEFAULT_PHPAGI_CONFIG">DEFAULT_PHPAGI_CONFIG</a></span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a151"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a>&nbsp;=&nbsp;<a href="http://www.php.net/parse_ini_file">parse_ini_file</a><span class="src-sym">(</span><span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineDEFAULT_PHPAGI_CONFIG">DEFAULT_PHPAGI_CONFIG</a></span><span class="src-sym">,&nbsp;</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a152"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a153"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;If&nbsp;optconfig&nbsp;is&nbsp;specified,&nbsp;stuff&nbsp;vals&nbsp;and&nbsp;vars&nbsp;into&nbsp;'phpagi'&nbsp;config&nbsp;array.</span></div></li>
<li><div class="src-line"><a name="a154"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$optconfig&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$var</span>=&gt;<span class="src-var">$val</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a155"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$var</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$val</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a156"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a157"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;add&nbsp;default&nbsp;values&nbsp;to&nbsp;config&nbsp;for&nbsp;uninitialized&nbsp;values</span></div></li>
<li><div class="src-line"><a name="a158"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'error_handler'</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'error_handler'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a159"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'debug'</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'debug'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a160"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'admin'</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'admin'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a161"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'tempdir'</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'tempdir'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAST_TMP_DIR">AST_TMP_DIR</a></span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a162"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a163"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;festival&nbsp;TTS&nbsp;config</span></div></li>
<li><div class="src-line"><a name="a164"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'festival'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'text2wave'</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'festival'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'text2wave'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodwhich">which</a><span class="src-sym">(</span><span class="src-str">'text2wave'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a165"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a166"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;swift&nbsp;TTS&nbsp;config</span></div></li>
<li><div class="src-line"><a name="a167"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'cepstral'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'swift'</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'cepstral'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'swift'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodwhich">which</a><span class="src-sym">(</span><span class="src-str">'swift'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a168"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a169"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/ob_implicit_flush">ob_implicit_flush</a><span class="src-sym">(</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a170"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a171"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;open&nbsp;stdin&nbsp;&amp;&nbsp;stdout</span></div></li>
<li><div class="src-line"><a name="a172"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$in">in</a>&nbsp;=&nbsp;<a href="http://www.php.net/defined">defined</a><span class="src-sym">(</span><span class="src-str">'STDIN'</span><span class="src-sym">)&nbsp;</span>?&nbsp;<span class="src-id">STDIN&nbsp;</span>:&nbsp;<a href="http://www.php.net/fopen">fopen</a><span class="src-sym">(</span><span class="src-str">'php://stdin'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'r'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a173"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$out">out</a>&nbsp;=&nbsp;<a href="http://www.php.net/defined">defined</a><span class="src-sym">(</span><span class="src-str">'STDOUT'</span><span class="src-sym">)&nbsp;</span>?&nbsp;<span class="src-id">STDOUT&nbsp;</span>:&nbsp;<a href="http://www.php.net/fopen">fopen</a><span class="src-sym">(</span><span class="src-str">'php://stdout'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'w'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a174"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a175"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;initialize&nbsp;error&nbsp;handler</span></div></li>
<li><div class="src-line"><a name="a176"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'error_handler'</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-id">true</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a177"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a178"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/set_error_handler">set_error_handler</a><span class="src-sym">(</span><span class="src-str">'phpagi_error_handler'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a179"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global&nbsp;</span><span class="src-var">$phpagi_error_handler_email</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a180"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$phpagi_error_handler_email&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'admin'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a181"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/error_reporting">error_reporting</a><span class="src-sym">(</span><span class="src-id">E_ALL</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a182"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a183"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a184"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;make&nbsp;sure&nbsp;temp&nbsp;folder&nbsp;exists</span></div></li>
<li><div class="src-line"><a name="a185"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodmake_folder">make_folder</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'tempdir'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a186"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a187"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;read&nbsp;the&nbsp;request</span></div></li>
<li><div class="src-line"><a name="a188"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$str&nbsp;</span>=&nbsp;<a href="http://www.php.net/fgets">fgets</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$in">in</a><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a189"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while</span><span class="src-sym">(</span><span class="src-var">$str&nbsp;</span>!=&nbsp;<span class="src-str">&quot;\n&quot;</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a190"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a191"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$request">request</a><span class="src-sym">[</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">,&nbsp;</span><span class="src-str">':'</span><span class="src-sym">))</span><span class="src-sym">]&nbsp;</span>=&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">,&nbsp;</span><span class="src-str">':'</span><span class="src-sym">)&nbsp;</span>+&nbsp;<span class="src-num">1</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a192"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$str&nbsp;</span>=&nbsp;<a href="http://www.php.net/fgets">fgets</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$in">in</a><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a193"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a194"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a195"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;open&nbsp;audio&nbsp;if&nbsp;eagi&nbsp;detected</span></div></li>
<li><div class="src-line"><a name="a196"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$request">request</a><span class="src-sym">[</span><span class="src-str">'agi_enhanced'</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-str">'1.0'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a197"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a198"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-str">'/proc/'&nbsp;</span>.&nbsp;<a href="http://www.php.net/getmypid">getmypid</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'/fd/3'</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a199"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$audio">audio</a>&nbsp;=&nbsp;<a href="http://www.php.net/fopen">fopen</a><span class="src-sym">(</span><span class="src-str">'/proc/'&nbsp;</span>.&nbsp;<a href="http://www.php.net/getmypid">getmypid</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'/fd/3'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'r'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a200"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-str">'/dev/fd/3'</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a201"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a202"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;may&nbsp;need&nbsp;to&nbsp;mount&nbsp;fdescfs</span></div></li>
<li><div class="src-line"><a name="a203"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$audio">audio</a>&nbsp;=&nbsp;<a href="http://www.php.net/fopen">fopen</a><span class="src-sym">(</span><span class="src-str">'/dev/fd/3'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'r'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a204"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a205"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a206"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodconlog">conlog</a><span class="src-sym">(</span><span class="src-str">'Unable&nbsp;to&nbsp;open&nbsp;audio&nbsp;stream'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a207"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a208"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$audio">audio</a><span class="src-sym">)&nbsp;</span><a href="http://www.php.net/stream_set_blocking">stream_set_blocking</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$audio">audio</a><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a209"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a210"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a211"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodconlog">conlog</a><span class="src-sym">(</span><span class="src-str">'AGI&nbsp;Request:'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a212"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodconlog">conlog</a><span class="src-sym">(</span><a href="http://www.php.net/print_r">print_r</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$request">request</a><span class="src-sym">,&nbsp;</span><span class="src-id">true</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a213"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodconlog">conlog</a><span class="src-sym">(</span><span class="src-str">'PHPAGI&nbsp;internal&nbsp;configuration:'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a214"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodconlog">conlog</a><span class="src-sym">(</span><a href="http://www.php.net/print_r">print_r</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">,&nbsp;</span><span class="src-id">true</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a215"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a216"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a217"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;*********************************************************************************************************</span></div></li>
<li><div class="src-line"><a name="a218"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COMMANDS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**</span></div></li>
<li><div class="src-line"><a name="a219"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;*********************************************************************************************************</span></div></li>
<li><div class="src-line"><a name="a220"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a221"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a222"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Answer&nbsp;channel&nbsp;if&nbsp;not&nbsp;already&nbsp;in&nbsp;answer&nbsp;state.</span></div></li>
<li><div class="src-line"><a name="a223"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a224"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-answer</span></div></li>
<li><div class="src-line"><a name="a225"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/dtmf.php&nbsp;Get&nbsp;DTMF&nbsp;tones&nbsp;from&nbsp;the&nbsp;user&nbsp;and&nbsp;say&nbsp;the&nbsp;digits</span></div></li>
<li><div class="src-line"><a name="a226"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/input.php&nbsp;Get&nbsp;text&nbsp;input&nbsp;from&nbsp;the&nbsp;user&nbsp;and&nbsp;say&nbsp;it&nbsp;back</span></div></li>
<li><div class="src-line"><a name="a227"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/ping.php&nbsp;Ping&nbsp;an&nbsp;IP&nbsp;address</span></div></li>
<li><div class="src-line"><a name="a228"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a229"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;&nbsp;['result']&nbsp;is&nbsp;0&nbsp;on&nbsp;success,&nbsp;-1&nbsp;on&nbsp;failure.</span></div></li>
<li><div class="src-line"><a name="a230"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a231"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodanswer">answer</a><span class="src-sym">(</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a232"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a233"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">'ANSWER'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a234"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a235"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a236"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a237"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Get&nbsp;the&nbsp;status&nbsp;of&nbsp;the&nbsp;specified&nbsp;channel.&nbsp;If&nbsp;no&nbsp;channel&nbsp;name&nbsp;is&nbsp;specified,&nbsp;return&nbsp;the&nbsp;status&nbsp;of&nbsp;the&nbsp;current&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a238"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a239"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-channel+status</span></div></li>
<li><div class="src-line"><a name="a240"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$channel&nbsp;</span></div></li>
<li><div class="src-line"><a name="a241"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['data']&nbsp;contains&nbsp;description.</span></div></li>
<li><div class="src-line"><a name="a242"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a243"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodchannel_status">channel_status</a><span class="src-sym">(</span><span class="src-var">$channel</span>=<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a244"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a245"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">CHANNEL&nbsp;STATUS&nbsp;<span class="src-var">$channel</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a246"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">switch</span><span class="src-sym">(</span><span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a247"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a248"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span>-<span class="src-num">1</span>:&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">There&nbsp;is&nbsp;no&nbsp;channel&nbsp;that&nbsp;matches&nbsp;<span class="src-var">$channel</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a249"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAST_STATE_DOWN">AST_STATE_DOWN</a></span>:&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'Channel&nbsp;is&nbsp;down&nbsp;and&nbsp;available'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a250"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAST_STATE_RESERVED">AST_STATE_RESERVED</a></span>:&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'Channel&nbsp;is&nbsp;down,&nbsp;but&nbsp;reserved'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a251"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAST_STATE_OFFHOOK">AST_STATE_OFFHOOK</a></span>:&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'Channel&nbsp;is&nbsp;off&nbsp;hook'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a252"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAST_STATE_DIALING">AST_STATE_DIALING</a></span>:&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'Digits&nbsp;(or&nbsp;equivalent)&nbsp;have&nbsp;been&nbsp;dialed'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a253"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAST_STATE_RING">AST_STATE_RING</a></span>:&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'Line&nbsp;is&nbsp;ringing'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a254"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAST_STATE_RINGING">AST_STATE_RINGING</a></span>:&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'Remote&nbsp;end&nbsp;is&nbsp;ringing'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a255"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAST_STATE_UP">AST_STATE_UP</a></span>:&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'Line&nbsp;is&nbsp;up'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a256"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAST_STATE_BUSY">AST_STATE_BUSY</a></span>:&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'Line&nbsp;is&nbsp;busy'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a257"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAST_STATE_DIALING_OFFHOOK">AST_STATE_DIALING_OFFHOOK</a></span>:&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'Digits&nbsp;(or&nbsp;equivalent)&nbsp;have&nbsp;been&nbsp;dialed&nbsp;while&nbsp;offhook'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a258"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAST_STATE_PRERING">AST_STATE_PRERING</a></span>:&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'Channel&nbsp;has&nbsp;detected&nbsp;an&nbsp;incoming&nbsp;call&nbsp;and&nbsp;is&nbsp;waiting&nbsp;for&nbsp;ring'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a259"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">default</span>:&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str">Unknown&nbsp;({<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">}</span>)</span><span class="src-str">&quot;</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a260"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a261"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$ret</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a262"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a263"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a264"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a265"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Deletes&nbsp;an&nbsp;entry&nbsp;in&nbsp;the&nbsp;Asterisk&nbsp;database&nbsp;for&nbsp;a&nbsp;given&nbsp;family&nbsp;and&nbsp;key.</span></div></li>
<li><div class="src-line"><a name="a266"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a267"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-database+del</span></div></li>
<li><div class="src-line"><a name="a268"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$family&nbsp;</span></div></li>
<li><div class="src-line"><a name="a269"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$key&nbsp;</span></div></li>
<li><div class="src-line"><a name="a270"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;1&nbsp;on&nbsp;sucess,&nbsp;0&nbsp;otherwise.</span></div></li>
<li><div class="src-line"><a name="a271"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a272"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methoddatabase_del">database_del</a><span class="src-sym">(</span><span class="src-var">$family</span><span class="src-sym">,&nbsp;</span><span class="src-var">$key</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a273"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a274"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">DATABASE&nbsp;DEL&nbsp;\&quot;<span class="src-var">$family</span>\&quot;&nbsp;\&quot;<span class="src-var">$key</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a275"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a276"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a277"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a278"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Deletes&nbsp;a&nbsp;family&nbsp;or&nbsp;specific&nbsp;keytree&nbsp;within&nbsp;a&nbsp;family&nbsp;in&nbsp;the&nbsp;Asterisk&nbsp;database.</span></div></li>
<li><div class="src-line"><a name="a279"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a280"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-database+deltree</span></div></li>
<li><div class="src-line"><a name="a281"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$family&nbsp;</span></div></li>
<li><div class="src-line"><a name="a282"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$keytree&nbsp;</span></div></li>
<li><div class="src-line"><a name="a283"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;1&nbsp;on&nbsp;sucess,&nbsp;0&nbsp;otherwise.</span></div></li>
<li><div class="src-line"><a name="a284"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a285"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methoddatabase_deltree">database_deltree</a><span class="src-sym">(</span><span class="src-var">$family</span><span class="src-sym">,&nbsp;</span><span class="src-var">$keytree</span>=<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a286"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a287"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cmd&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str">DATABASE&nbsp;DELTREE&nbsp;\&quot;<span class="src-var">$family</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a288"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$keytree&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span><span class="src-var">$cmd&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str">&nbsp;\&quot;<span class="src-var">$keytree</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a289"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-var">$cmd</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a290"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a291"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a292"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a293"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Retrieves&nbsp;an&nbsp;entry&nbsp;in&nbsp;the&nbsp;Asterisk&nbsp;database&nbsp;for&nbsp;a&nbsp;given&nbsp;family&nbsp;and&nbsp;key.</span></div></li>
<li><div class="src-line"><a name="a294"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a295"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-database+get</span></div></li>
<li><div class="src-line"><a name="a296"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$family&nbsp;</span></div></li>
<li><div class="src-line"><a name="a297"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$key&nbsp;</span></div></li>
<li><div class="src-line"><a name="a298"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;1&nbsp;on&nbsp;sucess,&nbsp;0&nbsp;failure.&nbsp;['data']&nbsp;holds&nbsp;the&nbsp;value</span></div></li>
<li><div class="src-line"><a name="a299"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a300"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methoddatabase_get">database_get</a><span class="src-sym">(</span><span class="src-var">$family</span><span class="src-sym">,&nbsp;</span><span class="src-var">$key</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a301"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a302"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">DATABASE&nbsp;GET&nbsp;\&quot;<span class="src-var">$family</span>\&quot;&nbsp;\&quot;<span class="src-var">$key</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a303"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a304"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a305"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a306"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Adds&nbsp;or&nbsp;updates&nbsp;an&nbsp;entry&nbsp;in&nbsp;the&nbsp;Asterisk&nbsp;database&nbsp;for&nbsp;a&nbsp;given&nbsp;family,&nbsp;key,&nbsp;and&nbsp;value.</span></div></li>
<li><div class="src-line"><a name="a307"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a308"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$family&nbsp;</span></div></li>
<li><div class="src-line"><a name="a309"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$key&nbsp;</span></div></li>
<li><div class="src-line"><a name="a310"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$value&nbsp;</span></div></li>
<li><div class="src-line"><a name="a311"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;1&nbsp;on&nbsp;sucess,&nbsp;0&nbsp;otherwise</span></div></li>
<li><div class="src-line"><a name="a312"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a313"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methoddatabase_put">database_put</a><span class="src-sym">(</span><span class="src-var">$family</span><span class="src-sym">,&nbsp;</span><span class="src-var">$key</span><span class="src-sym">,&nbsp;</span><span class="src-var">$value</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a314"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a315"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$value&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-str">'\n'</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/addslashes">addslashes</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a316"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">DATABASE&nbsp;PUT&nbsp;\&quot;<span class="src-var">$family</span>\&quot;&nbsp;\&quot;<span class="src-var">$key</span>\&quot;&nbsp;\&quot;<span class="src-var">$value</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a317"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a318"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a319"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a320"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a321"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;a&nbsp;global&nbsp;variable,&nbsp;using&nbsp;Asterisk&nbsp;1.6&nbsp;syntax.</span></div></li>
<li><div class="src-line"><a name="a322"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a323"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki/view/Asterisk+cmd+Set</span></div></li>
<li><div class="src-line"><a name="a324"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a325"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$pVariable&nbsp;</span></div></li>
<li><div class="src-line"><a name="a326"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">int</span><span class="src-doc">|</span><span class="src-doc-type">float</span><span class="src-doc-var">$pValue&nbsp;</span></div></li>
<li><div class="src-line"><a name="a327"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;1&nbsp;on&nbsp;sucess,&nbsp;0&nbsp;otherwise</span></div></li>
<li><div class="src-line"><a name="a328"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a329"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodset_global_var">set_global_var</a><span class="src-sym">(</span><span class="src-var">$pVariable</span><span class="src-sym">,&nbsp;</span><span class="src-var">$pValue</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a330"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a331"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/is_numeric">is_numeric</a><span class="src-sym">(</span><span class="src-var">$pValue</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a332"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">Set({<span class="src-var">$pVariable</span><span class="src-sym">}</span>={<span class="src-var">$pValue</span><span class="src-sym">}</span>,g);</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a333"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a334"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">Set({<span class="src-var">$pVariable</span><span class="src-sym">}</span>=\&quot;{<span class="src-var">$pValue</span><span class="src-sym">}</span>\&quot;,g);</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a335"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a336"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a337"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a338"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a339"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;a&nbsp;variable,&nbsp;using&nbsp;Asterisk&nbsp;1.6&nbsp;syntax.</span></div></li>
<li><div class="src-line"><a name="a340"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a341"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki/view/Asterisk+cmd+Set</span></div></li>
<li><div class="src-line"><a name="a342"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a343"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$pVariable&nbsp;</span></div></li>
<li><div class="src-line"><a name="a344"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">int</span><span class="src-doc">|</span><span class="src-doc-type">float</span><span class="src-doc-var">$pValue&nbsp;</span></div></li>
<li><div class="src-line"><a name="a345"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;1&nbsp;on&nbsp;sucess,&nbsp;0&nbsp;otherwise</span></div></li>
<li><div class="src-line"><a name="a346"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a347"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodset_var">set_var</a><span class="src-sym">(</span><span class="src-var">$pVariable</span><span class="src-sym">,&nbsp;</span><span class="src-var">$pValue</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a348"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a349"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/is_numeric">is_numeric</a><span class="src-sym">(</span><span class="src-var">$pValue</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a350"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">Set({<span class="src-var">$pVariable</span><span class="src-sym">}</span>={<span class="src-var">$pValue</span><span class="src-sym">}</span>);</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a351"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a352"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">Set({<span class="src-var">$pVariable</span><span class="src-sym">}</span>=\&quot;{<span class="src-var">$pValue</span><span class="src-sym">}</span>\&quot;);</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a353"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a354"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a355"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a356"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a357"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Executes&nbsp;the&nbsp;specified&nbsp;Asterisk&nbsp;application&nbsp;with&nbsp;given&nbsp;options.</span></div></li>
<li><div class="src-line"><a name="a358"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a359"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-exec</span></div></li>
<li><div class="src-line"><a name="a360"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-Asterisk+-+documentation+of+application+commands</span></div></li>
<li><div class="src-line"><a name="a361"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$application&nbsp;</span></div></li>
<li><div class="src-line"><a name="a362"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">mixed&nbsp;</span><span class="src-doc-var">$options&nbsp;</span></div></li>
<li><div class="src-line"><a name="a363"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;whatever&nbsp;the&nbsp;application&nbsp;returns,&nbsp;or&nbsp;-2&nbsp;on&nbsp;failure&nbsp;to&nbsp;find&nbsp;application</span></div></li>
<li><div class="src-line"><a name="a364"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a365"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodexec">exec</a><span class="src-sym">(</span><span class="src-var">$application</span><span class="src-sym">,&nbsp;</span><span class="src-var">$options</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a366"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a367"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">))&nbsp;</span><span class="src-var">$options&nbsp;</span>=&nbsp;<a href="http://www.php.net/join">join</a><span class="src-sym">(</span><span class="src-str">'|'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a368"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">EXEC&nbsp;<span class="src-var">$application</span>&nbsp;<span class="src-var">$options</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a369"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a370"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a371"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a372"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Plays&nbsp;the&nbsp;given&nbsp;file&nbsp;and&nbsp;receives&nbsp;DTMF&nbsp;data.</span></div></li>
<li><div class="src-line"><a name="a373"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a374"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;is&nbsp;similar&nbsp;to&nbsp;STREAM&nbsp;FILE,&nbsp;but&nbsp;this&nbsp;command&nbsp;can&nbsp;accept&nbsp;and&nbsp;return&nbsp;many&nbsp;DTMF&nbsp;digits,</span></div></li>
<li><div class="src-line"><a name="a375"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;while&nbsp;STREAM&nbsp;FILE&nbsp;returns&nbsp;immediately&nbsp;after&nbsp;the&nbsp;first&nbsp;DTMF&nbsp;digit&nbsp;is&nbsp;detected.</span></div></li>
<li><div class="src-line"><a name="a376"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a377"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Asterisk&nbsp;looks&nbsp;for&nbsp;the&nbsp;file&nbsp;to&nbsp;play&nbsp;in&nbsp;/var/lib/asterisk/sounds&nbsp;by&nbsp;default.</span></div></li>
<li><div class="src-line"><a name="a378"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a379"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;the&nbsp;user&nbsp;doesn't&nbsp;press&nbsp;any&nbsp;keys&nbsp;when&nbsp;the&nbsp;message&nbsp;plays,&nbsp;there&nbsp;is&nbsp;$timeout&nbsp;milliseconds</span></div></li>
<li><div class="src-line"><a name="a380"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;of&nbsp;silence&nbsp;then&nbsp;the&nbsp;command&nbsp;ends.</span></div></li>
<li><div class="src-line"><a name="a381"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a382"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;user&nbsp;has&nbsp;the&nbsp;opportunity&nbsp;to&nbsp;press&nbsp;a&nbsp;key&nbsp;at&nbsp;any&nbsp;time&nbsp;during&nbsp;the&nbsp;message&nbsp;or&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a383"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;post-message&nbsp;silence.&nbsp;If&nbsp;the&nbsp;user&nbsp;presses&nbsp;a&nbsp;key&nbsp;while&nbsp;the&nbsp;message&nbsp;is&nbsp;playing,&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a384"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;message&nbsp;stops&nbsp;playing.&nbsp;When&nbsp;the&nbsp;first&nbsp;key&nbsp;is&nbsp;pressed&nbsp;a&nbsp;timer&nbsp;starts&nbsp;counting&nbsp;for</span></div></li>
<li><div class="src-line"><a name="a385"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;$timeout&nbsp;milliseconds.&nbsp;Every&nbsp;time&nbsp;the&nbsp;user&nbsp;presses&nbsp;another&nbsp;key&nbsp;the&nbsp;timer&nbsp;is&nbsp;restarted.</span></div></li>
<li><div class="src-line"><a name="a386"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;command&nbsp;ends&nbsp;when&nbsp;the&nbsp;counter&nbsp;goes&nbsp;to&nbsp;zero&nbsp;or&nbsp;the&nbsp;maximum&nbsp;number&nbsp;of&nbsp;digits&nbsp;is&nbsp;entered,</span></div></li>
<li><div class="src-line"><a name="a387"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;whichever&nbsp;happens&nbsp;first.</span></div></li>
<li><div class="src-line"><a name="a388"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a389"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;you&nbsp;don't&nbsp;specify&nbsp;a&nbsp;time&nbsp;out&nbsp;then&nbsp;a&nbsp;default&nbsp;timeout&nbsp;of&nbsp;2000&nbsp;is&nbsp;used&nbsp;following&nbsp;a&nbsp;pressed</span></div></li>
<li><div class="src-line"><a name="a390"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;digit.&nbsp;If&nbsp;no&nbsp;digits&nbsp;are&nbsp;pressed&nbsp;then&nbsp;6&nbsp;seconds&nbsp;of&nbsp;silence&nbsp;follow&nbsp;the&nbsp;message.</span></div></li>
<li><div class="src-line"><a name="a391"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a392"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;you&nbsp;don't&nbsp;specify&nbsp;$max_digits&nbsp;then&nbsp;the&nbsp;user&nbsp;can&nbsp;enter&nbsp;as&nbsp;many&nbsp;digits&nbsp;as&nbsp;they&nbsp;want.</span></div></li>
<li><div class="src-line"><a name="a393"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a394"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Pressing&nbsp;the&nbsp;#&nbsp;key&nbsp;has&nbsp;the&nbsp;same&nbsp;effect&nbsp;as&nbsp;the&nbsp;timer&nbsp;running&nbsp;out:&nbsp;the&nbsp;command&nbsp;ends&nbsp;and</span></div></li>
<li><div class="src-line"><a name="a395"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;any&nbsp;previously&nbsp;keyed&nbsp;digits&nbsp;are&nbsp;returned.&nbsp;A&nbsp;side&nbsp;effect&nbsp;of&nbsp;this&nbsp;is&nbsp;that&nbsp;there&nbsp;is&nbsp;no</span></div></li>
<li><div class="src-line"><a name="a396"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;way&nbsp;to&nbsp;read&nbsp;a&nbsp;#&nbsp;key&nbsp;using&nbsp;this&nbsp;command.</span></div></li>
<li><div class="src-line"><a name="a397"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a398"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/ping.php&nbsp;Ping&nbsp;an&nbsp;IP&nbsp;address</span></div></li>
<li><div class="src-line"><a name="a399"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a400"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-get+data</span></div></li>
<li><div class="src-line"><a name="a401"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$filename&nbsp;</span><span class="src-doc">file&nbsp;to&nbsp;play.&nbsp;Do&nbsp;not&nbsp;include&nbsp;file&nbsp;extension.</span></div></li>
<li><div class="src-line"><a name="a402"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$timeout&nbsp;</span><span class="src-doc">milliseconds</span></div></li>
<li><div class="src-line"><a name="a403"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$max_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a404"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;holds&nbsp;the&nbsp;digits&nbsp;and&nbsp;['data']&nbsp;holds&nbsp;the&nbsp;timeout&nbsp;if&nbsp;present.</span></div></li>
<li><div class="src-line"><a name="a405"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a406"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;This&nbsp;differs&nbsp;from&nbsp;other&nbsp;commands&nbsp;with&nbsp;return&nbsp;DTMF&nbsp;as&nbsp;numbers&nbsp;representing&nbsp;ASCII&nbsp;characters.</span></div></li>
<li><div class="src-line"><a name="a407"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a408"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodget_data">get_data</a><span class="src-sym">(</span><span class="src-var">$filename</span><span class="src-sym">,&nbsp;</span><span class="src-var">$timeout</span>=<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$max_digits</span>=<span class="src-id">NULL</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a409"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a410"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><a href="http://www.php.net/rtrim">rtrim</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">GET&nbsp;DATA&nbsp;<span class="src-var">$filename</span>&nbsp;<span class="src-var">$timeout</span>&nbsp;<span class="src-var">$max_digits</span></span><span class="src-str">&quot;</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a411"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a412"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a413"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a414"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Fetch&nbsp;the&nbsp;value&nbsp;of&nbsp;a&nbsp;variable.</span></div></li>
<li><div class="src-line"><a name="a415"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a416"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Does&nbsp;not&nbsp;work&nbsp;with&nbsp;global&nbsp;variables.&nbsp;Does&nbsp;not&nbsp;work&nbsp;with&nbsp;some&nbsp;variables&nbsp;that&nbsp;are&nbsp;generated&nbsp;by&nbsp;modules.</span></div></li>
<li><div class="src-line"><a name="a417"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a418"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-get+variable</span></div></li>
<li><div class="src-line"><a name="a419"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-Asterisk+variables</span></div></li>
<li><div class="src-line"><a name="a420"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$variable&nbsp;</span><span class="src-doc">name</span></div></li>
<li><div class="src-line"><a name="a421"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc-var">$getvalue&nbsp;</span><span class="src-doc">return&nbsp;the&nbsp;value&nbsp;only</span></div></li>
<li><div class="src-line"><a name="a422"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;0&nbsp;if&nbsp;variable&nbsp;hasn't&nbsp;been&nbsp;set,&nbsp;1&nbsp;if&nbsp;it&nbsp;has.&nbsp;['data']&nbsp;holds&nbsp;the&nbsp;value.&nbsp;returns&nbsp;value&nbsp;if&nbsp;$getvalue&nbsp;is&nbsp;TRUE</span></div></li>
<li><div class="src-line"><a name="a423"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a424"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodget_variable">get_variable</a><span class="src-sym">(</span><span class="src-var">$variable</span><span class="src-sym">,</span><span class="src-var">$getvalue</span>=<span class="src-id">FALSE</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a425"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a426"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$res</span>=<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">GET&nbsp;VARIABLE&nbsp;<span class="src-var">$variable</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a427"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a428"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$getvalue</span>==<span class="src-id">FALSE</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a429"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a430"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a431"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a432"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a433"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a434"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a435"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a436"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Fetch&nbsp;the&nbsp;value&nbsp;of&nbsp;a&nbsp;full&nbsp;variable.</span></div></li>
<li><div class="src-line"><a name="a437"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a438"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a439"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki/view/get+full+variable</span></div></li>
<li><div class="src-line"><a name="a440"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-Asterisk+variables</span></div></li>
<li><div class="src-line"><a name="a441"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$variable&nbsp;</span><span class="src-doc">name</span></div></li>
<li><div class="src-line"><a name="a442"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$channel&nbsp;</span><span class="src-doc">channel</span></div></li>
<li><div class="src-line"><a name="a443"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc-var">$getvalue&nbsp;</span><span class="src-doc">return&nbsp;the&nbsp;value&nbsp;only</span></div></li>
<li><div class="src-line"><a name="a444"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;0&nbsp;if&nbsp;variable&nbsp;hasn't&nbsp;been&nbsp;set,&nbsp;1&nbsp;if&nbsp;it&nbsp;has.&nbsp;['data']&nbsp;holds&nbsp;the&nbsp;value.&nbsp;&nbsp;returns&nbsp;value&nbsp;if&nbsp;$getvalue&nbsp;is&nbsp;TRUE</span></div></li>
<li><div class="src-line"><a name="a445"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a446"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodget_fullvariable">get_fullvariable</a><span class="src-sym">(</span><span class="src-var">$variable</span><span class="src-sym">,</span><span class="src-var">$channel</span>=<span class="src-id">FALSE</span><span class="src-sym">,</span><span class="src-var">$getvalue</span>=<span class="src-id">FALSE</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a447"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a448"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$channel</span>==<span class="src-id">FALSE</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a449"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$req&nbsp;</span>=&nbsp;<span class="src-var">$variable</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a450"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a451"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$req&nbsp;</span>=&nbsp;<span class="src-var">$variable</span>.<span class="src-str">'&nbsp;'</span>.<span class="src-var">$channel</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a452"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a453"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a454"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$res</span>=<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">'GET&nbsp;VARIABLE&nbsp;FULL&nbsp;'</span>.<span class="src-var">$req</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a455"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a456"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$getvalue</span>==<span class="src-id">FALSE</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a457"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a458"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a459"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a460"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a461"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a462"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a463"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a464"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Hangup&nbsp;the&nbsp;specified&nbsp;channel.&nbsp;If&nbsp;no&nbsp;channel&nbsp;name&nbsp;is&nbsp;given,&nbsp;hang&nbsp;up&nbsp;the&nbsp;current&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a465"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a466"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;With&nbsp;power&nbsp;comes&nbsp;responsibility.&nbsp;Hanging&nbsp;up&nbsp;channels&nbsp;other&nbsp;than&nbsp;your&nbsp;own&nbsp;isn't&nbsp;something</span></div></li>
<li><div class="src-line"><a name="a467"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;that&nbsp;is&nbsp;done&nbsp;routinely.&nbsp;If&nbsp;you&nbsp;are&nbsp;not&nbsp;sure&nbsp;why&nbsp;you&nbsp;are&nbsp;doing&nbsp;so,&nbsp;then&nbsp;don't.</span></div></li>
<li><div class="src-line"><a name="a468"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a469"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-hangup</span></div></li>
<li><div class="src-line"><a name="a470"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/dtmf.php&nbsp;Get&nbsp;DTMF&nbsp;tones&nbsp;from&nbsp;the&nbsp;user&nbsp;and&nbsp;say&nbsp;the&nbsp;digits</span></div></li>
<li><div class="src-line"><a name="a471"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/input.php&nbsp;Get&nbsp;text&nbsp;input&nbsp;from&nbsp;the&nbsp;user&nbsp;and&nbsp;say&nbsp;it&nbsp;back</span></div></li>
<li><div class="src-line"><a name="a472"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/ping.php&nbsp;Ping&nbsp;an&nbsp;IP&nbsp;address</span></div></li>
<li><div class="src-line"><a name="a473"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a474"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$channel&nbsp;</span></div></li>
<li><div class="src-line"><a name="a475"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;1&nbsp;on&nbsp;success,&nbsp;-1&nbsp;on&nbsp;failure.</span></div></li>
<li><div class="src-line"><a name="a476"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a477"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodhangup">hangup</a><span class="src-sym">(</span><span class="src-var">$channel</span>=<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a478"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a479"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">HANGUP&nbsp;<span class="src-var">$channel</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a480"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a481"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a482"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a483"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Does&nbsp;nothing.</span></div></li>
<li><div class="src-line"><a name="a484"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a485"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-noop</span></div></li>
<li><div class="src-line"><a name="a486"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a487"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a488"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodnoop">noop</a><span class="src-sym">(</span><span class="src-var">$string</span>=<span class="src-str">&quot;&quot;</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a489"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a490"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">NOOP&nbsp;\&quot;<span class="src-var">$string</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a491"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a492"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a493"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a494"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Receive&nbsp;a&nbsp;character&nbsp;of&nbsp;text&nbsp;from&nbsp;a&nbsp;connected&nbsp;channel.&nbsp;Waits&nbsp;up&nbsp;to&nbsp;$timeout&nbsp;milliseconds&nbsp;for</span></div></li>
<li><div class="src-line"><a name="a495"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;a&nbsp;character&nbsp;to&nbsp;arrive,&nbsp;or&nbsp;infinitely&nbsp;if&nbsp;$timeout&nbsp;is&nbsp;zero.</span></div></li>
<li><div class="src-line"><a name="a496"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a497"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-receive+char</span></div></li>
<li><div class="src-line"><a name="a498"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$timeout&nbsp;</span><span class="src-doc">milliseconds</span></div></li>
<li><div class="src-line"><a name="a499"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;0&nbsp;on&nbsp;timeout&nbsp;or&nbsp;not&nbsp;supported,&nbsp;-1&nbsp;on&nbsp;failure.&nbsp;Otherwise</span></div></li>
<li><div class="src-line"><a name="a500"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;it&nbsp;is&nbsp;the&nbsp;decimal&nbsp;value&nbsp;of&nbsp;the&nbsp;DTMF&nbsp;tone.&nbsp;Use&nbsp;chr()&nbsp;to&nbsp;convert&nbsp;to&nbsp;ASCII.</span></div></li>
<li><div class="src-line"><a name="a501"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a502"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodreceive_char">receive_char</a><span class="src-sym">(</span><span class="src-var">$timeout</span>=-<span class="src-num">1</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a503"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a504"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">RECEIVE&nbsp;CHAR&nbsp;<span class="src-var">$timeout</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a505"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a506"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a507"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a508"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Record&nbsp;sound&nbsp;to&nbsp;a&nbsp;file&nbsp;until&nbsp;an&nbsp;acceptable&nbsp;DTMF&nbsp;digit&nbsp;is&nbsp;received&nbsp;or&nbsp;a&nbsp;specified&nbsp;amount&nbsp;of</span></div></li>
<li><div class="src-line"><a name="a509"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;time&nbsp;has&nbsp;passed.&nbsp;Optionally&nbsp;the&nbsp;file&nbsp;BEEP&nbsp;is&nbsp;played&nbsp;before&nbsp;recording&nbsp;begins.</span></div></li>
<li><div class="src-line"><a name="a510"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a511"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-record+file</span></div></li>
<li><div class="src-line"><a name="a512"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$file&nbsp;</span><span class="src-doc">to&nbsp;record,&nbsp;without&nbsp;extension,&nbsp;often&nbsp;created&nbsp;in&nbsp;/var/lib/asterisk/sounds</span></div></li>
<li><div class="src-line"><a name="a513"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$format&nbsp;</span><span class="src-doc">of&nbsp;the&nbsp;file.&nbsp;GSM&nbsp;and&nbsp;WAV&nbsp;are&nbsp;commonly&nbsp;used&nbsp;formats.&nbsp;MP3&nbsp;is&nbsp;read-only&nbsp;and&nbsp;thus&nbsp;cannot&nbsp;be&nbsp;used.</span></div></li>
<li><div class="src-line"><a name="a514"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a515"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$timeout&nbsp;</span><span class="src-doc">is&nbsp;the&nbsp;maximum&nbsp;record&nbsp;time&nbsp;in&nbsp;milliseconds,&nbsp;or&nbsp;-1&nbsp;for&nbsp;no&nbsp;timeout.</span></div></li>
<li><div class="src-line"><a name="a516"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$offset&nbsp;</span><span class="src-doc">to&nbsp;seek&nbsp;to&nbsp;without&nbsp;exceeding&nbsp;the&nbsp;end&nbsp;of&nbsp;the&nbsp;file.</span></div></li>
<li><div class="src-line"><a name="a517"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc-var">$beep&nbsp;</span></div></li>
<li><div class="src-line"><a name="a518"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$silence&nbsp;</span><span class="src-doc">number&nbsp;of&nbsp;seconds&nbsp;of&nbsp;silence&nbsp;allowed&nbsp;before&nbsp;the&nbsp;function&nbsp;returns&nbsp;despite&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a519"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;lack&nbsp;of&nbsp;dtmf&nbsp;digits&nbsp;or&nbsp;reaching&nbsp;timeout.</span></div></li>
<li><div class="src-line"><a name="a520"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;-1&nbsp;on&nbsp;error,&nbsp;0&nbsp;on&nbsp;hangup,&nbsp;otherwise&nbsp;a&nbsp;decimal&nbsp;value&nbsp;of&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a521"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;DTMF&nbsp;tone.&nbsp;Use&nbsp;chr()&nbsp;to&nbsp;convert&nbsp;to&nbsp;ASCII.</span></div></li>
<li><div class="src-line"><a name="a522"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a523"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodrecord_file">record_file</a><span class="src-sym">(</span><span class="src-var">$file</span><span class="src-sym">,&nbsp;</span><span class="src-var">$format</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-var">$timeout</span>=-<span class="src-num">1</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span>=<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$beep</span>=<span class="src-id">false</span><span class="src-sym">,&nbsp;</span><span class="src-var">$silence</span>=<span class="src-id">NULL</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a524"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a525"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cmd&nbsp;</span>=&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">RECORD&nbsp;FILE&nbsp;<span class="src-var">$file</span>&nbsp;<span class="src-var">$format</span>&nbsp;\&quot;<span class="src-var">$escape_digits</span>\&quot;&nbsp;<span class="src-var">$timeout</span>&nbsp;<span class="src-var">$offset</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a526"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$beep</span><span class="src-sym">)&nbsp;</span><span class="src-var">$cmd&nbsp;</span>.=&nbsp;<span class="src-str">'&nbsp;BEEP'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a527"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$silence</span><span class="src-sym">))&nbsp;</span><span class="src-var">$cmd&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str">&nbsp;s=<span class="src-var">$silence</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a528"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-var">$cmd</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a529"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a530"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a531"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a532"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Say&nbsp;the&nbsp;given&nbsp;digit&nbsp;string,&nbsp;returning&nbsp;early&nbsp;if&nbsp;any&nbsp;of&nbsp;the&nbsp;given&nbsp;DTMF&nbsp;escape&nbsp;digits&nbsp;are&nbsp;received&nbsp;on&nbsp;the&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a533"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a534"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-say+digits</span></div></li>
<li><div class="src-line"><a name="a535"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a536"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a537"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;-1&nbsp;on&nbsp;hangup&nbsp;or&nbsp;error,&nbsp;0&nbsp;if&nbsp;playback&nbsp;completes&nbsp;with&nbsp;no</span></div></li>
<li><div class="src-line"><a name="a538"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;digit&nbsp;received,&nbsp;otherwise&nbsp;a&nbsp;decimal&nbsp;value&nbsp;of&nbsp;the&nbsp;DTMF&nbsp;tone.&nbsp;&nbsp;Use&nbsp;chr()&nbsp;to&nbsp;convert&nbsp;to&nbsp;ASCII.</span></div></li>
<li><div class="src-line"><a name="a539"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a540"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodsay_digits">say_digits</a><span class="src-sym">(</span><span class="src-var">$digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a541"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a542"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">SAY&nbsp;DIGITS&nbsp;<span class="src-var">$digits</span>&nbsp;\&quot;<span class="src-var">$escape_digits</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a543"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a544"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a545"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a546"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Say&nbsp;the&nbsp;given&nbsp;number,&nbsp;returning&nbsp;early&nbsp;if&nbsp;any&nbsp;of&nbsp;the&nbsp;given&nbsp;DTMF&nbsp;escape&nbsp;digits&nbsp;are&nbsp;received&nbsp;on&nbsp;the&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a547"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a548"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-say+number</span></div></li>
<li><div class="src-line"><a name="a549"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$number&nbsp;</span></div></li>
<li><div class="src-line"><a name="a550"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a551"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;-1&nbsp;on&nbsp;hangup&nbsp;or&nbsp;error,&nbsp;0&nbsp;if&nbsp;playback&nbsp;completes&nbsp;with&nbsp;no</span></div></li>
<li><div class="src-line"><a name="a552"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;digit&nbsp;received,&nbsp;otherwise&nbsp;a&nbsp;decimal&nbsp;value&nbsp;of&nbsp;the&nbsp;DTMF&nbsp;tone.&nbsp;&nbsp;Use&nbsp;chr()&nbsp;to&nbsp;convert&nbsp;to&nbsp;ASCII.</span></div></li>
<li><div class="src-line"><a name="a553"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a554"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodsay_number">say_number</a><span class="src-sym">(</span><span class="src-var">$number</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a555"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a556"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">SAY&nbsp;NUMBER&nbsp;<span class="src-var">$number</span>&nbsp;\&quot;<span class="src-var">$escape_digits</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a557"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a558"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a559"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a560"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Say&nbsp;the&nbsp;given&nbsp;character&nbsp;string,&nbsp;returning&nbsp;early&nbsp;if&nbsp;any&nbsp;of&nbsp;the&nbsp;given&nbsp;DTMF&nbsp;escape&nbsp;digits&nbsp;are&nbsp;received&nbsp;on&nbsp;the&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a561"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a562"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-say+phonetic</span></div></li>
<li><div class="src-line"><a name="a563"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$text&nbsp;</span></div></li>
<li><div class="src-line"><a name="a564"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a565"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;-1&nbsp;on&nbsp;hangup&nbsp;or&nbsp;error,&nbsp;0&nbsp;if&nbsp;playback&nbsp;completes&nbsp;with&nbsp;no</span></div></li>
<li><div class="src-line"><a name="a566"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;digit&nbsp;received,&nbsp;otherwise&nbsp;a&nbsp;decimal&nbsp;value&nbsp;of&nbsp;the&nbsp;DTMF&nbsp;tone.&nbsp;&nbsp;Use&nbsp;chr()&nbsp;to&nbsp;convert&nbsp;to&nbsp;ASCII.</span></div></li>
<li><div class="src-line"><a name="a567"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a568"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodsay_phonetic">say_phonetic</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a569"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a570"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">SAY&nbsp;PHONETIC&nbsp;<span class="src-var">$text</span>&nbsp;\&quot;<span class="src-var">$escape_digits</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a571"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a572"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a573"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a574"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Say&nbsp;a&nbsp;given&nbsp;time,&nbsp;returning&nbsp;early&nbsp;if&nbsp;any&nbsp;of&nbsp;the&nbsp;given&nbsp;DTMF&nbsp;escape&nbsp;digits&nbsp;are&nbsp;received&nbsp;on&nbsp;the&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a575"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a576"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-say+time</span></div></li>
<li><div class="src-line"><a name="a577"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$time&nbsp;</span><span class="src-doc">number&nbsp;of&nbsp;seconds&nbsp;elapsed&nbsp;since&nbsp;00:00:00&nbsp;on&nbsp;January&nbsp;1,&nbsp;1970,&nbsp;Coordinated&nbsp;Universal&nbsp;Time&nbsp;(UTC).</span></div></li>
<li><div class="src-line"><a name="a578"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a579"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;-1&nbsp;on&nbsp;hangup&nbsp;or&nbsp;error,&nbsp;0&nbsp;if&nbsp;playback&nbsp;completes&nbsp;with&nbsp;no</span></div></li>
<li><div class="src-line"><a name="a580"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;digit&nbsp;received,&nbsp;otherwise&nbsp;a&nbsp;decimal&nbsp;value&nbsp;of&nbsp;the&nbsp;DTMF&nbsp;tone.&nbsp;&nbsp;Use&nbsp;chr()&nbsp;to&nbsp;convert&nbsp;to&nbsp;ASCII.</span></div></li>
<li><div class="src-line"><a name="a581"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a582"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodsay_time">say_time</a><span class="src-sym">(</span><span class="src-var">$time</span>=<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a583"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a584"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$time</span><span class="src-sym">))&nbsp;</span><span class="src-var">$time&nbsp;</span>=&nbsp;<a href="http://www.php.net/time">time</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a585"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">SAY&nbsp;TIME&nbsp;<span class="src-var">$time</span>&nbsp;\&quot;<span class="src-var">$escape_digits</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a586"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a587"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a588"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a589"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Send&nbsp;the&nbsp;specified&nbsp;image&nbsp;on&nbsp;a&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a590"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a591"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Most&nbsp;channels&nbsp;do&nbsp;not&nbsp;support&nbsp;the&nbsp;transmission&nbsp;of&nbsp;images.</span></div></li>
<li><div class="src-line"><a name="a592"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a593"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-send+image</span></div></li>
<li><div class="src-line"><a name="a594"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$image&nbsp;</span><span class="src-doc">without&nbsp;extension,&nbsp;often&nbsp;in&nbsp;/var/lib/asterisk/images</span></div></li>
<li><div class="src-line"><a name="a595"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;-1&nbsp;on&nbsp;hangup&nbsp;or&nbsp;error,&nbsp;0&nbsp;if&nbsp;the&nbsp;image&nbsp;is&nbsp;sent&nbsp;or</span></div></li>
<li><div class="src-line"><a name="a596"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;channel&nbsp;does&nbsp;not&nbsp;support&nbsp;image&nbsp;transmission.</span></div></li>
<li><div class="src-line"><a name="a597"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a598"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodsend_image">send_image</a><span class="src-sym">(</span><span class="src-var">$image</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a599"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a600"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">SEND&nbsp;IMAGE&nbsp;<span class="src-var">$image</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a601"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a602"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a603"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a604"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Send&nbsp;the&nbsp;given&nbsp;text&nbsp;to&nbsp;the&nbsp;connected&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a605"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a606"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Most&nbsp;channels&nbsp;do&nbsp;not&nbsp;support&nbsp;transmission&nbsp;of&nbsp;text.</span></div></li>
<li><div class="src-line"><a name="a607"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a608"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-send+text</span></div></li>
<li><div class="src-line"><a name="a609"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">$text&nbsp;</span></div></li>
<li><div class="src-line"><a name="a610"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;-1&nbsp;on&nbsp;hangup&nbsp;or&nbsp;error,&nbsp;0&nbsp;if&nbsp;the&nbsp;text&nbsp;is&nbsp;sent&nbsp;or</span></div></li>
<li><div class="src-line"><a name="a611"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;channel&nbsp;does&nbsp;not&nbsp;support&nbsp;text&nbsp;transmission.</span></div></li>
<li><div class="src-line"><a name="a612"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a613"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodsend_text">send_text</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a614"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a615"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">SEND&nbsp;TEXT&nbsp;\&quot;<span class="src-var">$text</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a616"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a617"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a618"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a619"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Cause&nbsp;the&nbsp;channel&nbsp;to&nbsp;automatically&nbsp;hangup&nbsp;at&nbsp;$time&nbsp;seconds&nbsp;in&nbsp;the&nbsp;future.</span></div></li>
<li><div class="src-line"><a name="a620"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;$time&nbsp;is&nbsp;0&nbsp;then&nbsp;the&nbsp;autohangup&nbsp;feature&nbsp;is&nbsp;disabled&nbsp;on&nbsp;this&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a621"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a622"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;the&nbsp;channel&nbsp;is&nbsp;hungup&nbsp;prior&nbsp;to&nbsp;$time&nbsp;seconds,&nbsp;this&nbsp;setting&nbsp;has&nbsp;no&nbsp;effect.</span></div></li>
<li><div class="src-line"><a name="a623"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a624"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-set+autohangup</span></div></li>
<li><div class="src-line"><a name="a625"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$time&nbsp;</span><span class="src-doc">until&nbsp;automatic&nbsp;hangup</span></div></li>
<li><div class="src-line"><a name="a626"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a627"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a628"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodset_autohangup">set_autohangup</a><span class="src-sym">(</span><span class="src-var">$time</span>=<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a629"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a630"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">SET&nbsp;AUTOHANGUP&nbsp;<span class="src-var">$time</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a631"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a632"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a633"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a634"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Changes&nbsp;the&nbsp;caller&nbsp;ID&nbsp;of&nbsp;the&nbsp;current&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a635"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a636"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-set+callerid</span></div></li>
<li><div class="src-line"><a name="a637"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$cid&nbsp;</span><span class="src-doc">example:&nbsp;&quot;John&nbsp;Smith&quot;&lt;1234567&gt;</span></div></li>
<li><div class="src-line"><a name="a638"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;This&nbsp;command&nbsp;will&nbsp;let&nbsp;you&nbsp;take&nbsp;liberties&nbsp;with&nbsp;the&nbsp;&lt;caller&nbsp;ID&nbsp;specification&gt;&nbsp;but&nbsp;the&nbsp;format&nbsp;shown&nbsp;in&nbsp;the&nbsp;example&nbsp;above&nbsp;works</span></div></li>
<li><div class="src-line"><a name="a639"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;well:&nbsp;the&nbsp;name&nbsp;enclosed&nbsp;in&nbsp;double&nbsp;quotes&nbsp;followed&nbsp;immediately&nbsp;by&nbsp;the&nbsp;number&nbsp;inside&nbsp;angle&nbsp;brackets.&nbsp;If&nbsp;there&nbsp;is&nbsp;no&nbsp;name&nbsp;then</span></div></li>
<li><div class="src-line"><a name="a640"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;you&nbsp;can&nbsp;omit&nbsp;it.&nbsp;If&nbsp;the&nbsp;name&nbsp;contains&nbsp;no&nbsp;spaces&nbsp;you&nbsp;can&nbsp;omit&nbsp;the&nbsp;double&nbsp;quotes&nbsp;around&nbsp;it.&nbsp;The&nbsp;number&nbsp;must&nbsp;follow&nbsp;the&nbsp;name</span></div></li>
<li><div class="src-line"><a name="a641"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;immediately;&nbsp;don't&nbsp;put&nbsp;a&nbsp;space&nbsp;between&nbsp;them.&nbsp;The&nbsp;angle&nbsp;brackets&nbsp;around&nbsp;the&nbsp;number&nbsp;are&nbsp;necessary;&nbsp;if&nbsp;you&nbsp;omit&nbsp;them&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a642"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;number&nbsp;will&nbsp;be&nbsp;considered&nbsp;to&nbsp;be&nbsp;part&nbsp;of&nbsp;the&nbsp;name.</span></div></li>
<li><div class="src-line"><a name="a643"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a644"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a645"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodset_callerid">set_callerid</a><span class="src-sym">(</span><span class="src-var">$cid</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a646"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a647"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">SET&nbsp;CALLERID&nbsp;<span class="src-var">$cid</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a648"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a649"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a650"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a651"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;context&nbsp;for&nbsp;continuation&nbsp;upon&nbsp;exiting&nbsp;the&nbsp;application.</span></div></li>
<li><div class="src-line"><a name="a652"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a653"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Setting&nbsp;the&nbsp;context&nbsp;does&nbsp;NOT&nbsp;automatically&nbsp;reset&nbsp;the&nbsp;extension&nbsp;and&nbsp;the&nbsp;priority;&nbsp;if&nbsp;you&nbsp;want&nbsp;to&nbsp;start&nbsp;at&nbsp;the&nbsp;top&nbsp;of&nbsp;the&nbsp;new</span></div></li>
<li><div class="src-line"><a name="a654"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;context&nbsp;you&nbsp;should&nbsp;set&nbsp;extension&nbsp;and&nbsp;priority&nbsp;yourself.</span></div></li>
<li><div class="src-line"><a name="a655"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a656"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;you&nbsp;specify&nbsp;a&nbsp;non-existent&nbsp;context&nbsp;you&nbsp;receive&nbsp;no&nbsp;error&nbsp;indication&nbsp;(['result']&nbsp;is&nbsp;still&nbsp;0)&nbsp;but&nbsp;you&nbsp;do&nbsp;get&nbsp;a</span></div></li>
<li><div class="src-line"><a name="a657"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;warning&nbsp;message&nbsp;on&nbsp;the&nbsp;Asterisk&nbsp;console.</span></div></li>
<li><div class="src-line"><a name="a658"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a659"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-set+context</span></div></li>
<li><div class="src-line"><a name="a660"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$context&nbsp;</span></div></li>
<li><div class="src-line"><a name="a661"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a662"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a663"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodset_context">set_context</a><span class="src-sym">(</span><span class="src-var">$context</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a664"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a665"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">SET&nbsp;CONTEXT&nbsp;<span class="src-var">$context</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a666"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a667"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a668"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a669"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Set&nbsp;the&nbsp;extension&nbsp;to&nbsp;be&nbsp;used&nbsp;for&nbsp;continuation&nbsp;upon&nbsp;exiting&nbsp;the&nbsp;application.</span></div></li>
<li><div class="src-line"><a name="a670"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a671"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Setting&nbsp;the&nbsp;extension&nbsp;does&nbsp;NOT&nbsp;automatically&nbsp;reset&nbsp;the&nbsp;priority.&nbsp;If&nbsp;you&nbsp;want&nbsp;to&nbsp;start&nbsp;with&nbsp;the&nbsp;first&nbsp;priority&nbsp;of&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a672"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;extension&nbsp;you&nbsp;should&nbsp;set&nbsp;the&nbsp;priority&nbsp;yourself.</span></div></li>
<li><div class="src-line"><a name="a673"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a674"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;you&nbsp;specify&nbsp;a&nbsp;non-existent&nbsp;extension&nbsp;you&nbsp;receive&nbsp;no&nbsp;error&nbsp;indication&nbsp;(['result']&nbsp;is&nbsp;still&nbsp;0)&nbsp;but&nbsp;you&nbsp;do</span></div></li>
<li><div class="src-line"><a name="a675"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;get&nbsp;a&nbsp;warning&nbsp;message&nbsp;on&nbsp;the&nbsp;Asterisk&nbsp;console.</span></div></li>
<li><div class="src-line"><a name="a676"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a677"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-set+extension</span></div></li>
<li><div class="src-line"><a name="a678"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$extension&nbsp;</span></div></li>
<li><div class="src-line"><a name="a679"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a680"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a681"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodset_extension">set_extension</a><span class="src-sym">(</span><span class="src-var">$extension</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a682"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a683"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">SET&nbsp;EXTENSION&nbsp;<span class="src-var">$extension</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a684"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a685"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a686"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a687"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Enable/Disable&nbsp;Music&nbsp;on&nbsp;hold&nbsp;generator.</span></div></li>
<li><div class="src-line"><a name="a688"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a689"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-set+music</span></div></li>
<li><div class="src-line"><a name="a690"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc-var">$enabled&nbsp;</span></div></li>
<li><div class="src-line"><a name="a691"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$class&nbsp;</span></div></li>
<li><div class="src-line"><a name="a692"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a693"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a694"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodset_music">set_music</a><span class="src-sym">(</span><span class="src-var">$enabled</span>=<span class="src-id">true</span><span class="src-sym">,&nbsp;</span><span class="src-var">$class</span>=<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a695"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a696"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$enabled&nbsp;</span>=&nbsp;<span class="src-sym">(</span><span class="src-var">$enabled</span><span class="src-sym">)&nbsp;</span>?&nbsp;<span class="src-str">'ON'&nbsp;</span>:&nbsp;<span class="src-str">'OFF'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a697"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">SET&nbsp;MUSIC&nbsp;<span class="src-var">$enabled</span>&nbsp;<span class="src-var">$class</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a698"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a699"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a700"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a701"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Set&nbsp;the&nbsp;priority&nbsp;to&nbsp;be&nbsp;used&nbsp;for&nbsp;continuation&nbsp;upon&nbsp;exiting&nbsp;the&nbsp;application.</span></div></li>
<li><div class="src-line"><a name="a702"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a703"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;you&nbsp;specify&nbsp;a&nbsp;non-existent&nbsp;priority&nbsp;you&nbsp;receive&nbsp;no&nbsp;error&nbsp;indication&nbsp;(['result']&nbsp;is&nbsp;still&nbsp;0)</span></div></li>
<li><div class="src-line"><a name="a704"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;and&nbsp;no&nbsp;warning&nbsp;is&nbsp;issued&nbsp;on&nbsp;the&nbsp;Asterisk&nbsp;console.</span></div></li>
<li><div class="src-line"><a name="a705"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a706"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-set+priority</span></div></li>
<li><div class="src-line"><a name="a707"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$priority&nbsp;</span></div></li>
<li><div class="src-line"><a name="a708"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a709"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a710"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodset_priority">set_priority</a><span class="src-sym">(</span><span class="src-var">$priority</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a711"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a712"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">SET&nbsp;PRIORITY&nbsp;<span class="src-var">$priority</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a713"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a714"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a715"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a716"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;a&nbsp;variable&nbsp;to&nbsp;the&nbsp;specified&nbsp;value.&nbsp;The&nbsp;variables&nbsp;so&nbsp;created&nbsp;can&nbsp;later&nbsp;be&nbsp;used&nbsp;by&nbsp;later&nbsp;using&nbsp;${&lt;variablename&gt;}</span></div></li>
<li><div class="src-line"><a name="a717"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;in&nbsp;the&nbsp;dialplan.</span></div></li>
<li><div class="src-line"><a name="a718"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a719"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;These&nbsp;variables&nbsp;live&nbsp;in&nbsp;the&nbsp;channel&nbsp;Asterisk&nbsp;creates&nbsp;when&nbsp;you&nbsp;pickup&nbsp;a&nbsp;phone&nbsp;and&nbsp;as&nbsp;such&nbsp;they&nbsp;are&nbsp;both&nbsp;local&nbsp;and&nbsp;temporary.</span></div></li>
<li><div class="src-line"><a name="a720"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Variables&nbsp;created&nbsp;in&nbsp;one&nbsp;channel&nbsp;can&nbsp;not&nbsp;be&nbsp;accessed&nbsp;by&nbsp;another&nbsp;channel.&nbsp;When&nbsp;you&nbsp;hang&nbsp;up&nbsp;the&nbsp;phone,&nbsp;the&nbsp;channel&nbsp;is&nbsp;deleted</span></div></li>
<li><div class="src-line"><a name="a721"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;and&nbsp;any&nbsp;variables&nbsp;in&nbsp;that&nbsp;channel&nbsp;are&nbsp;deleted&nbsp;as&nbsp;well.</span></div></li>
<li><div class="src-line"><a name="a722"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a723"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-set+variable</span></div></li>
<li><div class="src-line"><a name="a724"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$variable&nbsp;</span><span class="src-doc">is&nbsp;case&nbsp;sensitive</span></div></li>
<li><div class="src-line"><a name="a725"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$value&nbsp;</span></div></li>
<li><div class="src-line"><a name="a726"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a727"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a728"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodset_variable">set_variable</a><span class="src-sym">(</span><span class="src-var">$variable</span><span class="src-sym">,&nbsp;</span><span class="src-var">$value</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a729"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a730"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$value&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-str">'\n'</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/addslashes">addslashes</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a731"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">SET&nbsp;VARIABLE&nbsp;<span class="src-var">$variable</span>&nbsp;\&quot;<span class="src-var">$value</span>\&quot;</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a732"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a733"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a734"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a735"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Play&nbsp;the&nbsp;given&nbsp;audio&nbsp;file,&nbsp;allowing&nbsp;playback&nbsp;to&nbsp;be&nbsp;interrupted&nbsp;by&nbsp;a&nbsp;DTMF&nbsp;digit.&nbsp;This&nbsp;command&nbsp;is&nbsp;similar&nbsp;to&nbsp;the&nbsp;GET&nbsp;DATA</span></div></li>
<li><div class="src-line"><a name="a736"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;command&nbsp;but&nbsp;this&nbsp;command&nbsp;returns&nbsp;after&nbsp;the&nbsp;first&nbsp;DTMF&nbsp;digit&nbsp;has&nbsp;been&nbsp;pressed&nbsp;while&nbsp;GET&nbsp;DATA&nbsp;can&nbsp;accumulated&nbsp;any&nbsp;number&nbsp;of</span></div></li>
<li><div class="src-line"><a name="a737"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;digits&nbsp;before&nbsp;returning.</span></div></li>
<li><div class="src-line"><a name="a738"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a739"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/ping.php&nbsp;Ping&nbsp;an&nbsp;IP&nbsp;address</span></div></li>
<li><div class="src-line"><a name="a740"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a741"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-stream+file</span></div></li>
<li><div class="src-line"><a name="a742"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$filename&nbsp;</span><span class="src-doc">without&nbsp;extension,&nbsp;often&nbsp;in&nbsp;/var/lib/asterisk/sounds</span></div></li>
<li><div class="src-line"><a name="a743"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a744"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$offset&nbsp;</span></div></li>
<li><div class="src-line"><a name="a745"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;-1&nbsp;on&nbsp;hangup&nbsp;or&nbsp;error,&nbsp;0&nbsp;if&nbsp;playback&nbsp;completes&nbsp;with&nbsp;no</span></div></li>
<li><div class="src-line"><a name="a746"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;digit&nbsp;received,&nbsp;otherwise&nbsp;a&nbsp;decimal&nbsp;value&nbsp;of&nbsp;the&nbsp;DTMF&nbsp;tone.&nbsp;&nbsp;Use&nbsp;chr()&nbsp;to&nbsp;convert&nbsp;to&nbsp;ASCII.</span></div></li>
<li><div class="src-line"><a name="a747"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a748"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodstream_file">stream_file</a><span class="src-sym">(</span><span class="src-var">$filename</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span>=<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a749"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a750"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">STREAM&nbsp;FILE&nbsp;<span class="src-var">$filename</span>&nbsp;\&quot;<span class="src-var">$escape_digits</span>\&quot;&nbsp;<span class="src-var">$offset</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a751"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a752"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a753"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a754"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Enable&nbsp;or&nbsp;disable&nbsp;TDD&nbsp;transmission/reception&nbsp;on&nbsp;the&nbsp;current&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a755"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a756"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-tdd+mode</span></div></li>
<li><div class="src-line"><a name="a757"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$setting&nbsp;</span><span class="src-doc">can&nbsp;be&nbsp;on,&nbsp;off&nbsp;or&nbsp;mate</span></div></li>
<li><div class="src-line"><a name="a758"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;1&nbsp;on&nbsp;sucess,&nbsp;0&nbsp;if&nbsp;the&nbsp;channel&nbsp;is&nbsp;not&nbsp;TDD&nbsp;capable.</span></div></li>
<li><div class="src-line"><a name="a759"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a760"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodtdd_mode">tdd_mode</a><span class="src-sym">(</span><span class="src-var">$setting</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a761"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a762"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">TDD&nbsp;MODE&nbsp;<span class="src-var">$setting</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a763"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a764"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a765"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a766"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sends&nbsp;$message&nbsp;to&nbsp;the&nbsp;Asterisk&nbsp;console&nbsp;via&nbsp;the&nbsp;'verbose'&nbsp;message&nbsp;system.</span></div></li>
<li><div class="src-line"><a name="a767"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a768"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;the&nbsp;Asterisk&nbsp;verbosity&nbsp;level&nbsp;is&nbsp;$level&nbsp;or&nbsp;greater,&nbsp;send&nbsp;$message&nbsp;to&nbsp;the&nbsp;console.</span></div></li>
<li><div class="src-line"><a name="a769"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a770"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;Asterisk&nbsp;verbosity&nbsp;system&nbsp;works&nbsp;as&nbsp;follows.&nbsp;The&nbsp;Asterisk&nbsp;user&nbsp;gets&nbsp;to&nbsp;set&nbsp;the&nbsp;desired&nbsp;verbosity&nbsp;at&nbsp;startup&nbsp;time&nbsp;or&nbsp;later</span></div></li>
<li><div class="src-line"><a name="a771"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;using&nbsp;the&nbsp;console&nbsp;'set&nbsp;verbose'&nbsp;command.&nbsp;Messages&nbsp;are&nbsp;displayed&nbsp;on&nbsp;the&nbsp;console&nbsp;if&nbsp;their&nbsp;verbose&nbsp;level&nbsp;is&nbsp;less&nbsp;than&nbsp;or&nbsp;equal</span></div></li>
<li><div class="src-line"><a name="a772"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;to&nbsp;desired&nbsp;verbosity&nbsp;set&nbsp;by&nbsp;the&nbsp;user.&nbsp;More&nbsp;important&nbsp;messages&nbsp;should&nbsp;have&nbsp;a&nbsp;low&nbsp;verbose&nbsp;level;&nbsp;less&nbsp;important&nbsp;messages</span></div></li>
<li><div class="src-line"><a name="a773"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;should&nbsp;have&nbsp;a&nbsp;high&nbsp;verbose&nbsp;level.</span></div></li>
<li><div class="src-line"><a name="a774"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a775"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-verbose</span></div></li>
<li><div class="src-line"><a name="a776"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$message&nbsp;</span></div></li>
<li><div class="src-line"><a name="a777"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$level&nbsp;</span><span class="src-doc">from&nbsp;1&nbsp;to&nbsp;4</span></div></li>
<li><div class="src-line"><a name="a778"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a779"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a780"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodverbose">verbose</a><span class="src-sym">(</span><span class="src-var">$message</span><span class="src-sym">,&nbsp;</span><span class="src-var">$level</span>=<span class="src-num">1</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a781"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a782"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\r\n&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/print_r">print_r</a><span class="src-sym">(</span><span class="src-var">$message</span><span class="src-sym">,&nbsp;</span><span class="src-id">true</span><span class="src-sym">)))&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$msg</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a783"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a784"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">@</span><a href="http://www.php.net/syslog">syslog</a><span class="src-sym">(</span><span class="src-id">LOG_WARNING</span><span class="src-sym">,&nbsp;</span><span class="src-var">$msg</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a785"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">VERBOSE&nbsp;\&quot;<span class="src-var">$msg</span>\&quot;&nbsp;<span class="src-var">$level</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a786"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a787"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$ret</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a788"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a789"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a790"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a791"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Waits&nbsp;up&nbsp;to&nbsp;$timeout&nbsp;milliseconds&nbsp;for&nbsp;channel&nbsp;to&nbsp;receive&nbsp;a&nbsp;DTMF&nbsp;digit.</span></div></li>
<li><div class="src-line"><a name="a792"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a793"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-wait+for+digit</span></div></li>
<li><div class="src-line"><a name="a794"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$timeout&nbsp;</span><span class="src-doc">in&nbsp;millisecons.&nbsp;Use&nbsp;-1&nbsp;for&nbsp;the&nbsp;timeout&nbsp;value&nbsp;if&nbsp;you&nbsp;want&nbsp;the&nbsp;call&nbsp;to&nbsp;wait&nbsp;indefinitely.</span></div></li>
<li><div class="src-line"><a name="a795"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;0&nbsp;if&nbsp;wait&nbsp;completes&nbsp;with&nbsp;no</span></div></li>
<li><div class="src-line"><a name="a796"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;digit&nbsp;received,&nbsp;otherwise&nbsp;a&nbsp;decimal&nbsp;value&nbsp;of&nbsp;the&nbsp;DTMF&nbsp;tone.&nbsp;&nbsp;Use&nbsp;chr()&nbsp;to&nbsp;convert&nbsp;to&nbsp;ASCII.</span></div></li>
<li><div class="src-line"><a name="a797"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a798"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodwait_for_digit">wait_for_digit</a><span class="src-sym">(</span><span class="src-var">$timeout</span>=-<span class="src-num">1</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a799"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a800"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">WAIT&nbsp;FOR&nbsp;DIGIT&nbsp;<span class="src-var">$timeout</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a801"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a802"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a803"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a804"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;*********************************************************************************************************</span></div></li>
<li><div class="src-line"><a name="a805"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;APPLICATIONS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**</span></div></li>
<li><div class="src-line"><a name="a806"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;*********************************************************************************************************</span></div></li>
<li><div class="src-line"><a name="a807"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a808"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a809"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Set&nbsp;absolute&nbsp;maximum&nbsp;time&nbsp;of&nbsp;call.</span></div></li>
<li><div class="src-line"><a name="a810"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a811"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Note&nbsp;that&nbsp;the&nbsp;timeout&nbsp;is&nbsp;set&nbsp;from&nbsp;the&nbsp;current&nbsp;time&nbsp;forward,&nbsp;not&nbsp;counting&nbsp;the&nbsp;number&nbsp;of&nbsp;seconds&nbsp;the&nbsp;call&nbsp;has&nbsp;already&nbsp;been&nbsp;up.</span></div></li>
<li><div class="src-line"><a name="a812"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Each&nbsp;time&nbsp;you&nbsp;call&nbsp;AbsoluteTimeout(),&nbsp;all&nbsp;previous&nbsp;absolute&nbsp;timeouts&nbsp;are&nbsp;cancelled.</span></div></li>
<li><div class="src-line"><a name="a813"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Will&nbsp;return&nbsp;the&nbsp;call&nbsp;to&nbsp;the&nbsp;T&nbsp;extension&nbsp;so&nbsp;that&nbsp;you&nbsp;can&nbsp;playback&nbsp;an&nbsp;explanatory&nbsp;note&nbsp;to&nbsp;the&nbsp;calling&nbsp;party&nbsp;(the&nbsp;called&nbsp;party</span></div></li>
<li><div class="src-line"><a name="a814"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;will&nbsp;not&nbsp;hear&nbsp;that)</span></div></li>
<li><div class="src-line"><a name="a815"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a816"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-Asterisk+-+documentation+of+application+commands</span></div></li>
<li><div class="src-line"><a name="a817"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.dynx.net/ASTERISK/AGI/ccard/agi-ccard.agi</span></div></li>
<li><div class="src-line"><a name="a818"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">$seconds&nbsp;</span><span class="src-doc">allowed,&nbsp;0&nbsp;disables&nbsp;timeout</span></div></li>
<li><div class="src-line"><a name="a819"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a820"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a821"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodexec_absolutetimeout">exec_absolutetimeout</a><span class="src-sym">(</span><span class="src-var">$seconds</span>=<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a822"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a823"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodexec">exec</a><span class="src-sym">(</span><span class="src-str">'AbsoluteTimeout'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$seconds</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a824"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a825"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a826"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a827"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Executes&nbsp;an&nbsp;AGI&nbsp;compliant&nbsp;application.</span></div></li>
<li><div class="src-line"><a name="a828"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a829"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$command&nbsp;</span></div></li>
<li><div class="src-line"><a name="a830"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;-1&nbsp;on&nbsp;hangup&nbsp;or&nbsp;if&nbsp;application&nbsp;requested&nbsp;hangup,&nbsp;or&nbsp;0&nbsp;on&nbsp;non-hangup&nbsp;exit.</span></div></li>
<li><div class="src-line"><a name="a831"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$args&nbsp;</span></div></li>
<li><div class="src-line"><a name="a832"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a833"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodexec_agi">exec_agi</a><span class="src-sym">(</span><span class="src-var">$command</span><span class="src-sym">,&nbsp;</span><span class="src-var">$args</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a834"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a835"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodexec">exec</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">AGI&nbsp;<span class="src-var">$command</span></span><span class="src-str">&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-var">$args</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a836"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a837"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a838"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a839"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Set&nbsp;Language.</span></div></li>
<li><div class="src-line"><a name="a840"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a841"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$language&nbsp;</span><span class="src-doc">code</span></div></li>
<li><div class="src-line"><a name="a842"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a843"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a844"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodexec_setlanguage">exec_setlanguage</a><span class="src-sym">(</span><span class="src-var">$language</span>=<span class="src-str">'en'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a845"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a846"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodexec">exec</a><span class="src-sym">(</span><span class="src-str">'Set'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'CHANNEL(language)='</span>.&nbsp;<span class="src-var">$language</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a847"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a848"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a849"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a850"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Do&nbsp;ENUM&nbsp;Lookup.</span></div></li>
<li><div class="src-line"><a name="a851"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a852"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Note:&nbsp;to&nbsp;retrieve&nbsp;the&nbsp;result,&nbsp;use</span></div></li>
<li><div class="src-line"><a name="a853"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;get_variable('ENUM');</span></div></li>
<li><div class="src-line"><a name="a854"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a855"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">$exten&nbsp;</span></div></li>
<li><div class="src-line"><a name="a856"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a857"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a858"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodexec_enumlookup">exec_enumlookup</a><span class="src-sym">(</span><span class="src-var">$exten</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a859"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a860"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodexec">exec</a><span class="src-sym">(</span><span class="src-str">'EnumLookup'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$exten</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a861"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a862"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a863"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a864"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Dial.</span></div></li>
<li><div class="src-line"><a name="a865"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a866"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Dial&nbsp;takes&nbsp;input&nbsp;from&nbsp;${VXML_URL}&nbsp;to&nbsp;send&nbsp;XML&nbsp;Url&nbsp;to&nbsp;Cisco&nbsp;7960</span></div></li>
<li><div class="src-line"><a name="a867"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Dial&nbsp;takes&nbsp;input&nbsp;from&nbsp;${ALERT_INFO}&nbsp;to&nbsp;set&nbsp;ring&nbsp;cadence&nbsp;for&nbsp;Cisco&nbsp;phones</span></div></li>
<li><div class="src-line"><a name="a868"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Dial&nbsp;returns&nbsp;${CAUSECODE}:&nbsp;If&nbsp;the&nbsp;dial&nbsp;failed,&nbsp;this&nbsp;is&nbsp;the&nbsp;errormessage.</span></div></li>
<li><div class="src-line"><a name="a869"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Dial&nbsp;returns&nbsp;${DIALSTATUS}:&nbsp;Text&nbsp;code&nbsp;returning&nbsp;status&nbsp;of&nbsp;last&nbsp;dial&nbsp;attempt.</span></div></li>
<li><div class="src-line"><a name="a870"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a871"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-Asterisk+cmd+Dial</span></div></li>
<li><div class="src-line"><a name="a872"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$type&nbsp;</span></div></li>
<li><div class="src-line"><a name="a873"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$identifier&nbsp;</span></div></li>
<li><div class="src-line"><a name="a874"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$timeout&nbsp;</span></div></li>
<li><div class="src-line"><a name="a875"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$options&nbsp;</span></div></li>
<li><div class="src-line"><a name="a876"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$url&nbsp;</span></div></li>
<li><div class="src-line"><a name="a877"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a878"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a879"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodexec_dial">exec_dial</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">,&nbsp;</span><span class="src-var">$identifier</span><span class="src-sym">,&nbsp;</span><span class="src-var">$timeout</span>=<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$options</span>=<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$url</span>=<span class="src-id">NULL</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a880"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a881"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodexec">exec</a><span class="src-sym">(</span><span class="src-str">'Dial'</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$type</span>/<span class="src-var">$identifier</span></span><span class="src-str">&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$option_delim">option_delim</a>.<span class="src-var">$timeout</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$option_delim">option_delim</a>.<span class="src-var">$options</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$option_delim">option_delim</a>.<span class="src-var">$url</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$option_delim">option_delim</a><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a882"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a883"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a884"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a885"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Goto.</span></div></li>
<li><div class="src-line"><a name="a886"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a887"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;function&nbsp;takes&nbsp;three&nbsp;arguments:&nbsp;context,extension,&nbsp;and&nbsp;priority,&nbsp;but&nbsp;the&nbsp;leading&nbsp;arguments</span></div></li>
<li><div class="src-line"><a name="a888"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;are&nbsp;optional,&nbsp;not&nbsp;the&nbsp;trailing&nbsp;arguments.&nbsp;&nbsp;Thuse&nbsp;goto($z)&nbsp;sets&nbsp;the&nbsp;priority&nbsp;to&nbsp;$z.</span></div></li>
<li><div class="src-line"><a name="a889"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a890"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$a&nbsp;</span></div></li>
<li><div class="src-line"><a name="a891"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$b;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a892"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$c;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a893"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a894"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a895"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodexec_goto">exec_goto</a><span class="src-sym">(</span><span class="src-var">$a</span><span class="src-sym">,&nbsp;</span><span class="src-var">$b</span>=<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$c</span>=<span class="src-id">NULL</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a896"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a897"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodexec">exec</a><span class="src-sym">(</span><span class="src-str">'Goto'</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$a</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$option_delim">option_delim</a>.<span class="src-var">$b</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$option_delim">option_delim</a>.<span class="src-var">$c</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$option_delim">option_delim</a><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a898"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a899"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a900"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a901"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;*********************************************************************************************************</span></div></li>
<li><div class="src-line"><a name="a902"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FAST&nbsp;PASSING&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**</span></div></li>
<li><div class="src-line"><a name="a903"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;*********************************************************************************************************</span></div></li>
<li><div class="src-line"><a name="a904"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a905"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a906"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Say&nbsp;the&nbsp;given&nbsp;digit&nbsp;string,&nbsp;returning&nbsp;early&nbsp;if&nbsp;any&nbsp;of&nbsp;the&nbsp;given&nbsp;DTMF&nbsp;escape&nbsp;digits&nbsp;are&nbsp;received&nbsp;on&nbsp;the&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a907"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Return&nbsp;early&nbsp;if&nbsp;$buffer&nbsp;is&nbsp;adequate&nbsp;for&nbsp;request.</span></div></li>
<li><div class="src-line"><a name="a908"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a909"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-say+digits</span></div></li>
<li><div class="src-line"><a name="a910"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$buffer&nbsp;</span></div></li>
<li><div class="src-line"><a name="a911"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a912"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a913"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;-1&nbsp;on&nbsp;hangup&nbsp;or&nbsp;error,&nbsp;0&nbsp;if&nbsp;playback&nbsp;completes&nbsp;with&nbsp;no</span></div></li>
<li><div class="src-line"><a name="a914"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;digit&nbsp;received,&nbsp;otherwise&nbsp;a&nbsp;decimal&nbsp;value&nbsp;of&nbsp;the&nbsp;DTMF&nbsp;tone.&nbsp;&nbsp;Use&nbsp;chr()&nbsp;to&nbsp;convert&nbsp;to&nbsp;ASCII.</span></div></li>
<li><div class="src-line"><a name="a915"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a916"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodfastpass_say_digits">fastpass_say_digits</a><span class="src-sym">(</span><span class="src-sym">&amp;</span><span class="src-var">$buffer</span><span class="src-sym">,&nbsp;</span><span class="src-var">$digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a917"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a918"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a919"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$escape_digits&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$buffer&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a920"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a921"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-num">255</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-var">$escape_digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a922"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a923"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a924"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$buffer&nbsp;</span>==&nbsp;<span class="src-str">''&nbsp;</span>||&nbsp;<span class="src-var">$proceed</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a925"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a926"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodsay_digits">say_digits</a><span class="src-sym">(</span><span class="src-var">$digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a927"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a>&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>&gt;&nbsp;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a928"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$buffer&nbsp;</span>.=&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a929"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$res</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a930"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a931"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'code'</span>=&gt;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a></span><span class="src-sym">,&nbsp;</span><span class="src-str">'result'</span>=&gt;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a932"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a933"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a934"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a935"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Say&nbsp;the&nbsp;given&nbsp;number,&nbsp;returning&nbsp;early&nbsp;if&nbsp;any&nbsp;of&nbsp;the&nbsp;given&nbsp;DTMF&nbsp;escape&nbsp;digits&nbsp;are&nbsp;received&nbsp;on&nbsp;the&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a936"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Return&nbsp;early&nbsp;if&nbsp;$buffer&nbsp;is&nbsp;adequate&nbsp;for&nbsp;request.</span></div></li>
<li><div class="src-line"><a name="a937"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a938"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-say+number</span></div></li>
<li><div class="src-line"><a name="a939"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$buffer&nbsp;</span></div></li>
<li><div class="src-line"><a name="a940"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$number&nbsp;</span></div></li>
<li><div class="src-line"><a name="a941"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a942"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;-1&nbsp;on&nbsp;hangup&nbsp;or&nbsp;error,&nbsp;0&nbsp;if&nbsp;playback&nbsp;completes&nbsp;with&nbsp;no</span></div></li>
<li><div class="src-line"><a name="a943"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;digit&nbsp;received,&nbsp;otherwise&nbsp;a&nbsp;decimal&nbsp;value&nbsp;of&nbsp;the&nbsp;DTMF&nbsp;tone.&nbsp;&nbsp;Use&nbsp;chr()&nbsp;to&nbsp;convert&nbsp;to&nbsp;ASCII.</span></div></li>
<li><div class="src-line"><a name="a944"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a945"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodfastpass_say_number">fastpass_say_number</a><span class="src-sym">(</span><span class="src-sym">&amp;</span><span class="src-var">$buffer</span><span class="src-sym">,&nbsp;</span><span class="src-var">$number</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a946"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a947"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a948"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$escape_digits&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$buffer&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a949"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a950"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-num">255</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-var">$escape_digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a951"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a952"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a953"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$buffer&nbsp;</span>==&nbsp;<span class="src-str">''&nbsp;</span>||&nbsp;<span class="src-var">$proceed</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a954"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a955"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodsay_number">say_number</a><span class="src-sym">(</span><span class="src-var">$number</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a956"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a>&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>&gt;&nbsp;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a957"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$buffer&nbsp;</span>.=&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a958"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$res</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a959"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a960"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'code'</span>=&gt;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a></span><span class="src-sym">,&nbsp;</span><span class="src-str">'result'</span>=&gt;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a961"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a962"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a963"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a964"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Say&nbsp;the&nbsp;given&nbsp;character&nbsp;string,&nbsp;returning&nbsp;early&nbsp;if&nbsp;any&nbsp;of&nbsp;the&nbsp;given&nbsp;DTMF&nbsp;escape&nbsp;digits&nbsp;are&nbsp;received&nbsp;on&nbsp;the&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a965"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Return&nbsp;early&nbsp;if&nbsp;$buffer&nbsp;is&nbsp;adequate&nbsp;for&nbsp;request.</span></div></li>
<li><div class="src-line"><a name="a966"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a967"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-say+phonetic</span></div></li>
<li><div class="src-line"><a name="a968"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$buffer&nbsp;</span></div></li>
<li><div class="src-line"><a name="a969"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$text&nbsp;</span></div></li>
<li><div class="src-line"><a name="a970"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a971"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;-1&nbsp;on&nbsp;hangup&nbsp;or&nbsp;error,&nbsp;0&nbsp;if&nbsp;playback&nbsp;completes&nbsp;with&nbsp;no</span></div></li>
<li><div class="src-line"><a name="a972"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;digit&nbsp;received,&nbsp;otherwise&nbsp;a&nbsp;decimal&nbsp;value&nbsp;of&nbsp;the&nbsp;DTMF&nbsp;tone.&nbsp;&nbsp;Use&nbsp;chr()&nbsp;to&nbsp;convert&nbsp;to&nbsp;ASCII.</span></div></li>
<li><div class="src-line"><a name="a973"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a974"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodfastpass_say_phonetic">fastpass_say_phonetic</a><span class="src-sym">(</span><span class="src-sym">&amp;</span><span class="src-var">$buffer</span><span class="src-sym">,&nbsp;</span><span class="src-var">$text</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a975"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a976"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a977"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$escape_digits&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$buffer&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a978"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a979"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-num">255</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-var">$escape_digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a980"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a981"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a982"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$buffer&nbsp;</span>==&nbsp;<span class="src-str">''&nbsp;</span>||&nbsp;<span class="src-var">$proceed</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a983"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a984"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodsay_phonetic">say_phonetic</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a985"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a>&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>&gt;&nbsp;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a986"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$buffer&nbsp;</span>.=&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a987"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$res</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a988"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a989"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'code'</span>=&gt;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a></span><span class="src-sym">,&nbsp;</span><span class="src-str">'result'</span>=&gt;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a990"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a991"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a992"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a993"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Say&nbsp;a&nbsp;given&nbsp;time,&nbsp;returning&nbsp;early&nbsp;if&nbsp;any&nbsp;of&nbsp;the&nbsp;given&nbsp;DTMF&nbsp;escape&nbsp;digits&nbsp;are&nbsp;received&nbsp;on&nbsp;the&nbsp;channel.</span></div></li>
<li><div class="src-line"><a name="a994"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Return&nbsp;early&nbsp;if&nbsp;$buffer&nbsp;is&nbsp;adequate&nbsp;for&nbsp;request.</span></div></li>
<li><div class="src-line"><a name="a995"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a996"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-say+time</span></div></li>
<li><div class="src-line"><a name="a997"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$buffer&nbsp;</span></div></li>
<li><div class="src-line"><a name="a998"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$time&nbsp;</span><span class="src-doc">number&nbsp;of&nbsp;seconds&nbsp;elapsed&nbsp;since&nbsp;00:00:00&nbsp;on&nbsp;January&nbsp;1,&nbsp;1970,&nbsp;Coordinated&nbsp;Universal&nbsp;Time&nbsp;(UTC).</span></div></li>
<li><div class="src-line"><a name="a999"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1000"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;-1&nbsp;on&nbsp;hangup&nbsp;or&nbsp;error,&nbsp;0&nbsp;if&nbsp;playback&nbsp;completes&nbsp;with&nbsp;no</span></div></li>
<li><div class="src-line"><a name="a1001"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;digit&nbsp;received,&nbsp;otherwise&nbsp;a&nbsp;decimal&nbsp;value&nbsp;of&nbsp;the&nbsp;DTMF&nbsp;tone.&nbsp;&nbsp;Use&nbsp;chr()&nbsp;to&nbsp;convert&nbsp;to&nbsp;ASCII.</span></div></li>
<li><div class="src-line"><a name="a1002"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1003"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodfastpass_say_time">fastpass_say_time</a><span class="src-sym">(</span><span class="src-sym">&amp;</span><span class="src-var">$buffer</span><span class="src-sym">,&nbsp;</span><span class="src-var">$time</span>=<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1004"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1005"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1006"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$escape_digits&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$buffer&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1007"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1008"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-num">255</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-var">$escape_digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1009"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1010"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1011"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$buffer&nbsp;</span>==&nbsp;<span class="src-str">''&nbsp;</span>||&nbsp;<span class="src-var">$proceed</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1012"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1013"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodsay_time">say_time</a><span class="src-sym">(</span><span class="src-var">$time</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1014"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a>&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>&gt;&nbsp;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1015"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$buffer&nbsp;</span>.=&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1016"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$res</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1017"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1018"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'code'</span>=&gt;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a></span><span class="src-sym">,&nbsp;</span><span class="src-str">'result'</span>=&gt;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1019"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1020"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1021"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1022"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Play&nbsp;the&nbsp;given&nbsp;audio&nbsp;file,&nbsp;allowing&nbsp;playback&nbsp;to&nbsp;be&nbsp;interrupted&nbsp;by&nbsp;a&nbsp;DTMF&nbsp;digit.&nbsp;This&nbsp;command&nbsp;is&nbsp;similar&nbsp;to&nbsp;the&nbsp;GET&nbsp;DATA</span></div></li>
<li><div class="src-line"><a name="a1023"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;command&nbsp;but&nbsp;this&nbsp;command&nbsp;returns&nbsp;after&nbsp;the&nbsp;first&nbsp;DTMF&nbsp;digit&nbsp;has&nbsp;been&nbsp;pressed&nbsp;while&nbsp;GET&nbsp;DATA&nbsp;can&nbsp;accumulated&nbsp;any&nbsp;number&nbsp;of</span></div></li>
<li><div class="src-line"><a name="a1024"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;digits&nbsp;before&nbsp;returning.</span></div></li>
<li><div class="src-line"><a name="a1025"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Return&nbsp;early&nbsp;if&nbsp;$buffer&nbsp;is&nbsp;adequate&nbsp;for&nbsp;request.</span></div></li>
<li><div class="src-line"><a name="a1026"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1027"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-stream+file</span></div></li>
<li><div class="src-line"><a name="a1028"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$buffer&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1029"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$filename&nbsp;</span><span class="src-doc">without&nbsp;extension,&nbsp;often&nbsp;in&nbsp;/var/lib/asterisk/sounds</span></div></li>
<li><div class="src-line"><a name="a1030"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1031"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$offset&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1032"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;is&nbsp;-1&nbsp;on&nbsp;hangup&nbsp;or&nbsp;error,&nbsp;0&nbsp;if&nbsp;playback&nbsp;completes&nbsp;with&nbsp;no</span></div></li>
<li><div class="src-line"><a name="a1033"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;digit&nbsp;received,&nbsp;otherwise&nbsp;a&nbsp;decimal&nbsp;value&nbsp;of&nbsp;the&nbsp;DTMF&nbsp;tone.&nbsp;&nbsp;Use&nbsp;chr()&nbsp;to&nbsp;convert&nbsp;to&nbsp;ASCII.</span></div></li>
<li><div class="src-line"><a name="a1034"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1035"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodfastpass_stream_file">fastpass_stream_file</a><span class="src-sym">(</span><span class="src-sym">&amp;</span><span class="src-var">$buffer</span><span class="src-sym">,&nbsp;</span><span class="src-var">$filename</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span>=<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1036"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1037"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1038"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$escape_digits&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$buffer&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1039"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1040"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-num">255</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-var">$escape_digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1041"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1042"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1043"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$buffer&nbsp;</span>==&nbsp;<span class="src-str">''&nbsp;</span>||&nbsp;<span class="src-var">$proceed</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1044"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1045"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodstream_file">stream_file</a><span class="src-sym">(</span><span class="src-var">$filename</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1046"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a>&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>&gt;&nbsp;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1047"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$buffer&nbsp;</span>.=&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1048"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$res</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1049"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1050"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'code'</span>=&gt;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a></span><span class="src-sym">,&nbsp;</span><span class="src-str">'result'</span>=&gt;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-str">'endpos'</span>=&gt;<span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1051"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1052"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1053"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1054"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Use&nbsp;festival&nbsp;to&nbsp;read&nbsp;text.</span></div></li>
<li><div class="src-line"><a name="a1055"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Return&nbsp;early&nbsp;if&nbsp;$buffer&nbsp;is&nbsp;adequate&nbsp;for&nbsp;request.</span></div></li>
<li><div class="src-line"><a name="a1056"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1057"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.cstr.ed.ac.uk/projects/festival/</span></div></li>
<li><div class="src-line"><a name="a1058"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$buffer&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1059"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$text&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1060"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1061"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$frequency&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1062"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a1063"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1064"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodfastpass_text2wav">fastpass_text2wav</a><span class="src-sym">(</span><span class="src-sym">&amp;</span><span class="src-var">$buffer</span><span class="src-sym">,&nbsp;</span><span class="src-var">$text</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-var">$frequency</span>=<span class="src-num">8000</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1065"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1066"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1067"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$escape_digits&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$buffer&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1068"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1069"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-num">255</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-var">$escape_digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1070"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1071"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1072"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$buffer&nbsp;</span>==&nbsp;<span class="src-str">''&nbsp;</span>||&nbsp;<span class="src-var">$proceed</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1073"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1074"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodtext2wav">text2wav</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$frequency</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1075"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a>&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>&gt;&nbsp;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1076"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$buffer&nbsp;</span>.=&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1077"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$res</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1078"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1079"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'code'</span>=&gt;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a></span><span class="src-sym">,&nbsp;</span><span class="src-str">'result'</span>=&gt;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-str">'endpos'</span>=&gt;<span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1080"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1081"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1082"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1083"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Use&nbsp;Cepstral&nbsp;Swift&nbsp;to&nbsp;read&nbsp;text.</span></div></li>
<li><div class="src-line"><a name="a1084"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Return&nbsp;early&nbsp;if&nbsp;$buffer&nbsp;is&nbsp;adequate&nbsp;for&nbsp;request.</span></div></li>
<li><div class="src-line"><a name="a1085"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1086"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.cepstral.com/</span></div></li>
<li><div class="src-line"><a name="a1087"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$buffer&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1088"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$text&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1089"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1090"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$frequency&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1091"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a1092"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1093"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodfastpass_swift">fastpass_swift</a><span class="src-sym">(</span><span class="src-sym">&amp;</span><span class="src-var">$buffer</span><span class="src-sym">,&nbsp;</span><span class="src-var">$text</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-var">$frequency</span>=<span class="src-num">8000</span><span class="src-sym">,&nbsp;</span><span class="src-var">$voice</span>=<span class="src-id">NULL</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1094"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1095"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1096"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$escape_digits&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$buffer&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1097"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1098"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-num">255</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-var">$escape_digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1099"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1100"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1101"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$buffer&nbsp;</span>==&nbsp;<span class="src-str">''&nbsp;</span>||&nbsp;<span class="src-var">$proceed</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1102"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1103"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodswift">swift</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$frequency</span><span class="src-sym">,&nbsp;</span><span class="src-var">$voice</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1104"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a>&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>&gt;&nbsp;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1105"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$buffer&nbsp;</span>.=&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1106"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$res</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1107"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1108"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'code'</span>=&gt;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a></span><span class="src-sym">,&nbsp;</span><span class="src-str">'result'</span>=&gt;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-str">'endpos'</span>=&gt;<span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1109"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1110"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1111"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1112"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Say&nbsp;Puncutation&nbsp;in&nbsp;a&nbsp;string.</span></div></li>
<li><div class="src-line"><a name="a1113"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Return&nbsp;early&nbsp;if&nbsp;$buffer&nbsp;is&nbsp;adequate&nbsp;for&nbsp;request.</span></div></li>
<li><div class="src-line"><a name="a1114"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1115"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$buffer&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1116"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$text&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1117"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1118"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$frequency&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1119"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a1120"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1121"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodfastpass_say_punctuation">fastpass_say_punctuation</a><span class="src-sym">(</span><span class="src-sym">&amp;</span><span class="src-var">$buffer</span><span class="src-sym">,&nbsp;</span><span class="src-var">$text</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-var">$frequency</span>=<span class="src-num">8000</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1122"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1123"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1124"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$escape_digits&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$buffer&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1125"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1126"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-num">255</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-var">$escape_digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1127"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$proceed&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1128"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1129"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$buffer&nbsp;</span>==&nbsp;<span class="src-str">''&nbsp;</span>||&nbsp;<span class="src-var">$proceed</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1130"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1131"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodsay_punctuation">say_punctuation</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$frequency</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1132"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a>&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>&gt;&nbsp;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1133"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$buffer&nbsp;</span>.=&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1134"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$res</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1135"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1136"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'code'</span>=&gt;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a></span><span class="src-sym">,&nbsp;</span><span class="src-str">'result'</span>=&gt;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1137"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1138"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1139"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1140"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Plays&nbsp;the&nbsp;given&nbsp;file&nbsp;and&nbsp;receives&nbsp;DTMF&nbsp;data.</span></div></li>
<li><div class="src-line"><a name="a1141"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Return&nbsp;early&nbsp;if&nbsp;$buffer&nbsp;is&nbsp;adequate&nbsp;for&nbsp;request.</span></div></li>
<li><div class="src-line"><a name="a1142"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1143"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;is&nbsp;similar&nbsp;to&nbsp;STREAM&nbsp;FILE,&nbsp;but&nbsp;this&nbsp;command&nbsp;can&nbsp;accept&nbsp;and&nbsp;return&nbsp;many&nbsp;DTMF&nbsp;digits,</span></div></li>
<li><div class="src-line"><a name="a1144"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;while&nbsp;STREAM&nbsp;FILE&nbsp;returns&nbsp;immediately&nbsp;after&nbsp;the&nbsp;first&nbsp;DTMF&nbsp;digit&nbsp;is&nbsp;detected.</span></div></li>
<li><div class="src-line"><a name="a1145"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1146"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Asterisk&nbsp;looks&nbsp;for&nbsp;the&nbsp;file&nbsp;to&nbsp;play&nbsp;in&nbsp;/var/lib/asterisk/sounds&nbsp;by&nbsp;default.</span></div></li>
<li><div class="src-line"><a name="a1147"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1148"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;the&nbsp;user&nbsp;doesn't&nbsp;press&nbsp;any&nbsp;keys&nbsp;when&nbsp;the&nbsp;message&nbsp;plays,&nbsp;there&nbsp;is&nbsp;$timeout&nbsp;milliseconds</span></div></li>
<li><div class="src-line"><a name="a1149"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;of&nbsp;silence&nbsp;then&nbsp;the&nbsp;command&nbsp;ends.</span></div></li>
<li><div class="src-line"><a name="a1150"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1151"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;user&nbsp;has&nbsp;the&nbsp;opportunity&nbsp;to&nbsp;press&nbsp;a&nbsp;key&nbsp;at&nbsp;any&nbsp;time&nbsp;during&nbsp;the&nbsp;message&nbsp;or&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a1152"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;post-message&nbsp;silence.&nbsp;If&nbsp;the&nbsp;user&nbsp;presses&nbsp;a&nbsp;key&nbsp;while&nbsp;the&nbsp;message&nbsp;is&nbsp;playing,&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a1153"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;message&nbsp;stops&nbsp;playing.&nbsp;When&nbsp;the&nbsp;first&nbsp;key&nbsp;is&nbsp;pressed&nbsp;a&nbsp;timer&nbsp;starts&nbsp;counting&nbsp;for</span></div></li>
<li><div class="src-line"><a name="a1154"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;$timeout&nbsp;milliseconds.&nbsp;Every&nbsp;time&nbsp;the&nbsp;user&nbsp;presses&nbsp;another&nbsp;key&nbsp;the&nbsp;timer&nbsp;is&nbsp;restarted.</span></div></li>
<li><div class="src-line"><a name="a1155"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;command&nbsp;ends&nbsp;when&nbsp;the&nbsp;counter&nbsp;goes&nbsp;to&nbsp;zero&nbsp;or&nbsp;the&nbsp;maximum&nbsp;number&nbsp;of&nbsp;digits&nbsp;is&nbsp;entered,</span></div></li>
<li><div class="src-line"><a name="a1156"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;whichever&nbsp;happens&nbsp;first.</span></div></li>
<li><div class="src-line"><a name="a1157"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1158"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;you&nbsp;don't&nbsp;specify&nbsp;a&nbsp;time&nbsp;out&nbsp;then&nbsp;a&nbsp;default&nbsp;timeout&nbsp;of&nbsp;2000&nbsp;is&nbsp;used&nbsp;following&nbsp;a&nbsp;pressed</span></div></li>
<li><div class="src-line"><a name="a1159"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;digit.&nbsp;If&nbsp;no&nbsp;digits&nbsp;are&nbsp;pressed&nbsp;then&nbsp;6&nbsp;seconds&nbsp;of&nbsp;silence&nbsp;follow&nbsp;the&nbsp;message.</span></div></li>
<li><div class="src-line"><a name="a1160"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1161"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;you&nbsp;don't&nbsp;specify&nbsp;$max_digits&nbsp;then&nbsp;the&nbsp;user&nbsp;can&nbsp;enter&nbsp;as&nbsp;many&nbsp;digits&nbsp;as&nbsp;they&nbsp;want.</span></div></li>
<li><div class="src-line"><a name="a1162"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1163"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Pressing&nbsp;the&nbsp;#&nbsp;key&nbsp;has&nbsp;the&nbsp;same&nbsp;effect&nbsp;as&nbsp;the&nbsp;timer&nbsp;running&nbsp;out:&nbsp;the&nbsp;command&nbsp;ends&nbsp;and</span></div></li>
<li><div class="src-line"><a name="a1164"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;any&nbsp;previously&nbsp;keyed&nbsp;digits&nbsp;are&nbsp;returned.&nbsp;A&nbsp;side&nbsp;effect&nbsp;of&nbsp;this&nbsp;is&nbsp;that&nbsp;there&nbsp;is&nbsp;no</span></div></li>
<li><div class="src-line"><a name="a1165"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;way&nbsp;to&nbsp;read&nbsp;a&nbsp;#&nbsp;key&nbsp;using&nbsp;this&nbsp;command.</span></div></li>
<li><div class="src-line"><a name="a1166"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1167"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-get+data</span></div></li>
<li><div class="src-line"><a name="a1168"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$buffer&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1169"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$filename&nbsp;</span><span class="src-doc">file&nbsp;to&nbsp;play.&nbsp;Do&nbsp;not&nbsp;include&nbsp;file&nbsp;extension.</span></div></li>
<li><div class="src-line"><a name="a1170"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$timeout&nbsp;</span><span class="src-doc">milliseconds</span></div></li>
<li><div class="src-line"><a name="a1171"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$max_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1172"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.&nbsp;['result']&nbsp;holds&nbsp;the&nbsp;digits&nbsp;and&nbsp;['data']&nbsp;holds&nbsp;the&nbsp;timeout&nbsp;if&nbsp;present.</span></div></li>
<li><div class="src-line"><a name="a1173"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1174"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;This&nbsp;differs&nbsp;from&nbsp;other&nbsp;commands&nbsp;with&nbsp;return&nbsp;DTMF&nbsp;as&nbsp;numbers&nbsp;representing&nbsp;ASCII&nbsp;characters.</span></div></li>
<li><div class="src-line"><a name="a1175"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1176"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodfastpass_get_data">fastpass_get_data</a><span class="src-sym">(</span><span class="src-sym">&amp;</span><span class="src-var">$buffer</span><span class="src-sym">,&nbsp;</span><span class="src-var">$filename</span><span class="src-sym">,&nbsp;</span><span class="src-var">$timeout</span>=<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$max_digits</span>=<span class="src-id">NULL</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1177"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1178"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$max_digits</span><span class="src-sym">)&nbsp;</span>||&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)&nbsp;</span>&lt;&nbsp;<span class="src-var">$max_digits</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1179"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1180"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$buffer&nbsp;</span>==&nbsp;<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1181"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1182"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodget_data">get_data</a><span class="src-sym">(</span><span class="src-var">$filename</span><span class="src-sym">,&nbsp;</span><span class="src-var">$timeout</span><span class="src-sym">,&nbsp;</span><span class="src-var">$max_digits</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1183"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a></span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1184"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$buffer&nbsp;</span>.=&nbsp;<span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1185"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$res</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1186"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1187"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a1188"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1189"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$max_digits</span><span class="src-sym">)&nbsp;</span>||&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$buffer</span><span class="src-sym">)&nbsp;</span>&lt;&nbsp;<span class="src-var">$max_digits</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1190"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1191"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodwait_for_digit">wait_for_digit</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1192"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>!=&nbsp;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a></span><span class="src-sym">)&nbsp;</span><span class="src-key">return&nbsp;</span><span class="src-var">$res</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1193"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>==&nbsp;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-str">'#'</span><span class="src-sym">))&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1194"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$buffer&nbsp;</span>.=&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1195"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1196"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1197"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1198"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'code'</span>=&gt;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a></span><span class="src-sym">,&nbsp;</span><span class="src-str">'result'</span>=&gt;<span class="src-var">$buffer</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1199"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1200"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1201"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;*********************************************************************************************************</span></div></li>
<li><div class="src-line"><a name="a1202"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DERIVED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**</span></div></li>
<li><div class="src-line"><a name="a1203"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;*********************************************************************************************************</span></div></li>
<li><div class="src-line"><a name="a1204"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1205"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1206"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Menu.</span></div></li>
<li><div class="src-line"><a name="a1207"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1208"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;function&nbsp;presents&nbsp;the&nbsp;user&nbsp;with&nbsp;a&nbsp;menu&nbsp;and&nbsp;reads&nbsp;the&nbsp;response</span></div></li>
<li><div class="src-line"><a name="a1209"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1210"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc-var">$choices&nbsp;</span><span class="src-doc">has&nbsp;the&nbsp;following&nbsp;structure:</span></div></li>
<li><div class="src-line"><a name="a1211"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;array('1'=&gt;'*Press&nbsp;1&nbsp;for&nbsp;this',&nbsp;//&nbsp;festival&nbsp;reads&nbsp;if&nbsp;prompt&nbsp;starts&nbsp;with&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1212"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'2'=&gt;'some-gsm-without-extension',</span></div></li>
<li><div class="src-line"><a name="a1213"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'*'=&gt;'*Press&nbsp;star&nbsp;for&nbsp;help');</span></div></li>
<li><div class="src-line"><a name="a1214"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">mixed&nbsp;</span><span class="src-doc">key&nbsp;pressed&nbsp;on&nbsp;sucess,&nbsp;-1&nbsp;on&nbsp;failure</span></div></li>
<li><div class="src-line"><a name="a1215"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1216"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodmenu">menu</a><span class="src-sym">(</span><span class="src-var">$choices</span><span class="src-sym">,&nbsp;</span><span class="src-var">$timeout</span>=<span class="src-num">2000</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1217"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1218"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$keys&nbsp;</span>=&nbsp;<a href="http://www.php.net/join">join</a><span class="src-sym">(</span><span class="src-str">''</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/array_keys">array_keys</a><span class="src-sym">(</span><span class="src-var">$choices</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1219"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$choice&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1220"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$choice</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1221"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1222"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$choices&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$prompt</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1223"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1224"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$prompt</span><span class="src-sym">{</span><span class="src-num">0</span><span class="src-sym">}&nbsp;</span>==&nbsp;<span class="src-str">'*'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1225"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodtext2wav">text2wav</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$prompt</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$keys</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1226"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a1227"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodstream_file">stream_file</a><span class="src-sym">(</span><span class="src-var">$prompt</span><span class="src-sym">,&nbsp;</span><span class="src-var">$keys</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1228"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1229"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>!=&nbsp;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a>&nbsp;</span>||&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>==&nbsp;-<span class="src-num">1</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1230"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1231"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$choice&nbsp;</span>=&nbsp;-<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1232"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1233"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1234"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1235"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>!=&nbsp;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1236"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1237"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$choice&nbsp;</span>=&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1238"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1239"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1240"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1241"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1242"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$choice</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1243"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1244"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodget_data">get_data</a><span class="src-sym">(</span><span class="src-str">'beep'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$timeout</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1245"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>!=&nbsp;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a>&nbsp;</span>||&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>==&nbsp;-<span class="src-num">1</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1246"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$choice&nbsp;</span>=&nbsp;-<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1247"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-str">'&nbsp;'</span>.<span class="src-var">$keys</span><span class="src-sym">,&nbsp;</span><span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1248"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$choice&nbsp;</span>=&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1249"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1250"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1251"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$choice</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1252"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1253"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1254"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1255"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;setContext&nbsp;-&nbsp;Set&nbsp;context,&nbsp;extension&nbsp;and&nbsp;priority.</span></div></li>
<li><div class="src-line"><a name="a1256"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1257"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$context&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1258"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$extension&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1259"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$priority&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1260"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1261"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodsetContext">setContext</a><span class="src-sym">(</span><span class="src-var">$context</span><span class="src-sym">,&nbsp;</span><span class="src-var">$extension</span>=<span class="src-str">'s'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$priority</span>=<span class="src-num">1</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1262"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1263"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodset_context">set_context</a><span class="src-sym">(</span><span class="src-var">$context</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1264"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodset_extension">set_extension</a><span class="src-sym">(</span><span class="src-var">$extension</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1265"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodset_priority">set_priority</a><span class="src-sym">(</span><span class="src-var">$priority</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1266"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1267"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1268"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1269"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Parse&nbsp;caller&nbsp;id.</span></div></li>
<li><div class="src-line"><a name="a1270"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1271"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/dtmf.php&nbsp;Get&nbsp;DTMF&nbsp;tones&nbsp;from&nbsp;the&nbsp;user&nbsp;and&nbsp;say&nbsp;the&nbsp;digits</span></div></li>
<li><div class="src-line"><a name="a1272"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/input.php&nbsp;Get&nbsp;text&nbsp;input&nbsp;from&nbsp;the&nbsp;user&nbsp;and&nbsp;say&nbsp;it&nbsp;back</span></div></li>
<li><div class="src-line"><a name="a1273"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1274"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&quot;name&quot;&nbsp;&lt;proto:hide@address.com:port&gt;</span></div></li>
<li><div class="src-line"><a name="a1275"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1276"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$callerid&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1277"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array('Name'=&gt;$name,&nbsp;</span><span class="src-doc">'Number'=&gt;$number)</span></div></li>
<li><div class="src-line"><a name="a1278"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1279"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodparse_callerid">parse_callerid</a><span class="src-sym">(</span><span class="src-var">$callerid</span>=<span class="src-id">NULL</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1280"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1281"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$callerid</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1282"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$callerid&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$request">request</a><span class="src-sym">[</span><span class="src-str">'agi_callerid'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1283"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1284"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'name'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-str">'protocol'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-str">'username'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-str">'host'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-str">'port'</span>=&gt;<span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1285"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$callerid&nbsp;</span>=&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$callerid</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1286"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1287"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$callerid</span><span class="src-sym">{</span><span class="src-num">0</span><span class="src-sym">}&nbsp;</span>==&nbsp;<span class="src-str">'&quot;'&nbsp;</span>||&nbsp;<span class="src-var">$callerid</span><span class="src-sym">{</span><span class="src-num">0</span><span class="src-sym">}&nbsp;</span>==&nbsp;<span class="src-str">&quot;'&quot;</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1288"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1289"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$d&nbsp;</span>=&nbsp;<span class="src-var">$callerid</span><span class="src-sym">{</span><span class="src-num">0</span><span class="src-sym">}</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1290"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$callerid&nbsp;</span>=&nbsp;<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-var">$d</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$callerid</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1291"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<a href="http://www.php.net/array_shift">array_shift</a><span class="src-sym">(</span><span class="src-var">$callerid</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1292"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$callerid&nbsp;</span>=&nbsp;<a href="http://www.php.net/join">join</a><span class="src-sym">(</span><span class="src-var">$d</span><span class="src-sym">,&nbsp;</span><span class="src-var">$callerid</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1293"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1294"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1295"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$callerid&nbsp;</span>=&nbsp;<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'@'</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$callerid</span><span class="src-sym">,&nbsp;</span><span class="src-str">'&lt;&gt;&nbsp;'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1296"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$username&nbsp;&nbsp;</span>=&nbsp;<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">':'</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/array_shift">array_shift</a><span class="src-sym">(</span><span class="src-var">$callerid</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1297"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$username</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-num">1</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1298"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'username'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$username</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1299"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a1300"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1301"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'protocol'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<a href="http://www.php.net/array_shift">array_shift</a><span class="src-sym">(</span><span class="src-var">$username</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1302"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'username'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<a href="http://www.php.net/join">join</a><span class="src-sym">(</span><span class="src-str">':'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$username</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1303"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1304"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1305"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$callerid&nbsp;</span>=&nbsp;<a href="http://www.php.net/join">join</a><span class="src-sym">(</span><span class="src-str">'@'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$callerid</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1306"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$host&nbsp;</span>=&nbsp;<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">':'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$callerid</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1307"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$host</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-num">1</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1308"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'host'</span><span class="src-sym">]&nbsp;</span>=&nbsp;&nbsp;<span class="src-var">$host</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1309"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a1310"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1311"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'host'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<a href="http://www.php.net/array_shift">array_shift</a><span class="src-sym">(</span><span class="src-var">$host</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1312"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'port'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<a href="http://www.php.net/join">join</a><span class="src-sym">(</span><span class="src-str">':'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$host</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1313"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1314"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1315"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$ret</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1316"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1317"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1318"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1319"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Use&nbsp;festival&nbsp;to&nbsp;read&nbsp;text.</span></div></li>
<li><div class="src-line"><a name="a1320"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1321"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/dtmf.php&nbsp;Get&nbsp;DTMF&nbsp;tones&nbsp;from&nbsp;the&nbsp;user&nbsp;and&nbsp;say&nbsp;the&nbsp;digits</span></div></li>
<li><div class="src-line"><a name="a1322"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/input.php&nbsp;Get&nbsp;text&nbsp;input&nbsp;from&nbsp;the&nbsp;user&nbsp;and&nbsp;say&nbsp;it&nbsp;back</span></div></li>
<li><div class="src-line"><a name="a1323"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/ping.php&nbsp;Ping&nbsp;an&nbsp;IP&nbsp;address</span></div></li>
<li><div class="src-line"><a name="a1324"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1325"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.cstr.ed.ac.uk/projects/festival/</span></div></li>
<li><div class="src-line"><a name="a1326"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$text&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1327"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1328"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$frequency&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1329"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a1330"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1331"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodtext2wav">text2wav</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-var">$frequency</span>=<span class="src-num">8000</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1332"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1333"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$text&nbsp;</span>=&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1334"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$text&nbsp;</span>==&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span><span class="src-key">return&nbsp;</span><span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1335"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1336"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$hash&nbsp;</span>=&nbsp;<a href="http://www.php.net/md5">md5</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1337"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$fname&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'tempdir'</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-id">DIRECTORY_SEPARATOR</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1338"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$fname&nbsp;</span>.=&nbsp;<span class="src-str">'text2wav_'&nbsp;</span>.&nbsp;<span class="src-var">$hash</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1339"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1340"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;create&nbsp;wave&nbsp;file</span></div></li>
<li><div class="src-line"><a name="a1341"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$fname</span>.wav</span><span class="src-str">&quot;</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1342"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1343"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;write&nbsp;text&nbsp;file</span></div></li>
<li><div class="src-line"><a name="a1344"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$fname</span>.txt</span><span class="src-str">&quot;</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1345"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1346"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$fp&nbsp;</span>=&nbsp;<a href="http://www.php.net/fopen">fopen</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$fname</span>.txt</span><span class="src-str">&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-str">'w'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1347"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/fputs">fputs</a><span class="src-sym">(</span><span class="src-var">$fp</span><span class="src-sym">,&nbsp;</span><span class="src-var">$text</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1348"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/fclose">fclose</a><span class="src-sym">(</span><span class="src-var">$fp</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1349"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1350"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1351"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/shell_exec">shell_exec</a><span class="src-sym">(</span><span class="src-str">&quot;</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'festival'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'text2wave'</span><span class="src-sym">]</span><span class="src-str"></span><span class="src-sym">}</span>&nbsp;-F&nbsp;<span class="src-var">$frequency</span>&nbsp;-o&nbsp;<span class="src-var">$fname</span>.wav&nbsp;<span class="src-var">$fname</span>.txt</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1352"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1353"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a1354"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1355"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/touch">touch</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$fname</span>.txt</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1356"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/touch">touch</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$fname</span>.wav</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1357"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1358"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1359"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;stream&nbsp;it</span></div></li>
<li><div class="src-line"><a name="a1360"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodstream_file">stream_file</a><span class="src-sym">(</span><span class="src-var">$fname</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1361"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1362"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;clean&nbsp;up&nbsp;old&nbsp;files</span></div></li>
<li><div class="src-line"><a name="a1363"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$delete&nbsp;</span>=&nbsp;<a href="http://www.php.net/time">time</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>-&nbsp;<span class="src-num">2592000</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;1&nbsp;month</span></div></li>
<li><div class="src-line"><a name="a1364"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><a href="http://www.php.net/glob">glob</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'tempdir'</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-id">DIRECTORY_SEPARATOR&nbsp;</span>.&nbsp;<span class="src-str">'text2wav_*'</span><span class="src-sym">)&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$file</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1365"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/filemtime">filemtime</a><span class="src-sym">(</span><span class="src-var">$file</span><span class="src-sym">)&nbsp;</span>&lt;&nbsp;<span class="src-var">$delete</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1366"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/unlink">unlink</a><span class="src-sym">(</span><span class="src-var">$file</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1367"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1368"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$ret</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1369"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1370"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1371"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1372"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Use&nbsp;Cepstral&nbsp;Swift&nbsp;to&nbsp;read&nbsp;text.</span></div></li>
<li><div class="src-line"><a name="a1373"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1374"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.cepstral.com/</span></div></li>
<li><div class="src-line"><a name="a1375"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$text&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1376"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1377"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$frequency&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1378"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a1379"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1380"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodswift">swift</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-var">$frequency</span>=<span class="src-num">8000</span><span class="src-sym">,&nbsp;</span><span class="src-var">$voice</span>=<span class="src-id">NULL</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1381"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1382"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$voice</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1383"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$voice&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str">-n&nbsp;<span class="src-var">$voice</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1384"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'cepstral'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'voice'</span><span class="src-sym">]</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1385"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$voice&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str">-n&nbsp;{<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'cepstral'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'voice'</span><span class="src-sym">]</span><span class="src-str"></span><span class="src-sym">}</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1386"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1387"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$text&nbsp;</span>=&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1388"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$text&nbsp;</span>==&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span><span class="src-key">return&nbsp;</span><span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1389"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1390"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$hash&nbsp;</span>=&nbsp;<a href="http://www.php.net/md5">md5</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1391"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$fname&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'tempdir'</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-id">DIRECTORY_SEPARATOR</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1392"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$fname&nbsp;</span>.=&nbsp;<span class="src-str">'swift_'&nbsp;</span>.&nbsp;<span class="src-var">$hash</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1393"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1394"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;create&nbsp;wave&nbsp;file</span></div></li>
<li><div class="src-line"><a name="a1395"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$fname</span>.wav</span><span class="src-str">&quot;</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1396"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1397"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;write&nbsp;text&nbsp;file</span></div></li>
<li><div class="src-line"><a name="a1398"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$fname</span>.txt</span><span class="src-str">&quot;</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1399"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1400"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$fp&nbsp;</span>=&nbsp;<a href="http://www.php.net/fopen">fopen</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$fname</span>.txt</span><span class="src-str">&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-str">'w'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1401"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/fputs">fputs</a><span class="src-sym">(</span><span class="src-var">$fp</span><span class="src-sym">,&nbsp;</span><span class="src-var">$text</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1402"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/fclose">fclose</a><span class="src-sym">(</span><span class="src-var">$fp</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1403"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1404"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1405"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/shell_exec">shell_exec</a><span class="src-sym">(</span><span class="src-str">&quot;</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'cepstral'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'swift'</span><span class="src-sym">]</span><span class="src-str"></span><span class="src-sym">}</span>&nbsp;-p&nbsp;audio/channels=1,audio/sampling-rate=<span class="src-var">$frequency</span>&nbsp;<span class="src-var">$voice</span>&nbsp;-o&nbsp;<span class="src-var">$fname</span>.wav&nbsp;-f&nbsp;<span class="src-var">$fname</span>.txt</span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1406"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1407"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1408"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;stream&nbsp;it</span></div></li>
<li><div class="src-line"><a name="a1409"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodstream_file">stream_file</a><span class="src-sym">(</span><span class="src-var">$fname</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1410"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1411"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;clean&nbsp;up&nbsp;old&nbsp;files</span></div></li>
<li><div class="src-line"><a name="a1412"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$delete&nbsp;</span>=&nbsp;<a href="http://www.php.net/time">time</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>-&nbsp;<span class="src-num">2592000</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;1&nbsp;month</span></div></li>
<li><div class="src-line"><a name="a1413"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><a href="http://www.php.net/glob">glob</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'tempdir'</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-id">DIRECTORY_SEPARATOR&nbsp;</span>.&nbsp;<span class="src-str">'swift_*'</span><span class="src-sym">)&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$file</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1414"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/filemtime">filemtime</a><span class="src-sym">(</span><span class="src-var">$file</span><span class="src-sym">)&nbsp;</span>&lt;&nbsp;<span class="src-var">$delete</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1415"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/unlink">unlink</a><span class="src-sym">(</span><span class="src-var">$file</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1416"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1417"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$ret</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1418"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1419"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1420"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1421"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Text&nbsp;Input.</span></div></li>
<li><div class="src-line"><a name="a1422"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1423"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Based&nbsp;on&nbsp;ideas&nbsp;found&nbsp;at&nbsp;http://www.voip-info.org/wiki-Asterisk+cmd+DTMFToText</span></div></li>
<li><div class="src-line"><a name="a1424"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1425"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Example:</span></div></li>
<li><div class="src-line"><a name="a1426"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UC&nbsp;&nbsp;&nbsp;H&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LC&nbsp;&nbsp;&nbsp;i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SP&nbsp;&nbsp;&nbsp;h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;w&nbsp;&nbsp;&nbsp;&nbsp;SP&nbsp;&nbsp;&nbsp;a&nbsp;&nbsp;&nbsp;&nbsp;r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SP&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;u&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?</span></div></li>
<li><div class="src-line"><a name="a1427"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;$string&nbsp;=&nbsp;'*8'.'44*'.'*5'.'444*'.'00*'.'0*'.'44*'.'666*'.'9*'.'0*'.'2*'.'777*'.'33*'.'0*'.'999*'.'666*'.'88*'.'0000*';</span></div></li>
<li><div class="src-line"><a name="a1428"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1429"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://www.voip-info.org/wiki-Asterisk+cmd+DTMFToText</span></div></li>
<li><div class="src-line"><a name="a1430"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/input.php&nbsp;Get&nbsp;text&nbsp;input&nbsp;from&nbsp;the&nbsp;user&nbsp;and&nbsp;say&nbsp;it&nbsp;back</span></div></li>
<li><div class="src-line"><a name="a1431"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1432"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1433"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1434"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodtext_input">text_input</a><span class="src-sym">(</span><span class="src-var">$mode</span>=<span class="src-str">'NUMERIC'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1435"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1436"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$alpha&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(&nbsp;</span><span class="src-str">'k0'</span>=&gt;<span class="src-str">'&nbsp;'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k00'</span>=&gt;<span class="src-str">','</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k000'</span>=&gt;<span class="src-str">'.'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k0000'</span>=&gt;<span class="src-str">'?'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k00000'</span>=&gt;<span class="src-str">'0'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1437"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k1'</span>=&gt;<span class="src-str">'!'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k11'</span>=&gt;<span class="src-str">':'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k111'</span>=&gt;<span class="src-str">';'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k1111'</span>=&gt;<span class="src-str">'#'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k11111'</span>=&gt;<span class="src-str">'1'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1438"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k2'</span>=&gt;<span class="src-str">'A'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k22'</span>=&gt;<span class="src-str">'B'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k222'</span>=&gt;<span class="src-str">'C'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k2222'</span>=&gt;<span class="src-str">'2'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1439"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k3'</span>=&gt;<span class="src-str">'D'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k33'</span>=&gt;<span class="src-str">'E'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k333'</span>=&gt;<span class="src-str">'F'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k3333'</span>=&gt;<span class="src-str">'3'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1440"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k4'</span>=&gt;<span class="src-str">'G'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k44'</span>=&gt;<span class="src-str">'H'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k444'</span>=&gt;<span class="src-str">'I'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k4444'</span>=&gt;<span class="src-str">'4'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1441"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k5'</span>=&gt;<span class="src-str">'J'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k55'</span>=&gt;<span class="src-str">'K'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k555'</span>=&gt;<span class="src-str">'L'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k5555'</span>=&gt;<span class="src-str">'5'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1442"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k6'</span>=&gt;<span class="src-str">'M'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k66'</span>=&gt;<span class="src-str">'N'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k666'</span>=&gt;<span class="src-str">'O'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k6666'</span>=&gt;<span class="src-str">'6'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1443"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k7'</span>=&gt;<span class="src-str">'P'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k77'</span>=&gt;<span class="src-str">'Q'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k777'</span>=&gt;<span class="src-str">'R'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k7777'</span>=&gt;<span class="src-str">'S'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k77777'</span>=&gt;<span class="src-str">'7'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1444"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k8'</span>=&gt;<span class="src-str">'T'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k88'</span>=&gt;<span class="src-str">'U'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k888'</span>=&gt;<span class="src-str">'V'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k8888'</span>=&gt;<span class="src-str">'8'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1445"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k9'</span>=&gt;<span class="src-str">'W'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k99'</span>=&gt;<span class="src-str">'X'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k999'</span>=&gt;<span class="src-str">'Y'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k9999'</span>=&gt;<span class="src-str">'Z'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k99999'</span>=&gt;<span class="src-str">'9'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1446"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'k0'</span>=&gt;<span class="src-str">'='</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1447"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k1'</span>=&gt;<span class="src-str">'&lt;'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k11'</span>=&gt;<span class="src-str">'('</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k111'</span>=&gt;<span class="src-str">'['</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k1111'</span>=&gt;<span class="src-str">'{'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k11111'</span>=&gt;<span class="src-str">'1'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1448"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k2'</span>=&gt;<span class="src-str">'@'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k22'</span>=&gt;<span class="src-str">'$'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k222'</span>=&gt;<span class="src-str">'&amp;'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k2222'</span>=&gt;<span class="src-str">'%'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k22222'</span>=&gt;<span class="src-str">'2'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1449"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k3'</span>=&gt;<span class="src-str">'&gt;'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k33'</span>=&gt;<span class="src-str">')'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k333'</span>=&gt;<span class="src-str">']'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k3333'</span>=&gt;<span class="src-str">'}'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k33333'</span>=&gt;<span class="src-str">'3'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1450"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k4'</span>=&gt;<span class="src-str">'+'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k44'</span>=&gt;<span class="src-str">'-'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k444'</span>=&gt;<span class="src-str">'*'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k4444'</span>=&gt;<span class="src-str">'/'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k44444'</span>=&gt;<span class="src-str">'4'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1451"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k5'</span>=&gt;<span class="src-str">&quot;'&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k55'</span>=&gt;<span class="src-str">'`'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k555'</span>=&gt;<span class="src-str">'5'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1452"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k6'</span>=&gt;<span class="src-str">'&quot;'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k66'</span>=&gt;<span class="src-str">'6'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1453"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k7'</span>=&gt;<span class="src-str">'^'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k77'</span>=&gt;<span class="src-str">'7'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1454"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k8'</span>=&gt;<span class="src-str">&quot;\\&quot;</span><span class="src-sym">,</span><span class="src-str">'k88'</span>=&gt;<span class="src-str">'|'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k888'</span>=&gt;<span class="src-str">'8'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1455"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'k9'</span>=&gt;<span class="src-str">'_'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k99'</span>=&gt;<span class="src-str">'~'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'k999'</span>=&gt;<span class="src-str">'9'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1456"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$text&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1457"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;do</div></li>
<li><div class="src-line"><a name="a1458"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1459"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$command&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1460"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodget_data">get_data</a><span class="src-sym">(</span><span class="src-str">'beep'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1461"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'*'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$result</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">)&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$code</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1462"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1463"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$command</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1464"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1465"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">switch</span><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">{</span><span class="src-num">0</span><span class="src-sym">}</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1466"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1467"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'2'</span>:&nbsp;<span class="src-var">$text&nbsp;</span>=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">)&nbsp;</span>-&nbsp;<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;backspace</span></div></li>
<li><div class="src-line"><a name="a1468"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'5'</span>:&nbsp;<span class="src-var">$mode&nbsp;</span>=&nbsp;<span class="src-str">'LOWERCASE'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1469"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'6'</span>:&nbsp;<span class="src-var">$mode&nbsp;</span>=&nbsp;<span class="src-str">'NUMERIC'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1470"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'7'</span>:&nbsp;<span class="src-var">$mode&nbsp;</span>=&nbsp;<span class="src-str">'SYMBOL'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1471"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'8'</span>:&nbsp;<span class="src-var">$mode&nbsp;</span>=&nbsp;<span class="src-str">'UPPERCASE'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1472"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'9'</span>:&nbsp;<span class="src-var">$text&nbsp;</span>=&nbsp;<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'&nbsp;'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$text</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span>unset<span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">[</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-var">$text&nbsp;</span>=&nbsp;<a href="http://www.php.net/join">join</a><span class="src-sym">(</span><span class="src-str">'&nbsp;'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$text</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;backspace&nbsp;a&nbsp;word</span></div></li>
<li><div class="src-line"><a name="a1473"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1474"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$code&nbsp;</span>=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1475"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$command&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1476"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1477"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$code&nbsp;</span>==&nbsp;<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1478"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$command&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1479"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$mode&nbsp;</span>==&nbsp;<span class="src-str">'NUMERIC'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1480"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$text&nbsp;</span>.=&nbsp;<span class="src-var">$code</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1481"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$mode&nbsp;</span>==&nbsp;<span class="src-str">'UPPERCASE'&nbsp;</span>&amp;&amp;&nbsp;isset<span class="src-sym">(</span><span class="src-var">$alpha</span><span class="src-sym">[</span><span class="src-str">'k'</span>.<span class="src-var">$code</span><span class="src-sym">]</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1482"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$text&nbsp;</span>.=&nbsp;<span class="src-var">$alpha</span><span class="src-sym">[</span><span class="src-str">'k'</span>.<span class="src-var">$code</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1483"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$mode&nbsp;</span>==&nbsp;<span class="src-str">'LOWERCASE'&nbsp;</span>&amp;&amp;&nbsp;isset<span class="src-sym">(</span><span class="src-var">$alpha</span><span class="src-sym">[</span><span class="src-str">'k'</span>.<span class="src-var">$code</span><span class="src-sym">]</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1484"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$text&nbsp;</span>.=&nbsp;<a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$alpha</span><span class="src-sym">[</span><span class="src-str">'k'</span>.<span class="src-var">$code</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1485"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$mode&nbsp;</span>==&nbsp;<span class="src-str">'SYMBOL'&nbsp;</span>&amp;&amp;&nbsp;isset<span class="src-sym">(</span><span class="src-var">$symbol</span><span class="src-sym">[</span><span class="src-str">'k'</span>.<span class="src-var">$code</span><span class="src-sym">]</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1486"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$text&nbsp;</span>.=&nbsp;<span class="src-var">$symbol</span><span class="src-sym">[</span><span class="src-str">'k'</span>.<span class="src-var">$code</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1487"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1488"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodsay_punctuation">say_punctuation</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1489"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">while</span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span>-<span class="src-num">2</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-str">'**'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1490"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$text</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1491"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1492"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1493"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1494"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Say&nbsp;Puncutation&nbsp;in&nbsp;a&nbsp;string.</span></div></li>
<li><div class="src-line"><a name="a1495"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1496"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$text&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1497"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$escape_digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1498"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$frequency&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1499"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array,&nbsp;</span><span class="src-doc">see&nbsp;evaluate&nbsp;for&nbsp;return&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a1500"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1501"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodsay_punctuation">say_punctuation</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span>=<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-var">$frequency</span>=<span class="src-num">8000</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1502"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1503"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span>=<span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1504"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$i&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;&nbsp;</span><span class="src-var">$i&nbsp;</span>&lt;&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-var">$i</span>++<span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1505"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1506"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">switch</span><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">{</span><span class="src-var">$i</span><span class="src-sym">}</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1507"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1508"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'&nbsp;'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'SPACE&nbsp;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1509"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">','</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'COMMA&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1510"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'.'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'PERIOD&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1511"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'?'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'QUESTION&nbsp;MARK&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1512"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'!'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'EXPLANATION&nbsp;POINT&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1513"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">':'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'COLON&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1514"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">';'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'SEMICOLON&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1515"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'#'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'POUND&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1516"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'='</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'EQUALS&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1517"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'&lt;'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'LESS&nbsp;THAN&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1518"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'('</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'LEFT&nbsp;PARENTHESIS&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1519"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'['</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'LEFT&nbsp;BRACKET&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1520"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'{'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'LEFT&nbsp;BRACE&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1521"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'@'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'AT&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1522"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'$'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'DOLLAR&nbsp;SIGN&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1523"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'&amp;'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'AMPERSAND&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1524"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'%'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'PERCENT&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1525"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'&gt;'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'GREATER&nbsp;THAN&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1526"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">')'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'RIGHT&nbsp;PARENTHESIS&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1527"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">']'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'RIGHT&nbsp;BRACKET&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1528"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'}'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'RIGHT&nbsp;BRACE&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1529"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'+'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'PLUS&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1530"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'-'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'MINUS&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1531"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'*'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'ASTERISK&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1532"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'/'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'SLASH&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1533"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">&quot;'&quot;</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'SINGLE&nbsp;QUOTE&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1534"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'`'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'BACK&nbsp;TICK&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1535"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'&quot;'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'QUOTE&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1536"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'^'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'CAROT&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1537"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">&quot;\\&quot;</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'BACK&nbsp;SLASH&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1538"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'|'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'BAR&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1539"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'_'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'UNDERSCORE&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1540"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-str">'~'</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'TILDE&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1541"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">default</span>:&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-var">$text</span><span class="src-sym">{</span><span class="src-var">$i</span><span class="src-sym">}&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;'</span><span class="src-sym">;&nbsp;</span><span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1542"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1543"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1544"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodtext2wav">text2wav</a><span class="src-sym">(</span><span class="src-var">$ret</span><span class="src-sym">,&nbsp;</span><span class="src-var">$escape_digits</span><span class="src-sym">,&nbsp;</span><span class="src-var">$frequency</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1545"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1546"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1547"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1548"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Create&nbsp;a&nbsp;new&nbsp;AGI_AsteriskManager.</span></div></li>
<li><div class="src-line"><a name="a1549"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1550"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><span class="src-sym">&amp;</span><a href="../phpAGI/AGI.html#methodnew_AsteriskManager">new_AsteriskManager</a><span class="src-sym">(</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1551"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1552"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">asm&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../phpAGI/AGI_AsteriskManager.html">AGI_AsteriskManager</a></span><span class="src-sym">(</span><span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1553"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">asm</span><span class="src-sym">-&gt;</span><span class="src-id">pagi&nbsp;</span>=<span class="src-sym">&amp;&nbsp;</span><span class="src-var">$this</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1554"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$config">config</a>&nbsp;=<span class="src-sym">&amp;&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">asm</span><span class="src-sym">-&gt;</span><span class="src-id">config</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1555"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">asm</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1556"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1557"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1558"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1559"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;*********************************************************************************************************</span></div></li>
<li><div class="src-line"><a name="a1560"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PRIVATE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**</span></div></li>
<li><div class="src-line"><a name="a1561"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;*********************************************************************************************************</span></div></li>
<li><div class="src-line"><a name="a1562"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1563"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1564"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1565"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Evaluate&nbsp;an&nbsp;AGI&nbsp;command.</span></div></li>
<li><div class="src-line"><a name="a1566"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1567"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;private</span></div></li>
<li><div class="src-line"><a name="a1568"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$command&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1569"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc">('code'=&gt;$code,&nbsp;'result'=&gt;$result,&nbsp;'data'=&gt;$data)</span></div></li>
<li><div class="src-line"><a name="a1570"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1571"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodevaluate">evaluate</a><span class="src-sym">(</span><span class="src-var">$command</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1572"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1573"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$broken&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'code'</span>=&gt;<span class="src-num">500</span><span class="src-sym">,&nbsp;</span><span class="src-str">'result'</span>=&gt;-<span class="src-num">1</span><span class="src-sym">,&nbsp;</span><span class="src-str">'data'</span>=&gt;<span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1574"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1575"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;write&nbsp;command</span></div></li>
<li><div class="src-line"><a name="a1576"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-sym">@</span><a href="http://www.php.net/fwrite">fwrite</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$out">out</a><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$command</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">&quot;\n&quot;</span><span class="src-sym">))&nbsp;</span><span class="src-key">return&nbsp;</span><span class="src-var">$broken</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1577"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/fflush">fflush</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$out">out</a><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1578"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1579"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Read&nbsp;result.&nbsp;&nbsp;Occasionally,&nbsp;a&nbsp;command&nbsp;return&nbsp;a&nbsp;string&nbsp;followed&nbsp;by&nbsp;an&nbsp;extra&nbsp;new&nbsp;line.</span></div></li>
<li><div class="src-line"><a name="a1580"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;When&nbsp;this&nbsp;happens,&nbsp;our&nbsp;script&nbsp;will&nbsp;ignore&nbsp;the&nbsp;new&nbsp;line,&nbsp;but&nbsp;it&nbsp;will&nbsp;still&nbsp;be&nbsp;in&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a1581"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;buffer.&nbsp;&nbsp;So,&nbsp;if&nbsp;we&nbsp;get&nbsp;a&nbsp;blank&nbsp;line,&nbsp;it&nbsp;is&nbsp;probably&nbsp;the&nbsp;result&nbsp;of&nbsp;a&nbsp;previous</span></div></li>
<li><div class="src-line"><a name="a1582"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;command.&nbsp;&nbsp;We&nbsp;read&nbsp;until&nbsp;we&nbsp;get&nbsp;a&nbsp;valid&nbsp;result&nbsp;or&nbsp;asterisk&nbsp;hangs&nbsp;up.&nbsp;&nbsp;One&nbsp;offending</span></div></li>
<li><div class="src-line"><a name="a1583"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;command&nbsp;is&nbsp;SEND&nbsp;TEXT.</span></div></li>
<li><div class="src-line"><a name="a1584"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$count&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1585"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;do</div></li>
<li><div class="src-line"><a name="a1586"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1587"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$str&nbsp;</span>=&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><a href="http://www.php.net/fgets">fgets</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$in">in</a><span class="src-sym">,&nbsp;</span><span class="src-num">4096</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1588"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">while</span><span class="src-sym">(</span><span class="src-var">$str&nbsp;</span>==&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$count</span>++&nbsp;&lt;&nbsp;<span class="src-num">5</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1589"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1590"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$count&nbsp;</span>&gt;=&nbsp;<span class="src-num">5</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1591"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1592"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;conlog(&quot;evaluate&nbsp;error&nbsp;on&nbsp;read&nbsp;for&nbsp;$command&quot;);</span></div></li>
<li><div class="src-line"><a name="a1593"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$broken</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1594"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1595"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1596"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;parse&nbsp;result</span></div></li>
<li><div class="src-line"><a name="a1597"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">,&nbsp;</span><span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1598"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$str&nbsp;</span>=&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">,&nbsp;</span><span class="src-num">3</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1599"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1600"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">{</span><span class="src-num">0</span><span class="src-sym">}&nbsp;</span>==&nbsp;<span class="src-str">'-'</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;we&nbsp;have&nbsp;a&nbsp;multiline&nbsp;response!</span></div></li>
<li><div class="src-line"><a name="a1601"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1602"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$count&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1603"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$str&nbsp;</span>=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">&quot;\n&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1604"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$line&nbsp;</span>=&nbsp;<a href="http://www.php.net/fgets">fgets</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$in">in</a><span class="src-sym">,&nbsp;</span><span class="src-num">4096</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1605"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while</span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">,&nbsp;</span><span class="src-num">3</span><span class="src-sym">)&nbsp;</span>!=&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$count&nbsp;</span>&lt;&nbsp;<span class="src-num">5</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1606"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1607"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$str&nbsp;</span>.=&nbsp;<span class="src-var">$line</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1608"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$line&nbsp;</span>=&nbsp;<a href="http://www.php.net/fgets">fgets</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#var$in">in</a><span class="src-sym">,&nbsp;</span><span class="src-num">4096</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1609"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$count&nbsp;</span>=&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span>?&nbsp;<span class="src-var">$count&nbsp;</span>+&nbsp;<span class="src-num">1&nbsp;</span>:&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1610"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1611"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$count&nbsp;</span>&gt;=&nbsp;<span class="src-num">5</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1612"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1613"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;conlog(&quot;evaluate&nbsp;error&nbsp;on&nbsp;multiline&nbsp;read&nbsp;for&nbsp;$command&quot;);</span></div></li>
<li><div class="src-line"><a name="a1614"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$broken</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1615"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1616"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1617"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1618"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1619"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1620"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'code'</span><span class="src-sym">]&nbsp;</span>!=&nbsp;<span class="src-id"><a href="../phpAGI/_phpagi.php.html#defineAGIRES_OK">AGIRES_OK</a></span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;some&nbsp;sort&nbsp;of&nbsp;error</span></div></li>
<li><div class="src-line"><a name="a1621"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1622"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$str</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1623"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodconlog">conlog</a><span class="src-sym">(</span><a href="http://www.php.net/print_r">print_r</a><span class="src-sym">(</span><span class="src-var">$ret</span><span class="src-sym">,&nbsp;</span><span class="src-id">true</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1624"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1625"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else&nbsp;</span><span class="src-comm">//&nbsp;normal&nbsp;AGIRES_OK&nbsp;response</span></div></li>
<li><div class="src-line"><a name="a1626"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1627"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parse&nbsp;</span>=&nbsp;<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'&nbsp;'</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1628"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$in_token&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1629"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$parse&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$token</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1630"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1631"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$in_token</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;we&nbsp;previously&nbsp;hit&nbsp;a&nbsp;token&nbsp;starting&nbsp;with&nbsp;')'&nbsp;but&nbsp;not&nbsp;ending&nbsp;in&nbsp;')'</span></div></li>
<li><div class="src-line"><a name="a1632"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1633"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>.=&nbsp;<span class="src-str">'&nbsp;'&nbsp;</span>.&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$token</span><span class="src-sym">,&nbsp;</span><span class="src-str">'()&nbsp;'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1634"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$token</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$token</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}&nbsp;</span>==&nbsp;<span class="src-str">')'</span><span class="src-sym">)&nbsp;</span><span class="src-var">$in_token&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1635"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1636"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$token</span><span class="src-sym">{</span><span class="src-num">0</span><span class="src-sym">}&nbsp;</span>==&nbsp;<span class="src-str">'('</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1637"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1638"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$token</span><span class="src-sym">{</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$token</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">}&nbsp;</span>!=&nbsp;<span class="src-str">')'</span><span class="src-sym">)&nbsp;</span><span class="src-var">$in_token&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1639"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>.=&nbsp;<span class="src-str">'&nbsp;'&nbsp;</span>.&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$token</span><span class="src-sym">,&nbsp;</span><span class="src-str">'()&nbsp;'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1640"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1641"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$token</span><span class="src-sym">,&nbsp;</span><span class="src-str">'='</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1642"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1643"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$token&nbsp;</span>=&nbsp;<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'='</span><span class="src-sym">,&nbsp;</span><span class="src-var">$token</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1644"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-var">$token</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]]&nbsp;</span>=&nbsp;<span class="src-var">$token</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1645"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1646"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$token&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1647"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>.=&nbsp;<span class="src-str">'&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$token</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1648"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1649"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'data'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1650"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1651"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1652"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;log&nbsp;some&nbsp;errors</span></div></li>
<li><div class="src-line"><a name="a1653"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]&nbsp;</span>&lt;&nbsp;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1654"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodconlog">conlog</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$command</span>&nbsp;returned&nbsp;{<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-str">'result'</span><span class="src-sym">]</span><span class="src-sym">}</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1655"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1656"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$ret</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1657"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1658"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1659"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1660"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Log&nbsp;to&nbsp;console&nbsp;if&nbsp;debug&nbsp;mode.</span></div></li>
<li><div class="src-line"><a name="a1661"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1662"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@example</span><span class="src-doc">&nbsp;examples/ping.php&nbsp;Ping&nbsp;an&nbsp;IP&nbsp;address</span></div></li>
<li><div class="src-line"><a name="a1663"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1664"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$str&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1665"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$vbl&nbsp;</span><span class="src-doc">verbose&nbsp;level</span></div></li>
<li><div class="src-line"><a name="a1666"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1667"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodconlog">conlog</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">,&nbsp;</span><span class="src-var">$vbl</span>=<span class="src-num">1</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1668"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1669"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-var">$busy&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1670"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1671"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">config</span><span class="src-sym">[</span><span class="src-str">'phpagi'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'debug'</span><span class="src-sym">]&nbsp;</span>!=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1672"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1673"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$busy</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;no&nbsp;conlogs&nbsp;inside&nbsp;conlog!!!</span></div></li>
<li><div class="src-line"><a name="a1674"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1675"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$busy&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1676"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">verbose</span><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">,&nbsp;</span><span class="src-var">$vbl</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1677"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$busy&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1678"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1679"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1680"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1681"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1682"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1683"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Find&nbsp;an&nbsp;execuable&nbsp;in&nbsp;the&nbsp;path.</span></div></li>
<li><div class="src-line"><a name="a1684"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1685"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;private</span></div></li>
<li><div class="src-line"><a name="a1686"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$cmd&nbsp;</span><span class="src-doc">command&nbsp;to&nbsp;find</span></div></li>
<li><div class="src-line"><a name="a1687"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$checkpath&nbsp;</span><span class="src-doc">path&nbsp;to&nbsp;check</span></div></li>
<li><div class="src-line"><a name="a1688"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">the&nbsp;path&nbsp;to&nbsp;the&nbsp;command</span></div></li>
<li><div class="src-line"><a name="a1689"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1690"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodwhich">which</a><span class="src-sym">(</span><span class="src-var">$cmd</span><span class="src-sym">,&nbsp;</span><span class="src-var">$checkpath</span>=<span class="src-id">NULL</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1691"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1692"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global&nbsp;</span><span class="src-var">$_ENV</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1693"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$chpath&nbsp;</span>=&nbsp;<a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$checkpath</span><span class="src-sym">)&nbsp;</span>?&nbsp;<span class="src-var">$_ENV</span><span class="src-sym">[</span><span class="src-str">'PATH'</span><span class="src-sym">]&nbsp;</span>:&nbsp;<span class="src-var">$checkpath</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1694"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1695"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">':'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$chpath</span><span class="src-sym">)&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$path</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1696"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_executable">is_executable</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$path</span>/<span class="src-var">$cmd</span></span><span class="src-str">&quot;</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1697"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$path</span>/<span class="src-var">$cmd</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1698"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1699"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$checkpath</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1700"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../phpAGI/AGI.html#methodwhich">which</a><span class="src-sym">(</span><span class="src-var">$cmd</span><span class="src-sym">,&nbsp;</span><span class="src-str">'/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:'</span>.</div></li>
<li><div class="src-line"><a name="a1701"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'/usr/X11R6/bin:/usr/local/apache/bin:/usr/local/mysql/bin'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1702"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1703"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1704"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1705"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1706"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Make&nbsp;a&nbsp;folder&nbsp;recursively.</span></div></li>
<li><div class="src-line"><a name="a1707"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1708"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;private</span></div></li>
<li><div class="src-line"><a name="a1709"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$folder&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1710"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$perms&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1711"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1712"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1713"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/AGI.html#methodmake_folder">make_folder</a><span class="src-sym">(</span><span class="src-var">$folder</span><span class="src-sym">,&nbsp;</span><span class="src-var">$perms</span>=<span class="src-num">0755</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1714"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1715"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$f&nbsp;</span>=&nbsp;<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-id">DIRECTORY_SEPARATOR</span><span class="src-sym">,&nbsp;</span><span class="src-var">$folder</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1716"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$base&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1717"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$i&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;&nbsp;</span><span class="src-var">$i&nbsp;</span>&lt;&nbsp;<a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$f</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-var">$i</span>++<span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1718"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1719"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$base&nbsp;</span>.=&nbsp;<span class="src-var">$f</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1720"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$f</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-sym">!</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-var">$base</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1721"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/mkdir">mkdir</a><span class="src-sym">(</span><span class="src-var">$base</span><span class="src-sym">,&nbsp;</span><span class="src-var">$perms</span><span class="src-sym">)</span>==<span class="src-id">FALSE</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1722"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">(</span><span class="src-id">FALSE</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1723"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1724"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1725"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$base&nbsp;</span>.=&nbsp;<span class="src-id">DIRECTORY_SEPARATOR</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1726"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1727"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">(</span><span class="src-id">TRUE</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1728"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1729"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1730"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1731"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1732"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1733"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1734"></a><span class="src-doc">&nbsp;*&nbsp;error&nbsp;handler&nbsp;for&nbsp;phpagi.</span></div></li>
<li><div class="src-line"><a name="a1735"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a1736"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$level&nbsp;</span><span class="src-doc">PHP&nbsp;error&nbsp;level</span></div></li>
<li><div class="src-line"><a name="a1737"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$message&nbsp;</span><span class="src-doc">error&nbsp;message</span></div></li>
<li><div class="src-line"><a name="a1738"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$file&nbsp;</span><span class="src-doc">path&nbsp;to&nbsp;file</span></div></li>
<li><div class="src-line"><a name="a1739"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">integer&nbsp;</span><span class="src-doc-var">$line&nbsp;</span><span class="src-doc">line&nbsp;number&nbsp;of&nbsp;error</span></div></li>
<li><div class="src-line"><a name="a1740"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc-var">$context&nbsp;</span><span class="src-doc">variables&nbsp;in&nbsp;the&nbsp;current&nbsp;scope</span></div></li>
<li><div class="src-line"><a name="a1741"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1742"></a>&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../phpAGI/_phpagi.php.html#functionphpagi_error_handler">phpagi_error_handler</a><span class="src-sym">(</span><span class="src-var">$level</span><span class="src-sym">,&nbsp;</span><span class="src-var">$message</span><span class="src-sym">,&nbsp;</span><span class="src-var">$file</span><span class="src-sym">,&nbsp;</span><span class="src-var">$line</span><span class="src-sym">,&nbsp;</span><span class="src-var">$context</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1743"></a>&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1744"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/ini_get">ini_get</a><span class="src-sym">(</span><span class="src-str">'error_reporting'</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-num">0</span><span class="src-sym">)&nbsp;</span><span class="src-key">return</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;this&nbsp;happens&nbsp;with&nbsp;an&nbsp;@</span></div></li>
<li><div class="src-line"><a name="a1745"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1746"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">@</span><a href="http://www.php.net/syslog">syslog</a><span class="src-sym">(</span><span class="src-id">LOG_WARNING</span><span class="src-sym">,&nbsp;</span><span class="src-var">$file&nbsp;</span>.&nbsp;<span class="src-str">'['&nbsp;</span>.&nbsp;<span class="src-var">$line&nbsp;</span>.&nbsp;<span class="src-str">']:&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$message</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1747"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1748"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global&nbsp;</span><span class="src-var">$phpagi_error_handler_email</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1749"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-str">'mail'</span><span class="src-sym">)&nbsp;</span>&amp;&amp;&nbsp;<span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$phpagi_error_handler_email</span><span class="src-sym">))&nbsp;</span><span class="src-comm">//&nbsp;generate&nbsp;email&nbsp;debugging&nbsp;information</span></div></li>
<li><div class="src-line"><a name="a1750"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1751"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;decode&nbsp;error&nbsp;level</span></div></li>
<li><div class="src-line"><a name="a1752"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">switch</span><span class="src-sym">(</span><span class="src-var">$level</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1753"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1754"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id">E_WARNING</span>:</div></li>
<li><div class="src-line"><a name="a1755"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id">E_USER_WARNING</span>:</div></li>
<li><div class="src-line"><a name="a1756"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$level&nbsp;</span>=&nbsp;<span class="src-str">&quot;Warning&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1757"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1758"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id">E_NOTICE</span>:</div></li>
<li><div class="src-line"><a name="a1759"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id">E_USER_NOTICE</span>:</div></li>
<li><div class="src-line"><a name="a1760"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$level&nbsp;</span>=&nbsp;<span class="src-str">&quot;Notice&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1761"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1762"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id">E_USER_ERROR</span>:</div></li>
<li><div class="src-line"><a name="a1763"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$level&nbsp;</span>=&nbsp;<span class="src-str">&quot;Error&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1764"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1765"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1766"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1767"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;build&nbsp;message</span></div></li>
<li><div class="src-line"><a name="a1768"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$basefile&nbsp;</span>=&nbsp;<a href="http://www.php.net/basename">basename</a><span class="src-sym">(</span><span class="src-var">$file</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1769"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subject&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$basefile</span>/<span class="src-var">$line</span>/<span class="src-var">$level</span>:&nbsp;<span class="src-var">$message</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1770"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$message&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$level</span>:&nbsp;<span class="src-var">$message</span>&nbsp;in&nbsp;<span class="src-var">$file</span>&nbsp;on&nbsp;line&nbsp;<span class="src-var">$line</span>\n\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1771"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1772"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-str">'mysql_errno'</span><span class="src-sym">)&nbsp;</span>&amp;&amp;&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-str">'&nbsp;'</span>.<a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$message</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-str">'mysql'</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1773"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$message&nbsp;</span>.=&nbsp;<span class="src-str">'MySQL&nbsp;error&nbsp;'&nbsp;</span>.&nbsp;<a href="http://www.php.net/mysql_errno">mysql_errno</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">&quot;:&nbsp;&quot;&nbsp;</span>.&nbsp;<a href="http://www.php.net/mysql_error">mysql_error</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">&quot;\n\n&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1774"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1775"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;figure&nbsp;out&nbsp;who&nbsp;we&nbsp;are</span></div></li>
<li><div class="src-line"><a name="a1776"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-str">'socket_create'</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1777"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1778"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$addr&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1779"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$port&nbsp;</span>=&nbsp;<span class="src-num">80</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1780"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$socket&nbsp;</span>=&nbsp;<span class="src-sym">@</span><a href="http://www.php.net/socket_create">socket_create</a><span class="src-sym">(</span><span class="src-id">AF_INET</span><span class="src-sym">,&nbsp;</span><span class="src-id">SOCK_DGRAM</span><span class="src-sym">,&nbsp;</span><span class="src-id">SOL_UDP</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1781"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">@</span><a href="http://www.php.net/socket_connect">socket_connect</a><span class="src-sym">(</span><span class="src-var">$socket</span><span class="src-sym">,&nbsp;</span><span class="src-str">'64.0.0.0'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$port</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1782"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">@</span><a href="http://www.php.net/socket_getsockname">socket_getsockname</a><span class="src-sym">(</span><span class="src-var">$socket</span><span class="src-sym">,&nbsp;</span><span class="src-var">$addr</span><span class="src-sym">,&nbsp;</span><span class="src-var">$port</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1783"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">@</span><a href="http://www.php.net/socket_close">socket_close</a><span class="src-sym">(</span><span class="src-var">$socket</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1784"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$message&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str">\n\nIP&nbsp;Address:&nbsp;<span class="src-var">$addr</span>\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1785"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1786"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1787"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;include&nbsp;variables</span></div></li>
<li><div class="src-line"><a name="a1788"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$message&nbsp;</span>.=&nbsp;<span class="src-str">&quot;\n\nContext:\n&quot;&nbsp;</span>.&nbsp;<a href="http://www.php.net/print_r">print_r</a><span class="src-sym">(</span><span class="src-var">$context</span><span class="src-sym">,&nbsp;</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1789"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$message&nbsp;</span>.=&nbsp;<span class="src-str">&quot;\n\nGLOBALS:\n&quot;&nbsp;</span>.&nbsp;<a href="http://www.php.net/print_r">print_r</a><span class="src-sym">(</span><span class="src-var">$GLOBALS</span><span class="src-sym">,&nbsp;</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1790"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$message&nbsp;</span>.=&nbsp;<span class="src-str">&quot;\n\nBacktrace:\n&quot;&nbsp;</span>.&nbsp;<a href="http://www.php.net/print_r">print_r</a><span class="src-sym">(</span><a href="http://www.php.net/debug_backtrace">debug_backtrace</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1791"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1792"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;include&nbsp;code&nbsp;fragment</span></div></li>
<li><div class="src-line"><a name="a1793"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-var">$file</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1794"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1795"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$message&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str">\n\n<span class="src-var">$file</span>:\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1796"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$code&nbsp;</span>=&nbsp;<span class="src-sym">@</span><a href="http://www.php.net/file">file</a><span class="src-sym">(</span><span class="src-var">$file</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1797"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$i&nbsp;</span>=&nbsp;<a href="http://www.php.net/max">max</a><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">,&nbsp;</span><span class="src-var">$line&nbsp;</span>-&nbsp;<span class="src-num">10</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-var">$i&nbsp;</span>&lt;&nbsp;<a href="http://www.php.net/min">min</a><span class="src-sym">(</span><span class="src-var">$line&nbsp;</span>+&nbsp;<span class="src-num">10</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">))</span><span class="src-sym">;&nbsp;</span><span class="src-var">$i</span>++<span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1798"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$message&nbsp;</span>.=&nbsp;<span class="src-sym">(</span><span class="src-var">$i&nbsp;</span>+&nbsp;<span class="src-num">1</span><span class="src-sym">)</span>.<span class="src-str">&quot;</span><span class="src-str">\t<span class="src-var">$code</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1799"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1800"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1801"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;make&nbsp;sure&nbsp;message&nbsp;is&nbsp;fully&nbsp;readable&nbsp;(convert&nbsp;unprintable&nbsp;chars&nbsp;to&nbsp;hex&nbsp;representation)</span></div></li>
<li><div class="src-line"><a name="a1802"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1803"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$i&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;&nbsp;</span><span class="src-var">$i&nbsp;</span>&lt;&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$message</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-var">$i</span>++<span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1804"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1805"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$c&nbsp;</span>=&nbsp;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$message</span><span class="src-sym">{</span><span class="src-var">$i</span><span class="src-sym">}</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1806"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$c&nbsp;</span>==&nbsp;<span class="src-num">10&nbsp;</span>||&nbsp;<span class="src-var">$c&nbsp;</span>==&nbsp;<span class="src-num">13&nbsp;</span>||&nbsp;<span class="src-var">$c&nbsp;</span>==&nbsp;<span class="src-num">9</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1807"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-var">$message</span><span class="src-sym">{</span><span class="src-var">$i</span><span class="src-sym">}</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1808"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$c&nbsp;</span>&lt;&nbsp;<span class="src-num">16</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1809"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'\x0'&nbsp;</span>.&nbsp;<a href="http://www.php.net/dechex">dechex</a><span class="src-sym">(</span><span class="src-var">$c</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1810"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$c&nbsp;</span>&lt;&nbsp;<span class="src-num">32&nbsp;</span>||&nbsp;<span class="src-var">$c&nbsp;</span>&gt;&nbsp;<span class="src-num">127</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1811"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-str">'\x'&nbsp;</span>.&nbsp;<a href="http://www.php.net/dechex">dechex</a><span class="src-sym">(</span><span class="src-var">$c</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1812"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a1813"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret&nbsp;</span>.=&nbsp;<span class="src-var">$message</span><span class="src-sym">{</span><span class="src-var">$i</span><span class="src-sym">}</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1814"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1815"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$message&nbsp;</span>=&nbsp;<span class="src-var">$ret</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1816"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1817"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;send&nbsp;the&nbsp;mail&nbsp;if&nbsp;less&nbsp;than&nbsp;5&nbsp;errors</span></div></li>
<li><div class="src-line"><a name="a1818"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-var">$mailcount&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1819"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$mailcount&nbsp;</span>&lt;&nbsp;<span class="src-num">5</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1820"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">@</span><span class="src-id">mail</span><span class="src-sym">(</span><span class="src-var">$phpagi_error_handler_email</span><span class="src-sym">,&nbsp;</span><span class="src-var">$subject</span><span class="src-sym">,&nbsp;</span><span class="src-var">$message</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1821"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mailcount</span>++<span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1822"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1823"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1824"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1825"></a>&nbsp;&nbsp;<span class="src-var">$phpagi_error_handler_email&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
</ol></div>
</div>
	<p class="notes" id="credit">
		Documentation generated on Thu, 30 Sep 2010 02:21:59 -0700 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
	</p>
	</body>
</html>
Return current item: PHP AGI