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

List:       asterisk-dev
Subject:    Re: [asterisk-dev] [Code Review] 2603: Refactor RTCP events over to Stasis (with a bit of cleanup)
From:       "Joshua Colp" <reviewboard () asterisk ! org>
Date:       2013-06-27 17:09:07
Message-ID: 20130627170907.11681.38606 () 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/2603/#review8997
-----------------------------------------------------------



/trunk/include/asterisk/rtp_engine.h
<https://reviewboard.asterisk.org/r/2603/#comment17692>

    While I can understand not wanting a hard dependency my gut tells me that if the \
uniqueid gets upped this is going to get missed. Could mention it with the other \
define.



/trunk/include/asterisk/rtp_engine.h
<https://reviewboard.asterisk.org/r/2603/#comment17693>

    I'd add a note that it will remain valid for the lifetime of ast_rtp_instance, \
just in case.



/trunk/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/2603/#comment17694>

    I think it would be handy to have #defines for the types, for those reading.



/trunk/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/2603/#comment17695>

    Add some brackets to make this explicit.


- Joshua Colp


On June 24, 2013, 8:04 p.m., Matt Jordan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2603/
> -----------------------------------------------------------
> 
> (Updated June 24, 2013, 8:04 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-20754 and ASTERISK-21471
> https://issues.asterisk.org/jira/browse/ASTERISK-20754
> https://issues.asterisk.org/jira/browse/ASTERISK-21471
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> This patch does the following:
> 
> * It merges Jaco Kroon's patch from ASTERISK-20754, which provides channel \
> information in the RTCP events. Because Stasis provides a cache, Jaco's patch was \
> modified to pass the channel uniqueid to the RTP layer as opposed to a pointer to \
> the channel. This has the following benefits: (1) It keeps the RTP engine 'clean' \
> of references back to channels (2) It prevents circular dependencies and other \
>                 potential ref counting issues
> * The RTP engine now allows any RTP implementation to raise RTCP messages. \
> Potentially, other implementations (such as res_rtp_multicast) could also raise \
> RTCP information. The engine provides structs to represent RTCP headers and RTCP \
>                 SR/RR reports.
> * Some general refactoring in res_rtp_asterisk to done to try and tame the RTCP \
> code. It isn't perfect - that's *way* beyond the scope of this work - but it does \
>                 feel marginally better.
> * A few random bugs were fixed in the RTCP statistics. (Example: performing an \
>                 assignment of a = a is probably not correct)
> * We now raise RTCP events for each SR/RR sent/received. Previously we wouldn't \
> raise an event when we sent a RR report. 
> Note that this work will be of use to others who want to monitor call quality or \
> build modules that report call quality statistics. Since the events are now moving \
> across the Stasis message bus, this is far easier to accomplish. It is also a first \
> step (though by no means the last step) towards getting Olle's pinefrog work \
> incorporated. 
> 
> Diffs
> -----
> 
> /trunk/channels/chan_gtalk.c 392115 
> /trunk/channels/chan_gulp.c 392115 
> /trunk/channels/chan_h323.c 392115 
> /trunk/channels/chan_jingle.c 392115 
> /trunk/channels/chan_mgcp.c 392115 
> /trunk/channels/chan_motif.c 392115 
> /trunk/channels/chan_multicast_rtp.c 392115 
> /trunk/channels/chan_sip.c 392115 
> /trunk/channels/chan_skinny.c 392115 
> /trunk/channels/chan_unistim.c 392436 
> /trunk/include/asterisk/cdr.h 392115 
> /trunk/include/asterisk/channel.h 392115 
> /trunk/include/asterisk/json.h 392115 
> /trunk/include/asterisk/rtp_engine.h 392115 
> /trunk/main/asterisk.c 392115 
> /trunk/main/json.c 392115 
> /trunk/main/manager.c 392115 
> /trunk/main/rtp_engine.c 392115 
> /trunk/res/res_rtp_asterisk.c 392115 
> 
> Diff: https://reviewboard.asterisk.org/r/2603/diff/
> 
> 
> Testing
> -------
> 
> Lots. A lot of wiresharking.
> 
> Additionally, testing was done to ensure that the AMI event payloads matched the \
> RTCP packets sent between instances of Asterisk. 
> 
> 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/2603/">https://reviewboard.asterisk.org/r/2603/</a>
  </td>
    </tr>
   </table>
   <br />











<div>




<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/2603/diff/2/?file=40143#file40143line93" \
style="color: black; font-weight: bold; text-decoration: \
underline;">/trunk/include/asterisk/rtp_engine.h</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; ">extern \
&quot;C&quot; {</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">93</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="cp">#define MAX_CHANNEL_ID 150</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">While I can \
understand not wanting a hard dependency my gut tells me that if the uniqueid gets \
upped this is going to get missed. Could mention it with the other define.</pre> \
</div> <br />

<div>




<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/2603/diff/2/?file=40143#file40143line1603" \
style="color: black; font-weight: bold; text-decoration: \
underline;">/trunk/include/asterisk/rtp_engine.h</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; ">int \
ast_rtp_instance_fd(struct ast_rtp_instance *instance, int rtcp);</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">1603</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="cm"> *</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I&#39;d add \
a note that it will remain valid for the lifetime of ast_rtp_instance, just in \
case.</pre> </div>
<br />

<div>




<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/2603/diff/2/?file=40147#file40147line1820" \
style="color: black; font-weight: bold; text-decoration: \
underline;">/trunk/main/rtp_engine.c</a>  <span style="font-weight: normal;">

     (Diff revision 2)

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



 
 

 <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">1813</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="tb">	</span><span class="k">if</span> <span class="p">(</span><span \
class="n">payload</span><span class="o">-&gt;</span><span \
class="n">report</span><span class="o">-&gt;</span><span class="n">type</span> <span \
class="o">==</span> <span class="mi">200</span><span class="p">)</span> <span \
class="p">{</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I think it \
would be handy to have #defines for the types, for those reading.</pre> </div>
<br />

<div>




<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/2603/diff/2/?file=40147#file40147line1864" \
style="color: black; font-weight: bold; text-decoration: \
underline;">/trunk/main/rtp_engine.c</a>  <span style="font-weight: normal;">

     (Diff revision 2)

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



 
 

 <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">1857</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="tb">	</span><span class="n">rtcp_report</span> <span class="o">=</span> <span \
class="n">ao2_alloc</span><span class="p">(</span><span class="k">sizeof</span><span \
class="p">(</span><span class="o">*</span><span class="n">rtcp_report</span><span \
class="p">)</span> <span class="o">+</span> <span class="n">report_blocks</span> \
<span class="o">*</span> <span class="k">sizeof</span><span class="p">(</span><span \
class="k">struct</span> <span class="n">ast_rtp_rtcp_report_block</span> <span \
class="o">*</span><span class="p">),</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Add some \
brackets to make this explicit.</pre> </div>
<br />



<p>- Joshua</p>


<br />
<p>On June 24th, 2013, 8:04 p.m. UTC, Matt Jordan wrote:</p>








<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.</div>
<div>By Matt Jordan.</div>


<p style="color: grey;"><i>Updated June 24, 2013, 8:04 p.m.</i></p>







<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-20754">ASTERISK-20754</a>, \


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-21471">ASTERISK-21471</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;">This patch does the following:

* It merges Jaco Kroon&#39;s patch from ASTERISK-20754, which provides channel \
information in the RTCP events. Because Stasis provides a cache, Jaco&#39;s patch was \
modified to pass the channel uniqueid to the RTP layer as opposed to a pointer to the \
channel. This has the following benefits:  (1) It keeps the RTP engine \
&#39;clean&#39; of references back to channels  (2) It prevents circular dependencies \
                and other potential ref counting issues
* The RTP engine now allows any RTP implementation to raise RTCP messages. \
Potentially, other implementations (such as res_rtp_multicast) could also raise RTCP \
information. The engine provides structs to represent RTCP headers and RTCP SR/RR \
                reports.
* Some general refactoring in res_rtp_asterisk to done to try and tame the RTCP code. \
It isn&#39;t perfect - that&#39;s *way* beyond the scope of this work - but it does \
                feel marginally better.
* A few random bugs were fixed in the RTCP statistics. (Example: performing an \
                assignment of a = a is probably not correct)
* We now raise RTCP events for each SR/RR sent/received. Previously we wouldn&#39;t \
raise an event when we sent a RR report.

Note that this work will be of use to others who want to monitor call quality or \
build modules that report call quality statistics. Since the events are now moving \
across the Stasis message bus, this is far easier to accomplish. It is also a first \
step (though by no means the last step) towards getting Olle&#39;s pinefrog work \
incorporated.</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;">Lots. A lot of wiresharking.

Additionally, testing was done to ensure that the AMI event payloads matched the RTCP \
packets sent between instances of Asterisk.</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>/trunk/channels/chan_gtalk.c <span style="color: grey">(392115)</span></li>

 <li>/trunk/channels/chan_gulp.c <span style="color: grey">(392115)</span></li>

 <li>/trunk/channels/chan_h323.c <span style="color: grey">(392115)</span></li>

 <li>/trunk/channels/chan_jingle.c <span style="color: grey">(392115)</span></li>

 <li>/trunk/channels/chan_mgcp.c <span style="color: grey">(392115)</span></li>

 <li>/trunk/channels/chan_motif.c <span style="color: grey">(392115)</span></li>

 <li>/trunk/channels/chan_multicast_rtp.c <span style="color: \
grey">(392115)</span></li>

 <li>/trunk/channels/chan_sip.c <span style="color: grey">(392115)</span></li>

 <li>/trunk/channels/chan_skinny.c <span style="color: grey">(392115)</span></li>

 <li>/trunk/channels/chan_unistim.c <span style="color: grey">(392436)</span></li>

 <li>/trunk/include/asterisk/cdr.h <span style="color: grey">(392115)</span></li>

 <li>/trunk/include/asterisk/channel.h <span style="color: grey">(392115)</span></li>

 <li>/trunk/include/asterisk/json.h <span style="color: grey">(392115)</span></li>

 <li>/trunk/include/asterisk/rtp_engine.h <span style="color: \
grey">(392115)</span></li>

 <li>/trunk/main/asterisk.c <span style="color: grey">(392115)</span></li>

 <li>/trunk/main/json.c <span style="color: grey">(392115)</span></li>

 <li>/trunk/main/manager.c <span style="color: grey">(392115)</span></li>

 <li>/trunk/main/rtp_engine.c <span style="color: grey">(392115)</span></li>

 <li>/trunk/res/res_rtp_asterisk.c <span style="color: grey">(392115)</span></li>

</ul>

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