[OpenSIPS-Devel] [OpenSIPS/opensips] 7aca62: uac: Add basic detection for multiple uac_replace_...

Liviu Chircu noreply at github.com
Tue Feb 7 12:40:56 UTC 2023


  Branch: refs/heads/3.3
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 7aca62d7c2cd92d0b3a2f5ce8259bbfa17bfc411
      https://github.com/OpenSIPS/opensips/commit/7aca62d7c2cd92d0b3a2f5ce8259bbfa17bfc411
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2023-02-07 (Tue, 07 Feb 2023)

  Changed paths:
    M modules/uac/replace.c
    M modules/uac/replace.h
    M modules/uac/uac.c

  Log Message:
  -----------
  uac: Add basic detection for multiple uac_replace_xxx() calls

This patch adds a lightweight detection of multiple calls to
uac_replace_from() or uac_replace_to() during the processing of a SIP
request, using an int bitmask stored in the current SIP message context.
Returning an error helps avoid producing a bad SIP From/To header, with
doubled URIs due to doubled lumps, etc.

Still, to compromise between safety and performance, the case where
multiple uac_replace_xxx() get called during a failure_route is not
detected, as this would require extra TMCB_ON_FAILURE callback, which is
a bit of overkill just for the sake of scripting QoL...

Fixes #2720

(cherry picked from commit 3d6a4bb67ce6294449fc4f5d0f386fd207754337)





More information about the Devel mailing list