[OpenSIPS-Devel] [OpenSIPS/opensips] 3a25c0: tm: Fix transaction leakage with global onreply_route

Liviu Chircu noreply at github.com
Wed Nov 11 16:05:20 EST 2020


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 3a25c0b28f9bffc5e6942a7a3f5484ef903e28f6
      https://github.com/OpenSIPS/opensips/commit/3a25c0b28f9bffc5e6942a7a3f5484ef903e28f6
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2020-11-11 (Wed, 11 Nov 2020)

  Changed paths:
    M modules/tm/tm.c

  Log Message:
  -----------
  tm: Fix transaction leakage with global onreply_route

Given that the opensips.cfg execution order for replies is:
    1) onreply_route (global)
    2) reply_received(), i.e. "tm" module scope
      2.1) onreply_route (branch)
      2.2) onreply_route (transaction)

... this patch fixes some transaction leaks where if the script developer
matches the current transaction within global onreply_route, e.g. with a
random statement such as xlog("$T_reply_code\n"), it would cause an
extra ref after a transaction matching operation would be performed yet
again (??) within reply_received(), as the "tm" scope begins executing.

The fix is to simply avoid transaction lookups when evaluating tm
variables within the non-transactional, global SIP reply route.

Credits to Bogdan-Andrei Iancu for suggesting this solution





More information about the Devel mailing list