Index: asterisk-1.6.2.18/main/pbx.c =================================================================== --- asterisk-1.6.2.18.orig/main/pbx.c 2011-05-12 12:37:15.000000000 +0100 +++ asterisk-1.6.2.18/main/pbx.c 2011-05-12 12:37:24.000000000 +0100 @@ -4255,6 +4255,8 @@ digit = ast_waitfordigit(c, waittime); if (c->_softhangup & AST_SOFTHANGUP_ASYNCGOTO) { ast_channel_clear_softhangup(c, AST_SOFTHANGUP_ASYNCGOTO); + if( c->cdr && c->_state == AST_STATE_UP && !ast_check_hangup(c) ) + ast_cdr_answer(c->cdr); /* Channel in UP state returned to dialplan */ } else { if (!digit) /* No entry */ break; @@ -4333,6 +4335,8 @@ ast_channel_clear_softhangup(c, AST_SOFTHANGUP_TIMEOUT); } else if (c->_softhangup & AST_SOFTHANGUP_ASYNCGOTO) { ast_channel_clear_softhangup(c, AST_SOFTHANGUP_ASYNCGOTO); + if( c->cdr && c->_state == AST_STATE_UP && !ast_check_hangup(c) ) + ast_cdr_answer(c->cdr); /* Channel in UP state returned to dialplan */ continue; } else if (ast_check_hangup(c)) { ast_debug(1, "Extension %s, priority %d returned normally even though call was hung up\n", @@ -4378,6 +4382,8 @@ if (c->_softhangup & AST_SOFTHANGUP_ASYNCGOTO) { ast_channel_clear_softhangup(c, AST_SOFTHANGUP_ASYNCGOTO); + if( c->cdr && c->_state == AST_STATE_UP && !ast_check_hangup(c) ) + ast_cdr_answer(c->cdr); /* Channel in UP state returned to dialplan */ continue; } else if (c->_softhangup & AST_SOFTHANGUP_TIMEOUT && ast_exists_extension(c, c->context, "T", 1, c->cid.cid_num)) { set_ext_pri(c, "T", 1);