[asterisk-commits] irroot: branch irroot/distrotech-customers-trunk r337831 - /team/irroot/distr...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Sep 23 00:37:00 CDT 2011
Author: irroot
Date: Fri Sep 23 00:36:54 2011
New Revision: 337831
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=337831
Log:
Make update_cdr set the dst and dstchannel correctly
Modified:
team/irroot/distrotech-customers-trunk/apps/app_queue.c
Modified: team/irroot/distrotech-customers-trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/apps/app_queue.c?view=diff&rev=337831&r1=337830&r2=337831
==============================================================================
--- team/irroot/distrotech-customers-trunk/apps/app_queue.c (original)
+++ team/irroot/distrotech-customers-trunk/apps/app_queue.c Fri Sep 23 00:36:54 2011
@@ -5082,21 +5082,25 @@
struct ast_cdr *cdr;
struct ast_cdr *newcdr;
+ /* Only work with the last CDR in the stack*/
cdr = qe->chan->cdr;
while (cdr->next) {
cdr = cdr->next;
}
- if ((strcasecmp(cdr->uniqueid, qe->chan->uniqueid)) && (strcasecmp(cdr->linkedid, qe->chan->uniqueid))) {
- if ((newcdr = ast_cdr_dup(cdr))) {
- 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_unlocks(qe->chan);
- }
- }
- ast_copy_string(cdr->dstchannel, member->membername, sizeof(cdr->dstchannel));
+
+ /* If there is no CDR add one to the stack*/
+ if ((strcasecmp(cdr->uniqueid, qe->chan->uniqueid)) &&
+ (strcasecmp(cdr->linkedid, qe->chan->uniqueid)) &&
+ (newcdr = ast_cdr_dup(cdr))) {
+ 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);
+ }
+ ast_copy_string(cdr->dstchannel, member->interface, sizeof(cdr->dstchannel));
+ ast_copy_string(cdr->dst, member->membername, sizeof(cdr->dst));
}
if (qe->parent->eventwhencalled)
More information about the asterisk-commits
mailing list