[Home]

Summary:ASTERISK-23032: Example Configurations use old '=>' syntax
Reporter:xrobau (xrobau)Labels:
Date Opened:2013-12-18 16:34:23.000-0600Date Closed:2014-01-16 09:14:59.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/Configuration
Versions:12.0.0-beta2 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:The example configuration files in 'configs' still use a lot of => for settings, instead of the modern '='

Some even have an ad-hoc mix of both (eg, asterisk.conf.sample)

Comments:By: xrobau (xrobau) 2013-12-18 16:35:04.773-0600

A quick grep for => results in this list:

adsi.conf.sample
asterisk.conf.sample
ccss.conf.sample
cdr_adaptive_odbc.conf.sample
cdr.conf.sample
cdr_custom.conf.sample
cdr_manager.conf.sample
cdr_mysql.conf.sample
cdr_sqlite3_custom.conf.sample
cel.conf.sample
cel_custom.conf.sample
cel_odbc.conf.sample
cel_sqlite3_custom.conf.sample
chan_dahdi.conf.sample
codecs.conf.sample
dbsep.conf.sample
dundi.conf.sample
enum.conf.sample
extconfig.conf.sample
extensions.ael.sample
extensions.conf.sample
extensions_minivm.conf.sample
features.conf.sample
followme.conf.sample
h323.conf.sample
iax.conf.sample
logger.conf.sample
meetme.conf.sample
mgcp.conf.sample
modules.conf.sample
phone.conf.sample
phoneprov.conf.sample
pjsip_notify.conf.sample
queuerules.conf.sample
queues.conf.sample
res_config_mysql.conf.sample
res_config_sqlite3.conf.sample
res_config_sqlite.conf.sample
res_odbc.conf.sample
res_parking.conf.sample
res_pktccops.conf.sample
say.conf.sample
sip.conf.sample
sip_notify.conf.sample
skinny.conf.sample
smdi.conf.sample
unistim.conf.sample
voicemail.conf.sample


By: Michael L. Young (elguero) 2013-12-18 21:30:04.529-0600

Please take a gander at this: https://wiki.asterisk.org/wiki/display/AST/Objects

The "=>" is not old syntax, from what I can find.  It actually means something.  But, it is also acceptable to use "=" with objects as is pointed out in that documentation link above.

So, I am not sure if I am missing something and why you feel this is "old syntax".  It is actually valid syntax based on what I can find.

By: xrobau (xrobau) 2013-12-18 22:01:32.500-0600

It's reasonably historical, and whilst = and => are equivalent, the idea of using => is 'for an object', is a bit of out date now, isn't it?

What 'objects' are created, apart from dialplan? (This is an honest question, I'm unsure. Possibly voicemail? Does that count as an object?)

This bug report originated from looking at configs/asterisk.conf.sample

[directories](!)
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
... etc ...

[options]
;verbose = 3
;debug = 3
;alwaysfork = yes               ; Same as -F at startup.
... etc ...


Looking at codecs.conf.sample, [speex] and [plc] uses =>, whilst everything else uses =

This is just two files I picked at random.


By: Richard Mudgett (rmudgett) 2013-12-19 13:07:20.897-0600

There is no difference between '=' and '=>'.  They are not treated differently by the parsing code.

By: Michael L. Young (elguero) 2013-12-19 13:38:33.173-0600

Right, I probably wasn't very clear in what I wrote.  According to that wiki page, it would appear that some people prefer to use the '=>' syntax because it means something to that person - not to the code.

I am not against this, just wondering if this should be brought up on the lists first to get a consensus from the community as to whether to remove this from all the sample config files.  Probably would be good to do so since those who use the samples are probably new to Asterisk and would get confused by seeing the mix.

By: Rusty Newton (rnewton) 2013-12-19 18:37:29.981-0600

{quote}
Probably would be good to do so since those who use the samples are probably new to Asterisk and would get confused by seeing the mix.
{quote}

I think this is key.

If it possible to only use either "=" or "=>" throughout all of the files, then I think we should use one or the other, not a mix of both.

If someone can verify that it is safe to use only "=" throughout all of those configuration files, then let's do it.

@Richard , are you certain that "=" is safe throughout all Asterisk configuration?

@xrobau , do you want to throw up the question on the asterisk-dev list?

By: Richard Mudgett (rmudgett) 2013-12-19 20:27:03.132-0600

@Rusty: The code just makes note of which was used. ('=>' or '=')  If the config is ever written back to the config file it knows which one to write out.  Otherwise, I cannot find it used for any other purpose.

By: Matt Jordan (mjordan) 2013-12-19 22:16:16.770-0600

On a somewhat interesting note, the Asterisk wiki implies that there is some difference between '=' and '=>' in some configuration files:

https://wiki.asterisk.org/wiki/display/AST/Configuration+Parser

{quote}
In some files, (e.g. mgcp.conf, dahdi.conf and agents.conf), the syntax is a bit different. In these files the syntax is as follows:

{noformat}
[section]
label1 = value1
label2 = value2
object => name
label3 = value3
label2 = value4
object2 => name2
{noformat}

In this syntax, we create objects with the settings defined above the object creation. Note that settings are inherited from the top, so in the example above object2 has inherited the setting for "label1" from the first object.
{quote}

It does look like this is what {{mgcp.conf}} does. Ew.

By: Rusty Newton (rnewton) 2014-01-16 09:14:33.714-0600

Well.. since this is an improvement and we don't have a patch or anyone volunteering to go fix what is needed yet; I'm going to suspend this until someone can make the '=' usage acceptable for all configuration, or else identify definitely which config files require different syntax so that we don't confuse things further by changing all the config files to use a form which won't work in some.