Changeset 8832

Show
Ignore:
Timestamp:
02/16/10 13:43:19 (3 years ago)
Author:
p_lindheimer
Message:

changes to support CF devstate in deviceanduser mode re #4047

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.7/core/agi-bin/user_login_out.agi

    r8470 r8832  
    4848  $ast_version  = get_var("ASTVERSION"); 
    4949  $dnd_devstate = get_var( "DNDDEVSTATE" ) == "TRUE" ? true : false; 
     50  $cf_devstate = get_var( "CFDEVSTATE" ) == "TRUE" ? true : false; 
    5051  $fm_devstate  = get_var( "FMDEVSTATE" ) == "TRUE" ? true : false; 
    5152  $que_devstate = get_var( "QUEDEVSTATE" ) == "TRUE" ? true : false; 
     
    162163    global $fm_devstate; 
    163164    global $dnd_devstate; 
     165    global $cf_devstate; 
    164166    global $que_devstate; 
    165167    global $DEVSTATE; 
     
    193195      $agi->set_variable($DEVSTATE.'(Custom:DEVDND'.$device.')',get_dnd_state($user)); 
    194196    } 
     197    if ($cf_devstate) { 
     198      debug("insert_user: Setting CF DEVSTATES for device $device",5); 
     199      $agi->set_variable($DEVSTATE.'(Custom:DEVCF'.$device.')',get_cf_state($user)); 
     200    } 
    195201 
    196202    $vmcontext = get_voicemail_context($user); 
     
    212218    global $fm_devstate; 
    213219    global $dnd_devstate; 
     220    global $cf_devstate; 
    214221    global $que_devstate; 
    215222    global $DEVSTATE; 
     
    246253      if ($dnd_devstate) { 
    247254        debug("Setting device $device DND state to INVALID before deleting",5); 
    248         $agi->set_variable($DEVSTATE.'(Custom:DEVDND'.$device.')','INVALID'); 
     255        $agi->set_variable($DEVSTATE.'(Custom:DEVDND'.$device.')','UNKNOWN'); 
     256      } 
     257      if ($cf_devstate) { 
     258        debug("Setting device $device CF state to INVALID before deleting",5); 
     259        $agi->set_variable($DEVSTATE.'(Custom:DEVCF'.$device.')','UNKNOWN'); 
    249260      } 
    250261      // I thought they should then be deleted, but they still end up there probably because setting them to invalid re-creates them 
     
    444455    } 
    445456    debug("get_dnd_state: user $user got state ".$dnd_state['data']." returning $ret",8); 
     457    return $ret; 
     458  } 
     459 
     460  function get_cf_state($user) { 
     461    global $agi; 
     462 
     463    $cf_state = $agi->database_get('CF',$user); 
     464    if ($cf_state['result'] != 1) { 
     465      $ret = 'NOT_INUSE'; 
     466    } else { 
     467      if (trim($cf_state['data']) == '') { 
     468        $ret = 'NOT_INUSE'; 
     469      } else { 
     470        $ret = 'INUSE'; 
     471      } 
     472    } 
     473    debug("get_cf_state: user $user got state ".$cf_state['data']." returning $ret",8); 
    446474    return $ret; 
    447475  } 
  • modules/branches/2.7/core/module.xml

    r8813 r8832  
    44  <category>Basic</category> 
    55  <name>Core</name> 
    6   <version>2.7.0beta1.4</version> 
     6  <version>2.7.0beta1.5</version> 
    77  <publisher>FreePBX</publisher> 
    88  <license>GPLv2+</license> 
     
    1010  <canuninstall>no</canuninstall> 
    1111  <changelog> 
     12    *2.7.0beta1.5* #4047 changes to support CF devstate in deviceanduser mode 
    1213    *2.7.0beta1.4* #4041 
    1314    *2.7.0beta1.3* #4037