<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 16, 2014 at 4:12 PM, Murthy Gandikota <span dir="ltr"><<a href="mailto:mgandikota@nts.net" target="_blank">mgandikota@nts.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>
<u></u>
<u></u>
<u></u>
<u></u>
<u></u>
<div link="blue" vlink="blue" lang="EN-US">
<div>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">in cdr.c<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">void ast_cdr_reset(struct ast_cdr *cdr,
struct ast_flags *_flags)<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">{<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> struct ast_cdr *duplicate;<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> struct ast_flags flags = { 0 };<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> if (_flags)<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> ast_copy_flags(&flags,
_flags, AST_FLAGS_ALL);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> for ( ; cdr ; cdr = cdr->next)
{<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> /* Detach if post is
requested */<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> if
(ast_test_flag(&flags, AST_CDR_FLAG_LOCKED) || !ast_test_flag(cdr,
AST_CDR_FLAG_LOCKED)) {<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> if
(ast_test_flag(&flags, AST_CDR_FLAG_POSTED)) {<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">
ast_cdr_end(cdr);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> if
((duplicate = ast_cdr_dup_unique_swap(cdr))) {<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> ast_cdr_detach(duplicate);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> }<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">
ast_set_flag(cdr, AST_CDR_FLAG_POSTED);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> }<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> /* enable CDR only
*/<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> if
(ast_test_flag(&flags, AST_CDR_FLAG_POST_ENABLE)) {<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">
ast_clear_flag(cdr, AST_CDR_FLAG_POST_DISABLED);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> continue;<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> }<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> /* clear variables
*/<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> if (!ast_test_flag(&flags,
AST_CDR_FLAG_KEEP_VARS)) {<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">
ast_cdr_free_vars(cdr, 0);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> }<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> /* Reset to
initial state */<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">
ast_clear_flag(cdr, AST_FLAGS_ALL);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> memset(&cdr->start,
0, sizeof(cdr->start));<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">
memset(&cdr->end, 0, sizeof(cdr->end));<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">
memset(&cdr->answer, 0, sizeof(cdr->answer));<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> cdr->billsec =
0;<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> cdr->duration =
0;<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">
ast_cdr_start(cdr);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">
cdr->disposition = AST_CDR_NOANSWER;<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> }<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> }<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">}<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">If this line:<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">memset(&cdr->answer, 0,
sizeof(cdr->answer));<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy">is commented away, should work.<u></u><u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font face="Arial" color="navy"><span style="font-size:10.0pt;font-family:Arial;color:navy"> </span></font></p></div></div></blockquote></div><br></div><div class="gmail_extra">I don't think you need to change the Asterisk source for this (particularly since it is supposed to be wiping the answer time there).<br><br></div><div class="gmail_extra">If you want to keep the original answer time, use a custom field in your CDR, and set it prior to resetting:<br><br></div><div class="gmail_extra">exten => Set(CDR(orig_answer)=${CDR(answer)})<br></div><div class="gmail_extra">exten => ResetCDR(v)<br><br>Note the usage of 'v' to keep the custom variable that you just set.<br></div><div class="gmail_extra"></div><div class="gmail_extra"><br>-- <br><div dir="ltr"><div>Matthew Jordan<br></div><div>Digium, Inc. | Engineering Manager</div><div>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA</div><div>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a></div></div>
</div></div>