@@ -553,7 +553,7 @@ require_once "resources/require.php";
|
|||||||
else {
|
else {
|
||||||
$domain_name = $_SESSION['domain_name'];
|
$domain_name = $_SESSION['domain_name'];
|
||||||
}
|
}
|
||||||
echo " window.location = 'https://".$domain_name."/app/provision?mac=$device_mac_address&file=' + d + '&content_type=application/octet-stream';\n";
|
echo " window.location = 'https://".$domain_name."/app/provision?mac=".$device_mac_address."&file=' + d + '&content_type=application/octet-stream';\n";
|
||||||
echo " }\n";
|
echo " }\n";
|
||||||
|
|
||||||
echo "\n";
|
echo "\n";
|
||||||
@@ -602,8 +602,11 @@ require_once "resources/require.php";
|
|||||||
echo " <select class='formfld' style='display: none; width: auto;' name='target_file' id='target_file' onchange='download(this.value)'>\n";
|
echo " <select class='formfld' style='display: none; width: auto;' name='target_file' id='target_file' onchange='download(this.value)'>\n";
|
||||||
echo " <option value=''>".$text['label-download']."</option>\n";
|
echo " <option value=''>".$text['label-download']."</option>\n";
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
|
//format the mac address and
|
||||||
|
$format = new provision();
|
||||||
|
$mac = $format->format_mac($device_mac_address, $device_vendor);
|
||||||
//render the file name
|
//render the file name
|
||||||
$file_name = str_replace("{\$mac}",$device_mac_address,basename($file));
|
$file_name = str_replace("{\$mac}", $mac, basename($file));
|
||||||
//add the select option
|
//add the select option
|
||||||
echo " <option value='".basename($file)."'>".$file_name."</option>\n";
|
echo " <option value='".basename($file)."'>".$file_name."</option>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,18 +53,6 @@ include "root.php";
|
|||||||
case "00085d":
|
case "00085d":
|
||||||
$device_vendor = "aastra";
|
$device_vendor = "aastra";
|
||||||
break;
|
break;
|
||||||
case "000e08":
|
|
||||||
$device_vendor = "linksys";
|
|
||||||
break;
|
|
||||||
case "0004f2":
|
|
||||||
$device_vendor = "polycom";
|
|
||||||
break;
|
|
||||||
case "00907a":
|
|
||||||
$device_vendor = "polycom";
|
|
||||||
break;
|
|
||||||
case "0080f0":
|
|
||||||
$device_vendor = "panasonic";
|
|
||||||
break;
|
|
||||||
case "001873":
|
case "001873":
|
||||||
$device_vendor = "cisco";
|
$device_vendor = "cisco";
|
||||||
break;
|
break;
|
||||||
@@ -83,23 +71,38 @@ include "root.php";
|
|||||||
case "68efbd":
|
case "68efbd":
|
||||||
$device_vendor = "cisco";
|
$device_vendor = "cisco";
|
||||||
break;
|
break;
|
||||||
|
case "000b82":
|
||||||
|
$device_vendor = "grandstream";
|
||||||
|
break;
|
||||||
|
case "00177d":
|
||||||
|
$device_vendor = "konftel";
|
||||||
|
break;
|
||||||
case "00045a":
|
case "00045a":
|
||||||
$device_vendor = "linksys";
|
$device_vendor = "linksys";
|
||||||
break;
|
break;
|
||||||
case "000625":
|
case "000625":
|
||||||
$device_vendor = "linksys";
|
$device_vendor = "linksys";
|
||||||
break;
|
break;
|
||||||
case "001565":
|
case "000e08":
|
||||||
$device_vendor = "yealink";
|
$device_vendor = "linksys";
|
||||||
|
break;
|
||||||
|
case "08000f":
|
||||||
|
$device_vendor = "mitel";
|
||||||
|
break;
|
||||||
|
case "0080f0":
|
||||||
|
$device_vendor = "panasonic";
|
||||||
|
break;
|
||||||
|
case "0004f2":
|
||||||
|
$device_vendor = "polycom";
|
||||||
|
break;
|
||||||
|
case "00907a":
|
||||||
|
$device_vendor = "polycom";
|
||||||
break;
|
break;
|
||||||
case "000413":
|
case "000413":
|
||||||
$device_vendor = "snom";
|
$device_vendor = "snom";
|
||||||
break;
|
break;
|
||||||
case "000b82":
|
case "001565":
|
||||||
$device_vendor = "grandstream";
|
$device_vendor = "yealink";
|
||||||
break;
|
|
||||||
case "00177d":
|
|
||||||
$device_vendor = "konftel";
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$device_vendor = "";
|
$device_vendor = "";
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<context name="{v_context}">
|
||||||
|
<extension name="cidlookup" number="" continue="true" app_uuid="a0cb498c-6e09-441f-83ea-a7684565c44e" enabled="false">
|
||||||
|
<condition field="${user_exists}" expression="^true$"/>
|
||||||
|
<condition field="${call_direction}" expression="^(inbound)$" break="never">
|
||||||
|
<action application="set" data="effective_caller_id_name=${cidlookup(${caller_id_number})}"/>
|
||||||
|
</condition>
|
||||||
|
</extension>
|
||||||
|
</context>
|
||||||
+15
-9
@@ -298,15 +298,21 @@ openlog("fusion-provisioning", LOG_PID | LOG_PERROR, LOG_LOCAL0);
|
|||||||
//deliver the customized config over HTTP/HTTPS
|
//deliver the customized config over HTTP/HTTPS
|
||||||
//need to make sure content-type is correct
|
//need to make sure content-type is correct
|
||||||
if ($_REQUEST['content_type'] == 'application/octet-stream') {
|
if ($_REQUEST['content_type'] == 'application/octet-stream') {
|
||||||
$file_name = str_replace("{\$mac}",$mac,$file);
|
//format the mac address and
|
||||||
header('Content-Description: File Transfer');
|
$mac = $prov->format_mac($mac, $device_vendor);
|
||||||
header('Content-Type: application/octet-stream');
|
|
||||||
header('Content-Disposition: attachment; filename="'.basename($file_name).'"');
|
//replace the variable name with the value
|
||||||
header('Content-Transfer-Encoding: binary');
|
$file_name = str_replace("{\$mac}", $mac, $file);
|
||||||
header('Expires: 0');
|
|
||||||
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
//set the headers
|
||||||
header('Pragma: public');
|
header('Content-Description: File Transfer');
|
||||||
header('Content-Length: ' . filesize($file_contents));
|
header('Content-Type: application/octet-stream');
|
||||||
|
header('Content-Disposition: attachment; filename="'.basename($file_name).'"');
|
||||||
|
header('Content-Transfer-Encoding: binary');
|
||||||
|
header('Expires: 0');
|
||||||
|
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
||||||
|
header('Pragma: public');
|
||||||
|
header('Content-Length: ' . filesize($file_contents));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$cfg_ext = ".cfg";
|
$cfg_ext = ".cfg";
|
||||||
|
|||||||
@@ -126,7 +126,29 @@ include "root.php";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function render() {
|
//set the mac address in the correct format for the specific vendor
|
||||||
|
public function format_mac($mac, $vendor) {
|
||||||
|
switch (strtolower($vendor)) {
|
||||||
|
case "aastra":
|
||||||
|
$mac = strtoupper($mac);
|
||||||
|
break;
|
||||||
|
case "mitel":
|
||||||
|
$mac = strtoupper($mac);
|
||||||
|
break;
|
||||||
|
case "polycom":
|
||||||
|
$mac = strtolower($mac);
|
||||||
|
break;
|
||||||
|
case "snom":
|
||||||
|
$mac = strtolower($mac);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$mac = strtolower($mac);
|
||||||
|
$mac = substr($mac, 0,2).'-'.substr($mac, 2,2).'-'.substr($mac, 4,2).'-'.substr($mac, 6,2).'-'.substr($mac, 8,2).'-'.substr($mac, 10,2);
|
||||||
|
}
|
||||||
|
return $mac;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render() {
|
||||||
|
|
||||||
//debug
|
//debug
|
||||||
$debug = $_REQUEST['debug']; // array
|
$debug = $_REQUEST['debug']; // array
|
||||||
@@ -473,7 +495,7 @@ include "root.php";
|
|||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
}
|
}
|
||||||
|
|
||||||
//get the extensions array and add to the template engine
|
//get the contact extensions array and add to the template engine
|
||||||
if (strlen($device_uuid) > 0 and strlen($domain_uuid) > 0 and $_SESSION['provision']['directory_extensions']['boolean'] == "true") {
|
if (strlen($device_uuid) > 0 and strlen($domain_uuid) > 0 and $_SESSION['provision']['directory_extensions']['boolean'] == "true") {
|
||||||
//get contacts from the database
|
//get contacts from the database
|
||||||
$sql = "select c.contact_organization, c.contact_name_given, c.contact_name_family, e.extension ";
|
$sql = "select c.contact_organization, c.contact_name_given, c.contact_name_family, e.extension ";
|
||||||
@@ -489,9 +511,27 @@ include "root.php";
|
|||||||
$sql .= "order by c.contact_organization desc, c.contact_name_given asc, c.contact_name_family asc ";
|
$sql .= "order by c.contact_organization desc, c.contact_name_given asc, c.contact_name_family asc ";
|
||||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
$extensions = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
$contact_extensions = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||||
unset ($prep_statement, $sql);
|
unset ($prep_statement, $sql);
|
||||||
|
|
||||||
|
//assign the contacts array
|
||||||
|
$view->assign("contact_extensions", $contact_extensions);
|
||||||
|
}
|
||||||
|
|
||||||
|
//get the extensions array and add to the template engine
|
||||||
|
if (strlen($device_uuid) > 0 and strlen($domain_uuid) > 0 and $_SESSION['provision']['directory_extensions']['boolean'] == "true") {
|
||||||
|
//get contacts from the database
|
||||||
|
$sql = "select directory_full_name, description ";
|
||||||
|
$sql .= "effective_caller_id_name, effective_caller_id_number ";
|
||||||
|
$sql .= "from v_extensions ";
|
||||||
|
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||||
|
$sql .= "and enabled = 'true' ";
|
||||||
|
$prep_statement = $db->prepare($sql);
|
||||||
|
if ($prep_statement) {
|
||||||
|
$prep_statement->execute();
|
||||||
|
$extensions = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||||
|
}
|
||||||
|
|
||||||
//assign the contacts array
|
//assign the contacts array
|
||||||
$view->assign("extensions", $extensions);
|
$view->assign("extensions", $extensions);
|
||||||
}
|
}
|
||||||
@@ -703,20 +743,7 @@ include "root.php";
|
|||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
|
|
||||||
//set the mac address in the correct format
|
//set the mac address in the correct format
|
||||||
switch (strtolower($device_vendor)) {
|
$mac = $this->format_mac($mac, $device_vendor);
|
||||||
case "aastra":
|
|
||||||
$mac = strtoupper($mac);
|
|
||||||
break;
|
|
||||||
case "snom":
|
|
||||||
$mac = strtolower($mac);
|
|
||||||
break;
|
|
||||||
case "polycom":
|
|
||||||
$mac = strtolower($mac);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$mac = strtolower($mac);
|
|
||||||
$mac = substr($mac, 0,2).'-'.substr($mac, 2,2).'-'.substr($mac, 4,2).'-'.substr($mac, 6,2).'-'.substr($mac, 8,2).'-'.substr($mac, 10,2);
|
|
||||||
}
|
|
||||||
|
|
||||||
//replace the variables in the template in the future loop through all the line numbers to do a replace for each possible line number
|
//replace the variables in the template in the future loop through all the line numbers to do a replace for each possible line number
|
||||||
$view->assign("mac" , $mac);
|
$view->assign("mac" , $mac);
|
||||||
@@ -882,15 +909,11 @@ include "root.php";
|
|||||||
$this->file = $file_name;
|
$this->file = $file_name;
|
||||||
$file_contents = $this->render();
|
$file_contents = $this->render();
|
||||||
|
|
||||||
|
//format the mac address
|
||||||
|
$mac = $this->format_mac($device_mac_address, $device_vendor);
|
||||||
|
|
||||||
//replace {$mac} in the file name
|
//replace {$mac} in the file name
|
||||||
if ($device_vendor == "aastra" || $device_vendor == "cisco") {
|
$file_name = str_replace("{\$mac}", $mac, $file_name);
|
||||||
//upper case the mac address for aastra phones
|
|
||||||
$file_name = str_replace("{\$mac}", strtoupper($device_mac_address), $file_name);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//all other phones
|
|
||||||
$file_name = str_replace("{\$mac}", $device_mac_address, $file_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
//write the file
|
//write the file
|
||||||
//echo $directory.'/'.$file_name."\n";
|
//echo $directory.'/'.$file_name."\n";
|
||||||
|
|||||||
@@ -290,7 +290,7 @@
|
|||||||
case "inbound":
|
case "inbound":
|
||||||
$callee_number = check_str(urldecode($row->caller_profile->destination_number));
|
$callee_number = check_str(urldecode($row->caller_profile->destination_number));
|
||||||
$callee_number_serie = number_series($callee_number);
|
$callee_number_serie = number_series($callee_number);
|
||||||
$sql_user_rate = "SELECT v_lcr.currency, v_lcr.rate, v_lcr.connect_increment, v_lcr.talk_increment FROM v_lcr JOIN v_billings ON v_billings.type_value='$accountcode' WHERE v_lcr.carrier_uuid IS NULL AND v_lcr.lcr_direction = '".check_str(urldecode($xml->variables->call_direction))."' AND v_lcr.lcr_profile=v_billings.lcr_profile AND NOW() >= v_lcr.date_start AND NOW() < v_lcr.date_end AND digits IN ($destination_number_serie) ORDER BY digits DESC, rate ASC, date_start DESC LIMIT 1";
|
$sql_user_rate = "SELECT v_lcr.currency, v_lcr.rate, v_lcr.connect_increment, v_lcr.talk_increment FROM v_lcr JOIN v_billings ON v_billings.type_value='$accountcode' WHERE v_lcr.carrier_uuid IS NULL AND v_lcr.lcr_direction = '".check_str(urldecode($xml->variables->call_direction))."' AND v_lcr.lcr_profile=v_billings.lcr_profile AND NOW() >= v_lcr.date_start AND NOW() < v_lcr.date_end AND digits IN ($callee_number_serie) ORDER BY digits DESC, rate ASC, date_start DESC LIMIT 1";
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
echo "sql_user_rate: $sql_user_rate\n";
|
echo "sql_user_rate: $sql_user_rate\n";
|
||||||
|
|||||||
+121
-116
@@ -44,6 +44,7 @@
|
|||||||
|
|
||||||
--get the variables
|
--get the variables
|
||||||
dsn = trim(api:execute("global_getvar", "dsn"));
|
dsn = trim(api:execute("global_getvar", "dsn"));
|
||||||
|
dsn_callcenter = trim(api:execute("global_getvar", "dsn_callcenter"));
|
||||||
|
|
||||||
--start the xml array
|
--start the xml array
|
||||||
local xml = {}
|
local xml = {}
|
||||||
@@ -52,8 +53,12 @@
|
|||||||
table.insert(xml, [[ <section name="configuration">]]);
|
table.insert(xml, [[ <section name="configuration">]]);
|
||||||
table.insert(xml, [[ <configuration name="callcenter.conf" description="Call Center">]]);
|
table.insert(xml, [[ <configuration name="callcenter.conf" description="Call Center">]]);
|
||||||
table.insert(xml, [[ <settings>]]);
|
table.insert(xml, [[ <settings>]]);
|
||||||
if (string.len(dsn) > 0) then
|
if (dsn_callcenter) then
|
||||||
table.insert(xml, [[ <param name="odbc-dsn" value="]]..database["switch"]..[["/>]]);
|
table.insert(xml, [[ <param name="odbc-dsn" value="]]..dsn_callcenter..[["/>]]);
|
||||||
|
else
|
||||||
|
if (string.len(dsn) > 0) then
|
||||||
|
table.insert(xml, [[ <param name="odbc-dsn" value="]]..database["switch"]..[["/>]]);
|
||||||
|
end
|
||||||
end
|
end
|
||||||
--table.insert(xml, [[ <param name="dbname" value="/usr/local/freeswitch/db/call_center.db"/>]]);
|
--table.insert(xml, [[ <param name="dbname" value="/usr/local/freeswitch/db/call_center.db"/>]]);
|
||||||
table.insert(xml, [[ </settings>]]);
|
table.insert(xml, [[ </settings>]]);
|
||||||
@@ -156,136 +161,136 @@
|
|||||||
table.insert(xml, [[ </queues>]]);
|
table.insert(xml, [[ </queues>]]);
|
||||||
|
|
||||||
--get the agents
|
--get the agents
|
||||||
table.insert(xml, [[ <agents>]]);
|
table.insert(xml, [[ <agents>]]);
|
||||||
sql = "select * from v_call_center_agents as a, v_domains as d ";
|
sql = "select * from v_call_center_agents as a, v_domains as d ";
|
||||||
sql = sql .. "where d.domain_uuid = a.domain_uuid; ";
|
sql = sql .. "where d.domain_uuid = a.domain_uuid; ";
|
||||||
if (debug["sql"]) then
|
if (debug["sql"]) then
|
||||||
freeswitch.consoleLog("notice", "[xml_handler] SQL: " .. sql .. "\n");
|
freeswitch.consoleLog("notice", "[xml_handler] SQL: " .. sql .. "\n");
|
||||||
end
|
end
|
||||||
x = 0;
|
x = 0;
|
||||||
dbh:query(sql, function(row)
|
dbh:query(sql, function(row)
|
||||||
--get the values from the database and set as variables
|
--get the values from the database and set as variables
|
||||||
domain_uuid = row.domain_uuid;
|
domain_uuid = row.domain_uuid;
|
||||||
domain_name = row.domain_name;
|
domain_name = row.domain_name;
|
||||||
agent_name = row.agent_name;
|
agent_name = row.agent_name;
|
||||||
agent_type = row.agent_type;
|
agent_type = row.agent_type;
|
||||||
agent_call_timeout = row.agent_call_timeout;
|
agent_call_timeout = row.agent_call_timeout;
|
||||||
agent_contact = row.agent_contact;
|
agent_contact = row.agent_contact;
|
||||||
agent_status = row.agent_status;
|
agent_status = row.agent_status;
|
||||||
agent_no_answer_delay_time = row.agent_no_answer_delay_time;
|
agent_no_answer_delay_time = row.agent_no_answer_delay_time;
|
||||||
agent_max_no_answer = row.agent_max_no_answer;
|
agent_max_no_answer = row.agent_max_no_answer;
|
||||||
agent_wrap_up_time = row.agent_wrap_up_time;
|
agent_wrap_up_time = row.agent_wrap_up_time;
|
||||||
agent_reject_delay_time = row.agent_reject_delay_time;
|
agent_reject_delay_time = row.agent_reject_delay_time;
|
||||||
agent_busy_delay_time = row.agent_busy_delay_time;
|
agent_busy_delay_time = row.agent_busy_delay_time;
|
||||||
|
|
||||||
--get and then set the complete agent_contact with the call_timeout and when necessary confirm
|
--get and then set the complete agent_contact with the call_timeout and when necessary confirm
|
||||||
--confirm = "group_confirm_file=custom/press_1_to_accept_this_call.wav,group_confirm_key=1";
|
--confirm = "group_confirm_file=custom/press_1_to_accept_this_call.wav,group_confirm_key=1";
|
||||||
--if you change this variable also change app/call_center/call_center_agent_edit.php
|
--if you change this variable also change app/call_center/call_center_agent_edit.php
|
||||||
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 (string.find(agent_contact, '}') == nil) then
|
if (string.find(agent_contact, '}') == nil) then
|
||||||
|
--not found
|
||||||
|
if (string.find(agent_contact, 'sofia/gateway') == nil) then
|
||||||
|
--add the call_timeout
|
||||||
|
agent_contact = "{call_timeout="..agent_call_timeout.."}"..agent_contact;
|
||||||
|
else
|
||||||
|
--add the call_timeout and confirm
|
||||||
|
tmp_pos = string.find(agent_contact, "}");
|
||||||
|
tmp_first = string.sub(agent_contact, 0, tmp_pos);
|
||||||
|
tmp_last = string.sub(agent_contact, tmp_pos);
|
||||||
|
agent_contact = tmp_first..',call_timeout='..agent_call_timeout..tmp_last;
|
||||||
|
agent_contact = "{"..confirm..",call_timeout="..agent_call_timeout.."}"..agent_contact;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
--found
|
||||||
|
if (string.find(agent_contact, 'sofia/gateway') == nil) then
|
||||||
--not found
|
--not found
|
||||||
if (string.find(agent_contact, 'sofia/gateway') == nil) then
|
if (string.find(agent_contact, 'call_timeout') == nil) then
|
||||||
--add the call_timeout
|
--add the call_timeout
|
||||||
agent_contact = "{call_timeout="..agent_call_timeout.."}"..agent_contact;
|
pos = string.find(agent_contact, "}");
|
||||||
|
first = string.sub(agent_contact, 0, pos);
|
||||||
|
last = string.sub(agent_contact, tmp_pos);
|
||||||
|
agent_contact = first..[[,call_timeout=]]..agent_call_timeout..last;
|
||||||
else
|
else
|
||||||
--add the call_timeout and confirm
|
--the string has the call timeout
|
||||||
tmp_pos = string.find(agent_contact, "}");
|
agent_contact = agent_contact;
|
||||||
tmp_first = string.sub(agent_contact, 0, tmp_pos);
|
|
||||||
tmp_last = string.sub(agent_contact, tmp_pos);
|
|
||||||
agent_contact = tmp_first..',call_timeout='..agent_call_timeout..tmp_last;
|
|
||||||
agent_contact = "{"..confirm..",call_timeout="..agent_call_timeout.."}"..agent_contact;
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
--found
|
--found
|
||||||
if (string.find(agent_contact, 'sofia/gateway') == nil) then
|
pos = string.find(agent_contact, "}");
|
||||||
--not found
|
first = string.sub(agent_contact, 0, pos);
|
||||||
if (string.find(agent_contact, 'call_timeout') == nil) then
|
last = string.sub(agent_contact, pos);
|
||||||
--add the call_timeout
|
if (stristr(agent_contact, 'call_timeout') == FALSE) then
|
||||||
pos = string.find(agent_contact, "}");
|
--add the call_timeout and confirm
|
||||||
first = string.sub(agent_contact, 0, pos);
|
agent_contact = first..','..confirm..',call_timeout='..agent_call_timeout..last;
|
||||||
last = string.sub(agent_contact, tmp_pos);
|
|
||||||
agent_contact = first..[[,call_timeout=]]..agent_call_timeout..last;
|
|
||||||
else
|
|
||||||
--the string has the call timeout
|
|
||||||
agent_contact = agent_contact;
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
--found
|
--add confirm
|
||||||
pos = string.find(agent_contact, "}");
|
agent_contact = tmp_first..','..confirm..tmp_last;
|
||||||
first = string.sub(agent_contact, 0, pos);
|
|
||||||
last = string.sub(agent_contact, pos);
|
|
||||||
if (stristr(agent_contact, 'call_timeout') == FALSE) then
|
|
||||||
--add the call_timeout and confirm
|
|
||||||
agent_contact = first..','..confirm..',call_timeout='..agent_call_timeout..last;
|
|
||||||
else
|
|
||||||
--add confirm
|
|
||||||
agent_contact = tmp_first..','..confirm..tmp_last;
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--build the xml string
|
--build the xml string
|
||||||
table.insert(xml, [[ <agent ]]);
|
table.insert(xml, [[ <agent ]]);
|
||||||
table.insert(xml, [[ name="]]..agent_name..[[@]]..domain_name..[[" ]]);
|
table.insert(xml, [[ name="]]..agent_name..[[@]]..domain_name..[[" ]]);
|
||||||
table.insert(xml, [[ type="]]..agent_type..[[" ]]);
|
table.insert(xml, [[ type="]]..agent_type..[[" ]]);
|
||||||
table.insert(xml, [[ contact="]]..agent_contact..[[" ]]);
|
table.insert(xml, [[ contact="]]..agent_contact..[[" ]]);
|
||||||
table.insert(xml, [[ status="]]..agent_status..[[" ]]);
|
table.insert(xml, [[ status="]]..agent_status..[[" ]]);
|
||||||
if (agent_no_answer_delay_time ~= nil) then
|
if (agent_no_answer_delay_time ~= nil) then
|
||||||
table.insert(xml, [[ no-answer-delay-time="]]..agent_no_answer_delay_time..[[" ]]);
|
table.insert(xml, [[ no-answer-delay-time="]]..agent_no_answer_delay_time..[[" ]]);
|
||||||
end
|
end
|
||||||
if (agent_max_no_answer ~= nil) then
|
if (agent_max_no_answer ~= nil) then
|
||||||
table.insert(xml, [[ max-no-answer="]]..agent_max_no_answer..[[" ]]);
|
table.insert(xml, [[ max-no-answer="]]..agent_max_no_answer..[[" ]]);
|
||||||
end
|
end
|
||||||
if (agent_wrap_up_time ~= nil) then
|
if (agent_wrap_up_time ~= nil) then
|
||||||
table.insert(xml, [[ wrap-up-time="]]..agent_wrap_up_time..[[" ]]);
|
table.insert(xml, [[ wrap-up-time="]]..agent_wrap_up_time..[[" ]]);
|
||||||
end
|
end
|
||||||
if (agent_reject_delay_time ~= nil) then
|
if (agent_reject_delay_time ~= nil) then
|
||||||
table.insert(xml, [[ reject-delay-time="]]..agent_reject_delay_time..[[" ]]);
|
table.insert(xml, [[ reject-delay-time="]]..agent_reject_delay_time..[[" ]]);
|
||||||
end
|
end
|
||||||
if (agent_busy_delay_time ~= nil) then
|
if (agent_busy_delay_time ~= nil) then
|
||||||
table.insert(xml, [[ busy-delay-time="]]..agent_busy_delay_time..[[" ]]);
|
table.insert(xml, [[ busy-delay-time="]]..agent_busy_delay_time..[[" ]]);
|
||||||
end
|
end
|
||||||
table.insert(xml, [[ />]]);
|
table.insert(xml, [[ />]]);
|
||||||
end)
|
end)
|
||||||
table.insert(xml, [[ </agents>]]);
|
table.insert(xml, [[ </agents>]]);
|
||||||
|
|
||||||
--get the tiers
|
--get the tiers
|
||||||
sql = "select * from v_call_center_tiers as t, v_domains as d ";
|
sql = "select * from v_call_center_tiers as t, v_domains as d ";
|
||||||
sql = sql .. "where d.domain_uuid = t.domain_uuid; ";
|
sql = sql .. "where d.domain_uuid = t.domain_uuid; ";
|
||||||
if (debug["sql"]) then
|
if (debug["sql"]) then
|
||||||
freeswitch.consoleLog("notice", "[xml_handler] SQL: " .. sql .. "\n");
|
freeswitch.consoleLog("notice", "[xml_handler] SQL: " .. sql .. "\n");
|
||||||
end
|
end
|
||||||
table.insert(xml, [[ <tiers>]]);
|
table.insert(xml, [[ <tiers>]]);
|
||||||
dbh:query(sql, function(row)
|
dbh:query(sql, function(row)
|
||||||
--get the values from the database and set as variables
|
--get the values from the database and set as variables
|
||||||
domain_uuid = row.domain_uuid;
|
domain_uuid = row.domain_uuid;
|
||||||
domain_name = row.domain_name;
|
domain_name = row.domain_name;
|
||||||
agent_name = row.agent_name;
|
agent_name = row.agent_name;
|
||||||
queue_name = row.queue_name;
|
queue_name = row.queue_name;
|
||||||
tier_level = row.tier_level;
|
tier_level = row.tier_level;
|
||||||
tier_position = row.tier_position;
|
tier_position = row.tier_position;
|
||||||
--build the xml
|
--build the xml
|
||||||
table.insert(xml, [[ <tier ]]);
|
table.insert(xml, [[ <tier ]]);
|
||||||
table.insert(xml, [[ agent="]]..agent_name..[[@]]..domain_name..[[" ]]);
|
table.insert(xml, [[ agent="]]..agent_name..[[@]]..domain_name..[[" ]]);
|
||||||
table.insert(xml, [[ queue="]]..queue_name..[[@]]..domain_name..[[" ]]);
|
table.insert(xml, [[ queue="]]..queue_name..[[@]]..domain_name..[[" ]]);
|
||||||
table.insert(xml, [[ level="]]..tier_level..[[" ]]);
|
table.insert(xml, [[ level="]]..tier_level..[[" ]]);
|
||||||
table.insert(xml, [[ position="]]..tier_position..[[" ]]);
|
table.insert(xml, [[ position="]]..tier_position..[[" ]]);
|
||||||
table.insert(xml, [[ />]]);
|
table.insert(xml, [[ />]]);
|
||||||
end)
|
end)
|
||||||
table.insert(xml, [[ </tiers>]]);
|
table.insert(xml, [[ </tiers>]]);
|
||||||
|
|
||||||
--close the extension tag if it was left open
|
--close the extension tag if it was left open
|
||||||
table.insert(xml, [[ </configuration>]]);
|
table.insert(xml, [[ </configuration>]]);
|
||||||
table.insert(xml, [[ </section>]]);
|
table.insert(xml, [[ </section>]]);
|
||||||
table.insert(xml, [[</document>]]);
|
table.insert(xml, [[</document>]]);
|
||||||
XML_STRING = table.concat(xml, "\n");
|
XML_STRING = table.concat(xml, "\n");
|
||||||
if (debug["xml_string"]) then
|
if (debug["xml_string"]) then
|
||||||
freeswitch.consoleLog("notice", "[xml_handler] XML_STRING: " .. XML_STRING .. "\n");
|
freeswitch.consoleLog("notice", "[xml_handler] XML_STRING: " .. XML_STRING .. "\n");
|
||||||
end
|
end
|
||||||
|
|
||||||
--close the database connection
|
--close the database connection
|
||||||
dbh:release();
|
dbh:release();
|
||||||
--freeswitch.consoleLog("notice", "[xml_handler]"..api:execute("eval ${dsn}"));
|
--freeswitch.consoleLog("notice", "[xml_handler]"..api:execute("eval ${dsn}"));
|
||||||
|
|
||||||
--set the cache
|
--set the cache
|
||||||
result = trim(api:execute("memcache", "set configuration:callcenter.conf:" .. hostname .." '"..XML_STRING:gsub("'", "'").."' ".."expire['callcenter.conf']"));
|
result = trim(api:execute("memcache", "set configuration:callcenter.conf:" .. hostname .." '"..XML_STRING:gsub("'", "'").."' ".."expire['callcenter.conf']"));
|
||||||
|
|||||||
@@ -457,8 +457,8 @@
|
|||||||
freeswitch.consoleLog("INFO", "[FAX] RETRY_STATS FAILURE BAD NUMBER: GATEWAY[".. fax_uri .."]");
|
freeswitch.consoleLog("INFO", "[FAX] RETRY_STATS FAILURE BAD NUMBER: GATEWAY[".. fax_uri .."]");
|
||||||
email_message_fail = email_message_fail.."We tried sending, but the number entered was not a working phone number "
|
email_message_fail = email_message_fail.."We tried sending, but the number entered was not a working phone number "
|
||||||
email_address = email_address:gsub("\\,", ",");
|
email_address = email_address:gsub("\\,", ",");
|
||||||
freeswitch.email("",
|
freeswitch.email(email_address,
|
||||||
"",
|
email_address,
|
||||||
"To: "..email_address.."\nFrom: "..from_address.."\nSubject: Fax to: "..number_dialed.." was INVALID",
|
"To: "..email_address.."\nFrom: "..from_address.."\nSubject: Fax to: "..number_dialed.." was INVALID",
|
||||||
email_message_fail ,
|
email_message_fail ,
|
||||||
fax_file
|
fax_file
|
||||||
@@ -470,8 +470,8 @@
|
|||||||
freeswitch.consoleLog("INFO", "[FAX] RETRY STATS FAILURE BUSY: GATEWAY[".. fax_uri .."], BUSY NUMBER");
|
freeswitch.consoleLog("INFO", "[FAX] RETRY STATS FAILURE BUSY: GATEWAY[".. fax_uri .."], BUSY NUMBER");
|
||||||
email_message_fail = email_message_fail.." We tried sending, but the call was busy "..fax_busy_attempts.." of those times."
|
email_message_fail = email_message_fail.." We tried sending, but the call was busy "..fax_busy_attempts.." of those times."
|
||||||
email_address = email_address:gsub("\\,", ",");
|
email_address = email_address:gsub("\\,", ",");
|
||||||
freeswitch.email("",
|
freeswitch.email(email_address,
|
||||||
"",
|
email_address,
|
||||||
"To: "..email_address.."\nFrom: "..from_address.."\nSubject: Fax to: "..number_dialed.." was BUSY",
|
"To: "..email_address.."\nFrom: "..from_address.."\nSubject: Fax to: "..number_dialed.." was BUSY",
|
||||||
email_message_fail ,
|
email_message_fail ,
|
||||||
fax_file
|
fax_file
|
||||||
@@ -485,8 +485,8 @@
|
|||||||
email_message_fail = email_message_fail.." We tried sending 5 times ways. You may also want to know that the call was busy "..fax_busy_attempts.." of those times."
|
email_message_fail = email_message_fail.." We tried sending 5 times ways. You may also want to know that the call was busy "..fax_busy_attempts.." of those times."
|
||||||
email_address = email_address:gsub("\\,", ",");
|
email_address = email_address:gsub("\\,", ",");
|
||||||
|
|
||||||
freeswitch.email("",
|
freeswitch.email(email_address,
|
||||||
"",
|
email_address,
|
||||||
"To: "..email_address.."\nFrom: "..from_address.."\nSubject: Fax to: "..number_dialed.." FAILED",
|
"To: "..email_address.."\nFrom: "..from_address.."\nSubject: Fax to: "..number_dialed.." FAILED",
|
||||||
email_message_fail ,
|
email_message_fail ,
|
||||||
fax_file
|
fax_file
|
||||||
@@ -521,8 +521,8 @@
|
|||||||
freeswitch.consoleLog("INFO", "[FAX] RETRY STATS SUCCESS: GATEWAY[".. fax_uri .."] VARS[" .. fax_trial .. "]");
|
freeswitch.consoleLog("INFO", "[FAX] RETRY STATS SUCCESS: GATEWAY[".. fax_uri .."] VARS[" .. fax_trial .. "]");
|
||||||
email_address = email_address:gsub("\\,", ",");
|
email_address = email_address:gsub("\\,", ",");
|
||||||
|
|
||||||
freeswitch.email("",
|
freeswitch.email(email_address,
|
||||||
"",
|
email_address,
|
||||||
"To: "..email_address.."\nFrom: "..from_address.."\nSubject: Fax to: "..number_dialed.." SENT",
|
"To: "..email_address.."\nFrom: "..from_address.."\nSubject: Fax to: "..number_dialed.." SENT",
|
||||||
email_message_success ,
|
email_message_success ,
|
||||||
fax_file
|
fax_file
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
<configuration name="cidlookup.conf" description="cidlookup Configuration">
|
<configuration name="cidlookup.conf" description="cidlookup Configuration">
|
||||||
<settings>
|
<settings>
|
||||||
<!-- comment out url to not setup a url based lookup -->
|
<!-- comment out url to not setup a url based lookup -->
|
||||||
<param name="url" value="http://query.voipcnam.com/query.php?api_key=MYAPIKEY&number=${caller_id_number}"/>
|
<!--<param name="url" value="http://query.voipcnam.com/query.php?api_key=MYAPIKEY&number=${caller_id_number}"/>-->
|
||||||
|
|
||||||
<!-- comment out url to not setup a url based lookup -->
|
|
||||||
<!-- contact support@to-call.me for more details -->
|
|
||||||
<!-- <param name="url" value="http://cnam.to-call.me/lookup/${caller_id_number}?api_key=MYAPIKEY"/> -->
|
|
||||||
|
|
||||||
<!-- comment out whitepages-apikey to not use whitepages.com, you must
|
<!-- comment out whitepages-apikey to not use whitepages.com, you must
|
||||||
get an API key from http://developer.whitepages.com/ -->
|
get an API key from http://developer.whitepages.com/ -->
|
||||||
<!--<param name="whitepages-apikey" value="MYAPIKEY"/>-->
|
<param name="whitepages-apikey" value="MYAPIKEY"/>-->
|
||||||
|
|
||||||
<!-- set to false to not cache (in memcache) results from the url query -->
|
<!-- set to false to not cache (in memcache) results from the url query -->
|
||||||
<param name="cache" value="true"/>
|
<param name="cache" value="true"/>
|
||||||
@@ -21,11 +17,12 @@
|
|||||||
|
|
||||||
<!-- comment out sql to not setup a database (directory) lookup -->
|
<!-- comment out sql to not setup a database (directory) lookup -->
|
||||||
<param name="sql" value="
|
<param name="sql" value="
|
||||||
SELECT v_contacts.contact_name_given || ' ' || v_contacts.contact_name_family ||' ('||v_contact_phones.phone_type||')' AS name, v_contact_phones.phone_number AS number
|
SELECT trim(v_contacts.contact_name_given || ' ' || v_contacts.contact_name_family || ' (' || v_contacts.contact_organization || ')') AS name, v_contact_phones.phone_number AS number
|
||||||
FROM v_contacts, v_contact_phones
|
FROM v_contacts, v_contact_phones
|
||||||
WHERE v_contact_phones.contact_uuid = v_contacts.contact_uuid AND v_contact_phones.phone_number = '${caller_id_number}'
|
WHERE v_contact_phones.contact_uuid = v_contacts.contact_uuid AND (v_contact_phones.phone_number = '${caller_id_number}' OR v_contact_phones.phone_number = '1${caller_id_number}')
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
"/>
|
"/>
|
||||||
|
|
||||||
<!-- comment out citystate-sql to not setup a database (city/state)
|
<!-- comment out citystate-sql to not setup a database (city/state)
|
||||||
lookup -->
|
lookup -->
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ preferred_codec: g711ulaw
|
|||||||
enable_vad: 0
|
enable_vad: 0
|
||||||
dial_template: "dialplan"
|
dial_template: "dialplan"
|
||||||
|
|
||||||
{foreach $lines as $row}reg.{$row.line_number}.displayName="{$row.display_name}"
|
# Registration information
|
||||||
#registration information
|
{foreach $lines as $row}
|
||||||
|
reg.{$row.line_number}.displayName="{$row.display_name}"
|
||||||
proxy{$row.line_number}_address: "{$row.server_address}"
|
proxy{$row.line_number}_address: "{$row.server_address}"
|
||||||
proxy{$row.line_number}_port:"{$row.sip_port}"
|
proxy{$row.line_number}_port:"{$row.sip_port}"
|
||||||
line{$row.line_number}_name: "{$row.user_id}"
|
line{$row.line_number}_name: "{$row.user_id}"
|
||||||
@@ -111,8 +112,11 @@ dst_stop_time: "2"
|
|||||||
dst_auto_adjust: "1"
|
dst_auto_adjust: "1"
|
||||||
|
|
||||||
# Do Not Disturb Control (0-off, 1-on, 2-off with no user control, 3-on with no user control)
|
# Do Not Disturb Control (0-off, 1-on, 2-off with no user control, 3-on with no user control)
|
||||||
|
{if isset($cisco_dnd_control)}
|
||||||
|
dnd_control: "{$cisco_dnd_control}" ; Default 0 (Do Not Disturb feature is off)
|
||||||
|
{else}
|
||||||
dnd_control: "2" ; Default 0 (Do Not Disturb feature is off)
|
dnd_control: "2" ; Default 0 (Do Not Disturb feature is off)
|
||||||
|
{/if}
|
||||||
# Caller ID Blocking (0-disabled, 1-enabled, 2-disabled no user control, 3-enabled no user control)
|
# Caller ID Blocking (0-disabled, 1-enabled, 2-disabled no user control, 3-enabled no user control)
|
||||||
callerid_blocking: "0" ; Default 0 (Disable sending all calls as anonymous)
|
callerid_blocking: "0" ; Default 0 (Disable sending all calls as anonymous)
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<TEMPLATE MATCH="1..." Timeout="0" User="Phone"/> <!-- 4 digits intra-office -->
|
<TEMPLATE MATCH="1..." Timeout="0" User="Phone"/> <!-- 4 digits intra-office -->
|
||||||
<TEMPLATE MATCH=".11" Timeout="0" User="Phone"/> <!-- Service numbers -->
|
<TEMPLATE MATCH=".11" Timeout="0" User="Phone"/> <!-- Service numbers -->
|
||||||
<TEMPLATE MATCH="1.........." Timeout="0" User="Phone"/> <!-- Long Distance -->
|
<TEMPLATE MATCH="1.........." Timeout="0" User="Phone"/> <!-- Long Distance -->
|
||||||
<TEMPLATE MATCH="*" Timeout="2"/> <!-- Anything else -->
|
<TEMPLATE MATCH="*" Timeout="2"/> <!-- Anything else -->
|
||||||
<TEMPLATE MATCH="972......." Timeout="0" User="Phone"/> <!-- 10 digits -->
|
<TEMPLATE MATCH="972......." Timeout="0" User="Phone"/> <!-- 10 digits -->
|
||||||
<TEMPLATE MATCH="214......." Timeout="0" User="Phone"/> <!-- 10 digits -->
|
<TEMPLATE MATCH="214......." Timeout="0" User="Phone"/> <!-- 10 digits -->
|
||||||
<TEMPLATE MATCH="469......." Timeout="0" User="Phone"/> <!-- 10 digits -->
|
<TEMPLATE MATCH="469......." Timeout="0" User="Phone"/> <!-- 10 digits -->
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<CiscoIPPhoneDirectory>
|
||||||
|
<Title>Our Phones</Title>
|
||||||
|
<Prompt>Please choose...</Prompt>
|
||||||
|
{assign var=x value=1}
|
||||||
|
{foreach $extensions as $row}{
|
||||||
|
<DirectoryEntry>
|
||||||
|
{if $row.directory_full_name != ""}
|
||||||
|
<Name>{$row.directory_full_name}</Name>
|
||||||
|
{else}
|
||||||
|
<Name>{$row.effective_caller_id_name}</Name>
|
||||||
|
{/if}
|
||||||
|
{if $row.number_alias != ""}
|
||||||
|
<Telephone>{$row.number_alias}</Telephone>
|
||||||
|
{else}
|
||||||
|
<Telephone>{$row.extension}</Telephone>
|
||||||
|
{/if}
|
||||||
|
</DirectoryEntry>
|
||||||
|
{/if}
|
||||||
|
{assign var=x value=$x+1}
|
||||||
|
{/foreach}
|
||||||
|
</CiscoIPPhoneDirectory>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,13 +1,18 @@
|
|||||||
<CiscoIPPhoneMenu>
|
<CiscoIPPhoneMenu>
|
||||||
<Title>Contacts</Title>
|
<Title>Contacts</Title>
|
||||||
<Prompt>Please choose...</Prompt>
|
<Prompt>Please choose...</Prompt>
|
||||||
|
<MenuItem>
|
||||||
|
<Name>Our Phones</Name>
|
||||||
|
<URL>http://{$domain_name}/app/provision/file/directory-extensions.xml</URL>
|
||||||
|
</MenuItem>
|
||||||
<!--
|
<!--
|
||||||
<MenuItem>
|
<MenuItem>
|
||||||
<Name>Personal</Name>
|
<Name>Personal</Name>
|
||||||
<URL>http://{$domain_name}/app/provision/file/directory-personal.xml</URL>
|
<URL>http://{$domain_name}/app/provision/file/directory-personal.xml</URL>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
--> <MenuItem> <Name>Enterprise</Name>
|
-->
|
||||||
|
<MenuItem>
|
||||||
|
<Name>Enterprise</Name>
|
||||||
<URL>http://{$domain_name}/app/provision/file/directory-enterprise.xml?mac={$mac}</URL>
|
<URL>http://{$domain_name}/app/provision/file/directory-enterprise.xml?mac={$mac}</URL>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem>
|
<MenuItem>
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ preferred_codec: g711ulaw
|
|||||||
enable_vad: 0
|
enable_vad: 0
|
||||||
dial_template: "dialplan"
|
dial_template: "dialplan"
|
||||||
|
|
||||||
{foreach $lines as $row}reg.{$row.line_number}.displayName="{$row.display_name}"
|
# Registration information
|
||||||
#registration information
|
{foreach $lines as $row}
|
||||||
|
reg.{$row.line_number}.displayName="{$row.display_name}"
|
||||||
proxy{$row.line_number}_address: "{$row.server_address}"
|
proxy{$row.line_number}_address: "{$row.server_address}"
|
||||||
proxy{$row.line_number}_port:"{$row.sip_port}"
|
proxy{$row.line_number}_port:"{$row.sip_port}"
|
||||||
line{$row.line_number}_name: "{$row.user_id}"
|
line{$row.line_number}_name: "{$row.user_id}"
|
||||||
@@ -111,8 +112,11 @@ dst_stop_time: "2"
|
|||||||
dst_auto_adjust: "1"
|
dst_auto_adjust: "1"
|
||||||
|
|
||||||
# Do Not Disturb Control (0-off, 1-on, 2-off with no user control, 3-on with no user control)
|
# Do Not Disturb Control (0-off, 1-on, 2-off with no user control, 3-on with no user control)
|
||||||
|
{if isset($cisco_dnd_control)}
|
||||||
|
dnd_control: "{$cisco_dnd_control}" ; Default 0 (Do Not Disturb feature is off)
|
||||||
|
{else}
|
||||||
dnd_control: "2" ; Default 0 (Do Not Disturb feature is off)
|
dnd_control: "2" ; Default 0 (Do Not Disturb feature is off)
|
||||||
|
{/if}
|
||||||
# Caller ID Blocking (0-disabled, 1-enabled, 2-disabled no user control, 3-enabled no user control)
|
# Caller ID Blocking (0-disabled, 1-enabled, 2-disabled no user control, 3-enabled no user control)
|
||||||
callerid_blocking: "0" ; Default 0 (Disable sending all calls as anonymous)
|
callerid_blocking: "0" ; Default 0 (Disable sending all calls as anonymous)
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<TEMPLATE MATCH="1..." Timeout="0" User="Phone"/> <!-- 4 digits intra-office -->
|
<TEMPLATE MATCH="1..." Timeout="0" User="Phone"/> <!-- 4 digits intra-office -->
|
||||||
<TEMPLATE MATCH=".11" Timeout="0" User="Phone"/> <!-- Service numbers -->
|
<TEMPLATE MATCH=".11" Timeout="0" User="Phone"/> <!-- Service numbers -->
|
||||||
<TEMPLATE MATCH="1.........." Timeout="0" User="Phone"/> <!-- Long Distance -->
|
<TEMPLATE MATCH="1.........." Timeout="0" User="Phone"/> <!-- Long Distance -->
|
||||||
<TEMPLATE MATCH="*" Timeout="2"/> <!-- Anything else -->
|
<TEMPLATE MATCH="*" Timeout="2"/> <!-- Anything else -->
|
||||||
<TEMPLATE MATCH="972......." Timeout="0" User="Phone"/> <!-- 10 digits -->
|
<TEMPLATE MATCH="972......." Timeout="0" User="Phone"/> <!-- 10 digits -->
|
||||||
<TEMPLATE MATCH="214......." Timeout="0" User="Phone"/> <!-- 10 digits -->
|
<TEMPLATE MATCH="214......." Timeout="0" User="Phone"/> <!-- 10 digits -->
|
||||||
<TEMPLATE MATCH="469......." Timeout="0" User="Phone"/> <!-- 10 digits -->
|
<TEMPLATE MATCH="469......." Timeout="0" User="Phone"/> <!-- 10 digits -->
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<CiscoIPPhoneDirectory>
|
||||||
|
<Title>Our Phones</Title>
|
||||||
|
<Prompt>Please choose...</Prompt>
|
||||||
|
{assign var=x value=1}
|
||||||
|
{foreach $extensions as $row}{
|
||||||
|
<DirectoryEntry>
|
||||||
|
{if $row.directory_full_name != ""}
|
||||||
|
<Name>{$row.directory_full_name}</Name>
|
||||||
|
{else}
|
||||||
|
<Name>{$row.effective_caller_id_name}</Name>
|
||||||
|
{/if}
|
||||||
|
{if $row.number_alias != ""}
|
||||||
|
<Telephone>{$row.number_alias}</Telephone>
|
||||||
|
{else}
|
||||||
|
<Telephone>{$row.extension}</Telephone>
|
||||||
|
{/if}
|
||||||
|
</DirectoryEntry>
|
||||||
|
{/if}
|
||||||
|
{assign var=x value=$x+1}
|
||||||
|
{/foreach}
|
||||||
|
</CiscoIPPhoneDirectory>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,13 +1,18 @@
|
|||||||
<CiscoIPPhoneMenu>
|
<CiscoIPPhoneMenu>
|
||||||
<Title>Contacts</Title>
|
<Title>Contacts</Title>
|
||||||
<Prompt>Please choose...</Prompt>
|
<Prompt>Please choose...</Prompt>
|
||||||
|
<MenuItem>
|
||||||
|
<Name>Our Phones</Name>
|
||||||
|
<URL>http://{$domain_name}/app/provision/file/directory-extensions.xml</URL>
|
||||||
|
</MenuItem>
|
||||||
<!--
|
<!--
|
||||||
<MenuItem>
|
<MenuItem>
|
||||||
<Name>Personal</Name>
|
<Name>Personal</Name>
|
||||||
<URL>http://{$domain_name}/app/provision/file/directory-personal.xml</URL>
|
<URL>http://{$domain_name}/app/provision/file/directory-personal.xml</URL>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
--> <MenuItem> <Name>Enterprise</Name>
|
-->
|
||||||
|
<MenuItem>
|
||||||
|
<Name>Enterprise</Name>
|
||||||
<URL>http://{$domain_name}/app/provision/file/directory-enterprise.xml?mac={$mac}</URL>
|
<URL>http://{$domain_name}/app/provision/file/directory-enterprise.xml?mac={$mac}</URL>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem>
|
<MenuItem>
|
||||||
|
|||||||
Reference in New Issue
Block a user