In my dialplan , i have an extension for _XXXXXXX (for 7 digit numbers) and an extension for _X. .
Now, if i i dial a 7 digit number , the _X. extension is getting executed instead of _XXXXXXX.
I would like the _XXXXXXX part to get executed in case a 7 digit number is dialed.
Any way to fix this ?
You could try to fix this by putting .X_ first in the dial plan and after this line add _XXXXXXX . Im not sure this will work. Maybe there is a number pattern that you can use to have it fixed. _X. covers everything so there must be option to put some nuance into your dialplan. Check “numbermatching in Asterisk” to get some inspiration for a more detailed dialplan structure.
you have to ensure proper sorting of extensions.
"dialplan show " will give you, what asterisk parsed/sorted.
Asterisk will handle extension matching in order it parsed/sorted the dialplan/context.
To force a certain order of evaluation you have to create different contexts and then another one, including the contexts in the intended order.
e.g.:
[first]
exten => _XXXXXXX,1,blah…