[OpenSIPS-Users] t_reply() with Reason header

solarmon solarmon at one-n.co.uk
Fri Apr 16 09:22:08 EST 2021


Hi,

We have a code that response back with a "503 Service not available" if it
has exhausted all the dispatcher endpoints - see end of email.

It would be useful if we casn send back the Reason header of the last
rejection. Could this be done and what should I look at?

Thank you!

failure_route[call_failover]
{
        xlog("[$ci] call failed to established with $T_reply_code code\n");

        rtpproxy_unforce("$avp(rtpp_set)");

        if (t_was_cancelled()) {
                t_reply("487","Request cancelled");
                exit;
        }

        # any failure indication ?
        if ( t_check_status("[56][0-9][0-9]")
        || (t_check_status("408") && t_local_replied("all"))
        ) {
                xlog("[$ci] destination $rd failed  with $T_reply_code ->
retry\n ");

                ###ds_mark_dst("p");

                if ( ds_next_domain() ) {
                        xlog("[$ci] using new destination <$rd>\n ");

                        # send it out again
                        t_on_failure("call_failover");
                        t_relay();
                        exit;
                } else {
                        xlog("[$ci] no other destination to retry\n ");
                        t_reply("503","Service not available");
                        exit;
                }
        }

        # if call failure, allow the reply to propagate to caller
        exit;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20210416/62a82fba/attachment.html>


More information about the Users mailing list