mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Use the user_exists function.
This commit is contained in:
@@ -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'];
|
||||
|
||||
Reference in New Issue
Block a user