Changeset 10346

Show
Ignore:
Timestamp:
10/04/10 14:30:31 (3 years ago)
Author:
p_lindheimer
Message:

revert most of r10345 checked-in in error (still work in progress)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.8/core/functions.inc.php

    r10345 r10346  
    43074307    if (!$editmode) { 
    43084308      $astman->database_put("AMPUSER",$extension."/device","\"".((isset($device))?$device:'')."\""); 
    4309       /* TODO: how to do it, need to decide if it needs done 
    4310       $ret = $astman->send_request('Command',array('Command'=>"core set global $DEVSTATE(Custom:DND$exten) $value_opt")); 
    4311       */ 
    43124309    } 
    43134310 
  • modules/branches/2.8/queues/functions.inc.php

    r10345 r10346  
    6060    } 
    6161 
    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); 
    9072      } 
    91       unset($device_results); 
    92     } 
     73    } 
    9374    if ($amp_conf['USEQUEUESTATE'] || $ast_ge_14_25) { 
    9475      $users = array(); 
     
    159140      } 
    160141 
    161       // Now pull out all the members, one line for each 
     142      // Now pull out all the memebers, one line for each 
    162143      // 
    163       /* There are only fixed and adhoc devices. So if all devices are fixed, thus $has_adhoc is false 
    164          then any user who does not have a device is a virtual user. 
    165       */ 
    166144      if ($amp_conf['USEQUEUESTATE']) { 
    167145        foreach ($members as $member) { 
     
    170148            $name = $users[$matches[1]]; 
    171149            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"; 
    174151          } else { 
    175152            $output .= "member=".$member."\n"; 
     
    179156        foreach ($members as $member) { 
    180157          preg_match("/^Local\/([\d]+)\@*/",$member,$matches); 
    181           //TODO: need to have $users[$matches[1] set also, or ? 
    182158          if (isset($matches[1]) && isset($devices[$matches[1]])) { 
    183159            $name = $users[$matches[1]];