I'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 => _NXXNXXXXXX,1,macro(test-dialout,${EXTEN})<br>exten => h,1,Macro(test-hangup)<br><br>[macro-test-dialout]<br>exten => s,1,Dial(IAX2/6477226961/${ARG1})<br>;exten => h,1,Macro(test-hangup)<br>
<br>[macro-test-hangup]<br>exten => s,1,GotoIf($["1"="1"]?2:3)<br>exten => s,n,NoOp(A)<br>exten => s,n,ResetCDR(vw)<br>exten => s,n,NoCDR()<br>exten => s,n,Hangup()<br><br><br><div class="gmail_quote">
On Wed, Jul 15, 2009 at 10:18 AM, Zeeshan Zakaria <span dir="ltr"><<a href="mailto:zishanov@gmail.com">zishanov@gmail.com</a>></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't record correct value in dst column, and isntead puts 'h' 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't move ResetCDR before GotoIf.<br><br>Here are the test context and macro:<br><br>[test]<br>exten => _NXXNXXXXXX,1,Dial(IAX2/XXXXX/${EXTEN},30)<br>
exten => h,1,Macro(test-hangup)<br><br>[macro-test-hangup]<br>exten => s,1,GotoIf($["1"="1"]?2:3)<br>exten => s,n,NoOp(A)<br>exten => s,n,ResetCDR(vw)<br>exten => s,n,NoCDR()<br>exten => 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>