Hello,

 

Kamailio 4.3:

 

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).

 

1.       First all three clients registers and publish its own status. Below is print from my MySQL database (presentity table)

 

mysql> select id,username,priority,expires,received_time,body from presentity ORDER BY received_time DESC;

| id    | username | priority | expires    | received_time | body                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

| 84481 | 3918     |       40 | 1464340695 |    1464337095 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918&#64;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> |

| 84480 | 3918     |       40 | 1464340687 |    1464337087 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918&#64;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> |

| 84479 | 2025     |       40 | 1464340682 |    1464337082 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:2025&#64;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> |

 

2.       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«.

 

mysql> select id,username,priority,expires,received_time,body from presentity ORDER BY received_time DESC;

| id    | username | priority | expires    | received_time | body                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      

| 84480 | 3918     |       40 | 1464340703 |    1464337103 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918&#64;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> |

| 84481 | 3918     |       40 | 1464340695 |    1464337095 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918&#64;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>                         |

| 84479 | 2025     |       40 | 1464340682 |    1464337082 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:2025&#64;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>                         |

 

3.       After that the second 3918 client publishes his mood »22222«. The status in »Presentity« table is refreshed under the right id=84481. NOTIFY is sent to 2025 with status with mood »22222«.

 

mysql> select id,username,priority,expires,received_time,body from presentity ORDER BY received_time DESC;

| id    | username | priority | expires    | received_time | body                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      

| 84481 | 3918     |       40 | 1464340716 |    1464337116 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918&#64;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>22222</dm:note><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |

| 84480 | 3918     |       40 | 1464340703 |    1464337103 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918&#64;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> |

| 84479 | 2025     |       40 | 1464340682 |    1464337082 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:2025&#64;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>                         |

 

4.       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”!?

 

mysql> select id,username,priority,expires,received_time,body from presentity ORDER BY received_time DESC;

| id    | username | priority | expires    | received_time | body                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      

| 84480 | 3918     |       40 | 1464340729 |    1464337129 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918&#64;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>33333</dm:note><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |

| 84481 | 3918     |       40 | 1464340716 |    1464337116 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:3918&#64;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>22222</dm:note><op:overriding-willingness><opd:basic>open</opd:basic></op:overriding-willingness></dm:person></presence> |

| 84479 | 2025     |       40 | 1464340682 |    1464337082 | <?xml version='1.0' encoding='utf-8' ?><presence entity="sip:2025&#64;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>                         |

 

 

The Wireshark trace is attached.

 

 

Can anyone help. Please? We have a big installation in the Gazprom’s (Rusia) network, where Kamailio is used as a Presence server only.

 

Thanks

 

Ales