hi teams,
please help for my dialplan to knowing, which side hangup the call.
i use asterisk 13.16, here is my dialplan:
exten => X!,1,Set(CDR(userfield)=HANGUP_CALLER)
same => n,Dial(SIP/trunk${EXTEN},g)
same => n,Set(CDR(userfield)=${IF($[“${DIALSTATUS}” = “ANSWER”]?HANGUP_CALLEE:HANGUP DIALSTATUS)})
same => n,hangup
if the caller hangup the call first, cdr looks good. but if the callee hangup the call, the cdr always double.
please enlighten me.
here is the cdr for callee hangup
“”,“1001”,“6541112323”,“out”,“”“”" <1001>",“SIP/1001-0000003a”,“SIP/911-0000003b”,“Dial”,“SIP/1808/6541112323,g”,“2022-10-27 13:29:39”,“2022-10-27 13:29:50”,“2022-10-27 13:29:52”,12,2,“ANSWERED”,“DOCUMENTATION”,“1666852179.89”,“HANGUP_CALLER”
“”,“1001”,“6541112323”,“out”,“”“”" <1001>“,“SIP/1001-0000003a”,”“,“Hangup”,”",“2022-10-27 13:29:52”,“2022-10-27 13:29:52”,“2022-10-27 13:29:52”,0,0,“ANSWERED”,“DOCUMENTATION”,“1666852179.89”,“HANGUP_CALLEE”