Changeset 7786

Show
Ignore:
Timestamp:
06/02/09 23:09:18 (4 years ago)
Author:
p_lindheimer
Message:

fixes #3706 -prim mode ring strategy ringing other extensions when DND enabled

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.6/core/agi-bin/dialparties.agi

    r7751 r7786  
    314314// Hacky. 
    315315$count = 0; 
    316 $dndprimary = 0; 
     316$skipremaining = 0; 
    317317// Now check for DND 
    318318foreach ( $ext as $k ) { 
     
    325325      unset($ext[$count]); 
    326326      $AGI->set_variable('DIALSTATUS','BUSY');             
    327       // if this is primary set dndprimary and figure out if needed below 
     327      // if this is primary set skipremaining and figure out if needed below 
    328328      // 
    329329      if ($count == 0 && $mastermode) { 
    330         $dndprimary = 1; 
     330        $skipremaining = 1; 
    331331        debug("Primary extension is DND, so if mastermode, all should be dnd", 4); 
    332332      } 
     
    344344// Main calling loop 
    345345// 
    346 $skipremaining = 0; // used to allow primary to ring but skip the rest 
    347346$ds = ''; 
    348347foreach ( $ext as $k ) { 
     
    350349  // 
    351350  // if mastermode is set then the first extension will be examined and mastermode will be reset so that the others 
    352   // are left alone. If the remaining extensions are not to be tried, skipremaining will be set to 1 which will 
    353   // result in dndprimary being set to 1 thus diabling the remaining list. 
     351  // are left alone. If the remaining extensions are not to be tried, skipremaining will be set to 1 thus skipping them 
    354352  // 
    355353  // if cf unconditional was already detected on the primary, then mastermode will have been reset at this point 
    356354  // since that will negate the mastermode concpet. 
    357355  // 
    358   // if dnd was set on the primary then dndprimary will already be set resulting in a completly blanked out list 
    359   // since dnd on the primary means don't bother me on any. 
     356  // if dnd was set on the primary then skipremaining will already be set resulting in a completly blanked out list 
     357  // since dnd on the primary means don't bother me on any. It will only have been set if in mastermode 
    360358 
    361359  // Don't bother checking these if we will be blanking the extnum anyhow 
    362   if ($skipremaining == 1) { 
    363     $dndprimary = 1; 
    364   } 
    365   if ($dndprimary == 0) { 
    366     // TODO what are these comments...? do we need to remove them...? 
     360  if ($skipremaining == 0) { 
    367361    $extnum    = $k; 
    368362 
     
    412406      // should not be effected 
    413407    } 
    414   } // end if ($dndprimary == 0) 
    415   // $dndprimary == 1 so clear the extension 
     408  } // end if ($skipremaining == 0) 
     409  // $skipremaining == 1 so clear the extension 
    416410  else { 
    417     // clear the current extension if dndprimary has been set. This will only be the case if in mastermode so no need to check 
    418     // that. Use this to skip remaining extensions also if just ringing the primary. 
    419     $extnum = ''
    420   } 
    421  
    422   // if CF is not in use and $dndprimary is not set otherwise $extnum has been cleared and nothing to do 
     411    // skip this loop since $skipremaining = 1 which is only the case in mastermode meaning the remaining code below will skip 
     412    // this and remaining extensions 
     413    continue
     414  } 
     415 
     416  // if CF is not in use and $skipremaining is not set otherwise $extnum has been cleared and nothing to do 
    423417  // 
    424   if ( (substr($k,-1)!='#') && $dndprimary == 0) { 
     418  if ( (substr($k,-1)!='#')) { 
    425419    // CW is not in use or CFB is in use on this extension, then we need to check! 
    426420    if ( ($exthascw == 0) || ($exthascfb == 1) || ($exthascfu == 1) ) {