Hi,
I was trying to make it so that if I dialed 1001 from extension 21000, it would actually dial extension 21001.
I thought that I could put it in the outbound rules under the dial plan and then match which from CallerID 21XXX on the pattern of 1XXX then I would put a 2 in the prepend field so it would actually dial 21001.
It sounded good until I realized that it doesn’t hit the outbound rules when dialing an internal extension.
One of the custom-* or misc-* modules should allow you to do this. Basically, you set up 21000 and point it at a custom dialplan that does the “math” to dial the original extension plus the prefix.
Just trying to simplify extensions and have flexibility on scale on a single server.
Dial 1001, get extension 21001.
Basically, based on where the call is coming from, it would rewrite the actual number being called. I’m looking for the outbound rules and functionality, but with internal extensions. In outbound rules you can get where the call is coming from from CID, and you can strip/prepend digits based on the dial plan.
Create a Custom trunk with a Custom Dial String of Local/$OUTNUM$@from-internal
Set up your Outbound Route as you had originally done, with Route Type of Intra-Company and pointing to your new custom trunk. Make sure that you don’t have a higher priority route that matches 1XXX.
I was excited to get this to work… I created the trunk as you said. I also created the outbound route with intra-company route listed. I even did a simple pattern of a static number, but the /var/log/asterisk/full never catches the pattern and runs the route… I searched for “_ROUTENAME” and it doesn’t come up.
The Outbound Route matches on prefix + match pattern and (if it matches) calls prepend + match pattern. So for this test, the match pattern should be XXX