[Asterisk-Dev] regular expression behavior

snacktime snacktime at gmail.com
Tue Nov 22 22:39:58 MST 2005


On 11/22/05, Tilghman Lesher <tilghman at mail.jeffandtilghman.com> wrote:
> On Tuesday 22 November 2005 14:52, snacktime wrote:
> > On 11/22/05, Jared Smith <jaredsmith at jaredsmith.net> wrote:
> > > On Tue, 2005-11-22 at 10:49 -0800, snacktime wrote:
> > > > Not sure if this is a bug or just undocumented behavior.
> > >
> > > Neither.  Asterisk is seeing the comma as a separator between two
> > > arguments that you're passing to the application.  Commas should
> > > always be escaped if you don't want Asterisk to interpret them as
> > > an argument separator.
> > >
> > > > Might be
> > > > useful to document this in README.variables ?
> > >
> > > Yeah, probably wouldn't hurt to make this blatantly obvious.
> >
> > Well I'd say it's not obvious at all, since all the existing
> > documentation I have read leads you to believe that it's command
> > specific, not a rule for all commands.  When some of the commands
> > document the comma as a separator, and other's don't, the only
> > logical conclusion is that the separator only applies to commands
> > where the separator syntax is documented.
>
> The comma is, in fact, not an argument separator at all, but a
> character which is translated into the true argument separator, a
> vertical bar ('|') in certain cases.  If you use the parentheses
> to encapsulate your app arguments in extensions.conf, that is one of
> those cases.  You need to escape your commas in extensions.conf, if
> you are using that syntax, by placing a backslash ('\') before each,
> if you want to prevent those commas from being translated into
> vertical bars.

Ok so not all commands are parsed for argument separators, but the
parser will always convert a comma to a pipe when the grammar calls
for it, and this was one of those cases.  Makes a lot more sense.   I
know about using piples instead of comma's but it didn't even dawn on
me what was really happening.

Chris



More information about the asterisk-dev mailing list