<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
/* List Definitions */
@list l0
        {mso-list-id:875047514;
        mso-list-type:hybrid;
        mso-list-template-ids:818477474 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=white lang=EN-US link=blue vlink=purple>
<div class=Section1>
<ol style='margin-top:0in' start=1 type=1>
<li class=MsoNormal style='color:navy;mso-list:l0 level1 lfo1'><font size=2
color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial'>(personal
preference) I wouldn’t use PHP<o:p></o:p></span></font></li>
<li class=MsoNormal style='color:navy;mso-list:l0 level1 lfo1'><font size=2
color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial'>that
out of the way, I comment out the AGI stuff and run my AGI’s from
bash to make sure the non AGI stuff is happy.<o:p></o:p></span></font></li>
<li class=MsoNormal style='color:navy;mso-list:l0 level1 lfo1'><font size=2
color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial'>the
AGI seems to be ok here, I’d make sure my SQL stuff is good.<o:p></o:p></span></font></li>
</ol>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
color=black face="Times New Roman"><span style='font-size:12.0pt;color:windowtext'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 color=black face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;color:windowtext;font-weight:bold'>From:</span></font></b><font
size=2 color=black face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
color:windowtext'> asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Jonas Kellens<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, June 30, 2010
10:32 AM<br>
<b><span style='font-weight:bold'>To:</span></b> Asterisk Users Mailing List -
Non-Commercial Discussion<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [asterisk-users]
queue command in asterisk 1.4with macro-argument</span></font><font
color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color=black face=Helvetica><span
style='font-size:12.0pt;font-family:Helvetica'>Taking my first steps into AGI
then :<br>
<br>
<br>
[root@asterisk agi-bin]# cat sample.agi <br>
#!/usr/bin/php -q<br>
<?php<br>
$MYSQLSERVER2="localhost";<br>
$MYSQLUSER2="user";<br>
$MYSQLPASSWD2="passwd";<br>
<br>
set_time_limit(30);<br>
require('phpagi/phpagi.php');<br>
$agi = new AGI();<br>
<br>
$db=mysql_connect("$MYSQLSERVER2", "$MYSQLUSER2",
"$MYSQLPASSWD2");<br>
mysql_select_db(Asterisk, $db);<br>
<br>
$QUERY="SELECT vmcontext FROM AstDB WHERE ID='40'";<br>
$agi->verbose("query is: $QUERY", 3);<br>
$result=mysql_query($QUERY);<br>
$VMCONTEXT=mysql_fetch_array($result);<br>
$agi->verbose("VMCONTEXT is: $VMCONTEXT", 3);<br>
$vmcontext=$VMCONTEXT['vmcontext'];<br>
<br>
$exten = $agi->request['agi_extension']; //Dialed extension<br>
// the result is stored in $exten<br>
$agi->verbose("variable exten : $exten", 3);<br>
$agi->verbose("variable vmcontext : $vmcontext", 3);<br>
//<br>
?><br>
<br>
<br>
[Jun 30 17:26:04] -- Executing [123@test:3]
AGI("SIP/test-00000054", "sample.agi") in new stack<br>
[Jun 30 17:26:04] -- Launched AGI Script
/var/lib/asterisk/agi-bin/sample.agi<br>
[Jun 30 17:26:04] -- sample.agi: query is: SELECT
vmcontext FROM AstDB WHERE klantID='40'<br>
[Jun 30 17:26:04] -- sample.agi: VMCONTEXT is: <br>
[Jun 30 17:26:04] -- sample.agi: variable exten :
123<br>
[Jun 30 17:26:04] -- sample.agi: variable
vmcontext : <br>
[Jun 30 17:26:04] -- AGI Script sample.agi completed,
returning 0<br>
<br>
<br>
Does AGI not interpret my query correctly ? As there is no output for
$vmcontext...<br>
<br>
<br>
<br>
Jonas.<br>
<br>
</span></font><br>
On 06/30/2010 04:54 PM, Jim Dickenson wrote: <o:p></o:p></p>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'>Yes it gets called when the call is connected to a
queue member.<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'>In version 1.4.x you can execute an AGI instead of a
sub or macro.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>