<div dir="ltr">Hi, <div><br></div><div>In opensips-3.1 When I am using dynamic routing to do random distribution of calls on the gateway based on their weight . Its not working .Always call goes to the first gateway . </div><div>failover used to work . If a call fails with the 1st gateway then it goes to the next gateway . </div><div><br></div><div>My DB looks like below . </div><div><br></div><div>mysql> select * from dr_gateways;<br>+----+------+------+----------------------+-------+------------+-------+------------+-------+--------+------------------+<br>| id | gwid | type | address | strip | pri_prefix | attrs | probe_mode | state | socket | description |<br>+----+------+------+----------------------+-------+------------+-------+------------+-------+--------+------------------+<br>| 1 | gw1 | 3 | <a href="http://1.1.1.1:5080">1.1.1.1:5080</a> | 0 | | | 0 | 0 | NULL | 0 |<br>| 3 | gw2 | 3 | <a href="http://2.2.2.2:5080">2.2.2.2:5080</a> | 0 | NULL | NULL | 0 | 0 | NULL | testing gateway2 |<br>+----+------+------+----------------------+-------+------------+-------+------------+-------+--------+------------------+<br>2 rows in set (0.00 sec)<br><br>mysql> select * from dr_carriers;<br>+----+-----------+-------------+-------+----------+-------+-------+-------------------------+<br>| id | carrierid | gwlist | flags | sort_alg | state | attrs | description |<br>+----+-----------+-------------+-------+----------+-------+-------+-------------------------+<br>| 1 | ca3 | gw1=10,gw2=10 | 1 | N | 0 | NULL | homer load random calls |<br>+----+-----------+-------------+-------+----------+-------+-------+-------------------------+<br>1 row in set (0.00 sec)<br><br>mysql> select * from dr_rules;<br>+--------+---------+--------+---------+----------+---------+--------+----------+--------------+-------+--------------------+<br>| ruleid | groupid | prefix | timerec | priority | routeid | gwlist | sort_alg | sort_profile | attrs | description |<br>+--------+---------+--------+---------+----------+---------+--------+----------+--------------+-------+--------------------+<br>| 1 | 1 | | | 0 | | #ca3 | | 0 | | Freeswitch_gateway |<br>+--------+---------+--------+---------+----------+---------+--------+----------+--------------+-------+--------------------+<br></div><div><br></div><div>OR</div><div><div>mysql> select * from dr_rules;<br>+--------+---------+--------+---------+----------+---------+--------+----------+--------------+-------+--------------------+<br>| ruleid | groupid | prefix | timerec | priority | routeid | gwlist | sort_alg | sort_profile | attrs | description |<br>+--------+---------+--------+---------+----------+---------+--------+----------+--------------+-------+--------------------+<br>| 1 | 1 | | | 0 | | gw1=10,gw2=10 | | 0 | | Freeswitch_gateway |<br>+--------+---------+--------+---------+----------+---------+--------+----------+--------------+-------+--------------------+<br></div><div></div></div><div><br></div><div>In my config file the function is like </div><div>do_routing(,"W")</div><div><br></div><div>Till opensips-3.0 I have tested this function and this was working fine . Opensips used to fork calls randomly within the gateways when both have similar weight . </div><div>But in opensips-3.1 its not working . I have tested this with mysql and mongodb also . In both case it's not working . In openisps-1.11 even I am not setting this "W" flag in the function still its working . </div><div><br></div><div>Am I doing something wrong ? Please assist me . </div><div><br></div><div><br></div><div><br></div><div><br></div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><b><i>Thanks & Regards</i></b><div><i>Sasmita Panda</i></div><div><i>Senior Network Testing and Software Engineer</i></div><div><i>3CLogic , ph:07827611765</i></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 19, 2020 at 4:33 PM Liviu Chircu <<a href="mailto:liviu@opensips.org">liviu@opensips.org</a>> wrote:<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><tt>On 19.11.2020 07:26, Sasmita Panda
wrote:<br>
</tt></div>
<blockquote type="cite">
<div><tt><br>
</tt></div>
<div><tt> I am using opensips-3.1 with backend DB as mongodb . I
am facing some problem while using dynamic routing module . <br>
</tt></div>
<div><tt><br>
</tt></div>
<div><tt><b>ERROR:drouting:dr_load_routing_info: column gwid has a
bad type [4], accepting </b><b>only [3]</b></tt></div>
<div><tt><b>.....................</b></tt></div>
<div><tt><b>CRITICAL:drouting:dr_reload_data_head: failed to load
routing info</b></tt></div>
</blockquote>
<p><tt>Hi, Sasmita!</tt></p>
<p><tt>Could you apply the following patch in your OpenSIPS </tt><tt><tt>
3.1 </tt>source code root directory, rebuild and see if the
problem goes away?</tt></p>
<p><tt>git apply <(base64 -d <<EOF | gzip -dc<br>
H4sIAEZQtl8AA+1UbW/bNhD+HP2KS4Cmst4iu46TLXDRBkmKAWk7pGmBIg0IiqIcwTLpilQ3r+h/<br>
35GUZNdYuqZfug8TIFE83T187u455WVRQBzPSg30YCHzpuLqgFF2x/OMLKSYyTzb3pM8o4onDLKH<br>
RnilyPmfkBVsmI5GI5Yk40l2dDiaFAyGaToZj704jh/OxAvD8AfYPHsG8fDJZBwNRxC6lzGgsRQa<br>
rC96ko8Nr1dE11QovwNiUkCAjwjwoTQoXUOgaVbxzoJOc45hEJB55MGOvcBdhN2w2/hpxTG+fVcR<br>
vHt+Sc5evz29PPdZU5NPtBoMTrrIrOZ03u0YsofTN69fkev3v5+Tt9cXx796sXM0KMbaY8AUzk7J<br>
m+urHkvpRKHVZ3cUWQ8yJQUpNa9Jo4tjf9+8RuA3QpUzwXNbjGCwj1FIGBm1B5UF+Mv5jAhNMHuS<br>
N0t/3xyOJ/VnR4BhA9idQjqAz154f6TSW74t153Ll+T86srfk3LxQeytC7Izk1qCbDThdd1bv3hh<br>
d8r9hfjt1YuTTS9n2vQzFeoxjcvF1flXQMP+K/I7O33h713IRuRGB6WYwc2jJFC3U7cg7e8TgKuw<br>
XRUmmm9OZqOTOxS4WdoZOqTjo2P2y/A4SfJxwXnGc/71DFlnNxj21aj96BA1nkJoV6t1pakuGXa5<br>
KgW3zVZ3i74xuAaQm+70Qg9A1WzgwUHgAQTwks45UPy8XIEsgAo7DHg3TDc1h0aZihjMBa0qyUwQ<br>
1iE0njTPS11KQSt4/CF9DNlK4wApCSvZAEOHhQFvUO2IjCywTF4IgbnNFqZTwwVKBQb6D57vGvQD<br>
756kNgT3jbw+o8KNRHdxiwc64a7HnJgTpxDgcmLVZn2NNVGtcBd8obj2LXyK+ZR/ceQf4N7pt+ZY<br>
GQGp2XxxbZlMoicTbMtRGo2/0Zbvy8BRcvVqKXVjJCTi0BrHGknKegUVL3Q/WDYENYj5pXZEDNC6<br>
0AM7NYE12DpsZhMPXTqA5UNstlz5jkEErpDt2v1ENs7q7L1Z3XRfb/GzkYZhs4XqSt6uDjXcRO3s<br>
vVnddKY1Kmw2w5B/mKzNb+ynynrrP/ofkjX0zUTYdZ38rtlYquG6ZVtOXaNap39R9LIuP1HN/5f0<br>
P0v6b8a6yW7jCQAA<br>
EOF<br>
)<br>
</tt></p>
<p><tt>Cheers,</tt><br>
</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></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>