[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [asterisk-dev] [Code Review] 2878: app_queue: Make manager events tolerant of Local channel shen
From:       "svnbot" <reviewboard () asterisk ! org>
Date:       2013-09-28 20:38:11
Message-ID: 20130928203811.7486.27263 () hotblack ! digium ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2878/
-----------------------------------------------------------

(Updated Sept. 28, 2013, 3:38 p.m.)


Status
------

This change has been marked as submitted.


Review request for Asterisk Developers and Mark Michelson.


Changes
-------

Committed in revision 400060


Bugs: ASTERISK-22507
    https://issues.asterisk.org/jira/browse/ASTERISK-22507


Repository: Asterisk


Description
-------

app_queue does an admirable job of attempting to manage the Lovecraftian nightmare \
that are Local channel optimizations. Sometimes, however, even it can't defeat the \
horror.

Consider the following scenario:
 SIP/foo <-> L;1 <-> L;2 <-> SIP/agent

SIP/agent answers, triggering a Local channel optimization. This is fine - app_queue \
                will normally do the following:
 * Listen for the Local optimization events and update our agent accordingly to \
                SIP/agent
 * When we get a hangup, publish the AgentComplete event based on our information \
(SIP/foo and SIP/agent)

However, as with all things that depend on sanity from something as capricious as \
Local channels, things can go wrong:  (1) SIP/agent immediately hangs up upon \
answering, because "customer service is our #1 priority" doesn't apply on casual \
Fridays  (2) Asterisk is either (a) Running under valgrind; (b) Running under gdb; \
(c) Running on Richard's dev machine/some other ancient piece of equipment that \
should have been put out of its misery ages ago

In that case, the messages *may* arrive to app_queue in the following order:
 * Hangup SIP/Agent
 * Hangup SIP/foo
 * Optimize L;1/L;2
 * Hangup L;2
 * Hangup L;1

When we receive the hangup of the agent or the caller, we'll attempt to publish the \
AgentComplete event. However, we now have a problem - we think our agent is L;1. We \
haven't received the optimization messages - but L;1 is already dead, so any attempts \
to query it from the Stasis cache result in a big fat NULL.

There are two options here:
 (1) If we can't retrieve channel information, bail
 (2) If we can't retrieve channel information, publish what we know

This patch goes with option #2. We still have a lot of pertinent queue information \
(interface, queue name, etc.) - and we may as well tell the user what we know. They \
will still at least get the "AgentComplete" event, which "completes" the known Agent \
information.


Diffs
-----

  ./branches/12/apps/app_queue.c 399746 

Diff: https://reviewboard.asterisk.org/r/2878/diff/


Testing
-------


Thanks,

Matt Jordan


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/2878/">https://reviewboard.asterisk.org/r/2878/</a>
  </td>
    </tr>
   </table>
   <br />



<table bgcolor="#e0e0e0" width="100%" cellpadding="8" style="border: 1px gray \
solid;">  <tr>
  <td>
   <h1 style="margin-right: 0.2em; padding: 0; font-size: 10pt;">This change has been \
marked as submitted.</h1>  </td>
 </tr>
</table>
<br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Asterisk Developers and Mark Michelson.</div>
<div>By Matt Jordan.</div>


<p style="color: grey;"><i>Updated Sept. 28, 2013, 3:38 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Committed in revision 400060</pre>  </td>
 </tr>
</table>





<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-22507">ASTERISK-22507</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">app_queue does an admirable job of attempting to manage the Lovecraftian \
nightmare that are Local channel optimizations. Sometimes, however, even it can&#39;t \
defeat the horror.

Consider the following scenario:
 SIP/foo &lt;-&gt; L;1 &lt;-&gt; L;2 &lt;-&gt; SIP/agent

SIP/agent answers, triggering a Local channel optimization. This is fine - app_queue \
                will normally do the following:
 * Listen for the Local optimization events and update our agent accordingly to \
                SIP/agent
 * When we get a hangup, publish the AgentComplete event based on our information \
(SIP/foo and SIP/agent)

However, as with all things that depend on sanity from something as capricious as \
Local channels, things can go wrong:  (1) SIP/agent immediately hangs up upon \
answering, because &quot;customer service is our #1 priority&quot; doesn&#39;t apply \
on casual Fridays  (2) Asterisk is either (a) Running under valgrind; (b) Running \
under gdb; (c) Running on Richard&#39;s dev machine/some other ancient piece of \
equipment that should have been put out of its misery ages ago

In that case, the messages *may* arrive to app_queue in the following order:
 * Hangup SIP/Agent
 * Hangup SIP/foo
 * Optimize L;1/L;2
 * Hangup L;2
 * Hangup L;1

When we receive the hangup of the agent or the caller, we&#39;ll attempt to publish \
the AgentComplete event. However, we now have a problem - we think our agent is L;1. \
We haven&#39;t received the optimization messages - but L;1 is already dead, so any \
attempts to query it from the Stasis cache result in a big fat NULL.

There are two options here:
 (1) If we can&#39;t retrieve channel information, bail
 (2) If we can&#39;t retrieve channel information, publish what we know

This patch goes with option #2. We still have a lot of pertinent queue information \
(interface, queue name, etc.) - and we may as well tell the user what we know. They \
will still at least get the &quot;AgentComplete&quot; event, which \
&quot;completes&quot; the known Agent information.</pre>  </td>
 </tr>
</table>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>./branches/12/apps/app_queue.c <span style="color: grey">(399746)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/2878/diff/" style="margin-left: \
3em;">View Diff</a></p>







  </td>
 </tr>
</table>




  </div>
 </body>
</html>



-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic