<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">nikhil singhania</b> <span dir="ltr"><<a href="mailto:niksinghania@gmail.com">niksinghania@gmail.com</a>></span><br>
Date: 16 June 2010 12:15<br>Subject: Re: [asterisk-users] can't seem to register, status unmonitored<br>To: Zeeshan Zakaria <<a href="mailto:zishanov@gmail.com">zishanov@gmail.com</a>><br><br><br>Here is my extensions.conf:<br>
[general]<br>static=yes ; default values for changes to this file<br>writeprotect=no ; by the Asterisk CLI<br>[globals]<br>; variables go here<br>[default]<br>; default context<br>
[phones]<br>; context for our phones<br>exten => 2001,1,Dial(SIP/2001)<br>exten => 2002,1,Dial(SIP/2002)<br>exten => 500,1,Answer()<br>exten => 500,2,Playback(demo-echotest) <br> <br> ; Let them know what's going on<br>
exten => 500,3,Echo <br> <br> ; Do the echo test<br>exten => 500,4,Playback(demo-echodone) <br> <br> ; Let them know it's over<br>exten => 500,5,Hangup<br>exten => _.,1,Dial(SIP/${EXTEN}@wlg-gateway) ; match anything and send to wlg-gateway<br>
exten => _.,2,Hangup<br>[from-wlg-gateway]<br>; context for calls coming from wlg-gateway<br>exten => 4980007,1,Dial(SIP/2001&SIP/2002)<br>exten => _.,1,Congestion() <br> <br> ; everyone else gets congestion<br>
<br><br><br><br>..............................................................................................................................<br>sip.conf<br>........................................................................................................<br>
[general]<br>context=default ; Default context for incoming calls<br>port=5060 ; UDP Port to bind to (SIP standard port is 5060)<br>bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)<br>srvlookup=yes ; Enable DNS SRV lookups on outbound calls<br>
[2001]<br>type=friend ; both send and receive calls from this peer<br>host=dynamic ; this peer will register with us<br>username=2001<br>secret=j0nny<br>canreinvite=no ; don't send SIP re-invites (ie. terminate rtp stream)<br>
nat=yes ; always assume peer is behind a NAT<br>context=phones ; send calls to 'phones' context<br>dtmfmode=rfc2833 ; set dtmf relay mode<br>allow=all ; allow all codecs<br>[2002]<br>type=friend<br>
host=dynamic<br>username=2002<br>secret=whyfry<br>canreinvite=no<br>nat=yes<br>context=phones<br>dtmfmode=rfc2833<br>allow=all<br>[wlg-gateway]<br>type=friend<br>disallow=all<br>allow=ulaw<br>context=from-wlg-gateway<br>
host=202.7.4.40<br>
canreinvite=no<br>dtmfmode=rfc2833<br>allow=all<br>.....................................................................................................<br>inbound.php<br>..................................................................................................<br>
#!/usr/bin/php<br><br><?php<br><br> ob_implicit_flush(true);<br> set_time_limit(0);<br> echo("Hello, world!");<br><br> require_once "phpagi.php";<br> error_reporting(E_ALL);<br> echo("Hello, world!");<br>
<br> $dir_base = "/var/www/wizoz/";<br> echo $dir_base;<br> $dir_prompt = $dir_base."prompts";<br> $dir_wav = $dir_base."wav";<br> $rel_dir_mp3 = "mp3";<br> $dir_mp3 = $dir_base.$rel_dir_mp3;<br>
$agi = new AGI();<br> echo("created");<br> $agi->answer();<br><span style="background-color: rgb(255, 255, 102);"> $agi->exec_dial("SIP","2002");</span><br style="background-color: rgb(255, 255, 102);">
$agi->stream_file($dir_prompt.'/welcome','123'); fflush($agi->out);<br> # welcome to <a href="http://yumphone.com" target="_blank">yumphone.com</a><br> $agi->stream_file($dir_prompt.'/welcome','123'); fflush($agi->out);<br>
echo("Hello, world!");<br><br> $result = $agi->get_variable("CALLERID(num)");<br> echo $result;<br> $phonenum = $result['data'];<br> if (strlen($phonenum) != '10')<br> {<br>
$phonenum = substr($phonenum,-10);<br> }<br><br> $uid = $phonenum.time();<br><br> $agi->stream_file($dir_prompt.'/record','123'); fflush($agi->out);<br> # please record your message after the beep. press 0 at the end of the message<br>
$agi->record_file($dir_wav."/".$uid,'wav','0','60000',NULL,true,5);<br> # fname, format, escape, timeout, offset, beep, silence<br> $agi->stream_file($dir_prompt.'/messagesent','123'); fflush($agi->out);<br>
# your message has been sent<br> $agi->stream_file($dir_prompt.'/thankyou','123'); fflush($agi->out);<br> # thank you<br><br>?><br>..................................................................................................<br>
Though I am new, but i am somewhat familiar, and am devoting a great deal of time. Now you have all the files. I highlited the exec_dial function. This inbound.php is the file i am executing on the command line on the server. But I am not gettting the call at my end. May be the way i am doing it is wrong. Please suggest me. Rest of the code works fine.<div>
<div></div><div class="h5"><br>
<br><br><br><br><div class="gmail_quote">On 15 June 2010 18:15, Zeeshan Zakaria <span dir="ltr"><<a href="mailto:zishanov@gmail.com" target="_blank">zishanov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<p>The reason I said it'll take you one week, is because you seem new to asterisk. It may take even more.</p>
<p>Pasting a part of the code is not enough for anybody to be able to help you. You should paste the relevant parts of your sip.conf, extensions.conf and the agi script. To me it seems you are new to dial plans, and if this is true, first you need to focus on understanding dial plans, and then jump to agi.</p>
<p>Did the other two issue get resolved?<br></p><div>
<p>Zeeshan A Zakaria</p>
<p>--<br>
<a href="http://www.ilovetovoip.com" target="_blank">www.ilovetovoip.com</a></p>
</div><p></p><blockquote type="cite"><div>On 2010-06-15 7:49 AM, "nikhil singhania" <<a href="mailto:niksinghania@gmail.com" target="_blank">niksinghania@gmail.com</a>> wrote:<br><br></div><div class="gmail_quote">
<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Zeeshan,<br></blockquote><div>Thanx for ur reply!!<br><br>The reason for this question was that i am actually doing the 3rd part, which you said will take me 1 week to learn.<br><br>I have modified a file inbound.php which uses function of phpagi.php....exec_dial.<br>
But since i am not able to get the call on softphone.<br><br>Here is part of code:<br> $agi = new AGI();<br> $agi->answer();<br> $agi->exec_dial("SIP","2001");<br><br>when i execute the php file on the command line of server, nothing happens in my softphone. Since it's registered as i told you then when the file is executed at server, my phone is supposed to ring , but its not ringing. Where I am going wrong??<br>
<br> <br></div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
Message: 19<br>
Date: Tue, 15 Jun 2010 07:01:43 -0400<br>
From: Zeeshan Zakaria <<a href="mailto:zishanov@gmail.com" target="_blank">zishanov@gmail.com</a>><br>
Subject: Re: [asterisk-users] can't seem to register, status<br>
unmonitored<br>
To: Asterisk Users Mailing List - Non-Commercial Discussion<br>
<<a href="mailto:asterisk-users@lists.digium.com" target="_blank">asterisk-users@lists.digium.com</a>><br>
Message-ID:<br>
<<a href="mailto:AANLkTil6AAf21HcG4Jpf7sV9YzPJa7w-Yo8sT6PpfNkK@mail.gmail.com" target="_blank">AANLkTil6AAf21HcG4Jpf7sV9YzPJa7w-Yo8sT6PpfNkK@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"</div><p><font color="#500050"><div><br>><br>> 1. Do 'qualify=yes' in sip.conf for the extenstions for which you want to<br>> see the status.<br>
><br></div>>...</font></p><div>
<<a href="mailto:sip%3A2001@172.26.48.208" target="_blank">sip:2001@172.26.48.208</a> <<a href="mailto:sip%253A2001@172.26.48.208" target="_blank">sip%3A2001@172.26.48.208</a>>>;expires=3013</div><p><font color="#500050"><div>
<br>
><br>> 208 is ip of the asterisk server.<br></div>> on the server on doing 'sip show peers' , it shows the user...</font></p><div>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.digium.com/pipermail/asterisk-users/attachments/20100615/79ebe9fb/attachment.htm" target="_blank">http://lists.digium.com/pipermail/asterisk-users/attachments/20100615/79ebe9fb/attachment.htm</a><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--" target="_blank">http://www.api-digital.com--</a><br>
<br>
AstriCon 2010 - October 26-28 Washington, DC<br>
Register Now: <a href="http://www.astricon.net/" target="_blank">http://www.astricon.net/</a></div><p><font color="#500050"><div><br>><br>> asterisk-users mailing list<br>> To UNSUBSCRIBE or update options visit:<br>
</div>> <a href="http://lists.digium.c." target="_blank">http://lists.digium.c.</a>..</font></p><div>
End of asterisk-users Digest, Vol 71, Issue 33<br>
**********************************************<br>
</div></blockquote></div><br><br clear="all"><br>-- <br><p><font color="#500050"><div>Nikhil Kumar<br>summer intern:simmortel voice technologies<br>rit2007033<br>b.tech IT 6th sem<br>IIIT Allahabad<br></div>...</font></p>
</blockquote>
</blockquote></div><br><br clear="all"><br>-- <br>Nikhil Kumar<br>summer intern:simmortel voice technologies<br>rit2007033<br>b.tech IT 6th sem<br>IIIT Allahabad<br></div></div><div><div></div><div class="h5">contact@9793905858<br>
email: <a href="mailto:rit2007033@iiita.ac.in" target="_blank">rit2007033@iiita.ac.in</a><br>
<a href="mailto:niksinghania@gmail.com" target="_blank">niksinghania@gmail.com</a><br><a href="http://profile.iiita.ac.in/RIT2007033/" target="_blank">http://profile.iiita.ac.in/RIT2007033/</a><br><br>
</div></div></div><br><br clear="all"><br>-- <br>Nikhil Kumar<br>summer intern:simmortel voice technologies<br>rit2007033<br>b.tech IT 6th sem<br>IIIT Allahabad<br>contact@9793905858<br>email: <a href="mailto:rit2007033@iiita.ac.in">rit2007033@iiita.ac.in</a><br>
<a href="mailto:niksinghania@gmail.com">niksinghania@gmail.com</a><br><a href="http://profile.iiita.ac.in/RIT2007033/">http://profile.iiita.ac.in/RIT2007033/</a><br><br>