Pārlūkot izejas kodu

Completely remove auto_attendant in favor of IVR Menu.

Mark Crane 13 gadi atpakaļ
vecāks
revīzija
c128a237d0

+ 0 - 50
auto_attendant/root.php

@@ -1,50 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2010
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-// make sure the PATH_SEPARATOR is defined
-	if (!defined("PATH_SEPARATOR")) {
-		if ( strpos( $_ENV[ "OS" ], "Win" ) !== false ) { define("PATH_SEPARATOR", ";"); } else { define("PATH_SEPARATOR", ":"); }
-	}
-
-// make sure the document_root is set
-	$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", "/", $_SERVER["SCRIPT_FILENAME"]);
-	$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
-	$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
-	//echo "DOCUMENT_ROOT: ".$_SERVER["DOCUMENT_ROOT"]."<br />\n";
-	//echo "PHP_SELF: ".$_SERVER["PHP_SELF"]."<br />\n";
-	//echo "SCRIPT_FILENAME: ".$_SERVER["SCRIPT_FILENAME"]."<br />\n";
-
-// if the project directory exists then add it to the include path otherwise add the document root to the include path
-	if (is_dir($_SERVER["DOCUMENT_ROOT"].'/fusionpbx')){
-		define('PROJECT_PATH', '/fusionpbx');
-		set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"].'/fusionpbx' );
-	}
-	else {
-		define('PROJECT_PATH', '');
-		set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] );
-	}
-
-?>

+ 0 - 192
auto_attendant/v_auto_attendant.php

@@ -1,192 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2010
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "includes/config.php";
-require_once "includes/checkauth.php";
-if (ifgroup("admin") || ifgroup("superadmin")) {
-	//access granted
-}
-else {
-	echo "access denied";
-	exit;
-}
-require_once "includes/header.php";
-require_once "includes/paging.php";
-
-$orderby = $_GET["orderby"];
-$order = $_GET["order"];
-if (!function_exists('thorderby')) {
-	//html table header order by
-	function thorderby($fieldname, $columntitle, $orderby, $order) {
-
-		$html .= "<th class='' nowrap>&nbsp; &nbsp; ";
-		if (strlen($orderby)==0) {
-		  $html .= "<a href='?orderby=$fieldname&order=desc' title='ascending'>$columntitle</a>";
-		}
-		else {
-		  if ($order=="asc") {
-			  $html .= "<a href='?orderby=$fieldname&order=desc' title='ascending'>$columntitle</a>";
-		  }
-		  else {
-			  $html .= "<a href='?orderby=$fieldname&order=asc' title='descending'>$columntitle</a>";
-		  }
-		}
-		$html .= "&nbsp; &nbsp; </th>";
-
-		return $html;
-	}
-}
-//example use
-
-	echo "<div align='center'>";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
-
-	echo "<tr class='border'>\n";
-	echo "	<td align=\"center\">\n";
-	echo "      <br>";
-
-
-	//echo "<table width='100%' border='0'><tr>\n";
-	//echo "<td width='50%' nowrap><b>Auto_attendant List</b></td>\n";
-	//echo "<td width='50%' align='right'>&nbsp;</td>\n";
-	//echo "</tr></table>\n";
-
-echo "<table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
-echo "      <tr>\n";
-echo "        <td align='left'><p><span class=\"vexpl\"><span class=\"red\"><strong>Auto Attendant<br />\n";
-echo "            </strong></span>\n";
-echo "			Auto Attendant provides callers the ability to choose between multiple options that direct\n";
-echo "			calls to extensions, voicemail, conferences, queues, other auto attendants, and external phone numbers.\n";
-echo "            </span></p></td>\n";
-echo "      </tr>\n";
-echo "</table>\n";
-echo "<br />";
-
-	$sql = "";
-	$sql .= " select * from v_auto_attendant ";
-	$sql .= "where v_id = '$v_id' ";
-	if (strlen($orderby)> 0) { $sql .= "order by $orderby $order "; }
-	$prepstatement = $db->prepare(check_sql($sql));
-	$prepstatement->execute();
-	$result = $prepstatement->fetchAll();
-	$numrows = count($result);
-	unset ($prepstatement, $result, $sql);
-
-	$rowsperpage = 10;
-	$param = "";
-	$page = $_GET['page'];
-	if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } 
-	list($pagingcontrols, $rowsperpage, $var3) = paging($numrows, $param, $rowsperpage); 
-	$offset = $rowsperpage * $page; 
-	$sql = "";
-	$sql .= " select * from v_auto_attendant ";
-	$sql .= " where v_id = '$v_id' ";
-	if (strlen($orderby)> 0) { $sql .= "order by $orderby $order "; }
-	$sql .= " limit $rowsperpage offset $offset ";
-
-	$prepstatement = $db->prepare(check_sql($sql));
-	$prepstatement->execute();
-	$result = $prepstatement->fetchAll();
-	$resultcount = count($result);
-	unset ($prepstatement, $sql);
-
-
-	$c = 0;
-	$rowstyle["0"] = "rowstyle0";
-	$rowstyle["1"] = "rowstyle1";
-
-	echo "<div align='center'>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo thorderby('aa_extension', 'Extension', $orderby, $order);
-	echo thorderby('aa_name', 'Name', $orderby, $order);
-	echo thorderby('aa_descr', 'Description', $orderby, $order);
-	echo "<td align='right' width='42'>\n";
-	echo "	<a href='v_auto_attendant_edit.php' alt='add'>$v_link_label_add</a>\n";
-	echo "</td>\n";
-	echo "<tr>\n";
-	if ($resultcount == 0) { //no results
-	}
-	else { //received results
-		foreach($result as $row) {
-			//print_r( $row );
-			echo "<tr >\n";
-			echo "   <td valign='top' class='".$rowstyle[$c]."'>".$row[aa_extension]."</td>\n";
-			echo "   <td valign='top' class='".$rowstyle[$c]."'>".$row[aa_name]."</td>\n";
-			echo "   <td valign='top' class='rowstylebg' width='40%'>".$row[aa_descr]."&nbsp;</td>\n";
-			echo "   <td valign='top' align='right'>\n";
-			echo "		<a href='v_auto_attendant_edit.php?id=".$row[auto_attendant_id]."' alt='edit'>$v_link_label_edit</a>\n";
-			echo "		<a href='v_auto_attendant_delete.php?id=".$row[auto_attendant_id]."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
-			echo "   </td>\n";
-			echo "</tr>\n";
-			if ($c==0) { $c=1; } else { $c=0; }
-		} //end foreach
-		unset($sql, $result, $rowcount);
-	} //end if results
-
-	echo "<tr>\n";
-	echo "<td colspan='5'>\n";
-	echo "	<table width='100%' cellpadding='0' cellspacing='0'>\n";
-	echo "	<tr>\n";
-	echo "		<td width='33.3%' nowrap>&nbsp;</td>\n";
-	echo "		<td width='33.3%' align='center' nowrap>$pagingcontrols</td>\n";
-	echo "		<td width='33.3%' align='right'>\n";
-	echo "			<a href='v_auto_attendant_edit.php' alt='add'>$v_link_label_add</a>\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "	</table>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td colspan='5' align='left'>\n";
-	echo "<br />\n";
-	if ($v_path_show) {
-		echo $v_scripts_dir."";
-	}
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "</table>";
-	echo "</div>";
-	echo "<br><br>";
-	echo "<br><br>";
-
-
-	echo "</td>";
-	echo "</tr>";
-	echo "</table>";
-	echo "</div>";
-	echo "<br><br>";
-
-
-require_once "includes/footer.php";
-unset ($resultcount);
-unset ($result);
-unset ($key);
-unset ($val);
-unset ($c);
-?>

+ 0 - 112
auto_attendant/v_auto_attendant_delete.php

@@ -1,112 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2010
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "includes/config.php";
-require_once "includes/checkauth.php";
-
-if (ifgroup("admin") || ifgroup("superadmin")) {
-	//access granted
-}
-else {
-	echo "access denied";
-	exit;
-}
-
-if (count($_GET)>0) {
-	$id = $_GET["id"];
-}
-
-if (strlen($id)>0) {
-
-	//delete child data
-		$sql = "";
-		$sql .= "delete from v_auto_attendant_options ";
-		$sql .= "where v_id = '$v_id' ";
-		$sql .= "and auto_attendant_id = '$id' ";
-		$prepstatement = $db->prepare(check_sql($sql));
-		$prepstatement->execute();
-		unset($sql);
-
-	//delete parent data
-		$sql = "";
-		$sql .= "delete from v_auto_attendant ";
-		$sql .= "where v_id = '$v_id' ";
-		$sql .= "and auto_attendant_id = '$id' ";
-		$prepstatement = $db->prepare(check_sql($sql));
-		$prepstatement->execute();
-		unset($sql);
-
-	//delete the dialplan entries
-		$sql = "";
-		$sql .= "select * from v_dialplan_includes ";
-		$sql .= "where v_id = '$v_id' ";
-		$sql .= "and opt_1_name = 'auto_attendant_id' ";
-		$sql .= "and opt_1_value = '".$id."' ";
-		//echo "sql: ".$sql."<br />\n";
-		$prepstatement2 = $db->prepare($sql);
-		$prepstatement2->execute();
-		while($row2 = $prepstatement2->fetch()) {
-			$dialplan_include_id = $row2['dialplan_include_id'];
-			//echo "dialplan_include_id: ".$dialplan_include_id."<br />\n";
-			break; //limit to 1 row
-		}
-		unset ($sql, $prepstatement2);
-
-		$sql = "";
-		$sql = "delete from v_dialplan_includes_details ";
-		$sql .= "where v_id = '$v_id' ";
-		$sql .= "and dialplan_include_id = '$dialplan_include_id' ";
-		//echo "sql: ".$sql."<br />\n";
-		$db->query($sql);
-		unset($sql);
-
-		$sql = "";
-		$sql = "delete from v_dialplan_includes ";
-		$sql .= "where v_id = '$v_id' ";
-		$sql .= "and opt_1_name = 'auto_attendant_id' ";
-		$sql .= "and opt_1_value = '$id' ";
-		//echo "sql: ".$sql."<br />\n";
-		$db->query($sql);
-		unset($sql);
-
-	//synchronize the xml config
-		sync_package_v_auto_attendant();
-
-	//synchronize the xml config
-		sync_package_v_dialplan_includes();
-
-}
-
-require_once "includes/header.php";
-echo "<meta http-equiv=\"refresh\" content=\"2;url=v_auto_attendant.php\">\n";
-echo "<div align='center'>\n";
-echo "Delete Complete\n";
-echo "</div>\n";
-
-require_once "includes/footer.php";
-return;
-
-?>

+ 0 - 837
auto_attendant/v_auto_attendant_edit.php

@@ -1,837 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2010
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "includes/config.php";
-require_once "includes/checkauth.php";
-require_once "includes/paging.php";
-if (ifgroup("admin") || ifgroup("superadmin")) {
-	//access granted
-}
-else {
-	echo "access denied";
-	exit;
-}
-
-
-//Action add or update
-if (isset($_REQUEST["id"])) {
-	$action = "update";
-	$auto_attendant_id = check_str($_REQUEST["id"]);
-}
-else {
-	$action = "add";
-}
-
-//POST to PHP variables
-if (count($_POST)>0) {
-	//$v_id = check_str($_POST["v_id"]);
-	$aa_extension = check_str($_POST["aa_extension"]);
-	$aa_name = check_str($_POST["aa_name"]);
-	$recording_id_action = check_str($_POST["recording_id_action"]);
-	$recording_id_anti_action = check_str($_POST["recording_id_anti_action"]);
-	$aa_timeout = check_str($_POST["aa_timeout"]);
-	$aa_call_timeout = check_str($_POST["aa_call_timeout"]);
-	$aa_context = check_str($_POST["aa_context"]);
-	$aa_direct_dial = check_str($_POST["aa_direct_dial"]);
-	$aa_ringback = check_str($_POST["aa_ringback"]);
-	$aa_cid_name_prefix = check_str($_POST["aa_cid_name_prefix"]);
-	$aa_condition_js = check_str($_POST["aa_condition_js"]);
-	$aa_descr = check_str($_POST["aa_descr"]);
-}
-
-if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
-
-	$msg = '';
-
-	////recommend moving this to the config.php file
-	$uploadtempdir = $_ENV["TEMP"]."\\";
-	ini_set('upload_tmp_dir', $uploadtempdir);
-	////$imagedir = $_ENV["TEMP"]."\\";
-	////$filedir = $_ENV["TEMP"]."\\";
-
-	if ($action == "update") {
-		$auto_attendant_id = check_str($_POST["auto_attendant_id"]);
-	}
-
-	//check for all required data
-		if (strlen($v_id) == 0) { $msg .= "Please provide: v_id<br>\n"; }
-		if (strlen($aa_extension) == 0) { $msg .= "Please provide: Extension<br>\n"; }
-		if (strlen($aa_name) == 0) { $msg .= "Please provide: Name<br>\n"; }
-		if (strlen($recording_id_action) == 0) { $msg .= "Please provide: Recording Action<br>\n"; }
-		if (strlen($recording_id_anti_action) == 0) { $msg .= "Please provide: Recording Anti-Action<br>\n"; }
-		if (strlen($aa_timeout) == 0) { $msg .= "Please provide: Timeout<br>\n"; }
-		if (strlen($aa_call_timeout) == 0) { $msg .= "Please provide: Call Timeout<br>\n"; }
-		if (strlen($aa_context) == 0) { $msg .= "Please provide: Context<br>\n"; }
-		if (strlen($aa_direct_dial) == 0) { $msg .= "Please provide: Direct Dial<br>\n"; }
-		if (strlen($aa_ringback) == 0) { $msg .= "Please provide: Ring Back<br>\n"; }
-		//if (strlen($aa_cid_name_prefix) == 0) { $msg .= "Please provide: CID Prefix<br>\n"; }
-		//if (strlen($aa_condition_js) == 0) { $msg .= "Please provide: Javascript Condition<br>\n"; }
-		//if (strlen($aa_descr) == 0) { $msg .= "Please provide: Description<br>\n"; }
-		if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
-			require_once "includes/header.php";
-			require_once "includes/persistformvar.php";
-			echo "<div align='center'>\n";
-			echo "<table><tr><td>\n";
-			echo $msg."<br />";
-			echo "</td></tr></table>\n";
-			persistformvar($_POST);
-			echo "</div>\n";
-			require_once "includes/footer.php";
-			return;
-		}
-
-	$tmp = "\n";
-	//$tmp .= "v_id: $v_id\n";
-	$tmp .= "Extension: $aa_extension\n";
-	$tmp .= "Name: $aa_name\n";
-	$tmp .= "Recording Action: $recording_id_action\n";
-	$tmp .= "Recording Anti-Action: $recording_id_anti_action\n";
-	$tmp .= "Timeout: $aa_timeout\n";
-	$tmp .= "Call Timeout: $aa_call_timeout\n";
-	$tmp .= "Context: $aa_context\n";
-	$tmp .= "Direct Dial: $aa_direct_dial\n";
-	$tmp .= "Ring Back: $aa_ringback\n";
-	$tmp .= "CID Prefix: $aa_cid_name_prefix\n";
-	$tmp .= "Javascript Condition: $aa_condition_js\n";
-	$tmp .= "Description: $aa_descr\n";
-
-	//Add or update the database
-	if ($_POST["persistformvar"] != "true") {
-		if ($action == "add") {
-			$sql = "insert into v_auto_attendant ";
-			$sql .= "(";
-			$sql .= "v_id, ";
-			$sql .= "aa_extension, ";
-			$sql .= "aa_name, ";
-			$sql .= "recording_id_action, ";
-			$sql .= "recording_id_anti_action, ";
-			$sql .= "aa_timeout, ";
-			$sql .= "aa_call_timeout, ";
-			$sql .= "aa_context, ";
-			$sql .= "aa_direct_dial, ";
-			$sql .= "aa_ringback, ";
-			$sql .= "aa_cid_name_prefix, ";
-			$sql .= "aa_condition_js, ";
-			$sql .= "aa_descr ";
-			$sql .= ")";
-			$sql .= "values ";
-			$sql .= "(";
-			$sql .= "'$v_id', ";
-			$sql .= "'$aa_extension', ";
-			$sql .= "'$aa_name', ";
-			$sql .= "'$recording_id_action', ";
-			$sql .= "'$recording_id_anti_action', ";
-			$sql .= "'$aa_timeout', ";
-			$sql .= "'$aa_call_timeout', ";
-			$sql .= "'$aa_context', ";
-			$sql .= "'$aa_direct_dial', ";
-			$sql .= "'$aa_ringback', ";
-			$sql .= "'$aa_cid_name_prefix', ";
-			$sql .= "'$aa_condition_js', ";
-			$sql .= "'$aa_descr' ";
-			$sql .= ")";
-			$db->exec(check_sql($sql));
-			unset($sql);
-
-			//synchronize the xml config
-			sync_package_v_auto_attendant();
-
-			//synchronize the xml config
-			sync_package_v_dialplan_includes();
-
-			require_once "includes/header.php";
-			echo "<meta http-equiv=\"refresh\" content=\"2;url=v_auto_attendant.php\">\n";
-			echo "<div align='center'>\n";
-			echo "Add Complete\n";
-			echo "</div>\n";
-			require_once "includes/footer.php";
-			return;
-		} //if ($action == "add")
-
-		if ($action == "update") {
-			$sql = "update v_auto_attendant set ";
-			$sql .= "v_id = '$v_id', ";
-			$sql .= "aa_extension = '$aa_extension', ";
-			$sql .= "aa_name = '$aa_name', ";
-			$sql .= "recording_id_action = '$recording_id_action', ";
-			$sql .= "recording_id_anti_action = '$recording_id_anti_action', ";
-			$sql .= "aa_timeout = '$aa_timeout', ";
-			$sql .= "aa_call_timeout = '$aa_call_timeout', ";
-			$sql .= "aa_context = '$aa_context', ";
-			$sql .= "aa_direct_dial = '$aa_direct_dial', ";
-			$sql .= "aa_ringback = '$aa_ringback', ";
-			$sql .= "aa_cid_name_prefix = '$aa_cid_name_prefix', ";
-			$sql .= "aa_condition_js = '$aa_condition_js', ";
-			$sql .= "aa_descr = '$aa_descr' ";
-			$sql .= "where v_id = '$v_id' ";
-			$sql .= "and auto_attendant_id = '$auto_attendant_id'";
-			$db->exec(check_sql($sql));
-			unset($sql);
-
-			//synchronize the xml config
-			sync_package_v_auto_attendant();
-
-			//synchronize the xml config
-			sync_package_v_dialplan_includes();
-
-			require_once "includes/header.php";
-			echo "<meta http-equiv=\"refresh\" content=\"2;url=v_auto_attendant.php\">\n";
-			echo "<div align='center'>\n";
-			echo "Update Complete\n";
-			echo "</div>\n";
-			require_once "includes/footer.php";
-			return;
-		} //if ($action == "update")
-	} //if ($_POST["persistformvar"] != "true") { 
-
-} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
-
-//set default $aa_condition_js
-	$aa_condition_js_default = "function isholiday( Month, Date ) {\n";
-	$aa_condition_js_default .= "    var Holiday = 0; //default false\n";
-	$aa_condition_js_default .= "    if (Month == \"12\" && Date == \"25\") {\n";
-	$aa_condition_js_default .= "      Holiday = 1; //true\n";
-	$aa_condition_js_default .= "    }\n";
-	$aa_condition_js_default .= "    if (Month == \"7\" && Date == \"4\") {\n";
-	$aa_condition_js_default .= "      Holiday = 1; //true\n";
-	$aa_condition_js_default .= "    }\n";
-	$aa_condition_js_default .= "    if (Month == \"1\" && Date == \"1\") {\n";
-	$aa_condition_js_default .= "      Holiday = 1; //true\n";
-	$aa_condition_js_default .= "    }\n";
-	$aa_condition_js_default .= "    if (Holiday == 1) {\n";
-	$aa_condition_js_default .= "      return true;\n";
-	$aa_condition_js_default .= "    }\n";
-	$aa_condition_js_default .= "    else {\n";
-	$aa_condition_js_default .= "      return false;\n";
-	$aa_condition_js_default .= "    }\n";
-	$aa_condition_js_default .= "}\n";
-	$aa_condition_js_default .= "\n";
-	$aa_condition_js_default .= "function isweekday( Day ) {\n";
-	$aa_condition_js_default .= "    if (Day > 1 && Day < 7) {\n";
-	$aa_condition_js_default .= "        return true;\n";
-	$aa_condition_js_default .= "    }\n";
-	$aa_condition_js_default .= "    else {\n";
-	$aa_condition_js_default .= "        return false;\n";
-	$aa_condition_js_default .= "    }\n";
-	$aa_condition_js_default .= "}\n";
-	$aa_condition_js_default .= "\n";
-	$aa_condition_js_default .= "function isweekend( Day ) {\n";
-	$aa_condition_js_default .= "    if (Day > 1 && Day < 7) {\n";
-	$aa_condition_js_default .= "        return false;\n";
-	$aa_condition_js_default .= "    }\n";
-	$aa_condition_js_default .= "    else {\n";
-	$aa_condition_js_default .= "        return true;\n";
-	$aa_condition_js_default .= "    }\n";
-	$aa_condition_js_default .= "}\n";
-	$aa_condition_js_default .= "\n";
-	$aa_condition_js_default .= "function isofficehours( Hours ) {\n";
-	$aa_condition_js_default .= "    if (Hours >= 9 && Hours < 17) {\n";
-	$aa_condition_js_default .= "        return true;\n";
-	$aa_condition_js_default .= "    }\n";
-	$aa_condition_js_default .= "    else {\n";
-	$aa_condition_js_default .= "        return false;\n";
-	$aa_condition_js_default .= "    }\n";
-	$aa_condition_js_default .= "}\n";
-	$aa_condition_js_default .= "\n";
-	$aa_condition_js_default .= "function isafterhours( Hours ) {\n";
-	$aa_condition_js_default .= "    if (Hours >= 9 && Hours < 17) {\n";
-	$aa_condition_js_default .= "        return false;\n";
-	$aa_condition_js_default .= "    }\n";
-	$aa_condition_js_default .= "    else {\n";
-	$aa_condition_js_default .= "        return true;\n";
-	$aa_condition_js_default .= "    }\n";
-	$aa_condition_js_default .= "}\n";
-	$aa_condition_js_default .= "\n";
-	$aa_condition_js_default .= "//set default\n";
-	$aa_condition_js_default .= "condition = true;\n";
-	$aa_condition_js_default .= "\n";
-	$aa_condition_js_default .= "//Holiday?\n";
-	$aa_condition_js_default .= "if (isholiday( Month, Date )) {\n";
-	//$aa_condition_js_default .= "    console_log( \"info\", \"holiday\\n\" );\n";
-	$aa_condition_js_default .= "    condition = false;\n";
-	$aa_condition_js_default .= "}\n";
-	$aa_condition_js_default .= "\n";
-	$aa_condition_js_default .= "//Weekend?\n";
-	$aa_condition_js_default .= "if (isweekend( Day )) {\n";
-	//$aa_condition_js_default .= "    console_log( \"info\", \"weekend\\n\" );\n";
-	$aa_condition_js_default .= "    condition = false;\n";
-	$aa_condition_js_default .= "}\n";
-	$aa_condition_js_default .= "\n";
-	$aa_condition_js_default .= "// After Hours?\n";
-	$aa_condition_js_default .= "if (isafterhours( Hours )) {\n";
-	//$aa_condition_js_default .= "    console_log( \"info\", \"after hours\\n\" );\n";
-	$aa_condition_js_default .= "    condition = false;\n";
-	$aa_condition_js_default .= "}\n";
-	$aa_condition_js_default .= "\n";
-
-//Pre-populate the form
-if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
-	$auto_attendant_id = $_GET["id"];
-	$sql = "";
-	$sql .= "select * from v_auto_attendant ";
-	$sql .= "where v_id = '$v_id' ";
-	$sql .= "and auto_attendant_id = '$auto_attendant_id' ";
-	$prepstatement = $db->prepare(check_sql($sql));
-	$prepstatement->execute();
-	$result = $prepstatement->fetchAll();
-	foreach ($result as &$row) {
-		$v_id = $row["v_id"];
-		$aa_extension = $row["aa_extension"];
-		$aa_name = $row["aa_name"];
-		$recording_id_action = $row["recording_id_action"];
-		$recording_id_anti_action = $row["recording_id_anti_action"];
-		$aa_timeout = $row["aa_timeout"];
-		$aa_call_timeout = $row["aa_call_timeout"];
-		$aa_context = $row["aa_context"];
-		$aa_direct_dial = $row["aa_direct_dial"];
-		$aa_ringback = $row["aa_ringback"];
-		$aa_cid_name_prefix = $row["aa_cid_name_prefix"];
-		$aa_condition_js = $row["aa_condition_js"];
-		if (strlen($aa_condition_js) == 0) {
-			$aa_condition_js = $aa_condition_js_default;
-		}
-		
-		$aa_descr = $row["aa_descr"];
-		break; //limit to 1 row
-	}
-	unset ($prepstatement);
-}
-
-
-	require_once "includes/header.php";
-
-
-	echo "<script language=\"Javascript\">\n";
-	echo "function sf() { document.forms[0].savetopath.focus(); }\n";
-	echo "</script>\n";
-	echo "<script language=\"Javascript\" type=\"text/javascript\" src=\"/edit_area/edit_area_full.js\"></script>\n";
-	echo "<script language=\"Javascript\" type=\"text/javascript\">\n";
-	echo "	// initialisation\n";
-	echo "	editAreaLoader.init({\n";
-	echo "		id: \"aa_condition_js\"	// id of the textarea to transform\n";
-	echo "		,start_highlight: true\n";
-	echo "		,allow_toggle: false\n";
-	echo "		,language: \"en\"\n";
-	echo "		,syntax: \"js\"\n";
-	echo "		,toolbar: \"search, go_to_line,|, fullscreen, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help\"\n";
-	echo "		,syntax_selection_allow: \"css,html,js,php,xml,c,cpp,sql\"\n";
-	echo "		,show_line_colors: true\n";
-	echo "	});\n";
-	echo "</script>";
-
-	echo "<div align='center'>";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
-
-	echo "<tr class='border'>\n";
-	echo "	<td align=\"left\">\n";
-	echo "      <br>";
-
-
-
-	echo "<form method='post' name='frm' action=''>\n";
-
-	echo "<div align='center'>\n";
-
-	echo "<table width=\"100%\" border=\"0\" cellpadding=\"7\" cellspacing=\"0\">\n";
-	echo "<tr>\n";
-	if ($action == "add") {
-		echo "<td align='left' width='30%' nowrap><b>Auto Attendant Add</b></td>\n";
-	}
-	if ($action == "update") {
-		echo "<td align='left' width='30%' nowrap><b>Auto Attendant Edit</b></td>\n";
-	}
-	echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='v_auto_attendant.php'\" value='Back'></td>\n";
-	echo "</tr>\n";
-
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    Extension:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "    <input class='formfld' type='text' name='aa_extension' maxlength='255' value=\"$aa_extension\">\n";
-	echo "<br />\n";
-	echo "example: 5002\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    Name:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "    <input class='formfld' type='text' name='aa_name' maxlength='255' value=\"$aa_name\">\n";
-	echo "<br />\n";
-	echo "\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "	Recording Action:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "		<select name='recording_id_action' class='formfld'>\n";
-	echo "		<option></option>\n";
-
-	$sql = "";
-	$sql .= "select * from v_recordings ";
-	$sql .= "where v_id = '$v_id' ";
-	$prepstatement = $db->prepare(check_sql($sql));
-	$prepstatement->execute();
-	$result = $prepstatement->fetchAll();
-	foreach ($result as &$row) {
-		if ($recording_id_action == $row['recording_id']) {
-			echo "		<option value='".$row['recording_id']."' selected='yes'>".$row['recordingname']."</option>\n";
-		}
-		else {
-			echo "		<option value='".$row['recording_id']."'>".$row['recordingname']."</option>\n";
-		}
-	}
-	unset ($prepstatement);
-
-	echo "		</select>\n";
-	echo "<br />\n";
-	echo "\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    Recording Anti-Action:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	//echo "    <input class='formfld' type='text' name='recording_id_anti_action' maxlength='255' value=\"$recording_id_anti_action\">\n";
-	echo "              <select name='recording_id_anti_action' class='formfld'>\n";
-	echo "                <option></option>\n";
-	$sql = "";
-	$sql .= "select * from v_recordings ";
-	$sql .= "where v_id = '$v_id' ";
-	$prepstatement = $db->prepare(check_sql($sql));
-	$prepstatement->execute();
-	$result = $prepstatement->fetchAll();
-	foreach ($result as &$row) {
-		//$v_id = $row["v_id"];
-		//$filename = $row["filename"];
-		//$recordingname = $row["recordingname"];
-		//$recording_id = $row["recording_id"];
-		//$descr = $row["descr"];
-		if ($recording_id_anti_action == $row['recording_id']) {
-			echo "              <option value='".$row['recording_id']."' selected='yes'>".$row['recordingname']."</option>\n";
-		}
-		else {
-			echo "              <option value='".$row['recording_id']."'>".$row['recordingname']."</option>\n";
-		}
-	}
-	unset ($prepstatement);
-	
-	echo "              </select>\n";
-
-	echo "<br />\n";
-	echo "\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    Timeout:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "    <input class='formfld' type='text' name='aa_timeout' maxlength='255' value=\"$aa_timeout\">\n";
-	echo "<br />\n";
-	echo "After the recording concludes the timeout sets the time in seconds to continue to wait for DTMF. If the DTMF is \n";
-	echo "not detected during that time the 't' timeout option is executed. \n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    Call Timeout:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "    <input class='formfld' type='text' name='aa_call_timeout' maxlength='255' value=\"$aa_call_timeout\">\n";
-	echo "<br />\n";
-	echo "Call timeout is the time in seconds to ring the destination. After this time is exceeded calls to extensions \n";
-	echo "will be sent to voicemail. default: 30 seconds \n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    Context:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	if (strlen(aa_context) == 0) {
-		echo "    <input class='formfld' type='text' name='aa_context' maxlength='255' value=\"default\">\n";
-	}
-	else {
-		echo "    <input class='formfld' type='text' name='aa_context' maxlength='255' value=\"$aa_context\">\n";
-	}
-	echo "<br />\n";
-	echo "example: default\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    Direct Dial:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	//echo "    <input class='formfld' type='text' name='aa_direct_dial' maxlength='255' value=\"$aa_direct_dial\">\n";
-	echo "                <select name='aa_direct_dial' class='formfld'>\n";
-	echo "                <option></option>\n";
-	if (strlen($aa_direct_dial) == 0) { //set default
-		echo "                <option value='true'>enable</option>\n";
-		echo "                <option selected='yes' value='false'>disabled</option>\n";
-	}
-	else {
-		if ($aa_direct_dial == "true") {
-			echo "                <option selected='yes' value='true'>enabled</option>\n";
-		}
-		else {
-			echo "                <option value='true'>enable</option>\n";
-		}
-		if ($aa_direct_dial == "false") {
-			echo "                <option selected='yes' value='false'>disabled</option>\n";
-		}
-		else {
-			echo "                <option value='false'>disable</option>\n";
-		}
-	}
-	echo "                </select>\n";
-	echo "<br />\n";
-	echo "Allows callers to dial directly to extensions and feature codes that are up to 5 digits in length.\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    Ring Back:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "                <select name='aa_ringback' class='formfld'>\n";
-	echo "                <option></option>\n";
-	if ($aa_ringback == "ring") {
-		echo "                <option selected='yes'>ring</option>\n";
-	}
-	else {
-		echo "                <option>ring</option>\n";
-	}
-	if ($aa_ringback == "music") {
-		echo "                <option selected='yes'>music</option>\n";
-	}
-	else {
-		echo "                <option>music</option>\n";
-	}
-	echo "                </select>\n";
-
-	echo "<br />\n";
-	echo "Defines what the caller will hear while destination is being called. The choices are music (music on hold) ring (ring tone.) default: music\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-	echo "    CID Prefix:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "    <input class='formfld' type='text' name='aa_cid_name_prefix' maxlength='255' value=\"$aa_cid_name_prefix\">\n";
-	echo "<br />\n";
-	echo "Set a prefix on the caller ID name. (optional)\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    Javascript Condition:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	if (strlen($aa_condition_js) == 0) {
-		echo "<textarea name=\"aa_condition_js\" id=\"aa_condition_js\" cols=\"60\" rows=\"10\" wrap=\"off\">".$aa_condition_js_default."</textarea>\n";
-	}
-	else {
-		echo "<textarea name=\"aa_condition_js\" id=\"aa_condition_js\" cols=\"60\" rows=\"10\" wrap=\"off\">".$aa_condition_js."</textarea>\n";
-	}
-	echo "<br />\n";
-	echo "A simple valid condition is: condition=true; To re-populate the default simply empty the textarea and click on save. The following javascript variables have been defined: Hours, Mins, Seconds, Month, Date, Year, and Day.\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-	echo "    Description:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "    <input class='formfld' type='text' name='aa_descr' maxlength='255' value=\"$aa_descr\">\n";
-	echo "<br />\n";
-	echo "You may enter a description here for your reference (not parsed). \n";
-	echo "</td>\n";
-	echo "</tr>\n";
-	echo "	<tr>\n";
-	echo "		<td colspan='2' align='right'>\n";
-	if ($action == "update") {
-		echo "				<input type='hidden' name='auto_attendant_id' value='$auto_attendant_id'>\n";
-	}
-	echo "				<input type='submit' name='submit' class='btn' value='Save'>\n";
-	echo "		</td>\n";
-	echo "	</tr>";
-	echo "</table>";
-	echo "</form>";
-
-
-	echo "	</td>";
-	echo "	</tr>";
-	echo "</table>";
-	echo "</div>";
-
-//---- begin: v_auto_attendant ---------------------------
-if ($action == "update") {
-
-	echo "<div align='center'>";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
-
-	echo "<tr class='border'>\n";
-	echo "	<td align=\"center\">\n";
-
-	echo "      <br />";
-	
-	echo "    <table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
-	echo "      <tr>\n";
-	echo "        <td align='left'><p><span class=\"vexpl\"><span class=\"red\"><strong><br>\n";
-	echo "            </strong></span>\n";
-	echo "            Options are the choices that are available to the caller when they\n";
-	echo "            are calling the auto attendant. If the caller presses 2 then the call\n";
-	echo "            is directed to the corresponding destination.\n";
-	echo "            </span></p></td>\n";
-	echo "      </tr>\n";
-	echo "    </table>";
-
-	echo "      <br />";
-
-
-	echo "<table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
-	echo "  <tr>\n";
-	echo "    <td align='left'><p><span class=\"vexpl\"><span class=\"red\"><strong>Action<br />\n";
-	echo "        </strong></span>\n";
-	echo "        The options that are executed when the <b>condition matches.</b>\n";
-	echo "        </span></p></td>\n";
-	echo "  </tr>\n";
-	echo "</table>\n";
-	echo "<br />";
-
-	$sql = "";
-	$sql .= " select * from v_auto_attendant_options ";
-	$sql .= " where v_id = '$v_id' ";
-	$sql .= " and auto_attendant_id = '$auto_attendant_id' ";
-	$sql .= " and option_action = 'action' ";
-	$sql .= " order by option_number asc";
-	//if (strlen($orderby)> 0) { $sql .= "order by $orderby $order "; }
-	//$sql .= " limit $rowsperpage offset $offset ";
-	//echo $sql;
-	$prepstatement = $db->prepare(check_sql($sql));
-	$prepstatement->execute();
-	$result = $prepstatement->fetchAll();
-	$resultcount = count($result);
-	unset ($prepstatement, $sql);
-
-
-	$c = 0;
-	$rowstyle["0"] = "rowstyle0";
-	$rowstyle["1"] = "rowstyle1";
-
-	echo "<div align='center'>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	//echo "<tr><td colspan='5'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>";
-
-	echo "<tr>\n";
-	echo "<th align='left'>&nbsp;&nbsp;Option</th>\n";
-	echo "<th align='left'>&nbsp;&nbsp;Type</th>\n";
-	echo "<th align='left'>&nbsp;&nbsp;Profile</th>\n";
-	echo "<th align='left'>&nbsp;&nbsp;Destination</th>\n";
-	echo "<th align='left'>&nbsp;&nbsp;Description</th>\n";
-	echo "<td align='right' width='42'>\n";
-	echo "	<a href='v_auto_attendant_options_edit.php?id2=".$auto_attendant_id."&option_action=action' alt='add'>$v_link_label_add</a>\n";
-	echo "</td>\n";
-	echo "<tr>\n";
-
-	//echo "<tr><td colspan='5'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
-
-	if ($resultcount == 0) { //no results
-	}
-	else { //received results
-		foreach($result as $row) {
-			//print_r( $row );
-			echo "<tr >\n";
-			echo "   <td valign='top' class='".$rowstyle[$c]."'>&nbsp;&nbsp;".$row[option_number]."</td>\n";
-			echo "   <td valign='top' class='".$rowstyle[$c]."'>&nbsp;&nbsp;".$row[option_type]."</td>\n";
-			echo "   <td valign='top' class='".$rowstyle[$c]."'>&nbsp;&nbsp;".$row[option_profile]."</td>\n";
-			echo "   <td valign='top' class='".$rowstyle[$c]."'>&nbsp;&nbsp;".$row[option_data]."</td>\n";
-			echo "   <td valign='top' class='".$rowstyle[$c]."'>&nbsp;&nbsp;".$row[option_descr]."</td>\n";
-			echo "   <td valign='top' align='right'>\n";
-			echo "		<a href='v_auto_attendant_options_edit.php?id=".$row[auto_attendant_option_id]."&id2=".$auto_attendant_id."' alt='edit'>$v_link_label_edit</a>\n";
-			echo "		<a href='v_auto_attendant_options_delete.php?id=".$row[auto_attendant_option_id]."&id2=".$auto_attendant_id."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
-			echo "   </td>\n";
-			echo "</tr>\n";
-			//echo "<tr><td colspan='5'><img src='/images/spacer.gif' width='100%'' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
-			if ($c==0) { $c=1; } else { $c=0; }
-		} //end foreach
-		unset($sql, $result, $rowcount);
-	} //end if results
-
-	echo "<tr>\n";
-	echo "<td colspan='6'>\n";
-	echo "	<table width='100%' cellpadding='0' cellspacing='0'>\n";
-	echo "	<tr>\n";
-	echo "		<td width='33.3%' nowrap>&nbsp;</td>\n";
-	echo "		<td width='33.3%' align='center' nowrap>$pagingcontrols</td>\n";
-	echo "		<td width='33.3%' align='right'>\n";
-	echo "			<a href='v_auto_attendant_options_edit.php?id2=".$auto_attendant_id."&option_action=action' alt='add'>$v_link_label_add</a>\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "	</table>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "</table>";
-	echo "</div>";
-
-	echo "</td>";
-	echo "</tr>";
-	echo "</table>";
-	echo "</div>";
-
-
-	//--------------------------------------------------------------------------
-
-	echo "<div align='center'>";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
-
-	echo "<tr class='border'>\n";
-	echo "	<td align=\"center\">\n";
-	echo "      <br />";
-
-
-	echo "  	<table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
-	echo "      <tr>\n";
-	echo "        <td align='left'><p><span class=\"vexpl\"><span class=\"red\"><strong>Anti-Action<br />\n";
-	echo "            </strong></span>\n";
-	echo "              The options that are executed when the <b>condition does NOT match.</b>\n";
-	echo "            </span></p></td>\n";
-	echo "      </tr>\n";
-	echo "    </table>";
-
-	echo "      <br />";
-
-
-	$sql = "";
-	$sql .= " select * from v_auto_attendant_options ";
-	$sql .= " where auto_attendant_id = '$auto_attendant_id' ";
-	$sql .= " and v_id = $v_id ";
-	$sql .= " and option_action = 'anti-action' ";
-	$sql .= " order by option_number asc";
-	//if (strlen($orderby)> 0) { $sql .= "order by $orderby $order "; }
-
-	//$sql .= " limit $rowsperpage offset $offset ";
-	//echo $sql;
-	$prepstatement = $db->prepare(check_sql($sql));
-	$prepstatement->execute();
-	$result = $prepstatement->fetchAll();
-	$resultcount = count($result);
-	unset ($prepstatement, $sql);
-
-
-	$c = 0;
-	$rowstyle["0"] = "rowstyle0";
-	$rowstyle["1"] = "rowstyle1";
-
-	echo "<div align='center'>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	//echo "<tr><td colspan='5'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>";
-
-	echo "<tr>\n";
-	echo "<th align='left'>&nbsp;&nbsp;Option</th>\n";
-	echo "<th align='left'>&nbsp;&nbsp;Type</th>\n";
-	echo "<th align='left'>&nbsp;&nbsp;Profile</th>\n";
-	echo "<th align='left'>&nbsp;&nbsp;Destination</th>\n";
-	echo "<th align='left'>&nbsp;&nbsp;Description</th>\n";
-	echo "<td align='right' width='42'>\n";
-	echo "	<a href='v_auto_attendant_options_edit.php?id2=".$auto_attendant_id."&option_action=action' alt='add'>$v_link_label_add</a>\n";
-	echo "</td>\n";
-	echo "<tr>\n";
-	//echo "<tr><td colspan='5'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
-
-	if ($resultcount == 0) { //no results
-	}
-	else { //received results
-		foreach($result as $row) {
-			//print_r( $row );
-			echo "<tr >\n";
-			echo "   <td valign='top' class='".$rowstyle[$c]."'>&nbsp;&nbsp;".$row[option_number]."</td>\n";
-			echo "   <td valign='top' class='".$rowstyle[$c]."'>&nbsp;&nbsp;".$row[option_type]."</td>\n";
-			echo "   <td valign='top' class='".$rowstyle[$c]."'>&nbsp;&nbsp;".$row[option_profile]."</td>\n";
-			echo "   <td valign='top' class='".$rowstyle[$c]."'>&nbsp;&nbsp;".$row[option_data]."</td>\n";
-			echo "   <td valign='top' class='".$rowstyle[$c]."'>&nbsp;&nbsp;".$row[option_descr]."</td>\n";
-			echo "   <td valign='top' align='right'>\n";
-			echo "		<a href='v_auto_attendant_options_edit.php?id=".$row[auto_attendant_option_id]."&id2=".$auto_attendant_id."' alt='edit'>$v_link_label_edit</a>\n";
-			echo "		<a href='v_auto_attendant_options_delete.php?id=".$row[auto_attendant_option_id]."&id2=".$auto_attendant_id."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
-			echo "   </td>\n";
-			echo "</tr>\n";
-			//echo "<tr><td colspan='5'><img src='/images/spacer.gif' width='100%'' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
-			if ($c==0) { $c=1; } else { $c=0; }
-		} //end foreach
-		unset($sql, $result, $rowcount);
-	} //end if results
-
-	echo "<tr>\n";
-	echo "<td colspan='6'>\n";
-	echo "	<table width='100%' cellpadding='0' cellspacing='0'>\n";
-	echo "	<tr>\n";
-	echo "		<td width='33.3%' nowrap>&nbsp;</td>\n";
-	echo "		<td width='33.3%' align='center' nowrap>$pagingcontrols</td>\n";
-	echo "		<td width='33.3%' align='right'>\n";
-	echo "			<a href='v_auto_attendant_options_edit.php?id2=".$auto_attendant_id."&option_action=anti-action' alt='add'>$v_link_label_add</a>\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "	</table>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-
-	echo "</table>";
-	echo "</div>";
-	echo "<br><br>";
-	echo "<br><br>";
-
-	echo "</td>";
-	echo "</tr>";
-	echo "</table>";
-	echo "</div>";
-	echo "<br><br>";
-
-} //end if update
-//---- end: v_auto_attendant ---------------------------
-require_once "includes/footer.php";
-?>

+ 0 - 65
auto_attendant/v_auto_attendant_options_delete.php

@@ -1,65 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2010
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "includes/config.php";
-require_once "includes/checkauth.php";
-if (ifgroup("admin") || ifgroup("superadmin")) {
-	//access granted
-}
-else {
-	echo "access denied";
-	exit;
-}
-
-if (count($_GET)>0) {
-    $id = $_GET["id"];
-    $auto_attendant_id = check_str($_REQUEST["id2"]);
-}
-
-if (strlen($id)>0) {
-    $sql = "";
-    $sql .= "delete from v_auto_attendant_options ";
-	$sql .= "where v_id = '$v_id' ";
-    $sql .= "and auto_attendant_option_id = '$id' ";
-    $sql .= "and auto_attendant_id = '$auto_attendant_id' ";
-    $prepstatement = $db->prepare(check_sql($sql));
-    $prepstatement->execute();
-    unset($sql);
-	
-    //synchronize the xml config
-    sync_package_v_auto_attendant();
-}
-
-require_once "includes/header.php";
-echo "<meta http-equiv=\"refresh\" content=\"2;url=v_auto_attendant_edit.php?id=".$auto_attendant_id."\">\n";
-echo "<div align='center'>\n";
-echo "Delete Complete\n";
-echo "</div>\n";
-
-require_once "includes/footer.php";
-return;
-
-?>

+ 0 - 398
auto_attendant/v_auto_attendant_options_edit.php

@@ -1,398 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2010
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "includes/config.php";
-require_once "includes/checkauth.php";
-if (ifgroup("admin") || ifgroup("superadmin")) {
-	//access granted
-}
-else {
-	echo "access denied";
-	exit;
-}
-
-
-//Action add or update
-if (isset($_REQUEST["id"])) {
-	$action = "update";
-	$auto_attendant_option_id = check_str($_REQUEST["id"]);
-}
-else {
-	$action = "add";
-	$auto_attendant_id = check_str($_REQUEST["id2"]);
-}
-
-if (isset($_REQUEST["id2"])) {
-	$auto_attendant_id = check_str($_REQUEST["id2"]);
-}
-if (isset($_REQUEST["option_action"])) {
-	$option_action = $_REQUEST["option_action"];
-}
-
-//POST to PHP variables
-if (count($_POST)>0) {
-	//$v_id = check_str($_POST["v_id"]);
-	if (isset($_REQUEST["dialplan_include_id"])) {
-		$auto_attendant_id = check_str($_POST["auto_attendant_id"]);
-	}
-	$option_action = check_str($_POST["option_action"]);
-	$option_number = check_str($_POST["option_number"]);
-	$option_type = check_str($_POST["option_type"]);
-	$option_profile = check_str($_POST["option_profile"]);
-	$option_recording = check_str($_POST["option_recording"]);
-	$option_data = check_str($_POST["option_data"]);
-	$option_descr = check_str($_POST["option_descr"]);
-}
-
-if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
-
-	$msg = '';
-
-	////recommend moving this to the config.php file
-	$uploadtempdir = $_ENV["TEMP"]."\\";
-	ini_set('upload_tmp_dir', $uploadtempdir);
-	////$imagedir = $_ENV["TEMP"]."\\";
-	////$filedir = $_ENV["TEMP"]."\\";
-
-	if ($action == "update") {
-		$auto_attendant_option_id = check_str($_POST["auto_attendant_option_id"]);
-	}
-
-	//check for all required data
-		if (strlen($v_id) == 0) { $msg .= "Please provide: v_id<br>\n"; }
-		if (strlen($auto_attendant_id) == 0) { $msg .= "Please provide: auto_attendant_id<br>\n"; }
-		//if (strlen($option_action) == 0) { $msg .= "Please provide: Action<br>\n"; }
-		if (strlen($option_number) == 0) { $msg .= "Please provide: Option Number<br>\n"; }
-		if (strlen($option_type) == 0) { $msg .= "Please provide: Type<br>\n"; }
-		if (strlen($option_profile) == 0) { $msg .= "Please provide: Profile<br>\n"; }
-		if (strlen($option_data) == 0) { $msg .= "Please provide: Destination<br>\n"; }
-		//if (strlen($option_recording) == 0) { $msg .= "Please provide: Recording<br>\n"; }
-		//if (strlen($option_descr) == 0) { $msg .= "Please provide: Description<br>\n"; }
-		if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
-			require_once "includes/header.php";
-			require_once "includes/persistformvar.php";
-			echo "<div align='center'>\n";
-			echo "<table><tr><td>\n";
-			echo $msg."<br />";
-			echo "</td></tr></table>\n";
-			persistformvar($_POST);
-			echo "</div>\n";
-			require_once "includes/footer.php";
-			return;
-		}
-
-	//Add or update the database
-	if ($_POST["persistformvar"] != "true") {
-		if ($action == "add") {
-			$sql = "insert into v_auto_attendant_options ";
-			$sql .= "(";
-			$sql .= "v_id, ";
-			$sql .= "auto_attendant_id, ";
-			$sql .= "option_action, ";
-			$sql .= "option_number, ";
-			$sql .= "option_type, ";
-			$sql .= "option_profile, ";
-			$sql .= "option_data, ";
-			$sql .= "option_recording, ";
-			$sql .= "option_descr ";
-			$sql .= ")";
-			$sql .= "values ";
-			$sql .= "(";
-			$sql .= "'$v_id', ";
-			$sql .= "'$auto_attendant_id', ";
-			$sql .= "'$option_action', ";
-			$sql .= "'$option_number', ";
-			$sql .= "'$option_type', ";
-			$sql .= "'$option_profile', ";
-			$sql .= "'$option_data', ";
-			$sql .= "'$option_recording', ";
-			$sql .= "'$option_descr' ";
-			$sql .= ")";
-			$db->exec(check_sql($sql));
-			unset($sql);
-
-			//synchronize the xml config
-			sync_package_v_auto_attendant();
-
-			require_once "includes/header.php";
-			echo "<meta http-equiv=\"refresh\" content=\"2;url=v_auto_attendant_edit.php?id=".$auto_attendant_id."\">\n";
-			echo "<div align='center'>\n";
-			echo "Add Complete\n";
-			echo "</div>\n";
-			require_once "includes/footer.php";
-			return;
-		} //if ($action == "add")
-
-		if ($action == "update") {
-			$sql = "update v_auto_attendant_options set ";
-			$sql .= "auto_attendant_id = '$auto_attendant_id', ";
-			$sql .= "option_action = '$option_action', ";
-			$sql .= "option_number = '$option_number', ";
-			$sql .= "option_type = '$option_type', ";
-			$sql .= "option_profile = '$option_profile', ";
-			$sql .= "option_data = '$option_data', ";
-			$sql .= "option_recording = '$option_recording', ";
-			$sql .= "option_descr = '$option_descr' ";
-			$sql .= "where v_id = '$v_id' ";
-			$sql .= "and auto_attendant_option_id = '$auto_attendant_option_id'";
-			$db->exec(check_sql($sql));
-			unset($sql);
-
-			//synchronize the xml config
-			sync_package_v_auto_attendant();
-
-			require_once "includes/header.php";
-			echo "<meta http-equiv=\"refresh\" content=\"2;url=v_auto_attendant_edit.php?id=".$auto_attendant_id."\">\n";
-			echo "<div align='center'>\n";
-			echo "Update Complete\n";
-			echo "</div>\n";
-			require_once "includes/footer.php";
-
-			return;
-		} //if ($action == "update")
-	} //if ($_POST["persistformvar"] != "true") { 
-
-} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
-
-//Pre-populate the form
-if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
-	$auto_attendant_option_id = $_GET["id"];
-	$sql = "";
-	$sql .= "select * from v_auto_attendant_options ";
-	$sql .= "where v_id = '$v_id' ";
-	$sql .= "and auto_attendant_option_id = '$auto_attendant_option_id' ";
-	$prepstatement = $db->prepare(check_sql($sql));
-	$prepstatement->execute();
-	$result = $prepstatement->fetchAll();
-	foreach ($result as &$row) {
-		$auto_attendant_id = $row["auto_attendant_id"];
-		$option_action = $row["option_action"];
-		$option_number = $row["option_number"];
-		$option_type = $row["option_type"];
-		$option_profile = $row["option_profile"];
-		$option_data = $row["option_data"];
-		$option_recording = $row["option_recording"];
-		$option_descr = $row["option_descr"];
-		break; //limit to 1 row
-	}
-	unset ($prepstatement);
-}
-
-
-	require_once "includes/header.php";
-
-
-	echo "<div align='center'>";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
-
-	echo "<tr class='border'>\n";
-	echo "	<td align=\"left\">\n";
-	echo "		<br>";
-
-
-//Write the HTML form
-	echo "<form method='post' name='frm' action=''>\n";
-
-	echo "<div align='center'>\n";
-	echo "<table width='100%'  border='0' cellpadding='6' cellspacing='0'>\n";
-
-	echo "<tr>\n";
-	if ($action == "add") {
-		echo "<td align='left' width='30%' nowrap><b>Option Add</b></td>\n";
-	}
-	if ($action == "update") {
-		echo "<td align='left' width='30%' nowrap><b>Options Edit</b></td>\n";
-	}
-	echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='v_auto_attendant_edit.php?id=".$auto_attendant_id."'\" value='Back'></td>\n";
-	echo "</tr>\n";
-
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    Option Number:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "    <input class='formfld' type='text' name='option_number' maxlength='255' value=\"$option_number\">\n";
-	echo "<br />\n";
-	echo "Any number 1-5 digits. The following are special options:<br />\n";
-	echo "'n' now (don't wait for dtmf perform the action now) <br />\n";
-	echo "'d' default (if the caller presses an incorrect number the default action is used) <br />\n";
-	echo "'t' timeout (the action to perform after the call timeout passes) <br />\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-/*
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    Type:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "                <select name='option_type' class='formfld'>\n";
-	echo "                <option></option>\n";
-	if ($option_type == "extension") {
-		echo "                <option selected='yes'>extension</option>\n";
-	}
-	else {
-		echo "                <option>extension</option>\n";
-	}
-	if ($option_type == "voicemail") {
-		echo "                <option selected='yes'>voicemail</option>\n";
-	}
-	else {
-		echo "                <option>voicemail</option>\n";
-	}
-	if ($option_type == "sip uri") {
-		echo "                <option selected='yes'>sip uri</option>\n";
-	}
-	else {
-		echo "                <option>sip uri</option>\n";
-	}
-	echo "                </select>\n";
-	echo "<br />\n";
-	echo "\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-*/
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    Type:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "    <input class='formfld' type='text' name='option_type' maxlength='255' value=\"$option_type\"><br />\n";
-	echo "bridge, transfer, voicemail, conference, fifo, etc.<br />\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    Destination:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "    <input class='formfld' type='text' name='option_data' maxlength='255' value=\"$option_data\">\n";
-	echo "<br />\n";
-	echo "type: transfer data: 1001 XML default<br />\n";
-	echo "type: voicemail data: default \${domain} 1001<br />\n";
-	echo "type: bridge data: (voicemail): sofia/internal/*98@\${domain}<br />\n";
-	echo "type: bridge data: (external number): sofia/gateway/gatewayname/12081231234<br />\n";
-	echo "type: bridge data: (auto attendant): sofia/internal/5002@\${domain}<br />\n";
-	echo "type: bridge data: (user): /user/1001@\${domain}<br />\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    Profile:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "                <select name='option_profile' class='formfld'>\n";
-	echo "                <option></option>\n";
-	if ($option_profile == "auto") {
-		echo "                <option selected='yes'>auto</option>\n";
-	}
-	else {
-		echo "                <option>auto</option>\n";
-	}
-
-	foreach (ListFiles($v_conf_dir.'/sip_profiles') as $key=>$sip_profile_file){
-		$sip_profile_name = str_replace(".xml", "", $sip_profile_file);
-
-		if ($option_profile == $sip_profile_name) {
-			echo "                <option selected='yes'>$sip_profile_name</option>\n";
-		}
-		else {
-			echo "                <option>$sip_profile_name</option>\n";
-		}
-	}
-	echo "                </select>\n";
-	echo "<br />\n";
-	echo "\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-	echo "	Recording:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "		<select name='option_recording' class='formfld'>\n";
-	echo "		<option></option>\n";
-
-	$sql = "";
-	$sql .= "select * from v_recordings ";
-	$sql .= "where v_id = '$v_id' ";
-	$prepstatement = $db->prepare(check_sql($sql));
-	$prepstatement->execute();
-	$result = $prepstatement->fetchAll();
-	foreach ($result as &$row) {
-		if ($option_recording == $row['recording_id']) {
-			echo "		<option value='".$row['recording_id']."' selected='yes'>".$row['recordingname']."</option>\n";
-		}
-		else {
-			echo "		<option value='".$row['recording_id']."'>".$row['recordingname']."</option>\n";
-		}
-	}
-	unset ($prepstatement);
-
-	echo "		</select><br />\n";
-	echo "Optional, the recording to play before the call is sent to the destination.<br />\n";
-	echo "\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-	echo "    Description:\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "    <input class='formfld' type='text' name='option_descr' maxlength='255' value=\"$option_descr\">\n";
-	echo "<br />\n";
-	echo "You may enter a description here for your reference (not parsed).\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-	echo "	<tr>\n";
-	echo "		<td colspan='2' align='right'>\n";
-	echo "				<input type='hidden' name='auto_attendant_id' value='$auto_attendant_id'>\n";
-	echo "				<input class='formfld' type='hidden' name='option_action' maxlength='255' value=\"$option_action\">\n";
-	if ($action == "update") {
-		echo "				<input type='hidden' name='auto_attendant_option_id' value='$auto_attendant_option_id'>\n";
-	}
-	echo "				<input type='submit' name='submit' class='btn' value='Save'>\n";
-	echo "		</td>\n";
-	echo "	</tr>";
-	echo "</table>";
-	echo "</form>";
-
-
-	echo "	</td>";
-	echo "	</tr>";
-	echo "</table>";
-	echo "</div>";
-
-
-require_once "includes/footer.php";
-?>

+ 0 - 164
auto_attendant/v_config.php

@@ -1,164 +0,0 @@
-<?php
-	//application details
-		$apps[$x]['name'] = "Auto Attendant";
-		$apps[$x]['uuid'] = 'D998A959-3DB2-6E02-A53F-795E7B8E11D4';
-		$apps[$x]['category'] = 'PBX';
-		$apps[$x]['subcategory'] = '';
-		$apps[$x]['version'] = '';
-		$apps[$x]['license'] = 'Mozilla Public License 1.1';
-		$apps[$x]['url'] = 'http://www.fusionpbx.com';
-		$apps[$x]['description']['en'] = 'Deprecated';
-
-	//menu details
-		$apps[$x]['menu'][0]['title']['en'] = 'Auto Attendant';
-		$apps[$x]['menu'][0]['uuid'] = '963785C6-4DF6-9BF1-E4A7-7183774CC741';
-		$apps[$x]['menu'][0]['parent_uuid'] = 'FD29E39C-C936-F5FC-8E2B-611681B266B5';
-		$apps[$x]['menu'][0]['category'] = 'internal';
-		$apps[$x]['menu'][0]['groups'][] = 'hidden';
-		$apps[$x]['menu'][0]['path'] = '/mod/auto_attendant/v_auto_attendant.php';
-
-	//permission details
-		$apps[$x]['permissions'][0]['name'] = 'auto_attendant_view';
-		$apps[$x]['permissions'][0]['groups'][] = 'admin';
-		$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
-
-		$apps[$x]['permissions'][1]['name'] = 'auto_attendant_add';
-		$apps[$x]['permissions'][1]['groups'][] = 'admin';
-		$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
-
-		$apps[$x]['permissions'][2]['name'] = 'auto_attendant_edit';
-		$apps[$x]['permissions'][2]['groups'][] = 'admin';
-		$apps[$x]['permissions'][2]['groups'][] = 'superadmin';
-
-		$apps[$x]['permissions'][3]['name'] = 'auto_attendant_delete';
-		$apps[$x]['permissions'][3]['groups'][] = 'admin';
-		$apps[$x]['permissions'][3]['groups'][] = 'superadmin';
-
-	//schema details
-		$y = 0; //table array index
-		$z = 0; //field array index
-		$apps[$x]['db'][$y]['table'] = 'v_auto_attendant';
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'auto_attendant_id';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer PRIMARY KEY';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT PRIMARY KEY';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'v_id';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'aa_extension';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'aaextension';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'aa_name';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'aaname';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'recording_id_action';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'recordingidaction';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'recording_id_anti_action';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'recordingidantiaction';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'aa_timeout';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'aatimeout';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'aa_call_timeout';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'aacalltimeout';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'aa_context';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'aacontext';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'aa_direct_dial';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'aadirectdial';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'aa_ringback';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'aaringback';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'aa_cid_name_prefix';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'aacidnameprefix';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'aa_condition_js';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'aaconditionjs';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'aa_descr';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'aadescr';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-
-	// CREATE TABLE v_auto_attendant_options
-		$y = 1; //table array index
-		$z = 0; //field array index
-		$apps[$x]['db'][$y]['table'] = 'v_auto_attendant_options';
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'auto_attendant_option_id';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer PRIMARY KEY';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT PRIMARY KEY';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'v_id';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'auto_attendant_id';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'option_action';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'optionaction';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'option_number';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'optionnumber';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'option_type';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'optiontype';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'option_profile';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'optionprofile';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'option_data';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'optiondata';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'option_recording';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'optionrecording';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'option_descr';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'optiondescr';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-
-?>