[asterisk-users] Fwd: can't seem to register, status unmonitored

nikhil singhania niksinghania at gmail.com
Wed Jun 16 07:03:28 CDT 2010


---------- Forwarded message ----------
From: nikhil singhania <niksinghania at gmail.com>
Date: 16 June 2010 12:15
Subject: Re: [asterisk-users] can't seem to register, status unmonitored
To: Zeeshan Zakaria <zishanov at gmail.com>


Here is my extensions.conf:
[general]
static=yes               ; default values for changes to this file
writeprotect=no          ; by the Asterisk CLI
[globals]
; variables go here
[default]
; default context
[phones]
; context for our phones
exten => 2001,1,Dial(SIP/2001)
exten => 2002,1,Dial(SIP/2002)
exten =>  500,1,Answer()
exten =>  500,2,Playback(demo-echotest)

  ; Let them know what's going on
exten =>  500,3,Echo

  ; Do the echo test
exten =>  500,4,Playback(demo-echodone)

  ; Let them know it's over
exten =>  500,5,Hangup
exten => _.,1,Dial(SIP/${EXTEN}@wlg-gateway)        ; match anything and
send to wlg-gateway
exten => _.,2,Hangup
[from-wlg-gateway]
; context for calls coming from wlg-gateway
exten => 4980007,1,Dial(SIP/2001&SIP/2002)
exten => _.,1,Congestion()

       ; everyone else gets congestion




..............................................................................................................................
sip.conf
........................................................................................................
[general]
context=default  ; Default context for incoming calls
port=5060        ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes    ; Enable DNS SRV lookups on outbound calls
[2001]
type=friend      ; both send and receive calls from this peer
host=dynamic     ; this peer will register with us
username=2001
secret=j0nny
canreinvite=no   ; don't send SIP re-invites (ie. terminate rtp stream)
nat=yes          ; always assume peer is behind a NAT
context=phones   ; send calls to 'phones' context
dtmfmode=rfc2833 ; set dtmf relay mode
allow=all        ; allow all codecs
[2002]
type=friend
host=dynamic
username=2002
secret=whyfry
canreinvite=no
nat=yes
context=phones
dtmfmode=rfc2833
allow=all
[wlg-gateway]
type=friend
disallow=all
allow=ulaw
context=from-wlg-gateway
host=202.7.4.40
canreinvite=no
dtmfmode=rfc2833
allow=all
.....................................................................................................
inbound.php
..................................................................................................
#!/usr/bin/php

<?php

   ob_implicit_flush(true);
   set_time_limit(0);
   echo("Hello, world!");

   require_once "phpagi.php";
   error_reporting(E_ALL);
   echo("Hello, world!");

   $dir_base = "/var/www/wizoz/";
   echo $dir_base;
   $dir_prompt = $dir_base."prompts";
   $dir_wav = $dir_base."wav";
   $rel_dir_mp3 = "mp3";
   $dir_mp3 = $dir_base.$rel_dir_mp3;
   $agi = new AGI();
   echo("created");
  $agi->answer();
   $agi->exec_dial("SIP","2002");
   $agi->stream_file($dir_prompt.'/welcome','123'); fflush($agi->out);
   # welcome to yumphone.com
   $agi->stream_file($dir_prompt.'/welcome','123'); fflush($agi->out);
   echo("Hello, world!");

$result = $agi->get_variable("CALLERID(num)");
   echo $result;
   $phonenum = $result['data'];
   if (strlen($phonenum) != '10')
   {
      $phonenum = substr($phonenum,-10);
   }

   $uid = $phonenum.time();

   $agi->stream_file($dir_prompt.'/record','123'); fflush($agi->out);
   # please record your message after the beep. press 0 at the end of the
message

$agi->record_file($dir_wav."/".$uid,'wav','0','60000',NULL,true,5);
   # fname, format, escape, timeout, offset, beep, silence
   $agi->stream_file($dir_prompt.'/messagesent','123'); fflush($agi->out);
   # your message has been sent
   $agi->stream_file($dir_prompt.'/thankyou','123'); fflush($agi->out);
   # thank you

?>
..................................................................................................
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.





On 15 June 2010 18:15, Zeeshan Zakaria <zishanov at gmail.com> wrote:

> The reason I said it'll take you one week, is because you seem new to
> asterisk. It may take even more.
>
> 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.
>
> Did the other two issue get resolved?
>
> Zeeshan A Zakaria
>
> --
> www.ilovetovoip.com
>
> On 2010-06-15 7:49 AM, "nikhil singhania" <niksinghania at gmail.com> wrote:
>
>  Hi Zeeshan,
>>
> Thanx for ur reply!!
>
> The reason for this question was that i am actually doing the 3rd part,
> which you said will take me 1 week to learn.
>
> I have modified a file inbound.php which uses function of
> phpagi.php....exec_dial.
> But since i am not able to get the call on softphone.
>
> Here is part of code:
>       $agi = new AGI();
>        $agi->answer();
>        $agi->exec_dial("SIP","2001");
>
> 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??
>
>
>
>> Message: 19
>> Date: Tue, 15 Jun 2010 07:01:43 -0400
>> From: Zeeshan Zakaria <zishanov at gmail.com>
>> Subject: Re: [asterisk-users] can't seem to register, status
>>        unmonitored
>> To: Asterisk Users Mailing List - Non-Commercial Discussion
>>        <asterisk-users at lists.digium.com>
>> Message-ID:
>>        <AANLkTil6AAf21HcG4Jpf7sV9YzPJa7w-Yo8sT6PpfNkK at mail.gmail.com>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>>
>> >
>> > 1. Do 'qualify=yes' in sip.conf for the extenstions for which you want
>> to
>> > see the status.
>> >
>> >...
>> <sip:2001 at 172.26.48.208 <sip%3A2001 at 172.26.48.208> <
>> sip%3A2001 at 172.26.48.208 <sip%253A2001 at 172.26.48.208>>>;expires=3013
>>
>>
>> >
>> > 208 is ip of the asterisk server.
>> > on the server on doing 'sip show peers' , it shows the user...
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>> http://lists.digium.com/pipermail/asterisk-users/attachments/20100615/79ebe9fb/attachment.htm
>>
>> ------------------------------
>>
>> _______________________________________________
>> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>>
>> AstriCon 2010 - October 26-28 Washington, DC
>> Register Now: http://www.astricon.net/
>>
>>
>> >
>> > asterisk-users mailing list
>> > To UNSUBSCRIBE or update options visit:
>> >   http://lists.digium.c...
>> End of asterisk-users Digest, Vol 71, Issue 33
>> **********************************************
>>
>
>
>
> --
>
> Nikhil Kumar
> summer intern:simmortel voice technologies
> rit2007033
> b.tech IT 6th sem
> IIIT Allahabad
> ...
>
>


-- 
Nikhil Kumar
summer intern:simmortel voice technologies
rit2007033
b.tech IT 6th sem
IIIT Allahabad
contact at 9793905858
email: rit2007033 at iiita.ac.in
         niksinghania at gmail.com
http://profile.iiita.ac.in/RIT2007033/




-- 
Nikhil Kumar
summer intern:simmortel voice technologies
rit2007033
b.tech IT 6th sem
IIIT Allahabad
contact at 9793905858
email: rit2007033 at iiita.ac.in
         niksinghania at gmail.com
http://profile.iiita.ac.in/RIT2007033/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100616/6106bf65/attachment.htm 


More information about the asterisk-users mailing list