Merge branch 'master' into fax_queue
This commit is contained in:
@@ -1,10 +1,9 @@
|
|||||||
<context name="{v_context}">
|
<context name="{v_context}">
|
||||||
<extension name="local_extension" number="[ext]" continue="false" app_uuid="71cf1310-b6e3-415b-8745-3cbdc8e15212">
|
<extension name="local_extension" number="[ext]" continue="false" app_uuid="71cf1310-b6e3-415b-8745-3cbdc8e15212">
|
||||||
<condition field="user_exists" expression="true"/>
|
<condition field="user_exists" expression="true"/>
|
||||||
<condition field="destination_number" expression="(^.*$|^\d{2,7}$)">
|
|
||||||
<!--<action application="pre_answer"/>-->
|
<!--<action application="pre_answer"/>-->
|
||||||
<action application="export" data="dialed_extension=$1" inline="true"/>
|
<action application="export" data="dialed_extension=${destination_number}" inline="true"/>
|
||||||
<action application="limit" data="hash ${domain_name} $1 ${limit_max} ${limit_destination}" inline="false" />
|
<action application="limit" data="hash ${domain_name} ${destination_number} ${limit_max} ${limit_destination}" inline="false" />
|
||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
<!--Allow transfer/record only for internal users-->
|
<!--Allow transfer/record only for internal users-->
|
||||||
|
|||||||
@@ -145,12 +145,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
$dialplan_name = str_replace("/", "", $dialplan_name);
|
$dialplan_name = str_replace("/", "", $dialplan_name);
|
||||||
|
|
||||||
//set the context
|
//set the context
|
||||||
if (count($_SESSION["domains"]) > 1) {
|
$context = '$${domain_name}';
|
||||||
$context = 'default';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$context = '$${domain_name}';
|
|
||||||
}
|
|
||||||
|
|
||||||
//start the atomic transaction
|
//start the atomic transaction
|
||||||
$count = $db->exec("BEGIN;"); //returns affected rows
|
$count = $db->exec("BEGIN;"); //returns affected rows
|
||||||
|
|||||||
@@ -931,7 +931,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
echo "</table>";
|
echo "</table>";
|
||||||
echo "<br>";
|
echo "<br>";
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ function fax_split_dtmf(&$fax_number, &$fax_dtmf){
|
|||||||
mkdir($_SESSION['switch']['storage']['dir'].'/fax');
|
mkdir($_SESSION['switch']['storage']['dir'].'/fax');
|
||||||
chmod($_SESSION['switch']['storage']['dir'].'/fax',0774);
|
chmod($_SESSION['switch']['storage']['dir'].'/fax',0774);
|
||||||
}
|
}
|
||||||
if (count($_SESSION["domains"]) > 1 && !is_dir($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'])) {
|
if (!is_dir($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'])) {
|
||||||
mkdir($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name']);
|
mkdir($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name']);
|
||||||
chmod($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'],0774);
|
chmod($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'],0774);
|
||||||
}
|
}
|
||||||
@@ -238,7 +238,6 @@ function fax_split_dtmf(&$fax_number, &$fax_dtmf){
|
|||||||
//clear file status cache
|
//clear file status cache
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
|
|
||||||
//send the fax
|
//send the fax
|
||||||
$continue = false;
|
$continue = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,48 +1,48 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
function parse_attachments($connection, $message_number, $option = '') {
|
function parse_attachments($connection, $message_number, $option = '') {
|
||||||
$attachments = array();
|
$attachments = array();
|
||||||
$structure = imap_fetchstructure($connection, $message_number, $option);
|
$structure = imap_fetchstructure($connection, $message_number, $option);
|
||||||
|
|
||||||
if(isset($structure->parts) && count($structure->parts)) {
|
if(isset($structure->parts) && count($structure->parts)) {
|
||||||
|
|
||||||
for($i = 0; $i < count($structure->parts); $i++) {
|
for($i = 0; $i < count($structure->parts); $i++) {
|
||||||
|
|
||||||
if($structure->parts[$i]->ifdparameters) {
|
if($structure->parts[$i]->ifdparameters) {
|
||||||
foreach($structure->parts[$i]->dparameters as $object) {
|
foreach($structure->parts[$i]->dparameters as $object) {
|
||||||
if(strtolower($object->attribute) == 'filename') {
|
if(strtolower($object->attribute) == 'filename') {
|
||||||
$attachments[$i]['is_attachment'] = true;
|
$attachments[$i]['is_attachment'] = true;
|
||||||
$attachments[$i]['filename'] = $object->value;
|
$attachments[$i]['filename'] = $object->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($structure->parts[$i]->ifparameters) {
|
if($structure->parts[$i]->ifparameters) {
|
||||||
foreach($structure->parts[$i]->parameters as $object) {
|
foreach($structure->parts[$i]->parameters as $object) {
|
||||||
if(strtolower($object->attribute) == 'name') {
|
if(strtolower($object->attribute) == 'name') {
|
||||||
$attachments[$i]['is_attachment'] = true;
|
$attachments[$i]['is_attachment'] = true;
|
||||||
$attachments[$i]['name'] = $object->value;
|
$attachments[$i]['name'] = $object->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($attachments[$i]['is_attachment']) {
|
if($attachments[$i]['is_attachment']) {
|
||||||
$attachments[$i]['attachment'] = imap_fetchbody($connection, $message_number, $i+1, $option);
|
$attachments[$i]['attachment'] = imap_fetchbody($connection, $message_number, $i+1, $option);
|
||||||
if($structure->parts[$i]->encoding == 3) { // 3 = BASE64
|
if($structure->parts[$i]->encoding == 3) { // 3 = BASE64
|
||||||
$attachments[$i]['attachment'] = base64_decode($attachments[$i]['attachment']);
|
$attachments[$i]['attachment'] = base64_decode($attachments[$i]['attachment']);
|
||||||
$attachments[$i]['size'] = strlen($attachments[$i]['attachment']);
|
$attachments[$i]['size'] = strlen($attachments[$i]['attachment']);
|
||||||
}
|
}
|
||||||
elseif($structure->parts[$i]->encoding == 4) { // 4 = QUOTED-PRINTABLE
|
elseif($structure->parts[$i]->encoding == 4) { // 4 = QUOTED-PRINTABLE
|
||||||
$attachments[$i]['attachment'] = quoted_printable_decode($attachments[$i]['attachment']);
|
$attachments[$i]['attachment'] = quoted_printable_decode($attachments[$i]['attachment']);
|
||||||
$attachments[$i]['size'] = strlen($attachments[$i]['attachment']);
|
$attachments[$i]['size'] = strlen($attachments[$i]['attachment']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($attachments[$i]['is_attachment']);
|
unset($attachments[$i]['is_attachment']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return array_values($attachments); //reindex
|
return array_values($attachments); //reindex
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -575,23 +575,6 @@ include "root.php";
|
|||||||
$database->fields['dialplan_detail_order'] = '030';
|
$database->fields['dialplan_detail_order'] = '030';
|
||||||
$database->add();
|
$database->add();
|
||||||
|
|
||||||
/*
|
|
||||||
$database->table = "v_dialplan_details";
|
|
||||||
$database->fields['domain_uuid'] = $this->domain_uuid;
|
|
||||||
$database->fields['dialplan_uuid'] = $this->dialplan_uuid;
|
|
||||||
$database->fields['dialplan_detail_uuid'] = uuid();
|
|
||||||
$database->fields['dialplan_detail_tag'] = 'action'; //condition, action, antiaction
|
|
||||||
$database->fields['dialplan_detail_type'] = 'ivr';
|
|
||||||
if (count($_SESSION["domains"]) > 1) {
|
|
||||||
$database->fields['dialplan_detail_data'] = $_SESSION['domain_name'].'-'.$this->ivr_menu_name;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$database->fields['dialplan_detail_data'] = $this->ivr_menu_name;
|
|
||||||
}
|
|
||||||
$database->fields['dialplan_detail_order'] = '035';
|
|
||||||
$database->add();
|
|
||||||
*/
|
|
||||||
|
|
||||||
$database->table = "v_dialplan_details";
|
$database->table = "v_dialplan_details";
|
||||||
$database->fields['domain_uuid'] = $this->domain_uuid;
|
$database->fields['domain_uuid'] = $this->domain_uuid;
|
||||||
$database->fields['dialplan_uuid'] = $this->dialplan_uuid;
|
$database->fields['dialplan_uuid'] = $this->dialplan_uuid;
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// rename switch/recordings/[domain] (folder)
|
// rename switch/recordings/[domain] (folder)
|
||||||
if ( isset($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']) ) {
|
if ( file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']) ) {
|
||||||
$switch_recordings_dir = str_replace("/".$_SESSION["domain_name"], "", $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']);
|
$switch_recordings_dir = str_replace("/".$_SESSION["domain_name"], "", $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']);
|
||||||
if ( file_exists($switch_recordings_dir."/".$original_domain_name) ) {
|
if ( file_exists($switch_recordings_dir."/".$original_domain_name) ) {
|
||||||
@rename($switch_recordings_dir."/".$original_domain_name, $switch_recordings_dir."/".$domain_name); // folder
|
@rename($switch_recordings_dir."/".$original_domain_name, $switch_recordings_dir."/".$domain_name); // folder
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
Copyright (C) 2010
|
Copyright (C) 2010-2015
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
@@ -89,6 +89,7 @@ include "root.php";
|
|||||||
|
|
||||||
//add the fax
|
//add the fax
|
||||||
if (strlen($this->fax_extension) > 0) {
|
if (strlen($this->fax_extension) > 0) {
|
||||||
|
|
||||||
//add the dialplan
|
//add the dialplan
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$database->table = "v_dialplans";
|
$database->table = "v_dialplans";
|
||||||
@@ -190,12 +191,7 @@ include "root.php";
|
|||||||
$database->fields['dialplan_detail_uuid'] = uuid();
|
$database->fields['dialplan_detail_uuid'] = uuid();
|
||||||
$database->fields['dialplan_detail_tag'] = 'action'; //condition, action, antiaction
|
$database->fields['dialplan_detail_tag'] = 'action'; //condition, action, antiaction
|
||||||
$database->fields['dialplan_detail_type'] = 'rxfax';
|
$database->fields['dialplan_detail_type'] = 'rxfax';
|
||||||
if (count($_SESSION["domains"]) > 1) {
|
$dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domains'][$this->domain_uuid]['domain_name'].'/'.$this->fax_extension.'/inbox/${last_fax}.tif';
|
||||||
$dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domains'][$row['domain_uuid']]['domain_name'].'/'.$this->fax_extension.'/inbox/${last_fax}.tif';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$this->fax_extension.'/inbox/${last_fax}.tif';
|
|
||||||
}
|
|
||||||
$database->fields['dialplan_detail_data'] = $dialplan_detail_data;
|
$database->fields['dialplan_detail_data'] = $dialplan_detail_data;
|
||||||
$database->fields['dialplan_detail_order'] = '040';
|
$database->fields['dialplan_detail_order'] = '040';
|
||||||
$database->add();
|
$database->add();
|
||||||
@@ -322,7 +318,6 @@ include "root.php";
|
|||||||
$database->update();
|
$database->update();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// $this->dialplan_uuid = uuid();
|
|
||||||
$database->fields['domain_uuid'] = $this->domain_uuid;
|
$database->fields['domain_uuid'] = $this->domain_uuid;
|
||||||
$database->fields['dialplan_uuid'] = $this->dialplan_uuid;
|
$database->fields['dialplan_uuid'] = $this->dialplan_uuid;
|
||||||
$database->add();
|
$database->add();
|
||||||
@@ -427,12 +422,7 @@ include "root.php";
|
|||||||
$database->fields['dialplan_detail_uuid'] = uuid();
|
$database->fields['dialplan_detail_uuid'] = uuid();
|
||||||
$database->fields['dialplan_detail_tag'] = 'action'; //condition, action, antiaction
|
$database->fields['dialplan_detail_tag'] = 'action'; //condition, action, antiaction
|
||||||
$database->fields['dialplan_detail_type'] = 'rxfax';
|
$database->fields['dialplan_detail_type'] = 'rxfax';
|
||||||
if (count($_SESSION["domains"]) > 1) {
|
$dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domains'][$this->domain_uuid]['domain_name'].'/'.$this->fax_extension.'/inbox/${last_fax}.tif';
|
||||||
$dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domains'][$row['domain_uuid']]['domain_name'].'/'.$this->fax_extension.'/inbox/${last_fax}.tif';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$this->fax_extension.'/inbox/${last_fax}.tif';
|
|
||||||
}
|
|
||||||
$database->fields['dialplan_detail_data'] = $dialplan_detail_data;
|
$database->fields['dialplan_detail_data'] = $dialplan_detail_data;
|
||||||
$database->fields['dialplan_detail_order'] = '040';
|
$database->fields['dialplan_detail_order'] = '040';
|
||||||
$database->add();
|
$database->add();
|
||||||
|
|||||||
Reference in New Issue
Block a user