<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<tt>Hi,<br>
<br>
use the append_to_reply() function<br>
<br>
<a class="moz-txt-link-freetext" href="https://opensips.org/html/docs/modules/3.1.x/sipmsgops.html#func_append_to_reply">https://opensips.org/html/docs/modules/3.1.x/sipmsgops.html#func_append_to_reply</a><br>
<br>
Regards,<br>
</tt>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
OpenSIPS Bootcamp 2021 online
<a class="moz-txt-link-freetext" href="https://opensips.org/training/OpenSIPS_eBootcamp_2021/">https://opensips.org/training/OpenSIPS_eBootcamp_2021/</a></pre>
<div class="moz-cite-prefix">On 4/16/21 12:22 PM, solarmon wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAOXfywPs72HrBSsTezvTVx062VosBvGdyxq=2cUN-r9DaOtZZw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi,<br>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>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?</div>
<div><br>
</div>
<div>Thank you!</div>
<div><br>
</div>
<div>failure_route[call_failover]<br>
{<br>
xlog("[$ci] call failed to established with
$T_reply_code code\n");<br>
<br>
rtpproxy_unforce("$avp(rtpp_set)");<br>
<br>
if (t_was_cancelled()) {<br>
t_reply("487","Request cancelled");<br>
exit;<br>
}<br>
<br>
# any failure indication ?<br>
if ( t_check_status("[56][0-9][0-9]")<br>
|| (t_check_status("408") &&
t_local_replied("all"))<br>
) {<br>
xlog("[$ci] destination $rd failed with
$T_reply_code -> retry\n ");<br>
<br>
###ds_mark_dst("p");<br>
<br>
if ( ds_next_domain() ) {<br>
xlog("[$ci] using new destination
<$rd>\n ");<br>
<br>
# send it out again<br>
t_on_failure("call_failover");<br>
t_relay();<br>
exit;<br>
} else {<br>
xlog("[$ci] no other destination to
retry\n ");<br>
t_reply("503","Service not
available");<br>
exit;<br>
}<br>
}<br>
<br>
# if call failure, allow the reply to propagate to
caller<br>
exit;<br>
}<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>