Changeset 6362

Show
Ignore:
Timestamp:
08/12/08 15:04:03 (4 years ago)
Author:
p_lindheimer
Message:

Merged revisions 6361 via svnmerge from re #3047
http://svn.freepbx.org/modules/branches/2.5

........

r6361 | p_lindheimer | 2008-08-12 13:00:33 -0700 (Tue, 12 Aug 2008) | 1 line


fixes #3047 fixes bug that was supplying an existing trunk id when a new trunk was added in certain circumstances where there had been trunks deleted in the sequence

........

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,6142,6218,6291 to /modules/branches/2.3:1-5233,5245,5333,5336 /modules/branches/2.5:1-5852,5880,5930,5995,6016-6017,6030-6031,6142,6218,6291,6361
  • modules/branches/2.4/core/functions.inc.php

    r6143 r6362  
    27902790  // find the next available ID 
    27912791  $trunknum = 1; 
     2792 
     2793  // This is pretty ugle, will fix when we redo trunks and routes with proper uniqueids. 
     2794  // get the list, sort them, then look for a hole and use it, or overflow to the end if 
     2795  // not and use that 
     2796  // 
     2797  $trunk_hash = array(); 
    27922798  foreach(core_trunks_list() as $trunk) { 
    2793     if ($trunknum == ltrim($trunk[0],"OUT_")) {  
    2794       $trunknum++; 
    2795     } 
     2799    $trunknum = ltrim($trunk[0],"OUT_"); 
     2800    $trunk_hash[] = $trunknum; 
     2801  } 
     2802  sort($trunk_hash); 
     2803  $trunknum = 1; 
     2804  foreach ($trunk_hash as $trunk_id) { 
     2805    if ($trunk_id != $trunknum) { 
     2806      break; 
     2807    } 
     2808    $trunknum++; 
    27962809  } 
    27972810