<p>Kevin Harwell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15517">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_rtp_asterisk: Add packet subtype during RTCP debug when relevant<br><br>For some RTCP packet types the report count is actually the packet's subtype.<br>This was not being reflected in the packet debug output.<br><br>This patch makes it so for some RTCP packet types a "Packet Subtype" is<br>now output in the debug replacing the "Reception reports" (i.e count).<br><br>Change-Id: Id4f4b77bb37077a4c4f039abd6a069287bfefcb8<br>---<br>M res/res_rtp_asterisk.c<br>1 file changed, 28 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/17/15517/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c</span><br><span>index ad9cb7d..403c397 100644</span><br><span>--- a/res/res_rtp_asterisk.c</span><br><span>+++ b/res/res_rtp_asterisk.c</span><br><span>@@ -5926,6 +5926,26 @@</span><br><span> return str;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static const char *rtcp_payload_subtype2str(unsigned int pt, unsigned int subtype)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ switch (pt) {</span><br><span style="color: hsl(120, 100%, 40%);">+ case AST_RTP_RTCP_RTPFB:</span><br><span style="color: hsl(120, 100%, 40%);">+ if (subtype == AST_RTP_RTCP_FMT_NACK) {</span><br><span style="color: hsl(120, 100%, 40%);">+ return "NACK";</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ case RTCP_PT_PSFB:</span><br><span style="color: hsl(120, 100%, 40%);">+ if (subtype == AST_RTP_RTCP_FMT_REMB) {</span><br><span style="color: hsl(120, 100%, 40%);">+ return "REMB";</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ default:</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*! \pre instance is locked */</span><br><span> static int ast_rtp_rtcp_handle_nack(struct ast_rtp_instance *instance, unsigned int *nackdata, unsigned int position,</span><br><span> unsigned int length)</span><br><span>@@ -6255,10 +6275,16 @@</span><br><span> }</span><br><span> </span><br><span> if (rtcp_debug_test_addr(addr)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ const char *subtype = rtcp_payload_subtype2str(pt, rc);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> ast_verbose("\n");</span><br><span> ast_verbose("RTCP from %s\n", ast_sockaddr_stringify(addr));</span><br><span style="color: hsl(0, 100%, 40%);">- ast_verbose("PT: %u(%s)\n", pt, rtcp_payload_type2str(pt));</span><br><span style="color: hsl(0, 100%, 40%);">- ast_verbose("Reception reports: %u\n", rc);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_verbose("PT: %u (%s)\n", pt, rtcp_payload_type2str(pt));</span><br><span style="color: hsl(120, 100%, 40%);">+ if (subtype) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_verbose("Packet Subtype: %u (%s)\n", rc, subtype);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_verbose("Reception reports: %u\n", rc);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> ast_verbose("SSRC of sender: %u\n", ssrc);</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15517">change 15517</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/15517"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: Id4f4b77bb37077a4c4f039abd6a069287bfefcb8 </div>
<div style="display:none"> Gerrit-Change-Number: 15517 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>