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

List:       asterisk-dev
Subject:    Re: [asterisk-dev] [Code Review]: Patch to prevent stopping the active generator when it is not the
From:       "Mark Michelson" <reviewboard () asterisk ! org>
Date:       2012-10-19 20:49:30
Message-ID: 20121019204930.18994.34852 () hotblack ! digium ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On Oct. 18, 2012, 9:12 a.m., Joshua Colp wrote:
> > /branches/1.8/main/channel.c, line 8189
> > <https://reviewboard.asterisk.org/r/2152/diff/2/?file=31763#file31763line8189>
> > 
> > I think this should be made a new API call in the generator set and recommended \
> > for future use, so something like this doesn't happen for other generator usage.

I'm with Josh on this one. It seems like this could happen with other generators. \
There are two cases where generators might be deactivated:

1) I specifically think Generator X is running and I want to stop it from running any \
more. I should make sure I'm actually stopping Generator X. 2) I want whatever \
generator is on the channel to stop running. This could be because I want to start \
running my own generator on the channel. It could also happen during channel \
destruction.


- Mark


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


On Oct. 5, 2012, 1:50 p.m., Brent Eagles wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2152/
> -----------------------------------------------------------
> 
> (Updated Oct. 5, 2012, 1:50 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Stopping the silence generator does not take into account that it may no longer be \
> the active generator. This patch adds a small internal function that is currently \
> only used for silence generator related code. It might be useful to add to the \
> public API later on, or at the very least, everywhere in channel.c where stopping \
> an generator is only valid if the current generator is as expected. This patch also \
> adds a lock/unlock block around an unprotected assignment to chan->generatordata \
> that also checks to see if the current generator is the one that is expected (there \
> are almost certainly other spots that need looked at, but this little bit is itself \
> creep). 
> 
> This addresses bug ASTERISK-19918.
> https://issues.asterisk.org/jira/browse/ASTERISK-19918
> 
> 
> Diffs
> -----
> 
> /branches/1.8/main/channel.c 374534 
> 
> Diff: https://reviewboard.asterisk.org/r/2152/diff
> 
> 
> Testing
> -------
> 
> The problem as reported by the user was eventually reproduced by establishing \
> configuration details inferred from the reporter's provided debug logs. Namely, \
> enabling a configuration item that enables silence generation. A simple queue \
> configuration with agent login reproduced the issue pretty reliably. The same \
> actions were performed with the patch in place and music on hold resumed as \
> expected. 
> 
> Thanks,
> 
> Brent
> 
> 


[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/2152/">https://reviewboard.asterisk.org/r/2152/</a>
  </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On October 18th, 2012, 9:12 a.m., <b>Joshua \
Colp</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://reviewboard.asterisk.org/r/2152/diff/2/?file=31763#file31763line8189" \
style="color: black; font-weight: bold; text-decoration: \
underline;">/branches/1.8/main/channel.c</a>  <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">struct \
ast_silence_generator *ast_channel_start_silence_generator(struct ast_channel \
*chan)</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">8189</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="k">static</span> <span class="kt">int</span> <span \
class="nf">internal_deactivate_generator</span><span class="p">(</span><span \
class="k">struct</span> <span class="n">ast_channel</span> <span \
class="o">*</span><span class="n">chan</span><span class="p">,</span> <span \
class="kt">void</span><span class="o">*</span> <span class="n">generator</span><span \
class="p">)</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I think this should be \
made a new API call in the generator set and recommended for future use, so something \
like this doesn&#39;t happen for other generator usage.</pre>  </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I&#39;m \
with Josh on this one. It seems like this could happen with other generators. There \
are two cases where generators might be deactivated:

1) I specifically think Generator X is running and I want to stop it from running any \
more. I should make sure I&#39;m actually stopping Generator X. 2) I want whatever \
generator is on the channel to stop running. This could be because I want to start \
running my own generator on the channel. It could also happen during channel \
destruction.</pre> <br />




<p>- Mark</p>


<br />
<p>On October 5th, 2012, 1:50 p.m., Brent Eagles wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://reviewboard.asterisk.org/media/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.</div>
<div>By Brent Eagles.</div>


<p style="color: grey;"><i>Updated Oct. 5, 2012, 1:50 p.m.</i></p>




<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;">Stopping the silence generator does not take into account that it may no \
longer be the active generator. This patch adds a small internal function that is \
currently only used for silence generator related code. It might be useful to add to \
the public API later on, or at the very least, everywhere in channel.c where stopping \
an generator is only valid if the current generator is as expected. This patch also \
adds a lock/unlock block around an unprotected assignment to chan-&gt;generatordata \
that also checks to see if the current generator is the one that is expected (there \
are almost certainly other spots that need looked at, but this little bit is itself \
creep).</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </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;">The problem as reported by the user was eventually reproduced by \
establishing configuration details inferred from the reporter&#39;s provided debug \
logs. Namely, enabling a configuration item that enables silence generation. A simple \
queue configuration with agent login reproduced the issue pretty reliably. The same \
actions were performed with the patch in place and music on hold resumed as \
expected.</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-19918">ASTERISK-19918</a>


</div>


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

 <li>/branches/1.8/main/channel.c <span style="color: grey">(374534)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/2152/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