Hello,
Is there a possibility to know for sure which side hanged up the call without using the Dial command?
Consider the following dialplan, is there a way I can use in the hangup exten to know for sure which side hanged up ?
[my_context]
exten =>_X.,1,NoOp(${PJSIP_HEADER(read,To)})
exten =>_X.,n,Set(FirstTo=${CUT(PJSIP_HEADER(read,To),:,2)})
exten =>_X.,n,Set(TO_DID=${CUT(FirstTo,@,1)})
exten =>_X.,n,GotoIf($[“${EXTEN}” != “${TO_DID}” ]?multiple-uri,${TO_DID},1:continue)
exten =>_X.,n(continue),NoOp(${EXTEN})
exten =>_X.,n,GotoIf($[$[“${CALLERID(num)}” = " “] & $[”${CALLERID(name)}" = " “]]?end)
exten =>_X.,n,Set(client_number=${CALLERID(num)})
exten =>_X.,n,AGI(my_agi/translation_first_check.agi,${client_number})
exten =>_X.,n,Set(First_check=${first_ani})
exten =>_X.,n,Set(random=${RAND(500,1500)});
exten =>_X.,n,Set(wait_sec=${MATH(${random}/1000,float)})
exten =>_X.,n,Wait(${wait_sec})
exten =>_X.,n,AGI(my_agi/translation_second_check.agi,${client_number})
exten =>_X.,n,Set(ani=${ani})
exten =>_X.,n,Set(number_dialed=${EXTEN})
exten =>_X.,n,Set(tipo_chiam=PreInbound)
exten =>_X.,n,AGI(my_agi/dnc_check_number.agi,${client_number})
exten =>_X.,n,Set(dnc_client=${dnc_number})
exten =>_X.,n,GotoIf($[”${dnc_client}" = “${client_number}” ]?mbylle:vazhdo)
exten =>_X.,n(mbylle),Hangup()
exten =>_X.,n(vazhdo),AGI(agi-DID_route.agi)
exten =>_X.,n,Hangup()
exten =>_X.,n(end),Hangup()
; FastAGI for VICIDIAL/astGUIclient call logging
exten => h,1,Set(mbyllje_telefonate=Mbyllje Error Agi DID Route)
exten => h,n,GotoIf($[“${dnc_client}” != “bosh” ]?end:continue)
exten => h,n(continue),AGI(my_agi/call_log_check.agi,${ani})
exten => h,n,Set(check_result=${final_result})
exten => h,n,GotoIf($[“${check_result}” = “not_exists” ]?mbylle:vazhdo)
exten => h,n(vazhdo),AGI(my_agi/send_data_inb_vicidial_did_route_error.agi,${UNIQUEID}–${DIALSTATUS}–${ANSWEREDTIME}–${tipo_chiam}–${number_dialed}–${ani}–${client_number})
exten => h,n(mbylle),Hangup()
exten => h,n(end),Hangup()
I have used exten => h,n,AGI(agi://127.0.0.1:4577/call_log–HVcauses–PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME}-----${HANGUPCAUSE(${HANGUPCAUSE_KEYS()},tech)}))
but in most cases it throws the following warning
func_hangupcause.c:138 hangupcause_read: Unable to find information for channel
Asterisk Version: Asterisk 16.29.0-vici