diff --git a/crm/twilio/api.py b/crm/twilio/api.py index ebb300e0..ffbe7ebc 100644 --- a/crm/twilio/api.py +++ b/crm/twilio/api.py @@ -127,4 +127,14 @@ def get_datetime_from_timestamp(timestamp): datetime_utc_tz = datetime.strptime(datetime_utc_tz_str, '%Y-%m-%d %H:%M:%S%z') system_timezone = frappe.utils.get_system_timezone() converted_datetime = datetime_utc_tz.astimezone(timezone(system_timezone)) - return frappe.utils.format_datetime(converted_datetime, 'yyyy-MM-dd HH:mm:ss') \ No newline at end of file + return frappe.utils.format_datetime(converted_datetime, 'yyyy-MM-dd HH:mm:ss') + +@frappe.whitelist() +def add_note_to_call_log(call_sid, note): + """Add note to call log. based on child call sid. + """ + twilio = Twilio.connect() + if not twilio: return + + call_details = twilio.get_call_info(call_sid) + frappe.db.set_value("CRM Call Log", call_details.parent_call_sid, "note", note) \ No newline at end of file diff --git a/frontend/src/components/CallUI.vue b/frontend/src/components/CallUI.vue index 53aeb564..bb1d88cc 100644 --- a/frontend/src/components/CallUI.vue +++ b/frontend/src/components/CallUI.vue @@ -3,11 +3,10 @@