Ticket #1671: patchfile-1.txt

File patchfile-1.txt, 6.8 kB (added by naftali5, 5 years ago)

Added another method which ignores call waiting. (slight adjustment)

Line 
1 Index: amp_conf/astetc/extensions.conf
2 ===================================================================
3 --- amp_conf/astetc/extensions.conf (revision 3566)
4 +++ amp_conf/astetc/extensions.conf (working copy)
5 @@ -77,8 +77,10 @@
6          
7  exten => s,42,Dial(${${HuntMember}}${ds} ) ; dialparties will set the priority to 20 if $ds is not null and its a hunt group
8  exten => s,43,Set(HuntLoop=$[1 + ${HuntLoop}])
9 -exten => s,44,Set(HuntMembers=$[${HuntMembers} - 1])
10 -exten => s,45,Goto(s,22)
11 +exten => s,44,GotoIf($[$[$["foo${RingGroupMethod}" != "foofirstavailable"] & $["foo${RingGroupMethod}" != "foofirstnotonphone"]] | $["foo${DialStatus}" = "fooBUSY"]]?46)
12 +exten => s,45,Set(HuntMembers=0)
13 +exten => s,46,Set(HuntMembers=$[${HuntMembers} - 1])
14 +exten => s,47,Goto(s,22)
15  exten => s,50,DBdel(CALLTRACE/${CT_EXTEN})
16  exten => s,51,Goto(s,42)
17  
18 Index: amp_conf/agi-bin/dialparties.agi
19 ===================================================================
20 --- amp_conf/agi-bin/dialparties.agi  (revision 3566)
21 +++ amp_conf/agi-bin/dialparties.agi  (working copy)
22 @@ -381,6 +381,17 @@
23         debug("Extension $extnum is available",1);
24       }
25     }
26 +   elseif ( ($exthascw == 1) && ($rgmethod == 'firstnotonphone') )
27 +   { // get ExtensionState: 0-idle; 1-busy; 4-unavail; 8-ringing <--- these are unconfirmed
28 +     $extstate = is_ext_avail($extnum);
29 +     debug("Extension $extnum has ExtensionState: $extstate",1);
30 +     if ($extstate == 1)
31 +     { // CW in use - but blocked for hunt
32 +       debug("Extension $extnum has call waiting enabled but blocked for hunt",1);
33 +       $extnum = '';
34 +       $AGI->set_variable('DIALSTATUS','BUSY'); 
35 +     }
36 +   }
37   }
38  
39   if ($extnum != '')
40 @@ -400,7 +411,7 @@
41         if (strlen($extds)) $ds .= $extds . '&';
42    
43       // Update Caller ID for calltrace application
44 -     if ((strpos($k,"#")==0) && (($rgmethod != "hunt") && ($rgmethod != "memoryhunt")) )
45 +     if ((strpos($k,"#")==0) && (($rgmethod != "hunt") && ($rgmethod != "memoryhunt") && ($rgmethod != "firstavailable") && ($rgmethod != "firstnotonphone")) )
46       {
47         if ( isset($cidnum) && is_numeric($cidnum) )
48         {
49 @@ -433,7 +444,7 @@
50  $loops   = 0;
51  $myhuntmember  = "";
52  
53 -if (($rgmethod == "hunt") || ($rgmethod == "memoryhunt"))
54 +if (($rgmethod == "hunt") || ($rgmethod == "memoryhunt") || ($rgmethod == "firstavailable") || ($rgmethod == "firstnotonphone"))
55  {
56   if ($cidnum)
57     $AGI->set_variable(CALLTRACE_HUNT,$cidnum);
58 @@ -445,7 +456,7 @@
59     {
60       //If the original array is included in the extension hash then set variables
61       $myhuntmember="HuntMember"."$loops";
62 -     if ($rgmethod == "hunt")
63 +     if (($rgmethod == "hunt") || ($rgmethod == "firstavailable") || ($rgmethod == "firstnotonphone"))
64         $AGI->set_variable($myhuntmember,$ext_hunt[$k]);
65       elseif ($rgmethod == "memoryhunt")
66       {
67 @@ -549,7 +560,7 @@
68  
69   $AGI->noop('');
70  } else {
71 - if (($rgmethod == "hunt") || ($rgmethod == "memoryhunt"))
72 + if (($rgmethod == "hunt") || ($rgmethod == "memoryhunt") || ($rgmethod == "firstavailable") || ($rgmethod == "firstnotonphone"))
73   {
74     $ds = '|';
75     if ($timer)
76
77 Index: page.ringgroups.php
78 ===================================================================
79 --- page.ringgroups.php (revision 3566)
80 +++ page.ringgroups.php (working copy)
81 @@ -184,13 +184,15 @@
82           <b><?php echo _("hunt")?></b>: <?php echo _("Take turns ringing each available extension")?><br>
83           <b><?php echo _("memoryhunt")?></b>: <?php echo _("Ring first extension in the list, then ring the 1st and 2nd extension, then ring 1st 2nd and 3rd extension in the list.... etc.")?><br>
84                                          <b><?php echo _("*-prim")?></b>:  <?php echo _("These modes act as described above. However, if the primary extension (first in list) is occupied, the other extensions will not be rung. If the primary is freePBX DND, it won't be rung. If the primary is freePBX CF unconditional, then all will be rung")?><br>
85 +                                        <b><?php echo _("*-prim")?></b>:  <?php echo _("These modes act as described above. However, if the primary extension (first in list) is occupied, the other extensions will not be rung. If the primary is freePBX DND, it won't be rung. If the primary is freePBX CF unconditional, then all will be rung")?><br>
86 +                                        <b><?php echo _("firstnotonphone")?></b>:  <?php echo _("ring only the first channel which is not offhook - ignore CW")?><br>
87         </span>
88         </a></td>
89         <td>
90           <select name="strategy"/>
91           <?php
92             $default = (isset($strategy) ? $strategy : 'ringall');
93 -                                                $items = array('ringall','ringall-prim','hunt','hunt-prim','memoryhunt','memoryhunt-prim');
94 +                                                $items = array('ringallv2','ringallv2-prim','ringall','ringall-prim','hunt','hunt-prim','memoryhunt','memoryhunt-prim','firstavailable','firstnotonphone');
95             foreach ($items as $item) {
96               echo '<option value="'.$item.'" '.($default == $item ? 'SELECTED' : '').'>'._($item);
97             }
98
99 Index: page.findmefollow.php
100 ===================================================================
101 --- page.findmefollow.php (revision 3566)
102 +++ page.findmefollow.php (working copy)
103 @@ -208,13 +208,15 @@
104           <b><?php echo _("hunt")?></b>: <?php echo _("take turns ringing each available extension")?><br>
105           <b><?php echo _("memoryhunt")?></b>: <?php echo _("ring first extension in the list, then ring the 1st and 2nd extension, then ring 1st 2nd and 3rd extension in the list.... etc.")?><br>
106                                          <b><?php echo _("*-prim")?></b>:  <?php echo _("these modes act as described above. However, if the primary extension (first in list) is occupied, the other extensions will not be rung. If the primary is freepbx DND, it won't be run. If the primary is freepbx CF unconditional, then all will be rung")?><br>
107 +                                        <b><?php echo _("firstavailable")?></b>:  <?php echo _("ring only the first available channel")?><br>
108 +                                        <b><?php echo _("firstnotonphone")?></b>:  <?php echo _("ring only the first channel which is not offhook - ignore CW")?><br>
109         </span>
110         </a></td>
111         <td>
112           &nbsp;&nbsp;<select name="strategy"/>
113           <?php
114             $default = (isset($strategy) ? $strategy : 'ringall');
115 -                                                $items = array('ringall','ringall-prim','hunt','hunt-prim','memoryhunt','memoryhunt-prim');
116 +                                                $items = array('ringallv2','ringallv2-prim','ringall','ringall-prim','hunt','hunt-prim','memoryhunt','memoryhunt-prim','firstavailable','firstnotonphone');
117             foreach ($items as $item) {
118               echo '<option value="'.$item.'" '.($default == $item ? 'SELECTED' : '').'>'._($item);
119             }