aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-08-26 23:04:20 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-08-26 23:04:20 +0000
commit758a35b46b3fbba39556b40f2e0bdc3f546299b5 (patch)
tree50bdcccc4ad3e62e2243bebac71c2a9eb6369d9a
parente715954beff50826e7534510488c8806c4d0e375 (diff)
ensure that 'Events: On' enables all event types (issue #5016)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6429 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xmanager.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/manager.c b/manager.c
index f868b9560..3626bd5a2 100755
--- a/manager.c
+++ b/manager.c
@@ -395,19 +395,21 @@ static int ast_is_number(char *string)
static int ast_strings_to_mask(char *string)
{
- int x = 0, ret = -1;
+ int x, ret = -1;
x = ast_is_number(string);
- if (x)
+ if (x) {
ret = x;
- else if (!string || ast_strlen_zero(string))
+ } else if (!string || ast_strlen_zero(string)) {
ret = -1;
- else if (!strcasecmp(string, "off") || ast_false(string))
+ } else if (ast_false(string)) {
ret = 0;
- else if (!strcasecmp(string, "on") || ast_true(string))
- ret = 1;
- else {
+ } else if (ast_true(string)) {
+ ret = 0;
+ for (x=0; x<sizeof(perms) / sizeof(perms[0]); x++)
+ ret |= perms[x].num;
+ } else {
ret = 0;
for (x=0; x<sizeof(perms) / sizeof(perms[0]); x++) {
if (ast_instring(string, perms[x].label, ','))