Hello everyone, I hope you’re doing well. I’m reaching out to request your help with the following: I have this configured as a dial plan, and I need to add something to also log unanswered calls. This currently works perfectly, but when a call is not answered, nothing is logged. What modification should I add?
[outgoing2]
exten => s,1,Answer()
same => n,Set(CALL_START=${STRFTIME(${EPOCH},%Y-%m-%d %H:%M:%S)}) ; Start date and time
same => n,Set(CDR(userfield)=CALL_START:${CALL_START}) ; Save in userfield
same => n,Set(CDR(src)=${CALLERID(num)}) ; Save caller’s number
same => n,Set(CDR(dialed_number)=${CDR(dst)}) ; Save dialed number
same => n,Set(CDR(trunk_used)=${CHANNEL}) ; Save the trunk/channel used
same => n,MixMonitor(${STRFTIME(${EPOCH},%Y-%m-%d-%H-%M-%S)}-${CALLERID(num)}.wav) ; Record the call
same => n,Playback(espero_estes_bien) ; Play audio
same => n,Wait(10) ; Wait 10 seconds
same => n,Set(CALL_END=${STRFTIME(${EPOCH},%Y-%m-%d %H:%M:%S)}) ; End date and time
same => n,Set(BILLDURATION=${CDR(billsec)}) ; Billable duration
same => n,Set(CDR(userfield)=${CDR(userfield)}|CALL_END:${CALL_END}|BILLDURATION:${BILLDURATION}) ; Update userfield
same => n,Set(CDR(call_status)=SUCCESS) ; Mark the call as successful
same => n,NoOp(CALL_START=${CALL_START}) ; Debugging
same => n,NoOp(CALL_END=${CALL_END}) ; Debugging
same => n,NoOp(CDR(billsec)=${CDR(billsec)}) ; Debugging
same => n,NoOp(CDR(dialed_number)=${CDR(dialed_number)}) ; Debugging
same => n,Hangup()