root/contributed_modules/modules/wakeup/functions.inc.php

Revision 5064, 1.2 kB (checked in by p_lindheimer, 5 years ago)

#1766: add wakeup to contributed modules repository

  • Property svn:executable set to *
Line 
1 <?php
2
3 function wakeup_get_config($engine) {
4   $modulename = 'wakeup';
5  
6   // This generates the dialplan
7   global $ext; 
8   switch($engine) {
9     case "asterisk":
10       if (is_array($featurelist = featurecodes_getModuleFeatures($modulename))) {
11         foreach($featurelist as $item) {
12           $featurename = $item['featurename'];
13           $fname = $modulename.'_'.$featurename;
14           if (function_exists($fname)) {
15             $fcc = new featurecode($modulename, $featurename);
16             $fc = $fcc->getCodeActive();
17             unset($fcc);
18            
19             if ($fc != '')
20               $fname($fc);
21           } else {
22             $ext->add('from-internal-additional', 'debug', '', new ext_noop($modulename.": No func $fname"));
23             var_dump($item);
24           }
25         }
26       }
27     break;
28   }
29 }
30
31 function wakeup_wakeup($c) {
32   global $ext;
33
34   $id = "app-wakeup"; // The context to be included
35
36   $ext->addInclude('from-internal-additional', $id); // Add the include from from-internal
37
38    $ext->add($id, $c, '', new ext_macro('user-callerid'));
39   $ext->add($id, $c, '', new ext_answer('')); // $cmd,1,Answer
40   $ext->add($id, $c, '', new ext_wait('1'));
41   $ext->add($id, $c, '', new ext_agi('wakeup.php'));
42   $ext->add($id, $c, '', new ext_macro('hangupcall'));
43 }
44
45 ?>
Note: See TracBrowser for help on using the browser.