Changeset 5858
- Timestamp:
- 07/01/08 21:08:32 (2 months ago)
- Files:
-
- modules/branches/2.5/donotdisturb/functions.inc.php (modified) (5 diffs)
- modules/branches/2.5/donotdisturb/install.php (modified) (1 diff)
- modules/branches/2.5/donotdisturb/module.xml (modified) (1 diff)
- modules/branches/2.5/donotdisturb/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.5/donotdisturb/functions.inc.php
r4041 r5858 8 8 switch($engine) { 9 9 case "asterisk": 10 11 // If Using DND then set this so AGI scripts can determine 12 // 13 if ($amp_conf['USEDEVSTATE']) { 14 $ext->addGlobal('DNDDEVSTATE','TRUE'); 15 } 16 10 17 if (is_array($featurelist = featurecodes_getModuleFeatures($modulename))) { 11 18 foreach($featurelist as $item) { … … 31 38 function donotdisturb_dnd_on($c) { 32 39 global $ext; 40 global $amp_conf; 33 41 34 42 $id = "app-dnd-on"; // The context to be included … … 40 48 $ext->add($id, $c, '', new ext_macro('user-callerid')); // $cmd,n,Macro(user-callerid) 41 49 $ext->add($id, $c, '', new ext_setvar('DB(DND/${AMPUSER})', 'YES')); // $cmd,n,Set(...=YES) 50 if ($amp_conf['USEDEVSTATE']) { 51 $ext->add($id, $c, '', new ext_setvar('DEVSTATE(Custom:DND${AMPUSER})', 'BUSY')); // $cmd,n,Set(...=YES) 52 } 42 53 $ext->add($id, $c, '', new ext_playback('do-not-disturb&activated')); // $cmd,n,Playback(...) 43 54 $ext->add($id, $c, '', new ext_macro('hangupcall')); // $cmd,n,Macro(user-callerid) … … 46 57 function donotdisturb_dnd_off($c) { 47 58 global $ext; 59 global $amp_conf; 48 60 49 61 $id = "app-dnd-off"; // The context to be included … … 55 67 $ext->add($id, $c, '', new ext_macro('user-callerid')); // $cmd,n,Macro(user-callerid) 56 68 $ext->add($id, $c, '', new ext_dbdel('DND/${AMPUSER}')); // $cmd,n,DBdel(..) 69 if ($amp_conf['USEDEVSTATE']) { 70 $ext->add($id, $c, '', new ext_setvar('DEVSTATE(Custom:DND${AMPUSER})', 'NOT_INUSE')); // $cmd,n,Set(...=YES) 71 } 57 72 $ext->add($id, $c, '', new ext_playback('do-not-disturb&de-activated')); // $cmd,n,Playback(...) 58 73 $ext->add($id, $c, '', new ext_macro('hangupcall')); // $cmd,n,Macro(user-callerid) 59 74 } 60 75 76 function donotdisturb_dnd_toggle($c) { 77 global $ext; 78 global $amp_conf; 79 80 $id = "app-dnd-toggle"; // The context to be included 81 $ext->addInclude('from-internal-additional', $id); // Add the include from from-internal 82 83 $ext->add($id, $c, '', new ext_answer('')); 84 $ext->add($id, $c, '', new ext_wait('1')); 85 $ext->add($id, $c, '', new ext_macro('user-callerid')); 86 87 $ext->add($id, $c, '', new ext_gotoif('$["${DB(DND/${AMPUSER})}" = ""]', 'activate', 'deactivate')); 88 89 $ext->add($id, $c, 'activate', new ext_setvar('DB(DND/${AMPUSER})', 'YES')); 90 if ($amp_conf['USEDEVSTATE']) { 91 $ext->add($id, $c, '', new ext_setvar('DEVSTATE(Custom:DND${AMPUSER})', 'BUSY')); 92 } 93 $ext->add($id, $c, '', new ext_playback('do-not-disturb&activated')); 94 $ext->add($id, $c, '', new ext_macro('hangupcall')); 95 96 $ext->add($id, $c, 'deactivate', new ext_dbdel('DND/${AMPUSER}')); 97 if ($amp_conf['USEDEVSTATE']) { 98 $ext->add($id, $c, '', new ext_setvar('DEVSTATE(Custom:DND${AMPUSER})', 'NOT_INUSE')); 99 } 100 $ext->add($id, $c, '', new ext_playback('do-not-disturb&de-activated')); 101 $ext->add($id, $c, '', new ext_macro('hangupcall')); 102 } 103 61 104 ?> modules/branches/2.5/donotdisturb/install.php
r1404 r5858 15 15 unset($fcc); 16 16 17 // Register FeatureCode - Activate 18 $fcc = new featurecode('donotdisturb', 'dnd_toggle'); 19 $fcc->setDescription('DND Toggle'); 20 $fcc->setDefault('*0078'); 21 $fcc->update(); 22 unset($fcc); 23 17 24 ?> modules/branches/2.5/donotdisturb/module.xml
r5402 r5858 2 2 <rawname>donotdisturb</rawname> 3 3 <name>Do-Not-Disturb (DND)</name> 4 <version>2. 4.0</version>4 <version>2.5.0</version> 5 5 <changelog> 6 *2.5.0* added toggle and support for func_devstate 6 7 *2.4.0* bunp for 2.4 7 8 *1.0.2.2* changed category modules/branches/2.5/donotdisturb/uninstall.php
r2816 r5858 5 5 // from a function...? 6 6 global $astman; 7 8 // Register FeatureCode - Activate 9 $fcc = new featurecode('donotdisturb', 'dnd_on'); 10 $fcc->delete(); 11 unset($fcc); 12 13 // Register FeatureCode - Deactivate 14 $fcc = new featurecode('donotdisturb', 'dnd_off'); 15 $fcc->delete(); 16 unset($fcc); 17 18 // Register FeatureCode - Activate 19 $fcc = new featurecode('donotdisturb', 'dnd_toggle'); 20 $fcc->delete(); 21 unset($fcc); 7 22 8 23 // remove all D-N-D options in effect on extensions
