Trunk match pattern not working


I have a distro freepbx 5.211.65-6, with a pri to interface a small switch, some extensions and few sip trunks.
Extensions are same range of the switch, in national format

I am trying to use dial match pattern one of the trunks to cut international prefix(first 3 digits) and then pass it through an appropriate inbound route to the switch
But it does not work, the number goes unchanged to the switch, even, it is in the same format as expected to match

please help

thanks in advance

Trunk patterns are only for outbound dialed calls.

thank you very much for your immediate explanation. There some days trying for it!
I thought exactly the opposite of it, as dial match pattern are only in trunks and outbound routes, I thought that those in outbound routes are for outgoing calls and those in trunks are for incoming calls

How can I realize it in different manner ? It is given to me a range of 1000 numbers AAABBBB31000 to 31999 where AAA is 3digit international code, BBBB is a 4digit national code.
I have them distributed in the mentioned pstn small switch and freepbx server
Unfortunately, they are not distinctly subrange distributed, but badly mixed. This is because the subscribers chose by themselves to have the line analog or voip.
The extensions are in national format BBBB31XXX, and calls from SIP trunk are in international format AAABBBB31XXX.
Till now, I passed those calls to pstn switch, which turned back calls in national format that where directed to server. But I am having some call loss in this manner, how can do with freepbx, cut three digits of international code, and then determine that is a extension like the modified number, else send it to pstn(through pri) ?
inbound routes routes have the direction extension, but it obliges to choose one them only

Simplifying the above long description:

  • How can I send to extension eg 444431123, an incoming call with did=AAA444431123 ??
    where AAA is 3 digit international code(without 00).

Yes, I can do it creating an inbound route with did=_AAA444431123. and destination -> extension and choose my existing extension, but it is for this extension,only.

  • Have I to create an inbound route like this for every extension I have ??(I have for now 200 extensions randomly inside a range of 1000: 31000-31999)

*Incoming calls with did like the extension works fine

thanks in advance

If you use that same “pattern” every time, you should be able to do something like this is an inbound route context. You send every call to the context, chop up the DID, and (if you have a matching extension) send the call there, otherwise you drop it onto the ANY/ANY route destination with an ‘unknown’ number…

Yes, dids are of the same pattern, if we cut 3 first digits have the same format as extensions, Can you tell me more detailed how to do that ?It is exactly what I am looking for

1 Like

Not exactly, but the inbound context that has *e164* in it (look in extensions.conf) should give you all the hints you need.