What's the preferred way to set CallerID depending on outbound route?

I need to be able to define an extensions outbound caller ID dependant on whic outbound route they use. Basically one will show the user specific name, the other will show the department/group.

I munge it the other way, not sure if solution would be similar. For inbound, i set a few this way:

exten => _X./1112223333,1,Set(CALLERID(name)=NewNameHere)
exten =>  _.,1,NoOp(Entering user defined context from-pstn-preprocess in extensions_custom.conf)          ; Catch all other cases
exten =>  _.,n,goto(from-pstn,${EXTEN},1)

You can include a name in the Route CID e.g. “John Doe” <14162345678> and set Override Extension. With proper trunk configuration, that name will be sent to the VoSP. However, in most countries (Canada is an exception) it won’t do you any good, because the receiving party’s carrier will look up the name in a database. In the US, for example, you will need to send a different number for the department, and set “CNAM storage” with the desired name on your provider’s portal.

In addition, most mobile phones will use the name from local Contacts, if the calling number matches one, overriding any name you or the carrier sends.

1 Like

I’m not completely clear on this. I have two outbound trunks, one to provider and one to another on-site old analog PBX. I can only define one CID (Outbound CID) per extension. For each extension I need two defined CID.

Most of the CID I send to my provider is what get’s displayed. I’m working with them now to find out how all of those lines are defined.

Unless I’m completely missing something obvious here :slight_smile:

What @Stewart1is telling you is the only thing you can guarantee that will go through the PSTN is the CID number. Nothing else you set on your side matters. You can set a CID name to send, but you need to have little expectation of it reaching the other side.

Please be more specific:
If each extension has a unique personal number and a shared department number:

Ext. 101 can send A or D
Ext. 102 can send B or D
Ext. 103 can send C or D
then set Outbound CID to A, B, and C, and set the ‘department’ Outbound Route with Route CID set to D.

If each extension also has its own department number:
Ext. 101 can send A or D
Ext. 102 can send B or E
Ext. 103 can send C or F
then if you have only a few extensions, set up a separate department route for each.

If you have many extensions, each with two unique numbers, you’ll need to write a dial plan hook for that.

Understood. The FreePBX box is routing to a Vega gateway which routes it to an old analog PBX I own. It comes into that system as if it’s coming from the provider, it should show whatever I send it.

There would be cases with different department external numbers, so the ‘D,E,F’ example plan would be needed. Are you suggesting I would have to setup multiple routes?

I don’t mind creating multiple entries in extensions_custom.conf, I just need some examples to go by. Or at least get pointed to the right docs.

Ok, so you are correct in what you are trying to set up. But I never tried testing CID name output from a Vega to another system like this.

I think you need to be much more specific on when the various CID are to be used.

101 dials what and shows what CID under what circumstance.
102 dials what and shows what CID under what circumstance.

The Vega pretty much just decides where the call goes, it’s configured to send CID if it gets it.

I have 2 outgoing routes that along with dial plans on the Vega send certain 3 digit destinations to the legacy PBX and most other 7 or 10 digit numbers out to the provider. All of the call routing works fine. it’s just the CID I need to tweak.

So for example, I have it set that when extension 101 dials 501, that matches the outgoing route that sends it to the Vega. The Vega knows that if it gets a 5xx call coming in from the FreePBX to route it to the legacy PBX. The legacy PBX sees that 501 as a DID coming in from the provider and will route that to the corresponding extension on the legacy PBX, along with whatever caller ID is sent.

For 7/10 digit calls they will use a differently defined outbound route that still goes to the Vega that will route it to the provider.

Both routes have “Route CID” undefined and “Override extension” set to “no”. All extensions have “Outbound CID” set to something like ‘“name” <1112223333>’.

Currently some outbound (to provider) calls get their CID overwritten from the provider, some don’t. I’m working with the provider on that issue. In the meantime I have set the extension defined CID to the least specific CID (like department name and external group number) so that there isn’t any data leakage of user names to external calls routed through my provider.

…and that’s why I would like to have a seperate CID for each extension depending on which outbound route gets used. I thought there might be a way to define in the dial plan to use defined CID if destination outbound route is “Legacy PBX”, else set CID to “FOO” if outbound route is provider.

Please explain the overall setup better. Normally, the 5xx route would be marked Intra-Company, so those calls would send the extension’s Display Name and extension number as caller ID. External calls (using routes not marked Intra-Company) would send the Outbound CID name and number. If that won’t work for your system, provide details.

I’m not sure what other details you want or need. The route used is marked intra-company, but I’ve tried changing that. With intra-company, the analog phone attached to the legacy PBX only shows the internal extension. When I look at the logs on the Vega I only see a reference to the DID that’s being dialed (dest=NAME:501,TEL:501). I either don’t have the correct debug cmmand entered, or it’s getting that internal extension some other way.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.