ASTERISK_29853 added the ability to selectively disable
AMI events on a global basis, but the logic for this uses
strstr which means that events with names which are the prefix
of another event, if disabled, could disable those events as
well.
Instead, we account for this possibility to prevent this
undesired behavior from occuring.
ASTERISK_29853
Change-Id: Icccd1872602889806740971e4adf932f92466959
int res;
if (!ast_strlen_zero(manager_disabledevents)) {
- if (strstr(manager_disabledevents, event)) {
+ if (ast_in_delimited_string(event, manager_disabledevents, ',')) {
ast_debug(3, "AMI Event '%s' is globally disabled, skipping\n", event);
/* Event is globally disabled */
ao2_cleanup(sessions);