Update dialplan_inbound_add.php
This commit is contained in:
parent
70f939d713
commit
e4e6166a56
|
|
@ -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>
|
||||||
Portions created by the Initial Developer are Copyright (C) 2008-2015
|
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
|
|
@ -25,16 +25,20 @@
|
||||||
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
|
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
|
||||||
Riccardo Granchi <riccardo.granchi@nems.it>
|
Riccardo Granchi <riccardo.granchi@nems.it>
|
||||||
*/
|
*/
|
||||||
include "root.php";
|
|
||||||
require_once "resources/require.php";
|
//includes
|
||||||
require_once "resources/check_auth.php";
|
include "root.php";
|
||||||
if (permission_exists('inbound_route_add')) {
|
require_once "resources/require.php";
|
||||||
|
require_once "resources/check_auth.php";
|
||||||
|
|
||||||
|
//check permissions
|
||||||
|
if (permission_exists('inbound_route_add')) {
|
||||||
//access granted
|
//access granted
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo $text['label-access-denied'];
|
echo $text['label-access-denied'];
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
$language = new text;
|
$language = new text;
|
||||||
|
|
@ -51,7 +55,7 @@ else {
|
||||||
$action = $_GET["action"];
|
$action = $_GET["action"];
|
||||||
|
|
||||||
//get the http post values and set them as php variables
|
//get the http post values and set them as php variables
|
||||||
if (count($_POST)>0) {
|
if (count($_POST) > 0) {
|
||||||
$dialplan_name = check_str($_POST["dialplan_name"]);
|
$dialplan_name = check_str($_POST["dialplan_name"]);
|
||||||
$caller_id_outbound_prefix = check_str($_POST["caller_id_outbound_prefix"]);
|
$caller_id_outbound_prefix = check_str($_POST["caller_id_outbound_prefix"]);
|
||||||
$limit = check_str($_POST["limit"]);
|
$limit = check_str($_POST["limit"]);
|
||||||
|
|
@ -115,9 +119,10 @@ else {
|
||||||
$dialplan_enabled = check_str($_POST["dialplan_enabled"]);
|
$dialplan_enabled = check_str($_POST["dialplan_enabled"]);
|
||||||
$dialplan_description = check_str($_POST["dialplan_description"]);
|
$dialplan_description = check_str($_POST["dialplan_description"]);
|
||||||
if (strlen($dialplan_enabled) == 0) { $dialplan_enabled = "true"; } //set default to enabled
|
if (strlen($dialplan_enabled) == 0) { $dialplan_enabled = "true"; } //set default to enabled
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
//process the http post data
|
||||||
|
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
//check for all required data
|
//check for all required data
|
||||||
if (strlen($domain_uuid) == 0) { $msg .= "".$text['label-required-domain_uuid']."<br>\n"; }
|
if (strlen($domain_uuid) == 0) { $msg .= "".$text['label-required-domain_uuid']."<br>\n"; }
|
||||||
if (strlen($dialplan_name) == 0) { $msg .= "".$text['label-required-dialplan_name']."<br>\n"; }
|
if (strlen($dialplan_name) == 0) { $msg .= "".$text['label-required-dialplan_name']."<br>\n"; }
|
||||||
|
|
@ -669,6 +674,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
//commit the atomic transaction
|
//commit the atomic transaction
|
||||||
$count = $db->exec("COMMIT;"); //returns affected rows
|
$count = $db->exec("COMMIT;"); //returns affected rows
|
||||||
|
|
||||||
|
//update the dialplan xml
|
||||||
|
$dialplans = new dialplan;
|
||||||
|
$dialplans->source = "details";
|
||||||
|
$dialplans->destination = "database";
|
||||||
|
$dialplans->uuid = $dialplan_uuid;
|
||||||
|
$dialplans->xml();
|
||||||
|
|
||||||
//clear the cache
|
//clear the cache
|
||||||
$cache = new cache;
|
$cache = new cache;
|
||||||
$cache->delete("dialplan:public");
|
$cache->delete("dialplan:public");
|
||||||
|
|
@ -683,7 +695,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
} //end if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
} //end if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
||||||
|
|
||||||
//initialize the destinations object
|
//initialize the destinations object
|
||||||
$destination = new destinations;
|
$destination = new destinations;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue