Multiple DID with base number (GNR)

I have now 100 DID numbers from my voip provider in format 123456xxx (xxx= 400 to 499)
Since pbx extensions numbers are indeed 4XX , is there a way to avoid the use of 100 inbound route and simply strip 123456 from incoming DID and redirect calls at extension number ?

You can create a custom destination like this and set it as the destination for your incoming route:

Your incoming route should look similar to this:

the context ‘from-did-direct’ in extensions.conf was designed to handle that situation.

1 Like

Interesting. How does one use that with 3-digit extensions and how can you get granularity to snip out certain DID’s in the range to route them differently? FreePBX screen shots would be helpful. This question arises from time to time.

Vary the number of digits replace by Xs in the pattern, and the number of digits (-3 in the example) back from the end of ${FROM_DID}. I believe that incoming routes are handled on a best match basis, so full numbers will be preferred over ones ending in Xs. (I think it is outgoing routes that are first match, but for first match, you put the exceptions before the wildcard matches.)

It seems multiple inbound routes to be a more flexible solution in routing to different targets (bulk handler helps in this)
I’m just asking myself if “great” DID numbers (more and more hundreds of routes) would be resources-consuming anyway…

You shouldn’t need to ‘snip out’ anuthing, use the extracted 3 digits as an extension or build an ivr, rg, queue or even a custom destination to match that number

OK. I think I like my method better but to each their own.

If the trunk is sent to [from-did-direct] then normal inbound route processing (from-did) is bypassed and goes straight to the ‘ext-local’ dialplan, it is a very efficient way to process calls and based on the good old Centrex ‘common block’ concept

Use from-pstn in your custom destination. Definitely don’t use from-internal.

Staying in the inbound context for inbound calls is important for a lot of FreePBX features.

1 Like

I certainly never suggested using ’ from-internal’ (actually nobody mentioned that apart from you), If the OP uses ‘from-pstn’ then he will indeed need 100 inbound routes which he reasonably wanted to avoid :wink:
You will have to convince me which FreePBX features would be missed when in the ‘ext-local’ context apart from ‘follow-me’ which is why it is #included in the [from-did-direct] context, ‘ext-local’ is after all a global super-set of where any successfully routed inbound call would end up, If you doubt that, you should try it first maybe or peruse dialplan show @ext-local

Happy cake day @dicko !

1 Like