I’ve done a lot with FreePBX over the years and I’m probably just missing something obvious here – but is there a pattern-matching character that means something like “0 or 1 digits”? Basically, I sometimes have multiple SIP providers via trunks – Twilio, Flowroute, Telnyx. For Inbound Routes, Twilio does not send a leading 1 for the DID, but FlowRoute does. I’m trying to make a DID pattern-match that works for both and can’t seem to do it.
So, for example, my Inbound Route DID for Twilio might look like this:
_616555XXXX
But if that comes from FlowRoute, it would need to be this:
_1616555XXXX
Can I do something to mean “1 or nothing” for that first digit so that I have one pattern that would match both 6165551111 and 16165551111?
I know that “!” can represent zero characters in some circumstances. Would this work?
The best solution is probably to define custom dialplan that canonicalises the numbers before going to from-pstn. Although it doesn’t cover your specific case, the built-in special context from-pstn-e164-us demonstrates the general principles of how to do this.
Ok, thanks for the info. I think the best solution for me – because I want to keep it simple and very visible in the Inbound Routes list – is to simply add a 2nd Inbound Route for each option. So identical Inbound Routes, but one with and one without the leading 1. Just keeps it cleaner, I think.