def ksr_route_relay()
if KSR.is_method_in("IBSU") then
if KSR::TM.t_is_set("branch_route") < 0 then
KSR::TM.t_on_branch("ksr_branch_manage")
end
end
if KSR.is_method_in("ISU") then
if KSR::TM.t_is_set("onreply_route") < 0 then
KSR::TM.t_on_reply("ksr_onreply_manage")
end
#KSR.info("Onreply route: #{KSR::TM.t_is_set("onreply_route")}") end
if KSR.is_INVITE() then
if KSR::TM.t_is_set("failure_route") < 0 then
KSR::TM.t_on_failure("ksr_failure_manage")
end
end
if KSR::TM.t_relay() < 0 then
KSR::SL.sl_reply_error()
end
exit
end
def ksr_route_withindlg()
return if KSR::SIPUTILS.has_totag() < 0
if KSR::RR.loose_route() > 0 then
ksr_route_dlguri()
if KSR.is_BYE() then
#KSR.setflag($myenv['FLT_ACC'].to_i)
#KSR.setflag($myenv['FLT_ACCFAILED'].to_i)
elsif KSR.is_ACK() then
ksr_route_natmanage()
elsif KSR.is_NOTIFY() then
KSR::RR.record_route()
end
ksr_route_relay()
exit
end
if KSR.is_ACK() then
#KSR.info("Handling an ACK within dialog") if KSR::TM.t_check_trans() > 0 then
ksr_route_relay()
exit
else
exit
end
end
KSR::SL.sl_send_reply(404, "Not here");
exit
end