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 10.10.15.1 and the trunk is created agains the same IP 10.10.15.1. 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?
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?
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: