Changeset 10346
- Timestamp:
- 10/04/10 14:30:31 (3 years ago)
- Files:
-
- modules/branches/2.8/core/functions.inc.php (modified) (1 diff)
- modules/branches/2.8/queues/functions.inc.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.8/core/functions.inc.php
r10345 r10346 4307 4307 if (!$editmode) { 4308 4308 $astman->database_put("AMPUSER",$extension."/device","\"".((isset($device))?$device:'')."\""); 4309 /* TODO: how to do it, need to decide if it needs done4310 $ret = $astman->send_request('Command',array('Command'=>"core set global $DEVSTATE(Custom:DND$exten) $value_opt"));4311 */4312 4309 } 4313 4310 modules/branches/2.8/queues/functions.inc.php
r10345 r10346 60 60 } 61 61 62 // Notes: 63 // we could check if ANY adhoc devices exist and if not, then be more 'specific' in how we handle 64 // hints, etc. 65 // 66 // On pure virutal extensions with devstate, dnd hint once set to idle makes it work, but we are never initializing 67 // it when creating the extension. If we do that somewhere then that would fix those cases even if we are associating a hint 68 // 69 // When follow-me can be there in device mode, probably per queue (unless there is a way to mark when adding member) 70 // 71 $has_adhoc = false; 72 $devices = array(); 73 $device_results = core_devices_list('all','full',true); 74 if (is_array($device_results)) { 75 foreach ($device_results as $device) { 76 if (!isset($devices[$device['user']]) && $device['devicetype'] == 'fixed') { 77 $devices[$device['user']] = $device['dial']; 78 } 79 if ($device['devicetype'] == 'adhoc') { 80 $has_adhoc = true; 81 } 82 //TODO: given the array, if there is no $device[user] present then that user if 83 // they come up below is a virtual user, they must be, so simply ignore their 84 // hint. Note - need to determine how to deal with this when they login dynamically 85 // though? May be able to add something to the restrictions queue array if they are 86 // present there. 87 //TODO: If at the time they login (for hints) there is no device, maybe we skip the hint then? 88 // unless of course we have managed to fix the DND hint thing though ... that is still dependednt 89 // on having func_devstate. 62 if ($ast_ge_14_25) { 63 $devices = array(); 64 $device_results = core_devices_list('all','full',true); 65 if (is_array($device_results)) { 66 foreach ($device_results as $device) { 67 if (!isset($devices[$device['user']]) && $device['devicetype'] == 'fixed') { 68 $devices[$device['user']] = $device['dial']; 69 } 70 } 71 unset($device_results); 90 72 } 91 unset($device_results); 92 } 73 } 93 74 if ($amp_conf['USEQUEUESTATE'] || $ast_ge_14_25) { 94 75 $users = array(); … … 159 140 } 160 141 161 // Now pull out all the mem bers, one line for each142 // Now pull out all the memebers, one line for each 162 143 // 163 /* There are only fixed and adhoc devices. So if all devices are fixed, thus $has_adhoc is false164 then any user who does not have a device is a virtual user.165 */166 144 if ($amp_conf['USEQUEUESTATE']) { 167 145 foreach ($members as $member) { … … 170 148 $name = $users[$matches[1]]; 171 149 str_replace(',','\,',$name); 172 $this_name_device = (isset($devices[$matches[1]]) || $has_adhoc) ? "$name,HINT:{$matches[1]}@ext-local" : "$name"; 173 $output .= "member=$member,$this_name_device\n" 150 $output .= "member=$member,$name,HINT:".$matches[1]."@ext-local\n"; 174 151 } else { 175 152 $output .= "member=".$member."\n"; … … 179 156 foreach ($members as $member) { 180 157 preg_match("/^Local\/([\d]+)\@*/",$member,$matches); 181 //TODO: need to have $users[$matches[1] set also, or ?182 158 if (isset($matches[1]) && isset($devices[$matches[1]])) { 183 159 $name = $users[$matches[1]];
