ossobv / asterisklint

Asterisk PBX configuration syntax checker
GNU General Public License v3.0
61 stars 12 forks source link

Become aware of eventual syntax changes in Asterisk versions #46

Open JCCyC opened 3 years ago

JCCyC commented 3 years ago

Imagine, if you will, that Asterisk 20 introduces a new, optional syntax to extensions.conf. Now imagine that, by mistake, I put a new-syntax extensions.conf in my Asterisk 18 installation. It is invalid, but asterisklint will flag it as valid. My suggestion is to take an optional argument, saying what Asterisk version we're checking against. This could apply to other subcommands too, not only dialplan-check.

asterisklint dialplan-check -a 18 ~/mystagindir/extensions.conf

Or

asterisklint -a 18 dialplan-check ~/mystagindir/extensions.conf

Could also be an environment variable:

ALINT_ASTVER=18 asterisklint dialplan-check ~/mystagindir/extensions.conf