Sorry but for me isn’t clear where I need to put exactlly the ResetCDR()
In my dialplan I have 2 macros:
[macro-before-call-066]
exten => s,1,AGI(dongle_stat.sh,7777,dongle0)
same => n,Set(CDR(start_)=${SHELL(date "+%H:%M:%S %d.%b.%Y")})
same => n,set(CDR(codec1)=${CHANNEL(audioreadformat)})
same => n,set(CDR(codec2)=${CHANNEL(audiowriteformat)})
and
[macro-after-outgoing_CALL-066]
exten => s,1,System(STRFTIME(${EPOCH},%d.%m.%Y %H:%M:%S))
same => n,NoOp(SendedCID = ${CALLERID(num)})
same => n,set(CDR(duration_)=${CDR(duration)})
same => n,Set(CDR(answer_)=${SHELL(date "+%H:%M:%S %d.%b.%Y")})
same => n,Set(CDR(end_)=${SHELL(date "+%H:%M:%S %d.%b.%Y")})
....
and incoming and outgoing:
[066-incoming_CALL]
exten => s,1,Macro(before-call-066)
same => n,Dial(SIP/7777)
same => n,Hangup()
exten => h,1,Verbose(Macro after call)
same => n,Macro(after-incoming_CALL-066); Uvek ide h posle hangup-a
same => n(not_simple),Hangup()
[outgoing_CALL-066]
exten => _0[1,2,3,6,800].,1,Macro(before-call-066);
same => n,Set(Called_number=${EXTEN});
same => n,Dial(Dongle/dongle0/${EXTEN});
same => n,Hangup()
exten => h,1,Verbose(Macro after call)
same => n,Macro(after-outgoing_CALL-066)
same => n,Hangup()
From the CLI: core show function CDR is explained:
For example, CDRs may not be modified after the ‘Dial’ application has
returned.
Now if I put after DIAL how he will see when it was answered?
And if I put before, how he know after how many second someone pick up the phone?
Can someone help me where I need to put commands:
same => n,Set(CDR(answer_)=${SHELL(date "+%H:%M:%S %d.%b.%Y")})
and
ResetCDR(w)
Thx