Re: Multiple registers with the same SIP provider

Comment on Asterisk SIP user vs peer
tcseke
Joined: Thu 24 of Jan, 2008

Re: Multiple registers with the same SIP provider

Posted:Thu 24 of Jan, 2008 (11:53 UTC)
I had the same problem with Callweaver 1.2 4274 svn revision.
The solution for me:

type=friend
fromuser=something
trustrpid=yes

I have multiple sip trunk, which are distinguashed by the fromuser. For right callerid presentation I use username from the Remote-Party-Id header. For this i use trustrpid setting.
mariusmuja
Joined: Tue 11 of Dec, 2007

Re: Multiple registers with the same SIP provider

Posted:Tue 11 of Dec, 2007 (22:46 UTC)
I had the same problem (two accounts with the same provider) and all the incoming calls ended up in the same context (the last one configured in the conf file). I solved this with the information I found here: http://www.aussievoip.com.au/wiki/How+to+get+the+DID+of+a+SIP+trunk

Basically all I had to do was to look at the "To" field in the SIP headers and the number of the account from which the call was coming in was there. I changed extensions.conf like this:

[DID_trunk_1_and_2]
exten = _X.,1,Goto(DID_trunk_with_number,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)

[DID_trunk_with_number]
exten = <number1>,1,Goto(default|<ext1>|1)
exten = <number2>,1,Goto(default|<ext2>|1)

Now if a call comes from account with <number1> extension <ext1> rings, and if the call comes from account with <number2> then extension <ext2> rings.