[sr-dev] [kamailio/kamailio] tm: new weight-based call-termination distribution (#2178)
Henning Westerholt
notifications at github.com
Mon Dec 16 17:46:37 CET 2019
henningw commented on this pull request.
Thanks for the pull request - I found two things that should be improved before integrating the code.
> + return 0;
+}
+
+/*
+ * Loads contacts in destination set into contacts_avp in reverse
+ * proportional order. Each contact is associated with Q_FLAG beacuse
+ * only one contact at a time has to ring.
+ */
+int t_load_contacts_proportional(struct contact *contacts, char *sock_buf, int n, unsigned short q_total)
+{
+ int q_remove, n_rand, idx;
+ struct contact *curr;
+ sr_xavp_t *lxavp = NULL;
+
+ /* Initialize the random generator */
+ kam_srand(time(NULL));
This is not necessary (and will also overwrite the state for the global one). The random generator is initialized during startup.
> @@ -28,14 +28,19 @@
#ifndef _T_SERIAL_H_
#define _T_SERIAL_H_
+#define STANDARD 0
Makes probably sense to qualify the defines, e.g. with T_LOAD_ prefix or similar. Also consider to move them into the respective .c file, if they are not necessary in the .h
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2178#pullrequestreview-332707310
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20191216/66f5f578/attachment.html>
More information about the sr-dev
mailing list