fix: set status correctly
This commit is contained in:
parent
6fefa16ac3
commit
2f34fdd409
@ -242,19 +242,18 @@ def get_call_log_status(call_payload, direction="inbound"):
|
|||||||
elif status == "failed":
|
elif status == "failed":
|
||||||
return "Failed"
|
return "Failed"
|
||||||
|
|
||||||
status = call_payload.get("DialCallStatus")
|
|
||||||
call_type = call_payload.get("CallType")
|
call_type = call_payload.get("CallType")
|
||||||
dial_call_status = call_payload.get("DialCallStatus")
|
status = call_payload.get("DialCallStatus") or call_payload.get("Status")
|
||||||
|
|
||||||
if call_type == "incomplete" and dial_call_status == "no-answer":
|
if call_type == "incomplete" and status == "no-answer":
|
||||||
status = "No Answer"
|
status = "No Answer"
|
||||||
elif call_type == "client-hangup" and dial_call_status == "canceled":
|
elif call_type == "client-hangup" and status == "canceled":
|
||||||
status = "Canceled"
|
status = "Canceled"
|
||||||
elif call_type == "incomplete" and dial_call_status == "failed":
|
elif call_type == "incomplete" and status == "failed":
|
||||||
status = "Failed"
|
status = "Failed"
|
||||||
elif call_type == "completed":
|
elif call_type == "completed":
|
||||||
status = "Completed"
|
status = "Completed"
|
||||||
elif dial_call_status == "busy":
|
elif status == "busy":
|
||||||
status = "Ringing"
|
status = "Ringing"
|
||||||
|
|
||||||
return status
|
return status
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user