dect
/
asterisk
Archived
13
0
Fork 0

Handle macros in the CDR properly (bug #2414)

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3758 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
markster 2004-09-10 13:40:56 +00:00
parent a1f2f5b139
commit d1fab10737
1 changed files with 10 additions and 4 deletions

14
cdr.c
View File

@ -3,9 +3,9 @@
*
* 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
* the GNU General Public License.
@ -442,8 +442,14 @@ int ast_cdr_update(struct ast_channel *c)
/* Copy account code et-al */
strncpy(cdr->accountcode, c->accountcode, sizeof(cdr->accountcode) - 1);
/* Destination information */
strncpy(cdr->dst, c->exten, sizeof(cdr->dst) - 1);
strncpy(cdr->dcontext, c->context, sizeof(cdr->dcontext) - 1);
if (ast_strlen_zero(c->macroexten))
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;
}