<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">nikhil singhania</b> <span dir="ltr">&lt;<a href="mailto:niksinghania@gmail.com">niksinghania@gmail.com</a>&gt;</span><br>

Date: 16 June 2010 12:15<br>Subject: Re: [asterisk-users] can&#39;t seem to register, status unmonitored<br>To: Zeeshan Zakaria &lt;<a href="mailto:zishanov@gmail.com">zishanov@gmail.com</a>&gt;<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 =&gt; 2001,1,Dial(SIP/2001)<br>exten =&gt; 2002,1,Dial(SIP/2002)<br>exten =&gt;  500,1,Answer()<br>exten =&gt;  500,2,Playback(demo-echotest)         <br>     <br>  ; Let them know what&#39;s going on<br>


exten =&gt;  500,3,Echo                            <br>     <br>  ; Do the echo test<br>exten =&gt;  500,4,Playback(demo-echodone)         <br>     <br>  ; Let them know it&#39;s over<br>exten =&gt;  500,5,Hangup<br>exten =&gt; _.,1,Dial(SIP/${EXTEN}@wlg-gateway)        ; match anything and send to wlg-gateway<br>


exten =&gt; _.,2,Hangup<br>[from-wlg-gateway]<br>; context for calls coming from wlg-gateway<br>exten =&gt; 4980007,1,Dial(SIP/2001&amp;SIP/2002)<br>exten =&gt; _.,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&#39;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 &#39;phones&#39; 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>&lt;?php<br><br>   ob_implicit_flush(true);<br>   set_time_limit(0);<br>   echo(&quot;Hello, world!&quot;);<br><br>   require_once &quot;phpagi.php&quot;;<br>   error_reporting(E_ALL);<br>   echo(&quot;Hello, world!&quot;);<br>


<br>   $dir_base = &quot;/var/www/wizoz/&quot;;<br>   echo $dir_base;<br>   $dir_prompt = $dir_base.&quot;prompts&quot;;<br>   $dir_wav = $dir_base.&quot;wav&quot;;<br>   $rel_dir_mp3 = &quot;mp3&quot;;<br>   $dir_mp3 = $dir_base.$rel_dir_mp3;<br>


   $agi = new AGI();<br>   echo(&quot;created&quot;);<br>  $agi-&gt;answer();<br><span style="background-color: rgb(255, 255, 102);">   $agi-&gt;exec_dial(&quot;SIP&quot;,&quot;2002&quot;);</span><br style="background-color: rgb(255, 255, 102);">


   $agi-&gt;stream_file($dir_prompt.&#39;/welcome&#39;,&#39;123&#39;); fflush($agi-&gt;out);<br>   # welcome to <a href="http://yumphone.com" target="_blank">yumphone.com</a><br>   $agi-&gt;stream_file($dir_prompt.&#39;/welcome&#39;,&#39;123&#39;); fflush($agi-&gt;out);<br>


   echo(&quot;Hello, world!&quot;);<br><br> $result = $agi-&gt;get_variable(&quot;CALLERID(num)&quot;);<br>   echo $result;<br>   $phonenum = $result[&#39;data&#39;];<br>   if (strlen($phonenum) != &#39;10&#39;)<br>   {<br>


      $phonenum = substr($phonenum,-10);<br>   }<br><br>   $uid = $phonenum.time();<br><br>   $agi-&gt;stream_file($dir_prompt.&#39;/record&#39;,&#39;123&#39;); fflush($agi-&gt;out);<br>   # please record your message after the beep. press 0 at the end of the message<br>


                                   $agi-&gt;record_file($dir_wav.&quot;/&quot;.$uid,&#39;wav&#39;,&#39;0&#39;,&#39;60000&#39;,NULL,true,5);<br>   # fname, format, escape, timeout, offset, beep, silence<br>   $agi-&gt;stream_file($dir_prompt.&#39;/messagesent&#39;,&#39;123&#39;); fflush($agi-&gt;out);<br>


   # your message has been sent<br>   $agi-&gt;stream_file($dir_prompt.&#39;/thankyou&#39;,&#39;123&#39;); fflush($agi-&gt;out);<br>   # thank you<br><br>?&gt;<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">&lt;<a href="mailto:zishanov@gmail.com" target="_blank">zishanov@gmail.com</a>&gt;</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&#39;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, &quot;nikhil singhania&quot; &lt;<a href="mailto:niksinghania@gmail.com" target="_blank">niksinghania@gmail.com</a>&gt; 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-&gt;answer();<br>       $agi-&gt;exec_dial(&quot;SIP&quot;,&quot;2001&quot;);<br><br>when i execute the php file on the command line of server, nothing happens in my softphone. Since it&#39;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 &lt;<a href="mailto:zishanov@gmail.com" target="_blank">zishanov@gmail.com</a>&gt;<br>
Subject: Re: [asterisk-users] can&#39;t seem to register, status<br>
        unmonitored<br>
To: Asterisk Users Mailing List - Non-Commercial Discussion<br>
        &lt;<a href="mailto:asterisk-users@lists.digium.com" target="_blank">asterisk-users@lists.digium.com</a>&gt;<br>
Message-ID:<br>
        &lt;<a href="mailto:AANLkTil6AAf21HcG4Jpf7sV9YzPJa7w-Yo8sT6PpfNkK@mail.gmail.com" target="_blank">AANLkTil6AAf21HcG4Jpf7sV9YzPJa7w-Yo8sT6PpfNkK@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;</div><p><font color="#500050"><div><br>&gt;<br>&gt; 1. Do &#39;qualify=yes&#39; in sip.conf for the extenstions for which you want to<br>&gt; see the status.<br>
&gt;<br></div>&gt;...</font></p><div>

&lt;<a href="mailto:sip%3A2001@172.26.48.208" target="_blank">sip:2001@172.26.48.208</a> &lt;<a href="mailto:sip%253A2001@172.26.48.208" target="_blank">sip%3A2001@172.26.48.208</a>&gt;&gt;;expires=3013</div><p><font color="#500050"><div>


<br>
&gt;<br>&gt; 208 is ip of the asterisk server.<br></div>&gt; on the server on doing &#39;sip show peers&#39; , 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>&gt;<br>&gt; asterisk-users mailing list<br>&gt; To UNSUBSCRIBE or update options visit:<br>


</div>&gt;   <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>