mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 03:18:30 +00:00
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/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@348362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -4988,9 +4988,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);
|
||||
|
||||
Reference in New Issue
Block a user