[asterisk-dev] [Code Review] SIP user fields are crazy. Repeat extension searches if they all fail and semicolons are obfuscating the extension in the uri.
Jonathan Rose
jrose at digium.com
Thu May 12 07:41:24 CDT 2011
I'd be nice if it was that simple, but it really isn't.
This is a legitimate SIP uri:
sip:3585551234567;phone-context=5;tsp=a.b at foo.com;user=phone
In this case, the user field would end up being:
3585551234567;phone-context=5;tsp=a.b
And in order to connect it to an extension like 3585551234567, you currently need to do some semi-creative pattern matching in the dialplan.
And it can be more complex than that though. You can also have something like:
1234;4321;phone-context=5;tsp=a.b
In this case, the first semicolon is just a character in the sip field while the second and third are delimiting user-paramaters.
Currently how you manage this relies entirely on how you decide to deal with it in the dialplan. I don't know for sure there is really anything we can do about it, but
I'm currently thinking of a possible sip.conf way to approach it involving user set strings that are searched and removed from the user field.
----- Original Message -----
From: "Saúl Ibarra Corretgé" <saghul at gmail.com>
To: "Asterisk Developers Mailing List" <asterisk-dev at lists.digium.com>
Sent: Thursday, 12 May, 2011 5:54:25 AM
Subject: Re: [asterisk-dev] [Code Review] SIP user fields are crazy. Repeat extension searches if they all fail and semicolons are obfuscating the extension in the uri.
Hi,
On Thu, May 12, 2011 at 12:22 PM, Olle E. Johansson <oej at edvina.net> wrote:
> Bringing this out to the mailing list:
>
> Username URI options are just options to the username. We use the username as an extension. I don't see any reason why we should send an option into the dialplan within the extension name. It should be a channel variable that you can read if you want to.
>
Are we talking about URI parameters or ";something" in the user part
of the SIP URI? If it's the latter, then they are not parameters and
we should let them be there.
In this SIP URI:
sip:saghul;test at sip2sip.info
The username is saghul;test according to the grammar:
http://www.tech-invite.com/Ti-abnf-sip.html#userinfo
--
/Saúl
http://saghul.net | http://sipdoc.net
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
More information about the asterisk-dev
mailing list