[Asterisk-code-review] message.c: Add option to suppress the Message channel AMI and ARI eve... (asterisk[16.8])
Joshua Colp
asteriskteam at digium.com
Tue Feb 4 07:31:13 CST 2020
Hello George Joseph, Kevin Harwell, Friendly Automation,
I'd like you to do a code review. Please visit
https://gerrit.asterisk.org/c/asterisk/+/13752
to review the following change.
Change subject: message.c: Add option to suppress the Message channel AMI and ARI events"
......................................................................
message.c: Add option to suppress the Message channel AMI and ARI events"
This reverts commit bfe9e1b2e7a489b7eb49a98d290f2e3a68a34dca.
Reason for revert: Per discussion on IRC we're sticking to policy.
Change-Id: Ib8e148adde00e3ed14b04ef1c7e9bab7fe184e76
---
M configs/samples/asterisk.conf.sample
D doc/CHANGES-staging/hide_messaging_ami_events
M include/asterisk/options.h
M main/asterisk.c
M main/message.c
M main/options.c
6 files changed, 1 insertion(+), 27 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/52/13752/1
diff --git a/configs/samples/asterisk.conf.sample b/configs/samples/asterisk.conf.sample
index bf0bdba..5f33abb 100644
--- a/configs/samples/asterisk.conf.sample
+++ b/configs/samples/asterisk.conf.sample
@@ -118,11 +118,6 @@
; calls are not accepted by a remote
; implementation, please report this and go
; back to value 96.
-;hide_messaging_ami_events = no; This option, if enabled, will
- ; suppress all of the Message/ast_msg_queue channel's
- ; housekeeping AMI and ARI channel events. This can
- ; reduce the load on the manager and ARI applications
- ; when the Digium Phone Module for Asterisk is in use.
; Changing the following lines may compromise your security.
;[files]
diff --git a/doc/CHANGES-staging/hide_messaging_ami_events b/doc/CHANGES-staging/hide_messaging_ami_events
deleted file mode 100644
index 0afbeec..0000000
--- a/doc/CHANGES-staging/hide_messaging_ami_events
+++ /dev/null
@@ -1,11 +0,0 @@
-Subject: Messaging
-
-In order to reduce the amount of AMI and ARI events generated,
-the global "Message/ast_msg_queue" channel can be set to suppress
-it's normal channel housekeeping events such as "Newexten",
-"VarSet", etc. This can greatly reduce load on the manager
-and ARI applications when the Digium Phone Module for Asterisk
-is in use. To enable, set "hide_messaging_ami_events" in
-asterisk.conf to "yes" In Asterisk versions <18, the default
-is "no" preserving existing behavior. Beginning with
-Asterisk 18, the option will default to "yes".
diff --git a/include/asterisk/options.h b/include/asterisk/options.h
index f8c813f..6c4e552 100644
--- a/include/asterisk/options.h
+++ b/include/asterisk/options.h
@@ -84,8 +84,6 @@
AST_OPT_FLAG_DEBUG_MODULE = (1 << 23),
/*! Terminal colors should be adjusted for a light-colored background */
AST_OPT_FLAG_LIGHT_BACKGROUND = (1 << 25),
- /*! Make the global Message channel an internal channel to suppress AMI events */
- AST_OPT_FLAG_HIDE_MESSAGING_AMI_EVENTS = (1 << 26),
/*! Force black background */
AST_OPT_FLAG_FORCE_BLACK_BACKGROUND = (1 << 27),
/*! Hide remote console connect messages on console */
@@ -131,7 +129,6 @@
#define ast_opt_generic_plc ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC)
#define ast_opt_ref_debug ast_test_flag(&ast_options, AST_OPT_FLAG_REF_DEBUG)
#define ast_opt_generic_plc_on_equal_codecs ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC_ON_EQUAL_CODECS)
-#define ast_opt_hide_messaging_ami_events ast_test_flag(&ast_options, AST_OPT_FLAG_HIDE_MESSAGING_AMI_EVENTS)
/*! Maximum log level defined by PJPROJECT. */
#define MAX_PJ_LOG_MAX_LEVEL 6
diff --git a/main/asterisk.c b/main/asterisk.c
index 037c7cd..38084b4 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -506,7 +506,6 @@
ast_cli(a->fd, " Transmit silence during rec: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSMIT_SILENCE) ? "Enabled" : "Disabled");
ast_cli(a->fd, " Generic PLC: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC) ? "Enabled" : "Disabled");
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");
- ast_cli(a->fd, " Hide Msg Chan AMI events: %s\n", ast_opt_hide_messaging_ami_events ? "Enabled" : "Disabled");
ast_cli(a->fd, " Min DTMF duration:: %u\n", option_dtmfminduration);
#if !defined(LOW_MEMORY)
ast_cli(a->fd, " Cache media frames: %s\n", ast_opt_cache_media_frames ? "Enabled" : "Disabled");
diff --git a/main/message.c b/main/message.c
index 39b8d87..4874162 100644
--- a/main/message.c
+++ b/main/message.c
@@ -283,7 +283,7 @@
* This will not be registered as we never want anything to try
* to create Message channels other than internally in this file.
*/
-static struct ast_channel_tech msg_chan_tech_hack = {
+static const struct ast_channel_tech msg_chan_tech_hack = {
.type = "Message",
.description = "Internal Text Message Processing",
.read = chan_msg_read,
@@ -685,10 +685,6 @@
return NULL;
}
- if (ast_opt_hide_messaging_ami_events) {
- msg_chan_tech_hack.properties |= AST_CHAN_TP_INTERNAL;
- }
-
ast_channel_tech_set(chan, &msg_chan_tech_hack);
ast_channel_unlock(chan);
ast_channel_unlink(chan);
diff --git a/main/options.c b/main/options.c
index d6b48db..1da787f 100644
--- a/main/options.c
+++ b/main/options.c
@@ -464,8 +464,6 @@
}
} else if (!strcasecmp(v->name, "live_dangerously")) {
live_dangerously = ast_true(v->value);
- } else if (!strcasecmp(v->name, "hide_messaging_ami_events")) {
- ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_HIDE_MESSAGING_AMI_EVENTS);
}
}
if (!ast_opt_remote) {
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13752
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16.8
Gerrit-Change-Id: Ib8e148adde00e3ed14b04ef1c7e9bab7fe184e76
Gerrit-Change-Number: 13752
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200204/99b8b709/attachment-0001.html>
More information about the asterisk-code-review
mailing list