Skip to content
Snippets Groups Projects
Commit 7953c3f4 authored by Kevin P. Fleming's avatar Kevin P. Fleming
Browse files

issue #5763

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 60ebbb57
No related branches found
No related tags found
No related merge requests found
2005-11-16 Kevin P. Fleming <kpfleming@limerick.digium.com>
* apps/app_forkcdr.c (forkcdr_exec): issue warning (and don't segfault) if ForkCDR is called on a channel that doesn't have a CDR (issue #5763)
* channel.c (ast_queue_hangup): ensure that the channel lock is held before changing its fields... (issue #5770)
* res/res_musiconhold.c: don't spit out incorrect log messages (and leak memory) during reload (issue #5766)
......
......@@ -59,8 +59,7 @@ static void ast_cdr_fork(struct ast_channel *chan)
struct ast_cdr *newcdr;
struct ast_flags flags = { AST_CDR_FLAG_KEEP_VARS };
if (!chan || !(cdr = chan->cdr))
return;
cdr = chan->cdr;
while (cdr->next)
cdr = cdr->next;
......@@ -79,11 +78,18 @@ static void ast_cdr_fork(struct ast_channel *chan)
static int forkcdr_exec(struct ast_channel *chan, void *data)
{
int res=0;
int res = 0;
struct localuser *u;
if (!chan->cdr) {
ast_log(LOG_WARNING, "Channel does not have a CDR\n");
return 0;
}
LOCAL_USER_ADD(u);
if (!ast_strlen_zero(data))
ast_set2_flag(chan->cdr, strchr((char *)data, 'v'), AST_CDR_FLAG_KEEP_VARS);
ast_set2_flag(chan->cdr, strchr(data, 'v'), AST_CDR_FLAG_KEEP_VARS);
ast_cdr_fork(chan);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment