Im trying to record call times to a text file but it just enters a zero. how do I get ${CDR(duration)} to work? ${CDR(callend)} also dosnt work, I have a line that sets it as the current time of hangup.
exten => h,1,Set(saveto=/var/www/html/logs/); where to save the file
exten => h,n,Set(filename=${CONTEXT}.txt); what to call the file
exten => h,n,Set(callend=${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)});
exten => h,n,System(echo "${STRFTIME(${EPOCH},,%a %b %d | %I:%M %p)} | ${CALLERID(num)} | ${CALLERID(name)} | ${CDR(duration)} | ${CDR(start)} | ${CDR(answer)} | ${callend}" >> ${saveto}${filename}) ;
exten => h,n,Hangup