diff --git a/crm/fcrm/doctype/crm_call_log/crm_call_log.json b/crm/fcrm/doctype/crm_call_log/crm_call_log.json index 38601f47..cf7f3a1c 100644 --- a/crm/fcrm/doctype/crm_call_log/crm_call_log.json +++ b/crm/fcrm/doctype/crm_call_log/crm_call_log.json @@ -43,7 +43,7 @@ "fieldname": "status", "fieldtype": "Select", "label": "Status", - "options": "Ringing\nIn Progress\nCompleted\nFailed\nBusy\nNo Answer\nQueued\nCanceled", + "options": "Initiated\nRinging\nIn Progress\nCompleted\nFailed\nBusy\nNo Answer\nQueued\nCanceled", "read_only": 1 }, { @@ -127,7 +127,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-11-23 13:11:38.804903", + "modified": "2024-01-18 13:27:19.776926", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Call Log", diff --git a/crm/fcrm/doctype/crm_call_log/crm_call_log.py b/crm/fcrm/doctype/crm_call_log/crm_call_log.py index 8f2865bf..a1b3b594 100644 --- a/crm/fcrm/doctype/crm_call_log/crm_call_log.py +++ b/crm/fcrm/doctype/crm_call_log/crm_call_log.py @@ -90,18 +90,18 @@ class CRMCallLog(Document): @frappe.whitelist() def get_call_log(name): doc = frappe.get_doc("CRM Call Log", name) - _doc = doc.as_dict() + doc = doc.as_dict() if doc.lead: - _doc.lead_name = frappe.db.get_value("CRM Lead", doc.lead, "lead_name") + doc.lead_name = frappe.db.get_value("CRM Lead", doc.lead, "lead_name") if doc.note: note = frappe.db.get_values("CRM Note", doc.note, ["title", "content"])[0] - _doc.note_doc = { + doc.note_doc = { "name": doc.note, "title": note[0], "content": note[1] } - return _doc + return doc @frappe.whitelist() def create_lead_from_call_log(call_log): diff --git a/crm/twilio/api.py b/crm/twilio/api.py index 21dac21e..0af6d1f5 100644 --- a/crm/twilio/api.py +++ b/crm/twilio/api.py @@ -138,6 +138,8 @@ def get_datetime_from_timestamp(timestamp): from datetime import datetime from pytz import timezone + if not timestamp: return None + datetime_utc_tz_str = timestamp.strftime('%Y-%m-%d %H:%M:%S%z') datetime_utc_tz = datetime.strptime(datetime_utc_tz_str, '%Y-%m-%d %H:%M:%S%z') system_timezone = frappe.utils.get_system_timezone() diff --git a/crm/twilio/twilio_handler.py b/crm/twilio/twilio_handler.py index 7c598818..aadbdaa6 100644 --- a/crm/twilio/twilio_handler.py +++ b/crm/twilio/twilio_handler.py @@ -95,6 +95,9 @@ class Twilio: resp.append(dial) return resp + def get_call_info(self, call_sid): + return self.twilio_client.calls(call_sid).fetch() + def generate_twilio_client_response(self, client, ring_tone='at'): """Generates voice call instructions to forward the call to agents computer. """