[asterisk-users] SIP trunks going to the wrong context
asterisk at solutionengineers.com
Thu Dec 14 15:10:23 CST 2017
I'm trying to resolve a weird issue with SIP routing.
I have a number of SIP trunks, from a selection of providers, all of
which are registered in sip.conf:
; SE registrations
register => user1:password1 at sipgate.co.uk:5060/se2489
register => user2:password2 at sipgate.co.uk:5060/se1268
register => user3:password3 at sipgate.co.uk:5060/se0845
register => user4:password4 at callcentric.com:5060/se1777
register => user5:password5 at sipgate.co.uk:5060/se4130
register => user9:password9 at sip.vohippo.com:5060/se1413
; SJ registrations
register => user6:password6 at sipgate.co.uk:5060/sj0151
register => user7:password7 at callcentric.com:5060/sj1777
register => user8:password8 at sipgate.co.uk:5060/sj0203
I then have a selection of #included files. The first defines se2489:
The second defines sj0151:
regcontext=sj-main ; Added to try to fix wrong context on IB calls
subscribecontext=sj-main ; Added to try to fix wrong context on IB calls
When an inbound call comes in to sj0151, I get the following error:
NOTICE[C-00000000]: chan_sip.c:26407 handle_request_invite:
Call from 'user1' (18.104.22.168:5060) to extension 'sj0151' rejected
because extension not found in context 'external-se'.
Surely it should have looked in sj-main, not external-se?
Also, the "Call from 'user1' is always 'user1' no matter which sipgate
account originated the call. The Callcentric numbers can't receive
inbound calls, the vohippo number shows "Call from 'user9'" as one would
expect. ALL of them look in context 'external-se', but the SJ
registrations should all be looking in 'sj-main'. What's more, it seems
to be struggling with pattern matching... The extension is passed
correctly (albeit to the wrong context, for 3 of the numbers), so the
following dialplan should pick them all up, surely?:
; Transfer any call from any SE external trunk to the IVR @ the office.
; If the office is unavailable (no internet, for example), then go
exten => _se.,1,Dial(IAX2/cloud/1000,30,r)
same => n,Voicemail(5000)
same => n,Hangup()
However, it simply doesn't work. If I replace _se. with _se2489. (or
just se2489), it works fine (for calls arriving on the se2489 extension;
obviously the others bork).
Can anyone tell me what I'm doing wrong, based on the above?
FWIW; this seems to have occurred because I've been attempting to prune
my dialplan; I used to have them all going into a single context, and I
picked them out & routed them individually. I am _trying_ to simplify
the structure/mess that is extensions.conf... but as a result I ran into
this little conundrum. The main problem is to resolve the "wrong
context"; I have a suspicion I could fix the "can't find extension"
problem by getting rid of the letters & using a purely numeric extension.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the asterisk-users