diff --git a/app/call_broadcast/call_broadcast_send.php b/app/call_broadcast/call_broadcast_send.php
index 1ccf411c42..3041391e16 100644
--- a/app/call_broadcast/call_broadcast_send.php
+++ b/app/call_broadcast/call_broadcast_send.php
@@ -260,10 +260,10 @@ require_once "resources/header.php";
$phone_1 = preg_replace('{\D}', '', $tmp_value_array[0]);
if ($gateway == "loopback") {
- $cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}loopback/".$phone_1."/default/XML ".$_SESSION['switch']['recordings']['dir']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
+ $cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}loopback/".$phone_1."/default/XML ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
}
else {
- $cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}sofia/gateway/".$gateway."/".$phone_1." ".$_SESSION['switch']['recordings']['dir']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
+ $cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}sofia/gateway/".$gateway."/".$phone_1." ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
}
echo $cmd."
\n";
cmd_async($cmd);
@@ -335,20 +335,20 @@ require_once "resources/header.php";
//make the call
if (strlen($phone_1)> 0) {
if ($gateway == "loopback") {
- $cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}loopback/".$phone_1."/default/XML ".$_SESSION['switch']['recordings']['dir']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
+ $cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}loopback/".$phone_1."/default/XML ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
}
else {
- $cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}sofia/gateway/".$gateway."/".$phone_1." ".$_SESSION['switch']['recordings']['dir']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
+ $cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}sofia/gateway/".$gateway."/".$phone_1." ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
}
//echo $cmd."
\n";
cmd_async($cmd);
}
if (strlen($phone_2)> 0) {
if ($gateway == "loopback") {
- $cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}loopback/".$phone_2."/default/XML ".$_SESSION['switch']['recordings']['dir']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
+ $cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}loopback/".$phone_2."/default/XML ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
}
else {
- $cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}sofia/gateway/".$gateway."/".$phone_2." ".$_SESSION['switch']['recordings']['dir']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
+ $cmd = $_SESSION['switch']['bin']['dir']."/fs_cli -x \"luarun call_broadcast_originate.lua {call_timeout=".$broadcast_timeout."}sofia/gateway/".$gateway."/".$phone_2." ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename." '".$broadcast_caller_id_name."' ".$broadcast_caller_id_number." ".$broadcast_timeout." '".$broadcast_destination_application."' '".$broadcast_destination_data."'\";";
}
//echo $cmd."
\n";
cmd_async($cmd);
diff --git a/app/call_centers/call_center_agent_edit.php b/app/call_centers/call_center_agent_edit.php
index e72dc42c19..34002e36ac 100644
--- a/app/call_centers/call_center_agent_edit.php
+++ b/app/call_centers/call_center_agent_edit.php
@@ -129,48 +129,47 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//get and then set the complete agent_contact with the call_timeout and when necessary confirm
//if you change this variable, also change resources/switch.php
- $tmp_confirm = "group_confirm_file=custom/press_1_to_accept_this_call.wav,group_confirm_key=1,group_confirm_read_timeout=2000,leg_timeout=".$agent_call_timeout;
+ $confirm = "group_confirm_file=custom/press_1_to_accept_this_call.wav,group_confirm_key=1,group_confirm_read_timeout=2000,leg_timeout=".$agent_call_timeout;
if(strstr($agent_contact, '}') === FALSE) {
//not found
if(stristr($agent_contact, 'sofia/gateway') === FALSE) {
//add the call_timeout
- $tmp_agent_contact = "{call_timeout=".$agent_call_timeout."}".$agent_contact;
+ $agent_contact = "{call_timeout=".$agent_call_timeout.",sip_invite_domain=".$_SESSION['domain_name']."}".$agent_contact;
}
else {
//add the call_timeout and confirm
- $tmp_agent_contact = $tmp_first.',call_timeout='.$agent_call_timeout.$tmp_last;
- $tmp_agent_contact = "{".$tmp_confirm.",call_timeout=".$agent_call_timeout."}".$agent_contact;
- echo "\n\n".$tmp_agent_contact."\n\n";
+ $agent_contact = $first.',call_timeout='.$agent_call_timeout.$last;
+ $agent_contact = "{".$confirm.",call_timeout=".$agent_call_timeout.",sip_invite_domain=".$_SESSION['domain_name']."}".$agent_contact;
+ echo "\n\n".$agent_contact."\n\n";
}
}
else {
//found
if(stristr($agent_contact, 'sofia/gateway') === FALSE) {
//not found
+ $position = strrpos($agent_contact, "}");
+ $first = substr($agent_contact, 0, $position);
+ $last = substr($agent_contact, $position);
if(stristr($agent_contact, 'call_timeout') === FALSE) {
- //add the call_timeout
- $tmp_pos = strrpos($agent_contact, "}");
- $tmp_first = substr($agent_contact, 0, $tmp_pos);
- $tmp_last = substr($agent_contact, $tmp_pos);
- $tmp_agent_contact = $tmp_first.',call_timeout='.$agent_call_timeout.$tmp_last;
+ $call_timeout = ',call_timeout='.$agent_call_timeout;
}
else {
- //the string has the call timeout
- $tmp_agent_contact = $agent_contact;
+ $call_timeout = '';
}
+ $agent_contact = $first.',sip_invite_domain='.$_SESSION['domain_name'].$call_timeout.$last;
}
else {
//found
- $tmp_pos = strrpos($agent_contact, "}");
- $tmp_first = substr($agent_contact, 0, $tmp_pos);
- $tmp_last = substr($agent_contact, $tmp_pos);
+ $position = strrpos($agent_contact, "}");
+ $first = substr($agent_contact, 0, $position);
+ $last = substr($agent_contact, $position);
if(stristr($agent_contact, 'call_timeout') === FALSE) {
//add the call_timeout and confirm
- $tmp_agent_contact = $tmp_first.','.$tmp_confirm.',call_timeout='.$agent_call_timeout.$tmp_last;
+ $agent_contact = $first.','.$confirm.',sip_invite_domain='.$_SESSION['domain_name'].'call_timeout='.$agent_call_timeout.$last;
}
else {
//add confirm
- $tmp_agent_contact = $tmp_first.','.$tmp_confirm.$tmp_last;
+ $agent_contact = $first.',sip_invite_domain='.$_SESSION['domain_name'].','.$confirm.$last;
}
}
}
@@ -193,7 +192,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$response = event_socket_request($fp, $cmd);
usleep(200);
//agent set contact
- $cmd = "api callcenter_config agent set contact ".$agent_name."@".$_SESSION['domains'][$domain_uuid]['domain_name']." ".$tmp_agent_contact;
+ $cmd = "api callcenter_config agent set contact ".$agent_name."@".$_SESSION['domains'][$domain_uuid]['domain_name']." ".$agent_contact;
$response = event_socket_request($fp, $cmd);
usleep(200);
//agent set status
diff --git a/app/call_centers/call_center_queue_delete.php b/app/call_centers/call_center_queue_delete.php
index 5abb84093f..e00655459a 100644
--- a/app/call_centers/call_center_queue_delete.php
+++ b/app/call_centers/call_center_queue_delete.php
@@ -43,59 +43,60 @@ else {
$id = check_str($_GET["id"]);
}
-if (strlen($id) > 0) {
+//delete the data
+ if (strlen($id) > 0) {
- //get the dialplan uuid
- $sql = "select * from v_call_center_queues ";
- $sql .= "where domain_uuid = '$domain_uuid' ";
- $sql .= "and call_center_queue_uuid = '$id' ";
- $prep_statement = $db->prepare($sql);
- $prep_statement->execute();
- while($row = $prep_statement->fetch(PDO::FETCH_ASSOC)) {
- $queue_name = $row['queue_name'];
- $dialplan_uuid = $row['dialplan_uuid'];
- }
+ //get the dialplan uuid
+ $sql = "select * from v_call_center_queues ";
+ $sql .= "where domain_uuid = '$domain_uuid' ";
+ $sql .= "and call_center_queue_uuid = '$id' ";
+ $prep_statement = $db->prepare($sql);
+ $prep_statement->execute();
+ while($row = $prep_statement->fetch(PDO::FETCH_ASSOC)) {
+ $queue_name = $row['queue_name'];
+ $dialplan_uuid = $row['dialplan_uuid'];
+ }
- //delete the tier from the database
- $sql = "delete from v_call_center_tiers ";
- $sql .= "where domain_uuid = '$domain_uuid' ";
- $sql .= "and queue_name = '$queue_name' ";
- $db->query($sql);
- unset($sql);
+ //delete the tier from the database
+ $sql = "delete from v_call_center_tiers ";
+ $sql .= "where domain_uuid = '$domain_uuid' ";
+ $sql .= "and queue_name = '$queue_name' ";
+ $db->query($sql);
+ unset($sql);
- //delete the call center queue
- $sql = "delete from v_call_center_queues ";
- $sql .= "where domain_uuid = '$domain_uuid' ";
- $sql .= "and dialplan_uuid = '$dialplan_uuid' ";
- $db->query($sql);
- unset($sql);
+ //delete the call center queue
+ $sql = "delete from v_call_center_queues ";
+ $sql .= "where domain_uuid = '$domain_uuid' ";
+ $sql .= "and call_center_queue_uuid = '$id' ";
+ $db->query($sql);
+ unset($sql);
- //delete the dialplan entry
- $sql = "delete from v_dialplans ";
- $sql .= "where domain_uuid = '$domain_uuid' ";
- $sql .= "and dialplan_uuid = '$dialplan_uuid' ";
- $db->query($sql);
- unset($sql);
+ //delete the dialplan entry
+ $sql = "delete from v_dialplans ";
+ $sql .= "where domain_uuid = '$domain_uuid' ";
+ $sql .= "and dialplan_uuid = '$dialplan_uuid' ";
+ $db->query($sql);
+ unset($sql);
- //delete the dialplan details
- $sql = "delete from v_dialplan_details ";
- $sql .= "where domain_uuid = '$domain_uuid' ";
- $sql .= "and dialplan_uuid = '$dialplan_uuid' ";
- $db->query($sql);
- unset($sql);
+ //delete the dialplan details
+ $sql = "delete from v_dialplan_details ";
+ $sql .= "where domain_uuid = '$domain_uuid' ";
+ $sql .= "and dialplan_uuid = '$dialplan_uuid' ";
+ $db->query($sql);
+ unset($sql);
- //clear the cache
- $cache = new cache;
- $cache->delete("dialplan:".$_SESSION["context"]);
- remove_config_from_cache('configuration:callcenter.conf');
+ //clear the cache
+ $cache = new cache;
+ $cache->delete("dialplan:".$_SESSION["context"]);
+ remove_config_from_cache('configuration:callcenter.conf');
- //synchronize configuration
- save_dialplan_xml();
- save_call_center_xml();
+ //synchronize configuration
+ save_dialplan_xml();
+ save_call_center_xml();
- //apply settings reminder
- $_SESSION["reload_xml"] = true;
-}
+ //apply settings reminder
+ $_SESSION["reload_xml"] = true;
+ }
//redirect the browser
$_SESSION["message"] = $text['message-delete'];
diff --git a/app/call_centers/call_center_queue_edit.php b/app/call_centers/call_center_queue_edit.php
index e37cf5f245..81ce4acbfb 100644
--- a/app/call_centers/call_center_queue_edit.php
+++ b/app/call_centers/call_center_queue_edit.php
@@ -255,7 +255,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$db->exec(check_sql($sql));
unset($sql);
- //syncrhonize the configuration
+ //synchronize the configuration
save_call_center_xml();
remove_config_from_cache('configuration:callcenter.conf');
@@ -311,20 +311,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
unset ($prep_statement);
- //dialplan add or update
- $c = new call_center;
- $c->db = $db;
- $c->domain_uuid = $_SESSION['domain_uuid'];
- $c->call_center_queue_uuid = $call_center_queue_uuid;
- $c->dialplan_uuid = $dialplan_uuid;
- $c->queue_name = $queue_name;
- $c->queue_name = $queue_name;
- $c->queue_cid_prefix = $queue_cid_prefix;
- $c->queue_timeout_action = $queue_timeout_action;
- $c->queue_description = $queue_description;
- $c->destination_number = $queue_extension;
- $a = $c->dialplan();
-
//synchronize the configuration
save_call_center_xml();
remove_config_from_cache('configuration:callcenter.conf');
@@ -337,6 +323,20 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$_SESSION["message"] = $text['message-update'];
} //if ($action == "update")
+ //dialplan add or update
+ $c = new call_center;
+ $c->db = $db;
+ $c->domain_uuid = $_SESSION['domain_uuid'];
+ $c->call_center_queue_uuid = $call_center_queue_uuid;
+ $c->dialplan_uuid = $dialplan_uuid;
+ $c->queue_name = $queue_name;
+ $c->queue_name = $queue_name;
+ $c->queue_cid_prefix = $queue_cid_prefix;
+ $c->queue_timeout_action = $queue_timeout_action;
+ $c->queue_description = $queue_description;
+ $c->destination_number = $queue_extension;
+ $a = $c->dialplan();
+
//add agent/tier to queue
$agent_name = check_str($_POST["agent_name"]);
$tier_level = check_str($_POST["tier_level"]);
@@ -399,8 +399,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
//redirect
- header("Location: call_center_queue_edit.php?id=".$call_center_queue_uuid);
- return;
+ header("Location: call_center_queue_edit.php?id=".$call_center_queue_uuid);
+ return;
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
@@ -739,7 +739,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "\n";
echo "
\n";
$record_ext=($_SESSION['record_ext']=='mp3'?'mp3':'wav');
- $record_template = $_SESSION['switch']['recordings']['dir']."/archive/\${strftime(%Y)}/\${strftime(%b)}/\${strftime(%d)}/\${uuid}.".$record_ext;
+ $record_template = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/\${strftime(%Y)}/\${strftime(%b)}/\${strftime(%d)}/\${uuid}.".$record_ext;
echo " |