I’d like to be able to handle (route) both 10- and 11-digit DIDs, i.e. 800-555-1212 and 1-800-555-1213. I know I can build both DIDs into inbound routes, but I’d like to come up with a better way. For the sake of discussion, you can assume a TN/DID will be one or the other.
So far, the only way I can come up with is to create a trunk from the PBX to itself, and use the Dialed Number Manipulation to strip the 1. Then I can specify an inbound route with a pattern _1XXXXXXXXXX with the self-trunk as the destination.
Since asterisk will match exact DIDs before looking up patterns, all defined 11-digit DIDs will be routed accordingly. If there is no matching 11-digit DID, it would match the pattern, which would strip the 1 and send the call to itself, and then attempt to match the corresponding 10-digit DID.
Is there a better way of approaching this?