Skip to content

Commit b90650d

Browse files
InterLinked1jcolp
authored andcommitted
app_meetme: Don't erroneously set global variables.
The admin_exec function in app_meetme is used by the SLA applications for internal bridging. However, in these cases, chan is NULL. Currently, this function will set some status variables that are intended for a channel, but since channel is NULL, this is erroneously creating meaningless global variables, which shouldn't be happening. This sets these variables only if chan is not NULL. ASTERISK-30002 #close Change-Id: I817df6c26f5bda131678e56791b0b61ba64fc6f7
1 parent 4585a9c commit b90650d

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

apps/app_meetme.c

+12-4
Original file line numberDiff line numberDiff line change
@@ -5239,7 +5239,9 @@ static int admin_exec(struct ast_channel *chan, const char *data) {
52395239

52405240
if (ast_strlen_zero(data)) {
52415241
ast_log(LOG_WARNING, "MeetMeAdmin requires an argument!\n");
5242-
pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOPARSE");
5242+
if (chan) {
5243+
pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOPARSE");
5244+
}
52435245
return -1;
52445246
}
52455247

@@ -5248,7 +5250,9 @@ static int admin_exec(struct ast_channel *chan, const char *data) {
52485250

52495251
if (!args.command) {
52505252
ast_log(LOG_WARNING, "MeetmeAdmin requires a command!\n");
5251-
pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOPARSE");
5253+
if (chan) {
5254+
pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOPARSE");
5255+
}
52525256
return -1;
52535257
}
52545258

@@ -5261,7 +5265,9 @@ static int admin_exec(struct ast_channel *chan, const char *data) {
52615265
if (!cnf) {
52625266
ast_log(LOG_WARNING, "Conference number '%s' not found!\n", args.confno);
52635267
AST_LIST_UNLOCK(&confs);
5264-
pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOTFOUND");
5268+
if (chan) {
5269+
pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOTFOUND");
5270+
}
52655271
return 0;
52665272
}
52675273

@@ -5384,7 +5390,9 @@ static int admin_exec(struct ast_channel *chan, const char *data) {
53845390
AST_LIST_UNLOCK(&confs);
53855391

53865392
dispose_conf(cnf);
5387-
pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", res == -2 ? "NOTFOUND" : res ? "FAILED" : "OK");
5393+
if (chan) {
5394+
pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", res == -2 ? "NOTFOUND" : res ? "FAILED" : "OK");
5395+
}
53885396

53895397
return 0;
53905398
}

0 commit comments

Comments
 (0)