[asterisk-users] A matter of context

Ishfaq Malik ish at pack-net.co.uk
Tue Apr 20 10:50:44 CDT 2010


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



More information about the asterisk-users mailing list