mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@270981 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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';
|
||||
|
Reference in New Issue
Block a user