1
0
forked from test/crm

fix: get call details while making call

This commit is contained in:
Shariq Ansari 2025-01-19 22:50:21 +05:30
parent 8a31769ec6
commit 840bb6b76d
2 changed files with 8 additions and 3 deletions

View File

@ -125,7 +125,9 @@ def make_a_call(to_number, from_number=None, caller_id=None):
agent=frappe.session.user,
)
return response.json()
call_details = response.json().get("Call", {})
call_details["CallSid"] = call_details.get("Sid", "")
return call_details
def get_exotel_endpoint(action=None):
@ -161,7 +163,7 @@ def validate_request():
# workaround security since exotel does not support request signature
# /api/method/<exotel-integration-method>?key=<exotel-webhook=verify-token>
webhook_verify_token = frappe.db.get_single_value("CRM Exotel Settings", "webhook_verify_token")
key = frappe.request.args.get('key')
key = frappe.request.args.get("key")
is_valid = key and key == webhook_verify_token
if not is_valid:

View File

@ -399,7 +399,10 @@ function makeOutgoingCall(number) {
url: 'crm.integrations.exotel.handler.make_a_call',
params: { to_number: phoneNumber.value },
auto: true,
onSuccess() {
onSuccess(callDetails) {
callData.value = callDetails
console.log(callDetails)
callStatus.value = 'Calling...'
showCallPopup.value = true
showSmallCallPopup.value = false