[Asterisk-Dev] escaping @ in extensions ?

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Wed May 25 22:31:53 MST 2005


On Wednesday 25 May 2005 17:10, Luigi Rizzo wrote:
> well, many places parse '@' left to right, e.g.
> chan_alsa.c, chan_oss.c in the "dial foo" command
> pbx.c in function handle_show_dialplan
> apps/app_voicemail.c in all places where it is looking for a
> 'context' channels/chan_iax2.c in iax2_transfer()
> channels/chan_local.c in local_alloc()
> channels/chan_sip.c
> pbx/pbx_config.c
>
> and a few others. In all these cases, i would expect that
> a "context" in which to interpret the string as the last
> thing to appear in the string itself.

I think you're missing the point, in that a context is always
closely associated with an extension, and therefore it always
comes immediately after the extension.  In most cases,
extension at context is the only thing in the string, which is why
context comes last.  However, in the case of a SIP dialstring,
there is something else which comes last, namely the hostname.

Note that IAX2 does this a far more logical way, by putting the
extension at context AFTER the hostname, since that's information
which is interpreted by the remote host, not information which
is needed to connect to the remote host.  It's kind of a principle
of layer separation; I'll further note that SIP is guilty of violation
of layer separation (i.e. embedding port numbers in the application
layer), so it's not too surprising it does other braindead things.

-- 
Tilghman



More information about the asterisk-dev mailing list