Changeset 8174

Show
Ignore:
Timestamp:
08/25/09 23:45:19 (4 years ago)
Author:
p_lindheimer
Message:

closes #3545 ignore server side CF in immediate loop cases

Files:

Legend:

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

    r8163 r8174  
    271271// extension and do this if the case. 
    272272 
    273 // Check for call forwarding first 
    274 // If call forward is enabled, we use chan_local 
    275 // Hacky. We should be using an associative array, shouldn't we? 
    276273$count = 0; 
    277274foreach ($ext as $k) { 
     
    282279  // 
    283280  if (strlen($cf)) { 
    284     // append a hash sign so we can send out on chan_local below unless cfingore is set 
    285     if ($cfignore) { 
    286       unset($ext[$count]); 
    287       debug("Extension $k has call forward set to $cf", 1); 
    288       $AGI->set_variable('DIALSTATUS','NOANSWER'); 
     281 
     282     
     283    // Check for call forwarding first 
     284    // If call forward is enabled, we use chan_local 
     285    // Hacky. We should be using an associative array, shouldn't we? 
     286    // More hacks: ignore CF if caller is the extension this extension is forwarded to. 
     287    if (!isset($realcalleridnum)) { 
     288      $realcalleridnum  = get_var( $AGI, "REALCALLERIDNUM" ); 
     289    } 
     290    if (!isset($blindtransfer)) { 
     291      $blindtransfer = get_var( $AGI, "BLINDTRANSFER" ); 
     292    } 
     293    if (!isset($ampuser)) { 
     294      $ampuser = get_var( $AGI, "AMPUSER" ); 
     295      if ($ampuser == '') { 
     296        $ampuser = $cidnum; 
     297      } 
     298    } 
     299    if ( ($ampuser == $cf) || ($realcalleridnum == $cf) || (strstr($blindtransfer,"/".$cf."-")) ) { 
     300      debug("Extension $k cf is ignored", 1); 
    289301    } else { 
    290       $ext[$count] = $cf.'#';   
    291       debug("Extension $k has call forward set to $cf", 1); 
    292     } 
    293  
    294     // if this is the primary extension and CF enabled, then cancel mastermode 
    295     // whether it is or not, no need to check. 
    296     // 
    297     if ($count == 0) { 
    298       $mastermode = 0; 
    299       $pr_dialstatus = ""; // not relevant if not mastermode, clear it so dnd doesn't propagate, and other 
    300       debug("Primary ext is CF so disabling mastermode if it was set", 4); 
     302      if ($k == $cf) { 
     303        debug("Loop detected, extension $k cf is ignored", 1); 
     304      } else { 
     305        // append a hash sign so we can send out on chan_local below unless cfingore is set 
     306        if ($cfignore) { 
     307          unset($ext[$count]); 
     308          debug("Extension $k has call forward set to $cf", 1); 
     309          $AGI->set_variable('DIALSTATUS','NOANSWER'); 
     310        } else { 
     311          $ext[$count] = $cf.'#';   
     312          debug("Extension $k has call forward set to $cf", 1); 
     313        } 
     314   
     315        // if this is the primary extension and CF enabled, then cancel mastermode 
     316        // whether it is or not, no need to check. 
     317        // 
     318        if ($count == 0) { 
     319          $mastermode = 0; 
     320          $pr_dialstatus = ""; // not relevant if not mastermode, clear it so dnd doesn't propagate, and other 
     321          debug("Primary ext is CF so disabling mastermode if it was set", 4); 
     322        } 
     323      } 
    301324    } 
    302325  } 
  • modules/branches/2.6/core/module.xml

    r8163 r8174  
    1010  <canuninstall>no</canuninstall> 
    1111  <changelog> 
    12     *2.6.0beta1.4* #3075, #3501, #3636, #3581, #3266, #3701 
     12    *2.6.0beta1.4* #3075, #3501, #3636, #3581, #3266, #3701, #3545 
    1313    *2.6.0beta1.3* trunk tab improvements 
    1414    *2.6.0beta1.2* added more sql escape in devices