The carrier flags within dynamic routing in opensips_cp 5.0 are calculated in a faulty manner and can lead to disabling carriers when applying any change.
In opensips 1.8 "Dynamic Routing Module" Doc we'll find: 126.96.36.199. Carriers - flags : 0x1 - use weight for sorting the list and not definition order; 0x2 - use only the first gateway from the carrier (depending on the sorting); 0x4 - disable the usage of this carrier
But when changing the "Use weights" in the opensips cp this will end up increasing/decreasing the flags value in the dr_carrier table by 4. Changing the "Enabled" option in the opensips cp this will inrease/decrease the flags value by 1. So this is vice versa to what opensips expects.
As a workaround I did the following:
change $flags = bindec($useweights.$useonlyfirst.$enabled);
to $flags = bindec($enabled.$useonlyfirst.$useweights);
and in /web/tools/system/drouting/lib/carriers.functions.inc.php
change return ltrim($rtnval[$retbit]);
to return ltrim($rtnval[$numbits+1-$retbit]);
finally the header "enabled" will not fit to the flags value in the dr_table. I just change the header to "disabled"
change <td class="dataTitle">Enabled</td>
to <td class="dataTitle">Disabled</td>