Trying to understand use of Caller ID field in Outbound Routes

I have kind of a strange issue - I’m running FreePBX 2.7 but want to upgrade to 2.8, however the thing that is stopping me is that quite some time back I installed and started using the old Outbound Route Permissions module to route outgoing calls for different users to different trunks. I thought I read somewhere that this doesn’t work with 2.8 so my idea was to get all my outbound routes converted over by adding /callerid fields, then when it was all working as expected, uninstall the Outbound Route Permissions module and upgrade to 2.8. But, to make a long story short, things didn’t work quite as I expected, so before I go any further I was hoping I could get clarification on a few specific things.

First, in 2.7, you still have to put an underscore in front of a callerid pattern (like NXXNXXXXXX/_2XX ) right?

Second, let’s say I have three users. One has a single extension, we’ll call it 222. Another has a group of extensions, let’s say they are numbered 350-359. And another has a couple of non-consecutively numbered extensions, let’s say 200 and 432. So let’s say each needs an outbound route and trunk of their own. So in each of the outbound routes I would do something like this for each pattern to be matched - I’m using NXXNXXXXXX as a generic example here:

User 1: NXXNXXXXXX/222
User 2: NXXNXXXXXX/_35X
User 3: two patterns to catch the two extensions:
NXXNXXXXXX/200
NXXNXXXXXX/432

My question is, do these have to go in any particular order, and will what I’m doing for user 3 (duplicating patterns but with different extension numbers in the same route) work as expected?

Next, let’s say I had a fourth user that had extension 355. Could I make a route for that user with the pattern:
NXXNXXXXXX/355
And put it above User 2’s pattern and expect it to work? Are there any specific rules to watch out for if more than one route can match a callerid? I’m assuming that if you have a “fallover” route to be used if no callerid match is made, and that omits the callerid field, it should go below all the routes that do contain callerid match patterns, right?

Finally, are there any circumstances under which something other than the extension number might need to be used in that field? I’m not running FreePBX in any non-typical modes, such as “device and user” or whatever it is called.

My reason for asking is because when I started trying to change my routes over, calls started taking some very unexpected routings, I think including routes specifically “banned” to that extension by Outbound Route Permissions. I had only a limited time to try to do this tonight so I just reverted everything back to how it had been, but before I attempt this again I’d like to know if I’m making any bad assumptions on how this should work.

I am pretty sure the bracket syntax will work in 2.7.

I know it works in 2.8 (where you also don’t need the “_” for patterns, it figures that out for you.

Strowger,

your assumptions are correct in your first posting.

The only order that is important is that a route with no CallerID should come after the specific routes.

As far as the affect on these fields with the outbound routes module, I don’t know but it would not surprise me if there was strange behavior. Your best bet is to disable the outbound routes module during testing. Disabling a module does not lose any of its data, it just acts as if the module was not there until you enable it. You need to make sure to “Apply Configuration Changes” after disabling it.

Bottom line, both 2.7 and 2.8 can use the CallerID field to choose specific routes based on the extension calling. The CallerID is the extension number (or user number if running in deviceanduser mode), it is not the outbound callerid, so it behaves as you would like. Once you have it setup in 2.7, it will migrate to 2.8 during the upgrade (and you no longer need the “_” for patterns). You can also use the bracket syntax, for example you could put _34[01234] to include extensions 340, 341, 342, 343 and 344.

I hope this answers your questions.

Thank you Philippe, that answers my questions. I can only try making changes like this in the middle of the night and preferably on a weekend, and since I’ve already pulled one all-nighter this week, it might be next weekend before I’m up to it again. But I will try disabling Outbound Route Permissions next time. Just to clarify, you’re not saying that the bracket syntax won’t work in 2.7, right? Because if that were true, that would be why things weren’t working as expected. I’ll give it another shot real soon. Thanks.

Since all I’ve heard so far is crickets chirping, let me ask a simpler question: Is there anything about the Outbound Route Permissions module that would cause the callerid fields to not work as intended, assuming the extension in question does have permission to access the route containing its matching rule?