<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:974874755;
        mso-list-type:hybrid;
        mso-list-template-ids:-856103832 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hello,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> We noticed an issue with a bunch of stale entries in the mysql location table recently – all for the same user. It turns out that if you install linphone 2.0.2 on an iOS device (other versions/platforms might also be affected) with the transport mode set to TCP and the ‘Push Notification’ feature enabled, the client generates <u>very</u> long contact (258+ character) headers. The contact column in the location table is varchar(255), anything longer than this automatically gets truncated upon insert. When the entry later expires and usrloc tries to remove it, it generates a delete query that matches on the <u>entire</u> contact value and not the truncated version. This causes the delete query to fail and the usrloc record gets left behind in the location table.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The (truncated) contact header value from the database:<o:p></o:p></p><p class=MsoNormal><span style='font-size:8.0pt'>sip:22448462@98.248.37.244:52008;transport=tcp;app-id=org.linphone.phone.prod;pn-type=apple;pn-tok=AA31DC9642E76E7D7DA8A0E419B210E1A00E8DF43A7A77C8CD2955291E1BAC85;pn-msg-str=IM_MSG;pn-call-str=IC_MSG;pn-call-snd=ring.caf;pn-msg-snd=msg.caf;line=<span style='color:red'>932257155</span><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The failed delete query:. <o:p></o:p></p><p class=MsoNormal><span style='font-size:8.0pt'>delete from location where username='XXXXXXXX' AND contact='sip:XXXXXXXX@11.22.333. 44:52000;transport=tcp;app-id=org.linphone.phone.prod;pn-type=apple;pn-tok=AA31DC9642E76E7D7DA8A0E419B210E1A00E8DF43A7A77C8CD2955291E1BAC85;pn-msg-str=IM_MSG;pn-call-str=IC_MSG;pn-call-snd=ring.caf;pn-msg-snd=msg.caf;line=<span style='color:red'>932257155<u>f64767</u>' </span>AND callid='1962857815';<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>What do you all think the best solution here is? My intuition is to simply increase the size of this column. If this is the right approach then it probably also makes sense to update the .sql file for new installs. Thoughts?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thank you,<o:p></o:p></p><p class=MsoNormal>Ross<o:p></o:p></p></div></body></html>