[Asterisk-Dev] specification for exten => lines anywhere ?

Luigi Rizzo rizzo at icir.org
Tue May 17 11:24:50 MST 2005


is there a specification anywhere for the acceptable syntax of

	exten => ....

lines in config files ?

I am trying to figure out from the code in pbx/pbx_config.c
but it is tricky. And the current parser does a lot of things
that are not exactly intuitive, such as arbitrarily dropping
text (both whitespace and non-whitespace), not checking
for values out of range, etc. (see description below).

So, is there a specification anywhere that we can include
in a comment in the parser and compare the code against ?

	cheers
	luigi
-----------

CURRENT BEHAVIOUR:

+ I see the basic format is

	extension[/cid], priority, application

+ I see that you can have variables in extension which are evaluated,
  but that does not apply to 'cid'

+ i see that 'priority' can be:
  - a (label_in_parentheses), in which case everything before '('
    is silently ignored;
  - or the keyword 'hint' (case sensitive), no space allowed;
  - the keyword 'next' or 'n' (useful for compiling lists of increasing
    priority) or 'same' or 's' (useful for compiling lists with different
    CID numbers and same priority);
    However, in this case, the 'current' priority is silently inherited
    even if you change extensions;
  - something preceded by a '+', in which case everything before the '+'
    is silently skipped and anything after is interpreted as a number
    by atoi() and added to the 'current' priority, e.g. 100+-50
    gives 'current' - 50, which can cause a clash with PRIORITY_HINT
    or -2 (the initial value) ...

+ i am not sure how the parsing of application is supposed to work!

----------------



More information about the asterisk-dev mailing list