Module: kamailio
Branch: master
Commit: f7c41e6602f397987470d4ff8a50b51ff16dd521
URL:
https://github.com/kamailio/kamailio/commit/f7c41e6602f397987470d4ff8a50b51…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-06-06T20:32:36+02:00
dispatcher: prepare oc-based distribution
---
Modified: src/modules/dispatcher/dispatch.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f7c41e6602f397987470d4ff8a50b51…
Patch:
https://github.com/kamailio/kamailio/commit/f7c41e6602f397987470d4ff8a50b51…
---
diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c
index d22188ada1f..8a225f35418 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -409,6 +409,18 @@ int ds_set_attrs(ds_dest_t *dest, str *vattrs)
return 0;
}
+/**
+ *
+ */
+void ds_oc_prepare(ds_dest_t *dp)
+{
+ int i;
+ for(i = 0; i < dp->attrs.ocrate; i++) {
+ dp->ocdist[i] = 1;
+ }
+ shuffle_uint100array(dp->ocdist);
+}
+
/**
*
*/
@@ -562,6 +574,8 @@ ds_dest_t *pack_dest(str iuri, int flags, int priority, str *attrs,
int dload)
}
}
+ ds_oc_prepare(dp);
+
return dp;
err:
if(dp != NULL) {