Multiple in dial numbers all to different extensions

Hi All,

I am a PBX beginner, I just got a new request from the higher ups in regards to the freepbx system I installed and was wondering if anyone could help me out. I have setup a basic system where incoming calls go to a ring group and some one picks up.

We recently got 25 dial in numbers from our old PRI phone system transferred to our voip account. When it was first discussed only 5 of those numbers were going to be issued and I was going to create 5 trunks and 5 inbound routes to pass those along to the correct extensions. Now I have been asked to assign all 25 to all 25 extensions.

Without creating 25 trunks and 25 inbound routes, what is the easiest way to direct calls from certain numbers from my voip provider to those extensions (each number will go to a different extension)? I tried to get an understanding on context but managed to get very confused as to what they are used for.

Thanks a heap :smile:

You don’t need 25 trunks just 25 inbound routes.

there is a context


that is designed for that in /etc/asterisk/extensions.conf , If you are coming from a PRI then you almost certainly have a consecutive range, and your company still has a concept of a one-to-one mapping of those DID’s to extensions/IVR’s/RG/etc. send such calls to a custom-context that strips ${EXTEN} to the last four/three/seven, whatever, digits, just like the old PRI :-

exten => _323555XXXX,1,Goto(from-did-direct,${EXTEN:-4},1)

obviously adjust that to suite your old PRI trunk’s number of digits sent and what the number is.

This shouldn’t work. ${EXTEN} is really a function, that accesses a field in the channel data structure. I believe it is readonly. Even if it is not, changing it will cause the second priority not to match.

Also, the syntax is wrong: the “:-4” needs to be before the “}”.

In practice, it is easier, in this case, to do everything in the Goto line.

1 Like

Thanks for catching that, I edited to suit.