Exemple #1
0
?>
</div>

<div class="rnav" style="width:225px;">
    <li><a id="<?php 
echo $extdisplay == '' ? 'current' : '';
?>
" href="config.php?mode=pbx&display=<?php 
echo $dispnum;
?>
" onFocus="this.blur()"><?php 
echo _("Add Extension");
?>
</a></li>
<?php 
$results = getextens();
$vmcontext = "default";
if (isset($results)) {
    foreach ($results as $key => $result) {
        if ($index >= $perpage) {
            $shownext = 1;
            $pagerz = 1;
            break;
        }
        if ($skipped < $skip && $skip != 0) {
            $skipped = $skipped + 1;
            $pagerz = 1;
            continue;
        }
        $index = $index + 1;
        $cidname = explode('"', $result[1]);
Exemple #2
0
$sql = "SELECT * FROM globals";
$globals = $db->getAll($sql);
if (DB::IsError($globals)) {
    die($globals->getMessage());
}
foreach ($globals as $global) {
    ${trim($global[0])} = $global[1];
}
$ReadForceIncomingHours = ReadForceIncomingHours(2);
if ($ReadForceIncomingHours != "none") {
    $WarningMsg = "This Incoming Call is in conflict with the Special Estension *60.<br>Please don't use both at the same time. SUBMIT CHANGES is Disabled.";
} else {
    $WarningMsg = "&nbsp;";
}
$unique_aas = getaas();
$extens = getextens();
$gresults = getgroups();
$queues = getqueues();
$miscs = getmiscdest();
echo "<h3>" . _("Incoming Calls <font class=\"contextcolor\">#2</font> (context: <font class=\"contextcolor\"> from-trunk-1</font>):") . "</h3>";
?>
<table width="99%" border="0" cellpadding="1" cellspacing="2">
<form name="incoming" action="config.php?mode=pbx&amp;display=<?php 
echo urlencode($dispnum);
?>
" method="post">
<tr><td>
<center><h5><a href="config.php?display=9&mode=pbx">Incoming #1</a> - <a href="config.php?display=17&mode=pbx">Incoming #2</a> - <a href="config.php?display=10&mode=pbx">Incoming #3</a> - <a href="config.php?display=13&mode=pbx">Incoming #4</a> - <a href="config.php?display=15&mode=pbx">Incoming #5</a> - <a href="config.php?display=5&mode=pbx">Incoming #6</a></h5></center>
</td></tr>
<tr><td><b><center class="Warning"><?php 
echo $WarningMsg;
Exemple #3
0
function ivrdrawselects($formName, $goto, $i)
{
    $unique_aas = getaas();
    $extens = getextens();
    $gresults = getgroups();
    $queues = getqueues();
    $miscdest = getmiscdest();
    if (isset($extens)) {
        //get voicemail
        $uservm = getVoicemail();
        $vmcontexts = array_keys($uservm);
        foreach ($extens as $thisext) {
            $extnum = $thisext[0];
            // search vm contexts for this extensions mailbox
            foreach ($vmcontexts as $vmcontext) {
                if (isset($uservm[$vmcontext][$extnum])) {
                    $vmname = $uservm[$vmcontext][$extnum]['name'];
                    $vmboxes[] = array($extnum, '"' . $vmname . '" <' . $extnum . '>');
                }
            }
        }
    }
    $selectHtml = '<table border="0" cellpadding="1" cellspacing="2" id="loopdestination"';
    if ($goto == "") {
        $selectHtml .= 'style="display:none;"';
    }
    $selectHtml .= '>';
    $selectHtml .= '<tr><td><h5>Set Destination:</h5></td></tr>';
    $selectHtml .= '<tr><td></td></tr>';
    $selectHtml .= '<tr><td><input type="hidden" name="goto' . $i . '" value="">';
    $selectHtml .= '<input type="radio" onFocus="this.blur()" name="goto_indicate' . $i . '" value="ivr" onclick="javascript:document.' . $formName . '.goto' . $i . '.value=\'ivr\';" onkeypress="javascript:if (event.keyCode == 0 || (document.all && event.keyCode == 13)) document.' . $formName . '.goto' . $i . '.value=\'ivr\';" ' . (strpos($goto, 'aa_') === false ? '' : 'CHECKED=CHECKED') . ' /> ' . _("Digital Receptionist") . ': ';
    $selectHtml .= '<select name="ivr' . $i . '">';
    if (isset($unique_aas)) {
        foreach ($unique_aas as $unique_aa) {
            $menu_id = $unique_aa[0];
            $menu_name = $unique_aa[1];
            $selectHtml .= '<option value="' . $menu_id . '" ' . (strpos($goto, $menu_id) === false ? '' : 'SELECTED') . '>' . ($menu_name ? $menu_name : 'Menu ID' . $menu_id) . '</option>';
        }
    }
    $selectHtml .= '</select></td></tr>';
    $selectHtml .= '<tr><td><input type="radio" onFocus="this.blur()" name="goto_indicate' . $i . '" value="extension" onclick="javascript:document.' . $formName . '.goto' . $i . '.value=\'extension\';" onkeypress="javascript:if (event.keyCode == 0 || (document.all && event.keyCode == 13)) document.' . $formName . '.goto' . $i . '.value=\'extension\';" ' . (strpos($goto, 'ext-local') === false ? '' : 'CHECKED=CHECKED') . '/> ' . _("Extension") . ': ';
    $selectHtml .= '<select name="extension' . $i . '">';
    if (isset($extens)) {
        foreach ($extens as $exten) {
            $selectHtml .= '<option value="' . $exten[0] . '" ' . (strpos($goto, $exten[0]) === false ? '' : 'SELECTED') . '>' . $exten[1] . '</option>';
        }
    }
    $selectHtml .= '</select></td></tr>';
    $selectHtml .= '<tr><td><input type="radio" onFocus="this.blur()" name="goto_indicate' . $i . '" value="voicemail" onclick="javascript:document.' . $formName . '.goto' . $i . '.value=\'voicemail\';" onkeypress="javascript:if (event.keyCode == 0 || (document.all && event.keyCode == 13)) document.' . $formName . '.goto' . $i . '.value=\'voicemail\';" ' . (strpos($goto, 'vm') === false ? '' : 'CHECKED=CHECKED') . (strpos($goto, 'ext-local,${VM_PREFIX}') === false ? '' : 'CHECKED=CHECKED') . ' /> ' . _("Voicemail") . ': ';
    $selectHtml .= '<select name="voicemail' . $i . '">';
    if (isset($vmboxes)) {
        foreach ($vmboxes as $exten) {
            $selectHtml .= '<option value="' . $exten[0] . '" ' . (strpos($goto, $exten[0]) === false ? '' : 'SELECTED') . '>' . $exten[1] . '</option>';
        }
    }
    $selectHtml .= '</select></td></tr>';
    $selectHtml .= '<tr><td><input type="radio" onFocus="this.blur()" name="goto_indicate' . $i . '" value="group" onclick="javascript:document.' . $formName . '.goto' . $i . '.value=\'group\';" onkeypress="javascript:if (event.keyCode == 0 || (document.all && event.keyCode == 13)) document.' . $formName . '.goto' . $i . '.value=\'group\';" ' . (strpos($goto, 'ext-group') === false ? '' : 'CHECKED=CHECKED') . ' /> ' . _("Ring Group") . ': ';
    $selectHtml .= '<select name="group' . $i . '">';
    if (isset($gresults)) {
        foreach ($gresults as $gresult) {
            $selectHtml .= '<option value="' . $gresult[0] . '" ' . (strpos(',' . $goto . ',', ',' . $gresult[0] . ',') === false ? '' : 'SELECTED') . '>' . $gresult[0] . ':' . $gresult[1] . '</option>';
        }
    }
    $selectHtml .= '</select></td></tr>';
    $selectHtml .= '<tr><td><input type="radio" onFocus="this.blur()" name="goto_indicate' . $i . '" value="queue" onclick="javascript:document.' . $formName . '.goto' . $i . '.value=\'queue\';" onkeypress="javascript:if (event.keyCode == 0 || (document.all && event.keyCode == 13)) document.' . $formName . '.goto' . $i . '.value=\'queue\';" ' . (strpos($goto, 'ext-queues') === false ? '' : 'CHECKED=CHECKED') . ' /> ' . _("Queue") . ': ';
    $selectHtml .= '<select name="queue' . $i . '">';
    if (isset($queues)) {
        foreach ($queues as $queue) {
            $selectHtml .= '<option value="' . $queue[0] . '" ' . (strpos($goto, $queue[0]) === false ? '' : 'SELECTED') . '>' . $queue[0] . ':' . $queue[1] . '</option>';
        }
    }
    $selectHtml .= '</select></td></tr>';
    $selectHtml .= '<tr><td><input type="radio" onFocus="this.blur()" name="goto_indicate' . $i . '" value="miscdest" onclick="javascript:document.' . $formName . '.goto' . $i . '.value=\'miscdest\';" onkeypress="javascript:if (event.keyCode == 0 || (document.all && event.keyCode == 13)) document.' . $formName . '.goto' . $i . '.value=\'miscdest\';" ' . (strpos($goto, 'ext-miscdests') === false ? '' : 'CHECKED=CHECKED') . '/> ' . _("Misc Destinations") . ': ';
    $selectHtml .= '<select name="miscdest' . $i . '">';
    if (isset($miscdest)) {
        foreach ($miscdest as $miscdests) {
            $selectHtml .= '<option value="' . $miscdests[0] . '" ' . (strpos($goto, $miscdests[0]) === false ? '' : 'SELECTED') . '>' . $miscdests[0] . ':' . $miscdests[1] . '</option>';
        }
    }
    $selectHtml .= '</select></td></tr>';
    $selectHtml .= '<tr><td><input type="radio" onFocus="this.blur()" name="goto_indicate' . $i . '" value="dial" ' . (strpos($goto, 'outbound-allroutes') === false ? '' : 'CHECKED=CHECKED') . ' />';
    $selectHtml .= ' <a href="#" class="info">' . _("Custom Dial<span>You can include an extension on a remote system, or an external number (Outbound Routing must contain a valid route for external numbers)</span>") . '</a>:';
    $hackstart = strpos($goto, ',') + 1;
    $selectHtml .= '<input type="text" size="20" name="dial_args' . $i . '" value="' . (strpos($goto, 'outbound-allroutes') === false ? '' : substr($goto, $hackstart, -2)) . '" />';
    $selectHtml .= '</td></tr>';
    $selectHtml .= '</table>';
    return $selectHtml;
}