fix: trigger call accept logic
This commit is contained in:
parent
e6614a5ad7
commit
e95d684bfa
@ -111,15 +111,7 @@ def update_call_status_info(**kwargs):
|
||||
args = frappe._dict(kwargs)
|
||||
parent_call_sid = args.ParentCallSid
|
||||
update_call_log(parent_call_sid, status=args.CallStatus)
|
||||
except:
|
||||
frappe.log_error(title=_("Failed to update Twilio call status"))
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def get_call_info(**kwargs):
|
||||
"""This is a webhook called when the outgoing call status changes.
|
||||
E.g. 'initiated' 'ringing', 'in-progress', 'completed' etc.
|
||||
"""
|
||||
args = frappe._dict(kwargs)
|
||||
call_info = {
|
||||
'ParentCallSid': args.ParentCallSid,
|
||||
'CallSid': args.CallSid,
|
||||
@ -133,6 +125,8 @@ def get_call_info(**kwargs):
|
||||
client.calls(args.ParentCallSid).user_defined_messages.create(
|
||||
content=json.dumps(call_info)
|
||||
)
|
||||
except:
|
||||
frappe.log_error(title=_("Failed to update Twilio call status"))
|
||||
|
||||
def get_datetime_from_timestamp(timestamp):
|
||||
from datetime import datetime
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user