Hello Daniel,

Ok my problem is that there is several entries for the same contact in the presentity table.
Thus kamailio sends a lot of NOTIFY.

For example, i use jitsi software and my sip account is 124@192.168.0.186
Since i added the folowing settings in my kamailio.cfg config file : 

     if(is_method("REGISTER")  ) {
                xlog("L_INFO", "LBO - pua_set_publish() call for  $rm from $fu  (IP:$si:$sp)  \n");
                if(!pua_set_publish())
                    xlog("L_INFO", "LBO - set publish failed\n");
     }

I see at least 2 entries for 124 in the presentity table:

| 1246 | 124      | 192.168.0.186 | presence | a.1450269471.610.326.0  | 1450281200 |    1450281080 | <?xml version="1.0"?>
<presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" xmlns:c="urn:ietf:params:xml:ns:pidf:cipid" entity="124@192.168.0.186">
  <tuple id="0x7f57cfdb9570">
    <status>
      <basic>open</basic>
    </status>
  </tuple>
</presence>
                                                                                                                                                                                                                                                                                                                                                                                                                      |        |        0 |
| 1247 | 124      | 192.168.0.186 | presence | a.1450269471.609.402.0  | 1450281200 |    1450281080 | <?xml version="1.0" encoding="UTF-8" standalone="no"?><presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" entity="sip:124@192.168.0.186"><dm:person id="p4404"><rpid:activities/></dm:person><tuple id="t7423"><status><basic>open</basic></status><contact>sip:124@192.168.0.186</contact><note>Online</note></tuple></presence>    


Is it possible to use pua module only if the sip contact does not provide presence infos?
Best regards
Loic
 

2015-12-16 9:31 GMT+01:00 Daniel-Constantin Mierla <miconda@gmail.com>:
Hello,

the pua_usrloc sends PUBLISH requests via the network. To troubleshoot properly, run kamailio with debug=3 in config and watch the network traffic on all interfaces (loopback as well).

Cheers,
Daniel


On 15/12/15 18:05, Loïc Boissy wrote:
Hello Daniel,
Thank you for your help.

Ok pua_usrloc modules seems good for me.
I try to use it : 
I add these routing in route[REGISTAR]
     if(is_method("REGISTER") && from_uri=="sip:122@192.168.0.186" ) {
                xlog("L_INFO", "LBO - pua_set_publish() call for  $rm from $fu  (IP:$si:$sp)  \n");
                if(!pua_set_publish())
                    xlog("L_INFO", "LBO - set publish failed\n");
     }

When sip122 regsiters to my server (192.168.0.186), i can see it one entry for sip:122 in the pua table and one entry in presentity table.
If i wait for a register period, i can see 2 entries in presentity table (only 1 entry in the pua table).
If i wait for another register period, i can see 3 entries in presentity table (only 1 entry in the pua table)
...

Since the second register period, i can see this error in the log file:
ERROR: pua [send_publish.c:580]: send_publish(): New PUBLISH and no body found- invalid request
ERROR: pua_usrloc [ul_publish.c:326]: ul_publish(): while sending publish for ul event 2
ERROR: pua_usrloc [ul_publish.c:337]: ul_publish(): UPDATE action generated a PUBLISH without body -> invoking INSERT action


Is it normal that pua modules write entries in the presentity table?
Is there an solution to have only one entry per user in the presentity table?

Best regards
Loïc


2015-12-15 15:08 GMT+01:00 Daniel-Constantin Mierla <miconda@gmail.com>:
Hello,

On 15/12/15 14:16, Loïc Boissy wrote:
> Hello,
>
> I use kamailio 4.3.2 with the presence module.
> When the contact is able to manage its presence, No problem for me.
> But when a contact doesn't manage it presence, i would like to know if
> it is possible to generate a sip message (like as a simple presence
> message) with kamailio?
>
> The goal of that is to prevent my watcher when a "simple" contact
> (without presence option) is registered and unregistered on my
> kamailio server.
see pua_usrloc modules -- sounds like what you are looking for.

Cheers,
Daniel

--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
http://miconda.eu


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
http://miconda.eu



--

Loïc BOISSY
R&D software engineer & Project manager
office: +33 (0)4 76 52 53 16
cell: +33 (0)6 81 54 63 19
fax: +33 (0)4 76 52 18 44