I have created a dialplan which takes the call and save the start and end time of the call. I used ${CDR(start)}
to get the start time of the call but when I used ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)}
instead it gave me a 10 or more seconds difference as compared to ${CDR(start)}
.Part of my code:
same => n,NoOp(------${CDR(start)}----${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)}--)
the above line is second line in my dialplan.From the docs ${CDR(start)}
give start time of call and ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)}
gives current time .But I place the line as second line of my dialplan so its nearly start of call so both ${CDR(start)}
and ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)}
should be equal approximately but the output was like
NoOp(------2015-10-25 12:30:10----2015-10-25 12:30:21--)
Why there is so much diffrence in both? and also I dont know why the value of ${CDR(end)}
is empty.
${CDR(start)}
- is a time of call start.
${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)}
- current time, when this command was executed.
If you use EPOCH
variable after hangup, it may points to the end of call.
${CDR(end)}
can be empty if call is active now and will be filled after hangup.
About CDR variables: https://wiki.asterisk.org/wiki/display/AST/CDR+Variables