Add ringback to the IVR Menu.
This commit is contained in:
parent
d42d3cced0
commit
77db11d084
|
|
@ -9,8 +9,8 @@
|
|||
<action application="bind_meta_app" data="2 ab s record_session::$${recordings_dir}/archive/${strftime(%Y)}/${strftime(%b)}/${strftime(%d)}/${uuid}.wav"/>
|
||||
<action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/>
|
||||
<action application="bind_meta_app" data="4 b s execute_extension::att_xfer XML features"/>
|
||||
<action application="set" data="ringback=${us-ring}"/>
|
||||
<action application="set" data="transfer_ringback=$${hold_music}"/>
|
||||
<!--<action application="set" data="ringback=${us-ring}"/>-->
|
||||
<!--<action application="set" data="transfer_ringback=$${hold_music}"/>-->
|
||||
<action application="set" data="call_timeout=30"/>
|
||||
<action application="set" data="hangup_after_bridge=true"/>
|
||||
<!--<action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION"/> -->
|
||||
|
|
|
|||
|
|
@ -469,12 +469,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='hunt_group_ringback'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($hunt_group_ringback == "ring") {
|
||||
echo " <option value='us-ring' selected='selected'>us-ring</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='us-ring'>us-ring</option>\n";
|
||||
}
|
||||
if ($hunt_group_ringback == "us-ring") {
|
||||
echo " <option value='us-ring' selected='selected'>us-ring</option>\n";
|
||||
}
|
||||
|
|
@ -507,7 +501,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
}
|
||||
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 "Defines what the caller will hear while the destination is being called. The choices are music (music on hold) ring (ring tone.) default: music \n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -153,6 +153,10 @@
|
|||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'ivr_menu_ringback';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'ivr_menu_enabled';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ if (count($_POST)>0) {
|
|||
$ivr_menu_max_timeouts = check_str($_POST["ivr_menu_max_timeouts"]);
|
||||
$ivr_menu_digit_len = check_str($_POST["ivr_menu_digit_len"]);
|
||||
$ivr_menu_direct_dial = check_str($_POST["ivr_menu_direct_dial"]);
|
||||
$ivr_menu_ringback = check_str($_POST["ivr_menu_ringback"]);
|
||||
$ivr_menu_enabled = check_str($_POST["ivr_menu_enabled"]);
|
||||
$ivr_menu_description = check_str($_POST["ivr_menu_description"]);
|
||||
|
||||
|
|
@ -150,6 +151,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
if (strlen($ivr_menu_max_timeouts) == 0) { $msg .= "Please provide: Max Timeouts<br>\n"; }
|
||||
if (strlen($ivr_menu_digit_len) == 0) { $msg .= "Please provide: Digit Length<br>\n"; }
|
||||
if (strlen($ivr_menu_direct_dial) == 0) { $msg .= "Please provide: Direct Dial<br>\n"; }
|
||||
//if (strlen($ivr_menu_ringback) == 0) { $msg .= "Please provide: Ringback<br>\n"; }
|
||||
if (strlen($ivr_menu_enabled) == 0) { $msg .= "Please provide: Enabled<br>\n"; }
|
||||
//if (strlen($ivr_menu_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
|
@ -193,7 +195,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
$ivr->ivr_menu_digit_len = $ivr_menu_digit_len;
|
||||
$ivr->ivr_menu_digit_len = $ivr_menu_digit_len;
|
||||
$ivr->ivr_menu_direct_dial = $ivr_menu_direct_dial;
|
||||
$ivr->ivr_menu_direct_dial = $ivr_menu_direct_dial;
|
||||
$ivr->ivr_menu_ringback = $ivr_menu_ringback;
|
||||
$ivr->ivr_menu_enabled = $ivr_menu_enabled;
|
||||
$ivr->ivr_menu_description = $ivr_menu_description;
|
||||
|
||||
|
|
@ -268,6 +270,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
$ivr_menu_max_timeouts = $row["ivr_menu_max_timeouts"];
|
||||
$ivr_menu_digit_len = $row["ivr_menu_digit_len"];
|
||||
$ivr_menu_direct_dial = $row["ivr_menu_direct_dial"];
|
||||
$ivr_menu_ringback = $row["ivr_menu_ringback"];
|
||||
$ivr_menu_enabled = $row["ivr_menu_enabled"];
|
||||
$ivr_menu_description = $row["ivr_menu_description"];
|
||||
|
||||
|
|
@ -290,6 +293,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
if (strlen($ivr_menu_max_timeouts) == 0) { $ivr_menu_max_timeouts = '3'; }
|
||||
if (strlen($ivr_menu_digit_len) == 0) { $ivr_menu_digit_len = '5'; }
|
||||
if (strlen($ivr_menu_direct_dial) == 0) { $ivr_menu_direct_dial = 'false'; }
|
||||
if (strlen($ivr_menu_ringback) == 0) { $ivr_menu_ringback = 'music'; }
|
||||
if (strlen($ivr_menu_enabled) == 0) { $ivr_menu_enabled = 'true'; }
|
||||
|
||||
//content
|
||||
|
|
@ -610,6 +614,49 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Ring Back:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='ivr_menu_ringback'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($ivr_menu_ringback == "us-ring") {
|
||||
echo " <option value='us-ring' selected='selected'>us-ring</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='us-ring'>us-ring</option>\n";
|
||||
}
|
||||
if ($ivr_menu_ringback == "fr-ring") {
|
||||
echo " <option value='fr-ring' selected='selected'>fr-ring</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='fr-ring'>fr-ring</option>\n";
|
||||
}
|
||||
if ($ivr_menu_ringback == "uk-ring") {
|
||||
echo " <option value='uk-ring' selected='selected'>uk-ring</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='uk-ring'>uk-ring</option>\n";
|
||||
}
|
||||
if ($ivr_menu_ringback == "rs-ring") {
|
||||
echo " <option value='rs-ring' selected='selected'>rs-ring</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='rs-ring'>rs-ring</option>\n";
|
||||
}
|
||||
if ($ivr_menu_ringback == "music") {
|
||||
echo " <option value='music' selected='selected'>music</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='music'>music</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Defines what the caller will hear while the destination is being called. The choices are music (music on hold) ring (ring tone.) default: music \n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
//--- begin: show_advanced -----------------------
|
||||
echo "<tr>\n";
|
||||
echo "<td style='padding: 0px;' colspan='2' class='' valign='top' align='left' nowrap>\n";
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ require_once "includes/classes/switch_dialplan.php";
|
|||
public $ivr_menu_max_timeouts;
|
||||
public $ivr_menu_digit_len;
|
||||
public $ivr_menu_direct_dial;
|
||||
public $ivr_menu_ringback;
|
||||
public $ivr_menu_enabled;
|
||||
public $ivr_menu_description;
|
||||
public $ivr_menu_option_uuid;
|
||||
|
|
@ -223,6 +224,36 @@ require_once "includes/classes/switch_dialplan.php";
|
|||
$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;
|
||||
|
|
@ -235,7 +266,7 @@ require_once "includes/classes/switch_dialplan.php";
|
|||
else {
|
||||
$database->fields['dialplan_detail_data'] = $this->ivr_menu_name;
|
||||
}
|
||||
$database->fields['dialplan_detail_order'] = '025';
|
||||
$database->fields['dialplan_detail_order'] = '035';
|
||||
$database->add();
|
||||
|
||||
if (strlen($this->ivr_menu_exit_app) > 0) {
|
||||
|
|
@ -246,7 +277,7 @@ require_once "includes/classes/switch_dialplan.php";
|
|||
$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'] = '030';
|
||||
$database->fields['dialplan_detail_order'] = '040';
|
||||
$database->add();
|
||||
}
|
||||
}
|
||||
|
|
@ -284,7 +315,7 @@ require_once "includes/classes/switch_dialplan.php";
|
|||
$database->fields['ivr_menu_digit_len'] = $this->ivr_menu_digit_len;
|
||||
$database->fields['ivr_menu_digit_len'] = $this->ivr_menu_digit_len;
|
||||
$database->fields['ivr_menu_direct_dial'] = $this->ivr_menu_direct_dial;
|
||||
$database->fields['ivr_menu_direct_dial'] = $this->ivr_menu_direct_dial;
|
||||
$database->fields['ivr_menu_ringback'] = $this->ivr_menu_ringback;
|
||||
$database->fields['ivr_menu_enabled'] = $this->ivr_menu_enabled;
|
||||
$database->fields['ivr_menu_description'] = $this->ivr_menu_description;
|
||||
$database->add();
|
||||
|
|
@ -388,7 +419,7 @@ require_once "includes/classes/switch_dialplan.php";
|
|||
$database->fields['ivr_menu_digit_len'] = $this->ivr_menu_digit_len;
|
||||
$database->fields['ivr_menu_digit_len'] = $this->ivr_menu_digit_len;
|
||||
$database->fields['ivr_menu_direct_dial'] = $this->ivr_menu_direct_dial;
|
||||
$database->fields['ivr_menu_direct_dial'] = $this->ivr_menu_direct_dial;
|
||||
$database->fields['ivr_menu_ringback'] = $this->ivr_menu_ringback;
|
||||
$database->fields['ivr_menu_enabled'] = $this->ivr_menu_enabled;
|
||||
$database->fields['ivr_menu_description'] = $this->ivr_menu_description;
|
||||
$database->where[0]['name'] = 'domain_uuid';
|
||||
|
|
@ -494,6 +525,36 @@ require_once "includes/classes/switch_dialplan.php";
|
|||
$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;
|
||||
|
|
@ -506,7 +567,7 @@ require_once "includes/classes/switch_dialplan.php";
|
|||
else {
|
||||
$database->fields['dialplan_detail_data'] = $this->ivr_menu_name;
|
||||
}
|
||||
$database->fields['dialplan_detail_order'] = '025';
|
||||
$database->fields['dialplan_detail_order'] = '035';
|
||||
$database->add();
|
||||
|
||||
if (strlen($this->ivr_menu_exit_app) > 0) {
|
||||
|
|
@ -517,7 +578,7 @@ require_once "includes/classes/switch_dialplan.php";
|
|||
$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'] = '030';
|
||||
$database->fields['dialplan_detail_order'] = '040';
|
||||
$database->add();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue