[OpenSER-Users] Failure route after parallel forking (was "Problem with redirection (302 Moved temporarly)")

Antonio Reale ant.reale at gmail.com
Wed Apr 16 17:55:03 CEST 2008


Bogdan,
thank you very much for help.

2008/4/16, Bogdan-Andrei Iancu <bogdan at voice-system.ro>:

So, if one of your SPAs is sending 302, this will not hit failure route as
> you still have the second branch still ringing. Only if the second branch
> will fail too, the whole transaction will fail and the failure route will be
> called.


So can I intercept the 302 response in an onreply_route? I tryied to put the
below configuration taken from sipwise inside the onreply_route but some of
the used functions cannot be used in the onreply_route.

-----------------------------------------------------------------------------------------------------------------------
  if(t_check_status("301|302"))
        {
                avp_delete("$avp(s:acc_caller_user)/g");
                avp_delete("$avp(s:acc_caller_domain)/g");
                avp_delete("$avp(s:acc_state)/g");
                avp_copy("$avp(s:acc_callee_user)",
"$avp(s:acc_caller_user)");
                avp_copy("$avp(s:acc_callee_domain)",
"$avp(s:acc_caller_domain)");
                $avp(s:acc_state) = "cfc";
                setflag(29);
                if(!get_redirects("1:1"))
                {

                        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
                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);
                append_branch();

                t_on_branch("1");
                xlog("L_INFO", "Redirect from UAC intercepted - M=$rm
RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
                route(13);
                exit;
        }

        t_on_branch("1");
        xlog("L_INFO", "CFC detected - M=$rm RURI=$ru F=$fu T=$tu IP=$si
ID=$ci\n");
        route(13);
-----------------------------------------------------------------------------------------------------

Regards,
> Bogdan
>

Best regards,
Antonio.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kamailio.org/pipermail/users/attachments/20080416/70897d4d/attachment.htm 


More information about the Users mailing list