[Asterisk-Dev] escaping @ in extensions ?

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Wed May 25 13:57:08 MST 2005


On Wednesday 25 May 2005 12:34, Luigi Rizzo wrote:
> On Wed, May 25, 2005 at 11:12:25AM -0500, Tilghman Lesher wrote:
> > On Wednesday 25 May 2005 04:08, Luigi Rizzo wrote:
> > > quick question - SIP "addresses" are of the type
> > > 'foo at some.address', but the @ is also used in asterisk to
> > > separate extension and context.
> > >
> > > Do you expect any ill side effect if we use \@ to allow @ in
> > > 'extensions' ?
> >
> > There's no need.  You have only 3 possible syntaxes.  Just parse
> > your arguments right to left, and you'll get the right syntax:
> >
> > SIP/address
> > SIP/foo at address
> > SIP/foo at context@address
>
> perhaps you mean "SIP/foo at address@context" for the latter case ?

No, I don't think so.  That would be inconsistent with the rest of
Asterisk (not that SIP necessarily has any consistency anyway).  I tried
to look where this is parsed, and I'm coming up empty.

> Interesting observation, anyways.
> Too bad the code in chan_alsa.c or chan_oss.c and probably everywhere
> else does the parsing from left to right :(

Labels are parsed right to left, as well:

priority
extension|priority
context|extension|priority

-- 
Tilghman



More information about the asterisk-dev mailing list