Merge branch 'master' of https://github.com/fusionpbx/fusionpbx
This commit is contained in:
commit
e8bed6f611
35
.htaccess
35
.htaccess
|
|
@ -1,26 +1,31 @@
|
|||
RewriteEngine On
|
||||
|
||||
RewriteRule ^([A-Fa-f0-9]{12})(\.(xml|cfg))?$ app/provision/index.php?mac=$1 [QSA]
|
||||
RewriteRule ^([A-Fa-f0-9]{2}[:-][A-Fa-f0-9]{2}[:-][A-Fa-f0-9]{2}[:-][A-Fa-f0-9]{2}[:-][A-Fa-f0-9]{2}[:-][A-Fa-f0-9]{2}[:-])(\.(xml|cfg))?$ app/provision/index.php?mac=$1 [QSA]
|
||||
RewriteRule ^(kt.*?-)([A-Fa-f0-9]{12})(\.(xml))$ app/provision/index.php?mac=$2 [QSA]
|
||||
RewriteRule ^(cfg)([A-Fa-f0-9]{12})(\.(xml))$ app/provision/index.php?mac=$2 [QSA]
|
||||
# $mac or $mac.cfg/xml
|
||||
RewriteRule ^([A-Fa-f0-9]{12})(?:\.xml|\.cfg)?$ app/provision/index.php?mac=$1 [QSA]
|
||||
# $m:a:c or $m:a:c.cfg/xml
|
||||
RewriteRule ^((?:[A-Fa-f0-9]{2}[:-]){5}[A-Fa-f0-9]{2})(?:\.xml|\.cfg)?$ app/provision/index.php?mac=$1 [QSA]
|
||||
# kt*-$mac.xml
|
||||
RewriteRule ^kt.*?-([A-Fa-f0-9]{12})\.xml$ app/provision/index.php?mac=$1 [QSA]
|
||||
# cfg-$mac.xml
|
||||
RewriteRule ^cfg([A-Fa-f0-9]{12})\.xml$ app/provision/index.php?mac=$1 [QSA]
|
||||
|
||||
#Snom m3
|
||||
RewriteRule ^(m3/settings/)([A-Fa-f0-9]{12})(\.(cfg))?$ app/provision/index.php?mac=$2 [QSA]
|
||||
RewriteRule ^m3/settings/([A-Fa-f0-9]{12})(?:\.cfg)?$ app/provision/index.php?mac=$1 [QSA]
|
||||
|
||||
#Grandstream
|
||||
RewriteRule ^(?:.*/)?provision/cfg([A-Fa-f0-9]{12})(\.(xml|cfg))?$ app/provision/?mac=$1 [QSA]
|
||||
RewriteRule ^provision/cfg([A-Fa-f0-9]{12})(?:\.xml|\.cfg)?$ app/provision/?mac=$1 [QSA]
|
||||
|
||||
#Yealink
|
||||
RewriteRule ^(?:.*/)?provision/([A-Fa-f0-9]{12})(\.(xml|cfg))?$ app/provision/index.php?mac=$1 [QSA]
|
||||
#Yealink and Polycom
|
||||
RewriteRule ^provision/([A-Fa-f0-9]{12})(?:\.xml|\.cfg)?$ app/provision/index.php?mac=$1 [QSA]
|
||||
|
||||
#Polycom
|
||||
RewriteRule ^(?:.*/)?provision/000000000000.cfg$ app/provison/?mac=$1&file={$mac}.cfg [QSA]
|
||||
RewriteRule ^(?:.*/)?provision/features.cfg$ app/provision/?mac=$1&file=features.cfg [QSA]
|
||||
RewriteRule ^(?:.*/)?provision/([A-Fa-f0-9]{12})-sip.cfg$ app/provision/?mac=$1&file=sip.cfg [QSA]
|
||||
RewriteRule ^(?:.*/)?provision/([A-Fa-f0-9]{12})-phone.cfg$ app/provision/?mac=$1 [QSA]
|
||||
RewriteRule ^(?:.*/)?provision/([A-Fa-f0-9]{12})-registration.cfg$ app/provision/?mac=$1&file={$mac}-registration.cfg [QSA]
|
||||
RewriteRule ^(?:.*/)?provision/([A-Fa-f0-9]{12})-site.cfg$ app/provision/?mac=$1&file=site.cfg [QSA]
|
||||
RewriteRule ^(?:.*/)?provision/([A-Fa-f0-9]{12})-web.cfg$ app/provision/?mac=$1&file=web.cfg [QSA]
|
||||
RewriteRule ^provision/000000000000.cfg$ app/provision/?mac=$1&file={$mac}.cfg [QSA]
|
||||
RewriteRule ^provision/features.cfg$ app/provision/?mac=$1&file=features.cfg [QSA]
|
||||
RewriteRule ^provision/([A-Fa-f0-9]{12})-sip.cfg$ app/provision/?mac=$1&file=sip.cfg [QSA]
|
||||
RewriteRule ^provision/([A-Fa-f0-9]{12})-phone.cfg$ app/provision/?mac=$1 [QSA]
|
||||
RewriteRule ^provision/([A-Fa-f0-9]{12})-registration.cfg$ app/provision/?mac=$1&file={$mac}-registration.cfg [QSA]
|
||||
RewriteRule ^provision/([A-Fa-f0-9]{12})-site.cfg$ app/provision/?mac=$1&file=site.cfg [QSA]
|
||||
RewriteRule ^provision/([A-Fa-f0-9]{12})-web.cfg$ app/provision/?mac=$1&file=web.cfg [QSA]
|
||||
RewriteRule ^provision/([A-Fa-f0-9]{12})-directory.xml$ app/provision/?mac=$1&file=directory.xml [QSA]
|
||||
|
||||
Options -Indexes
|
||||
|
|
|
|||
|
|
@ -644,14 +644,28 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
$ivr_menu_option_param = $field['ivr_menu_option_action'];
|
||||
}
|
||||
$ivr_menu_option_param = str_replace("menu-", "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = str_replace("XML", "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = str_replace("transfer", "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = str_replace("bridge", "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = str_replace("XML ", "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = str_replace("transfer ", "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = str_replace("bridge ", "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = str_replace($_SESSION['domain_name'], "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = str_replace("\${domain_name}", "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = str_replace("\${domain}", "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = str_replace(".".$_SESSION['domain_uuid'], "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = str_replace("//", "/", $ivr_menu_option_param);
|
||||
if (preg_match( "/^phrase /", $ivr_menu_option_param )) {
|
||||
// parse out phrase uuid
|
||||
$phrase_uuid = str_replace("phrase ", "", $ivr_menu_option_param);
|
||||
// retrieve phrase name from db
|
||||
$sql = "select phrase_name from v_phrases where phrase_uuid = '$phrase_uuid' limit 1";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
if (count($result) > 0) {
|
||||
$phrase_name = $result[0]['phrase_name'];
|
||||
$ivr_menu_option_param = "<b>phrase:</b> $phrase_name";
|
||||
}
|
||||
unset ($prep_statement, $sql, $phrase_uuid, $phrase_name);
|
||||
}
|
||||
//$ivr_menu_option_param = ucfirst(trim($ivr_menu_option_param));
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vtable'>\n";
|
||||
|
|
|
|||
|
|
@ -28,10 +28,11 @@
|
|||
$apps[$x]['destinations'][$y]['name'] = "phrases";
|
||||
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and phrase_enabled = 'true' ";
|
||||
$apps[$x]['destinations'][$y]['order_by'] = "phrase_name asc";
|
||||
$apps[$x]['destinations'][$y]['field']['uuid'] = "phrase_uuid";
|
||||
$apps[$x]['destinations'][$y]['field']['name'] = "phrase_name";
|
||||
$apps[$x]['destinations'][$y]['field']['destination'] = "phrase_name";
|
||||
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "phrase:\${destination}.\${domain_uuid}";
|
||||
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:phrase \${destination}.\${domain_uuid}";
|
||||
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "phrase:\${uuid}";
|
||||
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:phrase \${uuid}";
|
||||
$apps[$x]['destinations'][$y]['select_label'] = "\${name}";
|
||||
|
||||
//permission details
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ echo "<br><br>";
|
|||
|
||||
echo "<form name='frm' method='post' action=''>\n";
|
||||
|
||||
if (permission_exists("upgrade_source") && !is_dir("/usr/share/examples/fusionpbx")) {
|
||||
if (permission_exists("upgrade_source") && !is_dir("/usr/share/examples/fusionpbx") && is_writeable($_SERVER["PROJECT_ROOT"]."/.git")) {
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo " <td width='30%' class='vncell'>\n";
|
||||
|
|
|
|||
|
|
@ -108,8 +108,12 @@
|
|||
if (debug["sql"]) then
|
||||
log.notice("SQL: " .. sql);
|
||||
end
|
||||
x = 0;
|
||||
local x = 0;
|
||||
local pass
|
||||
dbh:query(sql, function(row)
|
||||
--clear flag pass
|
||||
pass = false
|
||||
|
||||
--get the dialplan
|
||||
domain_uuid = row.domain_uuid;
|
||||
dialplan_uuid = row.dialplan_uuid;
|
||||
|
|
@ -281,8 +285,26 @@
|
|||
|
||||
--increment the x
|
||||
x = x + 1;
|
||||
|
||||
--set flag pass
|
||||
pass = true
|
||||
end);
|
||||
|
||||
-- prevent partial dialplan (pass=nil may be error in sql or empty resultset)
|
||||
if pass == false then
|
||||
log.errf('context: %s, extension: %s, type: %s, data: %s ',
|
||||
call_context,
|
||||
dialplan_name or '----',
|
||||
dialplan_detail_tag or '----',
|
||||
dialplan_detail_data or '----'
|
||||
)
|
||||
|
||||
--close the database connection
|
||||
dbh:release();
|
||||
|
||||
error('error while build context: ' .. call_context)
|
||||
end
|
||||
|
||||
--close the extension tag if it was left open
|
||||
if (dialplan_tag_status == "open") then
|
||||
table.insert(xml, [[ </condition>]]);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ local function tracef(type, name, level, ...)
|
|||
end
|
||||
|
||||
local LEVELS = {
|
||||
'error',
|
||||
'err',
|
||||
'warning',
|
||||
'notice',
|
||||
'info',
|
||||
|
|
|
|||
Loading…
Reference in New Issue