Change Caller ID based on destination number

Status
Not open for further replies.

ksstormmedia

New Member
Oct 24, 2021
7
0
1
58
Setup: I have a single Vitelity outbound route. I have several Vitelity DIDs. Asterisk has the ability to rewirte the Caller ID based on the destination phone number. SO when I call a number in 316 area code, for instance, it used my 316 DID as the Caller ID.

I can't seem to duplicate this in FusionPBX. I can get the numbers which are "local" to my DID's easily enough...how can I set up, say, 316722XXXX, 316721XXXX, 316554XXXX and so forth so they display my 316NXXXXXX Caller ID?
 

ad5ou

Active Member
Jun 12, 2018
884
196
43
I'm pretty sure this has been asked before because I still have the example in my test system.
You will need to build custom outbound routes to match dialing 316 area codes before any other "default" outbound routes then modify the dial plan to set your desired caller id number

In the example below, the condition will match any calls starting with +1316xxxxxxx, 1316xxxxxxx, or 316xxxxxxx. Then it sets caller id number to "3165551212". The last entry bridges the call via assigned gateway sending 10 digits. it adds the 316 not captured from the condition, then adds the remaining 7 digits dialed.
1653485744810.png
 

ksstormmedia

New Member
Oct 24, 2021
7
0
1
58
You are correct, I asked this as a multiple routes/trunks question, and I apparently have something wrong from your example above because it didn't work. That's why I'm back. I'll take another go at it in the morning...would it be possible for you to cut/paste rather than screen shot? My best guess is that I'm introducing a typo.

The way it's not working is that the 316 does not get carried through to the dialed number given to the trunk, only the last 7 digits. So the call can't complete.
 

ad5ou

Active Member
Jun 12, 2018
884
196
43
Sure, here's the important parts
Condition: ^\+?1?316(\d{7})$
The parentheses are capturing only the 7 digits after matching the dialed 316 phone number so in the bridge statement at the bottom, you have to add the missing digits back.
sofia/gateway/mygateway/316$1

When routes are normally created, the bridge statement assumes the captured digits are all that is needed, but that isn't always the case.
Your carrier may need you to send 11 digits or other prefixes. When that happens, just edit the statement to add the missing parts ahead of the captured digits.
 

ksstormmedia

New Member
Oct 24, 2021
7
0
1
58
This is working great now, thank you!

One other thing -- is it possible to set an extension to always use a specific outbound route? There is one extension on the system that should not ID as one of the virtual numbers, but as its own number regardless of destination area code.
 
Status
Not open for further replies.