CDR custom Master.csv improvements

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()

Logging of unanswered calls has to enabled in cdr.conf[1].

[1] asterisk/configs/samples/cdr.conf.sample at master · asterisk/asterisk · GitHub

Hello everyone, I hope you’re doing well. I need your guidance or help, please, with these topics. For outgoing calls, for some reason, missed or rejected calls are not being saved in the Master.csv (custom CDR, CDR conf), even though I have it enabled in the CDR.conf file. What could be the issue?

Additionally, when a call is accepted but it’s to a mobile phone that is turned off, it triggers a voicemail or an automatic IVR. How can I recognize this en masse? I am managing outbound IVRs, and if another IVR answers, is there a way to identify it? I want to avoid it being considered as “an effective contact” because there’s another machine behind the phone, not a human.

Thank you!