[Asterisk-Dev] escaping @ in extensions ?

Luigi Rizzo rizzo at icir.org
Wed May 25 22:49:38 MST 2005


On Thu, May 26, 2005 at 12:31:53AM -0500, Tilghman Lesher wrote:
...
> 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,

fine.
What i don't know is "what is an extension ?"
just [0-9]+ ?
anything that could appear as the first arg.  in an "exten => ..." line ?
anything that makes sense as a destination identifier for a transport
channel ?

I also don't understand "what is a context ?"
something used locally to define how to parse an extension ?
  (e.g. using this or that dialplan)
something else ?

In any case, what I believe is true is that a context is never sent
remotely and always used locally (reading what you say maybe i am
wrong), so interpreting everything after the last '@' as a context,
and everything before as an 'extension' (poossibly subject to further
parsing) seems to simplify things a lot.

In any case 2, all i wanted to do is from a console to be able to
do things such as 'dial Zap/1/1800444555' or 'dial SIP/123 at 4.5.6.7'
and the hack (if it is so) of putting @context last makes this
trivial to achieve without having to define special prefixes in
the dialplan.

	cheers
	luigi

> 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
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev



More information about the asterisk-dev mailing list