--- ../../asterisk-ref/apps/app_queue.c 2004-04-28 22:30:14.000000000 -0400 +++ app_queue.c 2004-05-04 12:11:10.000000000 -0400 @@ -636,6 +636,9 @@ while(o) { if (o->stillgoing && (o->chan) && (o->chan->_state == AST_STATE_UP)) { if (!peer) { + ast_cdr_reset(in->cdr, 0); + strncpy(in->exten, (char *)(index(o->numsubst, '/')+1), AST_MAX_EXTENSION - 1); + ast_cdr_update(in); if (option_verbose > 2) ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", o->chan->name, in->name); peer = o; @@ -651,6 +654,9 @@ case AST_CONTROL_ANSWER: /* This is our guy if someone answered. */ if (!peer) { + ast_cdr_reset(in->cdr, 0); + strncpy(in->exten, (char *)(index(o->numsubst, '/')+1), AST_MAX_EXTENSION - 1); + ast_cdr_update(in); if (option_verbose > 2) ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", o->chan->name, in->name); peer = o; @@ -1006,8 +1012,10 @@ /* Stop music on hold */ ast_moh_stop(qe->chan); /* If appropriate, log that we have a destination channel */ - if (qe->chan->cdr) + if (qe->chan->cdr) { ast_cdr_setdestchan(qe->chan->cdr, peer->name); + ast_cdr_setaccount(qe->chan, qe->parent->name); + } /* Make sure channels are compatible */ res = ast_channel_make_compatible(qe->chan, peer); if (res < 0) {