I&#39;ve found a work around, i.e. if put the dialout command in a separate macro, then CDR records the values fine, whether the hangup macro is called by the original context, or by the dialing macro.<br><br>Posting here in case somebody facing a similar issue like me can benefit from it:<br>
<br>[test]<br>exten =&gt; _NXXNXXXXXX,1,macro(test-dialout,${EXTEN})<br>exten =&gt; h,1,Macro(test-hangup)<br><br>[macro-test-dialout]<br>exten =&gt; s,1,Dial(IAX2/6477226961/${ARG1})<br>;exten =&gt; h,1,Macro(test-hangup)<br>
<br>[macro-test-hangup]<br>exten =&gt; s,1,GotoIf($[&quot;1&quot;=&quot;1&quot;]?2:3)<br>exten =&gt; s,n,NoOp(A)<br>exten =&gt; s,n,ResetCDR(vw)<br>exten =&gt; s,n,NoCDR()<br>exten =&gt; s,n,Hangup()<br><br><br><div class="gmail_quote">
On Wed, Jul 15, 2009 at 10:18 AM, Zeeshan Zakaria <span dir="ltr">&lt;<a href="mailto:zishanov@gmail.com">zishanov@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
(Both on Asterisk 1.2 and 1.4)<br><br>I was struggling to find out why my CDR was recording dst = h after a call hangup. It was working fine until I added a GotoIf statement before ResetCDR to calculate some value for userfield column. Today I tested and found out that if ResetCDR is put after GotoIf (or after if in AEL), it doesn&#39;t record correct value in dst column, and isntead puts &#39;h&#39; there. If GotoIf removed, it works fine.<br>

<br>Is this is a bug, or is this how it is supposed to work? Is there any work around it. In my production scenario, I can&#39;t move ResetCDR before GotoIf.<br><br>Here are the test context and macro:<br><br>[test]<br>exten =&gt; _NXXNXXXXXX,1,Dial(IAX2/XXXXX/${EXTEN},30)<br>

exten =&gt; h,1,Macro(test-hangup)<br><br>[macro-test-hangup]<br>exten =&gt; s,1,GotoIf($[&quot;1&quot;=&quot;1&quot;]?2:3)<br>exten =&gt; s,n,NoOp(A)<br>exten =&gt; s,n,ResetCDR(vw)<br>exten =&gt; s,n,NoCDR()<br>exten =&gt; s,n,Hangup()<br>
<font color="#888888">
<br clear="all"><br>-- <br>Zeeshan A Zakaria<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Zeeshan A Zakaria<br>