[OpenSIPS-Users] OpenSIPS 3.0.2 - 'IF' statement doesn't evaluating correctly

Igor Pavlov igor.pavlov1987 at gmail.com
Tue Aug 18 16:32:54 EST 2020


Hi all, I have found the strange behavior of evaluating boolean value in
'if' statement. Here is the part of my routing script, it handles the BYE
msg (I removed real logic and left only xlog).

if ($DLG_lifetime < $dlg_val(dialog_min_time)) {
    xlog("L_DBG","[$ci] Dialog lifetime less then dialog_min_time ;
duration: $DLG_lifetime ; $dlg_val(dialog_min_time)");
} else {
    xlog("L_DBG","[$ci] Dialog lifetime greater then dialog_min_time ;
duration: $DLG_lifetime ; $dlg_val(dialog_min_time)");
}

The '$dlg_val(dialog_min_time)' setup during INVITE handling, after
create_dialog().

Under load I see that '$DLG_lifetime < $dlg_val(dialog_min_time)' is not
evaluating correctly. Here is some logs:

opensips[1589]: [56276459-0-1637911800 at 1.1.1.48] BYE from 2.2.2.143:5060,
dialog_min_time: 30, duration: 161, status: 5
opensips[1589]: [56276459-0-1637911800 at 1.1.1.48] Dialog lifetime less then
dialog_min_time ; duration: 161 ; 30

Here is DLG_lifetime = 161 and $dlg_val(dialog_min_time) = 30 (161 < 30 ???)

Another example:

opensips[1590]: [58514636-0-1638386270 at 1.1.1.48] BYE from 1.1.1.50:5060,
dialog_min_time: 15, duration: 1212, status: 5
opensips[1590]: [58514636-0-1638386270 at 1.1.1.48] Dialog lifetime less then
dialog_min_time ; duration: 1212 ; 15

Here is DLG_lifetime = 1212 and $dlg_val(dialog_min_time) = 15 (1212 < 15
???)

My OpenSIPS version is:

version: opensips 3.0.2 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC,
F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
git revision: 3a8f6f137
main.c compiled on 22:11:53 Jul 20 2020 with gcc 8

-- 

Best regards,
Igor Pavlov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200818/2ea35ef6/attachment.html>


More information about the Users mailing list