<p>Rodrigo Ramirez Norambuena has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13853">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_rtp_asterisk: Add 'rtp show settings' cli command<br><br>This change introduce a CLI command for the RTP to display the general<br>configuration.<br><br>In the first step add the follow fields of the configurations:<br>  - rtpstart<br>  - rtpend<br>  - dtmftimeout<br>  - rtpchecksum<br>  - strictrtp<br>  - learning_min_sequential<br>  - icesupport<br><br>Change-Id: Ibe5450898e2c3e1ed68c10993aa1ac6bf09b821f<br>---<br>M res/res_rtp_asterisk.c<br>1 file changed, 34 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/53/13853/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 969fc2d..5d39487 100644</span><br><span>--- a/res/res_rtp_asterisk.c</span><br><span>+++ b/res/res_rtp_asterisk.c</span><br><span>@@ -8652,6 +8652,39 @@</span><br><span>     return CLI_SHOWUSAGE;   /* default, failure */</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static char *handle_cli_rtp_settings(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+  switch (cmd) {</span><br><span style="color: hsl(120, 100%, 40%);">+        case CLI_INIT:</span><br><span style="color: hsl(120, 100%, 40%);">+                e->command = "rtp show settings";</span><br><span style="color: hsl(120, 100%, 40%);">+                e->usage =</span><br><span style="color: hsl(120, 100%, 40%);">+                 "Usage: rtp show settings\n"</span><br><span style="color: hsl(120, 100%, 40%);">+                        "       Display settings configuration of the RTP\n";</span><br><span style="color: hsl(120, 100%, 40%);">+               return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+  case CLI_GENERATE:</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 style="color: hsl(120, 100%, 40%);">+   if (a->argc != 3)</span><br><span style="color: hsl(120, 100%, 40%);">+          return CLI_SHOWUSAGE;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       ast_cli(a->fd, "\n\nGeneral Settings:\n");</span><br><span style="color: hsl(120, 100%, 40%);">+       ast_cli(a->fd, "----------------\n");</span><br><span style="color: hsl(120, 100%, 40%);">+    ast_cli(a->fd, "  Port start:      %d\n", rtpstart);</span><br><span style="color: hsl(120, 100%, 40%);">+     ast_cli(a->fd, "  Port end:        %d\n", rtpend);</span><br><span style="color: hsl(120, 100%, 40%);">+       ast_cli(a->fd, "  RTP Check sums:  %s\n", AST_CLI_YESNO(nochecksums == 0));</span><br><span style="color: hsl(120, 100%, 40%);">+      ast_cli(a->fd, "  DTFM Timeout:    %d\n", dtmftimeout);</span><br><span style="color: hsl(120, 100%, 40%);">+  ast_cli(a->fd, "  Strict RTP:      %s\n", AST_CLI_YESNO(strictrtp));</span><br><span style="color: hsl(120, 100%, 40%);">+     if (strictrtp)</span><br><span style="color: hsl(120, 100%, 40%);">+                ast_cli(a->fd, "  Probation :      %d\n", learning_min_sequential);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    ast_cli(a->fd, "  ICE support:     %s\n", AST_CLI_YESNO(icesupport));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  return CLI_SUCCESS;</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%);">+</span><br><span> static char *handle_cli_rtcp_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)</span><br><span> {</span><br><span>  switch (cmd) {</span><br><span>@@ -8714,6 +8747,7 @@</span><br><span> </span><br><span> static struct ast_cli_entry cli_rtp[] = {</span><br><span>      AST_CLI_DEFINE(handle_cli_rtp_set_debug,  "Enable/Disable RTP debugging"),</span><br><span style="color: hsl(120, 100%, 40%);">+  AST_CLI_DEFINE(handle_cli_rtp_settings,   "Display RTP settings"),</span><br><span>         AST_CLI_DEFINE(handle_cli_rtcp_set_debug, "Enable/Disable RTCP debugging"),</span><br><span>        AST_CLI_DEFINE(handle_cli_rtcp_set_stats, "Enable/Disable RTCP stats"),</span><br><span> };</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13853">change 13853</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/+/13853"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ibe5450898e2c3e1ed68c10993aa1ac6bf09b821f </div>
<div style="display:none"> Gerrit-Change-Number: 13853 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Rodrigo Ramirez Norambuena <a@rodrigoramirez.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>