function miscdests_get_config($engine) { global $ext; // is this the best way to pass this? switch ($engine) { case "asterisk": $contextname = 'ext-miscdests'; $fctemplate = '/\\{(.+)\\:(.+)\\}/'; if (is_array($destlist = miscdests_list())) { foreach ($destlist as $item) { $miscdest = miscdests_get($item['0']); $miscid = $miscdest['id']; $miscdescription = $miscdest['description']; $miscdialdest = $miscdest['destdial']; // exchange {mod:fc} for the relevent feature codes in $miscdialdest $miscdialdest = preg_replace_callback($fctemplate, "miscdests_lookupfc", $miscdialdest); // write out the dialplan details $ext->add($contextname, $miscid, '', new ext_noop('MiscDest: ' . $miscdescription)); $ext->add($contextname, $miscid, '', new ext_goto('from-internal,' . $miscdialdest . ',1', '')); } } break; } }
foreach ($miscdests as $miscdest) { echo "<li><a id=\"" . ($extdisplay == $miscdest[0] ? 'current' : '') . "\" href=\"config.php?display=" . urlencode($dispnum) . "&id=" . urlencode($miscdest[0]) . "\">{$miscdest[1]}</a></li>"; } } ?> </ul></div> <div class="content"> <?php if ($action == 'delete') { echo '<br><h3>' . _("Misc Destination") . ' ' . $extdisplay . ' ' . _("deleted") . '!</h3><br><br><br><br><br><br><br><br>'; } else { if ($extdisplay) { //get details for this meetme $thisMiscDest = miscdests_get($extdisplay); //create variables $description = ""; $destdial = ""; extract($thisMiscDest); } $helptext = _("Misc Destinations are for adding destinations that can be used by other FreePBX modules, generally used to route incoming calls. If you want to create feature codes that can be dialed by internal users and go to various destinations, please see the <strong>Misc Applications</strong> module."); if ($extdisplay) { ?> <h2><?php echo _("Misc Destination:") . " " . $description; ?> </h2> <?php $usage_list = framework_display_destination_usage(miscdests_getdest($extdisplay)); $delURL = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . '&action=delete';
$prevtag .= " | "; } print "{$prevtag} <a onFocus='this.blur()' href='?mode=pbx&display=" . $dispnum . "&skip={$nextskip}'>[NEXT]</a>"; } print "</div></center></li>"; ?> </div> <div class="content"> <?php if ($action == 'delete') { echo '<br><h3>' . _("Misc Destination") . ' ' . $extdisplay . ' ' . _("deleted") . '!</h3><br><br><br><br><br><br><br><br>'; } else { if ($extdisplay) { $thisMiscDest = miscdests_get($extdisplay, $context); $extension = ""; $descr = ""; extract($thisMiscDest); } $delURL = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . '&action=delete'; ?> <?php if ($extdisplay) { ?> <h3><?php echo _("Misc Destination:") . " " . $description; ?> </h3>