<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16274">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mgcp: Remove dead debug code<br><br>ASTERISK-20399 #close<br><br>Change-Id: I36f364aaa1971241d8f3ea1a5909b463d185a2d5<br>---<br>M channels/chan_mgcp.c<br>M res/res_pktccops.c<br>2 files changed, 3 insertions(+), 66 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/74/16274/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c</span><br><span>index 2c8c525..12b6636 100644</span><br><span>--- a/channels/chan_mgcp.c</span><br><span>+++ b/channels/chan_mgcp.c</span><br><span>@@ -239,8 +239,6 @@</span><br><span> static struct in_addr __ourip;</span><br><span> static int ourport;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static int mgcpdebug = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> static struct ast_sched_context *sched;</span><br><span> static struct io_context *io;</span><br><span> /*! The private structures of the mgcp channels are linked for</span><br><span>@@ -1070,13 +1068,13 @@</span><br><span> e->usage =</span><br><span> "Usage: mgcp audit endpoint <endpointid>\n"</span><br><span> " Lists the capabilities of an endpoint in the MGCP (Media Gateway Control Protocol) subsystem.\n"</span><br><span style="color: hsl(0, 100%, 40%);">- " mgcp debug MUST be on to see the results of this command.\n";</span><br><span style="color: hsl(120, 100%, 40%);">+ " Debug logging (core set debug on) MUST be on to see the results of this command.\n";</span><br><span> return NULL;</span><br><span> case CLI_GENERATE:</span><br><span> return NULL;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (!mgcpdebug) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!DEBUG_ATLEAST(1)) {</span><br><span> return CLI_SHOWUSAGE;</span><br><span> }</span><br><span> if (a->argc != 4)</span><br><span>@@ -1118,38 +1116,9 @@</span><br><span> return CLI_SUCCESS;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static char *handle_mgcp_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- switch (cmd) {</span><br><span style="color: hsl(0, 100%, 40%);">- case CLI_INIT:</span><br><span style="color: hsl(0, 100%, 40%);">- e->command = "mgcp set debug {on|off}";</span><br><span style="color: hsl(0, 100%, 40%);">- e->usage =</span><br><span style="color: hsl(0, 100%, 40%);">- "Usage: mgcp set debug {on|off}\n"</span><br><span style="color: hsl(0, 100%, 40%);">- " Enables/Disables dumping of MGCP packets for debugging purposes\n";</span><br><span style="color: hsl(0, 100%, 40%);">- return NULL;</span><br><span style="color: hsl(0, 100%, 40%);">- case CLI_GENERATE:</span><br><span style="color: hsl(0, 100%, 40%);">- return NULL;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (a->argc != e->args)</span><br><span style="color: hsl(0, 100%, 40%);">- return CLI_SHOWUSAGE;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strncasecmp(a->argv[e->args - 1], "on", 2)) {</span><br><span style="color: hsl(0, 100%, 40%);">- mgcpdebug = 1;</span><br><span style="color: hsl(0, 100%, 40%);">- ast_cli(a->fd, "MGCP Debugging Enabled\n");</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp(a->argv[3], "off", 3)) {</span><br><span style="color: hsl(0, 100%, 40%);">- mgcpdebug = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- ast_cli(a->fd, "MGCP Debugging Disabled\n");</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">- return CLI_SHOWUSAGE;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- return CLI_SUCCESS;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> static struct ast_cli_entry cli_mgcp[] = {</span><br><span> AST_CLI_DEFINE(handle_mgcp_audit_endpoint, "Audit specified MGCP endpoint"),</span><br><span> AST_CLI_DEFINE(handle_mgcp_show_endpoints, "List defined MGCP endpoints"),</span><br><span style="color: hsl(0, 100%, 40%);">- AST_CLI_DEFINE(handle_mgcp_set_debug, "Enable/Disable MGCP debugging"),</span><br><span> AST_CLI_DEFINE(mgcp_reload, "Reload MGCP configuration"),</span><br><span> };</span><br><span> </span><br><span>diff --git a/res/res_pktccops.c b/res/res_pktccops.c</span><br><span>index 9beabfb..2539a30 100644</span><br><span>--- a/res/res_pktccops.c</span><br><span>+++ b/res/res_pktccops.c</span><br><span>@@ -158,7 +158,6 @@</span><br><span> static uint16_t t7 = 200;</span><br><span> static uint16_t t8 = 300;</span><br><span> static uint32_t keepalive = 60;</span><br><span style="color: hsl(0, 100%, 40%);">-static int pktccopsdebug = 0;</span><br><span> static int pktcreload = 0;</span><br><span> static int gateinfoperiod = 60;</span><br><span> static int gatetimeout = 150;</span><br><span>@@ -637,9 +636,7 @@</span><br><span> ast_debug(1, "Construct new gate\n");</span><br><span> cops_construct_gate(cmd, gateset->object->next->next->next->contents, trid, mta, actcount, bitrate, psize, ssip, ssport, 0, cmts);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- if (pktccopsdebug) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_debug(3, "send cmd\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_debug(3, "send cmd\n");</span><br><span> cops_sendmsg(cmts->sfd, gateset);</span><br><span> cops_freemsg(gateset);</span><br><span> ast_free(gateset);</span><br><span>@@ -1380,41 +1377,12 @@</span><br><span> return CLI_SUCCESS;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static char *pktccops_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- switch (cmd) {</span><br><span style="color: hsl(0, 100%, 40%);">- case CLI_INIT:</span><br><span style="color: hsl(0, 100%, 40%);">- e->command = "pktccops set debug {on|off}";</span><br><span style="color: hsl(0, 100%, 40%);">- e->usage =</span><br><span style="color: hsl(0, 100%, 40%);">- "Usage: pktccops set debug {on|off}\n"</span><br><span style="color: hsl(0, 100%, 40%);">- " Turn on/off debuging\n";</span><br><span style="color: hsl(0, 100%, 40%);">- return NULL;</span><br><span style="color: hsl(0, 100%, 40%);">- case CLI_GENERATE:</span><br><span style="color: hsl(0, 100%, 40%);">- return NULL;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (a->argc != e->args)</span><br><span style="color: hsl(0, 100%, 40%);">- return CLI_SHOWUSAGE;</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strncasecmp(a->argv[e->args - 1], "on", 2)) {</span><br><span style="color: hsl(0, 100%, 40%);">- pktccopsdebug = 1;</span><br><span style="color: hsl(0, 100%, 40%);">- ast_cli(a->fd, "PktcCOPS Debugging Enabled\n");</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp(a->argv[e->args - 1], "off", 2)) {</span><br><span style="color: hsl(0, 100%, 40%);">- pktccopsdebug = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- ast_cli(a->fd, "PktcCOPS Debugging Disabled\n");</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">- return CLI_SHOWUSAGE;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- return CLI_SUCCESS;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> static struct ast_cli_entry cli_pktccops[] = {</span><br><span> AST_CLI_DEFINE(pktccops_show_cmtses, "List PacketCable COPS CMTSes"),</span><br><span> AST_CLI_DEFINE(pktccops_show_gates, "List PacketCable COPS GATEs"),</span><br><span> AST_CLI_DEFINE(pktccops_show_pools, "List PacketCable MTA pools"),</span><br><span> AST_CLI_DEFINE(pktccops_gateset, "Send Gate-Set to cmts"),</span><br><span> AST_CLI_DEFINE(pktccops_gatedel, "Send Gate-Det to cmts"),</span><br><span style="color: hsl(0, 100%, 40%);">- AST_CLI_DEFINE(pktccops_debug, "Enable/Disable COPS debugging")</span><br><span> };</span><br><span> </span><br><span> static int pktccops_add_ippool(struct cops_ippool *ippool)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16274">change 16274</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/+/16274"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: I36f364aaa1971241d8f3ea1a5909b463d185a2d5 </div>
<div style="display:none"> Gerrit-Change-Number: 16274 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>