Changeset 13439 for modules/branches
- Timestamp:
- 02/13/12 22:41:59 (1 year ago)
- Files:
-
- modules/branches/2.10/ivr/assets/js/ivr.js (modified) (4 diffs)
- modules/branches/2.10/ivr/functions.inc.php (modified) (11 diffs)
- modules/branches/2.10/ivr/install.php (modified) (3 diffs)
- modules/branches/2.10/ivr/module.xml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.10/ivr/assets/js/ivr.js
r12991 r13439 83 83 //always disable hidden elements so that they dont trigger validation 84 84 function invalid_elements() { 85 var invalid_elements = $('#invalid_retry_recording, #invalid_recording, [name=gotoinvalid]');85 var invalid_elements = $('#invalid_retry_recording, #invalid_recording, #invalid_append_announce, [name=gotoinvalid]'); 86 86 var invalid_element_tr = invalid_elements.parent().parent(); 87 87 switch ($('#invalid_loops').val()) { … … 94 94 invalid_element_tr.show(); 95 95 $('#invalid_retry_recording').parent().parent().hide(); 96 $('#invalid_append_announce').parent().parent().hide(); 96 97 break; 97 98 default: … … 104 105 //always disable hidden elements so that they dont trigger validation 105 106 function timeout_elements() { 106 var timeout_elements = $('#timeout_retry_recording, #timeout_recording, [name=gototimeout]');107 var timeout_elements = $('#timeout_retry_recording, #timeout_recording, #timeout_append_announce, [name=gototimeout]'); 107 108 var timeout_element_tr = timeout_elements.parent().parent(); 108 109 switch ($('#timeout_loops').val()) { … … 114 115 timeout_elements.removeAttr('disabled') 115 116 timeout_element_tr.show(); 116 $('#timeout_retry_recording').attr('disabled', 'disabled').parent().parent().hide(); 117 $('#timeout_retry_recording').parent().parent().hide(); 118 $('#timeout_append_announce').parent().parent().hide(); 117 119 default: 118 120 timeout_elements.removeAttr('disabled') modules/branches/2.10/ivr/functions.inc.php
r13397 r13439 83 83 $ext->add($c, 's', '', new ext_answer('')); 84 84 $ext->add($c, 's', '', new ext_wait('1')); 85 86 $ivr_announcement = recordings_get_file($ivr['announcement']); 87 $ext->add($c, 's', '', new ext_set('IVR_MSG', $ivr_announcement)); 88 85 89 $ext->add($c, 's', 'start', new ext_digittimeout(3)); 86 90 //$ext->add($ivr_id, 's', '', new ext_responsetimeout($ivr['timeout_time'])); 87 91 88 $ext->add($c, 's', '', new ext_ background(recordings_get_file($ivr['announcement'])));92 $ext->add($c, 's', '', new ext_execif('$["${IVR_MSG}" != ""]','Background','${IVR_MSG}')); 89 93 $ext->add($c, 's', '', new ext_waitexten($ivr['timeout_time'])); 90 94 … … 127 131 switch ($ivr['invalid_retry_recording']) { 128 132 case 'default': 129 $ ext->add($c, 'i', '', new ext_playback('no-valid-responce-pls-try-again'));133 $invalid_annoucement = 'no-valid-responce-pls-try-again'; 130 134 break; 131 135 case '': 136 $invalid_annoucement = ''; 132 137 break; 133 138 default: 134 $ ext->add($c, 'i', '', new ext_playback(recordings_get_file($ivr['invalid_retry_recording'])));139 $invalid_annoucement = recordings_get_file($ivr['invalid_retry_recording']); 135 140 break; 136 141 } 137 142 143 if ($ivr['invalid_append_announce'] || $invalid_annoucement == '') { 144 $invalid_annoucement .= '&' . $ivr_announcement; 145 } 146 $ext->add($c, 'i', '', new ext_set('IVR_MSG', trim($invalid_annoucement, '&'))); 138 147 $ext->add($c, 'i', '', new ext_goto('s,start')); 139 148 } … … 154 163 } 155 164 $ext->add($c, 'i', $label, new ext_goto($ivr['invalid_destination'])); 165 } else { 166 // If no invalid destination provided we need to do something 167 $ext->add($c, 'i', '', new ext_playback('sorry-youre-having-problems')); 168 $ext->add($c, 'i', '', new ext_goto('1','hang')); 156 169 } 157 170 … … 164 177 switch ($ivr['timeout_retry_recording']) { 165 178 case 'default': 166 $ ext->add($c, 't', '', new ext_playback('no-valid-responce-pls-try-again'));179 $timeout_annoucement = 'no-valid-responce-pls-try-again'; 167 180 break; 168 181 case '': 182 $timeout_annoucement = ''; 169 183 break; 170 184 default: 171 $ext->add($c, 't', '', 172 new ext_playback(recordings_get_file($ivr['timeout_retry_recording']))); 185 $timeout_annoucement = recordings_get_file($ivr['timeout_retry_recording']); 173 186 break; 174 187 } 175 188 189 if ($ivr['timeout_append_announce'] || $timeout_annoucement == '') { 190 $timeout_annoucement .= '&' . $ivr_announcement; 191 } 192 $ext->add($c, 't', '', new ext_set('IVR_MSG', trim($timeout_annoucement, '&'))); 176 193 $ext->add($c, 't', '', new ext_goto('s,start')); 177 194 } … … 192 209 } 193 210 $ext->add($c, 't', $label, new ext_goto($ivr['timeout_destination'])); 211 } else { 212 // If no invalid destination provided we need to do something 213 $ext->add($c, 't', '', new ext_playback('sorry-youre-having-problems')); 214 $ext->add($c, 't', '', new ext_goto('1','hang')); 194 215 } 195 216 … … 199 220 $ext->add($c, 'return', '', new ext_setvar('_IVR_CONTEXT', '${CONTEXT}')); 200 221 $ext->add($c, 'return', '', new ext_setvar('_IVR_CONTEXT_${CONTEXT}', '${IVR_CONTEXT_${CONTEXT}}')); 222 $ext->add($c, 'return', '', new ext_set('IVR_MSG', $ivr_announcement)); 201 223 $ext->add($c, 'return', '', new ext_goto('s,start')); 202 224 } … … 383 405 new gui_selectbox('invalid_retry_recording', $currentcomponent->getoptlist('recordings'), 384 406 $ivr['invalid_retry_recording'], _('Invalid Retry Recording'), _('Prompt to be played when an invalid/unmatched response is received, before prompting the caller to try again'), false)); 407 408 $currentcomponent->addguielem($section, 409 new gui_checkbox('invalid_append_announce', $ivr['invalid_append_announce'], _('Append Original Annoucement'), _('After playing the Invalid Retry Recording the system will replay the main IVR Annoucement'))); 410 385 411 $currentcomponent->addguielem($section, 386 412 new gui_selectbox('invalid_recording', $currentcomponent->getoptlist('recordings'), … … 397 423 new gui_selectbox('timeout_retry_recording', $currentcomponent->getoptlist('recordings'), 398 424 $ivr['timeout_retry_recording'], _('Timeout Retry Recording'), _('Prompt to be played when an invalid/unmatched response is received, before prompting the caller to try again'), false)); 425 426 $currentcomponent->addguielem($section, 427 new gui_checkbox('timeout_append_announce', $ivr['timeout_append_announce'], _('Append Original Annoucement'), _('After playing the Timeout Retry Recording the system will replay the main IVR Annoucement'))); 428 399 429 $currentcomponent->addguielem($section, 400 430 new gui_selectbox('timeout_recording', $currentcomponent->getoptlist('recordings'), … … 448 478 'invalid_destination', 'invalid_recording', 449 479 'retvm', 'timeout_time', 'timeout_recording', 450 'timeout_retry_recording', 'timeout_destination', 'timeout_loops'); 480 'timeout_retry_recording', 'timeout_destination', 'timeout_loops', 481 'timeout_append_announce', 'invalid_append_announce'); 451 482 foreach($get_var as $var){ 452 483 $vars[$var] = isset($_REQUEST[$var]) ? $_REQUEST[$var] : ''; 453 484 } 485 $vars['timeout_append_announce'] = empty($vars['timeout_append_announce']) ? '0' : '1'; 486 $vars['invalid_append_announce'] = empty($vars['invalid_append_announce']) ? '0' : '1'; 454 487 455 488 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; … … 488 521 invalid_destination, invalid_recording, 489 522 retvm, timeout_time, timeout_recording, 490 timeout_retry_recording, timeout_destination, timeout_loops) 491 VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; 523 timeout_retry_recording, timeout_destination, timeout_loops, 524 timeout_append_announce, invalid_append_announce) 525 VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; 492 526 $foo = $db->query($sql, $vals); 493 527 if($db->IsError($foo)) { … … 500 534 invalid_destination, invalid_recording, 501 535 retvm, timeout_time, timeout_recording, 502 timeout_retry_recording, timeout_destination, timeout_loops) 503 VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; 536 timeout_retry_recording, timeout_destination, timeout_loops, 537 timeout_append_announce, invalid_append_announce) 538 VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; 504 539 505 540 $foo = $db->query($sql, $vals); modules/branches/2.10/ivr/install.php
r13091 r13439 23 23 `timeout_retry_recording` varchar(25) default NULL, 24 24 `timeout_destination` varchar(50) default NULL, 25 `timeout_loops` varchar(10) default NULL)" 25 `timeout_loops` varchar(10) default NULL, 26 `timeout_append_announce` tinyint(1) NOT NULL default '1', 27 `invalid_append_announce` tinyint(1) NOT NULL default '1')" 26 28 ); 27 29 } else { … … 43 45 `timeout_destination` varchar(50) default NULL, 44 46 `timeout_loops` varchar(10) default NULL, 47 `timeout_append_announce` tinyint(1) NOT NULL default '1', 48 `invalid_append_announce` tinyint(1) NOT NULL default '1', 45 49 PRIMARY KEY (`id`))" 46 50 ); … … 423 427 } 424 428 429 // Add timeout/invalid_append_announce if not there 430 // 431 outn(_("Checking for timeout_append_announce..")); 432 $sql = "SELECT timeout_append_announce FROM ivr_details"; 433 $check = $db->getRow($sql, DB_FETCHMODE_ASSOC); 434 if($db->IsError($check)) { 435 // Add timeout_append_announce field 436 // 437 $sql = "ALTER TABLE ivr_details ADD timeout_append_announce tinyint(1) NOT NULL DEFAULT '1'"; 438 $result = $db->query($sql); 439 if($db->IsError($result)) { 440 out(_("fatal error")); 441 die_freepbx($result->getDebugInfo()); 442 } else { 443 out(_("added")); 444 } 445 } else { 446 out(_("not needed")); 447 } 448 449 outn(_("Checking for invalid_append_announce..")); 450 $sql = "SELECT invalid_append_announce FROM ivr_details"; 451 $check = $db->getRow($sql, DB_FETCHMODE_ASSOC); 452 if($db->IsError($check)) { 453 // Add invalid_append_announce field 454 // 455 $sql = "ALTER TABLE ivr_details ADD invalid_append_announce tinyint(1) NOT NULL DEFAULT '1'"; 456 $result = $db->query($sql); 457 if($db->IsError($result)) { 458 out(_("fatal error")); 459 die_freepbx($result->getDebugInfo()); 460 } else { 461 out(_("added")); 462 } 463 } else { 464 out(_("not needed")); 465 } 466 425 467 ?> modules/branches/2.10/ivr/module.xml
r13192 r13439 3 3 <repo>standard</repo> 4 4 <name>IVR</name> 5 <version>2.10.0. 3</version>5 <version>2.10.0.4</version> 6 6 <publisher>FreePBX</publisher> 7 7 <license>GPLv2+</license> … … 11 11 </description> 12 12 <changelog> 13 *2.10.0.4* #5576 13 14 *2.10.0.3* #5515 14 15 *2.10.0.2* misc bug fixes
