Unified Communications PBX System

Clear all

Loopback Trunk for direct PSTN extension dialing  


Carlos Cambronero
New Member Customer
Joined: 1 year ago
Posts: 4
18/04/2020 12:30 pm  


I have a siptrunk service with 300 numbers to the PSTN with my local provider, when we use analog E1/PRI service we request a service called MDE which send to the PBX just the four last numbers of the public number dialed example:

PSTN number from 2521-1000 to 2521-1299 and the MDS service works to send to the PBX the last 4 digits of the number dialed like if I dial 2521-1001 the PBX receives the dial 1001 which can routed by default directly to the extension 1001 if there's any created. 

With the siptrunk service this MDE service is not availabel and we wllways get into the PBX the full number i.e: +50625211001 and in order to route it to an extension we have to create an inbound rout for each specific PSTNnumber-Extension.

I tried to create a loopback IAX2 trunk on the PBX, when I say loopback I mean a trunk tha registers against the same PBX. For example the PBX IP is and the trunk is created agains the same IP The trunk has the all permissions profile for extensions direct dialing purposes instead of the default trunk permissions at the trunk when created.

I managed to get the trunk created and registered with no issues, and I created an Inbound route +5062521XXXX and and outbound route that sends all the calls that mach the pattern (prefix:+5062521 pattern:XXXX) to the loopback trunk. 

At the console I can see the calls being routed to the loopback trunk with the desired number, so I called +50625211001 and I see at the console the call being routed to the loopback trunk dialing 1001 but the call get hangedup and I see at the console the loopback trunk channel being hanged up insted of ring the extension 1001 which is created, registered and working.


Is this the expected behavior behavior?

Am I configuring something wrong?

Is there any way to achieve the same goal with a different configuration that I may not know?


Thanks in advanced for your help. 

Topic Tags
Developer Admin
Joined: 2 years ago
Posts: 2355
18/04/2020 5:23 pm  

In the inbound routes you may use a method that routes calls directly to the extension, e.g.:


+50625211001 to 1001

+50625211002 to 1002

and so on.

Active Member
Joined: 2 years ago
Posts: 15
19/04/2020 1:03 am  

@ing-joserivera26j thank for your reply,

well, yeah Actually I know that way works, but is very inefficient, I mean I think my workaround was a little creative to avoid the creation of 300 inbound routes,  but unfortunately there’s a missed piece of the puzzle, do you or maybe somebody from the forum know how free PBX works in that same way to achieve this with a loop back trunk? Is something about the protocol itself or asterisk dialplan security?

Does any other way exists in the meantime? Or can we patreon this as a proyectos for a future version of VitalPBX?



This post was modified 3 months ago by cdcambronero

Estimable Member
Joined: 10 months ago
Posts: 102
25/04/2020 5:01 pm  

If I understood correctly, you want to route the 4 digit DIDs you are receiving to the 4 digit extensions, then setup a custom context something like the below and have your wildcard inbound route go to that custom context:


Developer Admin
Joined: 2 years ago
Posts: 2355
28/04/2020 4:49 pm  

In the inbound routes, you can create a DID range to route calls to the assigned extension as shown in the attached picture.