How to make call ended and write it to CDR?

Hello! I am making dialplan, which will check if the entered prefix right.
If it is not right the call should be ended with failed status and should be able to be seen in CDR’s.
I tried like this
exten => s,1,Set(CDR(userfield)=Wrong Prefix)
exten => s,n,Hangup(3)
I tried like this, but there is no CDR.
When I am trying another things it writes answered status, but I need it to be failed

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.