This was discussed on the list earlier. The answer is:
If it matches srvr, then it's srvr.
If it matches reg-name, then it's reg-name.
If it matches both, then it's srvr, since it's the more specific case.
So in your specific examples:
[EMAIL PROTECTED] is "srvr".
domainLabel.com is also "srvr".
If you had something like:
regname@@something::[EMAIL PROTECTED]
however, it would only resolve to "reg-name".
- rob
-----Original Message-----
From: Gade Ramesh [mailto:gramesh@;cdotb.ernet.in]
Sent: Monday, November 11, 2002 2:44 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: [Sip-implementors] Ambiguity in "absoluteURI" (Cannot resolve
between "srvr" and"reg-name")
Hi,
I'm am trying to implement a SIP parser.
I have an issue here while parsing the Absolute-uri. I am
not able to resolve between "srvr" and "reg-name".
-----------------------------------------------------------------------
*) Absolute uri:
absoluteURI = scheme ":" ( hier-part / opaque-part )
scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
hier-part = ( net-path / abs-path ) [ "?" query ]
net-path = "//" authority [ abs-path ]
abs-path = "/" path-segments
authority = srvr / reg-name
srvr = [ [ userinfo "@" ] hostport ]
reg-name = 1*( unreserved / escaped / "$" / ","
/ ";" / ":" / "@" / "&" / "=" / "+" )
userinfo = ( user / telephone-subscriber )
[ ":" password ] "@"
user = 1*( unreserved / escaped / user-unreserved )
unreserved = alphanum / mark
mark = "-" / "_" / "." / "!" / "~" / "*" / "'" / "(" / ")"
user-unreserved= "&" / "=" / "+" / "$" / "," / ";" / "?" / "/"
password = *( unreserved / escaped /
"&" / "=" / "+" / "$" / "," )
hostport = host [ ":" port ]
host = hostname / IPv4address / IPv6reference
------------------------------------------------------------------------
Here the problem is with "authority". srvr contains "@"
and reg-name can contain multiple "@" characters. How do
I resolve between the 2 non-terminals?
Example 1: [EMAIL PROTECTED]
Example 2: domainLabel.com
"srvr" can contain either "userinfo@hostport" or "hostport".
In hostport, port is optional. Both examples 1 and 2,
according to the grammar, can match with both reg-name
and srvr. How do I decide whether it belongs to reg-name
or srvr?
One possibility is:
-------------------
If token contains multiple "@"s, then it could be resolved
as reg-name. (But then, this aspect is not specified in the
grammar and it is our hack.)
Could somebody kindly help me out with this aspect?
Thanks in advance.
G. Ramesh
Research Engineer, Internet Telephony Group
=====================================================================
C-DOT (Centre for Development of Telematics)
71/1, Sneha Complex, Miller Road, Bangalore - 560052, India
email: [EMAIL PROTECTED]
Phone: +91-80-2263399, +91-80-2383951, Fax: +91-80-2263256
=====================================================================
_______________________________________________
Sip-implementors mailing list
[EMAIL PROTECTED]
http://lists.cs.columbia.edu/mailman/listinfo/sip-implementors
_______________________________________________
Sip-implementors mailing list
[EMAIL PROTECTED]
http://lists.cs.columbia.edu/mailman/listinfo/sip-implementors