fix: Remove unwanted code
This commit is contained in:
parent
a86a07ef37
commit
340ccb6c96
@ -14,16 +14,15 @@ def handle_incoming_call(*args, **kwargs):
|
|||||||
if status == 'free':
|
if status == 'free':
|
||||||
return
|
return
|
||||||
|
|
||||||
call_log = get_call_log(kwargs)
|
create_call_log(kwargs)
|
||||||
|
|
||||||
@frappe.whitelist(allow_guest=True)
|
@frappe.whitelist(allow_guest=True)
|
||||||
def handle_end_call(*args, **kwargs):
|
def handle_end_call(*args, **kwargs):
|
||||||
call_log = update_call_log(kwargs, 'Completed')
|
update_call_log(kwargs, 'Completed')
|
||||||
|
|
||||||
@frappe.whitelist(allow_guest=True)
|
@frappe.whitelist(allow_guest=True)
|
||||||
def handle_missed_call(*args, **kwargs):
|
def handle_missed_call(*args, **kwargs):
|
||||||
call_log = update_call_log(kwargs, 'Missed')
|
update_call_log(kwargs, 'Missed')
|
||||||
frappe.publish_realtime('call_disconnected', call_log)
|
|
||||||
|
|
||||||
def update_call_log(call_payload, status):
|
def update_call_log(call_payload, status):
|
||||||
call_log = get_call_log(call_payload, False)
|
call_log = get_call_log(call_payload, False)
|
||||||
@ -35,7 +34,6 @@ def update_call_log(call_payload, status):
|
|||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
return call_log
|
return call_log
|
||||||
|
|
||||||
|
|
||||||
def get_call_log(call_payload, create_new_if_not_found=True):
|
def get_call_log(call_payload, create_new_if_not_found=True):
|
||||||
call_log = frappe.get_all('Call Log', {
|
call_log = frappe.get_all('Call Log', {
|
||||||
'id': call_payload.get('CallSid'),
|
'id': call_payload.get('CallSid'),
|
||||||
@ -54,6 +52,8 @@ def get_call_log(call_payload, create_new_if_not_found=True):
|
|||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
return call_log
|
return call_log
|
||||||
|
|
||||||
|
create_call_log = get_call_log
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_call_status(call_id):
|
def get_call_status(call_id):
|
||||||
endpoint = get_exotel_endpoint('Calls/{call_id}.json'.format(call_id=call_id))
|
endpoint = get_exotel_endpoint('Calls/{call_id}.json'.format(call_id=call_id))
|
||||||
|
Loading…
Reference in New Issue
Block a user