diff --git a/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml b/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml index 10c28b8df0..905bdc0aa0 100644 --- a/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml +++ b/app/dialplan/resources/switch/conf/dialplan/999_local_extension.xml @@ -1,10 +1,9 @@ - - - + + diff --git a/app/dialplan_inbound/dialplan_inbound_add.php b/app/dialplan_inbound/dialplan_inbound_add.php index 25dbfb37fd..bf4205d8fe 100644 --- a/app/dialplan_inbound/dialplan_inbound_add.php +++ b/app/dialplan_inbound/dialplan_inbound_add.php @@ -145,12 +145,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $dialplan_name = str_replace("/", "", $dialplan_name); //set the context - if (count($_SESSION["domains"]) > 1) { - $context = 'default'; - } - else { - $context = '$${domain_name}'; - } + $context = '$${domain_name}'; //start the atomic transaction $count = $db->exec("BEGIN;"); //returns affected rows diff --git a/app/fax/fax_edit.php b/app/fax/fax_edit.php index 77a473567a..8a23a3cf4c 100644 --- a/app/fax/fax_edit.php +++ b/app/fax/fax_edit.php @@ -931,7 +931,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo ""; echo "
"; echo "\n"; - } echo ""; diff --git a/app/fax/fax_send.php b/app/fax/fax_send.php index 6307d28f68..1d016b4171 100644 --- a/app/fax/fax_send.php +++ b/app/fax/fax_send.php @@ -213,7 +213,7 @@ function fax_split_dtmf(&$fax_number, &$fax_dtmf){ mkdir($_SESSION['switch']['storage']['dir'].'/fax'); 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']); 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 clearstatcache(); - //send the fax $continue = false; diff --git a/app/fax/resources/functions/parse_attachments.php b/app/fax/resources/functions/parse_attachments.php index 9999660636..f5a5f1f508 100644 --- a/app/fax/resources/functions/parse_attachments.php +++ b/app/fax/resources/functions/parse_attachments.php @@ -1,48 +1,48 @@ 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) { - foreach($structure->parts[$i]->dparameters as $object) { - if(strtolower($object->attribute) == 'filename') { - $attachments[$i]['is_attachment'] = true; - $attachments[$i]['filename'] = $object->value; - } - } - } + if($structure->parts[$i]->ifdparameters) { + foreach($structure->parts[$i]->dparameters as $object) { + if(strtolower($object->attribute) == 'filename') { + $attachments[$i]['is_attachment'] = true; + $attachments[$i]['filename'] = $object->value; + } + } + } - if($structure->parts[$i]->ifparameters) { - foreach($structure->parts[$i]->parameters as $object) { - if(strtolower($object->attribute) == 'name') { - $attachments[$i]['is_attachment'] = true; - $attachments[$i]['name'] = $object->value; - } - } - } + if($structure->parts[$i]->ifparameters) { + foreach($structure->parts[$i]->parameters as $object) { + if(strtolower($object->attribute) == 'name') { + $attachments[$i]['is_attachment'] = true; + $attachments[$i]['name'] = $object->value; + } + } + } - if($attachments[$i]['is_attachment']) { - $attachments[$i]['attachment'] = imap_fetchbody($connection, $message_number, $i+1, $option); - if($structure->parts[$i]->encoding == 3) { // 3 = BASE64 - $attachments[$i]['attachment'] = base64_decode($attachments[$i]['attachment']); - $attachments[$i]['size'] = strlen($attachments[$i]['attachment']); - } - elseif($structure->parts[$i]->encoding == 4) { // 4 = QUOTED-PRINTABLE - $attachments[$i]['attachment'] = quoted_printable_decode($attachments[$i]['attachment']); - $attachments[$i]['size'] = strlen($attachments[$i]['attachment']); - } - } + if($attachments[$i]['is_attachment']) { + $attachments[$i]['attachment'] = imap_fetchbody($connection, $message_number, $i+1, $option); + if($structure->parts[$i]->encoding == 3) { // 3 = BASE64 + $attachments[$i]['attachment'] = base64_decode($attachments[$i]['attachment']); + $attachments[$i]['size'] = strlen($attachments[$i]['attachment']); + } + elseif($structure->parts[$i]->encoding == 4) { // 4 = QUOTED-PRINTABLE + $attachments[$i]['attachment'] = quoted_printable_decode($attachments[$i]['attachment']); + $attachments[$i]['size'] = strlen($attachments[$i]['attachment']); + } + } unset($attachments[$i]['is_attachment']); - } + } - } - return array_values($attachments); //reindex + } + return array_values($attachments); //reindex } ?> \ No newline at end of file diff --git a/app/ivr_menus/resources/classes/ivr_menu.php b/app/ivr_menus/resources/classes/ivr_menu.php index 2f4d03959c..beaba4f804 100644 --- a/app/ivr_menus/resources/classes/ivr_menu.php +++ b/app/ivr_menus/resources/classes/ivr_menu.php @@ -575,23 +575,6 @@ include "root.php"; $database->fields['dialplan_detail_order'] = '030'; $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->fields['domain_uuid'] = $this->domain_uuid; $database->fields['dialplan_uuid'] = $this->dialplan_uuid; diff --git a/core/domain_settings/domain_edit.php b/core/domain_settings/domain_edit.php index 099c563458..870a2c9ad9 100644 --- a/core/domain_settings/domain_edit.php +++ b/core/domain_settings/domain_edit.php @@ -234,7 +234,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { } // 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']); if ( file_exists($switch_recordings_dir."/".$original_domain_name) ) { @rename($switch_recordings_dir."/".$original_domain_name, $switch_recordings_dir."/".$domain_name); // folder diff --git a/resources/classes/fax.php b/resources/classes/fax.php index bd936bdb01..195a0e8370 100644 --- a/resources/classes/fax.php +++ b/resources/classes/fax.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Copyright (C) 2010 + Copyright (C) 2010-2015 All Rights Reserved. Contributor(s): @@ -89,6 +89,7 @@ include "root.php"; //add the fax if (strlen($this->fax_extension) > 0) { + //add the dialplan $database = new database; $database->table = "v_dialplans"; @@ -190,12 +191,7 @@ include "root.php"; $database->fields['dialplan_detail_uuid'] = uuid(); $database->fields['dialplan_detail_tag'] = 'action'; //condition, action, antiaction $database->fields['dialplan_detail_type'] = 'rxfax'; - if (count($_SESSION["domains"]) > 1) { - $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'; - } + $dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domains'][$this->domain_uuid]['domain_name'].'/'.$this->fax_extension.'/inbox/${last_fax}.tif'; $database->fields['dialplan_detail_data'] = $dialplan_detail_data; $database->fields['dialplan_detail_order'] = '040'; $database->add(); @@ -322,7 +318,6 @@ include "root.php"; $database->update(); } else { -// $this->dialplan_uuid = uuid(); $database->fields['domain_uuid'] = $this->domain_uuid; $database->fields['dialplan_uuid'] = $this->dialplan_uuid; $database->add(); @@ -427,12 +422,7 @@ include "root.php"; $database->fields['dialplan_detail_uuid'] = uuid(); $database->fields['dialplan_detail_tag'] = 'action'; //condition, action, antiaction $database->fields['dialplan_detail_type'] = 'rxfax'; - if (count($_SESSION["domains"]) > 1) { - $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'; - } + $dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domains'][$this->domain_uuid]['domain_name'].'/'.$this->fax_extension.'/inbox/${last_fax}.tif'; $database->fields['dialplan_detail_data'] = $dialplan_detail_data; $database->fields['dialplan_detail_order'] = '040'; $database->add();