Changeset 3703
- Timestamp:
- 02/05/07 13:02:03 (6 years ago)
- Files:
-
- modules/branches/2.3 (modified) (1 prop)
- modules/branches/2.3/announcement/functions.inc.php (modified) (7 diffs)
- modules/branches/2.3/announcement/install.php (modified) (2 diffs)
- modules/branches/2.3/announcement/install.sql (modified) (1 diff)
- modules/branches/2.3/announcement/module.xml (modified) (1 diff)
- modules/branches/2.3/announcement/page.announcement.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.3
- Property svnmerge-integrated changed from /modules/branches/2.2:1-3588,3615-3635,3637-3638,3640,3674,3680,3686,3692 to /modules/branches/2.2:1-3588,3615-3635,3637-3638,3640,3674,3680,3686,3692,3702
modules/branches/2.3/announcement/functions.inc.php
r3681 r3703 14 14 case 'asterisk': 15 15 foreach (announcement_list() as $row) { 16 $ext->add('app-announcement-'.$row[0], 's', '', new ext_answer(''));17 $ext->add('app-announcement-'.$row[0], 's', '', new ext_wait('1'));18 16 $ext->add('app-announcement-'.$row[0], 's', '', new ext_noop('Playing announcement '.$row[1])); 17 if (! $row[6]) { 18 $ext->add('app-announcement-'.$row[0], 's', '', new ext_answer('')); 19 $ext->add('app-announcement-'.$row[0], 's', '', new ext_wait('1')); 20 } 19 21 if ($row[3]) { 20 22 // allow skip 21 $ext->add('app-announcement-'.$row[0], 's', '', new ext_background($row[2] ));23 $ext->add('app-announcement-'.$row[0], 's', '', new ext_background($row[2].'|n')); 22 24 23 25 $ext->add('app-announcement-'.$row[0], '_X', '', new ext_noop('User skipped announcement')); … … 28 30 } 29 31 } else { 30 $ext->add('app-announcement-'.$row[0], 's', '', new ext_playback($row[2] ));32 $ext->add('app-announcement-'.$row[0], 's', '', new ext_playback($row[2].'|noanswer')); 31 33 } 32 34 … … 44 46 function announcement_list() { 45 47 global $db; 46 $sql = "SELECT announcement_id, description, recording, allow_skip, post_dest, return_ivr FROM announcement ORDER BY description ";48 $sql = "SELECT announcement_id, description, recording, allow_skip, post_dest, return_ivr, noanswer FROM announcement ORDER BY description "; 47 49 $results = $db->getAll($sql); 48 50 if(DB::IsError($results)) { … … 54 56 function announcement_get($announcement_id) { 55 57 global $db; 56 $sql = "SELECT announcement_id, description, recording, allow_skip, post_dest, return_ivr FROM announcement WHERE announcement_id = ".addslashes($announcement_id);58 $sql = "SELECT announcement_id, description, recording, allow_skip, post_dest, return_ivr, noanswer FROM announcement WHERE announcement_id = ".addslashes($announcement_id); 57 59 $row = $db->getRow($sql); 58 60 if(DB::IsError($row)) { … … 62 64 } 63 65 64 function announcement_add($description, $recording, $allow_skip, $post_dest, $return_ivr ) {66 function announcement_add($description, $recording, $allow_skip, $post_dest, $return_ivr, $noanswer) { 65 67 global $db; 66 $sql = "INSERT INTO announcement (description, recording, allow_skip, post_dest, return_ivr ) VALUES (".68 $sql = "INSERT INTO announcement (description, recording, allow_skip, post_dest, return_ivr, noanswer) VALUES (". 67 69 "'".addslashes($description)."', ". 68 70 "'".addslashes($recording)."', ". 69 71 "'".($allow_skip ? 1 : 0)."', ". 70 72 "'".addslashes($post_dest)."', ". 71 "'".($return_ivr ? 1 : 0)."')"; 73 "'".($return_ivr ? 1 : 0)."', ". 74 "'".($noanswer ? 1 : 0)."')"; 72 75 $result = $db->query($sql); 73 76 if(DB::IsError($result)) { … … 86 89 } 87 90 88 function announcement_edit($announcement_id, $description, $recording, $allow_skip, $post_dest, $return_ivr ) {91 function announcement_edit($announcement_id, $description, $recording, $allow_skip, $post_dest, $return_ivr, $noanswer) { 89 92 global $db; 90 93 $sql = "UPDATE announcement SET ". … … 93 96 "allow_skip = '".($allow_skip ? 1 : 0)."', ". 94 97 "post_dest = '".addslashes($post_dest)."', ". 95 "return_ivr = '".($return_ivr ? 1 : 0)."' ". 98 "return_ivr = '".($return_ivr ? 1 : 0)."', ". 99 "noanswer = '".($noanswer ? 1 : 0)."' ". 96 100 "WHERE announcement_id = ".addslashes($announcement_id); 97 101 $result = $db->query($sql); modules/branches/2.3/announcement/install.php
r3681 r3703 3 3 global $db; 4 4 5 // Version 2.1 upgrade. Add support for ${DIALOPTS} override, playing MOH5 // Version 0.3 adds auto-return to IVR 6 6 $sql = "SELECT return_ivr FROM announcement"; 7 7 $check = $db->getRow($sql, DB_FETCHMODE_ASSOC); … … 13 13 } 14 14 15 // Version 0.4 adds auto-return to IVR 16 $sql = "SELECT noanswer FROM announcement"; 17 $check = $db->getRow($sql, DB_FETCHMODE_ASSOC); 18 if(DB::IsError($check)) { 19 // add new field 20 $sql = "ALTER TABLE announcement ADD noanswer TINYINT(1) NOT NULL DEFAULT 0;"; 21 $result = $db->query($sql); 22 if(DB::IsError($result)) { die($result->getDebugInfo()); } 23 } 24 15 25 ?> modules/branches/2.3/announcement/install.sql
r3681 r3703 5 5 allow_skip INT, 6 6 post_dest VARCHAR( 255 ) , 7 return_ivr TINYINT(1) NOT NULL DEFAULT 0 7 return_ivr TINYINT(1) NOT NULL DEFAULT 0, 8 noanswer TINYINT(1) NOT NULL DEFAULT 0 8 9 ); modules/branches/2.3/announcement/module.xml
r3685 r3703 2 2 <rawname>announcement</rawname> 3 3 <name>Announcements</name> 4 <version>0. 3</version>4 <version>0.4</version> 5 5 <changelog> 6 *0.4* Added Don't Answer option to not answer the channel (and playback early media if supported) 6 7 *0.3* Added support to return to calling IVR 7 8 *0.2* First Module Intro modules/branches/2.3/announcement/page.announcement.php
r3687 r3703 22 22 $allow_skip = isset($_POST['allow_skip']) ? $_POST['allow_skip'] : 0; 23 23 $return_ivr = isset($_POST['return_ivr']) ? $_POST['return_ivr'] : 0; 24 $noanswer = isset($_POST['noanswer']) ? $_POST['noanswer'] : 0; 24 25 $post_dest = isset($_POST['post_dest']) ? $_POST['post_dest'] : ''; 25 26 … … 32 33 switch ($action) { 33 34 case 'add': 34 announcement_add($description, $recording, $allow_skip, $post_dest, $return_ivr );35 announcement_add($description, $recording, $allow_skip, $post_dest, $return_ivr, $noanswer); 35 36 needreload(); 36 37 redirect_standard(); 37 38 break; 38 39 case 'edit': 39 announcement_edit($announcement_id, $description, $recording, $allow_skip, $post_dest, $return_ivr );40 announcement_edit($announcement_id, $description, $recording, $allow_skip, $post_dest, $return_ivr, $noanswer); 40 41 needreload(); 41 42 redirect_standard('extdisplay'); … … 78 79 $post_dest = $row[4]; 79 80 $return_ivr = $row[5]; 81 $noanswer = $row[6]; 80 82 81 83 } … … 119 121 <td><input type="checkbox" name="return_ivr" value="1" <?php echo ($return_ivr ? 'CHECKED' : ''); ?> /></td> 120 122 </tr> 123 <tr> 124 <td><a href="#" class="info"><?php echo _("Don't Answer Channel")?><span><?php echo _("Check this to keep the channel from explicitly being answered. When checked, the message will be played and if the channel is not already answered it will be delivered as early media if the channel supports that. When not checked, the channel is answered followed by a 1 second delay. When using an annoucement from an IVR or other sources that have already answered the channel, that 1 second delay may not be desired.")?></span></a></td> 125 <td><input type="checkbox" name="noanswer" value="1" <?php echo ($noanswer ? 'CHECKED' : ''); ?> /></td> 126 </tr> 121 127 122 128 <tr><td colspan="2"><br><h5><?php echo _("Destination after playback")?>:<hr></h5></td></tr>
