Edited: This can be Possible in dialplans?

Hi!
Is possible to define the dialplan match from a VARIABLE?

Example:
I set the global variable: STATIONS_FORMAT=’_XXX’

Can I create a dialplan something like this?

... exten=>${STATION_FORMAT},1,Answer() exten=>${STATION_FORMAT},n,Dial(SIP/${EXTEN}) ...
??

I made this question because, somethimes we need to configure a client PBX that use extensions with 3 digits, like: 221. But other times we need to setup a configuration that work with extensions with 4 digits, like: 2421.

What can be possibles alternatives to do this? Or… I have to edit the FULL FULL dialplan to make it match the numbers of extensions I want?

It should work. Did you try it?

Doesn’t work. I tried

Variables are not resolved until after the extension and priority have been matched. To do otherwise would prevent efficient searching for the next priority.

If you say what the real goal, is there may be a suitable technique.

Of course, if you aske din the right forum, you might get more answers, and if you used a subject that summarised the question, you might get even more.