<div dir="ltr"><br><div>Bala, are you going to open an issue?</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 8, 2017 at 7:02 AM, George Joseph <span dir="ltr"><<a href="mailto:gjoseph@digium.com" target="_blank">gjoseph@digium.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>Here's the ABNF:<br>
<br>
Contact = ("Contact" / "m" ) HCOLON<br>
( STAR / (contact-param *(COMMA contact-param)))<br>
contact-param = (name-addr / addr-spec) *(SEMI contact-params)<br>
name-addr = [ display-name ] LAQUOT addr-spec RAQUOT<br>
addr-spec = SIP-URI / SIPS-URI / absoluteURI<br>
display-name = *(token LWS)/ quoted-string<br>
<br></span>
After re-reading I realized that "contact-param" can be EITHER a "name-addr" which includes the display name and DOES require the brackets OR an "addr-spec" which doesn't include the display name and does NOT require the brackets.<br>
</blockquote>
<br>
Yes, those parameters are an indious bunch, because:<br>
<br>
SIP-URI may contain ";uri-parameters" [1], while the contact-params may contain ";contact-params" [2]<br>
<br>
[1] <a href="http://www.tech-invite.com/fo-abnf/tinv-fo-abnf-sipuriup.html#idx" rel="noreferrer" target="_blank">http://www.tech-invite.com/fo-<wbr>abnf/tinv-fo-abnf-sipuriup.htm<wbr>l#idx</a><br>
[2] <a href="http://www.tech-invite.com/fo-abnf/tinv-fo-abnf-sip-h-contact.html#contact-params" rel="noreferrer" target="_blank">http://www.tech-invite.com/fo-<wbr>abnf/tinv-fo-abnf-sip-h-contac<wbr>t.html#contact-params</a><br>
<br>
So this is valid:<br>
<br>
Contact: <<a href="mailto:sip%3Aline1@192.0.2.2" target="_blank">sip:line1@192.0.2.2</a>;transport<wbr>=tcp>;reg-id=1;expires=60<br>
<br>
And so would this be (except, it isn't, read on):<br>
<br>
Contact: <a href="mailto:sip%3Aline1@192.0.2.2" target="_blank">sip:line1@192.0.2.2</a>;transport=<wbr>tcp;reg-id=1;expires=60<br>
<br>
In which case you wouldn't be able to separate the uri-parameters from the contact-params.<br>
<br>
Luckily, there is this in RFC3261, 20.10 "Contact":<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[...] If no "<"<br>
and ">" are present, all parameters after the URI are header<br>
parameters, not URI parameters.<br>
</blockquote>
<br>
and<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Even if the "display-name" is empty, the "name-addr" form MUST be<br>
used if the "addr-spec" contains a comma, semicolon, or question<br>
mark.<br>
</blockquote>
<br>
Without the transport=tcp, it would be valid:<br>
<br>
Contact: <a href="mailto:sip%3Aline1@192.0.2.2" target="_blank">sip:line1@192.0.2.2</a>;reg-id=1;e<wbr>xpires=60<br>
<br>
<br>
So, even though you cannot tell from just the ABNF, the mentioned Contact should be parsed as follows:<br>
<br>
addr-spec = <a href="http://sip:p65549t0000000m112562c591000000@10.196.0.111:5089" rel="noreferrer" target="_blank">sip:p65549t0000000m112562c5910<wbr>00000@10.196.0.111:5089</a><br>
contact-params = ;+g.3gpp.accesstype="cellular"<wbr>;+sip.instance="<urn:gsma:imei<wbr>:3561119000-996900-0>"<br></blockquote><div><br></div><div><br></div></div></div><div>I had to go back and forth between 20.10 and the ABNF a few times but yeah, agreed.</div><span class=""><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hence: the wrongly stored fullcontact is too long, not too short.<span class="m_-3294033201783093933HOEnZb"><font color="#888888"><br>
<br>
<br>
Walter</font></span><div class="m_-3294033201783093933HOEnZb"><div class="m_-3294033201783093933h5"><br></div></div></blockquote></span></div>
</div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span style="font-size:12.8px">George Joseph</span><br style="font-size:12.8px"><span style="font-size:12.8px">Digium, Inc. | Software Developer</span><span style="font-size:12.8px"><br>445 Jan Davis Drive NW - Huntsville, AL 35806 - US<br></span><span style="font-size:12.8px">Check us out at: </span><a href="http://www.digium.com/" rel="noreferrer" style="color:rgb(17,85,204);font-size:12.8px" target="_blank">www.digium.com</a><span style="font-size:12.8px"> & </span><a href="http://www.asterisk.org/" rel="noreferrer" style="color:rgb(17,85,204);font-size:12.8px" target="_blank">www.asterisk.org</a><br><div><br></div></div></div>
</div></div>