Trunking two together

Okay I know theres plenty of info out there on linking two pbx servers together. My issue is the ones I find assume that PBX A are using extensions 5xx and PBX B is using extensions 6XX for example. What if I want a trunk where both PBX servers are using the same extensions but I want the trunk to act like its coming in from an outside phoneline. I give PBX A a specific number that you call from PBX B and get an IVR which lets you dial the extensions on PBX A and then get them… or even better you can just dial say 4+extension to dial it direct without needing to reach the IVR. I have a similar setup right now between my main PBX and another PBX running on the hamshack hotline and I know how to configure my side but I have no idea how the other side is configured. This would be helpful to me as I am running two PBX servers that I would like to have the ability to call eachother without having to change everyones extension numbers on one of the systems.

If you trunk two servers together and leave the context on both as “from-pstn” or “from-trunk” (they are the same) then it will act like an external/provider trunk.

You would then setup Inbound and Outbound Routes to deliver calls over the trunk.

https://wiki.freepbx.org/pages/viewpage.action?pageId=4161588

I follow these instructions and then dial the extension and I just get all circuits are busy now. Watching the log on system B system A never even touched system B. Same the other direction as well.

https://wiki.freepbx.org/display/SUP/Providing+Great+Debug
Capture a log of the failed call.

Which channel driver? With the, deprecated, chan_sip driver, making the extensions type=friend, which is often done on the basis of a misunderstanding, can cause calls on a tie trunk to be matched against the local extensions with the same name, but with the wrong password.

There are some cases where type=friend is necessary, but they are relatively unusual, and, normally, type=peer should be used, exclusively.

I figured it out. Now they are calling eachother just fine. Now I have one more question. Both servers have different users using the same extension numbers. Is it possible to get the caller ID to pass correctly? Right now when user A calls a user on server B from an extension that is the same as another user already on server B the number shows correctly but the system uses the caller ID from server B instead of A.

Server A extension 1002 calls user 1000 on server B

Caller ID shows the call is coming from caller 1002 on server B instead of caller on Server A from 1002.
Just incase my above text got confusing… sometimes it’s hard for me to even keep track of it… lol

For a number of reasons it is best to use different extension numbers on different boxes (1000-2000 on box A, 2001-3000 on box b, etc.)