I'm testing kamailio with a SIP client with presence support, when I get two logins of the same user I insert two different entry in the presentity database. Exists a way to define this? or it is a bug?
This is the problem:
```
/* now we have all the necessary values */ /* fill in the filds of the structure */
presentity= new_presentity(&pres_domain, &pres_user, lexpire, event, &etag, sender); if(presentity== NULL) { LM_ERR("creating presentity structure\n"); goto error; }
/* querry the database and update or insert */ if(update_presentity(msg, presentity, &body, etag_gen, &sent_reply, sphere) <0) { LM_ERR("when updating presentity\n"); goto error; }
```
Is located in the file publish.c
Closed #783.
SIP allows many devices to be connected for same user, each with its own presence state. All have to be stored and presented to the watched by the presence server. To update an existing state, a device has to reuse the same ETag. So if the PUBLISH requests don't have the same ETag, then both have to be stored.
Note also that presence states are refreshed periodically (like registration), so its rather hard to say with one is more relevant at a moment, anyhow, you have the option to retrieve by time or by priority that you can set via xavp, see more at:
* https://www.kamailio.org/docs/modules/stable/modules/presence.html#presence....
In summary, it is not a bug. If you want to discuss more, start a conversation on sr-users@lists.sip-router.org mailing list, we keep this tracker only for bugs or feature requests. If the devices are sharing the same ETag, then reopen this issue and attach (make available for download) the pcap with the SIP traffic. If you need a new feature, open a new item on this tracker with the description of what you want.