[asterisk-users] SIP trunks going to the wrong context

Tony Mountifield tony at softins.co.uk
Thu Dec 14 16:53:22 CST 2017


In article <1513290358.2926.4.camel at linuxista.com>,
Frank Vanoni <mailinglist at linuxista.com> wrote:
> I don't know if it applies to your problem, but I also had some
> troubles with multiple account on same SIP provider. 
> Here what works for me:
> 
> 
> In sip.conf:
> 
> 
> register => 111111:qwertz at sip.provider.zz/111111 ; Trunk1
> register => 222222:asdfgh at sip.provider.zz/222222 ; Trunk2
> register => 222222:yxcvbn at sip.provider.zz/222222 ; Trunk3
> 
> 
> [trunk1]
> type=friend
> host=sip.provider.zz
> defaultuser=111111
> secret=qwertz
> canreinvite=no
> insecure=invite
> nat=force_rport,comedia
> qualify=yes
> context=trunkincoming
> description=Trunk 1
> 
> [trunk2]
> type=friend
> host=sip.provider.zz
> defaultuser=222222
> secret=asdfgh
> canreinvite=no
> insecure=invite
> nat=force_rport,comedia
> qualify=yes
> context=trunkincoming
> description=Trunk 2
> 
> [trunk3]
> type=friend
> host=sip.provider.zz
> defaultuser=333333
> secret=yxcvbn
> canreinvite=no
> insecure=invite
> nat=force_rport,comedia
> qualify=yes
> context=trunkincoming
> description=Trunk 3
> 
> 
> 
> In extensions.conf:
> 
> [trunkincoming]
> exten => 111111,1,GoTo(firstline,111111,1)
> exten => 222222,1,GoTo(secondline,222222,1)
> exten => 333333,1,GoTo(thirdline,333333,1)
> 
> [firstline]
> exten => 111111,1,Dial(SIP/officephone,120,m)
> 
> [secondline]
> exten => 222222,1,Dial(SIP/livingroomphone,120,m)
> 
> [thirdline]
> exten => 333333,1,Dial(SIP/bedroomphone,120,m)

But because you have all three of your trunk peers pointing to the
same context, you don't necessarily know whether the inbound calls
are matching different peers or all the same one.

If you had each trunk pointing at a different context, you would
probably run into the same problem as the OP.

Cheers,
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-users mailing list