ftocc

Sharing a SIP Trunk with other boxes on the NETWORK

rehmans
Posts: 222
Member Since:
2007-06-24

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 ?

--


huebs73
Posts: 98
Member Since:
2006-09-27
Set up an IAX trunk between them

Then send the calls that you need to go to the other box across that trunk.



rehmans
Posts: 222
Member Since:
2007-06-24
Well, I am looking for SIP

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.

--


rehmans
Posts: 222
Member Since:
2007-06-24
And yeah .... I cannot send

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.

--


SkykingOH
Posts: 3548
Member Since:
2007-12-17
SIP trunks can be "tunneled"

SIP trunks can be "tunneled" across IAX groups.

Step to make this work:

Box: A - server with SIP provider Box B: - server with extensions

  1. Configure trunk group to SIP provider on box A
  2. Place outbound route with "9" access on box A point to SIP trunk in step 1
  3. In box B setup IAX trunk to box A
  4. Setup outbound route "with" 9 access point it to the IAX trunk in step 3
  5. Place Dial Plan in outbound route to eliminate the "double 9" problem
  6. Dial Plan (US): Note substitute local Area Code for this allows 7 digit dialing
  7. 91+NXXXXXX
    9+NXXNXXXXXX
    9+1NXXNXXXXXX
  8. That's it

Now you should be able to dial 9 on box B and use the trunks on box A.

Scott

--

Scott

aka "Skyking"



rehmans
Posts: 222
Member Since:
2007-06-24
Thanks Scott, The idea is

Thanks Scott,

The idea is definitely good. 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 ?

--


SkykingOH
Posts: 3548
Member Since:
2007-12-17
Quote: The only issue is
Quote:
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

--

Scott

aka "Skyking"



rehmans
Posts: 222
Member Since:
2007-06-24
Surely does and let me try

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.

--


SkykingOH
Posts: 3548
Member Since:
2007-12-17
Quote: What is the
Quote:
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

--

Scott

aka "Skyking"



SkykingOH
Posts: 3548
Member Since:
2007-12-17
Quote: What is the
Quote:
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

--

Scott

aka "Skyking"



rehmans
Posts: 222
Member Since:
2007-06-24
So avoiding all

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 ?

--


SkykingOH
Posts: 3548
Member Since:
2007-12-17
Quote: So avoiding all
Quote:
So avoiding all complications, How do I

That would be impossible, there is a certain amount of experimentation.

Quote:
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

--

Scott

aka "Skyking"



bubbapcguy
Posts: 3344
Member Since:
2006-06-02
turning on anonymous

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



rehmans
Posts: 222
Member Since:
2007-06-24
Guys I don't care about the

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

--


SkykingOH
Posts: 3548
Member Since:
2007-12-17
Quote: From Scott, what I
Quote:
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).

Quote:
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.

Quote:
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?

Quote:
I am struggling to see any incoming SIP packets at the moment :).

Why?

Scott

--

Scott

aka "Skyking"



rehmans
Posts: 222
Member Since:
2007-06-24
Hey thanks Scott, Lets try

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 ?

--


SkykingOH
Posts: 3548
Member Since:
2007-12-17
Quote: I am confused whether
Quote:
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.

Quote:
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

--

Scott

aka "Skyking"



rehmans
Posts: 222
Member Since:
2007-06-24
Alright Scott ! That was

Alright Scott ! That was indeed good help.

Now how do I force an incoming call to an outbound trunk ?

I think we may need a custom context here ?

--


SkykingOH
Posts: 3548
Member Since:
2007-12-17
Quote: Now how do I force an
Quote:
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. 1 - Load Astassistant on a PC and set forwarding for the dummy extensions to the remote system
  2. 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

--

Scott

aka "Skyking"



rehmans
Posts: 222
Member Since:
2007-06-24
I agree to you Scott. Yes !

I agree to you Scott. Yes ! we require a custom context here and I am trying to google it out. If not, then call forwarding can be tried.

I am trying to play with FreePBX to achieve this.

Between any good pointers for writing custom contexts ?

--


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.