[sr-dev] [kamailio/kamailio] dialog: db and dmq issues in master branch (Issue #3218)

shaneqld notifications at github.com
Tue Aug 16 05:25:11 CEST 2022


### Description

While debugging an issue in Kamailio 5.4, I compiled/installed master to see if the issue persists. However, I immediately ran into multiple issues with dialog in master:

#### Using enable_dmq=1

With dmq enabled, I receive the following log lines which did not appear when running 5.4:

```
CRITICAL: dialog [dlg_timer.c:129]: insert_dlg_timer(): Trying to insert a bogus dlg tl=0x7fa0bc21fc80 tl->next=0x7fa0bbf46ba8 tl->prev=0x7fa0bbf46ba8
CRITICAL: dialog [dlg_dmq.c:314]: dlg_dmq_handle_msg(): Unable to insert dlg timer 0x7fa0bc21fc20 [2687:66928]
```

#### Using database

When using database persistence (sqlite and db_mode=3 (SHUTDOWN)), dialogs are not persisted across restarts (which was working in 5.4). There are no obvious log lines, except when I end the call after restarting Kamailio I receive a "unable to find dialog for BYE" message which would be expected if the dialog did not persist.

### Troubleshooting

- I ran the same configuration using 5.4 and neither issue occurred.
- I attempted to identify the troublesome commit by checking out/compiling older commits based on the commit history of the dialog module, but could only go so far back until builds started failing with `module not found: modules/siprepo`. As such I was not able to identify when the behavior changed.

#### Reproduction

DMQ issue: Use dialog module with dmq enabled and start a call that has `dlg_manage();` in the path. My configuration has the following settings:

```
modparam("dmq", "server_address", SERVER_ADDRESS_DMQ)
modparam("dmq", "notification_address", "redacted")
modparam("dmq", "notification_address", "redacted")
modparam("dmq", "num_workers", 6)
modparam("dialog", "default_timeout", 14520)
modparam("dialog", "profiles_with_value", "group")
modparam("dialog", "enable_dmq", 1)
modparam("dialog", "h_id_start", 0)
modparam("dialog", "h_id_step", 16)
```

DB issue: Use dialog module with db enabled. Start a call that has `dlg_manage();` in the path and keep the call open. Observe `kamcmd dlg.list` shows the dialog. Restart kamailio. Observe `kamcmd dlg.list` no longer lists any dialogs. My configuration has the following additional settings:

```
modparam("dialog", "db_url", "sqlite:////kamailio/kamailio.sqlite")
modparam("dialog", "db_mode", 3)
```

### Additional Information

**Kamailio Version**

```
version: kamailio 5.7.0-dev0 (x86_64/linux) f1dcb6
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, 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_BLOCKLIST, 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: f1dcb6
compiled on 23:18:23 Aug 15 2022 with gcc 8.3.0```
```

**Operating System**

```
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3218
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/3218 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20220815/be3a47e5/attachment.htm>


More information about the sr-dev mailing list