### Description
If db_mode == 2 (PUA_DB_ONLY) ``SIP-If-Match`` header doesn't exists on dialog event
```
PUBLISH sip:testuser1003@spce.test SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5062;branch=z9hG4bKcc38.e1cf4686000000000000000000000000.0
To: <sip:testuser1003@spce.test>
From: <sip:testuser1003@spce.test>;tag=40bd18ec79e1d8f7e9c3f54805d1ecb3-86dabd12
CSeq: 10 PUBLISH
Call-ID: 200464472a3c6cfc-497(a)127.0.0.1
Content-Length: 709
User-Agent: Sipwise NGCP Proxy 8.X
Max-Forwards: 70
Event: dialog
Expires: 23761
Content-Type: application/dialog-info+xml
```
same escenario but with db_mode == 0
```
PUBLISH sip:testuser1002@spce.test SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5062;branch=z9hG4bK5e55.d35147e4000000000000000000000000.0
To: <sip:testuser1002@spce.test>
From: <sip:testuser1002@spce.test>;tag=40bd18ec79e1d8f7e9c3f54805d1ecb3-84a3a447
CSeq: 10 PUBLISH
Call-ID: 3cce05ee326f011b-24523(a)127.0.0.1
Content-Length: 682
User-Agent: Sipwise NGCP Proxy 8.X
Max-Forwards: 70
Event: dialog
Expires: 23761
SIP-If-Match: a.1596025051.24523.1.0
Content-Type: application/dialog-info+xml
```
#### Log Messages
with db_mode == 0
```
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua_dialoginfo
[dialog_publish.c:406]: dialog_publish_multi(): CALLING dialog_publish for URI
sip:testuser1002@spce.test
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua_dialoginfo
[dialog_publish.c:255]: build_dialoginfo(): new_body:#012<?xml
version="1.0"?>#012<dialog-info
xmlns="urn:ietf:params:xml:ns:dialog-info" version="0"
state="full" entity="sip:testuser1002@spce.test">#012 <dialog
id="NGCP%invite_shared_line%///1-26774(a)127.126.0.1"
call-id="NGCP%invite_shared_line%///1-26774(a)127.126.0.1"
local-tag="26774SIPpTag001"
remote-tag="51E6E31F-5F2168FA000B8FF4-430B7700"
direction="initiator">#012 <state>early</state>#012
<remote>#012 <identity>sip:testuser1003@spce.test</identity>#012
<target uri="sip:127.0.0.1:5085;transport=udp"/>#012
</remote>#012 <local>#012
<identity>sip:testuser1002@spce.test</identity>#012 <target
uri="sip:testuser1002@127.126.0.1:51602"/>#012 </local>#012
</dialog>#012</dialog-info>#012
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua_dialoginfo
[dialog_publish.c:315]: dialog_publish(): publish uri= sip:testuser1002@spce.test
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua_dialoginfo
[dialog_publish.c:50]: print_publ(): publ:
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua_dialoginfo
[dialog_publish.c:51]: print_publ(): uri= sip:testuser1002@spce.test
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua_dialoginfo
[dialog_publish.c:52]: print_publ(): id=
DIALOG_PUBLISH.NGCP%invite_shared_line%///1-26774(a)127.126.0.1
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua_dialoginfo
[dialog_publish.c:53]: print_publ(): expires= 23760
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua [send_publish.c:498]:
send_publish(): pres_uri=sip:testuser1002@spce.test
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua [hash.c:132]: search_htable():
core_hash= 322
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua [hash.c:174]: search_htable():
no etag restriction
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua [hash.c:183]: search_htable():
found record
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua [send_publish.c:587]:
send_publish(): record found
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua [send_publish.c:673]:
send_publish(): etag:a.1596025051.24523.1.0
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua [send_publish.c:106]:
publ_build_hdr(): UPDATE_TYPE [etag]= a.1596025051.24523.1.0
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua [send_publish.c:683]:
send_publish(): publ->pres_uri:#012sip:testuser1002@spce.test#012
Jul 29 14:18:03 sp1 proxy[24523]: DEBUG: <null> pua [send_publish.c:684]:
send_publish(): str_hdr:#012Max-Forwards: 70#015#012Event: dialog#015#012Expires:
23761#015#012SIP-If-Match: a.1596025051.24523.1.0#015#012Content-Type:
application/dialog-info+xml#015#012 130#012
```
with db_mode == 2
```
Jul 29 14:03:47 sp1 proxy[5714]: DEBUG: <null> pua_dialoginfo
[dialog_publish.c:406]: dialog_publish_multi(): CALLING dialog_publish for URI
sip:testuser1002@spce.test
Jul 29 14:03:47 sp1 proxy[5714]: DEBUG: <null> pua_dialoginfo
[dialog_publish.c:255]: build_dialoginfo(): new_body:#012<?xml
version="1.0"?>#012<dialog-info
xmlns="urn:ietf:params:xml:ns:dialog-info" version="0"
state="full" entity="sip:testuser1002@spce.test">#012 <dialog
id="NGCP%invite_shared_line%///1-8362(a)127.126.0.1"
call-id="NGCP%invite_shared_line%///1-8362(a)127.126.0.1"
local-tag="8362SIPpTag001"
remote-tag="18DEC3EE-5F2165A30000D6FF-42FB6700"
direction="initiator">#012 <state>early</state>#012
<remote>#012 <identity>sip:testuser1003@spce.test</identity>#012
<target uri="sip:127.0.0.1:5085;transport=udp"/>#012
</remote>#012 <local>#012
<identity>sip:testuser1002@spce.test</identity>#012 <target
uri="sip:testuser1002@127.126.0.1:51602"/>#012 </local>#012
</dialog>#012</dialog-info>#012
Jul 29 14:03:47 sp1 proxy[5714]: DEBUG: <null> pua_dialoginfo
[dialog_publish.c:315]: dialog_publish(): publish uri= sip:testuser1002@spce.test
Jul 29 14:03:47 sp1 proxy[5714]: DEBUG: <null> pua_dialoginfo [dialog_publish.c:50]:
print_publ(): publ:
Jul 29 14:03:47 sp1 proxy[5714]: DEBUG: <null> pua_dialoginfo [dialog_publish.c:51]:
print_publ(): uri= sip:testuser1002@spce.test
Jul 29 14:03:47 sp1 proxy[5714]: DEBUG: <null> pua_dialoginfo [dialog_publish.c:52]:
print_publ(): id= DIALOG_PUBLISH.NGCP%invite_shared_line%///1-8362(a)127.126.0.1
Jul 29 14:03:47 sp1 proxy[5714]: DEBUG: <null> pua_dialoginfo [dialog_publish.c:53]:
print_publ(): expires= 23760
Jul 29 14:03:47 sp1 proxy[5714]: DEBUG: <null> pua [send_publish.c:498]:
send_publish(): pres_uri=sip:testuser1002@spce.test
Jul 29 14:03:47 sp1 proxy[5714]: DEBUG: <null> pua [send_publish.c:564]:
send_publish(): insert type
Jul 29 14:03:47 sp1 proxy[5714]: DEBUG: <null> pua [send_publish.c:568]:
send_publish(): UPDATE_TYPE and no record found
Jul 29 14:03:47 sp1 proxy[5714]: DEBUG: <null> pua [send_publish.c:683]:
send_publish(): publ->pres_uri:#012sip:testuser1002@spce.test#012
Jul 29 14:03:47 sp1 proxy[5714]: DEBUG: <null> pua [send_publish.c:684]:
send_publish(): str_hdr:#012Max-Forwards: 70#015#012Event: dialog#015#012Expires:
23761#015#012Content-Type: application/dialog-info+xml#015#012 92#012
```
### Possible Solutions
I think the problem here is that on db_mode == 2 pua never search for the pua record if no
etag is set
change introduced at
https://github.com/kamailio/kamailio/commit/6822ff45e931ad3e93b22ebf7d1beb3…
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
This is Sipwise's kamailio version based on 5.3.5
```
version: kamailio 5.3.5 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST,
NO_SIG_DEBUG, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC,
DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER,
USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535,
DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 8.3.0
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2414