[OpenSIPS-Devel] [OpenSIPS/opensips] 96d97e: tm: Fix transaction leakage with global onreply_route

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


  Branch: refs/heads/3.1
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 96d97eea2ca1e6ce44853ec7cf901e73a0fdf9d2
      https://github.com/OpenSIPS/opensips/commit/96d97eea2ca1e6ce44853ec7cf901e73a0fdf9d2
  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

(cherry picked from commit 3a25c0b28f9bffc5e6942a7a3f5484ef903e28f6)





More information about the Devel mailing list