All: I've starting building an asterisk system for our company, which has about 60 users. I am new to asterisk, so thank you for your patience. I've stripped the sip.conf and the extensions.conf down to the bare minimum: Here is my extensions.conf file [globals] [general] autofallthrough=no [default] [fromprovider] exten => YYYYYYYYYY,1,Dial(SIP/151,20) [phones] exten => 150,1,Dial(SIP/150) exten => 151,1,Dial(SIP/151) exten => _X.,1,DIAL(SIP/${EXTEN}@xx.xxxxxx.net) and the matching sip.conf: [general] port=5060 bindaddr=0.0.0.0 ;10.8.0.34 srvlookup=yes disallow=all ;read somewhere you have to disallow everything first allow=ulaw allow=alaw allow=gsm dtmfmode=rfc2833 ;; allows use of push buttons on grandstream nat=no externip=64.4.127.106 localnet=10.0.0.0/255.0.0.0 canreinvite=no ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; register sip service ; ;register => YYYYYYYYY:xxxxxxx:4xxxxxxxxxxx at ia.ntelos.net/YYYYYYYYYY ; This register statement works also. ; register => YYYYYYYYYY:xxxxxxxxxxx:YYYYYYYYYY at ia.ntelos.net ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [151] ; define extension number for grandstreams type=friend context=phones username=eddie host=dynamic [150] type=friend context=phones username=regis host=dynamic ; define sip service [xx.xxxxx.net] type = peer username = YYYYYYYYYY fromuser = YYYYYYYYYY user = phone host = xx.xxxxx.net fromdomain = xx.xxxxx.net outboundproxy = xxxx.xxxxx.net secret = secret context = fromprovider I can make outgoing phones ok. Here's the problem. When I make an incoming phone call, I get a sip error message stating extension not found. If I comment out the [fromprovider] context, and leave exten => YYYYYYYYYY,1,Dial(SIP/151,20) in the default context, everything works fine. Why do the incoming phone calls work ok when defined in the default context and not in the fromprovider context. I hope that is clear. Thanks for any help and tips. And thanks for everything I have gleaned from others who have answered previous "newbie" questions.
Have you tried 'type = friend', might also want to make sure 'allowguest' is set to 'no', as this may be putting guest calls into your default context. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100419/ab623dd1/attachment.htm
Message: 15 Date: Mon, 19 Apr 2010 17:46:46 -0400 From: Ryan Bullock<rrb3942 at gmail.com> Subject: Re: [asterisk-users] A matter of context To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com> Message-ID: <g2y3ceb22f71004191446x23bb96c3x5a3848b06ada482d at mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Have you tried 'type = friend', might also want to make sure 'allowguest' is set to 'no', as this may be putting guest calls into your default context. -------------- next part -------------- An HTML attachment was scrubbed... URL:http://lists.digium.com/pipermail/asterisk-users/attachments/20100419/ab623dd1/attachment-0001.htm ------------------------------ No luck on those. In fact, if I set allowguest to no, it shuts incoming calls down completely. I can get things to work, but am puzzled why things have to go under the "default" context. I haven't received any other replies, so it is either so obvious, or no one else knows either.... best Eddie
Hi There is a setting in sip.conf that deafults to context=default ; Default context for incoming calls As explained this means that all incoming calls go to the default context. You can change this if you wish to but just remember that incoming calls will only go into one context and you can always make them GoTo other contexts from there. Hope this helps Ish Eddie Mikell wrote:> All: > > I've starting building an asterisk system for our company, which has > about 60 users. I am new to asterisk, so thank you for your patience. > > I've stripped the sip.conf and the extensions.conf down to the bare minimum: > > Here is my extensions.conf file > > [globals] > > [general] > autofallthrough=no > > [default] > > [fromprovider] > exten => YYYYYYYYYY,1,Dial(SIP/151,20) > > [phones] > exten => 150,1,Dial(SIP/150) > exten => 151,1,Dial(SIP/151) > exten => _X.,1,DIAL(SIP/${EXTEN}@xx.xxxxxx.net) > > and the matching sip.conf: > > [general] > port=5060 > bindaddr=0.0.0.0 ;10.8.0.34 > srvlookup=yes > disallow=all ;read somewhere you have to disallow everything first > allow=ulaw > allow=alaw > allow=gsm > dtmfmode=rfc2833 ;; allows use of push buttons on grandstream > nat=no > externip=64.4.127.106 > localnet=10.0.0.0/255.0.0.0 > canreinvite=no > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;; register sip service > ; > ;register => YYYYYYYYY:xxxxxxx:4xxxxxxxxxxx at ia.ntelos.net/YYYYYYYYYY > ; This register statement works also. > ; > register => YYYYYYYYYY:xxxxxxxxxxx:YYYYYYYYYY at ia.ntelos.net > ; > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > > > [151] ; define extension number for grandstreams > type=friend > context=phones > username=eddie > host=dynamic > > [150] > type=friend > context=phones > username=regis > host=dynamic > > > ; define sip service > [xx.xxxxx.net] > type = peer > username = YYYYYYYYYY > fromuser = YYYYYYYYYY > user = phone > host = xx.xxxxx.net > fromdomain = xx.xxxxx.net > outboundproxy = xxxx.xxxxx.net > secret = secret > context = fromprovider > > > I can make outgoing phones ok. > > Here's the problem. When I make an incoming phone call, I get a sip > error message stating extension not found. > > If I comment out the [fromprovider] context, and leave exten => > YYYYYYYYYY,1,Dial(SIP/151,20) in the > default context, everything works fine. > > Why do the incoming phone calls work ok when defined in the default > context and not in the fromprovider context. > > I hope that is clear. > > Thanks for any help and tips. And thanks for everything I have gleaned > from others who have answered previous "newbie" questions. > >-- Ishfaq Malik Software Developer PackNet Ltd Office: 0161 660 3062