[OpenSIPS-Users] DROUTING: order and priority

Alexey Kazantsev kurgan-rus at inbox.ru
Mon Jul 2 04:36:10 EDT 2018


Hi list!

Last days I'm trying to master DROUTING module usage.

This is a piece of script:

        if( $(rU{s.len}) > 3 ) {
                set_dlg_profile("callout");
                if(!do_routing("", "W")) {
                        sl_send_reply("500", "DRouting Error");
                        exit;
                }
        }

******************

I noticed, that "W" flag works only if I set weight for rules (in gwlist column of dr_rules).
Firstly I set weight for carriers (in gwlist column), as it's also possible, according to documentation,
but it haven't made any changes.

sqlite> .schema dr_carriers
CREATE TABLE dr_carriers (
    id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
    carrierid CHAR(64) NOT NULL,
    gwlist CHAR(255) NOT NULL,
    flags INTEGER DEFAULT 0 NOT NULL,
    state INTEGER DEFAULT 0 NOT NULL,
    attrs CHAR(255) DEFAULT NULL,
    description CHAR(128) DEFAULT NULL,
    CONSTRAINT dr_carriers_dr_carrier_idx  UNIQUE (carrierid)
);

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_1,c_asterisk_2,c_asterisk_3|0|0||carrier VoIP

******************

sqlite> .schema dr_rules
CREATE TABLE dr_rules (
    ruleid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
    groupid CHAR(255) NOT NULL,
    prefix CHAR(64) NOT NULL,
    timerec CHAR(255) DEFAULT NULL,
    priority INTEGER DEFAULT 0 NOT NULL,
    routeid CHAR(255) DEFAULT NULL,
    gwlist CHAR(255) NOT NULL,
    attrs CHAR(255) DEFAULT NULL,
    description CHAR(128) DEFAULT NULL
);

dr rules
sqlite_query: /usr/bin/sqlite3 /etc/opensips/db/opensips-no-ast2.db 'select * FROM dr_rules ORDER BY groupid; '
9|1|7912||0||#carrierKTSmts,#carrierVOIP||rule 1st, MTS through MTS gates and ast1
10|2|7912||0||#carrierVOIP=20,#carrierKTSmts=10||rule MTS through MTS gates and ast1 for groupid 2


Is it OK, or I do something wrong?

-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/


More information about the Users mailing list