[OpenSIPS-Users] t_reply() with Reason header

solarmon solarmon at one-n.co.uk
Fri Apr 16 10:28:40 EST 2021


Hi Bogdan,

Thanks for the response amd link to append_to_reply()

What is the best function to use to extract the Reason header to feed in to
append_to_reply()?

Thank you.

On Fri, 16 Apr 2021 at 11:07, Bogdan-Andrei Iancu <bogdan at opensips.org>
wrote:

> Hi,
>
> use the append_to_reply() function
>
>
> https://opensips.org/html/docs/modules/3.1.x/sipmsgops.html#func_append_to_reply
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
> OpenSIPS Bootcamp 2021 online
>   https://opensips.org/training/OpenSIPS_eBootcamp_2021/
>
> On 4/16/21 12:22 PM, solarmon wrote:
>
> 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;
> }
>
> _______________________________________________
> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20210416/6efa8297/attachment.html>


More information about the Users mailing list