[SR-Users] Request-URI in fail route

Jan Klepal jan at klepal.cz
Tue Mar 13 19:23:22 CET 2012


Hello,

I am trying to set simple no-answer forward scenario: Alice calls Bob and 
after timeout 5s forward to Carol (and additionally Carol timeout forward to 
Dave).

I am using Kamailio 3.2.2 default config. There is part of routing logic for 
no-answer forwarding:

route[RELAY] {
    if(is_method("INVITE")) {
        t_set_fr(5000);
        t_on_branch("BRANCH_ONE");
        t_on_reply("REPLY_ONE");
        t_on_failure("FAIL_ONE");
    }
    if(!t_relay()) {
        sl_reply_error();
    }
}

branch_route[BRANCH_ONE] {
    $avp(divert) = $null;
    if($rU == "bob") {
        $avp(divert) = "carol";
    }
    # second problem
    if($rU == "carol") {
        $avp(divert) = "dave";
    }
}

failure_route[FAIL_ONE] {
    if($avp(divert) != $null) {
        add_diversion("no-answer");
        $rU = $avp(divert);
        route(LOOKUP);
        route(RELAY);
    }
}

First problem I encountered is that I can't check $rU in failure_route (it is 
always set to original Request-URI - bob). Is this normal behavior or am I 
missing something? Because of that I have to set divert destination in branch 
route.

Second problem is when Carol's no-answer forward to Dave happens. Then 
add_diversion adds invalid diversion header because it uses Request-URI which 
is still set to bob.

Kind Regards,
Jan




More information about the sr-users mailing list