Sharing a SIP Trunk with other boxes on the NETWORK
Hi Guys,
I 've been googling this out for quite sometime now but to no avail. Here is what I'd like to know,
We have 2 boxes (A and B) geographically distributed each with its own trunks and extesnions.
I want the extensions on server A to use server B trunk for their outbound dialing. Likewise, I may need my Server B extesnions to use Server A trunks for outbound dialing.
Can anyone assist on this or mention any pointers ?
Well, I am looking for SIP termination. If Server A extensions want to use Server B trunks
What would be the outgoing settings for Server A ?
What would be the incoming settings for Server B ?
Can you paste the most general ones, I'll find rest of the tweaks from the provider.
And yeah .... I cannot send the calls directly.....
The call from server A should land on Server B and then server outbound trunk would be dialed.
Is there a way I can use a custom context ? A call coming in from Server A should be sent to a custom context where the trunk can be dialed.
SIP trunks can be "tunneled" across IAX groups.
Step to make this work:
Box: A - server with SIP provider Box B: - server with extensions
- Configure trunk group to SIP provider on box A
- Place outbound route with "9" access on box A point to SIP trunk in step 1
- In box B setup IAX trunk to box A
- Setup outbound route "with" 9 access point it to the IAX trunk in step 3
- Place Dial Plan in outbound route to eliminate the "double 9" problem
- Dial Plan (US): Note substitute local Area Code for
this allows 7 digit dialing - 91
+NXXXXXX
9+NXXNXXXXXX
9+1NXXNXXXXXX - That's it
Now you should be able to dial 9 on box B and use the trunks on box A.
Scott
The only issue is that Box B server exntensions use SIP phones. Do you think that they'll be able to dial out through an IAX trunk ?
--
Yeah sure it will work.
This is how I setup all of my customers.
There are many advantages to IAX we can go into that another time.
Asterisk can convert (call transcode) between different channel technologies. That is one of theg reat flexibilities of Asterisk. SIP, IAX, MGCP, H.323 and SCCN UA's (endpoints) can all call each other and access trunks of the same or different technology.
As a for instance I have SIP phones at home connected via IAX to my Asterisk server at work. I have no SIP trunks at the house, it is all transparent.
Does this make sense?
Scott
Surely does and let me try this out !
One more thing which might sound dumb but I can't help it. This is the first time I am working with inbound on my Trixbox.
What is the difference between an inbound route and the incoming settings for a trunk (Incoming Trunk) ? Does the inbound route works only for DID matches only?
Someone wants to send me his IP based traffic. What settings do I need so that I can accept his traffic from his gateway and pass the traffic out through my trunks ? I have now confirmed he is not using TB.
I know that in outbound, every outbound route must be pointed to some outbound trunk to place external calls.
What is the difference between an inbound route and the incoming settings for a trunk (Incoming Trunk) ? Does the inbound route works only for DID matches only?
This subject is a bit more complex. Think of inbound routes as routing based on matching the source DID (CLID).
Inbound trunks is authentication of the peer. Authentication can be done by the register method where the peer sends a username and password. Authentication can also be doe by source IP.
What you want to avoid doing is turning on anonymous SIP inbound. If you do you can't place the system with open SIP on an untrusted network (like the Internet).
Scott
What is the difference between an inbound route and the incoming settings for a trunk (Incoming Trunk) ? Does the inbound route works only for DID matches only?
This subject is a bit more complex. Think of inbound routes as routing based on matching the source DID (CLID).
Inbound trunks is authentication of the peer. Authentication can be done by the register method where the peer sends a username and password. Authentication can also be doe by source IP.
What you want to avoid doing is turning on anonymous SIP inbound. If you do you can't place the system with open SIP on an untrusted network (like the Internet).
Scott
So avoiding all complications, How do I
Set my Trixbox to accept my partner's traffic ? He is providing me with the IP only and says that there is no need for username/password.
Do I have to create a trunk with incoming settings below,
host = Partner IP Address
type = peer
canreinvite = no
Once, I start getting his calls from the trunk, how do I route them to the appropriate trunk ?
Do I have to write a custom incoming context such as ?
exten => _NXX,1,dial(SIP/trunkname2/${EXTEN}
something like that ?
So avoiding all complications, How do I
That would be impossible, there is a certain amount of experimentation.
Do I have to create a trunk with incoming settings below,
Maybe, there are also different peer options including friend. You may have to use the insecure variable.
You can always try testing by turning on anonymous SIP and then tightening up the trunk settings.
You will not need a custom context.
Scott
You can always use IPtables to drop all inbound SIP packets
from every IP but the one(s) you wish.
In Freepbx is there not a "inhouse" trunk setting...not where I have access to any Freepbx boxes at this time.
I have this working for two folks who "share" a PRI but it is not setup with a GUI.
all inbound and outbound are ported to the right boxes (no dailing 9 or anything like that as for as I remember).
I used code from John Mullinix (Tb user JMullinix) from his trunking / dailplan code to his IPTables.
http://cohutta.com/npanxx.php
Guys I don't care about the security at all as this is not a production system.
From Scott, what I understand that I cannot accept traffic solely on the basis IP. It needs to be binded with any DID or a username/password. But guys, this is carrier level traffic. I cannot have so many inbound routes in place. Concluding, I think trixbox cannot be used a SIP gateway for terminating carrier level traffic ?
The goal was to accept SIP traffic from his VOIP gateway and terminate it through my trunks.
And yeah Bubba ! I am struggling to see any incoming SIP packets at the moment :). Between has john posted that code here in the forums ? I may want to have a look
From Scott, what I understand that I cannot accept traffic solely on the basis IP.
I never said that! My comment was authenticate on source IP adn then route based on DID (CLID).
But guys, this is carrier level traffic. I cannot have so many inbound routes in place.
What is "carrier level traffic"? What kind of call volume? I think you have Caller ID confused with DID number. You have a route for each DID number that will be called, not from each caller. If they are not actually DID's the carrier can still change the identity to make them look like they are originating from a DID. What kind of SIP gateway is the call originating from? I have interfaced with Broadsoft and Tekelec softswitches plus Sonus, Cisco and Lucent media gateways.
If all else fails you can use a catch all route.
Guys I don't care about the security at all as this is not a production system.
If it is exposed to the Internet turning on Anonymous SIP could expose you to some large usage charges. What type of Internet connection?
I am struggling to see any incoming SIP packets at the moment :).
Why?
Scott
Hey thanks Scott,
Lets try to simplify things, so in order to accept traffic
Task One:
I need to authenticate on Source IP
Get the routing done based on DID.
How do I go about ? Do you want me to create a trunk with incoming only such as
host = Partner IP Address
type = peer
canreinvite = no
I am confused whether to create an inbound route or a trunk to accept his traffic. I have the catch all route enabled though.
Call Volume would be like 3-4 calls at a time.
What I get from you is that by having one DID number only, I can have several incoming calls on that inbound route. Actually, I was under the assumption that with one DID number in your inbound route, you can have only one caller calling at that time.
I can have my partner originate traffic based on DID so that I can have it authenticated.
Task Two :
The second task is that I need to route the incoming call to somewhere. I want it to go through my trunks for termination. I have like 12 trunks from the same provider. How do I route it to my trunks, if one trunk fails, it should go on to the second one.
In the inbound route settings you see only extensions, voicemail, ringgroups etc. How do I get them routed to my trunks ?
What would you have done in FreePBX if you were assigned a similar task ?
I am confused whether to create an inbound route or a trunk to accept his traffic. I have the catch all route enabled though.
Turn on allow anonymous SIP in general config FOR TESTING
That will take the trunk part out of it.
You can now start to play with the routes.
What I get from you is that by having one DID number only, I can have several incoming calls on that inbound route.
As many as the provider will send you.
With anonymous SIP turned on you will be able to trap the info from your provider and see where it is originating from. You can use this data to populate your trunk settings.
Scott
Now how do I force an incoming call to an outbound trunk ?
I think we may need a custom context here ?
You could, that would be the elegant way to do it.
There are easier ways, though they don't scale well.
You can make "dummy extensions" place the DID in the extension DID field.
Then you have many choices but I will list two.
- 1 - Load Astassistant on a PC and set forwarding for the dummy extensions to the remote system
- 2 - Load a FreePBX module called "Feature Panel" and set forwarding for the dummy extensions from the FreePBX GUI
Remember when setting forwarding to first place the outbound route selector digit then the remote extension number.
Scott



Member Since:
2007-06-24