[OpenSIPS-Users] DROUTING: order and priority
Alexey Kazantsev
kurgan-rus at inbox.ru
Mon Jul 2 05:00:01 EDT 2018
Now, the script remains as it was (no changes):
if( $(rU{s.len}) > 3 ) {
set_dlg_profile("callout");
if(!do_routing("", "W")) {
sl_send_reply("500", "DRouting Error");
exit;
}
}
But I edited DB -
1) changed the order of gw's in dr_carriers,
2) added weights there,
3) added a flag 0x1 to the table (use weight for sorting the list and not definition order).
(then 'opensipsctl dr reload' of course)
dr carriers
sqlite_query: /usr/bin/sqlite3 /etc/opensips/db/opensips-no-ast2.db 'select * FROM dr_carriers ORDER BY carrierid; '
1|carrierKTSmts|mts45_9,mts45_10,mts45_11,mts45_12|0|0||carrier MTS
2|carrierVOIP|c_asterisk_3=10,c_asterisk_2=20,c_asterisk_1=30|0x1|0||carrier VoIP
According to this ^^^ the call should go to c_asterisk_1=30,
- as it has the highest weight
- as I set '0x1' flag in DB
- as I still use "W" flag for 'do_routing' in the script.
But no... the call goes to the c_asterisk_3=10, as it's just the first in the list.
-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/
More information about the Users
mailing list