From 340ccb6c967dca3aa3b704bf65e5f8c3075bc534 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Mon, 17 Jun 2019 10:16:38 +0530 Subject: [PATCH] fix: Remove unwanted code --- erpnext/erpnext_integrations/exotel_integration.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/erpnext_integrations/exotel_integration.py b/erpnext/erpnext_integrations/exotel_integration.py index f91f757673..10d533c8df 100644 --- a/erpnext/erpnext_integrations/exotel_integration.py +++ b/erpnext/erpnext_integrations/exotel_integration.py @@ -14,16 +14,15 @@ def handle_incoming_call(*args, **kwargs): if status == 'free': return - call_log = get_call_log(kwargs) + create_call_log(kwargs) @frappe.whitelist(allow_guest=True) def handle_end_call(*args, **kwargs): - call_log = update_call_log(kwargs, 'Completed') + update_call_log(kwargs, 'Completed') @frappe.whitelist(allow_guest=True) def handle_missed_call(*args, **kwargs): - call_log = update_call_log(kwargs, 'Missed') - frappe.publish_realtime('call_disconnected', call_log) + update_call_log(kwargs, 'Missed') def update_call_log(call_payload, status): call_log = get_call_log(call_payload, False) @@ -35,7 +34,6 @@ def update_call_log(call_payload, status): frappe.db.commit() return call_log - def get_call_log(call_payload, create_new_if_not_found=True): call_log = frappe.get_all('Call Log', { 'id': call_payload.get('CallSid'), @@ -54,6 +52,8 @@ def get_call_log(call_payload, create_new_if_not_found=True): frappe.db.commit() return call_log +create_call_log = get_call_log + @frappe.whitelist() def get_call_status(call_id): endpoint = get_exotel_endpoint('Calls/{call_id}.json'.format(call_id=call_id))