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

Frank Vanoni mailinglist at linuxista.com
Thu Dec 14 16:25:58 CST 2017


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)







More information about the asterisk-users mailing list