<div dir="ltr">Nitesh,<div><br></div><div>I struggled with this before, and agree with what Ben (Skrusty?) says above. The point is, the exact event you reap in your ARI application depends on, well, your application. Some ARI applications need to know when a channel left the bridge, others need to know when the channel hungup. I think the Asterisk/ARI developers decided to give access to as many events as possible so that the ARI application developers have a rich set of events to work with; we don't need to use all of them. And this means your ARI application will have "noop" for events which do not pertain to your application and wait only for a StasisEnd. </div><div><br></div><div>Hope that helps you.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 18, 2016 at 9:34 AM, Ben Merrills <span dir="ltr"><<a href="mailto:b.merrills@mersontech.co.uk" target="_blank">b.merrills@mersontech.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Hi Nitesh,
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Neither of the events signify that channel has hungup. You should have another event Hangup when a channel is hung up, or destroyed
if it’s part of an unanswered/timeout Originate (if I remember right).<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">How you decide to clean up or manage your code really depends on what you’re doing. When you say building a mixing bridge, do you mean
a simple conference? Two way call? What you do in your code depends on what you want to happen when one party hangs up!<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Skrusty<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <a href="mailto:asterisk-app-dev-bounces@lists.digium.com" target="_blank">asterisk-app-dev-bounces@lists.digium.com</a> [mailto:<a href="mailto:asterisk-app-dev-bounces@lists.digium.com" target="_blank">asterisk-app-dev-bounces@lists.digium.com</a>]
<b>On Behalf Of </b>Nitesh Bansal<br>
<b>Sent:</b> 18 April 2016 14:18<br>
<b>To:</b> Asterisk Application Development discussion <<a href="mailto:asterisk-app-dev@lists.digium.com" target="_blank">asterisk-app-dev@lists.digium.com</a>><br>
<b>Subject:</b> [asterisk-app-dev] ChannelLeftBridge vs StasisEnd<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hello,<u></u><u></u></p>
</div>
<p class="MsoNormal">I'm building a mixing bridge with ARI and Asterisk 13.<u></u><u></u></p>
</div>
<p class="MsoNormal">Now when a channel hangs up, I can see two StasisEvents:<u></u><u></u></p>
</div>
<p class="MsoNormal">'ChannelLeftBridge' and 'StasisEnd'.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">To me, there should be just one event when a channel hangs up, if<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">it hangs up, it should automatically leave the bridge.<u></u><u></u></p>
</div>
<p class="MsoNormal">Is there any specific order that these two events should come from<br>
Asterisk?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Which event should I rely on to write the cleanup code for a channel?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Nitesh<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div></div><div class="MsoNormal" align="center" style="text-align:center">
<hr size="1" width="100%" noshade style="color:#a0a0a0" align="center">
</div>
<p class="MsoNormal">No virus found in this message.<br>
Checked by AVG - <a href="http://www.avg.com" target="_blank">www.avg.com</a><br>
Version: 2016.0.7539 / Virus Database: 4545/12056 - Release Date: 04/18/16<u></u><u></u></p>
</div>
</div>
</div>
<br>_______________________________________________<br>
asterisk-app-dev mailing list<br>
<a href="mailto:asterisk-app-dev@lists.digium.com">asterisk-app-dev@lists.digium.com</a><br>
<a href="http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev" rel="noreferrer" target="_blank">http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev</a><br>
<br></blockquote></div><br></div>