Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ include "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; if (permission_exists('dialplan_advanced_view')) { //access granted } else { echo "access denied"; exit; } require_once "includes/header.php"; if ($_GET['a'] == "default" && permission_exists('dialplan_advanced_edit')) { //create the dialplan/default.xml for single tenant or dialplan/domain.xml require_once "includes/classes/switch_dialplan.php"; $dialplan = new dialplan; $dialplan->domain_uuid = $_SESSION['domain_uuid']; $dialplan->switch_dialplan_dir = $_SESSION['switch']['dialplan']['dir']; $dialplan->restore_advanced_xml(); //print_r($dialplan->result); } if ($_POST['a'] == "save" && permission_exists('dialplan_advanced_edit')) { $v_content = str_replace("\r","",$_POST['code']); if (file_exists($_SESSION['switch']['dialplan']['dir']."/".$_SESSION['domain_name'].".xml")) { $fd = fopen($_SESSION['switch']['dialplan']['dir']."/".$_SESSION['domain_name'].".xml", "w"); } else { $fd = fopen($_SESSION['switch']['dialplan']['dir']."/default.xml", "w"); } fwrite($fd, $v_content); fclose($fd); $savemsg = "Saved"; } if (file_exists($_SESSION['switch']['dialplan']['dir']."/".$_SESSION['domain_name'].".xml")) { $fd = fopen($_SESSION['switch']['dialplan']['dir']."/".$_SESSION['domain_name'].".xml", "r"); $v_content = fread($fd, filesize($_SESSION['switch']['dialplan']['dir']."/".$_SESSION['domain_name'].".xml")); } else { $fd = fopen($_SESSION['switch']['dialplan']['dir']."/default.xml", "r"); $v_content = fread($fd, filesize($_SESSION['switch']['dialplan']['dir']."/default.xml")); } fclose($fd); ?>
Default Dialplan
The default dialplan is used to setup call destinations based on conditions and context. You can use the dialplan to send calls to gateways, auto attendants, external numbers, to scripts, or any destination.



location: ".$_SESSION['switch']['conf']['dir']."/dialplan/default.xml\n"; } ?> ' /> "; } ?>