<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=iso-8859-2"><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:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
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:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1118333699;
mso-list-type:hybrid;
mso-list-template-ids:-1157985052 69468175 69468185 69468187 69468175 69468185 69468187 69468175 69468185 69468187;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@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:-18.0pt;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@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:-18.0pt;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@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:0cm;}
ul
{margin-bottom:0cm;}
--></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=SL link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hello,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Kamailio 4.3:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I am testing Presence module with more complex scenario. I have 2 SIP clients (presentity) with equal identities (3918) and one watcher (2025). All my clients are Monster 0.9.25. My Kamailio Presence module is configured with “retrieve_order=1” (presentity records are retrieve by priority order). I have situation when wrong status is send to the watcher (2025).<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><b><span lang=EN-US><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'> </span></span></span></b><![endif]><b><span lang=EN-US>First all three clients registers and publish its own status. Below is print from my MySQL database (presentity table)<o:p></o:p></span></b></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>mysql> select id,username,priority,expires,received_time,body from presentity ORDER BY received_time DESC;<o:p></o:p></p><p class=MsoNormal>| id | username | priority | expires | received_time | body <o:p></o:p></p><p class=MsoNormal>| 84481 | 3918 | 40 | 1464340695 | 1464337095 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918@192.168.77.43" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpidf="urn:ietf:params:xml:ns:pidf:rpid" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" xmlns:opd="urn:oma:xml:pde:pidf:ext"><tuple id="com1"><status><basic>open</basic></status><op:willingness><opd:basic>open</opd:basic></op:willingness></tuple><dm:person id="per123"><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |<o:p></o:p></p><p class=MsoNormal>| 84480 | 3918 | 40 | 1464340687 | 1464337087 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918@192.168.77.43" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpidf="urn:ietf:params:xml:ns:pidf:rpid" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" xmlns:opd="urn:oma:xml:pde:pidf:ext"><tuple id="com1"><status><basic>open</basic></status><op:willingness><opd:basic>open</opd:basic></op:willingness></tuple><dm:person id="per123"><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |<o:p></o:p></p><p class=MsoNormal>| 84479 | 2025 | 40 | 1464340682 | 1464337082 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:2025@192.168.77.43" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpidf="urn:ietf:params:xml:ns:pidf:rpid" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" xmlns:opd="urn:oma:xml:pde:pidf:ext"><tuple id="com1"><status><basic>open</basic></status><op:willingness><opd:basic>open</opd:basic></op:willingness></tuple><dm:person id="per123"><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><b><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'> </span></span></b><![endif]><b>Then first 3918 client publishes his mood »11111«. The status in »Presentity« table is refreshed under the id=84480. NOTIFY is sent to 2025 with status with mood »11111«.<o:p></o:p></b></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>mysql> select id,username,priority,expires,received_time,body from presentity ORDER BY received_time DESC;<o:p></o:p></p><p class=MsoNormal>| id | username | priority | expires | received_time | body <o:p></o:p></p><p class=MsoNormal>| <b>84480</b> | 3918 | 40 | 1464340703 | 1464337103 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918@192.168.77.43" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpidf="urn:ietf:params:xml:ns:pidf:rpid" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" xmlns:opd="urn:oma:xml:pde:pidf:ext"><tuple id="com1"><status><basic>open</basic></status><op:willingness><opd:basic>open</opd:basic></op:willingness></tuple><dm:person id="per123"><dm:note><b>11111</b></dm:note><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |<o:p></o:p></p><p class=MsoNormal>| 84481 | 3918 | 40 | 1464340695 | 1464337095 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918@192.168.77.43" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpidf="urn:ietf:params:xml:ns:pidf:rpid" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" xmlns:opd="urn:oma:xml:pde:pidf:ext"><tuple id="com1"><status><basic>open</basic></status><op:willingness><opd:basic>open</opd:basic></op:willingness></tuple><dm:person id="per123"><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |<o:p></o:p></p><p class=MsoNormal>| 84479 | 2025 | 40 | 1464340682 | 1464337082 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:2025@192.168.77.43" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpidf="urn:ietf:params:xml:ns:pidf:rpid" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" xmlns:opd="urn:oma:xml:pde:pidf:ext"><tuple id="com1"><status><basic>open</basic></status><op:willingness><opd:basic>open</opd:basic></op:willingness></tuple><dm:person id="per123"><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><b><span lang=EN-US><span style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'> </span></span></span></b><![endif]><b><span lang=EN-US>After that the second 3918 client publishes his mood »22222«. The status in »Presentity« table is refreshed under the right id=84481. </span>NOTIFY is sent to 2025 with status with mood »22222«.</b><b><span lang=EN-US><o:p></o:p></span></b></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>mysql> select id,username,priority,expires,received_time,body from presentity ORDER BY received_time DESC;<o:p></o:p></p><p class=MsoNormal>| id | username | priority | expires | received_time | body <o:p></o:p></p><p class=MsoNormal>| <b>84481</b> | 3918 | 40 | 1464340716 | 1464337116 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918@192.168.77.43" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpidf="urn:ietf:params:xml:ns:pidf:rpid" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" xmlns:opd="urn:oma:xml:pde:pidf:ext"><tuple id="com1"><status><basic>open</basic></status><op:willingness><opd:basic>open</opd:basic></op:willingness></tuple><dm:person id="per123"><dm:note><b>22222</b></dm:note><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |<o:p></o:p></p><p class=MsoNormal>| 84480 | 3918 | 40 | 1464340703 | 1464337103 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918@192.168.77.43" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpidf="urn:ietf:params:xml:ns:pidf:rpid" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" xmlns:opd="urn:oma:xml:pde:pidf:ext"><tuple id="com1"><status><basic>open</basic></status><op:willingness><opd:basic>open</opd:basic></op:willingness></tuple><dm:person id="per123"><dm:note>11111</dm:note><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |<o:p></o:p></p><p class=MsoNormal>| 84479 | 2025 | 40 | 1464340682 | 1464337082 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:2025@192.168.77.43" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpidf="urn:ietf:params:xml:ns:pidf:rpid" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" xmlns:opd="urn:oma:xml:pde:pidf:ext"><tuple id="com1"><status><basic>open</basic></status><op:willingness><opd:basic>open</opd:basic></op:willingness></tuple><dm:person id="per123"><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><b><span lang=EN-US><span style='mso-list:Ignore'>4.<span style='font:7.0pt "Times New Roman"'> </span></span></span></b><![endif]><b><span lang=EN-US>Then finally, the first 3918 changes his mood to “33333”. The status in »Presentity« table is refreshed under the right id=84480. BUT, to 2025 is sent NOTIFY with mood “22222”. “received_time” timestamp of status with mood “33333” is higher than timestamp of status with mood “22222”. BUT the “id” attribute of “presentity” table of status with mood “33333” is smaller. I think that statuses with equal “priority” are retrieved by “id” and not by “received_time”!?<o:p></o:p></span></b></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>mysql> select id,username,priority,expires,received_time,body from presentity ORDER BY received_time DESC;<o:p></o:p></p><p class=MsoNormal>| id | username | priority | expires | received_time | body <o:p></o:p></p><p class=MsoNormal>| <b>84480</b> | 3918 | 40 | 1464340729 | 1464337129 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918@192.168.77.43" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpidf="urn:ietf:params:xml:ns:pidf:rpid" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" xmlns:opd="urn:oma:xml:pde:pidf:ext"><tuple id="com1"><status><basic>open</basic></status><op:willingness><opd:basic>open</opd:basic></op:willingness></tuple><dm:person id="per123"><dm:note><b>33333</b></dm:note><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |<o:p></o:p></p><p class=MsoNormal>| <b>84481</b> | 3918 | 40 | 1464340716 | 1464337116 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918@192.168.77.43" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpidf="urn:ietf:params:xml:ns:pidf:rpid" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" xmlns:opd="urn:oma:xml:pde:pidf:ext"><tuple id="com1"><status><basic>open</basic></status><op:willingness><opd:basic>open</opd:basic></op:willingness></tuple><dm:person id="per123"><dm:note><b>22222</b></dm:note><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |<o:p></o:p></p><p class=MsoNormal>| 84479 | 2025 | 40 | 1464340682 | 1464337082 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:2025@192.168.77.43" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpidf="urn:ietf:params:xml:ns:pidf:rpid" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" xmlns:opd="urn:oma:xml:pde:pidf:ext"><tuple id="com1"><status><basic>open</basic></status><op:willingness><opd:basic>open</opd:basic></op:willingness></tuple><dm:person id="per123"><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>The Wireshark trace is attached.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Can anyone help. Please? We have a big installation in the Gazprom’s (Rusia) network, where Kamailio is used as a Presence server only.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Thanks<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Ales<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>