From: Victor Seva <vseva@sipwise.com>
Date: Thu, 30 Jul 2020 11:11:52 +0200
Subject: pua: fix send_publish() behavior on PUA_DB_ONLY

* dialog PUBLISH was missing SIP-If-Mach
* pua was inserting a new record for every dialog state

fixes #2414
---
 src/modules/pua/send_publish.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/modules/pua/send_publish.c b/src/modules/pua/send_publish.c
index 1c9d8ed..fc9af79 100644
--- a/src/modules/pua/send_publish.c
+++ b/src/modules/pua/send_publish.c
@@ -516,14 +516,11 @@ int send_publish( publ_info_t* publ )
 
 	if (dbmode==PUA_DB_ONLY)
 	{
-		if (publ->etag) {
-			memset(&dbpres, 0, sizeof(dbpres));
-			dbpres.pres_uri = &pres_uri;
-			dbpres.watcher_uri = &watcher_uri;
-			dbpres.extra_headers = &extra_headers;
-			presentity = get_record_puadb(publ->id, publ->etag,
-						      &dbpres, &res);
-		}
+		memset(&dbpres, 0, sizeof(dbpres));
+		dbpres.pres_uri = &pres_uri;
+		dbpres.watcher_uri = &watcher_uri;
+		dbpres.extra_headers = &extra_headers;
+		presentity = get_record_puadb(publ->id, publ->etag, &dbpres, &res);
 	}
 	else
 	{
