Fix outbound_route_to_bridge so that it uses the correct domain_uuid in every situation. Everyone using multi-tenant is should update svn to apply this fix.
This commit is contained in:
parent
f10e565168
commit
815dd7ec87
|
|
@ -148,7 +148,7 @@ function cmd_async($cmd) {
|
|||
$phone1 = str_replace(".", "", $phone1);
|
||||
|
||||
//get the correct gateway
|
||||
$bridge_array = outbound_route_to_bridge ($phone1);
|
||||
$bridge_array = outbound_route_to_bridge ($_SESSION['domain_uuid'], $phone1);
|
||||
|
||||
//prepare the string
|
||||
$channel_variables = "ignore_early_media=true,origination_number=$phone1,origination_caller_id_name='$broadcast_caller_id_name',origination_caller_id_number=$broadcast_caller_id_number";
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ if (is_array($_REQUEST) && !empty($_REQUEST['src']) && !empty($_REQUEST['dest'])
|
|||
$source = "{".$sip_auto_answer."origination_caller_id_name='$src_cid_name',origination_caller_id_number=$src_cid_number,instant_ringback=true,ringback=$ringback_value,presence_id=$src@".$_SESSION['domains'][$domain_uuid]['domain_name'].",call_direction=outbound}sofia/internal/$src%".$_SESSION['domains'][$domain_uuid]['domain_name'];
|
||||
}
|
||||
else {
|
||||
$bridge_array = outbound_route_to_bridge ($src);
|
||||
$bridge_array = outbound_route_to_bridge ($_SESSION['domain_uuid'], $src);
|
||||
$source = "{origination_caller_id_name='$src_cid_name',origination_caller_id_number=$src_cid_number,instant_ringback=true,ringback=$ringback_value,presence_id=$src@".$_SESSION['domains'][$domain_uuid]['domain_name'].",call_direction=outbound}".$bridge_array[0];
|
||||
}
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ if (is_array($_REQUEST) && !empty($_REQUEST['src']) && !empty($_REQUEST['dest'])
|
|||
unset ($prep_statement);
|
||||
}
|
||||
}
|
||||
$bridge_array = outbound_route_to_bridge ($dest);
|
||||
$bridge_array = outbound_route_to_bridge ($_SESSION['domain_uuid'], $dest);
|
||||
$destination = "{origination_caller_id_name='$dest_cid_name',origination_caller_id_number=$dest_cid_number}".$bridge_array[0];
|
||||
if (permission_exists('click_to_call_call')) {
|
||||
$switch_cmd = "api originate $source &bridge($destination)";
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ else {
|
|||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
if ($fp) {
|
||||
//prepare the fax originate command
|
||||
$route_array = outbound_route_to_bridge($fax_number);
|
||||
$route_array = outbound_route_to_bridge($_SESSION['domain_uuid'], $fax_number);
|
||||
$fax_file = $dir_fax_temp."/".$fax_name.".tif";
|
||||
if (count($route_array) == 0) {
|
||||
//send the internal call to the registered extension
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ else {
|
|||
if (count($_POST)>0) {
|
||||
$virtual_table_category = check_str($_POST["virtual_table_category"]);
|
||||
$virtual_table_category_other = check_str($_POST["virtual_table_category_other"]);
|
||||
if (strlen($virtual_table_category_other) == 0) { $virtual_table_category = $virtual_table_category_other; }
|
||||
if (strlen($virtual_table_category_other) > 0) { $virtual_table_category = $virtual_table_category_other; }
|
||||
$virtual_table_label = check_str($_POST["virtual_table_label"]);
|
||||
$virtual_table_name = check_str($_POST["virtual_table_name"]);
|
||||
$virtual_table_auth = check_str($_POST["virtual_table_auth"]);
|
||||
|
|
|
|||
|
|
@ -2150,7 +2150,7 @@ function save_var_xml() {
|
|||
//unset($cmd);
|
||||
}
|
||||
|
||||
function outbound_route_to_bridge ($destination_number) {
|
||||
function outbound_route_to_bridge ($domain_uuid, $destination_number) {
|
||||
global $db;
|
||||
|
||||
$destination_number = trim($destination_number);
|
||||
|
|
@ -2164,7 +2164,7 @@ function outbound_route_to_bridge ($destination_number) {
|
|||
}
|
||||
|
||||
$sql = "select * from v_dialplans ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3' ";
|
||||
$sql .= "and dialplan_enabled = 'true' ";
|
||||
$sql .= "order by dialplan_order asc ";
|
||||
|
|
@ -2182,7 +2182,7 @@ function outbound_route_to_bridge ($destination_number) {
|
|||
//get the extension number using the dialplan_uuid
|
||||
$sql = "select * ";
|
||||
$sql .= "from v_dialplan_details ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
|
||||
$sql .= "order by dialplan_detail_order asc ";
|
||||
$sub_result = $db->query($sql)->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
|
@ -2230,7 +2230,7 @@ function outbound_route_to_bridge ($destination_number) {
|
|||
unset ($prep_statement);
|
||||
}
|
||||
//$destination_number = '1231234';
|
||||
//$bridge_array = outbound_route_to_bridge ($destination_number);
|
||||
//$bridge_array = outbound_route_to_bridge ($domain_uuid, $destination_number);
|
||||
//foreach ($bridge_array as &$bridge) {
|
||||
// echo "bridge: ".$bridge."<br />";
|
||||
//}
|
||||
|
|
@ -2682,7 +2682,7 @@ function save_hunt_group_xml() {
|
|||
$tmp_sub_array["application"] = "bridge";
|
||||
$tmp_sub_array["type"] = "sip uri";
|
||||
//$destination_data = "{user=foo}loopback/".$ent['destination_data']."/default/XML";
|
||||
$bridge_array = outbound_route_to_bridge ($ent['destination_data']);
|
||||
$bridge_array = outbound_route_to_bridge ($domain_uuid, $ent['destination_data']);
|
||||
$destination_data = $bridge_array[0];
|
||||
$tmp_sub_array["application"] = "bridge";
|
||||
$tmp_sub_array["data"] = "\"[leg_timeout=$destination_timeout,origination_caller_id_name=\"..caller_id_name..\",origination_caller_id_number=\"..caller_id_number..\"]".$destination_data."\"";
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ if (defined('STDIN')) {
|
|||
//send the command with event socket
|
||||
if ($fp) {
|
||||
//prepare the fax originate command
|
||||
$route_array = outbound_route_to_bridge($fax_forward_number);
|
||||
$route_array = outbound_route_to_bridge($_SESSION['domain_uuid'], $fax_forward_number);
|
||||
$fax_file = $dir_fax."/".$fax_name.".tif";
|
||||
if (count($route_array) == 0) {
|
||||
//send the internal call to the registered extension
|
||||
|
|
|
|||
Loading…
Reference in New Issue