Hi again,<div><br></div><div>So, I have this but NoOp shows a random SIP info value rather then the one passed to it. Just to test, I am sending $didin as argument to test.php and then expect it back as $didgot back into dialplan. But it seems that either send or receive has problem because no matter what I put as the NoOp in _x,4 it all comes back the same as SIP channel info.</div>
<div><br></div><div><div><b><i>[custom-phpagi]</i></b></div><div><b><i>exten => _x.,1,Set(didin=${EXTEN})</i></b></div><div><b><i>exten => _x.,2,NoOp(${didin}</i></b></div><div><b><i>exten => _x.,3,deadAGI(test.agi,${didin})</i></b></div>
<div><b><i>exten => _x.,4,NoOp(${didgot})</i></b></div><div><b><i>exten => _x.,5,Hangup()</i></b></div><div><br></div><div><div><b>/var/lib/asterisk/agi-lib/test.agi:</b></div><div><br></div><div>#!/usr/bin/php -q</div>
<div><?php</div><div>set_time_limit(30);</div><div>require('phpagi/phpagi.php');</div><div><br></div><div>$didgot = $argv[1];</div><div><br></div><div>$agi = new AGI();</div><div><br></div><div>$agi->get_variable("didgot", $didgot); /// both of these don't seem to send didgot back to dialplan</div>
<div>$agi->set_variable("didgot", $didgot); /// both of these don't seem to send didgot back to dialplan</div><div><br></div><div><br></div><div>exit(0);</div><div>?></div></div><div><br></div><div>
Thanks,</div><div>Bruce</div><div><br></div><br><div class="gmail_quote">On Mon, Jun 14, 2010 at 2:15 PM, Carlos Chavez <span dir="ltr"><<a href="mailto:cursor@telecomabmex.com">cursor@telecomabmex.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Mon, 2010-06-14 at 13:41 -0400, bruce bruce wrote:<br>
> Hi Carlso,<br>
><br>
><br>
> Thanks for the input. I have done this in php and am not familiar with<br>
> phpagi.<br>
> So, there is absolutely no way to temporarily solve this problem by<br>
> getting the value back from php file?<br>
><br>
><br>
> Wondering if it would require a lot of work to change the php file to<br>
> phpagi?<br>
> Thanks,<br>
> Bruce<br>
><br>
</div> Here is an example:<br>
<br>
exten => _x.,1,AGI(sample.agi)<br>
<div class="im">exten => _x.,n,NoOp(${var})<br>
<br>
</div>sample.agi:<br>
<br>
#!/usr/bin/php -q<br>
<?php<br>
set_time_limit(30);<br>
require('phpagi/phpagi.php');<br>
$agi = new AGI();<br>
$exten = $agi->request['agi_extension']; //Dialed extension<br>
// the result is stored in $exten<br>
// do something with your data<br>
$agi->set_variable("var", $result);<br>
$agi->verbose("The result was: $result", 3);<br>
?><br>
<br>
You can even send parameters to the AGI via the command line like:<br>
<br>
exten => _x.,1,AGI(sample.agi,param1,param2) //Use comma for 1.6 or |<br>
for 1.4 or below<br>
<br>
And access them via $argv[1], $argv[2] is there is some extra<br>
information that you cannot get via the AGI variables.<br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div class="h5">Telecomunicaciones Abiertas de México S.A. de C.V.<br>
Carlos Chávez Prats<br>
Director de Tecnología<br>
+52-55-91169161 ext 2001<br>
</div></div><br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br></div>