Appending to the caller ID in outbound route

Hello, all…

I have an outbound route that works fine, but I want to change the caller ID on that route to prepend a number to the calling extension.
I would like to prepend “973” to the actual extension number that is placing the call.
So, if the call is coming from extension 3301, I want the CID to be 9733301
and if call is originated from 3302, the caller ID should be 9733302
and so on…
How can I achieve that in the outbound route, please?

Thanks in advance.

Normally, this would not be an issue. You would set the Outbound CID for extension 3301 to (for example)
"John Doe" <9733301>
and on calls to external numbers, 9733301 would be automatically sent, unless overridden by the Outbound Route or Trunk settings.

If you have an application where this is insufficient e.g. you have blocks of numbers in different cities or countries, please provide details.


Will this change the caller ID for external calls only, or internal calls as well?

What I am trying to achieve is that if ext. 3301 calls 3302 then the CID should still be 3301 as normal. but when calling out an “outbound route” for a specific trunk, I want to append the 973 in this case.

If you want to change CID only on a specific outbound route or trunk, and not affect any other calls, you need your own dialplan using a dialplan hook: Hooking for fun and income

It may be easier to pre-process the CID on the far end as opposed to changing it on the outbound leg.

Just a question out of curiosity, what provider is allowing 7 digit callerid for calls to the PSTN? That’s not really an acceptable CallerID format.


That’s not really a provider.
I am building a network of PBXs over a mesh network using amateur radio.

I will look into that, thank you

1 Like

I don’t understand why you are having trouble. For each FreePBX extension, you can specify an Outbound CID and an Emergency CID.

The rules are:

On an internal call (not using an Outbound Route), the extension number is sent as caller ID.
On a normal outgoing call (using an Outbound Route that is not specially tagged), the Outbound CID is sent.
When calling another PBX in the organization (using an Outbound Route flagged as Intra-Company), the extension number is sent.
On an emergency call (using an Outbound Route flagged as Emergency), the Emergency CID is sent.

1 Like

and in which case of those you mentioned does extension 3301 send out a CID of 9733301 on a specific outbound route and extension 3302 sends a CID of 9733302 on the same route… but not internally or on other routes?

NONE? Exactly. This is my question. None of your genius suggestions help here.

My question is how to prepend a number to the extension CID on a specific route!

You configure extension 3301 with an Outbound CID of 9733301.
You configure extension 3302 with an Outbound CID of 9733302.
When extension 3301 dials a ‘regular’ route, the caller ID sent will be 9733301.
When extension 3301 dials an Intracompany route, the caller ID sent will be 3301.
When extension 3302 dials a ‘regular’ route, the caller ID sent will be 9733302.
When extension 3302 dials an Intracompany route, the caller ID sent will be 3302.

Isn’t this what you’re asking for?

1 Like

The “or on other outbound routes” part is what breaks this.

He flags those as Intra-Company.

If you aren’t happy with the other suggestions made so far, I have one more.

You can build a custom outbound route in extensions_custom.conf, context [from-internal-custom]. There you set up match patterns like you would in an outbound route and manipulate the caller ID like this:

exten => _555NXXNXXX,1,Set(CALLERID(num)=973${CALLERID(num)})

then send the call to the outbound routes and skip the callerid macro (step 1)

exten => _555NXXNXXX,n,Goto(outbound-allroutes,${EXTEN},2)

not tested… good luck!

I really like this approach. thank you :slight_smile:

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