| | 352 | |
|---|
| | 353 | // Check for and report any extension conflicts |
|---|
| | 354 | // |
|---|
| | 355 | |
|---|
| | 356 | $extens_ok = true; |
|---|
| | 357 | $dests_ok = true; |
|---|
| | 358 | |
|---|
| | 359 | $nt = notifications::create($db); |
|---|
| | 360 | |
|---|
| | 361 | $my_hash = array_flip($active_modules); |
|---|
| | 362 | $my_prob_extens = framework_list_extension_conflicts($my_hash); |
|---|
| | 363 | |
|---|
| | 364 | if (empty($my_prob_extens)) { |
|---|
| | 365 | $nt->delete('retrieve_conf', 'XTNCONFLICT'); |
|---|
| | 366 | } else { |
|---|
| | 367 | $previous = null; |
|---|
| | 368 | $str = null; |
|---|
| | 369 | $count = 0; |
|---|
| | 370 | foreach ($my_prob_extens as $extens) { |
|---|
| | 371 | foreach ($extens as $exten => $details) { |
|---|
| | 372 | if ($exten != $previous) { |
|---|
| | 373 | $str .= "Extension: $exten:<br />"; |
|---|
| | 374 | $count++; |
|---|
| | 375 | } |
|---|
| | 376 | $str .= sprintf("%8s: %s<br />",$details['status'], $details['description']); |
|---|
| | 377 | $previous = $exten; |
|---|
| | 378 | } |
|---|
| | 379 | } |
|---|
| | 380 | $nt->add_error('retrieve_conf', 'XTNCONFLICT', sprintf(_("There are %s conflicting extensions"),$count), $str); |
|---|
| | 381 | $extens_ok = false; |
|---|
| | 382 | } |
|---|
| | 383 | |
|---|
| | 384 | // Check for and report any bogus destinations |
|---|
| | 385 | // |
|---|
| | 386 | $my_probs = framework_list_problem_destinations($my_hash, !$amp_conf['CUSTOMASERROR']); |
|---|
| | 387 | |
|---|
| | 388 | if (empty($my_probs)) { |
|---|
| | 389 | $nt->delete('retrieve_conf', 'BADDEST'); |
|---|
| | 390 | } else { |
|---|
| | 391 | $results = array(); |
|---|
| | 392 | $count = 0; |
|---|
| | 393 | $str = null; |
|---|
| | 394 | foreach ($my_probs as $problem) { |
|---|
| | 395 | //print_r($problem); |
|---|
| | 396 | $results[$problem['status']][] = $problem['description']; |
|---|
| | 397 | $count++; |
|---|
| | 398 | } |
|---|
| | 399 | foreach ($results as $status => $subjects) { |
|---|
| | 400 | $str .= sprintf(_("DEST STATUS: %s%s"),$status,"\n"); |
|---|
| | 401 | foreach ($subjects as $subject) { |
|---|
| | 402 | //$str .= $subject."<br />"; |
|---|
| | 403 | $str .= " ".$subject."\n"; |
|---|
| | 404 | } |
|---|
| | 405 | } |
|---|
| | 406 | $nt->add_error('retrieve_conf', 'BADDEST', sprintf(_("There are %s bad destinations"),$count), $str); |
|---|
| | 407 | $dests_ok = false; |
|---|
| | 408 | } |
|---|
| | 409 | |
|---|
| | 410 | if ((!$exten_ok && $amp_conf['XTNCONFLICTABORT']) || (!$dest_ok && $amp_conf['BADDESTABORT'])) { |
|---|
| | 411 | out(_("Aborting reload because extension conflicts or bad destinations")); |
|---|
| | 412 | exit(20); |
|---|
| | 413 | } |
|---|
| 402 | | } |
|---|
| 403 | | |
|---|
| 404 | | // Check for and report any extension conflicts |
|---|
| 405 | | // |
|---|
| 406 | | $nt = notifications::create($db); |
|---|
| 407 | | |
|---|
| 408 | | $my_hash = array_flip($active_modules); |
|---|
| 409 | | $my_prob_extens = framework_list_extension_conflicts($my_hash); |
|---|
| 410 | | |
|---|
| 411 | | if (empty($my_prob_extens)) { |
|---|
| 412 | | $nt->delete('retrieve_conf', 'XTNCONFLICT'); |
|---|
| 413 | | } else { |
|---|
| 414 | | $previous = null; |
|---|
| 415 | | $str = null; |
|---|
| 416 | | $count = 0; |
|---|
| 417 | | foreach ($my_prob_extens as $extens) { |
|---|
| 418 | | foreach ($extens as $exten => $details) { |
|---|
| 419 | | if ($exten != $previous) { |
|---|
| 420 | | $str .= "Extension: $exten:<br />"; |
|---|
| 421 | | $count++; |
|---|
| 422 | | } |
|---|
| 423 | | $str .= sprintf("%8s: %s<br />",$details['status'], $details['description']); |
|---|
| 424 | | $previous = $exten; |
|---|
| 425 | | } |
|---|
| 426 | | } |
|---|
| 427 | | $nt->add_error('retrieve_conf', 'XTNCONFLICT', sprintf(_("There are %s conflicting extensions"),$count), $str); |
|---|
| 428 | | } |
|---|
| 429 | | |
|---|
| 430 | | // Check for and report any bogus destinations |
|---|
| 431 | | // |
|---|
| 432 | | $my_probs = framework_list_problem_destinations($my_hash, !$amp_conf['CUSTOMASERROR']); |
|---|
| 433 | | |
|---|
| 434 | | if (empty($my_probs)) { |
|---|
| 435 | | $nt->delete('retrieve_conf', 'BADDEST'); |
|---|
| 436 | | } else { |
|---|
| 437 | | $results = array(); |
|---|
| 438 | | $count = 0; |
|---|
| 439 | | $str = null; |
|---|
| 440 | | foreach ($my_probs as $problem) { |
|---|
| 441 | | //print_r($problem); |
|---|
| 442 | | $results[$problem['status']][] = $problem['description']; |
|---|
| 443 | | $count++; |
|---|
| 444 | | } |
|---|
| 445 | | foreach ($results as $status => $subjects) { |
|---|
| 446 | | $str .= sprintf(_("DEST STATUS: %s%s"),$status,"\n"); |
|---|
| 447 | | foreach ($subjects as $subject) { |
|---|
| 448 | | //$str .= $subject."<br />"; |
|---|
| 449 | | $str .= " ".$subject."\n"; |
|---|
| 450 | | } |
|---|
| 451 | | } |
|---|
| 452 | | $nt->add_error('retrieve_conf', 'BADDEST', sprintf(_("There are %s bad destinations"),$count), $str); |
|---|
| 671 | | generate_configurations_sip($version); |
|---|
| 672 | | generate_configurations_iax($version); |
|---|
| 673 | | generate_configurations_zap($version); |
|---|
| 674 | | generate_configurations_queues($version); |
|---|
| | 679 | // Leave the legacy scripts in for a little while to help with odd-ball upgrade scenarios if they haven't gotten |
|---|
| | 680 | // a module upgraded yet. In particular Queues |
|---|
| | 681 | // |
|---|
| | 682 | if (!isset($core_conf) || !is_a($core_conf, "core_conf")) { |
|---|
| | 683 | generate_configurations_sip($version); |
|---|
| | 684 | generate_configurations_iax($version); |
|---|
| | 685 | generate_configurations_zap($version); |
|---|
| | 686 | } |
|---|
| | 687 | if (!isset($queues_conf) || !is_a($queues_conf, "queues_conf")) { |
|---|
| | 688 | generate_configurations_queues($version); |
|---|
| | 689 | } |
|---|