[asterisk-dev] [svn-commits] tilghman: trunk r76703 - in /trunk: ./ apps/ channels/ funcs/ include/asteris...
Tilghman Lesher
tilghman at mail.jeffandtilghman.com
Mon Jul 23 23:59:15 CDT 2007
On Monday 23 July 2007, Russell Bryant wrote:
> SVN commits to the Digium repositories wrote:
> > Author: tilghman
> > Date: Mon Jul 23 14:51:41 2007
> > New Revision: 76703
> >
> > URL: http://svn.digium.com/view/asterisk?view=rev&rev=76703
> > Log:
> > Merge the dialplan_aesthetics branch. Most of this patch simply converts
> > applications using old methods of parsing arguments to using the standard
> > macros. However, the big change is that the really old way of specifying
> > application and arguments separated by a comma will no longer work (e.g.
> > NoOp,foo|bar). Instead, the way that has been recommended since long
> > before 1.0 will become the only method available (e.g. NoOp(foo,bar).
>
> Due to the size of this change as far as the effects on existing dialplans,
> I would like to see a lot more documentation of these changes, including
> multiple examples of things that used to work and no longer will.
It's mainly about a syntax that hasn't been recommended for a long time:
exten => 123,1,Dial,SIP/123|30|m
instead of:
exten => 123,1,Dial(SIP/123,30,m)
The second form was elected to be used, as it is much more clear in terms
of readability, but it was translated at load time into the old format. The
unfortunate problem with the translation was that you needed to escape
certain characters, sometimes multiple times, in order for things to work
correctly. So, for example:
exten => 123,1,Set(ARRAY(one,two,three)=one\\\,two\\\,three)
This is a simple example which shows the lunacy of needing to escape
characters to get the right behavior. Now, we can simply do:
exten => 123,1,Set(ARRAY(one,two,three)=one,two,three)
and it will work correctly (and arguably is more intuitive of a syntax).
> Furthermore, I would like to see this documentation clearly demonstrate why
> these changes are beneficial and necessary, as it is not very clear to me
> right now.
I think that making the dialplan clearer and less obfuscated was the reason
why this change was beneficial. It is necessary to create even more complex
dialplans on the first try, without needing an obscene amount of escaping.
Interestingly, the vast majority of this change was simply in converting
several of the remaining applications over to using the standard application
parsing macro. If the choice was made to revert it, most of the change would
consist of simply modifying the header file app.h to use the '|' as the
standard delimiter. The only other portion of the change that would need to
be reverted was the amount of escaping I have removed from pbx_config.c.
--
Tilghman
More information about the asterisk-dev
mailing list