diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-27 16:16:13 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-27 16:16:13 +0000 |
commit | ca234253a66e80509ae8a78bc45c7333ad359895 (patch) | |
tree | 03a47f66e5bf1c468314e6629b83b4739ecc7d4d /apps | |
parent | f823a9e252537020f8f258ae3c4f102bb64f682a (diff) |
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/trunk@125855 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_queue.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index bfbbdef16..70295aa78 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -3541,10 +3541,15 @@ 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"); - if ((monexec = pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC")) || (monargs = pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC_ARGS"))) + ast_channel_lock(qe->chan); + 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_log(LOG_NOTICE, "poop\n"); + 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) |