Skip to content
Snippets Groups Projects
Commit a6e748e4 authored by Mark Spencer's avatar Mark Spencer
Browse files

Handle macros in the CDR properly (bug #2414)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 8a12240f
No related branches found
No related tags found
No related merge requests found
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* *
* Call Detail Record API * Call Detail Record API
* *
* Copyright (C) 1999, Mark Spencer * Copyright (C) 1999-2004, Digium, Inc.
* *
* Mark Spencer <markster@linux-support.net> * Mark Spencer <markster@digium.com>
* *
* This program is free software, distributed under the terms of * This program is free software, distributed under the terms of
* the GNU General Public License. * the GNU General Public License.
...@@ -442,8 +442,14 @@ int ast_cdr_update(struct ast_channel *c) ...@@ -442,8 +442,14 @@ int ast_cdr_update(struct ast_channel *c)
/* Copy account code et-al */ /* Copy account code et-al */
strncpy(cdr->accountcode, c->accountcode, sizeof(cdr->accountcode) - 1); strncpy(cdr->accountcode, c->accountcode, sizeof(cdr->accountcode) - 1);
/* Destination information */ /* Destination information */
strncpy(cdr->dst, c->exten, sizeof(cdr->dst) - 1); if (ast_strlen_zero(c->macroexten))
strncpy(cdr->dcontext, c->context, sizeof(cdr->dcontext) - 1); strncpy(cdr->dst, c->exten, sizeof(cdr->dst) - 1);
else
strncpy(cdr->dst, c->macroexten, sizeof(cdr->dst) - 1);
if (ast_strlen_zero(c->macrocontext))
strncpy(cdr->dcontext, c->context, sizeof(cdr->dcontext) - 1);
else
strncpy(cdr->dcontext, c->macrocontext, sizeof(cdr->dcontext) - 1);
} }
cdr = cdr->next; cdr = cdr->next;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment