Changeset 6029
- Timestamp:
- 07/15/08 21:28:26 (3 months ago)
- Files:
-
- freepbx/trunk/amp_conf/htdocs/recordings/includes/common.php (modified) (1 diff)
- freepbx/trunk/amp_conf/htdocs/recordings/modules/VmX.module (modified) (1 diff)
- freepbx/trunk/amp_conf/htdocs/recordings/modules/followme.module (modified) (1 diff)
- freepbx/trunk/amp_conf/htdocs/recordings/modules/phonefeatures.module (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk/amp_conf/htdocs/recordings/includes/common.php
r4993 r6029 166 166 $asteriskcdr_dbhost = isset($amp_conf["AMPDBHOST"]) ? $amp_conf["AMPDBHOST"] : $ASTERISKCDR_DBHOST; 167 167 $asteriskcdr_dbname = $ASTERISKCDR_DBNAME; 168 169 global $amp_usedevstate; 170 $amp_usedevstate = isset($amp_conf["USEDEVSTATE"]) ? strtolower(trim($amp_conf["USEDEVSTATE"])) : 0; 171 if ($amp_usedevstate == 'yes' || $amp_usedevstate == 'true' || $amp_usedevstate == 'on' || $amp_usedevstate == '1') { 172 $amp_usedevstate = 1; 173 } else { 174 $amp_usedevstate = 0; 175 } 168 176 169 177 unset($amp_conf); freepbx/trunk/amp_conf/htdocs/recordings/modules/VmX.module
r4993 r6029 300 300 <td><a href='#' class='info'>" . _("Use When:") . "<span>" . _("Menu options below are available during your personal voicemail greeting playback. <br/><br/>Check both to use at all times.") . "<br></span></a></td> <td> 301 301 <input " . $vmx_unavail_enabled . " type=checkbox name='vmx_unavail_enabled' value='checked'> 302 <small>" . _("unavailable") . "</small> 303 </td> 304 <td> 302 <small>" . _("unavailable") . "</small> 305 303 <input " . $vmx_busy_enabled . " type=checkbox name='vmx_busy_enabled' value='checked'> 306 304 <small>" . _("busy") . "</small> freepbx/trunk/amp_conf/htdocs/recordings/modules/followme.module
r5764 r6029 568 568 */ 569 569 function setFollowMeDDial($exten,$follow_me_ddial) { 570 571 global $asterisk_manager_interface; 572 573 $value_opt = ($follow_me_ddial)?'DIRECT':'EXTENSION'; 574 575 $response = $asterisk_manager_interface->Command("Action: Command\r\nCommand: database put AMPUSER $exten/followme/ddial $value_opt\r\n\r\n"); 570 global $amp_usedevstate; 571 global $asterisk_manager_interface; 572 573 $value_opt = ($follow_me_ddial)?'DIRECT':'EXTENSION'; 574 575 $response = $asterisk_manager_interface->Command("Action: Command\r\nCommand: database put AMPUSER $exten/followme/ddial $value_opt\r\n\r\n"); 576 577 // TODO only do this if in USEDEVSTATE MODE 578 // Now that we have set the state (DIRECT is enabled, EXTENSION is disabled) 579 // Get the devices associated with this user first and then we will set them all as needed 580 // 581 582 if ($amp_usedevstate) { 583 $value_opt = ($follow_me_ddial)?'BUSY':'NOT_INUSE'; 584 $devices = $asterisk_manager_interface->Command("Action: Command\r\nCommand: database get AMPUSER $exten/device\r\n\r\n"); 585 $device_arr = explode('&',$devices); 586 foreach ($device_arr as $device) { 587 $ret = $asterisk_manager_interface->Command("Action: Command\r\nCommand: core set global DEVSTATE(Custom:FOLLOWME$device) $value_opt\r\n\r\n"); 588 } 589 } 576 590 } 577 591 freepbx/trunk/amp_conf/htdocs/recordings/modules/phonefeatures.module
r4993 r6029 185 185 //***************************************************************************** 186 186 function setPhoneSetting( $databaseCallFwdType, $exten, $state_value) { 187 188 global $asterisk_manager_interface; 189 190 $type_opt = ($state_value != "") ? "put":"del"; 191 192 $response = $asterisk_manager_interface->Command("Action: Command\r\nCommand: database $type_opt $databaseCallFwdType $exten $state_value\r\n\r\n"); 187 global $amp_usedevstate; 188 global $asterisk_manager_interface; 189 190 $type_opt = ($state_value != "") ? "put":"del"; 191 192 $response = $asterisk_manager_interface->Command("Action: Command\r\nCommand: database $type_opt $databaseCallFwdType $exten $state_value\r\n\r\n"); 193 194 // This is a kludge but ... check if the is DND and if so do additional processing 195 // 196 //if ($amp_usedevstate && ($databaseCallFwdType == 'DND')) { 197 if ($databaseCallFwdType == 'DND' && $amp_usedevstate) { 198 $value_opt = ($type_opt == 'put') ? 'BUSY' : 'NOT_INUSE'; 199 $devices = $asterisk_manager_interface->Command("Action: Command\r\nCommand: database get AMPUSER $exten/device\r\n\r\n"); 200 $device_arr = explode('&',$devices); 201 foreach ($device_arr as $device) { 202 $ret = $asterisk_manager_interface->Command("Action: Command\r\nCommand: core set global DEVSTATE(Custom:DEVDND$device) $value_opt\r\n\r\n"); 203 } 204 // And also handle the state associated with the user 205 $ret = $asterisk_manager_interface->Command("Action: Command\r\nCommand: core set global DEVSTATE(Custom:DND$exten) $value_opt\r\n\r\n"); 206 } 193 207 } 194 208
