[OpenSIPS-Users] Problem with dynamic routing

mmarzuola at interfree.it mmarzuola at interfree.it
Tue Jan 20 18:16:43 CET 2009


Hi.
If in the table dr_rules I set the route ID to 0 and in the main route of the script I explicitly put the route 2:

if (is_method("INVITE")) {
                xlog("L_INFO", "Method is an INVITE\n");
                #setflag(4);
                setflag(1); # do accounting
                if($rU=~"3.*") {
                        xlog("L_INFO", "Call to PSTN\n");
                        do_routing();
                        route(2);
                }
        }

route[2] {
        t_on_failure("2");

        if (!t_relay()) {
                sl_reply_error();
        };
        exit;
}

failure_route[2] {
        xlog("L_INFO","failure\n");
        if (next_routing()) {
                append_branch();
                t_relay();
                exit;
        }
}

the dynamic routing seems to work well and the destinations gateways are tried in the given order.

Indeed, if I set the route ID of the dr_rules to 2, and change the script in this way:

if (is_method("INVITE")) {
                xlog("L_INFO", "Method is an INVITE\n");
                #setflag(4);
                setflag(1); # do accounting
                if($rU=~"3.*") {
                        xlog("L_INFO", "Call to PSTN\n");
                        do_routing();
                }
        }

route[2] {
        t_on_failure("2");

        if (!t_relay()) {
                sl_reply_error();
        };
        exit;
}

failure_route[2] {
        xlog("L_INFO","failure\n");
        if (next_routing()) {
                append_branch();
                t_relay();
                exit;
        }
}

I get the 500 error from the opensips.
Why this happens?
Do I have to change something in the script?

Thanks in advance.

Marzuola Matteo


----------------------------------------------------------------------------
Vuoi essere presente online? 
Vuoi dare voce alla tua attivita`? 
Acquista un dominio su domini.interfree.it.
A partire da 18,59 euro
----------------------------------------------------------------------------




More information about the Users mailing list