Zeeshan Zakaria
2009-Jul-15 14:18 UTC
[asterisk-users] ResetCDR after GotoIf doesn't set dst correctly, Is this a bug?
(Both on Asterisk 1.2 and 1.4)
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.
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.
Here are the test context and macro:
[test]
exten => _NXXNXXXXXX,1,Dial(IAX2/XXXXX/${EXTEN},30)
exten => h,1,Macro(test-hangup)
[macro-test-hangup]
exten => s,1,GotoIf($["1"="1"]?2:3)
exten => s,n,NoOp(A)
exten => s,n,ResetCDR(vw)
exten => s,n,NoCDR()
exten => s,n,Hangup()
--
Zeeshan A Zakaria
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20090715/5fd42eda/attachment-0001.htm
Zeeshan Zakaria
2009-Jul-15 14:36 UTC
[asterisk-users] ResetCDR after GotoIf doesn't set dst correctly, Is this a bug?
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.
Posting here in case somebody facing a similar issue like me can benefit
from it:
[test]
exten => _NXXNXXXXXX,1,macro(test-dialout,${EXTEN})
exten => h,1,Macro(test-hangup)
[macro-test-dialout]
exten => s,1,Dial(IAX2/6477226961/${ARG1})
;exten => h,1,Macro(test-hangup)
[macro-test-hangup]
exten => s,1,GotoIf($["1"="1"]?2:3)
exten => s,n,NoOp(A)
exten => s,n,ResetCDR(vw)
exten => s,n,NoCDR()
exten => s,n,Hangup()
On Wed, Jul 15, 2009 at 10:18 AM, Zeeshan Zakaria <zishanov at
gmail.com>wrote:
> (Both on Asterisk 1.2 and 1.4)
>
> 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.
>
> 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.
>
> Here are the test context and macro:
>
> [test]
> exten => _NXXNXXXXXX,1,Dial(IAX2/XXXXX/${EXTEN},30)
> exten => h,1,Macro(test-hangup)
>
> [macro-test-hangup]
> exten => s,1,GotoIf($["1"="1"]?2:3)
> exten => s,n,NoOp(A)
> exten => s,n,ResetCDR(vw)
> exten => s,n,NoCDR()
> exten => s,n,Hangup()
>
>
> --
> Zeeshan A Zakaria
>
--
Zeeshan A Zakaria
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20090715/b8f468d9/attachment.htm