<div dir="ltr">Hello Liviu,<br><br>Thank you for your mail.<br><br>If I understand well, with dynamic-weights algorithm, for example if I set:<br>- warn_threshold_asr = 40<br>- warn_penalty_asr = 1<br><br>So, if the gateway defined on each rule has an ASR < 40, so the gateway will have a penality = 1.<br><br>and when I call do_routing() function, qrouting choose the gw that has the lowest score.<br><br>am I right?<br><br>Regards<div><br>Abdoul.<br><a href="https://www.africallshop.com/">https://www.africallshop.com/</a><br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 27 févr. 2020 à 16:45, Liviu Chircu <<a href="mailto:liviu@opensips.org">liviu@opensips.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div>On 27.02.2020 17:26, Abdoul Osséni
wrote:<br>
</div>
<blockquote type="cite">I
want to test qrouting module.<br>
Do you have some qrouting configs examples?<br>
Regards<br>
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div><span style="font-size:12.8px"><br>
</span></div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p><tt>Hey, Abdoul!<br>
</tt></p>
<p><tt>It's quite an "out-of-the-box" solution, you'd be surprised.
Here are some provisioning tips:<br>
</tt></p>
<p><tt>* provision any qrouting profiles you want to play with in
the "qr_profiles" table [1]<br>
* in dr_rules, make sure to set the "sort_alg" column to 'Q' in
order to enable qrouting for each rule<br>
* in dr_rules, for each 'Q'-enabled rule, set the "sort_profile"
to your desired profile "id" taken from the "qr_profiles" table<br>
</tt></p>
<p><tt>From here on, it's just a matter of loading up the modules
and setting up the "db_url" modparams. The modules will
complain if something is missing and tell you what to load
anyway! :)</tt></p>
<p><tt>Regarding the script: nothing changes. Just call
do_routing() [2] as usual, and it will both collect stats and
sort the destinations based on quality. If you want to
integrate with custom stats, check out the module docs [3],
there is plenty of help. Below is the module configuration --
everything else is just drouting!<br>
</tt></p>
<p><tt>Best regards,</tt></p>
<p><tt>[1]: </tt><tt><a href="https://github.com/OpenSIPS/opensips/blob/master/scripts/mysql/qrouting-create.sql" target="_blank">https://github.com/OpenSIPS/opensips/blob/master/scripts/mysql/qrouting-create.sql</a></tt></p>
<p><tt>[2]: </tt><tt><a href="https://opensips.org/docs/modules/3.1.x/drouting.html#func_do_routing" target="_blank">https://opensips.org/docs/modules/3.1.x/drouting.html#func_do_routing</a></tt></p>
<p><tt>[3]: </tt><tt><a href="https://opensips.org/docs/modules/3.1.x/qrouting.html" target="_blank">https://opensips.org/docs/modules/3.1.x/qrouting.html</a></tt></p>
<p><tt>--- qrouting.cfg<br>
</tt></p>
<p><tt>loadmodule "db_mysql.so"<br>
<br>
loadmodule "drouting.so"<br>
modparam("drouting", "use_partitions", 1)<br>
modparam("drouting", "rule_id_avp", "$avp(ruleid)")<br>
modparam("drouting", "gw_id_avp", "$avp(gwid)")<br>
modparam("drouting", "db_partitions_url",
<a href="mailto:mysql://root:xxxxxxxxxx@10.0.0.10/opensips" target="_blank">"mysql://root:xxxxxxxxxx@10.0.0.10/opensips"</a>)<br>
<br>
loadmodule "qrouting.so"<br>
modparam("qrouting", "algorithm", "dynamic-weights")<br>
modparam("qrouting", "history_span", 30)<br>
modparam("qrouting", "extra_stats", "+mos/1; +r_factor/1")<br>
<br>
# for fast testing<br>
modparam("qrouting", "min_samples_asr", 0)<br>
modparam("qrouting", "min_samples_ccr", 0)<br>
modparam("qrouting", "min_samples_pdd", 0)<br>
modparam("qrouting", "min_samples_ast", 0)<br>
modparam("qrouting", "min_samples_acd", 0)<br>
modparam("qrouting", "decimal_digits", 3)<br>
<br>
modparam("qrouting", "db_url",
<a href="mailto:mysql://root:xxxxxxxxxx@10.0.0.10/opensips" target="_blank">"mysql://root:xxxxxxxxxx@10.0.0.10/opensips"</a>)<br>
<br>
</tt></p>
<pre cols="72">--
Liviu Chircu
<a href="http://www.twitter.com/liviuchircu" target="_blank">www.twitter.com/liviuchircu</a> | <a href="http://www.opensips-solutions.com" target="_blank">www.opensips-solutions.com</a>
OpenSIPS Summit, Amsterdam, May 2020
<a href="http://www.opensips.org/events" target="_blank">www.opensips.org/events</a>
OpenSIPS Bootcamp, Miami, March 2020
<a href="http://www.opensips.org/training" target="_blank">www.opensips.org/training</a></pre>
</div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>