diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-27 16:19:16 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-27 16:19:16 +0000 |
commit | 6c7801bd4a3953e532d0ba0b7f1ba65d60341b78 (patch) | |
tree | 16c76550d0ea93c7cab9d76b41c4325449322a12 /apps/app_queue.c | |
parent | 4c68192dd69bec598e4e420b70a64271d9011602 (diff) |
Merged revisions 125855 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r125855 | mmichelson | 2008-06-27 11:16:13 -0500 (Fri, 27 Jun 2008) | 5 lines
Ensure the thread-safety of the monexec variable in app_queue.
Thanks to Russell for pointing out the problem
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@125859 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r-- | apps/app_queue.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index 74e7c581d..dd4750640 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -3489,11 +3489,18 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce if (!qe->parent->montype) { const char *monexec, *monargs; ast_debug(1, "Starting Monitor as requested.\n"); + ast_channel_lock(qe->chan); monitorfilename = pbx_builtin_getvar_helper(qe->chan, "MONITOR_FILENAME"); - if ((monexec = pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC")) || (monargs = pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC_ARGS"))) + if (monitorfilename) { + monitorfilename = ast_strdupa(monitorfilename); + } + if ((monexec = pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC")) || (monargs = pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC_ARGS"))) { which = qe->chan; + monexec = monexec ? ast_strdupa(monexec) : NULL; + } else which = peer; + ast_channel_unlock(qe->chan); if (monitorfilename) ast_monitor_start(which, qe->parent->monfmt, monitorfilename, 1, X_REC_IN | X_REC_OUT); else if (qe->chan->cdr) |