aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_agent.c
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-16 21:10:48 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-16 21:10:48 +0000
commitbf4f9e2c711021680ca90dc3e02cd0ad8be48fa0 (patch)
treedb29268a356ff6440bf9c0925ddbbfdcf2e5c84d /channels/chan_agent.c
parentdb405545aed92ad37e37dd761964bf4f604ad676 (diff)
Merged revisions 270980 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r270980 | qwell | 2010-06-16 16:10:09 -0500 (Wed, 16 Jun 2010) | 4 lines Need to lock the agent chan before access its internal bits. Pointed out by russellb on asterisk-dev mailing list. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@270981 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_agent.c')
-rw-r--r--channels/chan_agent.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index 02c175388..0b1590341 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -2289,7 +2289,9 @@ static int function_agent(struct ast_channel *chan, const char *cmd, char *data,
ast_copy_string(buf, agent->moh, len);
else if (!strcasecmp(args.item, "channel")) {
if (agent->chan) {
+ ast_channel_lock(agent->chan);
ast_copy_string(buf, agent->chan->name, len);
+ ast_channel_unlock(agent->chan);
tmp = strrchr(buf, '-');
if (tmp)
*tmp = '\0';