Skip to content

[BUG] OpenSIPS 3.2 set_select_weight() cause the dialog destroyed when return index 0 #3777

@chenyw11

Description

@chenyw11

OpenSIPS 3.2.15

version: opensips 3.2.15 (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: 77f3ca8
main.c compiled on 05:47:11 Nov 12 2025 with gcc 12

I use set_select_weight() to get weight index from a avp. But when the result index is 0, the dialog was destroyed.

...
$avp(sort) = 40;
$avp(sort) = 60;
set_select_weight($avp(sort));
xlog("L_INFO", "+++++++++++ $rc +++++++++++++++++++");
...

Log
index is 1:

Dec  8 18:01:02.157587 opensips[394]: DBG:cfgutils:pv_sel_weight: The interval is 60 - 100
Dec  8 18:01:02.157592 opensips[394]: +++++++++++ 1 +++++++++++++++++++ 

index is 0:

Dec  8 18:01:01.142385 opensips[394]: DBG:cfgutils:pv_sel_weight: The interval is 0 - 60
Dec  8 18:01:01.142392 opensips[394]: DBG:dialog:next_state_dlg: dialog 0x7f8eac235278 changed from state 1 to state 5, due event 1
Dec  8 18:01:01.142396 opensips[394]: DBG:dialog:dlg_onreply: dialog 0x7f8eac235278 failed (negative reply)
Dec  8 18:01:01.142403 opensips[394]: DBG:dialog:destroy_dlg: destroying dialog 0x7f8eac235278
Dec  8 18:01:01.142408 opensips[394]: DBG:dialog:destroy_dlg: dlg expired or not in list - dlg 0x7f8eac235278 [2736:1539084200] with clid '00900139d2ca41d9825eb8407f40af01' and tags '44874e28d6c34da88a0763f1d846fb93' 'NULL'
Dec  8 18:01:01.142414 opensips[394]: DBG:core:destroy_avp_list: destroying list 0x7f8eac236468
Dec  8 18:01:01.142418 opensips[394]: DBG:core:receive_msg: cleaning up
Dec  8 18:01:01.142424 opensips[394]: DBG:core:free_sdp_content: sdp = 0x7f8eec77bca8
Dec  8 18:01:01.142428 opensips[394]: DBG:core:free_sdp_content: sdp = 0x7f8eec77bca8 
Dec  8 18:01:01.142432 opensips[394]: DBG:core:free_sdp_content: session = 0x7f8eec77bcf0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions