[OpenSIPS-Devel] [OpenSIPS/opensips] 0f07cb: qrouting: Rework/Fix bogus gwlist sorting logic

Liviu Chircu noreply at github.com
Fri Feb 14 12:02:46 EST 2020


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 0f07cb0a06b676e643f225b0a0b1a1be9391b2c1
      https://github.com/OpenSIPS/opensips/commit/0f07cb0a06b676e643f225b0a0b1a1be9391b2c1
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2020-02-14 (Fri, 14 Feb 2020)

  Changed paths:
    M modules/qrouting/qr_sort.c
    M modules/qrouting/qr_sort.h
    M modules/qrouting/qr_stats.c
    M modules/qrouting/qr_stats.h
    M modules/qrouting/qrouting.c

  Log Message:
  -----------
  qrouting: Rework/Fix bogus gwlist sorting logic

The sorting logic was incorrect, as the carriers were never actually
sorted within the gwlist array -- their positions were always fixed.
Only groups of gateways in-between these carriers were getting sorted
by their qrouting score.  For example, assuming the numbers represent
qrouting-assigned scores:

this rule gwlist: "4, 2, 1, CR1=0.5, 1, 0" would get sorted as:

"1, 2, 4, CR1=0.5, 0, 1", whereas the correct sort would have been:

"0, CR1=0.5, 1, 1, 2, 4"





More information about the Devel mailing list