Sending a phone number from one box to another

I have two Trixbox servers connected with IAX2 connections. The first box has two phone numbers on it via a SIP trunk. When someone calls the first number, I’d like the phones at the first box to ring and when the second number is called, the second box would ring.

What is happening is that the second number comes into the first box and is sent to the second box. When the second box receives the call, it takes the DID number and starts making a call to that number instead of ringing the phones.

Right now the phone number is in the Outgoing Dial Rules on the first server and on the Incoming Routes on the second server with the DID set.

Besides the IAX2 trunk that is setup, what else needs to happen?

For the first box:
DID2: Inbound Route —> RingGroup, with extensions of second box with the suffix # and the ring scheme you desire.
Set an outbound route with the extensions of second box, going through the trunk that joins both boxes.

And thats it…

The problem is that extensions will be added and removed on the second box constantly and the first box won’t be updated. Isn’t there a way to do with by just setting in inbound route on box two?

How are VoIP providers sending phone numbers to customers like me without setting up extension on their box?

I found this in the Trixbox forum, it might help you:

"Actually, trunk to trunk passthru is not too tough to do. I am using just such a feature to ‘forward’ my companies old lines (still located in the old office) to our new location in a different city. The same methods can be used for several senarios including the one you mention. I have a recorded anouncement hooked into mine, informing the caller of our new numbers before passing the call over to the new office. Trunk recording on the passthru box is also quite easy.

The following is my initial writeup on this topic, previously posted in the old forum:

This took a bit of searching, and a whole lot of expermentation, but here it is, tested out.
Geez this fried my brain…

  1. Set up the AAH box with the PTSN cards (box1) with an IAX2 trunk to the second box(box2) as follows:

Outgoing settings

Trunk name= ToBox2

Peer Details:

Incoming settings
User Context = pbx1



Trunkname= ToBox1



Incoming Settings
User Context = box1

  1. On box1, enter the following at the bottom of extensions_custom.conf

exten => _.,1,Macro(dialout-trunk,6,${EXTEN},)
exten => .,n,Macro(outisbusy,)

  1. Setup box2 with a default inbound route going to and IVR or whatever.

The end result is that any inbound calls to box 1 that are routed to the custom-pass-thru will ring in to box2 as if they were coming directly from the external provider.
One note:
in custom-pass-thru it says:
exten => _.,1,Macro(dialout-trunk,6,${EXTEN},)

The number 6 MUST be changed on your system.
Goto Trunks in FreePBX on box 1
Count down the trunks listed on the right
if your trunk to box 2 is second in the list change the 6 above to a 2, if it is third, change it to a 3, etc…

The method I posted only works when ALL calls coming in on a given trunk are destined for the second AAH system. However, when that it the case, it keeps things simple, no call croups, no forwarding, etc. One potential use of this kind of setup is to set up one box to record calls during passthru. Nothing else going on on the box, just incoming zap calls, recording and back out to the box with all the extensions etc. Another use for it would be to use an asterisk system as a cross connect for an analog phone system to voip trunks.

Greg Keys "