MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / no_sort_cb

Function no_sort_cb

modules/drouting/drouting.c:2917–2937  ·  view source on GitHub ↗

preserve the order of the destinations */

Source from the content-addressed store, hash-verified

2915
2916/* preserve the order of the destinations */
2917static void no_sort_cb(void *params)
2918{
2919 struct dr_sort_params *dsp = (struct dr_sort_params *)params;
2920 int i = 0;
2921 unsigned short *sorted_dst = NULL;
2922 int size = 0;
2923 pgw_list_t *pgwl = NULL;
2924 int rc = 0;
2925
2926 rc = get_pgwl_params(dsp, &pgwl, &size, &sorted_dst);
2927 if (rc < 0) {
2928 LM_ERR("failed to sort\n");
2929 dsp->rc = -1;
2930 return;
2931 }
2932
2933 for (i = 0; i < size; i++)
2934 sorted_dst[i] = i;
2935
2936 dsp->rc = 0; /* everything ok */
2937}
2938
2939/* sort based on the weight of the gws */
2940static void weight_based_sort_cb(void *params)

Callers

nothing calls this directly

Calls 1

get_pgwl_paramsFunction · 0.85

Tested by

no test coverage detected