Changeset 6143

Show
Ignore:
Timestamp:
07/23/08 14:21:54 (4 years ago)
Author:
p_lindheimer
Message:

Merged revisions 6142 via svnmerge from
http://svn.freepbx.org/modules/branches/2.5

........

r6142 | p_lindheimer | 2008-07-23 12:13:29 -0700 (Wed, 23 Jul 2008) | 1 line


#2939 if vmcontext is edited, make changes to symlinks for all devices user is currently using

........

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.4

    • Property svnmerge-integrated changed from /modules/branches/2.3:1-5233,5245,5333,5336 /modules/branches/2.5:1-5852,5880,5930,5995,6016-6017,6030-6031 to /modules/branches/2.3:1-5233,5245,5333,5336 /modules/branches/2.5:1-5852,5880,5930,5995,6016-6017,6030-6031,6142
  • modules/branches/2.4/core/functions.inc.php

    r5881 r6143  
    18201820  $thisUser = core_users_get($user); 
    18211821  if(isset($thisUser['voicemail']) && ($thisUser['voicemail'] != "novm")) { 
    1822     if(empty($thisUser['voicemail'])) 
     1822    if(empty($thisUser['voicemail'])) { 
    18231823      $vmcontext = "default"; 
    1824     else  
     1824    } else {  
    18251825      $vmcontext = $thisUser['voicemail']; 
     1826    } 
    18261827     
    18271828    //voicemail symlink 
     
    26492650  if ($astman) { 
    26502651    $ud = $astman->database_get("AMPUSER",$extension."/device"); 
     2652    $current_vmcontext = $astman->database_get("AMPUSER",$extension."/voicemail"); 
     2653    $new_vmcontext = isset($vars['vmcontext']) ? $vars['vmcontext'] : 'novm'; 
    26512654    $vars['device'] = $ud; 
    26522655  } else { 
     
    26752678    core_users_del($extension, true); 
    26762679    core_users_add($vars, true); 
     2680 
     2681    // If the vmcontext has changed, we need to change all the links. In extension mode, the link 
     2682    // to the current fixed device will get changed, but none others will 
     2683    // 
     2684    if ($current_vmcontext != $new_vmcontext) { 
     2685      $user_devices = explode('&',$ud); 
     2686      foreach ($user_devices as $user_device) { 
     2687        exec("rm -f /var/spool/asterisk/voicemail/device/".$user_device); 
     2688        if ($new_context != 'novm') { 
     2689          exec("/bin/ln -s /var/spool/asterisk/voicemail/".$new_vmcontext."/".$extension."/ /var/spool/asterisk/voicemail/device/".$user_device); 
     2690        } 
     2691      } 
     2692    } 
    26772693  } 
    26782694  return true; 
    2679    
    26802695} 
    26812696