[OpenSIPS-Users] using mongodb for dynamic routing .

Sasmita Panda spanda at 3clogic.com
Tue Nov 24 08:21:21 EST 2020


Hi,

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 .
failover used to work . If a call fails with the 1st gateway then it goes
to the next gateway .

My  DB looks like below .

mysql> select * from dr_gateways;
+----+------+------+----------------------+-------+------------+-------+------------+-------+--------+------------------+
| id | gwid | type | address              | strip | pri_prefix | attrs |
probe_mode | state | socket | description      |
+----+------+------+----------------------+-------+------------+-------+------------+-------+--------+------------------+
|  1 | gw1  |    3 | 1.1.1.1:5080        |     0 |            |       |
     0 |     0 | NULL   | 0                |
|  3 | gw2  |    3 | 2.2.2.2:5080        |     0 | NULL       | NULL  |
     0 |     0 | NULL   | testing gateway2 |
+----+------+------+----------------------+-------+------------+-------+------------+-------+--------+------------------+
2 rows in set (0.00 sec)

mysql> select * from dr_carriers;
+----+-----------+-------------+-------+----------+-------+-------+-------------------------+
| id | carrierid | gwlist      | flags | sort_alg | state | attrs |
description             |
+----+-----------+-------------+-------+----------+-------+-------+-------------------------+
|  1 | ca3       | gw1=10,gw2=10 |     1 | N        |     0 | NULL  | homer
load random calls |
+----+-----------+-------------+-------+----------+-------+-------+-------------------------+
1 row in set (0.00 sec)

mysql> select * from dr_rules;
+--------+---------+--------+---------+----------+---------+--------+----------+--------------+-------+--------------------+
| ruleid | groupid | prefix | timerec | priority | routeid | gwlist |
sort_alg | sort_profile | attrs | description        |
+--------+---------+--------+---------+----------+---------+--------+----------+--------------+-------+--------------------+
|      1 | 1       |        |         |        0 |         | #ca3   |
   |            0 |       | Freeswitch_gateway |
+--------+---------+--------+---------+----------+---------+--------+----------+--------------+-------+--------------------+

OR
mysql> select * from dr_rules;
+--------+---------+--------+---------+----------+---------+--------+----------+--------------+-------+--------------------+
| ruleid | groupid | prefix | timerec | priority | routeid | gwlist |
sort_alg | sort_profile | attrs | description        |
+--------+---------+--------+---------+----------+---------+--------+----------+--------------+-------+--------------------+
|      1 | 1       |        |         |        0 |         | gw1=10,gw2=10
 |          |            0 |       | Freeswitch_gateway |
+--------+---------+--------+---------+----------+---------+--------+----------+--------------+-------+--------------------+

In my config file the function is like
do_routing(,"W")

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 .
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 .

Am I doing something wrong ? Please assist me .





*Thanks & Regards*
*Sasmita Panda*
*Senior Network Testing and Software Engineer*
*3CLogic , ph:07827611765*


On Thu, Nov 19, 2020 at 4:33 PM Liviu Chircu <liviu at opensips.org> wrote:

> On 19.11.2020 07:26, Sasmita Panda wrote:
>
>
>  I am using opensips-3.1 with backend DB as mongodb .  I am facing some
> problem while using dynamic routing  module .
>
> *ERROR:drouting:dr_load_routing_info: column gwid has a bad type [4],
> accepting **only [3]*
> *.....................*
> *CRITICAL:drouting:dr_reload_data_head: failed to load routing info*
>
> Hi, Sasmita!
>
> Could you apply the following patch in your OpenSIPS 3.1 source code root
> directory, rebuild and see if the problem goes away?
>
> git apply <(base64 -d <<EOF | gzip -dc
>
> H4sIAEZQtl8AA+1UbW/bNhD+HP2KS4Cmst4iu46TLXDRBkmKAWk7pGmBIg0IiqIcwTLpilQ3r+h/
>
> 35GUZNdYuqZfug8TIFE83T187u455WVRQBzPSg30YCHzpuLqgFF2x/OMLKSYyTzb3pM8o4onDLKH
>
> RnilyPmfkBVsmI5GI5Yk40l2dDiaFAyGaToZj704jh/OxAvD8AfYPHsG8fDJZBwNRxC6lzGgsRQa
>
> rC96ko8Nr1dE11QovwNiUkCAjwjwoTQoXUOgaVbxzoJOc45hEJB55MGOvcBdhN2w2/hpxTG+fVcR
>
> vHt+Sc5evz29PPdZU5NPtBoMTrrIrOZ03u0YsofTN69fkev3v5+Tt9cXx796sXM0KMbaY8AUzk7J
>
> m+urHkvpRKHVZ3cUWQ8yJQUpNa9Jo4tjf9+8RuA3QpUzwXNbjGCwj1FIGBm1B5UF+Mv5jAhNMHuS
>
> N0t/3xyOJ/VnR4BhA9idQjqAz154f6TSW74t153Ll+T86srfk3LxQeytC7Izk1qCbDThdd1bv3hh
>
> d8r9hfjt1YuTTS9n2vQzFeoxjcvF1flXQMP+K/I7O33h713IRuRGB6WYwc2jJFC3U7cg7e8TgKuw
>
> XRUmmm9OZqOTOxS4WdoZOqTjo2P2y/A4SfJxwXnGc/71DFlnNxj21aj96BA1nkJoV6t1pakuGXa5
>
> KgW3zVZ3i74xuAaQm+70Qg9A1WzgwUHgAQTwks45UPy8XIEsgAo7DHg3TDc1h0aZihjMBa0qyUwQ
>
> 1iE0njTPS11KQSt4/CF9DNlK4wApCSvZAEOHhQFvUO2IjCywTF4IgbnNFqZTwwVKBQb6D57vGvQD
>
> 756kNgT3jbw+o8KNRHdxiwc64a7HnJgTpxDgcmLVZn2NNVGtcBd8obj2LXyK+ZR/ceQf4N7pt+ZY
>
> GQGp2XxxbZlMoicTbMtRGo2/0Zbvy8BRcvVqKXVjJCTi0BrHGknKegUVL3Q/WDYENYj5pXZEDNC6
>
> 0AM7NYE12DpsZhMPXTqA5UNstlz5jkEErpDt2v1ENs7q7L1Z3XRfb/GzkYZhs4XqSt6uDjXcRO3s
>
> vVnddKY1Kmw2w5B/mKzNb+ynynrrP/ofkjX0zUTYdZ38rtlYquG6ZVtOXaNap39R9LIuP1HN/5f0
> P0v6b8a6yW7jCQAA
> EOF
> )
>
> Cheers,
>
> --
> Liviu Chircuwww.twitter.com/liviuchircu | www.opensips-solutions.com
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20201124/092ea7ef/attachment.html>


More information about the Users mailing list