Skip to content

Commit

Permalink
fix: renamed Twilio Agents to CRM Telephony Agent in code
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Jan 23, 2025
1 parent 1273d14 commit 6b23b29
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
11 changes: 10 additions & 1 deletion crm/fcrm/doctype/crm_telephony_agent/crm_telephony_agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"section_break_ozjn",
"twilio",
"twilio_number",
"call_receiving_device",
"column_break_aydj",
"exotel",
"exotel_number",
Expand Down Expand Up @@ -100,11 +101,19 @@
"fieldtype": "Select",
"label": "Default Medium",
"options": "\nTwilio\nExotel"
},
{
"default": "Computer",
"depends_on": "twilio",
"fieldname": "call_receiving_device",
"fieldtype": "Select",
"label": "Device",
"options": "Computer\nPhone"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2025-01-19 14:17:12.880185",
"modified": "2025-01-23 22:24:53.448716",
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM Telephony Agent",
Expand Down
4 changes: 2 additions & 2 deletions crm/integrations/twilio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def generate_access_token():
if not twilio:
return {}

from_number = frappe.db.get_value("Twilio Agents", frappe.session.user, "twilio_number")
from_number = frappe.db.get_value("CRM Telephony Agent", frappe.session.user, "twilio_number")
if not from_number:
return {
"ok": False,
Expand All @@ -40,7 +40,7 @@ def voice(**kwargs):
def _get_caller_number(caller):
identity = caller.replace("client:", "").strip()
user = Twilio.emailid_from_identity(identity)
return frappe.db.get_value("Twilio Agents", user, "twilio_number")
return frappe.db.get_value("CRM Telephony Agent", user, "twilio_number")

args = frappe._dict(kwargs)
twilio = Twilio.connect()
Expand Down
4 changes: 3 additions & 1 deletion crm/integrations/twilio/twilio_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ def get_twilio_number_owners(phone_number):
# keep + sign in the number at start of the number
phone_number = "".join([c for c in phone_number if c.isdigit() or c == "+"])
user_voice_settings = frappe.get_all(
"Twilio Agents", filters={"twilio_number": phone_number}, fields=["name", "call_receiving_device"]
"CRM Telephony Agent",
filters={"twilio_number": phone_number},
fields=["name", "call_receiving_device"],
)
user_wise_voice_settings = {user["name"]: user for user in user_voice_settings}

Expand Down

0 comments on commit 6b23b29

Please sign in to comment.