[OpenSIPS-Devel] [OpenSIPS/opensips] 8700f6: [tm] t_uac() gets a preferred socket too

Bogdan Andrei IANCU noreply at github.com
Fri Sep 15 07:46:16 UTC 2023


  Branch: refs/heads/3.4
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 8700f69364b8d08605157360f7c124b761fa0699
      https://github.com/OpenSIPS/opensips/commit/8700f69364b8d08605157360f7c124b761fa0699
  Author: Bogdan-Andrei Iancu <bogdan at opensips.org>
  Date:   2023-09-15 (Fri, 15 Sep 2023)

  Changed paths:
    M modules/tm/dlg.h
    M modules/tm/uac.c

  Log Message:
  -----------
  [tm] t_uac() gets a preferred socket too

The function already receives a send_socket (a forced socket) which overrides the protocol given by the destination URI. But are cases were we need a milder approach, like a preffered socket to be used if not conflicting with the protocol given by the RURI.
What we have now:
* send_socket - it is a forced socket, overrides the proto given by RURI, it will be used for sure
* pref_socket - a preferred socket, to be used if no send_socket is given and if there is no conflict with the proto given by RURI (in case of a conflict, the pref_socket is discarded and a new socket is looked up based on the RURI info).

First part fix for #3138

(cherry picked from commit 2824a3818bcb40a980b795aaece69545eb963397)


  Commit: e435d7fc40e39bdb1b5fb03a83356bac47b4179c
      https://github.com/OpenSIPS/opensips/commit/e435d7fc40e39bdb1b5fb03a83356bac47b4179c
  Author: Bogdan-Andrei Iancu <bogdan at opensips.org>
  Date:   2023-09-15 (Fri, 15 Sep 2023)

  Changed paths:
    M modules/b2b_entities/b2be_load.h
    M modules/b2b_entities/client.c
    M modules/b2b_logic/logic.c

  Log Message:
  -----------
  [b2b_entities/logic] use the newly added pref_socket

When creating a new B2B client, avoid using the UAS side incoming socket as a forced socket. By doing that we override the proto given by the UAC RURI (and forcing to use the same proto as the UAS side - of course, unless we do not do a force send socket from script to manually indicate a new socket/proto). Shortly, th dynamic selection of the correct UAC socket is broken.

With this change, we do:
* if the UAS/msg side has a forced socket (from script), we will push it as forced socket to the UAC too (as before this change).
* if there is no forcing, the current UAS/msg incoming socket is passed as "preferred" socket to the UAC - like use it as time as it fits the RURI proto. This helps in preserving (during the whole b2b logic) the same socket when having multiple sockets serving the same protocol.

Fixes #3138

(cherry picked from commit 4244c286e19e85f10f2873e1c4f1deee2661eb50)


Compare: https://github.com/OpenSIPS/opensips/compare/c01ebd575391...e435d7fc40e3



More information about the Devel mailing list