Multiple SIP trunks to single ISP
I have a working scenario where I have 3 SIP trunks to a single ISP. I have no issues with inbound calls and am able to (after a lot of head scratching and a VERY helpful provider) receive inbound calls and route them correctly based on DID. They have a single SIP proxy to which everything registers. All 3 trunks register fine. Outgoing calls only work on one trunk the other two give me a congested problem.
I suspect that this is a single outside IP address problem as trixbox uses the destination IP to store the info against. Therefore last sip trunk is always the good one.
The question is, is there a way around this (other than put a cheap SIP gateway in between at least 2 of the trunks)?
Does anyone know if this issue (sip registration store) is unique to trixbox or is an issue with asterisk in general?
Regards
Sean
Sean,
What is the purpose of having three trunks to the same ITSP? Since a single SIP trunk can handle multiple call appearances, the only thing I could imagine you would do that for would be billing multiple tenants out of the same box. Even then I think there are better solutions. Maybe instead of looking for a solution you might consider consolidating to a single trunk?
I think this is a SIP/Asterisk thing. The way SIP is designed, I just don't think it supports this unless you bind each trunk to different ports. That, or course, would require help from your ITSP.
Also, there was a patch floating around somewhere (sorry... I don't have a link to it) that would allow multiple SIP devices to register to a single extension. I have no clue if that would work for trunks or not. Maybe somebody else with some experience with that patch would know?
Jason
jgleim my guess is its as simple as to have more than 1 phone number.
I have 2 accounts at Sipgate.co.uk they both register fine, but I only really make calls on the 1 account, the other working for incoming but I had never really tested it or indeed ever put credit on it, so this thread alarmed me slightly.
I just found a freephone information line to test on and both calls worked fine, I logged into both my sipgate accounts and they both show as having made a call each to the number, so no problem here.
The only niggle I have is one I noticed before, the FreePBX CDR shows both calls as having taken place on the same trunk, even though they didn't.
Yea...
I understand multiple SIP trunks for multiple numbers but there is no need for it. I have multiple numbers with Teliax (both local and toll-free) but only a single connection. That is what the DID information is for. The number that was called comes in as the DID on the SIP connection then you do your routing with Inbound Routes. Any ITSP should be able to bind multiple numbers to a single trunk... that is digital phone service 101. I see it the same as ordering 3 PRI circuits because you want three numbers. Nobody does that because of the PRI's ability to handle multiple call appearances. (Up to the B-Channel count) SIP has the same thing... an out-of-band signal channel and multiple audio channels.
Again, the only scenario I can think of would be for billing and I think even then it is really over-complicating things. I was taught a long time ago to stick to the KISS principle and it seems to me that Sean is over-complicating things with multiple trunks.
Jason
This is a multi tenant setup. The clients insist on their own trunks and want to make sure that no other phone uses their trunk or can affect their number or use their number. Incoming is not an issue ( I also agree with the KISS principle) but now and then you have to actually give the client what they want.... so yes this is a billing issue but it surely shouldn't be an issue. If it is a sip protocol design thing then I am surpised as surely I am not the only one trying to do a multi tenant setup. Perhaps someone out there has some advice as to multi tenant setups. Certainly commercial (sales people) tell me their products (epygi, grandstream and some newer but more obscure products) don't suffer from this issue. I am getting one of these more obscure products to test in the next few weeks (got the sales guy to put his money where is mouth is) so I should be able to prove whether their hype is true or not.
Obviously this issue causes me that same billing issue anyway as I can only use one outgoing trunk.... Even if I setup custom contexts to do outbound routing decisions I can't use them with only one working trunk (btw custom contexts seems to break if you install all the additional modules - haven't have the time to find out which one yet.)
Your tenants may insist on separate trunks but is the ITSP billing them directly or is it going to you? I mean a lot of times the clients don't know what they are asking for nor do they have any way of knowing for sure the details behind an implementation. If the client can make and receive calls, and the outbound calls have the correct CID info, then how will the client honestly know if the calls go out on trunk A, B, or C?
I'm not suggesting you lie to them but it would be a lot less complicated for you and a lot more reliable for them if you used the custom contexts module to put the phones in their own contexts and then consolidated on a single trunk. Sometimes the best solution for a customer is to know more than the customer and to implement a solution that is in their best interest (and yours) even if it isn't exactly what they wanted... as long as the end result is the same.
But, have you checked to see if the ITSP supports alternate ports? You can register the three SIP connections to alternate ports (5060, 5061, & 5062) and shouldn't have any problems... other than setting up the internal routing to get specific phones to dial out on specific trunks.
Jason
Ok, I will try the different ports ( any short help on where those get specified per trunk?) - I know I can always google it but though someone could give me a quick pointer. Then the custom contexts would be the next step.
I am south africa and the ITSP is rheid.com, they are very helpful ( I am acting as a reseller so I configure my own trunks - very handy). Also the company is always eager to debug - even on weekends ;-)
Thanks for advice and help thus far.
Sean
In the trunk config you can specify the port with the port= variable. This will set the port for that peer (trunk).
You can use any SIP variables in the trunk config http://www.voip-info.org/wiki-Asterisk+config+sip.conf they are all documented on this page.
I'm still a fairly new newbie and maybe i'm not clear on the issue, but I have no problems with multiple trunks to the same ISP.
I have two SIP trunks from the same provider (both handling multiple phone numbers), using a multi-tenant configuration (we had our own reasons for this configuration).
I have not specified anything for separating the traffic over different ports, and it works completely fine for me after playing with the outbound routes. The only thing i did was separate my outbound routes by dialing rules - my provider requires 1+areacode+number. So i have one route that uses that for dialing rules, and another route that's using 9+1+areacode+number.
Both work completely fine, and use the outbound routes correctly. in the trunk settings i had to pay attention to the logins for each trunk, and in the outbound routes, i had to get the dialing rules correct and select the trunk that i wanted to use for each outbound route, but it did work. Been using it fine now for a couple weeks.
Custom contexts can also be used to control which outbound route each extension uses. I found this: http://aussievoip.com/wiki/freePBX-CustomContexts. haven't tried it myself yet, but it looks like it shold work.
I don't know if this will work for you, but i wanted to share that i had personally had some success with it.
Thanks for the info. please could you post your trunk configs so I can make sure I haven't got something wrong there. Busy testing other distros to see if this might help. Some technical asnwers would really help, instead of "well mine works". Not much use...
My trunks are as follows:
deny=all
host=fqdn.voice.supplier
dtmfmode=rfc2833
username=voip_user
secret=voip_password
type=peer
canreinvite=no
qualify=yes
nat=yes
allow=g729&alaw&ulaw
User Context : voip_user
deny=all
host=dvs01sais.rheid.com
dtmfmode=rfc2833
context=from-trunk
type=peer
canreinvite=no
qualify=yes
nat=yes
allow=g729&ulaw&alaw
The biggest problem you have is you have your deny and disallow mixed up.
Deny works with Permit and form IP based access lists. I doubt that you can do anything with that config. Until you have it working you should not even mess with access lists.
Disallow and Allow work together to form the list of CODEC's that can be used. You start with a disallow=all then and an allow statement with the CODEC's you want to use. ulaw and alaw are mutually exclusive, you use one of the other ulaw is most common for non-compressed CODEC's in the US.
Client needed something that worked without someone messing aroung all the time (my fault here). Got him a Grandstream GXE5024 and all was working in 90 minutes. Good thing is it is easy to support and can be easily maintained and installed by other people which takes the load off of me. Much simpler and and sustainable too. Nowhere near as feature rich but thats life
Thanks for all the help.
Just out of curiosity, what firewall were you using at the site? Some won't allow multiple SIP connections to the same destination IP. For instance, pfSense says the following in its Features page (http://www.pfsense.org/index.php?Itemid=43) :
"... you cannot use multiple phones with a single outside server without using a dedicated public IP per device. The sipproxd package will provide a work around for this issue, and is currently under development."
I've seen the same issue with m0n0wall & newer versions of Mikrotik RouterOS whereby multiple SIP registrations to the same external server never worked reliably without tweaking.
Seriously though, that wasn't the issue (Using Endian) I just replaced the trixbox with a grandstream and used the same IP's for LAN and WAN (didn't want to redo the prot forwarding on the firewall) and it worked out the box (so to speak). Added the three sip trunks, created the outbound and inbound routes, extensions and ring groups. That was it. For those that keeps asking, the reason for this setup (have got a bunch of other trixbox installations in place) was a multi tenant setup. The voice provider doesn't send real DID back (sends the actual login) which complicates things. No such issues when I switched to the commercial product.



Member Since:
2007-11-24