Hello dear FreePBX community,
I am in possession of a number trunk with a 100 number block from 00-99, which I can attach to the master number. Now I want to solve the direct dialing to an extension a bit smarter. So far I have created a separate inbound route for each extension. Since this is a bit tedious in the long run, I have seen that I can specify a range for the phone number in the inbound route.
My question: can I use the range to route from 00-99 directly to the corresponding extension? Currently I can specify the range, but I can only select one extension as destination. Or do I have a mistake here?
You can do this from the FreePBX gui with minimal effort. This method will let you select how many digits of the DID number are selected for matching the extension number. In this case, I use the last 3-digits. I have an incoming 11-digit DID number but only want the last 3 digits for my extensions. The target translates the number starting after the 8th digit so I get digits 9 thru 11 which equate to my extension number. The illustration below takes anything coming into the trunk that matches the first 8 digits and extracts the last three to correspond to the extension numbers on the system.
Go to Admin > Custom Destinations.
Create a new Custom Destination so that it looks like this:
@kenn10’s approach is decent, but I would recommend a few changes:
Use caution when sending pstn calls to the from-internal context as a misconfig here could easily have unintended consequences. I would recommend using the previously mentioned from-did-direct as it’s specifically limited to local extensions but still allows FMFM to work.
If your intent is to isolate the final 3 digits, it’s more intuitive to use ${EXTEN:-3}
In freepbx, it’s conventional to use the channel variable FROM_DID to reference the DID for the call. Using EXTEN will only work in very rare cases in FreePBX.
Thanks for the suggestions @lgaetz. We communicated offline and everything is working. I’ve never experienced any issues using the EXTEN variable but we changed it to FROM_DID for his implementation.