Multiple Trunked Asterisk Systems - Caller ID Name Problem

We have multiple asterisk servers configured to all trunk back to a central server. There are IAX2 trunks between server A and B, A and C, A and D, etc. Calls to / from server A present caller ID correctly. Our dial plans allow the stacking of location prefixes, so A can act as a hub, allowing B to call C, or C to call D, etc. So, if you dial A’s prefix plus an extension, it rings on A’s server. However, if from B you dial A’s prefix, then C’s prefix, the call rings on C.

The issue is that when calls come from a remote server (B, C, D), through A, to another remote server, the name that shows on the caller ID is the name associated with the extension on the destination server, not the calling server. You can see in the debugs that the “real” caller ID is correct when the call gets to C, but a lookup then takes place on C, and the name is shown as the name of the extension on C.

Is there any way to address this through freePBX, without doing something in the _Custom.conf file(s)?

Thank you for you help,
CDL

not really. You generally need to keep the extension numbers different across servers, otherwise FreePBX doesn’t have any way to differentiate. You will need to avoid using the standard dialout-trunk when dealing with this bridging action

So I would have to customize the user-callerid macro to make this work? In the debugs, when a call reaches the target I see

– Executing [[email protected]:1] NoOp(“IAX2/DET_UserMX-4”, “user-callerid: sourcecallerid”) in new stack

Then later, when it looks up the source extension, it overrides based on the AMPUSER=Source Extension to the local caller id of that extension. Would it be possible to change this macro to always use the source caller id?

In my experience, many larger companies will increase the size of their dial plan so that instead of maybe a 3 digit extension, you have a 4 digit extension. Then routing between PBX’s does not require all these access codes. You simply dial the 4-digit extension and let dial plan routing do what it needs to get to the destination.

So if you have extension 101, 102, 103, etc. Just change them at each site to be something like this:

Site A: Extension 1101
Site B: Extension 2101
Site C: Extension 3101
Site D: Extension 4101

That way, each extension number is unique across the system and you don’t have FreePBX looking up just “101” when the call arrives and replacing with the local data. The dial plan can easily be crafted at each remote is uniquely routed based on first digit(s) of the extension. It also makes it much easier for the users because they no longer have to dial all those trunk access codes to get where they need to go.

I hope this makes sense.