<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13753">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Friendly Automation: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">REVERT: Add option to suppress the Message channel AMI and ARI events<br><br>This reverts commit bdcf8e71655cd2fd79264e212cb50494c70c1e05.<br><br>Reason for revert: Per discussion on IRC we're sticking to policy.<br><br>Change-Id: I13e14edd2e410d26e8d1b8a1fe8e8dbc63536542<br>---<br>M configs/samples/asterisk.conf.sample<br>D doc/CHANGES-staging/hide_messaging_ami_events<br>M include/asterisk/options.h<br>M main/asterisk.c<br>M main/message.c<br>M main/options.c<br>6 files changed, 1 insertion(+), 27 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/configs/samples/asterisk.conf.sample b/configs/samples/asterisk.conf.sample</span><br><span>index bf0bdba..5f33abb 100644</span><br><span>--- a/configs/samples/asterisk.conf.sample</span><br><span>+++ b/configs/samples/asterisk.conf.sample</span><br><span>@@ -118,11 +118,6 @@</span><br><span> ; calls are not accepted by a remote</span><br><span> ; implementation, please report this and go</span><br><span> ; back to value 96.</span><br><span style="color: hsl(0, 100%, 40%);">-;hide_messaging_ami_events = no; This option, if enabled, will</span><br><span style="color: hsl(0, 100%, 40%);">- ; suppress all of the Message/ast_msg_queue channel's</span><br><span style="color: hsl(0, 100%, 40%);">- ; housekeeping AMI and ARI channel events. This can</span><br><span style="color: hsl(0, 100%, 40%);">- ; reduce the load on the manager and ARI applications</span><br><span style="color: hsl(0, 100%, 40%);">- ; when the Digium Phone Module for Asterisk is in use.</span><br><span> </span><br><span> ; Changing the following lines may compromise your security.</span><br><span> ;[files]</span><br><span>diff --git a/doc/CHANGES-staging/hide_messaging_ami_events b/doc/CHANGES-staging/hide_messaging_ami_events</span><br><span>deleted file mode 100644</span><br><span>index 0afbeec..0000000</span><br><span>--- a/doc/CHANGES-staging/hide_messaging_ami_events</span><br><span>+++ /dev/null</span><br><span>@@ -1,11 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-Subject: Messaging</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-In order to reduce the amount of AMI and ARI events generated,</span><br><span style="color: hsl(0, 100%, 40%);">-the global "Message/ast_msg_queue" channel can be set to suppress</span><br><span style="color: hsl(0, 100%, 40%);">-it's normal channel housekeeping events such as "Newexten",</span><br><span style="color: hsl(0, 100%, 40%);">-"VarSet", etc. This can greatly reduce load on the manager</span><br><span style="color: hsl(0, 100%, 40%);">-and ARI applications when the Digium Phone Module for Asterisk</span><br><span style="color: hsl(0, 100%, 40%);">-is in use. To enable, set "hide_messaging_ami_events" in</span><br><span style="color: hsl(0, 100%, 40%);">-asterisk.conf to "yes" In Asterisk versions <18, the default</span><br><span style="color: hsl(0, 100%, 40%);">-is "no" preserving existing behavior. Beginning with</span><br><span style="color: hsl(0, 100%, 40%);">-Asterisk 18, the option will default to "yes".</span><br><span>diff --git a/include/asterisk/options.h b/include/asterisk/options.h</span><br><span>index f8c813f..6c4e552 100644</span><br><span>--- a/include/asterisk/options.h</span><br><span>+++ b/include/asterisk/options.h</span><br><span>@@ -84,8 +84,6 @@</span><br><span> AST_OPT_FLAG_DEBUG_MODULE = (1 << 23),</span><br><span> /*! Terminal colors should be adjusted for a light-colored background */</span><br><span> AST_OPT_FLAG_LIGHT_BACKGROUND = (1 << 25),</span><br><span style="color: hsl(0, 100%, 40%);">- /*! Make the global Message channel an internal channel to suppress AMI events */</span><br><span style="color: hsl(0, 100%, 40%);">- AST_OPT_FLAG_HIDE_MESSAGING_AMI_EVENTS = (1 << 26),</span><br><span> /*! Force black background */</span><br><span> AST_OPT_FLAG_FORCE_BLACK_BACKGROUND = (1 << 27),</span><br><span> /*! Hide remote console connect messages on console */</span><br><span>@@ -131,7 +129,6 @@</span><br><span> #define ast_opt_generic_plc ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC)</span><br><span> #define ast_opt_ref_debug ast_test_flag(&ast_options, AST_OPT_FLAG_REF_DEBUG)</span><br><span> #define ast_opt_generic_plc_on_equal_codecs ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC_ON_EQUAL_CODECS)</span><br><span style="color: hsl(0, 100%, 40%);">-#define ast_opt_hide_messaging_ami_events ast_test_flag(&ast_options, AST_OPT_FLAG_HIDE_MESSAGING_AMI_EVENTS)</span><br><span> </span><br><span> /*! Maximum log level defined by PJPROJECT. */</span><br><span> #define MAX_PJ_LOG_MAX_LEVEL 6</span><br><span>diff --git a/main/asterisk.c b/main/asterisk.c</span><br><span>index 6ae9219..dd2ae6f 100644</span><br><span>--- a/main/asterisk.c</span><br><span>+++ b/main/asterisk.c</span><br><span>@@ -509,7 +509,6 @@</span><br><span> ast_cli(a->fd, " Transmit silence during rec: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSMIT_SILENCE) ? "Enabled" : "Disabled");</span><br><span> ast_cli(a->fd, " Generic PLC: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC) ? "Enabled" : "Disabled");</span><br><span> ast_cli(a->fd, " Generic PLC on equal codecs: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC_ON_EQUAL_CODECS) ? "Enabled" : "Disabled");</span><br><span style="color: hsl(0, 100%, 40%);">- ast_cli(a->fd, " Hide Msg Chan AMI events: %s\n", ast_opt_hide_messaging_ami_events ? "Enabled" : "Disabled");</span><br><span> ast_cli(a->fd, " Min DTMF duration:: %u\n", option_dtmfminduration);</span><br><span> #if !defined(LOW_MEMORY)</span><br><span> ast_cli(a->fd, " Cache media frames: %s\n", ast_opt_cache_media_frames ? "Enabled" : "Disabled");</span><br><span>diff --git a/main/message.c b/main/message.c</span><br><span>index 39b8d87..4874162 100644</span><br><span>--- a/main/message.c</span><br><span>+++ b/main/message.c</span><br><span>@@ -283,7 +283,7 @@</span><br><span> * This will not be registered as we never want anything to try</span><br><span> * to create Message channels other than internally in this file.</span><br><span> */</span><br><span style="color: hsl(0, 100%, 40%);">-static struct ast_channel_tech msg_chan_tech_hack = {</span><br><span style="color: hsl(120, 100%, 40%);">+static const struct ast_channel_tech msg_chan_tech_hack = {</span><br><span> .type = "Message",</span><br><span> .description = "Internal Text Message Processing",</span><br><span> .read = chan_msg_read,</span><br><span>@@ -685,10 +685,6 @@</span><br><span> return NULL;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_opt_hide_messaging_ami_events) {</span><br><span style="color: hsl(0, 100%, 40%);">- msg_chan_tech_hack.properties |= AST_CHAN_TP_INTERNAL;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> ast_channel_tech_set(chan, &msg_chan_tech_hack);</span><br><span> ast_channel_unlock(chan);</span><br><span> ast_channel_unlink(chan);</span><br><span>diff --git a/main/options.c b/main/options.c</span><br><span>index 38a646e..ea97a6a 100644</span><br><span>--- a/main/options.c</span><br><span>+++ b/main/options.c</span><br><span>@@ -457,8 +457,6 @@</span><br><span> }</span><br><span> } else if (!strcasecmp(v->name, "live_dangerously")) {</span><br><span> live_dangerously = ast_true(v->value);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strcasecmp(v->name, "hide_messaging_ami_events")) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_HIDE_MESSAGING_AMI_EVENTS);</span><br><span> }</span><br><span> }</span><br><span> if (!ast_opt_remote) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13753">change 13753</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/+/13753"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 17.2 </div>
<div style="display:none"> Gerrit-Change-Id: I13e14edd2e410d26e8d1b8a1fe8e8dbc63536542 </div>
<div style="display:none"> Gerrit-Change-Number: 13753 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>