diff options
author | Richard Mudgett <rmudgett@digium.com> | 2011-12-16 21:10:19 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2011-12-16 21:10:19 +0000 |
commit | b05d4603c4506bae4a065409937fa7567df9bc9f (patch) | |
tree | b38e1b54c4e4d447a650211787e351a4d26835f5 /apps/app_queue.c | |
parent | 8baea2b35e96d1c51756c00aff322a4e1af858a0 (diff) |
Fix crash during CDR update.
The ast_cdr_setcid() and ast_cdr_update() were shown in ASTERISK-18836 to
be called by different threads for the same channel. The channel driver
thread and the PBX thread running dialplan.
* Add lock protection around CDR API calls that access an ast_channel
pointer.
(closes issue ASTERISK-18836)
Reported by: gpluser
Review: https://reviewboard.asterisk.org/r/1628/
........
Merged revisions 348362 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 348363 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r-- | apps/app_queue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index fe8723c54..de88dcaba 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -5116,9 +5116,9 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce if ((strcasecmp(cdr->uniqueid, qe->chan->uniqueid)) && (strcasecmp(cdr->linkedid, qe->chan->uniqueid)) && (newcdr = ast_cdr_dup(cdr))) { + ast_channel_lock(qe->chan); ast_cdr_init(newcdr, qe->chan); ast_cdr_reset(newcdr, 0); - ast_channel_lock(qe->chan); cdr = ast_cdr_append(cdr, newcdr); cdr = cdr->next; ast_channel_unlock(qe->chan); |