[asterisk-dev] Comments in extensions.conf with 2 dashes behind semicolon not being ignored when parsed?

Russell Bryant russell at digium.com
Wed May 28 16:16:25 CDT 2008


JR Richardson wrote:
> I've been using Asterisk since 2002 and never came across this issue.
> All the reference documents say comments prefixed with semicolon are
> ignored, apparently this is not the case.  And I don't see anywhere
> that comments need to be closed with a semicolon.  None of the example
> comments in the sample files close with semicolon.
> 
> I'm wondering if this behavior can be corrected?  This behavior
> appears in 1.2 and 1.6.

IIRC, the other method of comments was added in Asterisk 1.2.

;
; Single line comments
;

;--
   Multi
   Line
   Comment
   Block
--;

I see that this is documented in doc/configuration.txt of Asterisk 1.4:

Comments
--------
All lines that starts with semi-colon ";" is treated as comments
and is not parsed.

The ";--" is a marker for a multi-line comment. Everything after
that marker will be treated as a comment until the end-marker "--;"
is found. Parsing begins directly after the end-marker.
  -------------------------------------------------------------

I suspect that ";-----------" is not treated as the beginning of a multi line 
comment for the sake of backwards compatibility.  Some people like to use that 
to help organize their dialplans:

;------------------------------------
;--- Extensions for ordering pizza
;------------------------------------

[pizza]

exten => 74992,1,AGI(zomgpizza.py)

-- 
Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc.



More information about the asterisk-dev mailing list