Changeset 7786
- Timestamp:
- 06/02/09 23:09:18 (4 years ago)
- Files:
-
- modules/branches/2.6/core/agi-bin/dialparties.agi (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.6/core/agi-bin/dialparties.agi
r7751 r7786 314 314 // Hacky. 315 315 $count = 0; 316 $ dndprimary= 0;316 $skipremaining = 0; 317 317 // Now check for DND 318 318 foreach ( $ext as $k ) { … … 325 325 unset($ext[$count]); 326 326 $AGI->set_variable('DIALSTATUS','BUSY'); 327 // if this is primary set dndprimaryand figure out if needed below327 // if this is primary set skipremaining and figure out if needed below 328 328 // 329 329 if ($count == 0 && $mastermode) { 330 $ dndprimary= 1;330 $skipremaining = 1; 331 331 debug("Primary extension is DND, so if mastermode, all should be dnd", 4); 332 332 } … … 344 344 // Main calling loop 345 345 // 346 $skipremaining = 0; // used to allow primary to ring but skip the rest347 346 $ds = ''; 348 347 foreach ( $ext as $k ) { … … 350 349 // 351 350 // 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 354 352 // 355 353 // if cf unconditional was already detected on the primary, then mastermode will have been reset at this point 356 354 // since that will negate the mastermode concpet. 357 355 // 358 // if dnd was set on the primary then dndprimarywill already be set resulting in a completly blanked out list359 // 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 360 358 361 359 // 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) { 367 361 $extnum = $k; 368 362 … … 412 406 // should not be effected 413 407 } 414 } // end if ($ dndprimary== 0)415 // $ dndprimary== 1 so clear the extension408 } // end if ($skipremaining == 0) 409 // $skipremaining == 1 so clear the extension 416 410 else { 417 // clear the current extension if dndprimary has been set. This will only be the case if in mastermode so no need to check418 // th at. Use this to skip remaining extensions also if just ringing the primary.419 $extnum = '';420 } 421 422 // if CF is not in use and $ dndprimaryis not set otherwise $extnum has been cleared and nothing to do411 // 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 423 417 // 424 if ( (substr($k,-1)!='#') && $dndprimary == 0) {418 if ( (substr($k,-1)!='#')) { 425 419 // CW is not in use or CFB is in use on this extension, then we need to check! 426 420 if ( ($exthascw == 0) || ($exthascfb == 1) || ($exthascfu == 1) ) {
