--- ../../stable/asterisk/apps/app_queue.c Thu Apr 1 00:43:11 2004 +++ app_queue.c Tue Apr 20 20:50:39 2004 @@ -492,6 +492,11 @@ 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; @@ -507,6 +512,11 @@ 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; @@ -829,8 +839,11 @@ } } /* 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) {