Trunk into Extension?

Joined
Mar 31, 2008
Messages
217
Reaction score
1
I work from home one day a week, and I have a PiaF set up at my house, as well as at our office. Is there a way I can set up a trunk on my home system that will connect to an extension at the office?

In other words, I'd like others at the office to be able to dial an extension (x413 or something) and I set up the incoming routes properly at home so it rings at my office desk in the house.


What ports do I need to forward in the router at the office to accomplish this?

Thanks in advance for the help.
 
Iax

I am doing something similar with a friend, 2 states away, using IAX2.

Basically we have an IAX trunk on each end (peer type=friend, context=from-internal) pointing to eachother's boxes. Then we each have an outbound route (8|.) utilizing the other's trunk. So if he wants to ring my main desk he dials 8200 (where 200 is my local extension).

The coolest part is if all lines are in use on my main VOIP provider it rolls to his box for outbound calls.

Sorry if this is not descriptive enough for you, I mainly google'd to get this to work with some trial-and-error dashed in for good measure.. One of the articles I found helpful is here.

The least of ports you would want open are IAX (4569) and RTP (mine are 10001-20000).
 
SIP and IAX remote extensions with two separate systems

I've done this (after a lot of trial and error) with both SIP and IAX2. Here are the highlights:

SIP METHOD:


Office router: forward ports 5060-5082 and 10000-20000 (all of them UDP only) to your PiaF server. I suggest you create a dynamic dns updater at the office so you can use a name instead of an IP in the config below. For this example, I'll use myoffice.dyndns.org.

Set up a SIP extension at the office with the extension number and secret that you want (for this example, I'll use extension 413 and secret "notverysecurehere"). Make sure NAT is set to YES. For now, don't change anything else. Save and apply.

On your home system, set up a SIP trunk with the following settings:

Trunk Name: worksiptrunk

PEER Details:
canreinvite=no
context=from-trunk
dtmfmode=rfc2833
fromuser=413
host=myoffice.dyndns.org
insecure=very
qualify=yes
secret=notverysecurehere
type=friend
username=413

USER Context: 413

User Details:
host=myoffice.dyndns.org

Register String:
413:[email protected]/413

Create an outbound route that will allow you to call out this trunk. For example, if you want to always dial a 9 before the numbers into the office, make the dial pattern 9|X. for this route, and set the trunk to worksiptrunk.

If you only want to dial internal office numbers, change this pattern accordingly (for example, if all your internal extensions were 3 digits and started with a 4, your dial pattern could be 4XX and only calls with this pattern will match this outbound route).

Create an inbound route named Work Office Line with the following settings:
DID Number: 413
Caller ID Number: (leave this blank)
Set the destination to the extension or ring group that you would like to receive calls. I use a time condition so my home extension won't ring late in the evening.
If you like, you can use the CallerID name prefix to add "Work-" or something in front of the caller ID of calls received through this trunk.

IAX2 METHOD:

I think I actually had more luck doing trunk peering rather than an actual IAX extension, so give this a shot:

On both ends, open up port 4569 (UDP) and point it to the servers. Note on the SIP configuration above, no ports needed to be opened on the "home" system. On this configuration, I've also set up a dynamic DNS name for the home system as well, myhome.dyndns.org.

On the office system, create an IAX2 trunk with the following:

Trunk Name: home-peer

PEER Details:
context=from-internal
host=myhome.dyndns.org
qualify=yes
secret=
notverysecurehere
trunk=yes
type=peer
username=work-user

USER Context: home-user

USER Details:
context=from-internal
host=myhome.dyndns.org
qualify=yes
secret=
notverysecurehere
trunk=yes
type=user

Register String: (leave blank)

On the home system, create an IAX2 trunk with the following:

Trunk Name: work-peer

PEER Details:
username=home-user
type=peer
trunk=yes
secret=
notverysecurehere
qualify=yes
host=myoffice.dyndns.org
context=from-internal

USER Context: work-user

USER Details:
type=user
trunk=yes
secret=
notverysecurehere
qualify=yes
host=
myoffice.dyndns.org
context=from-internal

Register String: (leave blank)

Before you go any further, login to each machine, run asterisk (asterisk -r) and run the command "iax2 show peers" to confirm that the two boxes are talking. If the trunk doesn't show up as OK (with a time delay in milliseconds) then go check the settings before continuing.

On the office system, create a CUSTOM extension (413) with the following dial string (assuming your home office extension is 250):

IAX2/home-peer/250

So now when you dial 413 from the office, your home extension 250 should ring.

Finally, create an outbound route that will allow you to call out this trunk (to the office). For example, if you want to always dial a 9 before the numbers into the office, make the dial pattern 9|X. for this route, and set the trunk to work-peer.

If you only want to dial internal office numbers, change this pattern accordingly (for example, if all your internal extensions were 3 digits and started with a 4, your dial pattern could be 4XX and only calls with this pattern will match this outbound route).

Disclaimer:

Hopefully I've covered everything for each configuration. If not, reply and I'll try to clarify or add whatever might be missing. This configuration is taken from my live, working system, so I know it works (unless I missed something :smile5:).
 
Thanks!

Thanks for the help Jeremy. I used the SIP method you described and it works...mostly. I seem to have one way audio.

When I place a call from home into the office, the person at the office can hear me, but I cannot hear them. When they speak they hear a great deal of echo back at them.

Regular outbound or inbound calls from either location work fine, and since both my home and office are on the same ISP in the same geographic area, we are an average of 19ms apart, so there isn't a lot of latency.

Any ideas?
 
One way audio is usually caused by the firewall not forwarding the correct ports to the * box. Since you have a firewall on both ends, (I presume) you will have fun! But it does work.
 
Hi

It maybe easier to use IAX, No NAT and one way audio problems.

Joe
 

Members online

Forum statistics

Threads
26,686
Messages
174,407
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top