<div dir="ltr">Here you go george , i have raised a issue in Jira see below <div><br></div><div><ol class="gmail-aui-nav gmail-aui-nav-breadcrumbs" style="margin:0px;padding:0px;list-style:none"><li style="margin:0px;padding:0px 10px 0px 0px;list-style:none;float:none;display:inline"><a id="gmail-project-name-val" href="https://issues.asterisk.org/jira/browse/ASTERISK" style="color:rgb(119,51,0);text-decoration-line:none">Asterisk</a></li><li style="margin:0px;padding:0px 10px;list-style:none;float:none;display:inline"><a class="gmail-issue-link" href="https://issues.asterisk.org/jira/browse/ASTERISK-27045" id="gmail-key-val" rel="61672" style="color:rgb(119,51,0);text-decoration-line:none">ASTERISK-27045</a></li></ol><h1 id="gmail-summary-val" class="editable-field gmail-inactive" title="Click to edit" style="padding:2px 30px 2px 5px;font-size:24px;font-weight:normal;line-height:1.25;color:rgb(119,51,0);box-sizing:border-box;border-radius:2.01px;display:inline-block;max-width:100%;vertical-align:top;word-break:break-word"><span style="font-family:Arial,sans-serif;background-color:rgb(245,245,245)">Issue with Parsing Contact Header without Brackets and with additional HeaderParameters seperated with semicolon</span></h1><br></div><div><h1 class="editable-field gmail-inactive" title="Click to edit" style="padding:2px 30px 2px 5px;font-size:24px;font-weight:normal;line-height:1.25;color:rgb(119,51,0);box-sizing:border-box;border-radius:2.01px;display:inline-block;max-width:100%;vertical-align:top;word-break:break-word"><span style="font-family:Arial,sans-serif;background-color:rgb(245,245,245)"><br></span></h1></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 8, 2017 at 5:05 PM, 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>Bala, are you going to open an issue?</div><div><br></div><div class="gmail_extra"><div><div class="h5"><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="m_8181406864958441457h5"><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><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_8181406864958441457m_-3294033201783093933HOEnZb"><font color="#888888"><br>
<br>
<br>
Walter</font></span><div class="m_8181406864958441457m_-3294033201783093933HOEnZb"><div class="m_8181406864958441457m_-3294033201783093933h5"><br></div></div></blockquote></span></div>
</div></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="">-- <br><div class="m_8181406864958441457gmail_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.<wbr>asterisk.org</a><br><div><br></div></div></div>
</span></div></div>
<br>--<br>
______________________________<wbr>______________________________<wbr>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/<wbr>mailman/listinfo/asterisk-dev</a><br></blockquote></div><br></div>