<div dir="ltr">Hi,<div>Please see my comments in line.<br><div class="gmail_extra"><br></div><div class="gmail_extra">Regards,</div><div class="gmail_extra">Sammy</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Jan 16, 2013 at 12:13 PM, Zohair Raza <span dir="ltr"><<a href="mailto:engineerzuhairraza@gmail.com" target="_blank">engineerzuhairraza@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><br><div class="gmail_quote"><div class="im">On Wed, Jan 16, 2013 at 11:01 AM, Muhammad <span dir="ltr"><<a href="mailto:mohammad.ghazavi@gmail.com" target="_blank">mohammad.ghazavi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><font color="#333399"><font><font face="tahoma,sans-serif"><i>Thank<font>s <font>Zohair!<br><font>I wrote some php code to working with AGI, but it dosen't work.<br><font></font></font></font></font></i></font></font></font></div>
</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><font color="#333399"><font><font face="tahoma,sans-serif"><i><font><font><font><font>I don't know how can run it. please explain me when I put m<font>y php code insi<font>de </font>/var/lib/asterisk/agi-bin <font>so, what should I do a<font>fter that. </font></font></font></font></font></font></font></i></font></font></font></div>
</blockquote><div><br></div></div><div>Make sure Asterisk has access to your AGI script, and make it executable (chmod u+x agi.php). Also make sure it has shebang (!#/usr/bin/php)</div></div></div></blockquote><div style>
<br></div><div style>Besides that you'll need to create SIP users and define their <i>context=my-agi</i> and in your context call this AGI.</div><div style><br></div><div style><font face="courier new, monospace">[my-agi]</font></div>
<div style><font face="courier new, monospace">exten => _X.,1,NOOP(Invoking AGI Script now)</font></div><div style><font face="courier new, monospace">same => n,AGI(my-agi-filename.php)</font></div><div style><font face="courier new, monospace">same => n,NOOP(Any other post AGI things here)</font></div>
<div style><font face="courier new, monospace">same => n,Hangup()</font></div><div style><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_quote"><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><font color="#333399"><font><font face="tahoma,sans-serif"><i><font><font><font><font><font><font><font>and the second one, how can limit users to call just my number in list at datab<font>ase<font> and permit to call another numbers.</font></font></font></font></font></font></font></font></font></i></font></font></font><div>
<div><i><br></i></div></div></div></blockquote></div><div>That depends on logic in your script, you can also separate users by contexts</div></div></div></blockquote><div style><br></div><div style>Alternative to the above approach there are other possibilities, like applying a GotoIF() condition in the <i>[my-agi]</i> dialplan code above restricting a particluar number, or Instead of <i>_X. </i>in the above code implement some regex to enable only local area dialing i.e</div>
<div style><br></div><div style><font face="courier new, monospace">exten => _78XXXXXX,1,NOOP(Invoking AGI Script now for dialled string starting with 78 and 8 digit in length)</font></div><div style><br></div><div style>
If you don't like any of the above because you've a list of numbers which should be dialled only in a DB.table then in your php-AGI script do some restrictions based on that table.</div><div style><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_quote"><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div><div><i>
</i><br><div class="gmail_quote">On Tue, Jan 15, 2013 at 12:39 PM, Zohair Raza <span dir="ltr"><<a href="mailto:engineerzuhairraza@gmail.com" target="_blank">engineerzuhairraza@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">you need to run full command, like <div><br></div><div>agi show commands topic answer</div><div>agi show commands topic gosub</div><div>agi set debug on</div><div><br></div><div><br clear="all"><div><div dir="ltr">
Regards,<br>Zohair Raza<div><br></div><div><br></div></div></div><div class="gmail_quote"><div><div>On Tue, Jan 15, 2013 at 1:05 PM, Muhammad <span dir="ltr"><<a href="mailto:mohammad.ghazavi@gmail.com" target="_blank">mohammad.ghazavi@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><div dir="ltr">Hi,<br><br>in CLI, I type agi show or other agi commad, but response me "command not found".<br>
How can see agi is work normally in my server?<br><br></div>
<br></div></div><span><font color="#888888">--<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></font></span></blockquote></div><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></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></div></div><br></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></div></div>