My understanding is that you can only really match based on the start of a dial string. So to achieve your result of 123456, 1234567, 12345617 you could use
123456!
which basically means match anything that is 123456, or that starts with 123456. Unfortunately that also matches things like 12345623423543534.
The other alternative would be to just have multiple patterns for a route (I assume this is for an outbound route). ie
123456
123456X
123456XX
If you were really adventurous you could create a custom dialplan in extensions_custom.conf and set it up to put additional checks within the actual dialplan logic to do further limitations on it… but that’s quite a bit more complicated.
The reason I need this because we need to match outbound numbers to a trunk that are 9-12 digits long (the phone numbers supposed to go out the trunk have a variable length).
I understand there is no wildcard match for a single character, is this correct?
Oh ok, wildcards are supported…
e.g.
X <-any digits 0-9
Z <-any digits 1-9
N <-any digits 2-9
! <-anything, including non-digits
. <-accept anything after, e.g. 123. meaning 123456, 12345…