Following code sets the ruri to the last contact, however, the $ds show more information about other contacts. Is there a way to reset this so that only ruri information is used? Cisco response and xlog information is also given below.
if(!get_redirects("*:*"))
{
xlog("L_ERROR", "Failed to fetch contact '$ct' from 301/302 - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
acc_db_request("480", "acc");
t_reply("480", "Temporarily Unavailable");
exit;
}
# get last URI from destination-set and set it as R-URI
xlog("L_INFO", "Redirect from UAC intercepted 1 - M=$rm RURI=$ru D=$ds B=$bR \nF=$fu T=$tu IP=$si ID=$ci\n");
avp_delete("$avp(s:tmp)/g");
$avp(s:tmp) = $ds;
avp_subst("$avp(s:tmp)", "/.*(
sip:.+@[^:;>]+).*$/\1/");
avp_pushto("$ru", "$avp(s:tmp)");
setflag(29);
xlog("L_INFO", "Redirect from UAC intercepted 2 - M=$rm RURI=$ru D=$ds B=$bR \ntmp=$avp(s:tmp) \nF=$fu T=$tu IP=$si ID=$ci\n");
append_branch();
route(17); # process
exit;
}
Thanks in advance for your advice.