[SR-Users] R: R: R: R: lcr module: strip and tag

Alida - Danilo SMALDONE dsmaldone at alida.it
Mon May 2 21:16:48 CEST 2011


Hi Juha,
I've tried and tested, but I don't under stand why I have to force $tu in
this way to make the routing to external gateway works:

route[LCR1]{
    if (!load_gws("1")) {
        xlog("L_ERR", "Cannot load gws for $rm <$ru>\n");
        send_reply("500", "Server Internal Error - Cannot load gateways");
        exit;
    };

    if (!next_gw()) {
        xlog("L_WARN", "No gateways for $rm <$ru>\n");
        send_reply("503", "Service not available - No gateways");
        exit;
    };

    $tu="sip:" + $rU + "@" + $od;
    route(RELAY);
}

route[RELAY] {
#!ifdef WITH_NAT
         if (check_route_param("nat=yes")) {
                setbflag(FLB_NATB);
        }
        if (isflagset(FLT_NATS) || isbflagset(FLB_NATB)) {
                route(RTPPROXY);
        }
#!endif

        /* example how to enable some additional event routes */
        if (is_method("INVITE")) {
                #t_on_branch("BRANCH_ONE");
                t_on_reply("REPLY_ONE");
                t_on_failure("FAIL_ONE");
        }
         if (!t_relay()) {
                sl_reply_error();
        }
        exit;
}


If I delete $tu="sip:" + $rU + "@" + $od; the call to outbound gateway
fails.
Any suggestion?

Thank you
Danilo

-----Messaggio originale-----
Da: sr-users-bounces at lists.sip-router.org
[mailto:sr-users-bounces at lists.sip-router.org] Per conto di Juha Heinanen
Inviato: venerdì 29 aprile 2011 17:14
A: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -Users
Mailing List
Oggetto: [SR-Users] R: R: R: lcr module: strip and tag


Alida - Danilo SMALDONE writes:

> Could you please send a simple script with load_gws() and next_gw()
working?
> I've tried but I'll never seen working strip and tag

for example:

    if (!load_gws("1")) {
        xlog("L_ERR", "Cannot load gws for $rm <$ru>\n");
        send_reply("500", "Server Internal Error - Cannot load gateways");
        exit;
    };

    if (!next_gw()) {
        xlog("L_WARN", "No gateways for $rm <$ru>\n");
        send_reply("503", "Service not available - No gateways");
        exit;
    };

    if (t_relay())
        exit;

-- juha

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users at lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




More information about the sr-users mailing list