[Asterisk-Dev] regular expression behavior

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Tue Nov 22 21:20:19 MST 2005


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.

Note that if you are using the really old syntax, you can't use commas
in your app arguments anyway, since any such commas are seen as a
delimiter that the end of arguments has been reached.

People who are configuring their extensions out of a database already
know that the vertical bar is the argument separator, as RealTime
won't work if you separate your arguments with commas, instead of
vertical bars.

Hopefully that clears up the confusion.

-- 
Tilghman



More information about the asterisk-dev mailing list