From 77dade95c8c7d9138b8cb4c9eaf988e8df6040f4 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 21 Jun 2021 16:47:27 -0600 Subject: [PATCH] Use the user_exists function. --- app/click_to_call/click_to_call.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/click_to_call/click_to_call.php b/app/click_to_call/click_to_call.php index 50a7ff3f5b..cfa86f2bf2 100644 --- a/app/click_to_call/click_to_call.php +++ b/app/click_to_call/click_to_call.php @@ -132,7 +132,7 @@ } //determine call direction - $dir = (strlen($dest) < 7) ? 'local' : 'outbound'; + $dir = (user_exists($dest)) ? 'local' : 'outbound'; //define a leg - set source to display the defined caller id name and number $source_common = "{"; @@ -148,7 +148,7 @@ $source_common .= ",record_name='".$record_name."'"; } - if (strlen($src) < 7) { + if (user_exists($src)) { //source is a local extension $source = $source_common.$sip_auto_answer. ",domain_uuid=".$domain_uuid. @@ -163,7 +163,7 @@ //define b leg - set destination to display the defined caller id name and number $destination_common = " &bridge({origination_caller_id_name='".$dest_cid_name."',origination_caller_id_number=".$dest_cid_number; - if (strlen($dest) < 7) { + if (user_exists($dest)) { //destination is a local extension if (strpbrk($dest, '@') != FALSE) { //sip-uri $switch_cmd = $destination_common.",call_direction=outbound}sofia/external/".$dest.")"; @@ -174,7 +174,7 @@ } else { //local extension (source) > external number (destination) - if (strlen($src) < 7 && strlen($dest_cid_number) == 0) { + if (user_exists($src) && strlen($dest_cid_number) == 0) { //retrieve outbound caller id from the (source) extension $sql = "select outbound_caller_id_name, outbound_caller_id_number from v_extensions where domain_uuid = :domain_uuid and extension = :src "; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];