fix: added subdomain field
This commit is contained in:
parent
7da03d0293
commit
0315220857
@ -10,6 +10,7 @@
|
|||||||
"record_call",
|
"record_call",
|
||||||
"section_break_kfez",
|
"section_break_kfez",
|
||||||
"account_sid",
|
"account_sid",
|
||||||
|
"subdomain",
|
||||||
"column_break_qwfn",
|
"column_break_qwfn",
|
||||||
"webhook_verify_token",
|
"webhook_verify_token",
|
||||||
"section_break_iuct",
|
"section_break_iuct",
|
||||||
@ -83,12 +84,19 @@
|
|||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Webhook Verify Token",
|
"label": "Webhook Verify Token",
|
||||||
"mandatory_depends_on": "enabled"
|
"mandatory_depends_on": "enabled"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"depends_on": "enabled",
|
||||||
|
"fieldname": "subdomain",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"label": "Subdomain",
|
||||||
|
"mandatory_depends_on": "enabled"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-01-19 22:19:20.713970",
|
"modified": "2025-01-20 15:00:51.096985",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "FCRM",
|
"module": "FCRM",
|
||||||
"name": "CRM Exotel Settings",
|
"name": "CRM Exotel Settings",
|
||||||
|
|||||||
@ -14,7 +14,9 @@ class CRMExotelSettings(Document):
|
|||||||
def verify_credentials(self):
|
def verify_credentials(self):
|
||||||
if self.enabled:
|
if self.enabled:
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
"https://api.exotel.com/v1/Accounts/{sid}".format(sid=self.account_sid),
|
"https://{subdomain}/v1/Accounts/{sid}".format(
|
||||||
|
subdomain=self.subdomain, sid=self.account_sid
|
||||||
|
),
|
||||||
auth=(self.api_key, self.get_password("api_token")),
|
auth=(self.api_key, self.get_password("api_token")),
|
||||||
)
|
)
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
|
|||||||
@ -132,9 +132,10 @@ def make_a_call(to_number, from_number=None, caller_id=None):
|
|||||||
|
|
||||||
def get_exotel_endpoint(action=None):
|
def get_exotel_endpoint(action=None):
|
||||||
settings = get_exotel_settings()
|
settings = get_exotel_settings()
|
||||||
return "https://{api_key}:{api_token}@api.exotel.com/v1/Accounts/{sid}/{action}".format(
|
return "https://{api_key}:{api_token}@{subdomain}/v1/Accounts/{sid}/{action}".format(
|
||||||
api_key=settings.api_key,
|
api_key=settings.api_key,
|
||||||
api_token=settings.get_password("api_token"),
|
api_token=settings.get_password("api_token"),
|
||||||
|
subdomain=settings.subdomain,
|
||||||
sid=settings.account_sid,
|
sid=settings.account_sid,
|
||||||
action=action,
|
action=action,
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user