Hello Daniel,
On Thursday 15 of March 2012 11:59:32 you wrote:
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.
in failure route you have access to the value of r-uri before getting to
any branch_route or failure_route. You can use an avp to store the value
you would like to check later in tm specific routes.
Thanks for confirming usage of avp.
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.
You can set the r-uri to the value you want before calling
add_diversion, after that set it to what you want to be the destination.
I am not able to make this working... not sure if I follow you correctly. So I
tried following minimal config:
route {
if(is_method("REGISTER")) {
save("location");
exit;
}
lookup("location");
t_set_fr(5000);
t_on_failure("FAIL_ONE");
t_relay();
}
failure_route[FAIL_ONE] {
add_diversion("no-answer");
rewiteuser("carol");
lookup("location");
t_on_failure("FAIL_TWO");
t_relay();
}
failure_route[FAIL_TWO] {
rewriteuser("carol");
add_diversion("no-answer");
rewiteuser("dave");
lookup("location");
t_relay();
}
First failure route works correctly, it adds diversion header.
However in second failure route diversion header is not appended to SIP packet
at all (no matter if I try to overwrite r-uri). In case I overwrite r-uri in
first failure route before calling add_diversion it still uses original r-uri.
Same result changing r-uri with $ru or even with $rU instead of rewiteuser
function.
There is also problem in case of cross redirect (B->C and C->B)... secondary
invites end with 500 Internal server error from UA (probably because it gets
invite with same callid and tags as original invite).
I think I need to use B2BUA to make multiple forwards working.
Cheers,
Jan