Multiple SIP accounts

Is it possible to registering multiple SIP accounts with one SIP provider in asterisk 1.4 and get the incoming calls to match different peers?



yes, its possible.
example given here:-

note: post such queries in user forum

My experience is that when the incoming calls come from the same SIP provider(ip address), they will all match the same peer. I saw that the Olle E. Johanson had some development around this problem. … +chan_sip2
Thats why I’am asking in the developers forum, if someone knows if this possibility has been implemented yet?

I have 3 different BroadVoice accounts and while I’m not set up 100% by any means, I think I have found a way around the multiple account issue. This may or may not work for other servers without multiple proxies.

I basically aliased the DNS names of the broadvoice proxies to simulate 3 different providers. I simply picked the 3 closest servers and assigned the closest to the account I used the most, the next closest to the 2nd most used, etc.

[hosts file]


(NOTE THE DIFFERENCE OF LX.SIP vs just SIP in the following lines:)
register =>
register =>
register =>

; and then only changed 2 lines in the individual account settings (per account):

Again, I’m not an expert as I’ve only been playing with linux and Asterisk for 3 days… :smile: And I may be totally off base here, but I did try calling into my Asterisk server using the 3 different accounts. Prior to this, they all processed incoming scripts with the same EXT.CONF settings. Now, they process their own individual account settings on incoming calls.

Can anyone see any holes in this method or verify it works for them?

this example is based on my own working config (Asterisk 1.4)


exten => s,1,Set(DN=${SIP_HEADER(TO)})
exten => s,2,GotoIf($["${DN}" = "<sip:4733601@domain.tld>"]?15,1)
exten => s,3,GotoIf($["${DN}" = "<sip:4733602@domain.tld>"]?12,1)
exten => s,4,Goto(default,11,1)
exten => 15,1,Goto(default,15,1)
exten => 12,1,Goto(default,12,1)
exten => t,1,Goto(default,11,1)
exten => i,1,Goto(default,11,1)

All the calls coming to 4733601 will go to ext.15, calls for 4733602 will go ext. 12 and all other calls coming on the same trunk or the same context will go to ext.11