<p dir="ltr">I think you should take care of this on your gateway. For example, using freeswitch or asterisk, you can check for rtps, and when the other end stops sending rtps for 30 seconds (configurable) it will tear down the call properly. </p>
<p dir="ltr">Unless you're using a rtp-proxy with opensips which can do this (most can), that's the way to do this. Anything else is just duct-taping.</p>
<p dir="ltr">My opinion after 20 years on voip.</p>
<p dir="ltr">Hope that helps.</p>
<p dir="ltr">David</p>
<br><div class="gmail_quote"><div dir="ltr">On Fri, Sep 7, 2018, 21:43 Ben Newlin <<a href="mailto:Ben.Newlin@genesys.com">Ben.Newlin@genesys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="m_3952631859867134231WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I am having an issue trying to add values to accounting based on the response to the BYE request.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">We use the dialog timeout mechanism to terminate long calls in our system. In some cases, these are “valid” calls that remained connected for too long due to some error elsewhere in the application. But sometimes
 one or both ends of the call believe they have disconnected, but we did not receive or process the disconnect, due to a malformed BYE or a network disruption. In these cases, when the Dialog timeout is reached and OpenSIPS generates a BYE to both parties,
 they will respond with a 481.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">What I want is to set a CDR flag on receipt of that 481 to indicate that there was an error and the calculated call time may not be correct. But it seems that any accounting flags set after the BYE is sent
 are not honored. Is there any way to accomplish this?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">This is my attempt:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">failure_route[local_failure]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">{<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">  $acc_extra(disconnect_error) = "true";<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">}<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">local_route<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">{<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">  t_on_failure("local_failure");<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">}<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black">Ben Newlin </span>
<u></u><u></u></p>
</div>
</div>

_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>