</div> <div class="rnav"> <li><a id="<?php echo $extdisplay == '' ? 'current' : ''; ?> " href="config.php?mode=pbx&display=<?php echo urlencode($display); ?> " onFocus="this.blur()"><?php echo _("Add Trunk"); ?> </a></li> <?php $tresults = gettrunks(); foreach ($tresults as $tresult) { echo "<li><a id=\"" . ($extdisplay == $tresult[0] ? 'current' : '') . "\" href=\"config.php?mode=pbx&display=" . urlencode($display) . "&extdisplay=" . urlencode($tresult[0]) . "\" title=\"" . $tresult[1] . "\" onFocus=\"this.blur()\">" . _("Trunk") . " " . substr(ltrim($tresult[1], "AMP:"), 0, 14) . "</a></li>"; } ?> </div> <div class="content"> <?php if (!$tech && !$extdisplay) { ?> <h3><?php echo _("Add a Trunk:"); ?> </h3>
$compiled = $db->prepare('UPDATE globals SET value = ? WHERE variable = ?'); $result = $db->executeMultiple($compiled, $globalfields); if (DB::IsError($result)) { echo $action . '<br>'; die($result->getMessage()); } exec($wScript); exec($mohScript); needreload(); } $sql = "SELECT * FROM globals"; $globals = $db->getAll($sql); if (DB::IsError($globals)) { die($globals->getMessage()); } foreach (gettrunks() as $temp) { $trunks[trim($temp[0])] = trim($temp[1]); } foreach ($globals as $global) { ${trim($global[0])} = $global[1]; } $extens = getextens(); ?> <form name="general" action="config.php?mode=settings&display=<?php echo urlencode($dispnum); ?> " method="post"> <input type="hidden" name="display" value="<?php echo urlencode($dispnum); ?>
function addTrunk($tech, $channelid, $dialoutprefix, $maxchans, $outcid, $peerdetails, $usercontext, $userconfig, $register, $accountcodefinal, $outtrunkright) { global $db; // find the next available ID $trunknum = 1; foreach (gettrunks() as $trunk) { if ($trunknum == ltrim($trunk[0], "OUT_")) { $trunknum++; } } backendAddTrunk($trunknum, $tech, $channelid, $dialoutprefix, $maxchans, $outcid, $peerdetails, $usercontext, $userconfig, $register, $accountcodefinal, $outtrunkright); return $trunknum; }