Update the IVR Menu class to make dialplan more modular. Add option for LUA or application IVR.

This commit is contained in:
markjcrane 2016-03-19 19:06:06 -06:00
parent b626edb480
commit e984d7e00a
3 changed files with 313 additions and 390 deletions

View File

@ -32,6 +32,31 @@
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "transfer:\${destination} XML \${context}"; $apps[$x]['destinations'][$y]['select_value']['dialplan'] = "transfer:\${destination} XML \${context}";
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:transfer \${destination} XML \${context}"; $apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:transfer \${destination} XML \${context}";
$apps[$x]['destinations'][$y]['select_label'] = "\${destination} \${name}"; $apps[$x]['destinations'][$y]['select_label'] = "\${destination} \${name}";
if ($_SESSION['ivr menu']['application']['text'] != "lua") {
$y++;
$this->destinations[$x]['type'] = 'array';
//$this->destinations[$x]['label'] = 'ivr_menus';
$this->destinations[$x]['result']['data'][$y]['label'] = 'menu-top';
$this->destinations[$x]['result']['data'][$y]['name'] = 'menu-top:';
$this->destinations[$x]['result']['data'][$y]['destination'] = 'menu-top';
$y++;
$this->destinations[$x]['result']['data'][$y]['label'] = 'menu-exit';
$this->destinations[$x]['result']['data'][$y]['name'] = 'menu-exit';
$this->destinations[$x]['result']['data'][$y]['destination'] = 'menu-exit';
$y++;
$apps[$x]['destinations'][$y]['type'] = "sql";
$apps[$x]['destinations'][$y]['label'] = "sub_ivr_menus";
$apps[$x]['destinations'][$y]['name'] = "ivr_menus";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and ivr_menu_enabled = 'true' ";
$apps[$x]['destinations'][$y]['order_by'] = "ivr_menu_extension asc";
$apps[$x]['destinations'][$y]['field']['name'] = "ivr_menu_name";
$apps[$x]['destinations'][$y]['field']['destination'] = "ivr_menu_uuid";
//$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "ivr:\${uuid}";
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-sub:ivr \${uuid}";
$apps[$x]['destinations'][$y]['select_label'] = "\${destination} \${name}";
}
//menu-say-phrase
//menu-play-sound
//permission details //permission details
$y = 0; $y = 0;

View File

@ -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-2016
All Rights Reserved. All Rights Reserved.
Contributor(s): Contributor(s):
@ -160,8 +160,13 @@ include "root.php";
public function add() { public function add() {
//create the database object
$database = new database;
if ($this->db) {
$database->db = $this->db;
}
//add the ivr menu //add the ivr menu
if (strlen($this->ivr_menu_option_action) == 0) {
if (strlen($this->ivr_menu_extension) > 0) { if (strlen($this->ivr_menu_extension) > 0) {
//set the ivr menu uuid //set the ivr menu uuid
if (strlen($this->ivr_menu_uuid) == 0) { if (strlen($this->ivr_menu_uuid) == 0) {
@ -173,138 +178,11 @@ include "root.php";
$this->dialplan_uuid = uuid(); $this->dialplan_uuid = uuid();
} }
//add the dialplan
$database = new database;
if ($this->db) {
$database->db = $this->db;
}
$database->table = "v_dialplans";
$database->fields['domain_uuid'] = $this->domain_uuid;
$database->fields['dialplan_uuid'] = $this->dialplan_uuid;
$database->fields['dialplan_name'] = $this->ivr_menu_name;
$database->fields['dialplan_order'] = '333';
$database->fields['dialplan_context'] = $_SESSION['context'];
$database->fields['dialplan_enabled'] = $this->ivr_menu_enabled;
$database->fields['dialplan_description'] = $this->ivr_menu_description;
$database->fields['app_uuid'] = $this->app_uuid;
$database->add();
//add the dialplan details
$detail_data = '^'.$this->ivr_menu_extension.'$';
$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'] = 'condition'; //condition, action, antiaction
$database->fields['dialplan_detail_type'] = 'destination_number';
$database->fields['dialplan_detail_data'] = $detail_data;
$database->fields['dialplan_detail_order'] = '005';
$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'] = 'answer';
$database->fields['dialplan_detail_data'] = '';
$database->fields['dialplan_detail_order'] = '010';
$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'] = 'sleep';
$database->fields['dialplan_detail_data'] = '1000';
$database->fields['dialplan_detail_order'] = '015';
$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'] = 'set';
$database->fields['dialplan_detail_data'] = 'hangup_after_bridge=true';
$database->fields['dialplan_detail_order'] = '020';
$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'] = 'set';
if ($this->ivr_menu_ringback == "music" || $this->ivr_menu_ringback == "") {
$database->fields['dialplan_detail_data'] = 'ringback=${hold_music}';
}
else {
$database->fields['dialplan_detail_data'] = 'ringback='.$this->ivr_menu_ringback;
}
$database->fields['dialplan_detail_order'] = '025';
$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'] = 'set';
if ($this->ivr_menu_ringback == "music" || $this->ivr_menu_ringback == "") {
$database->fields['dialplan_detail_data'] = 'transfer_ringback=${hold_music}';
}
else {
$database->fields['dialplan_detail_data'] = 'transfer_ringback='.$this->ivr_menu_ringback;
}
$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'] = 'set';
$database->fields['dialplan_detail_data'] = 'ivr_menu_uuid='.$this->ivr_menu_uuid;
$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;
$database->fields['dialplan_detail_uuid'] = uuid();
$database->fields['dialplan_detail_tag'] = 'action'; //condition, action, antiaction
$database->fields['dialplan_detail_type'] = 'lua';
$database->fields['dialplan_detail_data'] = 'ivr_menu.lua';
$database->fields['dialplan_detail_order'] = '040';
$database->add();
if (strlen($this->ivr_menu_exit_app) > 0) {
$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'] = $this->ivr_menu_exit_app;
$database->fields['dialplan_detail_data'] = $this->ivr_menu_exit_data;
$database->fields['dialplan_detail_order'] = '045';
$database->add();
}
}
//add the ivr menu //add the ivr menu
$database = new database;
if ($this->db) {
$database->db = $this->db;
}
$database->table = "v_ivr_menus"; $database->table = "v_ivr_menus";
$database->fields['domain_uuid'] = $this->domain_uuid; $database->fields['domain_uuid'] = $this->domain_uuid;
if (strlen($this->ivr_menu_extension) > 0) {
$database->fields['ivr_menu_extension'] = $this->ivr_menu_extension; $database->fields['ivr_menu_extension'] = $this->ivr_menu_extension;
$database->fields['dialplan_uuid'] = $this->dialplan_uuid; $database->fields['dialplan_uuid'] = $this->dialplan_uuid;
}
$database->fields['ivr_menu_uuid'] = $this->ivr_menu_uuid; $database->fields['ivr_menu_uuid'] = $this->ivr_menu_uuid;
$database->fields['ivr_menu_name'] = $this->ivr_menu_name; $database->fields['ivr_menu_name'] = $this->ivr_menu_name;
$database->fields['ivr_menu_greet_long'] = $this->ivr_menu_greet_long; $database->fields['ivr_menu_greet_long'] = $this->ivr_menu_greet_long;
@ -336,9 +214,6 @@ include "root.php";
//add the ivr menu option //add the ivr menu option
if (strlen($this->ivr_menu_option_action) > 0) { if (strlen($this->ivr_menu_option_action) > 0) {
$database = new database; $database = new database;
if ($this->db) {
$database->db = $this->db;
}
$database->table = "v_ivr_menu_options"; $database->table = "v_ivr_menu_options";
$database->fields['domain_uuid'] = $this->domain_uuid; $database->fields['domain_uuid'] = $this->domain_uuid;
$database->fields['ivr_menu_uuid'] = $this->ivr_menu_uuid; $database->fields['ivr_menu_uuid'] = $this->ivr_menu_uuid;
@ -351,23 +226,19 @@ include "root.php";
$database->add(); $database->add();
} }
//delete the dialplan context from memcache //update the dialplan
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); $this->dialplan();
if ($fp) {
$switch_cmd .= "memcache delete dialplan:".$_SESSION["context"]."@".$_SESSION['domain_name'];
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
} }
public function update() { public function update() {
//udate the ivr menu //create the database object
if (strlen($this->ivr_menu_option_action) == 0) {
//get the dialplan uuid
$database = new database; $database = new database;
if ($this->db) { if ($this->db) {
$database->db = $this->db; $database->db = $this->db;
} }
//get the dialplan uuid
$database->table = "v_ivr_menus"; $database->table = "v_ivr_menus";
$database->where[0]['name'] = 'domain_uuid'; $database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid; $database->where[0]['value'] = $this->domain_uuid;
@ -404,12 +275,14 @@ include "root.php";
$database->where[1]['value'] = $this->dialplan_uuid; $database->where[1]['value'] = $this->dialplan_uuid;
$database->where[1]['operator'] = '='; $database->where[1]['operator'] = '=';
$database->delete(); $database->delete();
//update the table to remove the dialplan_uuid //update the table to remove the dialplan_uuid
$this->dialplan_uuid = ''; $this->dialplan_uuid = '';
} }
} }
//update the ivr menu //update the ivr menu
if (strlen($this->ivr_menu_extension) > 0) {
if (strlen($this->dialplan_uuid) == 0) { if (strlen($this->dialplan_uuid) == 0) {
$this->dialplan_uuid = uuid(); $this->dialplan_uuid = uuid();
} }
@ -449,6 +322,127 @@ include "root.php";
$database->where[1]['value'] = $this->ivr_menu_uuid; $database->where[1]['value'] = $this->ivr_menu_uuid;
$database->where[1]['operator'] = '='; $database->where[1]['operator'] = '=';
$database->update(); $database->update();
}
//update the ivr menu option
if (strlen($this->ivr_menu_option_action) > 0) {
$database = new database;
$database->table = "v_ivr_menu_options";
$database->fields['ivr_menu_option_digits'] = $this->ivr_menu_option_digits;
$database->fields['ivr_menu_option_action'] = $this->ivr_menu_option_action;
$database->fields['ivr_menu_option_param'] = $this->ivr_menu_option_param;
$database->fields['ivr_menu_option_order'] = $this->ivr_menu_option_order;
$database->fields['ivr_menu_option_description'] = $this->ivr_menu_option_description;
$database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid;
$database->where[0]['operator'] = '=';
$database->where[1]['name'] = 'ivr_menu_uuid';
$database->where[1]['value'] = $this->ivr_menu_uuid;
$database->where[1]['operator'] = '=';
$database->where[2]['name'] = 'ivr_menu_option_uuid';
$database->where[2]['value'] = $this->ivr_menu_option_uuid;
$database->where[2]['operator'] = '=';
$database->update();
}
//update the dialplan
$this->dialplan();
}
function delete() {
//create the database object
$database = new database;
if ($this->db) {
$database->db = $this->db;
}
//start the transaction
//$count = $database->db->exec("BEGIN;");
//delete the ivr menu option
if (strlen($this->ivr_menu_option_uuid) > 0) {
$database->table = "v_ivr_menu_options";
$database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid;
$database->where[0]['operator'] = '=';
$database->where[1]['name'] = 'ivr_menu_option_uuid';
$database->where[1]['value'] = $this->ivr_menu_option_uuid;
$database->where[1]['operator'] = '=';
$database->delete();
unset($this->ivr_menu_option_uuid);
}
//delete the ivr menu
if (strlen($this->ivr_menu_option_uuid) == 0) {
//select the dialplan entries
$database->table = "v_ivr_menus";
$database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid;
$database->where[0]['operator'] = '=';
$database->where[1]['name'] = 'ivr_menu_uuid';
$database->where[1]['value'] = $this->ivr_menu_uuid;
$database->where[1]['operator'] = '=';
$result = $database->find();
foreach($result as $row) {
//set the uuid
$this->dialplan_uuid = $row['dialplan_uuid'];
//delete the child dialplan information
$database->table = "v_dialplan_details";
$database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid;
$database->where[0]['operator'] = '=';
$database->where[1]['name'] = 'dialplan_uuid';
$database->where[1]['value'] = $this->dialplan_uuid;
$database->where[1]['operator'] = '=';
$database->delete();
//delete the dialplan information
$database->table = "v_dialplans";
$database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid;
$database->where[0]['operator'] = '=';
$database->where[1]['name'] = 'dialplan_uuid';
$database->where[1]['value'] = $this->dialplan_uuid;
$database->where[1]['operator'] = '=';
$database->delete();
}
//delete child data
$database->table = "v_ivr_menu_options";
$database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid;
$database->where[0]['operator'] = '=';
$database->where[1]['name'] = 'ivr_menu_uuid';
$database->where[1]['value'] = $this->ivr_menu_uuid;
$database->where[1]['operator'] = '=';
$database->delete();
//delete parent data
$database->table = "v_ivr_menus";
$database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid;
$database->where[0]['operator'] = '=';
$database->where[1]['name'] = 'ivr_menu_uuid';
$database->where[1]['value'] = $this->ivr_menu_uuid;
$database->where[1]['operator'] = '=';
$database->delete();
//delete the dialplan context from memcache
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$switch_cmd = "memcache delete dialplan:".$_SESSION["context"];
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
//commit the transaction
//$count = $database->db->exec("COMMIT;");
}
}
public function dialplan() {
//create the database object
$database = new database;
if ($this->db) {
$database->db = $this->db;
}
//check to see if the dialplan entry exists //check to see if the dialplan entry exists
$dialplan = new dialplan; $dialplan = new dialplan;
@ -460,16 +454,17 @@ include "root.php";
if (!$dialplan_exists) { if (!$dialplan_exists) {
$database = new database; $database = new database;
$database->table = "v_dialplans"; $database->table = "v_dialplans";
$database->fields['domain_uuid'] = $this->domain_uuid;
$database->fields['dialplan_uuid'] = $this->dialplan_uuid;
$database->fields['dialplan_name'] = $this->ivr_menu_name; $database->fields['dialplan_name'] = $this->ivr_menu_name;
$database->fields['dialplan_order'] = '333'; $database->fields['dialplan_order'] = '333';
$database->fields['dialplan_context'] = $_SESSION['context']; $database->fields['dialplan_context'] = $_SESSION['context'];
$database->fields['dialplan_enabled'] = $this->ivr_menu_enabled; $database->fields['dialplan_enabled'] = $this->ivr_menu_enabled;
$database->fields['dialplan_description'] = $this->ivr_menu_description; $database->fields['dialplan_description'] = $this->ivr_menu_description;
$database->fields['app_uuid'] = $this->app_uuid; $database->fields['app_uuid'] = $this->app_uuid;
$database->fields['domain_uuid'] = $this->domain_uuid;
$database->fields['dialplan_uuid'] = $this->dialplan_uuid;
$database->add(); $database->add();
} }
//if the dialplan entry exists then update it //if the dialplan entry exists then update it
if ($dialplan_exists && strlen($this->ivr_menu_extension) > 0) { if ($dialplan_exists && strlen($this->ivr_menu_extension) > 0) {
//update the dialplan //update the dialplan
@ -590,8 +585,14 @@ include "root.php";
$database->fields['dialplan_uuid'] = $this->dialplan_uuid; $database->fields['dialplan_uuid'] = $this->dialplan_uuid;
$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
if ($_SESSION['ivr menu']['application']['text'] == "lua") {
$database->fields['dialplan_detail_type'] = 'lua'; $database->fields['dialplan_detail_type'] = 'lua';
$database->fields['dialplan_detail_data'] = 'ivr_menu.lua'; $database->fields['dialplan_detail_data'] = 'ivr_menu.lua';
}
else {
$database->fields['dialplan_detail_type'] = 'ivr';
$database->fields['dialplan_detail_data'] = $this->ivr_menu_uuid;
}
$database->fields['dialplan_detail_order'] = '040'; $database->fields['dialplan_detail_order'] = '040';
$database->add(); $database->add();
@ -606,115 +607,13 @@ include "root.php";
$database->fields['dialplan_detail_order'] = '045'; $database->fields['dialplan_detail_order'] = '045';
$database->add(); $database->add();
} }
}
//update the ivr menu option
if (strlen($this->ivr_menu_option_action) > 0) {
$database = new database;
$database->table = "v_ivr_menu_options";
$database->fields['ivr_menu_option_digits'] = $this->ivr_menu_option_digits;
$database->fields['ivr_menu_option_action'] = $this->ivr_menu_option_action;
$database->fields['ivr_menu_option_param'] = $this->ivr_menu_option_param;
$database->fields['ivr_menu_option_order'] = $this->ivr_menu_option_order;
$database->fields['ivr_menu_option_description'] = $this->ivr_menu_option_description;
$database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid;
$database->where[0]['operator'] = '=';
$database->where[1]['name'] = 'ivr_menu_uuid';
$database->where[1]['value'] = $this->ivr_menu_uuid;
$database->where[1]['operator'] = '=';
$database->where[2]['name'] = 'ivr_menu_option_uuid';
$database->where[2]['value'] = $this->ivr_menu_option_uuid;
$database->where[2]['operator'] = '=';
$database->update();
}
}
function delete() {
//create the database object
$database = new database;
if ($this->db) {
$database->db = $this->db;
}
//start the transaction
//$count = $database->db->exec("BEGIN;");
//delete the ivr menu option
if (strlen($this->ivr_menu_option_uuid) > 0) {
$database->table = "v_ivr_menu_options";
$database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid;
$database->where[0]['operator'] = '=';
$database->where[1]['name'] = 'ivr_menu_option_uuid';
$database->where[1]['value'] = $this->ivr_menu_option_uuid;
$database->where[1]['operator'] = '=';
$database->delete();
unset($this->ivr_menu_option_uuid);
}
//delete the ivr menu
if (strlen($this->ivr_menu_option_uuid) == 0) {
//select the dialplan entries
$database->table = "v_ivr_menus";
$database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid;
$database->where[0]['operator'] = '=';
$database->where[1]['name'] = 'ivr_menu_uuid';
$database->where[1]['value'] = $this->ivr_menu_uuid;
$database->where[1]['operator'] = '=';
$result = $database->find();
foreach($result as $row) {
$this->dialplan_uuid = $row['dialplan_uuid'];
//delete the child dialplan information
$database->table = "v_dialplan_details";
$database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid;
$database->where[0]['operator'] = '=';
$database->where[1]['name'] = 'dialplan_uuid';
$database->where[1]['value'] = $this->dialplan_uuid;
$database->where[1]['operator'] = '=';
$database->delete();
//delete the dialplan information
$database->table = "v_dialplans";
$database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid;
$database->where[0]['operator'] = '=';
$database->where[1]['name'] = 'dialplan_uuid';
$database->where[1]['value'] = $this->dialplan_uuid;
$database->where[1]['operator'] = '=';
$database->delete();
}
//delete child data
$database->table = "v_ivr_menu_options";
$database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid;
$database->where[0]['operator'] = '=';
$database->where[1]['name'] = 'ivr_menu_uuid';
$database->where[1]['value'] = $this->ivr_menu_uuid;
$database->where[1]['operator'] = '=';
$database->delete();
//delete parent data
$database->table = "v_ivr_menus";
$database->where[0]['name'] = 'domain_uuid';
$database->where[0]['value'] = $this->domain_uuid;
$database->where[0]['operator'] = '=';
$database->where[1]['name'] = 'ivr_menu_uuid';
$database->where[1]['value'] = $this->ivr_menu_uuid;
$database->where[1]['operator'] = '=';
$database->delete();
//delete the dialplan context from memcache //delete the dialplan context from memcache
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) { if ($fp) {
$switch_cmd = "memcache delete dialplan:".$_SESSION["context"]; $switch_cmd .= "memcache delete dialplan:".$_SESSION["context"]."@".$_SESSION['domain_name'];
$switch_result = event_socket_request($fp, 'api '.$switch_cmd); $switch_result = event_socket_request($fp, 'api '.$switch_cmd);
} }
//commit the transaction
//$count = $database->db->exec("COMMIT;");
}
} }
function get_xml(){ function get_xml(){
@ -878,8 +777,6 @@ include "root.php";
return $xml; return $xml;
} }
function xml_save_all() {
}
} }
?> ?>

View File

@ -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):
@ -332,6 +332,7 @@ else {
case "api" : echo "API"; break; case "api" : echo "API"; break;
case "cdr" : echo "CDR"; break; case "cdr" : echo "CDR"; break;
case "ldap" : echo "LDAP"; break; case "ldap" : echo "LDAP"; break;
case "ivr menu" : echo "IVR Menu"; break;
default: echo ucwords(str_replace("_", " ", $row['default_setting_category'])); default: echo ucwords(str_replace("_", " ", $row['default_setting_category']));
} }
echo "</b>\n"; echo "</b>\n";