[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sip] 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: userA@domainLabel.com.
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: gramesh@cdotb.ernet.in
Phone: +91-80-2263399, +91-80-2383951, Fax: +91-80-2263256
=====================================================================
_______________________________________________
Sip mailing list  https://www1.ietf.org/mailman/listinfo/sip
This list is for NEW development of the core SIP Protocol
Use sip-implementors@cs.columbia.edu for questions on current sip
Use sipping@ietf.org for new developments on the application of sip