Skip to content

[BUG] dialog:dlg_onreq_out: wrongfully increasing callee_leg #3954

Description

@FlyingDutchfrog

OpenSIPS version you are running

version: opensips 3.6.7 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, F_PARALLEL_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: 6c392ee7c0
main.c compiled on 11:20:08 Jun 22 2026 with cc 10

Describe the bug

While processing a call with multiple legs this CRITICAL log appears at the end of or immediately after branch_route{}. It doesn't seem to affect the calls themselves, but the log also directly told me to open a ticket here...

To Reproduce

Have a call that opens more than one call leg, usually due to one of the next hops replying with 100 and 480/488, therefore opening a new call leg and trying the next gateway.

Expected behavior

Not wrongfully increasing the callee_leg.

Relevant System Logs

opensips[183721]: Jun 23 09:12:22 [183721] NOTICE::: 6c3ed577-e986-123f-9fa2-a8a159689b8d :: Sending Call from Socket udp:123.456.123.456:5060 with Timeout 1800
opensips[183721]: Jun 23 09:12:22 [183721] CRITICAL:dialog:dlg_onreq_out:
opensips[183721]: >>> wrongfully increasing callee_leg 3/7
opensips[183721]: It seems you have hit a programming bug.
opensips[183721]: Please help us make OpenSIPS better by reporting it at https://github.com/OpenSIPS/opensips/issues

That first NOTICE log is the very last thing happening in branch_route {}

OS/environment information

  • Operating System: Linux 5.10.0-43-cloud-amd64 #1 SMP Debian 5.10.251-5 (2026-05-15) x86_64 GNU/Linux
  • OpenSIPS installation: git clone https://github.com/OpenSIPS/opensips.git --recursive -b 3.6 opensips-3.6, make menuconfig
  • other relevant information: this seems to be the file in question, at line 1579.

Metadata

Metadata

Assignees

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions