Initial commit
4
.env.example
Normal file
@@ -0,0 +1,4 @@
|
||||
# Asterisk configuration
|
||||
# Copy to .env and fill in your values
|
||||
ASTERISK_ADMIN_USER=admin
|
||||
ASTERISK_ADMIN_PASSWORD=change_me
|
||||
23
.gitignore
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# Environment variables
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
# Dependencies
|
||||
node_modules/
|
||||
vendor/
|
||||
|
||||
# Build output
|
||||
.next/
|
||||
dist/
|
||||
build/
|
||||
*.pyc
|
||||
__pycache__/
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
|
||||
219
old-asterisk/asterisk/static-http/ajamdemo.html
Normal file
@@ -0,0 +1,219 @@
|
||||
<script src="prototype.js"></script>
|
||||
<script src="astman.js"></script>
|
||||
<link href="astman.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
|
||||
<script>
|
||||
var logins = new Object;
|
||||
var logoffs = new Object;
|
||||
var channels = new Object;
|
||||
var pongs = new Object;
|
||||
var loggedon = -1;
|
||||
var selectedchan = null;
|
||||
var hungupchan = "";
|
||||
var transferedchan = "";
|
||||
|
||||
var demo = new Object;
|
||||
|
||||
function loggedOn() {
|
||||
if (loggedon == 1)
|
||||
return;
|
||||
loggedon = 1;
|
||||
updateButtons();
|
||||
$('statusbar').innerHTML = "<i>Retrieving channel status...</i>";
|
||||
astmanEngine.pollEvents();
|
||||
astmanEngine.sendRequest('action=status', demo.channels);
|
||||
}
|
||||
|
||||
function clearChannelList() {
|
||||
$('channellist').innerHTML = "<i class='light'>Not connected</i>";
|
||||
}
|
||||
|
||||
function loggedOff() {
|
||||
if (loggedon == 0)
|
||||
return;
|
||||
loggedon = 0;
|
||||
selectedchan = null;
|
||||
updateButtons();
|
||||
astmanEngine.channelClear();
|
||||
clearChannelList();
|
||||
}
|
||||
|
||||
function updateButtons()
|
||||
{
|
||||
if ($(selectedchan)) {
|
||||
$('transfer').disabled = 0;
|
||||
$('hangup').disabled = 0;
|
||||
} else {
|
||||
$('transfer').disabled = 1;
|
||||
$('hangup').disabled = 1;
|
||||
selectedchan = null;
|
||||
}
|
||||
if (loggedon) {
|
||||
$('username').disabled = 1;
|
||||
$('secret').disabled = 1;
|
||||
$('logoff').disabled = 0;
|
||||
$('login').disabled = 1;
|
||||
$('refresh').disabled = 0;
|
||||
} else {
|
||||
$('username').disabled = 0;
|
||||
$('secret').disabled = 0;
|
||||
$('logoff').disabled = 1;
|
||||
$('login').disabled = 0;
|
||||
$('refresh').disabled = 1;
|
||||
}
|
||||
}
|
||||
|
||||
demo.channelCallback = function(target) {
|
||||
selectedchan = target;
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
demo.channels = function(msgs) {
|
||||
resp = msgs[0].headers['response'];
|
||||
if (resp == "Success") {
|
||||
loggedOn();
|
||||
} else
|
||||
loggedOff();
|
||||
|
||||
for (i=1;i<msgs.length - 1;i++)
|
||||
astmanEngine.channelUpdate(msgs[i]);
|
||||
$('channellist').innerHTML = astmanEngine.channelTable(demo.channelCallback);
|
||||
$('statusbar').innerHTML = "Ready";
|
||||
}
|
||||
|
||||
demo.logins = function(msgs) {
|
||||
$('statusbar').innerHTML = msgs[0].headers['message'];
|
||||
resp = msgs[0].headers['response'];
|
||||
if (resp == "Success")
|
||||
loggedOn();
|
||||
else
|
||||
loggedOff();
|
||||
};
|
||||
|
||||
|
||||
demo.logoffs = function(msgs) {
|
||||
$('statusbar').innerHTML = msgs[0].headers['message'];
|
||||
loggedOff();
|
||||
};
|
||||
|
||||
demo.hungup = function(msgs) {
|
||||
$('statusbar').innerHTML = "Hungup " + hungupchan;
|
||||
}
|
||||
|
||||
demo.transferred = function(msgs) {
|
||||
$('statusbar').innerHTML = "Transferred " + transferredchan;
|
||||
}
|
||||
|
||||
function doHangup() {
|
||||
hungupchan = selectedchan;
|
||||
astmanEngine.sendRequest('action=hangup&channel=' + selectedchan, demo.hungup);
|
||||
}
|
||||
|
||||
function doStatus() {
|
||||
$('statusbar').innerHTML = "<i>Updating channel status...</i>";
|
||||
astmanEngine.channelClear();
|
||||
astmanEngine.sendRequest('action=status', demo.channels);
|
||||
}
|
||||
|
||||
function doLogin() {
|
||||
$('statusbar').innerHTML = "<i>Logging in...</i>";
|
||||
astmanEngine.sendRequest('action=login&username=' + $('username').value + "&secret=" + $('secret').value, demo.logins);
|
||||
}
|
||||
|
||||
function doTransfer() {
|
||||
var channel = astmanEngine.channelInfo(selectedchan);
|
||||
var exten = prompt("Enter new extension for " + selectedchan);
|
||||
var altchan;
|
||||
if (exten) {
|
||||
if (channel.link) {
|
||||
if (confirm("Transfer " + channel.link + " too?"))
|
||||
altchan = channel.link;
|
||||
}
|
||||
if (altchan) {
|
||||
transferredchan = selectedchan + " and " + altchan + " to " + exten;
|
||||
astmanEngine.sendRequest('action=redirect&channel=' + selectedchan + "&priority=1&extrachannel=" + altchan + "&exten=" + exten, demo.transferred);
|
||||
} else {
|
||||
transferredchan = selectedchan + " to " + exten;
|
||||
astmanEngine.sendRequest('action=redirect&channel=' + selectedchan + "&priority=1&exten=" + exten, demo.transferred);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function doLogoff() {
|
||||
$('statusbar').innerHTML = "<i>Logging off...</i>";
|
||||
astmanEngine.sendRequest('action=logoff', demo.logoffs);
|
||||
}
|
||||
|
||||
demo.pongs = function(msgs) {
|
||||
resp = msgs[0].headers['response'];
|
||||
if (resp == "Pong") {
|
||||
$('statusbar').innerHTML = "<i>Already connected...</i>";
|
||||
loggedOn();
|
||||
} else {
|
||||
$('statusbar').innerHTML = "<i>Please login...</i>";
|
||||
loggedOff();
|
||||
}
|
||||
}
|
||||
|
||||
demo.eventcb = function(msgs) {
|
||||
var x;
|
||||
if (loggedon) {
|
||||
for (i=1;i<msgs.length - 1;i++) {
|
||||
astmanEngine.channelUpdate(msgs[i]);
|
||||
}
|
||||
$('channellist').innerHTML = astmanEngine.channelTable(demo.channelCallback);
|
||||
astmanEngine.pollEvents();
|
||||
}
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
function localajaminit() {
|
||||
astmanEngine.setURL('../rawman');
|
||||
astmanEngine.setEventCallback(demo.eventcb);
|
||||
//astmanEngine.setDebug($('ditto'));
|
||||
clearChannelList();
|
||||
astmanEngine.sendRequest('action=ping', demo.pongs);
|
||||
}
|
||||
</script>
|
||||
|
||||
<title>Asterisk™ AJAM Demo</title>
|
||||
<body onload="localajaminit()">
|
||||
<table align="center" width=600>
|
||||
<tr valign="top"><td>
|
||||
<table align="left">
|
||||
<tr><td colspan="2"><h2>Asterisk™ AJAM Demo</h2></td>
|
||||
<tr><td>Username:</td><td><input id="username"></td></tr>
|
||||
<tr><td>Secret:</td><td><input type="password" id="secret"></td></tr>
|
||||
<tr><td colspan=2 align="center">
|
||||
<div id="statusbar">
|
||||
<span style="margin-left: 4px;font-weight:bold"> </span>
|
||||
</div>
|
||||
</td></tr>
|
||||
|
||||
<tr><td><input type="submit" id="login" value="Login" onClick="doLogin()"></td>
|
||||
<td><input type="submit" id="logoff" value="Logoff" disabled=1 onClick="doLogoff()"></td></tr>
|
||||
</table>
|
||||
</td><td valign='bottom'>
|
||||
<table>
|
||||
<div style="margin-left:10;margin-right:50;margin-top:10;margin-bottom:20">
|
||||
<i>This is a demo of the Asynchronous Javascript Asterisk Manager interface. You can login with a
|
||||
valid, appropriately permissioned manager username and secret.</i>
|
||||
</div>
|
||||
<tr>
|
||||
<td><input type="submit" onClick="doStatus()" id="refresh" value="Refresh"></td>
|
||||
<td><input type="submit" onClick="doTransfer()" id="transfer" value="Transfer..."></td>
|
||||
<td><input type="submit" onClick="doHangup()" id="hangup" value="Hangup"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td></tr>
|
||||
<tr><td colspan=2>
|
||||
<div id="channellist" class="chanlist">
|
||||
</div>
|
||||
</td></tr>
|
||||
<tr><td align="center" colspan=2>
|
||||
<font size=-1><i>
|
||||
Copyright (C) 2006 Digium, Inc. Asterisk and Digium are trademarks of Digium, Inc.
|
||||
</i></font>
|
||||
</td></tr>
|
||||
</table>
|
||||
</body>
|
||||
34
old-asterisk/asterisk/static-http/astman.css
Normal file
@@ -0,0 +1,34 @@
|
||||
.chanlist {
|
||||
border : 1px solid #1f669b;
|
||||
height : 150px;
|
||||
overflow : auto;
|
||||
background-color : #f1f1f1;
|
||||
width : 600;
|
||||
}
|
||||
|
||||
.chantable {
|
||||
border : 0px;
|
||||
background-color : #f1f1f1;
|
||||
width : 100%;
|
||||
}
|
||||
|
||||
.labels {
|
||||
background-color : #000000;
|
||||
color : #ffffff;
|
||||
}
|
||||
|
||||
.chanlisteven {
|
||||
background-color : #fff8e4;
|
||||
}
|
||||
|
||||
.chanlistodd {
|
||||
background-color : #f0f5ff;
|
||||
}
|
||||
|
||||
.chanlistselected {
|
||||
background-color : #ffb13d;
|
||||
}
|
||||
|
||||
.light {
|
||||
color : #717171;
|
||||
}
|
||||
262
old-asterisk/asterisk/static-http/astman.js
Normal file
@@ -0,0 +1,262 @@
|
||||
/*
|
||||
* Asterisk -- An open source telephony toolkit.
|
||||
*
|
||||
* Javascript routines or accessing manager routines over HTTP.
|
||||
*
|
||||
* Copyright (C) 1999 - 2006, Digium, Inc.
|
||||
*
|
||||
* Mark Spencer <markster@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function Astman() {
|
||||
var me = this;
|
||||
var channels = new Array;
|
||||
var lastselect;
|
||||
var selecttarget;
|
||||
this.setURL = function(url) {
|
||||
this.url = url;
|
||||
};
|
||||
this.setEventCallback = function(callback) {
|
||||
this.eventcallback = callback;
|
||||
};
|
||||
this.setDebug = function(debug) {
|
||||
this.debug = debug;
|
||||
};
|
||||
this.clickChannel = function(ev) {
|
||||
var target = ev.target;
|
||||
// XXX This is icky, we statically use astmanEngine to call the callback XXX
|
||||
if (me.selecttarget)
|
||||
me.restoreTarget(me.selecttarget);
|
||||
while(!target.id || !target.id.length)
|
||||
target=target.parentNode;
|
||||
me.selecttarget = target.id;
|
||||
target.className = "chanlistselected";
|
||||
me.chancallback(target.id);
|
||||
};
|
||||
this.restoreTarget = function(targetname) {
|
||||
var other;
|
||||
target = $(targetname);
|
||||
if (!target)
|
||||
return;
|
||||
if (target.previousSibling) {
|
||||
other = target.previousSibling.previousSibling.className;
|
||||
} else if (target.nextSibling) {
|
||||
other = target.nextSibling.nextSibling.className;
|
||||
}
|
||||
if (other) {
|
||||
if (other == "chanlisteven")
|
||||
target.className = "chanlistodd";
|
||||
else
|
||||
target.className = "chanlisteven";
|
||||
} else
|
||||
target.className = "chanlistodd";
|
||||
};
|
||||
this.channelUpdate = function(msg, channame) {
|
||||
var fields = new Array("callerid", "calleridname", "context", "extension", "priority", "account", "state", "link", "uniqueid" );
|
||||
|
||||
if (!channame || !channame.length)
|
||||
channame = msg.headers['channel'];
|
||||
|
||||
if (!channels[channame])
|
||||
channels[channame] = new Array();
|
||||
|
||||
if (msg.headers.event) {
|
||||
if (msg.headers.event == "Hangup") {
|
||||
delete channels[channame];
|
||||
} else if (msg.headers.event == "Link") {
|
||||
var chan1 = msg.headers.channel1;
|
||||
var chan2 = msg.headers.channel2;
|
||||
if (chan1 && channels[chan1])
|
||||
channels[chan1].link = chan2;
|
||||
if (chan2 && channels[chan2])
|
||||
channels[chan2].link = chan1;
|
||||
} else if (msg.headers.event == "Unlink") {
|
||||
var chan1 = msg.headers.channel1;
|
||||
var chan2 = msg.headers.channel2;
|
||||
if (chan1 && channels[chan1])
|
||||
delete channels[chan1].link;
|
||||
if (chan2 && channels[chan2])
|
||||
delete channels[chan2].link;
|
||||
} else if (msg.headers.event == "Rename") {
|
||||
var oldname = msg.headers.oldname;
|
||||
var newname = msg.headers.newname;
|
||||
if (oldname && channels[oldname]) {
|
||||
channels[newname] = channels[oldname];
|
||||
delete channels[oldname];
|
||||
}
|
||||
} else {
|
||||
channels[channame]['channel'] = channame;
|
||||
for (x=0;x<fields.length;x++) {
|
||||
if (msg.headers[fields[x]])
|
||||
channels[channame][fields[x]] = msg.headers[fields[x]];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
channels[channame]['channel'] = channame;
|
||||
for (x=0;x<fields.length;x++) {
|
||||
if (msg.headers[fields[x]])
|
||||
channels[channame][fields[x]] = msg.headers[fields[x]];
|
||||
}
|
||||
}
|
||||
};
|
||||
this.channelClear = function() {
|
||||
channels = new Array;
|
||||
}
|
||||
this.channelInfo = function(channame) {
|
||||
return channels[channame];
|
||||
};
|
||||
this.channelTable = function(callback) {
|
||||
var s, x;
|
||||
var cclass, count=0;
|
||||
var found = 0;
|
||||
var foundactive = 0;
|
||||
var fieldlist = new Array("channel", "callerid", "calleridname", "context", "extension", "priority");
|
||||
|
||||
me.chancallback = callback;
|
||||
s = "<table class='chantable' align='center'>\n";
|
||||
s = s + "\t<tr class='labels' id='labels'><td>Channel</td><td>State</td><td>Caller</td><td>Location</td><td>Link</td></tr>";
|
||||
count=0;
|
||||
for (x in channels) {
|
||||
if (channels[x].channel) {
|
||||
if (count % 2)
|
||||
cclass = "chanlistodd";
|
||||
else
|
||||
cclass = "chanlisteven";
|
||||
if (me.selecttarget && (me.selecttarget == x)) {
|
||||
cclass = "chanlistselected";
|
||||
foundactive = 1;
|
||||
}
|
||||
count++;
|
||||
s = s + "\t<tr class='" + cclass + "' id='" + channels[x].channel + "' onClick='astmanEngine.clickChannel(event)'>";
|
||||
s = s + "<td>" + channels[x].channel + "</td>";
|
||||
if (channels[x].state)
|
||||
s = s + "<td>" + channels[x].state + "</td>";
|
||||
else
|
||||
s = s + "<td><i class='light'>unknown</i></td>";
|
||||
if (channels[x].calleridname && channels[x].callerid && channels[x].calleridname != "<unknown>") {
|
||||
cid = channels[x].calleridname.escapeHTML() + " <" + channels[x].callerid.escapeHTML() + ">";
|
||||
} else if (channels[x].calleridname && (channels[x].calleridname != "<unknown>")) {
|
||||
cid = channels[x].calleridname.escapeHTML();
|
||||
} else if (channels[x].callerid) {
|
||||
cid = channels[x].callerid.escapeHTML();
|
||||
} else {
|
||||
cid = "<i class='light'>Unknown</i>";
|
||||
}
|
||||
s = s + "<td>" + cid + "</td>";
|
||||
if (channels[x].extension) {
|
||||
s = s + "<td>" + channels[x].extension + "@" + channels[x].context + ":" + channels[x].priority + "</td>";
|
||||
} else {
|
||||
s = s + "<td><i class='light'>None</i></td>";
|
||||
}
|
||||
if (channels[x].link) {
|
||||
s = s + "<td>" + channels[x].link + "</td>";
|
||||
} else {
|
||||
s = s + "<td><i class='light'>None</i></td>";
|
||||
}
|
||||
s = s + "</tr>\n";
|
||||
found++;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
s += "<tr><td colspan=" + fieldlist.length + "><i class='light'>No active channels</i></td>\n";
|
||||
s += "</table>\n";
|
||||
if (!foundactive) {
|
||||
me.selecttarget = null;
|
||||
}
|
||||
return s;
|
||||
};
|
||||
this.parseResponse = function(t, callback) {
|
||||
var msgs = new Array();
|
||||
var inmsg = 0;
|
||||
var msgnum = 0;
|
||||
var x,y;
|
||||
var s = t.responseText;
|
||||
var allheaders = s.split('\r\n');
|
||||
if (me.debug)
|
||||
me.debug.value = "\n";
|
||||
for (x=0;x<allheaders.length;x++) {
|
||||
if (allheaders[x].length) {
|
||||
var fields = allheaders[x].split(': ');
|
||||
if (!inmsg) {
|
||||
msgs[msgnum] = new Object();
|
||||
msgs[msgnum].headers = new Array();
|
||||
msgs[msgnum].names = new Array();
|
||||
y=0;
|
||||
}
|
||||
msgs[msgnum].headers[fields[0].toLowerCase()] = fields[1];
|
||||
msgs[msgnum].names[y++] = fields[0].toLowerCase();
|
||||
if (me.debug)
|
||||
me.debug.value = me.debug.value + "field " + fields[0] + "/" + fields[1] + "\n";
|
||||
inmsg=1;
|
||||
} else {
|
||||
if (inmsg) {
|
||||
if (me.debug)
|
||||
me.debug.value = me.debug.value + " new message\n";
|
||||
inmsg = 0;
|
||||
msgnum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (me.debug) {
|
||||
me.debug.value = me.debug.value + "msgnum is " + msgnum + " and array length is " + msgs.length + "\n";
|
||||
me.debug.value = me.debug.value + "length is " + msgs.length + "\n";
|
||||
var x, y;
|
||||
for (x=0;x<msgs.length;x++) {
|
||||
for (y=0;y<msgs[x].names.length;y++) {
|
||||
me.debug.value = me.debug.value + "msg "+ (x + 1) + "/" + msgs[x].names[y] + "/" + msgs[x].headers[msgs[x].names[y]] + "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
callback(msgs);
|
||||
};
|
||||
this.managerResponse = function(t) {
|
||||
me.parseResponse(t, me.callback);
|
||||
};
|
||||
this.doEvents = function(msgs) {
|
||||
me.eventcallback(msgs);
|
||||
};
|
||||
this.eventResponse = function(t) {
|
||||
me.parseResponse(t, me.doEvents);
|
||||
};
|
||||
this.sendRequest = function(request, callback) {
|
||||
var tmp;
|
||||
var opt = {
|
||||
method: 'get',
|
||||
asynchronous: true,
|
||||
onSuccess: this.managerResponse,
|
||||
onFailure: function(t) {
|
||||
alert("Error: " + t.status + ": " + t.statusText);
|
||||
}
|
||||
};
|
||||
me.callback = callback;
|
||||
opt.parameters = request;
|
||||
tmp = new Ajax.Request(this.url, opt);
|
||||
};
|
||||
this.pollEvents = function() {
|
||||
var tmp;
|
||||
var opt = {
|
||||
method: 'get',
|
||||
asynchronous: true,
|
||||
onSuccess: this.eventResponse,
|
||||
onFailure: function(t) {
|
||||
alert("Event Error: " + t.status + ": " + t.statusText);
|
||||
}
|
||||
};
|
||||
opt.parameters="action=waitevent";
|
||||
tmp = new Ajax.Request(this.url, opt);
|
||||
};
|
||||
};
|
||||
|
||||
astmanEngine = new Astman();
|
||||
1
old-asterisk/asterisk/static-http/config/Master.csv
Symbolic link
@@ -0,0 +1 @@
|
||||
/var/log/asterisk/cdr-csv/Master.csv
|
||||
|
72
old-asterisk/asterisk/static-http/config/asterisklogs.html
Normal file
@@ -0,0 +1,72 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Asterisk Log Files
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Brandon Kruse <bkruse@digium.com>
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>System Log</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css"></style>
|
||||
</head>
|
||||
<body bgcolor="EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
Asterisk Log messages
|
||||
<span class="refresh_icon" onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
<input size=10 id="log_date">
|
||||
<span class="guiButton" onclick="load_tmp_logs();">Go</span>
|
||||
</div>
|
||||
|
||||
<div id="todaylog" style="font-family:courier; font-size:8.5pt; margin: 1px ; padding: 1px ; height:475px; overflow :auto;"></div>
|
||||
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/jquery.tooltip.js"></script>
|
||||
<script src="js/jquery.date_input.js"></script>
|
||||
<script>
|
||||
|
||||
var load_tmp_logs = function(){
|
||||
var sel_date = _$("log_date").value.trim() ;
|
||||
if(!sel_date ){ return ; }
|
||||
var ld = Number( sel_date.split(' ')[0] );
|
||||
var space = (ld < 10 ) ? ' ' : ' ' ;
|
||||
var lm = sel_date.split(' ')[1]; lm = lm.trim();
|
||||
var tmp_cmd = "/bin/grep /var/log/asterisk/messages -e '" + lm + space + ld + " ' " ;
|
||||
parent.ASTGUI.dialog.waitWhile(' Loading Asterisk Logs ...');
|
||||
top.log.debug(tmp_cmd);
|
||||
ASTGUI.systemCmdWithOutput( tmp_cmd , function(output){
|
||||
parent.ASTGUI.dialog.hide();
|
||||
_$('todaylog').innerHTML = (output) ? "<PRE>" + output.escapeHTML() + "</PRE>" : "No log messages found on this Day" ;
|
||||
});
|
||||
};
|
||||
|
||||
var localajaxinit = function(){
|
||||
top.document.title = 'System Log';
|
||||
$("#log_date").date_input();
|
||||
var rz = function(){ var i = $(window).height(); _$('todaylog').style.height = (i - 35); };
|
||||
ASTGUI.events.add( window , 'resize', rz );
|
||||
rz();
|
||||
ASTGUI.systemCmdWithOutput( " echo '' ", function(output){}); // clean up output file
|
||||
};
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
128
old-asterisk/asterisk/static-http/config/backup.html
Normal file
@@ -0,0 +1,128 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Configuration for "Backup / Restore"
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Backup / Restore Configurations</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/backup.js"></script>
|
||||
<style type="text/css">
|
||||
#table_one tr{
|
||||
background: #6b79a5;
|
||||
color: #CED7EF;
|
||||
}
|
||||
|
||||
#nocf {
|
||||
font-size: 13pt;
|
||||
border:1px solid;
|
||||
padding : 10;
|
||||
margin-left : 15;
|
||||
margin-right : 15;
|
||||
margin-top : 25;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#thispageContent{
|
||||
/*
|
||||
font-size: 10pt;
|
||||
margin-left : 15;
|
||||
margin-top : 15;
|
||||
*/
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
Backup / Restore Configurations
|
||||
<span class='refresh_icon' onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
<div style='display:none;' id='nocf'> You need a <b>CompactFlash®</b> to use this feature </div>
|
||||
|
||||
<div id='backup_download_Link' style='display:none; background: #FFFFFF; border-style : solid; border-width: 1px ; border-color: #bdc7e7; border-style: solid ; margin:20px ; padding: 10px ;' >
|
||||
<span style="float:right; font-size: 85%;" onclick="$('#backup_download_Link').hide();"><a href='#'>close</a></span>
|
||||
<div id='backup_download_Link_url'></div>
|
||||
</div>
|
||||
|
||||
<div id='thispageContent' style='text-align:center;'>
|
||||
<div class='lite_Heading'>Manage Configuration Backups</div>
|
||||
<center>
|
||||
<fieldset style="font-size : 13px; width: 745px;" id='uploadForm_container'>
|
||||
<legend><B> Upload a previous backup file : </B></legend>
|
||||
<IFRAME src="upload_form.html" id="uploadiframe" width="480" height="100" frameborder="0" border="0" marginheight="0" marginwidth="0"></IFRAME>
|
||||
</fieldset>
|
||||
|
||||
<div style='margin-top:20px; margin-bottom:10px;'><span class='guiButtonNew' id="takebkp" onclick='take_bkp();'>Create New Backup</span></div>
|
||||
|
||||
<fieldset style="font-size : 13px; height: 230px; width: 845px" id="fieldset2">
|
||||
<legend><B> List of Previous Configuration Backups : </B></legend>
|
||||
<table id="table_one" cellpadding=3 cellspacing=1 border=0 align=center width=800>
|
||||
<tr> <td width=35>S.No</td>
|
||||
<td width="180">Name</td>
|
||||
<td width="125">Date</td>
|
||||
<td align="center">Options</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="bkpfilesTable_div" style="height:200px;width=100%; overflow :auto; padding : 0px 0px 0px 0px;">
|
||||
<table id="bkpfilesTable" cellpadding=2 cellspacing=1 border=0 align=center width=800></table>
|
||||
</div>
|
||||
</fieldset>
|
||||
</center>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="newbkp_content" STYLE="width:450; height:150;display:none;" class='dialog'>
|
||||
<TABLE width="100%" cellpadding=0 cellspacing=0>
|
||||
<TR class="dialog_title_tr">
|
||||
<TD class="dialog_title" onmousedown="ASTGUI.startDrag(event);">Create New Backup</TD>
|
||||
<TD class="dialog_title_X" onclick="ASTGUI.hideDrag(event);"> X </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<table cellpadding=2 cellspacing=2 border=0 width="100%" align="center">
|
||||
<tr> <td colspan=2 height=20 valign=middle align=center class="field_text"></td> </tr>
|
||||
<tr> <td class="field_text" align="right">File Name: </td>
|
||||
<td><input id='newbkp_name' size=25 class="input9" validation='alphanumericUnd' required='yes'></td>
|
||||
</tr>
|
||||
|
||||
<tr class='AA50only'> <td colspan=2 align=center height=6></td> </tr>
|
||||
<tr class='AA50only'>
|
||||
<td valign=top align="right">
|
||||
<input type='checkbox' id='newbkp_completeBackup' class="input9">
|
||||
</td>
|
||||
<td class="field_text">
|
||||
<label for='newbkp_completeBackup'>Also backup Voicemails & Custom Prompts</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr> <td colspan=2 align=center height=6></td> </tr>
|
||||
|
||||
<tr> <td colspan=2 align=center>
|
||||
<span class='guiButtonCancel' id="cancel_a" onclick='cancel_newbackup();'>Cancel</span>
|
||||
<span class='guiButtonEdit' id="getbackup" onclick='backup_new();'>Backup</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr> <td colspan=2 align=center height=16></td> </tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
0
old-asterisk/asterisk/static-http/config/blank.html
Normal file
82
old-asterisk/asterisk/static-http/config/bulkadd.html
Normal file
@@ -0,0 +1,82 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Bulk Add
|
||||
*
|
||||
* Copyright (C) 2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Bulk Add</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css"></style>
|
||||
</head>
|
||||
<body bgcolor="EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
Bulk Add <span class='refresh_icon' onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
|
||||
<div class='lite_Heading'>Bulk Add</div>
|
||||
|
||||
<center><div id="tabbedMenu"></div></center>
|
||||
|
||||
<table width='98%' align=center id='table_usersFromCSV'>
|
||||
<tr><td align=center>
|
||||
<BR>
|
||||
The below input box is for inputting configuration data for multiple Users at one time.<br>
|
||||
<br>
|
||||
The first line of the text input into the box should be populated by a comma separated<br>listing of the user variables,
|
||||
beginning with the keyword "User," as such:<br>
|
||||
<br>
|
||||
User, fullname, host, type, cid_number, context, hasvoicemail, vmsecret, email, hassip, hasiax, secret<br>
|
||||
<br>
|
||||
A carriage return should follow this line.<br>
|
||||
<br>
|
||||
Each following line should contain the data that corresponds to each of the variables such as:<br>
|
||||
<br>
|
||||
<p style='font-family: monospace, monospace'>6020, Bob Jones, dynamic, peer, 6020, DLPN_Default_DialPlan, yes, 1234, bob@jones.null, yes, yes, mypassword<br>
|
||||
6021, Jane Doe, dynamic, peer, 6021, DLPN_Default_DialPlan, yes, 5678, jane@doe.null, yes, yes, otherpassword</p>
|
||||
</td></tr>
|
||||
<tr><td align=center>
|
||||
<textarea id='ta_ba_csv' rows=10 cols=120></textarea>
|
||||
</td></tr>
|
||||
<tr><td align=center>
|
||||
<span class="guiButton" onclick="addUsers_from_CSV_field()">Add</span>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
<table width='700' align=center id='table_usersFromRange'>
|
||||
<tr>
|
||||
<td align=center>Create <select id='RANGE_Number'></select> Users Starting from Extension <input id='RANGE_Start' size=3> </td>
|
||||
</tr>
|
||||
<tr> <td align=center>
|
||||
<BR>
|
||||
<span class="guiButton" onclick="add_RangeOfUsers()"> Create Users </span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center><BR><BR><B>Tip:</B> Use the 'Modify Selected Users' button from the Users page to edit any options for the created users.</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/bulkadd.js"></script>
|
||||
<script src="js/jquery.tooltip.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
174
old-asterisk/asterisk/static-http/config/callingrules.html
Normal file
@@ -0,0 +1,174 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Manage Calling Rules
|
||||
*
|
||||
* Copyright (C) 2006-2010, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
* Ryan Brindley <rbrindley@digium.com>
|
||||
* Erin Spiceland <espiceland@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Manage Calling Rules</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
#table_CRLS_list {
|
||||
border: 1px solid #666666;
|
||||
margin-top: 5px;
|
||||
margin-bottom:10px;
|
||||
width: 96%;
|
||||
text-align: center;
|
||||
padding : 1px;
|
||||
}
|
||||
#table_CRLS_list tr.frow { background: #6b79a5; color: #CED7EF; }
|
||||
#table_CRLS_list tr.frow td{ font-weight:bold; }
|
||||
#table_CRLS_list tr td{ padding : 3px; }
|
||||
#table_CRLS_list tr.even { background: #DFDFDF; }
|
||||
#table_CRLS_list tr.odd{ background: #FFFFFF; }
|
||||
#table_CRLS_list tr.even:hover, #table_CRLS_list tr.odd:hover {
|
||||
background: #a8b6e5;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
Manage Calling Rules
|
||||
<span style="cursor: pointer; cursor: hand;" onclick="window.location.reload();" >
|
||||
<img src="images/refresh.png" title=" Refresh " border=0 >
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='top_buttons'>
|
||||
<span id='new_cr_button' class='guiButtonNew'>New Calling Rule</span>
|
||||
<span id='restore_default_clrs_button' class='guiButton'>Restore Default Calling Rules</span>
|
||||
<!--<input type=button id='deleted_crs' class='regularButton' value='Delete'>-->
|
||||
<span class='lite_Heading' style='margin-left:30px'>Outgoing Calling Rules</span>
|
||||
</div>
|
||||
|
||||
<center>
|
||||
<div style='text-align:center; background-color : #FFFFFF; width: 95%; padding: 5px; margin-left: 1px; margin-top:14px; margin-bottom:20px; border:1px solid #CDCDCD; color: #575757 ' class='lite'>
|
||||
An outgoing calling rule pairs an extension pattern with a trunk used to dial the pattern. This allows different patterns to be dialed through different trunks (e.g. "local" 7-digit dials through an FXO but "long distance" 10-digit dials through a low-cost SIP trunk). You can optionally set a failover trunk to use when the primary trunk fails. Note that this panel manages only individual outgoing call rules. See the Dial Plans <hyperlink> section to associate multiple outgoing calling rules to be used for User outbound dialing.
|
||||
</div>
|
||||
</center>
|
||||
|
||||
|
||||
<table id='table_CRLS_list' cellpadding=0 cellspacing=0 border=0 align=center></table>
|
||||
|
||||
<div id="new_CRL_DIV" STYLE="width:650;display:none;" class='dialog'>
|
||||
<TABLE width="100%" cellpadding=0 cellspacing=0>
|
||||
<TR class="dialog_title_tr">
|
||||
<TD class="dialog_title" onmousedown="ASTGUI.startDrag(event);"><span id='cr_dialog_title'></span></TD>
|
||||
<TD class="dialog_title_X" onclick="ASTGUI.hideDrag(event);"> X </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<TABLE align=center cellpadding=2 cellspacing=2 border=0>
|
||||
<TR> <TD align="right">Calling Rule Name <img src="images/tooltip_info.gif" tip="en,callingrules,0" class='tooltipinfo'> :</TD>
|
||||
<TD><input id="new_crl_name" size=20 field_name='Calling Rule Name' validation='alphanumericUnd' required='yes'></TD>
|
||||
</TR>
|
||||
<TR> <TD align="right">Pattern <img src="images/tooltip_info.gif" tip="en,callingrules,1" class='tooltipinfo'> :</TD>
|
||||
<TD><input id="new_crl_pattern" size=20 field_name='Pattern' validation='dialpattern' required='yes'></TD>
|
||||
</TR>
|
||||
<TR> <TD align="right">Caller ID<img src="images/tooltip_info.gif" tip="en,callingrules,8" class='tooltipinfo'> :</TD>
|
||||
<TD><input id="new_crl_caller_id" size=20'></TD>
|
||||
</TR>
|
||||
<TR> <TD colspan=2>
|
||||
<fieldset>
|
||||
<legend> <input type=checkbox id='toLocalDest' required="yes">
|
||||
<label for='toLocalDest'>Send to Local Destination
|
||||
<img src="images/tooltip_info.gif" tip="en,callingrules,5" class='tooltipinfo'>
|
||||
</label>
|
||||
</legend>
|
||||
<table width='580'>
|
||||
<TR> <TD align="right" width='40%' valign='top'>Destination :</TD>
|
||||
<TD>
|
||||
<select id='new_crl_localDest'></select>
|
||||
<div id='new_crl_localDest_CUSTOM_container' style='margin-top:3px;display:none'>
|
||||
<input id='new_crl_localDest_CUSTOM' size=30> <BR>
|
||||
Ex: Macro(someMacro,${EXTEN:1})
|
||||
</div>
|
||||
</TD>
|
||||
</TR>
|
||||
</table>
|
||||
</fieldset>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR class='STT_TR_OPTIONS'> <TD colspan=2>
|
||||
<fieldset>
|
||||
<legend> Send this call through trunk: </legend>
|
||||
<table width='580'>
|
||||
<TR> <TD align="right" width='40%'>Use Trunk <img src="images/tooltip_info.gif" tip="en,callingrules,6" class='tooltipinfo'> </TD>
|
||||
<TD><select id='new_crl_trunk' required="yes"></select></TD>
|
||||
</TR>
|
||||
<TR> <TD align=right>Strip <img src="images/tooltip_info.gif" tip="en,callingrules,2" class='tooltipinfo'> </TD>
|
||||
<TD> <input id="new_crl_tr_stripx" size=1 validation='numeric'> digits from front </TD>
|
||||
</TR>
|
||||
<TR> <TD align=right> and Prepend these digits
|
||||
<img src="images/tooltip_info.gif" tip="en,callingrules,3" class='tooltipinfo'>
|
||||
</TD>
|
||||
<TD> <input id="new_crl_tr_prepend" size=3 validation='numeric_plus_w'> before dialing</TD>
|
||||
</TR>
|
||||
<TR> <TD align=right> using this filter: <img src="images/tooltip_info.gif" tip="en,callingrules,7" class='tooltipinfo'>
|
||||
</TD>
|
||||
<TD> <input id="new_crl_tr_filter" size=3 validation='required'></TD>
|
||||
</TR>
|
||||
</table>
|
||||
</fieldset>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR class='STT_TR_OPTIONS'>
|
||||
<TD colspan=2>
|
||||
<fieldset>
|
||||
<legend> <input type=checkbox id='new_crl_foChkbx' > <label for='new_crl_foChkbx'>Use FailOver Trunk <img src="images/tooltip_info.gif" tip="en,callingrules,4" class='tooltipinfo'> :</label> </legend>
|
||||
<table width='580'>
|
||||
<TR> <TD align="right" width='40%'>fail over Trunk <img src="images/tooltip_info.gif" tip="en,callingrules,4" class='tooltipinfo'> </TD>
|
||||
<TD><select id='new_crl_fotrunk'></select></TD>
|
||||
</TR>
|
||||
<TR> <TD align=right>Strip <img src="images/tooltip_info.gif" tip="en,callingrules,2" class='tooltipinfo'> </TD>
|
||||
<TD> <input id="new_crl_fotr_stripx" size=1 validation='numeric'> digits from front </TD>
|
||||
</TR>
|
||||
<TR> <TD align=right> and Prepend these digits
|
||||
<img src="images/tooltip_info.gif" tip="en,callingrules,3" class='tooltipinfo'>
|
||||
</TD>
|
||||
<TD> <input id="new_crl_fotr_prepend" size=3 validation='numeric_plus_w'> before dialing</TD>
|
||||
</TR>
|
||||
<TR> <TD align=right> using this filter: <img src="images/tooltip_info.gif" tip="en,callingrules,7" class='tooltipinfo'>
|
||||
</TD>
|
||||
<TD> <input id="new_crl_fotr_filter" size=3 validation='required'></TD>
|
||||
</TR>
|
||||
</table>
|
||||
</fieldset>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR> <TD colspan=2 align=center height=50 valign=middle>
|
||||
<span class='guiButtonCancel' onclick='ASTGUI.hideDrag(event);'>Cancel</span>
|
||||
<span class='guiButtonEdit' onclick='new_crl_save_go();'>Save</span>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</div>
|
||||
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/callingrules.js"></script>
|
||||
<script src="js/jquery.tooltip.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
113
old-asterisk/asterisk/static-http/config/cdr.html
Normal file
@@ -0,0 +1,113 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* CDR Reader - show cdr entries from Master.csv
|
||||
*
|
||||
* Copyright (C) 2008, Digium, Inc.
|
||||
*
|
||||
* Brett Bryant <bbryant@digium.com>
|
||||
* Brandon Kruse <bkruse@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CDR Viewer</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
div#cdr_content_container {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.table_CDR {
|
||||
border: 1px solid #666666;
|
||||
border-collapse: collapse;
|
||||
margin-top: 0px;
|
||||
margin-bottom:10px;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
padding: 3px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.table_CDR thead { background: #6b79a5; color: #CED7EF;}
|
||||
.table_CDR thead th{ font-weight:bold; cursor: pointer; cursor: hand;}
|
||||
.table_CDR tr td{ padding : 3px; }
|
||||
.table_CDR tr.even { background: #DFDFDF; }
|
||||
.table_CDR tr.odd{ background: #FFFFFF; }
|
||||
.table_CDR tr.even:hover, .table_CDR tr.odd:hover {
|
||||
background: #a8b6e5;
|
||||
cursor: pointer; cursor: hand;
|
||||
}
|
||||
|
||||
.info {
|
||||
font-size: small;
|
||||
color: #6b79a5;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
CDR Viewer (<span id="engine"></span>) <span class='refresh_icon' onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
|
||||
<div class='lite_Heading'>Call Detail Report</div>
|
||||
<div style="float: right; font-size: medium; color: #6b79a5;">
|
||||
View:
|
||||
<select id="selectViewCount">
|
||||
<option value="25">25</option>
|
||||
<option value="100">100</option>
|
||||
<option value="500">500</option>
|
||||
<option value="-1">all</option>
|
||||
</select>
|
||||
</div>
|
||||
<div style='margin-left: 10px; overflow:auto;'>
|
||||
<input type='checkbox' id='showInbound'>Inbound calls<img src="images/tooltip_info.gif" tip="en,CDR,1" class='tooltipinfo'>
|
||||
<input type='checkbox' id='showOutbound'>Outbound calls<img src="images/tooltip_info.gif" tip="en,CDR,2" class='tooltipinfo'>
|
||||
<input type='checkbox' id='showInternal'>Internal calls<img src="images/tooltip_info.gif" tip="en,CDR,3" class='tooltipinfo'>
|
||||
<input type='checkbox' id='showExternal'>External calls<img src="images/tooltip_info.gif" tip="en,CDR,4" class='tooltipinfo'>
|
||||
<br>
|
||||
<input type='checkbox' id='longFields'>Show all fields<img src="images/tooltip_info.gif" tip="en,CDR,5" class='tooltipinfo'>
|
||||
<input type='checkbox' id='showSystem'>Show system calls<img src="images/tooltip_info.gif" tip="en,CDR,0" class='tooltipinfo'>
|
||||
</div>
|
||||
<!-- <a href="cdr_conf.html" target="_self">Configure CDRs</a></div> -->
|
||||
<div class='top_buttons' style="color: #6b79a5;">
|
||||
<div id="info" class="info"></div>
|
||||
<span id='prevPageBtn' class='guiButton' onclick="javascript: prevPage();">Previous</span>
|
||||
<span id='nextPageBtn' class='guiButton' onclick="javascript: nextPage();">Next</span>
|
||||
Click on column header to sort by that column. Click on row to display full record.
|
||||
</div>
|
||||
<div id='cdr_content_container' style='margin-left: 10px; overflow:auto;'>
|
||||
</div>
|
||||
<div id="cdr_calldetail_DIV" STYLE="width:620; display:none;" class='dialog'>
|
||||
<TABLE width="100%" cellpadding=0 cellspacing=0>
|
||||
<TR class="dialog_title_tr">
|
||||
<TD class="dialog_title" onmousedown="ASTGUI.startDrag(event);">
|
||||
<span id='cdr_calldetail_Title'>Call Detail Record</span>
|
||||
</TD>
|
||||
<TD class="dialog_title_X" onclick="ASTGUI.hideDrag(event);"> X </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<TABLE align=left cellpadding=2 cellspacing=2 border=0>
|
||||
<TR id='cdr_calldetail_table'>
|
||||
<TD id='cdr_calldetail_text'>Text here</TD>
|
||||
</TR>
|
||||
</div>
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/cdr.js"></script>
|
||||
<script src="js/jquery.tooltip.js"></script>
|
||||
<script src="js/jquery.fixedheader.js"></script> <!-- OPTIONAL, for fixed table header. Need not be present -->
|
||||
</body>
|
||||
</html>
|
||||
8
old-asterisk/asterisk/static-http/config/cfgbasic.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<HEAD>
|
||||
<title>Asterisk Configuration</title>
|
||||
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=index.html">
|
||||
</HEAD>
|
||||
<body>
|
||||
Your browser should automatically go to the configuration page.<br>
|
||||
Or you can <a href="index.html">click here</a><br>
|
||||
</body>
|
||||
104
old-asterisk/asterisk/static-http/config/cli.html
Normal file
@@ -0,0 +1,104 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Asterisk CLI emulator
|
||||
*
|
||||
* Copyright (C) 2006-2007, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Asterisk CLI</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body onload="localajaxinit()" bgcolor="#FFFFFF">
|
||||
<div style="font-size : 12px; padding : 4px 6px 4px 6px; border-style : solid none solid none; border-top-color : #BDC7E7; border-bottom-color : #182052; border-width : 1px 0px 1px 0px; background-color : #ef8700; color : #ffffff;">
|
||||
<span style="cursor: pointer; cursor: hand;" onclick="window.location.href=window.location.href;" > <img src="images/refresh.png" title=" Refresh" border=0 > </span>
|
||||
<span style="margin-left: 4px;font-weight:bold;">
|
||||
Asterisk CLI> <input id="cli_cmd" onKeyDown="sendCommand(event)" size=65>
|
||||
</span>
|
||||
</div>
|
||||
<div style="padding : 0px 1px 0px 2px; overflow :auto; font-size : 12px;" id="cli_output"></div>
|
||||
<script>
|
||||
var DOM_CLI_CMD ;
|
||||
var CLIINDEX = 0;
|
||||
|
||||
var setIndexToLastCommand = function(){
|
||||
CLIINDEX = parent.sessionData.cliHistory.length - 1 ;
|
||||
}
|
||||
|
||||
var showCommandWithIndex = function(){
|
||||
DOM_CLI_CMD.value = (parent.sessionData.cliHistory[CLIINDEX]) ? parent.sessionData.cliHistory[CLIINDEX] : '';
|
||||
}
|
||||
|
||||
function executeCommand(cmd){
|
||||
cmd = cmd.replace(/^\s+|\s+$/g, "");
|
||||
if(!cmd ){ DOM_CLI_CMD.value = ''; DOM_CLI_CMD.focus(); return ;}
|
||||
if(cmd == 'stop now' ){
|
||||
parent.ASTGUI.feedback( { msg:'restricted command', showfor:2 });
|
||||
DOM_CLI_CMD.select();
|
||||
DOM_CLI_CMD.focus();
|
||||
return ;
|
||||
}
|
||||
var t = parent.ASTGUI.cliCommand(cmd) ;
|
||||
var response = parent.ASTGUI.parseCLIResponse(t) ;
|
||||
parent.sessionData.cliHistory.push(cmd) ;
|
||||
setIndexToLastCommand(); CLIINDEX++ ;
|
||||
document.getElementById('cli_output').innerHTML = 'Command><B><Font color=#13138a>' + cmd + '</FONT></B><PRE>' + response + '</PRE>' ;
|
||||
DOM_CLI_CMD.value = '' ;
|
||||
DOM_CLI_CMD.focus() ;
|
||||
}
|
||||
|
||||
function sendCommand(e){
|
||||
if(e.keyCode == 38){ // UP Key
|
||||
if( CLIINDEX <= 0 ) {
|
||||
setIndexToLastCommand();
|
||||
showCommandWithIndex();
|
||||
return;
|
||||
}
|
||||
CLIINDEX -- ;
|
||||
showCommandWithIndex();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(e.keyCode == 40){ // Down Key
|
||||
if( CLIINDEX == (parent.sessionData.cliHistory.length - 1) ) {
|
||||
DOM_CLI_CMD.value = ''; CLIINDEX++ ;
|
||||
return;
|
||||
}
|
||||
CLIINDEX += 1;
|
||||
showCommandWithIndex();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(e.keyCode == 13){
|
||||
executeCommand( DOM_CLI_CMD.value );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var localajaxinit = function(){
|
||||
top.document.title = "Asterisk CLI Emulator";
|
||||
DOM_CLI_CMD = document.getElementById('cli_cmd');
|
||||
DOM_CLI_CMD.focus();
|
||||
DOM_CLI_CMD.value = "core show version";
|
||||
executeCommand(DOM_CLI_CMD.value);
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
176
old-asterisk/asterisk/static-http/config/date.html
Normal file
@@ -0,0 +1,176 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Set Date on the Digium Appliance - AA50
|
||||
*
|
||||
* Copyright (C) 2007-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Update Date & Time</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css"></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="iframeTitleBar"> Update Date & Time <span style="cursor: pointer; cursor: hand;" onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span> </div>
|
||||
|
||||
<div class='lite_Heading'> Update Date & Time </div>
|
||||
|
||||
<table width=700 border=0 align=left>
|
||||
<tr> <td align=right><B>NTP server :</B></td>
|
||||
<td>
|
||||
<span id='NTPSERVER'></span>
|
||||
<A href='#' class='splbutton' title='Edit NTP server' onclick="parent.miscFunctions.click_panel('networking.html');"><B>Edit</B></A>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr> <td height=15></td><td></td></tr>
|
||||
|
||||
<tr> <td valign=top align=right><B>Current System Date :</B></td>
|
||||
<td id='current_date'></td>
|
||||
</tr>
|
||||
<tr class='lite'>
|
||||
<td valign=top align=right><B>Current System Date in Local Time :</B></td>
|
||||
<td id='current_date_local'></td>
|
||||
</tr>
|
||||
|
||||
<tr> <td height=15></td><td></td></tr>
|
||||
|
||||
<tr> <td valign=top align=right>
|
||||
<B>Set New Date & Time :</B><BR>
|
||||
<span class='lite'>Enter Date & Time in your Local time </span>
|
||||
</td>
|
||||
<td> <TABLE cellpadding=6 cellspacing=1 border=0>
|
||||
<TR> <TD width=70 align=right>Date </TD>
|
||||
<TD><input size=10 id="date_day"></TD>
|
||||
</TR>
|
||||
<TR> <TD width=70 align=right>Time</TD>
|
||||
<TD> <!-- Time -->
|
||||
<select id="hod"></select>:
|
||||
<select id="minute"></select>
|
||||
<select id="ampm">
|
||||
<option value="AM">AM</option>
|
||||
<option value="PM">PM</option>
|
||||
</select>
|
||||
<!-- Time -->
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD colspan=2 align=center>
|
||||
<span class='guiButton' onclick='update_systemdate();'>Update</span>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/jquery.tooltip.js"></script>
|
||||
<script src="js/jquery.date_input.js"></script>
|
||||
<script>
|
||||
|
||||
function localajaxinit(){
|
||||
top.document.title = 'Set Date & Time' ;
|
||||
parent.ASTGUI.dialog.waitWhile('Loading...');
|
||||
$("#date_day").date_input();
|
||||
|
||||
(function(){
|
||||
var x;
|
||||
var hod = _$('hod');
|
||||
var minute = _$('minute');
|
||||
for(var i=1; i < 13; i++){
|
||||
x = i.addZero();
|
||||
ASTGUI.selectbox.append(hod, x , x);
|
||||
}
|
||||
for(var i=0; i < 60; i++){
|
||||
x = i.addZero();
|
||||
ASTGUI.selectbox.append(minute, x , x);
|
||||
}
|
||||
hod.selectedIndex = -1;
|
||||
minute.selectedIndex = -1;
|
||||
})();
|
||||
|
||||
(function(){
|
||||
var c = context2json({ filename:'networking.conf' , context : 'general' , usf:1 });
|
||||
_$('NTPSERVER').innerHTML = (c && c['NTP_ADDRESS']) || ' --';
|
||||
})();
|
||||
|
||||
ASTGUI.systemCmdWithOutput( "date ", function(output){
|
||||
_$('current_date').innerHTML = ' ' + output.bold_X('UTC') ;
|
||||
_$('current_date_local').innerHTML = ' ' + ASTGUI.toLocalTime(output);
|
||||
parent.ASTGUI.dialog.hide();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
function update_systemdate(){
|
||||
parent.ASTGUI.dialog.waitWhile('Updating Date & Time ...');
|
||||
try{
|
||||
// convert local time to UTC
|
||||
var lt_minutes = _$('minute').value ; // 0 to 59
|
||||
var date_day = _$("date_day").value ;
|
||||
if( !date_day || (_$('hod').selectedIndex == -1 ) || ( _$('minute').selectedIndex == -1) ){
|
||||
parent.ASTGUI.dialog.hide();
|
||||
return;
|
||||
}
|
||||
|
||||
var date_day_split = date_day.split(' ');
|
||||
var lt_month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"].indexOf(date_day_split[1]); // 0 to 11
|
||||
var lt_dom = date_day_split[0] ; // 1 to 31
|
||||
lt_dom = lt_dom.addZero() ;
|
||||
var lt_year = date_day_split[2] ; // 2007
|
||||
// prepare commands to set the date
|
||||
if( _$('ampm').value == "AM" ){
|
||||
var lt_hours = (_$('hod').value == "12" )? "00" : _$('hod').value;
|
||||
}else if( _$('ampm').value == "PM"){
|
||||
var lt_hours = ( _$('hod').value == "12") ? parseInt( _$('hod').value) : parseInt( _$('hod').value) + 12 ;
|
||||
}
|
||||
var lt = new Date();
|
||||
lt.setFullYear ( lt_year, lt_month, lt_dom );
|
||||
lt.setHours ( lt_hours, lt_minutes );
|
||||
var utc_hours = lt.getUTCHours(); // 0 to 23
|
||||
var utc_minutes = lt.getUTCMinutes(); // 0 to 59
|
||||
var utc_month = lt.getUTCMonth(); // 0 to 11
|
||||
var utc_dom = lt.getUTCDate(); // 1 to 31
|
||||
var utc_year = lt.getUTCFullYear() ; // 2007
|
||||
if (utc_month < 10) { utc_month = "0"+ String(utc_month+1); }else{utc_month = String(utc_month+1) ;}
|
||||
if (utc_dom < 10) { utc_dom = "0"+ String(utc_dom) ; }
|
||||
if (utc_hours < 10) { utc_hours = "0"+ String(utc_hours) ; }
|
||||
if (utc_minutes < 10) { utc_minutes = "0"+ String(utc_minutes) ; }
|
||||
var newdate = utc_month + utc_dom + utc_hours + utc_minutes + utc_year ;
|
||||
}catch(err){
|
||||
parent.ASTGUI.dialog.hide();
|
||||
return false;
|
||||
}
|
||||
parent.ASTGUI.systemCmd( "date -s " + newdate , function(){
|
||||
parent.ASTGUI.dialog.hide();
|
||||
var after = function(){
|
||||
alert("You will be now logged out of the gui.\n Please login again !!");
|
||||
var f = makeSyncRequest({ action :'logoff'});
|
||||
top.window.location.reload();
|
||||
};
|
||||
ASTGUI.feedback( { msg:'updated date & time', showfor:2 });
|
||||
setTimeout( after, 1000 );
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
105
old-asterisk/asterisk/static-http/config/dialplans.html
Normal file
@@ -0,0 +1,105 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* DialPlans
|
||||
*
|
||||
* Copyright (C) 2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Dialplans</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
|
||||
#table_DialPlans_list {
|
||||
border: 1px solid #666666;
|
||||
margin-top: 5px;
|
||||
margin-bottom:10px;
|
||||
width: 96%;
|
||||
text-align: center;
|
||||
padding : 1px;
|
||||
}
|
||||
#table_DialPlans_list tr.frow { background: #6b79a5; color: #CED7EF; }
|
||||
#table_DialPlans_list tr.frow td{ font-weight:bold; }
|
||||
#table_DialPlans_list tr td{ padding : 3px; }
|
||||
#table_DialPlans_list tr.even { background: #DFDFDF; }
|
||||
#table_DialPlans_list tr.odd{ background: #FFFFFF; }
|
||||
#table_DialPlans_list tr.even:hover, #table_DialPlans_list tr.odd:hover {
|
||||
background: #a8b6e5;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
DialPlans
|
||||
<span style="cursor: pointer; cursor: hand;" onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
|
||||
<div class='lite_Heading'> Manage DialPlans </div>
|
||||
|
||||
<div class='top_buttons' style='margin-top: -23px;'>
|
||||
<span id='new_cr_button' class='guiButtonNew' onclick="show_NewDialPlan_form()">New DialPlan</span>
|
||||
</div>
|
||||
|
||||
<center>
|
||||
<div style='text-align:center; background-color : #FFFFFF; width: 95%; padding: 5px; margin-left: 1px; margin-top:14px; margin-bottom:20px; border:1px solid #CDCDCD; color: #575757 ' class='lite'>
|
||||
A Dial Plan is a collection of Outgoing Call Rules <hyperlink>. Dial Plans are assigned to Users to specify the dialing permissions they have. For example, you might have one Dial Plan for local calling that only permits users of that Dial Plan to dial local numbers, via the "local" outgoing calling rule. Another user may be permitted to dial long distance numbers, and so would have a Dial Plan that includes both the "local" and "longdistance" outgoing calling rules.
|
||||
</div>
|
||||
</center>
|
||||
|
||||
<table id='table_DialPlans_list' cellpadding=0 cellspacing=0 border=0 align=center></table>
|
||||
|
||||
<div id="Edit_DLPN_DIV" STYLE="display:none;" class='dialog'>
|
||||
<TABLE width="100%" cellpadding=0 cellspacing=0>
|
||||
<TR class="dialog_title_tr">
|
||||
<TD class="dialog_title" onmousedown="ASTGUI.startDrag(event);">
|
||||
<span id='Edit_dialog_title'></span>
|
||||
</TD>
|
||||
<TD class="dialog_title_X" onclick="ASTGUI.hideDrag(event);"> X </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<TABLE align=center cellpadding=2 cellspacing=2 border=0>
|
||||
<TR> <TD align="right"><nobr> DialPlan Name:</nobr></TD>
|
||||
<TD><input id="edit_dlpn_name" size=24 maxlength="70" field_name='DialPlan Name' validation='alphanumericUnd' required='yes'></TD>
|
||||
</TR>
|
||||
<TR> <TD align="right" colspan=2 height=10></TD></TR>
|
||||
|
||||
<TR> <TD valign=top align="right">Include Outgoing Calling Rules:</TD>
|
||||
<TD><div id='edit_includeCheckboxes_div'></div></TD>
|
||||
</TR>
|
||||
|
||||
<TR> <TD align="right" colspan=2 height=10></TD></TR>
|
||||
|
||||
<TR> <TD valign=top align="right"><nobr>Include Local Contexts:</nobr></TD>
|
||||
<TD><div id='edit_LC_includeCheckboxes_div'></div></TD>
|
||||
</TR>
|
||||
|
||||
<TR> <TD colspan=2 align=center height=50 valign=middle>
|
||||
<span class='guiButtonCancel' onclick='ASTGUI.hideDrag(event);'>Cancel</span>
|
||||
<span class='guiButtonEdit' onclick='edit_DP_save_go();'>Save</span>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</div>
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/dialplans.js"></script>
|
||||
</body>
|
||||
13
old-asterisk/asterisk/static-http/config/digital.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<script>
|
||||
|
||||
if( parent.sessionData.PLATFORM.isAA50 ){
|
||||
window.location.href='hardware_aa50.html';
|
||||
}else{
|
||||
if( parent.sessionData.DahdiChannelString == 'zapchan' ){
|
||||
window.location.href='hardware.html';
|
||||
}else{
|
||||
window.location.href='hardware_dahdi.html';
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
107
old-asterisk/asterisk/static-http/config/directory.html
Normal file
@@ -0,0 +1,107 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Directory Settings
|
||||
*
|
||||
* Copyright (C) 2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Directory Preferences</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css"></style>
|
||||
</head>
|
||||
<body bgcolor="EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
Directory Settings
|
||||
<span class='refresh_icon' onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
<div class='lite_Heading'>Directory Settings</div>
|
||||
|
||||
<center>
|
||||
<div style='text-align:center; background-color : #FFFFFF; width: 95%; padding: 5px; margin-left: 1px; margin-top:14px; margin-bottom:20px; border:1px solid #CDCDCD; color: #575757 ' class='lite'>
|
||||
Dialing the 'Directory Extension' would present to the caller, a directory of users listed in the sytem telephone directory - from which they can search by First or Last Name.
|
||||
To add or remove a user from the system telephone directory, edit the 'In Directory' field of the user.
|
||||
</div>
|
||||
</center>
|
||||
|
||||
<table align="center" cellpadding=2 cellspacing=2 border=0>
|
||||
<tr> <td align=right> Directory Extension <img src="images/tooltip_info.gif" tip="en,directory,0" class='tooltipinfo'> :</td>
|
||||
<td> <input size=4 type='text' id='dirext'></td>
|
||||
</tr>
|
||||
<tr> <td align=right>Also read the extension number <img src="images/tooltip_info.gif" tip="en,directory,1" class='tooltipinfo'> :</td>
|
||||
<td> <input type=checkbox id='read_extNo'></td>
|
||||
</tr>
|
||||
<tr> <td align=right> Use first name instead of last name <img src="images/tooltip_info.gif" tip="en,directory,2" class='tooltipinfo'> :</td>
|
||||
<td> <input type=checkbox id='dir_firstname'></td>
|
||||
</tr>
|
||||
<tr> <td colspan=2 align=center height=40 valign=bottom>
|
||||
<span class='guiButtonCancel' id='cancel' onclick='window.location.reload();'>Cancel</span>
|
||||
<span class='guiButtonEdit' id='save' onclick='save_changes();'>Save</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/jquery.tooltip.js"></script>
|
||||
<script>
|
||||
var DIR_EXT ;
|
||||
|
||||
var localajaxinit = function(){
|
||||
top.document.title = 'Directory Preferences' ;
|
||||
var c = context2json({filename: 'extensions.conf', context: ASTGUI.contexts.Directory, usf: 0});
|
||||
for ( var ci = 0 ; ci < c.length ; ci++ ){
|
||||
if( c[ci].toLowerCase().contains('directory(') && c[ci].toLowerCase().contains('default') ){
|
||||
DIR_EXT = ASTGUI.parseContextLine.getExten(c[ci]);
|
||||
ASTGUI.updateFieldToValue( 'dirext', DIR_EXT );
|
||||
var args = ASTGUI.parseContextLine.getArgs(c[ci]);
|
||||
_$('read_extNo').checked = ( args.length == 3 && args[2].contains('e') ) ? true : false;
|
||||
_$('dir_firstname').checked = ( args.length == 3 && args[2].contains('f') ) ? true : false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var save_changes= function(){
|
||||
var NEWEXT = ASTGUI.getFieldValue('dirext');
|
||||
if( NEWEXT && NEWEXT != DIR_EXT && parent.miscFunctions.ifExtensionAlreadyExists(NEWEXT) ){
|
||||
ASTGUI.highlightField( 'dirext' , 'Extension already exists');
|
||||
return;
|
||||
}
|
||||
if (!NEWEXT && ($('#read_extNo:checked').val() || $('#dir_firstname:checked').val())) {
|
||||
ASTGUI.highlightField('dirext', 'Extension must exist if options are checked');
|
||||
return;
|
||||
}
|
||||
var dir_ops = '';
|
||||
dir_ops += ( _$('read_extNo').checked ) ? 'e' : '' ;
|
||||
dir_ops += ( _$('dir_firstname').checked ) ? 'f' : '' ;
|
||||
ASTGUI.miscFunctions.delete_LinesLike({ context_name : ASTGUI.contexts.Directory , beginsWithArr: ['exten='] , filename: 'extensions.conf', hasThisString:'1,Directory(default', cb:function(){}, useSyn:true });
|
||||
if( NEWEXT ){
|
||||
var dir_string = NEWEXT + ',1,Directory(default,default,' + dir_ops +')' ;
|
||||
var u = new listOfSynActions('extensions.conf');
|
||||
u.new_action('append', ASTGUI.contexts.Directory , 'exten', dir_string );
|
||||
u.callActions();
|
||||
}
|
||||
parent.sessionData.pbxinfo['localextensions']['defaultDirectory'] = NEWEXT ;
|
||||
ASTGUI.feedback({msg:' Saved !!', showfor: 3 , color: '#5D7CBA', bgcolor: '#FFFFFF'}) ;
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
144
old-asterisk/asterisk/static-http/config/emailsettings.html
Normal file
@@ -0,0 +1,144 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* VoiceMail->Email Template Settings
|
||||
*
|
||||
* Copyright (C) 2006 - 2008, Digium, Inc.
|
||||
*
|
||||
* Mark Spencer <markster@digium.com>
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>VoiceMail Email Settings</title>
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css"></style>
|
||||
</head>
|
||||
<body bgcolor="#EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
Voicemail-Email alert preferences
|
||||
<span class='refresh_icon' onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
|
||||
<table width=95% cellpadding=0 cellspacing=0 border=0><tr><td align=center><div id="tabbedMenu"></div></td></tr></table>
|
||||
|
||||
<div> <table align="center" cellpadding=2 cellspacing=1 border=0>
|
||||
<tr>
|
||||
<td align=right><input type='checkbox' id='emailonly'></td>
|
||||
<td>
|
||||
<label for='emailonly'>Send messages by e-mail only</label>
|
||||
<img src="images/tooltip_info.gif" tip="en,voicemail,4" class='tooltipinfo'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right><input type='checkbox' id='attach'></td>
|
||||
<td>
|
||||
<label for='attach'>Attach recordings to e-mail</label>
|
||||
<img src="images/tooltip_info.gif" tip="en,voicemail,1" class='tooltipinfo'>
|
||||
</td>
|
||||
</tr>
|
||||
<TR> <TD colspan=2 align=center valign=middle><span class='lite_Heading'>Template for Voicemail Emails </span></TD></TR>
|
||||
<TR> <TD align=right>From</TD>
|
||||
<TD><input type="text" id="serveremail" size=45></TD>
|
||||
</TR>
|
||||
<TR> <TD align=right>Subject</TD>
|
||||
<TD><input type="text" id="emailsubject" size=45></TD>
|
||||
</TR>
|
||||
<TR> <TD valign=top>Message</TD>
|
||||
<TD><textarea id="emailbody" rows=5 cols=65></textarea></TD>
|
||||
</TR>
|
||||
<TR> <TD colspan=2 align=center>
|
||||
<span class='guiButtonCancel' id='cancel' onclick='window.location.reload();'>Cancel</span>
|
||||
<span class='guiButton' id='span_load_defaults' onclick='load_defaults();'>Load Defaults</span>
|
||||
<span class='guiButtonEdit' id='save' onclick='save_changes();'>Save</span>
|
||||
</TD>
|
||||
</TR>
|
||||
</table><BR>
|
||||
<table align="center" cellpadding=2 cellspacing=1 border=0>
|
||||
<TR> <TD valign=top align=center><B>Template Variables:</B></TD>
|
||||
<TD>\t : TAB</TD>
|
||||
</TR>
|
||||
<TR> <TD></TD>
|
||||
<TD>${VM_NAME} : Recipient's firstname and lastname</TD>
|
||||
</TR>
|
||||
<TR> <TD></TD>
|
||||
<TD>${VM_DUR} : The duration of the voicemail message</TD>
|
||||
</TR>
|
||||
<TR> <TD></TD>
|
||||
<TD>${VM_MAILBOX} : The recipient's extension</TD>
|
||||
</TR>
|
||||
<TR> <TD></TD>
|
||||
<TD>${VM_CALLERID} : The caller id of the person who left the message</TD>
|
||||
</TR>
|
||||
<TR> <TD></TD>
|
||||
<TD>${VM_MSGNUM} : The message number in your mailbox</TD>
|
||||
</TR>
|
||||
<TR> <TD></TD>
|
||||
<TD>${VM_DATE} : The date and time the message was left</TD>
|
||||
</TR>
|
||||
</table>
|
||||
</div>
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/jquery.tooltip.js"></script>
|
||||
<script>
|
||||
var localajaxinit = function(){
|
||||
(function (){
|
||||
var t = [
|
||||
{url:'voicemail.html', desc:'General Settings'} ,
|
||||
{url:'#', desc:'Email Settings for VoiceMails', selected:true }
|
||||
];
|
||||
if( parent.sessionData.PLATFORM.isAA50 ){
|
||||
t.push( {url:'smtp_settings.html', desc:'SMTP Settings'} );
|
||||
}
|
||||
ASTGUI.tabbedOptions( _$('tabbedMenu') , t);
|
||||
})();
|
||||
|
||||
top.document.title = 'VoiceMail Email Settings' ;
|
||||
var c = config2json({filename:'voicemail.conf', usf:1});
|
||||
if(! c.hasOwnProperty('general') ){return;}
|
||||
var cg = c['general'];
|
||||
|
||||
ASTGUI.updateFieldToValue( 'emailonly' , cg.getProperty('emailonly') );
|
||||
ASTGUI.updateFieldToValue( 'attach' , cg.getProperty('attach') );
|
||||
ASTGUI.updateFieldToValue( 'emailbody' , cg.getProperty('emailbody') );
|
||||
ASTGUI.updateFieldToValue( 'serveremail' , cg.getProperty('serveremail') );
|
||||
ASTGUI.updateFieldToValue( 'emailsubject' , cg.getProperty('emailsubject') );
|
||||
};
|
||||
|
||||
var load_defaults = function(){
|
||||
ASTGUI.updateFieldToValue( 'emailbody' , 'Hello ${VM_NAME}, you received a message lasting ${VM_DUR} at ${VM_DATE} from, (${VM_CALLERID}). This is message ${VM_MSGNUM} in your voicemail Inbox.' );
|
||||
ASTGUI.updateFieldToValue( 'serveremail' , 'asterisk@yourcompany.null' );
|
||||
ASTGUI.updateFieldToValue( 'emailsubject' , 'New voicemail from ${VM_CALLERID} for ${VM_MAILBOX}' );
|
||||
_$('span_load_defaults').style.display = 'none';
|
||||
};
|
||||
|
||||
var save_changes = function(){
|
||||
var u = new listOfSynActions('voicemail.conf') ;
|
||||
u.new_action('update', 'general' , 'emailonly', ASTGUI.getFieldValue('emailonly') );
|
||||
u.new_action('update', 'general' , 'attach', ASTGUI.getFieldValue('attach') );
|
||||
u.new_action('update', 'general' , 'serveremail', ASTGUI.getFieldValue('serveremail') );
|
||||
u.new_action('update', 'general' , 'emailsubject', ASTGUI.getFieldValue('emailsubject') );
|
||||
u.callActions();
|
||||
var eb = ASTGUI.getFieldValue('emailbody');
|
||||
eb = eb.split('\n').join('\\n');
|
||||
ASTGUI.updateaValue({ file:'voicemail.conf', context :'general', variable :'emailbody', value : eb }) ;
|
||||
ASTGUI.feedback({msg:' Saved !!', showfor: 3 , color: '#5D7CBA', bgcolor: '#FFFFFF'}) ;
|
||||
window.location.reload();
|
||||
|
||||
};
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
292
old-asterisk/asterisk/static-http/config/features.html
Normal file
@@ -0,0 +1,292 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Call Features
|
||||
*
|
||||
* Copyright (C) 2007-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
* Ryan Brindley <rbrindley@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Call Features</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
body { background-color: #efefef; }
|
||||
|
||||
#right_container { float: right; width: 60%; }
|
||||
#left_container { width: 40%; }
|
||||
#bottom_container { clear: both; }
|
||||
|
||||
.section { -moz-border-radius: 8px; -webkit-border-radius: 8px; background-color: #ffffff; border: 1px solid #6b79a5; margin: 4px; padding: 4px; }
|
||||
.section .title { color: #6b79a5; font-size: 16px; font-weight: bold; }
|
||||
.section .enabled { color: #000000; }
|
||||
.section .disabled { color: #666666; }
|
||||
|
||||
#call_parking .feature label, #feature_map .feature label, #feature_options .feature label { float: left; margin-right: 5px; text-align: right; }
|
||||
#call_parking .feature label { width: 200px; }
|
||||
#feature_options .feature label { width: 150px; }
|
||||
#feature_map .feature label { width: 120px; }
|
||||
#feature_map .checkbox { float: left; padding: 0px; margin: 4px; }
|
||||
.feature label { width: 200px; }
|
||||
|
||||
.ui-tabs-panel { text-align: left; }
|
||||
|
||||
#application_map_list { margin-top 5px; margin-bottom 10px; padding: 1px; text-align: center; width: 96%; }
|
||||
#application_map_list thead tr { background: #6b79a5; color: #ced7ef; }
|
||||
#application_map_list thead th { font-weight: bold; }
|
||||
#application_map_list tr td { padding: 3px; }
|
||||
#application_map_list tr.even { background: #dfdfdf; }
|
||||
#application_map_list tr.odd { background: #ffffff; }
|
||||
#application_map_list td.buttons, th.buttons { width: 100px; }
|
||||
|
||||
#dial_options { height: 305px; }
|
||||
|
||||
.update { background-color: #ffc58a; border: 1px dotted #e8440c; display: none; padding: 2px 4px 2px 4px; }
|
||||
.error { background-color: #ffaeae; }
|
||||
.hidden { display: none; }
|
||||
.template { display: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="iframeTitleBar">
|
||||
Feature Codes & Call Parking Preferences
|
||||
<span class="refresh_icon" > <img src="images/refresh.png" title=" Refresh " border="0" > </span>
|
||||
</div>
|
||||
<div id="right_container" class="container">
|
||||
<div id="dial_options" class="section">
|
||||
<span class="title"><img class="title_img" src="images/asterisk_red.gif"/>Dial Options</span>
|
||||
<div class="feature disabled">
|
||||
<input type="checkbox" id="dial_t" value="t" />
|
||||
<label for="dial_t"> <b>t</b> - Allow the called party to transfer the calling party by sending the 'Blind Transfer' or 'Attended Transfer' feature maps.</label>
|
||||
<span class="update"></span>
|
||||
</div>
|
||||
<div class="feature disabled">
|
||||
<input type="checkbox" id="dial_T" value="T" />
|
||||
<label for="dial_T"> <b>T</b> - Allow the calling party to transfer the called party by sending the 'Blind Transfer' or 'Attended Transfer' feature maps.</label>
|
||||
<span class="update"></span>
|
||||
</div>
|
||||
<div class="feature disabled">
|
||||
<input type="checkbox" id="dial_h" value="h" />
|
||||
<label for="dial_h"> <b>h</b> - Allow the called party to hang up by sending the 'Disconnect' feature map.</label>
|
||||
<span class="update"></span>
|
||||
</div>
|
||||
<div class="feature disabled">
|
||||
<input type="checkbox" id="dial_H" value="H" />
|
||||
<label for="dial_H"> <b>H</b> - Allow the calling party to hang up by sending the 'Disconnect' feature map.</label>
|
||||
<span class="update"></span>
|
||||
</div>
|
||||
<div class="feature disabled">
|
||||
<input type="checkbox" id="dial_k" value="k" />
|
||||
<label for="dial_k"> <b>k</b> - Allow the called party to enable parking of the call by sending the 'Call Parking' feature map.</label>
|
||||
<span class="update"></span>
|
||||
</div>
|
||||
<div class="feature disabled">
|
||||
<input type="checkbox" id="dial_K" value="K" />
|
||||
<label for="dial_K"> <b>K</b> - Allow the calling party to enable parking of the call by sending the 'Call Parking' feature map.</label>
|
||||
<span class="update"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="left_container" class="container">
|
||||
<div id="feature_options" class="section">
|
||||
<span class="title"><img class="title_img" src="images/asterisk_red.gif"/>Feature Options</span>
|
||||
<div class="feature disabled">
|
||||
<label for="feature_featuredigittimeout">Feature Digit Timeout:</label>
|
||||
<input type="text" id="feature_featuredigittimeout" size="4" />
|
||||
(milliseconds)
|
||||
<span class="update"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="call_parking" class="section">
|
||||
<span class="title"><img class="title_img" src="images/asterisk_red.gif"/>Call Parking</span>
|
||||
<div class="feature disabled">
|
||||
<label for="parkext">Extension to Dial to Park a Call:</label>
|
||||
<input type="text" id="parkext" size="4"/>
|
||||
<span class="update"></span>
|
||||
</div>
|
||||
<div class="feature disabled">
|
||||
<label for="parkpos">Extensions for Parked Calls:</label>
|
||||
<input type="text" id="parkpos" size="10" /> (Ex: '701-720')
|
||||
<span class="update"></span>
|
||||
</div>
|
||||
<div class="feature disabled">
|
||||
<label for="parkingtime">Parked Call Timeout (in secs):</label>
|
||||
<input type="text" id="parkingtime" size="2" />
|
||||
<span class="update"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="feature_map" class="section">
|
||||
<span class="title"><img class="title_img" src="images/asterisk_red.gif"/>Feature Map</span>
|
||||
<div class="feature disabled">
|
||||
<label for="fmap_blindxfer">Blind Transfer:</label>
|
||||
<input type="text" id="fmap_blindxfer" size="2" /> (default is #)
|
||||
<span class="update"></span>
|
||||
</div>
|
||||
<div class="feature disabled">
|
||||
<label for="fmap_disconnect">Disconnect:</label>
|
||||
<input type="text" id="fmap_disconnect" size="2" /> (default is *)
|
||||
<span class="update"></span>
|
||||
</div>
|
||||
<div class="feature disabled">
|
||||
<label for="fmap_atxfer">Attended Transfer:</label>
|
||||
<input type="text" id="fmap_atxfer" size="2" />
|
||||
<span class="update"></span>
|
||||
</div>
|
||||
<div class="feature disabled">
|
||||
<label for="fmap_parkcall">Call Parking:</label>
|
||||
<input type="text" id="fmap_parkcall" size="2" />
|
||||
<span class="update"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bottom_container" class="container">
|
||||
<div id="application_map" class="section">
|
||||
<span class="title"><img class="title_img" src="images/asterisk_red.gif"/>Application Map</span>
|
||||
<span class="guiButtonNew">New Application Map</span>
|
||||
<table id="application_map_list" align="center" cellpadding="0" cellspacing="1" border="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Enabled</th>
|
||||
<th>Feature Name</th>
|
||||
<th>Digits</th>
|
||||
<th>ActiveOn/By</th>
|
||||
<th>App Name</th>
|
||||
<th>Arguments</th>
|
||||
<th class="buttons"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="template">
|
||||
<td class="enabled">
|
||||
<input type="checkbox" checked="checked" />
|
||||
</td>
|
||||
<td class="name">
|
||||
<input type="text" size="10" />
|
||||
</td>
|
||||
<td class="digits">
|
||||
<input type="text" size="2" />
|
||||
</td>
|
||||
<td class="active">
|
||||
<select>
|
||||
<option value="self">Self</option>
|
||||
<option value="peer">Peer</option>
|
||||
<option value="self/caller">Self/Caller</option>
|
||||
<option value="peer/caller">Peer/Caller</option>
|
||||
<option value="self/callee">Self/Callee</option>
|
||||
<option value="peer/callee">Peer/Callee</option>
|
||||
<option value="self/both">Self/Both</option>
|
||||
<option value="peer/both">Peer/Both</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="app_name">
|
||||
<input type="text" size="20" />
|
||||
</td>
|
||||
<td class="app_args">
|
||||
<input type="text" size="10" />
|
||||
</td>
|
||||
<td class="buttons">
|
||||
<span class="guiButton save hidden">Save</span>
|
||||
<span class="guiButton delete">Delete</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script type="text/javascript" src="js/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/astman.js"></script>
|
||||
<script type="text/javascript" src="js/features.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.tooltip.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.autocomplete.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.delegate-1.1.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.ui.core.js"></script>
|
||||
<script type="text/javascript" src="js/effects.core.js"></script>
|
||||
<script type="text/javascript" src="js/effects.highlight.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready( function() {
|
||||
top.document.title = "Call Feature Preferences";
|
||||
|
||||
load();
|
||||
|
||||
$('.refresh_icon').click( function() {
|
||||
window.location.reload();
|
||||
});
|
||||
$('#application_map .guiButtonNew').click(function() {
|
||||
newAmap();
|
||||
});
|
||||
$('#application_map_list')
|
||||
.delegate('click', 'span.delete', function() {
|
||||
removeAmap($(this));
|
||||
}).delegate('click', 'span.save', function() {
|
||||
if (editAmap($(this))) {
|
||||
$(this).parents('tr').find('.buttons > span.save').hide();
|
||||
}
|
||||
}).delegate('change', 'input, select', function() {
|
||||
if ($(this).parents('td').hasClass('enabled')) {
|
||||
if ($(this).attr('checked') === true) {
|
||||
enableAmap($(this));
|
||||
} else {
|
||||
disableAmap($(this));
|
||||
}
|
||||
} else {
|
||||
var obj = $(this).parents('tr');
|
||||
var vari = $(this).parents('td').attr('class');
|
||||
var val = $(this).val();
|
||||
if (validateAmap(obj, {variable: vari, value: val}, false)) {
|
||||
$(this).parents('td').siblings('.buttons').children('.save').show();
|
||||
} else {
|
||||
$(this).parents('td').siblings('.buttons').children('.save').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#feature_map, #call_parking, #feature_options, #dial_options')
|
||||
.delegate('click', ':text', function() {
|
||||
$(this).parents('.feature').removeClass('disabled');
|
||||
$(this).select();
|
||||
}).delegate('change', 'input', function() {
|
||||
if ($(this).val() === '' || ($(this).attr('type') === 'checkbox' && $(this).attr('checked') === false)) {
|
||||
$(this).parents('.feature').addClass('disabled');
|
||||
/* send action to remove feature */
|
||||
remove($(this));
|
||||
} else {
|
||||
$(this).parents('.feature').removeClass('disabled');
|
||||
/* send action to update */
|
||||
edit($(this));
|
||||
}
|
||||
});
|
||||
$('#feature_map :text, #call_parking :text, #feature_options :text').blur(function() {
|
||||
if ($(this).val() === vals[$(this).attr('id')]) {
|
||||
return;
|
||||
}
|
||||
if ($(this).val() === '') {
|
||||
$(this).parents('.feature').addClass('disabled');
|
||||
/* send action to remove feature */
|
||||
if (typeof vals[$(this).attr('id')] === 'undefined' && $(this).val() === '') {
|
||||
return;
|
||||
}
|
||||
remove($(this));
|
||||
} else {
|
||||
/* send action to update */
|
||||
edit($(this));
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
98
old-asterisk/asterisk/static-http/config/feditor.html
Normal file
@@ -0,0 +1,98 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* File Editor
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>File Editor</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
.spzero{
|
||||
cursor: pointer;
|
||||
cursor: hand;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="FFFFFF">
|
||||
<div class="iframeTitleBar">
|
||||
<span style="margin-left: 4px;font-weight:bold;">File Editor</span>
|
||||
<span style="cursor: pointer; cursor: hand;" onclick="window.location.reload();">
|
||||
<img src="images/refresh.png" title=" Refresh " border=0 >
|
||||
</span>
|
||||
<select id="filenames" class="input8"></select>
|
||||
<span id="createfile_button" class='guiButton' onclick='show_createfile();' style='margin-left:20px;'>New File</span>
|
||||
</div>
|
||||
|
||||
<div style="display:none; font-size:14px; font-weight:bold; font-family:helvetica,sans-serif,'trebuchet ms'; padding : 6px 0px 6px 10px;" id="div_filename">
|
||||
<span id="CurrentFileName"></span>
|
||||
<a href=# class="splbutton" onclick="show_addcontext();" id="AddContextButton">Add Context</a>
|
||||
</div>
|
||||
|
||||
<div id="file_output" style="height: 90%; width: 770px; overflow :auto;" align="center"></div>
|
||||
|
||||
<span id="temp_holding"></span>
|
||||
|
||||
<span id="div_editcontext" style="display:none; z-index:1000; background-color : #4D5423" onclick="stopBubble(event)">
|
||||
<input id="context_edited" size=15 class="input8">
|
||||
<span class='guiButton' id='save_context' onclick='update_context();'>Save</span>
|
||||
<span class='guiButtonCancel' id='cancel_context' onclick='cancel_context();'>Cancel</span>
|
||||
<span class='guiButtonDelete' id='delete_context' onclick='delete_context();'>Delete</span>
|
||||
</span>
|
||||
<div id="div_editcontextContent" style="display:none; z-index:1001; background-color : #E0E6C4" onclick="stopBubble(event)">
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" align="right">
|
||||
<span class='guiButton' id='save_contextContent' onclick='update_contextContent();'>Save</span>
|
||||
<span class='guiButtonCancel' id='cancel_contextContent' onclick='cancel_contextContent();'>Cancel</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <textarea id="context_Content" rows=1 cols=95 class="input9"></textarea> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="AddContext" style="display:none; position:absolute; z-index:1004; background-color : #C1D7EC; padding : 6px 6px 6px 10px;">
|
||||
Add New Context : <input id="New_ContextName" size=20 class="input9">
|
||||
<input type="button" value="Add" style="font-size: 8pt; border:1px solid; padding : 0px 0px 0px 0px;" onclick="add_context();">
|
||||
<input type="button" value="Cancel" style="font-size: 8pt; border:1px solid; padding : 0px 0px 0px 0px;" onclick="cancel_addcontext();">
|
||||
</div>
|
||||
|
||||
<div id="CreateFile" style="display:none; position:absolute; z-index:1005; background-color : #C1D7EC; padding : 6px 6px 6px 10px;">
|
||||
<table>
|
||||
<tr> <td colspan=2 align=center><B>Create New ConfigFile</B></td>
|
||||
</tr>
|
||||
<tr> <td>New FileName :</td>
|
||||
<td> <input id="New_FileName" size=20 class="input9">
|
||||
<input type="button" value="Add" style="font-size: 8pt; border:1px solid; padding : 0px 0px 0px 0px;" onclick="create_file();">
|
||||
<input type="button" value="Cancel" style="font-size: 8pt; border:1px solid; padding : 0px 0px 0px 0px;" onclick="cancel_file();"><BR>
|
||||
</td>
|
||||
</tr>
|
||||
<tr> <td></td>
|
||||
<td> (Ex: newfile.conf)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/feditor.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
104
old-asterisk/asterisk/static-http/config/flashupdate.html
Normal file
@@ -0,0 +1,104 @@
|
||||
<!--
|
||||
* Asterisk GUI - Apply new uimages via upload/http/ftp urls
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
* Brandon Kruse <bkruse@digium.com>
|
||||
*
|
||||
* Copyright (C) 2006 - 2008, Digium, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Update Appliance Firmware</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
Update Appliance Firmware
|
||||
<span style="cursor: pointer; cursor: hand;" onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
|
||||
<div style='display:none;' class='nocf' id='nocf'> You need a <b>CompactFlash®</b> to use this feature </div>
|
||||
|
||||
<table id='mainDiv' style='display:none;' align=center width='95%'>
|
||||
<TR>
|
||||
<TD><div class='lite_Heading'> Update Appliance Firmware </div></TD>
|
||||
</TR>
|
||||
<tr>
|
||||
<td align=center style='padding-top:30px;'>
|
||||
<span id='span_current_fwversion'></span>
|
||||
<span id='check_forNewFirmwareVersions_button' style='display:none' class='guiButton' onclick='check_forNewFirmwareVersions()'> Check for new Firmware versions </span>
|
||||
<div id="UpdatePolycomFirmware" style="display:none"><A href='update_phonefirmware.html'>Update Polycom firmware</A></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>
|
||||
<BR>
|
||||
<fieldset>
|
||||
<legend><B> Download image from a : </B></legend>
|
||||
<LABEL FOR="updatetype_http">
|
||||
<input type=radio id="updatetype_http" name="updatetype" value="HTTP" onchange="switch_httptftp('h');"> HTTP URL
|
||||
</LABEL>
|
||||
|
||||
<LABEL FOR="updatetype_tftp">
|
||||
<input type=radio id="updatetype_tftp" name="updatetype" value="TFTP" onchange="switch_httptftp('t');"> TFTP Server
|
||||
</LABEL>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td> <table>
|
||||
<tr id="tr_1">
|
||||
<td align=right>HTTP URL :</td>
|
||||
<td> <input id="httpurl" size=35> </td>
|
||||
</tr>
|
||||
<tr id="tr_2">
|
||||
<td align=right>TFTP Server :</td>
|
||||
<td><input id="tftpurl" size=35></td>
|
||||
</tr>
|
||||
<tr id="tr_3">
|
||||
<td align=right>File Name :</td>
|
||||
<td><input id="tftp_filename" size=25></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td valign=top>
|
||||
<input type="button" id="Update_Image" onclick="call_flashupdate();" value="Go">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id="tdupload">
|
||||
<BR>
|
||||
<fieldset>
|
||||
<legend><B> Upload a new image : </B></legend>
|
||||
<IFRAME src="upload2.html" id="uploadiframe" width="480" height="100" frameborder="0" border="0" marginheight="0" marginwidth="0"></IFRAME>
|
||||
</fieldset>
|
||||
<span id="fstatus"></span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="overlayUpload_TR" style='display:none'>
|
||||
<td align=center>
|
||||
<BR>
|
||||
<fieldset>
|
||||
<legend><B> Upload a overlay file : </B></legend>
|
||||
<IFRAME id="uploadOVERLAY_iframe" width="480" height="100" frameborder="0" border="0" marginheight="0" marginwidth="0"></IFRAME>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/flashupdate.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
111
old-asterisk/asterisk/static-http/config/flipadvanced.html
Normal file
@@ -0,0 +1,111 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Show/Hide advanced options
|
||||
*
|
||||
* Copyright (C) 2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Show/Hide Advanced Options</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css"></style>
|
||||
</head>
|
||||
<body bgcolor="EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
Advanced Options <span class='refresh_icon' onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
|
||||
<center> <div id="tabbedMenu"></div> </center>
|
||||
|
||||
<div class='lite_Heading' id='ADVOPTIONS_HEADING'> Advanced Options </div>
|
||||
|
||||
<center>
|
||||
<div id='flip_decsription' style='text-align:center; background-color : #FFFFFF; max-width: 700px; padding:20px; margin-top:10px; border:1px solid #CDCDCD; ' class='lite'></div>
|
||||
</center>
|
||||
|
||||
<div style='text-align:center; width: 95%; margin-top:20px'>
|
||||
<span class='guiButton' id='flip_button' onclick='flip_advOptions();'></span>
|
||||
</div>
|
||||
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script>
|
||||
// parent.miscFunctions.flip_advancedmode
|
||||
|
||||
var localajaxinit = function(){
|
||||
top.document.title = "Show/Hide Advanced options" ;
|
||||
var t = [
|
||||
{ url:'preferences.html', desc:'General Preferences' },
|
||||
{ url:'language.html', desc:'Language' },
|
||||
{ url:'password.html', desc:'Change Password' }
|
||||
];
|
||||
if( parent.sessionData.PLATFORM.isAA50 ){
|
||||
t.push({ url:'reset_defaults.html', desc: 'Factory Reset' });
|
||||
}
|
||||
t.push({ url:'reboot.html', desc:'Reboot' });
|
||||
t.push({ url:'#', desc:'Advanced Options', selected: true });
|
||||
|
||||
ASTGUI.tabbedOptions( _$('tabbedMenu') , t );
|
||||
update_status();
|
||||
|
||||
ASTGUI.events.add( _$('ADVOPTIONS_HEADING') , 'dblclick' , function(){
|
||||
if( parent.sessionData.DEBUG_MODE ){
|
||||
parent.sessionData.DEBUG_MODE = false;
|
||||
parent.miscFunctions.DEBUG_CLEAR();
|
||||
parent.$(".debugWindow").hide();
|
||||
}else{
|
||||
parent.sessionData.DEBUG_MODE = true;
|
||||
parent.miscFunctions.DEBUG_START();
|
||||
parent.$(".debugWindow").show();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var update_status = function(){
|
||||
|
||||
var am = top.cookies.get('advancedmode');
|
||||
if( am && am == 'yes' ){
|
||||
_$('flip_button').innerHTML = 'Hide Advanced Options';
|
||||
_$('flip_decsription').innerHTML = "Clicking the 'Hide Advanced Options' button below removes the advanced menu items on the left hand sidebar"
|
||||
+ "<BR><BR><B>Notice!</B> Digium does not provide support for the options configurable in the Advanced menu items. "
|
||||
+ "Digium does not provide support for bugs uncovered in the Advanced menu items. If your unit becomes inoperable "
|
||||
+ "due to editing of the Advanced menu items, Digium Technical Support will request that you reset your unit to"
|
||||
+ "Factory Default configuration. Continue at your own risk." ;
|
||||
}else{
|
||||
_$('flip_button').innerHTML = 'Show Advanced Options';
|
||||
_$('flip_decsription').innerHTML = "Clicking the 'Show Advanced Options' button below provides the additional menu items on the left hand sidebar"
|
||||
+ "<BR><BR><B>Notice!</B> Digium does not provide support for the options configurable in the Advanced menu items. "
|
||||
+ "Digium does not provide support for bugs uncovered in the Advanced menu items. If your unit becomes inoperable "
|
||||
+ "due to editing of the Advanced menu items, Digium Technical Support will request that you reset your unit to"
|
||||
+ "Factory Default configuration. Continue at your own risk." ;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
var flip_advOptions = function(){
|
||||
parent.miscFunctions.flip_advancedmode();
|
||||
update_status();
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
216
old-asterisk/asterisk/static-http/config/followme.html
Normal file
@@ -0,0 +1,216 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Follow Me
|
||||
*
|
||||
* Copyright (C) 2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
* Malcolm Davenport <malcolmd@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Follow Me</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
|
||||
#table_userslist {
|
||||
border: 1px solid #666666;
|
||||
margin-top: 5px;
|
||||
margin-bottom:10px;
|
||||
width: 96%;
|
||||
text-align: center;
|
||||
padding : 1px;
|
||||
}
|
||||
#table_userslist tr.frow { background: #6b79a5; color: #CED7EF; }
|
||||
#table_userslist tr.frow td{ font-weight:bold; }
|
||||
#table_userslist tr td{ padding : 3px; }
|
||||
#table_userslist tr.even { background: #DFDFDF; }
|
||||
#table_userslist tr.odd{ background: #FFFFFF; }
|
||||
#table_userslist tr.even:hover, #table_userslist tr.odd:hover {
|
||||
background: #a8b6e5;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
|
||||
#sqDestinations{
|
||||
height:120px ;
|
||||
background-color:#FFFFFF;
|
||||
padding: 5px;
|
||||
border-width: 1px;
|
||||
border-color: #7E5538;
|
||||
border-style: solid;
|
||||
cursor: default;
|
||||
font: 83%/1.4 arial, helvetica, sans-serif;
|
||||
overflow :auto;
|
||||
}
|
||||
|
||||
#sqDestinations div {
|
||||
clear :both;
|
||||
padding : 3px 5px 0px 5px;
|
||||
min-height: 20px;
|
||||
}
|
||||
#sqDestinations div:hover {
|
||||
background-color:#DEDEDE;
|
||||
}
|
||||
|
||||
#sqDestinations div span.step_desc {
|
||||
float: left;
|
||||
/* max-width: 300px; */
|
||||
background: transparent;
|
||||
}
|
||||
#sqDestinations div span.step_desc:hover{
|
||||
background-color:#DEDEDE;
|
||||
}
|
||||
|
||||
#sqDestinations div span.step_up {
|
||||
float: right;
|
||||
width: 20px;
|
||||
background: transparent url("./images/asterisk-arrow-up.png") no-repeat;
|
||||
}
|
||||
|
||||
#sqDestinations div span.step_down {
|
||||
float: right;
|
||||
width: 20px;
|
||||
background: transparent url("./images/asterisk-arrow-down.png") no-repeat;
|
||||
}
|
||||
|
||||
#sqDestinations div span.step_delete {
|
||||
float: right;
|
||||
width: 20px;
|
||||
background: transparent url("./images/delete_circle.png") no-repeat;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
Follow Me <span class='refresh_icon' onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
|
||||
<center><div id="tabbedMenu"></div></center>
|
||||
|
||||
<div id='div_ONE_FOLLOWMEUSERS'>
|
||||
<div class='lite_Heading' id='thisPage_lite_Heading'>'<i>Follow Me</i>' preferences for users</div>
|
||||
|
||||
<table id='table_userslist' cellpadding=0 cellspacing=0 border=0 align=center style='clear:both;'></table>
|
||||
</div>
|
||||
<div id='div_TWO_FOLLOWME_PREFS' style="display:none;">
|
||||
<div class='lite_Heading'>FollowMe Options</div>
|
||||
<table align="center" cellpadding=2 cellspacing=2 border=0>
|
||||
<tr> <td valign=top align=right> <input type=checkbox id='chk_fmoptions_s'></td>
|
||||
<td>Playback the incoming status message prior to starting the follow-me step(s)</td>
|
||||
</tr>
|
||||
<tr> <td height=10></td></tr>
|
||||
<tr> <td valign=top align=right> <input type=checkbox id='chk_fmoptions_a'></td>
|
||||
<td>Record the caller's name so it can be announced to the callee on each step</td>
|
||||
</tr>
|
||||
<tr> <td height=10></td></tr>
|
||||
<tr> <td valign=top align=right> <input type=checkbox id='chk_fmoptions_n'></td>
|
||||
<td>Playback the unreachable status message if we've run out of steps to reach the or the callee has elected not to be reachable.</td>
|
||||
</tr>
|
||||
<tr> <td height=10></td></tr>
|
||||
|
||||
<tr> <td align=center colspan=2>
|
||||
<span class='guiButtonCancel' id='cancel' onclick='window.location.reload();'>Cancel</span>
|
||||
<span class='guiButtonEdit' id='save' onclick='update_FollowMe_Options();'>Save</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="div_followUser_edit" STYLE="width:600; display:none;" class='dialog'>
|
||||
<TABLE width="100%" cellpadding=0 cellspacing=0>
|
||||
<TR class="dialog_title_tr">
|
||||
<TD class="dialog_title" onmousedown="ASTGUI.startDrag(event);">
|
||||
<span id="div_followUser_edit_title"></span></TD>
|
||||
<TD class="dialog_title_X" onclick="ASTGUI.hideDrag(event);"> X </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<TABLE align=center cellpadding=2 cellspacing=2 border=0 width='100%'>
|
||||
<tr> <td align=right width=200>Status <img src="images/tooltip_info.gif" tip="en,followme,0" class='tooltipinfo'> :</td>
|
||||
<td> <input type=radio id='FMU_Enable' name='radio_FMU_EnableDisable'> <font color=green><b>Enable</b></font> <input type=radio id='FMU_Disable' name='radio_FMU_EnableDisable'> <font color=red><b>Disable</b></font> </td>
|
||||
</tr>
|
||||
<tr> <td align=right width=200>'Music On Hold' Class <img src="images/tooltip_info.gif" tip="en,followme,1" class='tooltipinfo'> :</td>
|
||||
<td> <select id='FMU_moh' required='yes'> </td>
|
||||
</tr>
|
||||
<tr> <td align=right>DialPlan <img src="images/tooltip_info.gif" tip="en,followme,2" class='tooltipinfo'> :</td>
|
||||
<td> <select id='FMU_context' required='yes'> </td>
|
||||
</tr>
|
||||
<tr> <td align=right valign=top>Destinations <img src="images/tooltip_info.gif" tip="en,followme,3" class='tooltipinfo'> :</td>
|
||||
<td> <div id='sqDestinations'></div> </td>
|
||||
</tr>
|
||||
|
||||
<tr class='FORM_newFM_Number' >
|
||||
<td align=right valign=top></td>
|
||||
<td>
|
||||
<span class='guiButton' onclick=" followMe_MiscFunctions.show_FORM_newFM_Number(); "><B>Add FollowMe Number</B></span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class='FORM_newFM_Number'>
|
||||
<td align=right valign=top><B>New FollowMe Number <img src="images/tooltip_info.gif" tip="en,followme,4" class='tooltipinfo'> :</B></td>
|
||||
<td>
|
||||
<input type=radio name='newFM_Number_radio' id='newFM_Number_radio_local'>
|
||||
<label for='newFM_Number_radio_local'> Dial Local Extension </label>
|
||||
<input type=radio name='newFM_Number_radio' id='newFM_Number_radio_Externals'>
|
||||
<label for='newFM_Number_radio_Externals'> Dial Outside Number </label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class='FORM_newFM_Number'>
|
||||
<td align=right></td>
|
||||
<td> <select id='FMU_newNumber_local'></select> <input id='FMU_newNumber_External' size=10> for <input id='FMU_newNumber_seconds' size=1> Seconds</td>
|
||||
</tr>
|
||||
|
||||
<tr class='FORM_newFM_Number'>
|
||||
<td align=right valign=top>Dial Order <img src="images/tooltip_info.gif" tip="en,followme,5" class='tooltipinfo'> :</td>
|
||||
<td>
|
||||
<input type=radio name='newFM_Order_radio' id='newFM_Order_radio_after'>
|
||||
<label for='newFM_Order_radio_after'>Ring after Trying previous extension/number </label><BR>
|
||||
<input type=radio name='newFM_Order_radio' id='newFM_Order_radio_alongWith'>
|
||||
<label for='newFM_Order_radio_alongWith'>Ring along with previous extension/number </label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class='FORM_newFM_Number'>
|
||||
<td align=right></td>
|
||||
<td>
|
||||
<span class='guiButtonCancel' onclick=" followMe_MiscFunctions.hide_FORM_newFM_Number();">Cancel</span>
|
||||
<span class='guiButton' onclick="followMe_MiscFunctions.push_newdest();"> ↑ Add</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class='FORM_newFM_Number'>
|
||||
<td align=center valign=bottom colspan=2 height=5></td>
|
||||
</tr>
|
||||
|
||||
<tr id='lastRow_Edit'>
|
||||
<td align=center valign=bottom colspan=2 style="padding:15px; background-color: #f4deb7">
|
||||
<span class='guiButtonCancel' onclick='ASTGUI.hideDrag(event);'>Cancel</span>
|
||||
<span class='guiButtonEdit' onclick='save_FollowMeUser();'>Save</span>
|
||||
</td>
|
||||
</tr>
|
||||
</TABLE>
|
||||
</div>
|
||||
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/followme.js"></script>
|
||||
<script src="js/jquery.tooltip.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
155
old-asterisk/asterisk/static-http/config/gtalk.html
Normal file
@@ -0,0 +1,155 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Google Talk/Jabber Configuration
|
||||
*
|
||||
* Copyright (C) 2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
#table_BuddiesList {
|
||||
border: 1px solid #666666;
|
||||
margin: 0px;
|
||||
width: 95% ;
|
||||
text-align: center;
|
||||
padding : 1px;
|
||||
}
|
||||
|
||||
#table_BuddiesList tr.heading { background: #FFFFFF; }
|
||||
#table_BuddiesList tr.frow { background: #6b79a5; color: #CED7EF; }
|
||||
#table_BuddiesList tr.frow td{ font-weight:bold; }
|
||||
#table_BuddiesList tr td{ padding : 3px; }
|
||||
#table_BuddiesList tr.even { background: #DFDFDF; }
|
||||
#table_BuddiesList tr.odd{ background: #FFFFFF; }
|
||||
#table_BuddiesList tr.even:hover, #table_BuddiesList tr.odd:hover {
|
||||
background: #a8b6e5;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
|
||||
#table_AccountsList {
|
||||
border: 1px solid #666666;
|
||||
margin: 0px;
|
||||
text-align: center;
|
||||
padding : 1px;
|
||||
width: 95% ;
|
||||
}
|
||||
#table_AccountsList tr.heading { background: #FFFFFF;}
|
||||
#table_AccountsList tr.frow { background: #6b79a5; color: #CED7EF; }
|
||||
#table_AccountsList tr.frow td{ font-weight:bold; }
|
||||
#table_AccountsList tr td { padding : 3px; }
|
||||
#table_AccountsList tr.even { background: #DFDFDF; }
|
||||
#table_AccountsList tr.odd { background: #FFFFFF; }
|
||||
#table_AccountsList tr.even:hover, #table_AccountsList tr.odd:hover {
|
||||
background: #a8b6e5;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
Google Talk Settings
|
||||
<span class='refresh_icon' onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
|
||||
<center><div id="tabbedMenu" style="margin-bottom: 0px;"></div></center>
|
||||
|
||||
<div id='table_BuddiesList_DIV' style='margin-left:50px; margin-top: 0px; margin-right: 50px; padding: 0px'>
|
||||
<div style="margin-bottom: 10px; margin-top:0px">
|
||||
<span class='guiButtonNew' onclick='MANAGE_BUDDIES.new_buddy_form();'>New Peer</span>
|
||||
<!--<span class='lite_Heading' style="margin-left: 50px">Peers</span>-->
|
||||
</div>
|
||||
<div><table id='table_BuddiesList' cellpadding=0 cellspacing=0 border=0 align=center></table></div>
|
||||
</div>
|
||||
<div id='table_AccountsList_DIV' style='margin-left:50px; margin-top: 0px; margin-right: 50px; padding: 0px'>
|
||||
<div style="margin-bottom: 10px; margin-top:0px">
|
||||
<span class='guiButtonNew' onclick='MANAGE_ACCOUNTS.new_Account_form();'>New gtalk Account</span>
|
||||
<!--<span class='lite_Heading' style="margin-left: 50px">gtalk Accounts</span>-->
|
||||
</div>
|
||||
<table id='table_AccountsList' cellpadding=0 cellspacing=0 border=0 align=center></table>
|
||||
</div>
|
||||
|
||||
<div id="buddy_editdiv" STYLE="width:500px; display:none;" class='dialog'>
|
||||
<TABLE width="100%" cellpadding=0 cellspacing=0>
|
||||
<TR class="dialog_title_tr">
|
||||
<TD class="dialog_title" onmousedown="ASTGUI.startDrag(event);"><span></span></TD>
|
||||
<TD class="dialog_title_X" onclick="ASTGUI.hideDrag(event);"> X </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<table cellpadding=2 cellspacing=2 border=0 width="100%" align="center">
|
||||
<tr> <td align="right" colspan=2 height=10></td></tr>
|
||||
<tr> <td align=right>Username: </td>
|
||||
<td colspan=2><input id="edit_buddyName_text" size=25></td>
|
||||
</tr>
|
||||
<tr> <td align=right>Connection: </td>
|
||||
<td colspan=2><select id="edit_buddyConnection_select"></select></td>
|
||||
</tr>
|
||||
|
||||
<tr> <td align=right>Incoming Calls to : </td>
|
||||
<td colspan=2><select id="edit_buddyIncomingCalls_select"></select></td>
|
||||
</tr>
|
||||
|
||||
<tr> <td align="right" colspan=2 height=10></td></tr>
|
||||
<tr> <td align=center colspan=3>
|
||||
<span class='guiButtonCancel' onclick='ASTGUI.hideDrag(event);'>Cancel</span>
|
||||
<span class='guiButtonEdit' onclick='MANAGE_BUDDIES.addBuddy();'>Save</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr> <td align="right" colspan=2 height=10></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="account_editdiv" STYLE="width:500px; display:none;" class='dialog'>
|
||||
<TABLE width="100%" cellpadding=0 cellspacing=0>
|
||||
<TR class="dialog_title_tr">
|
||||
<TD class="dialog_title" onmousedown="ASTGUI.startDrag(event);"><span></span></TD>
|
||||
<TD class="dialog_title_X" onclick="ASTGUI.hideDrag(event);"> X </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<table cellpadding=2 cellspacing=2 border=0 width="100%" align="center">
|
||||
<tr> <td align="right" colspan=2 height=10></td></tr>
|
||||
<tr> <td align=right>Username: </td>
|
||||
<td colspan=2><input id="edit_account_text" size=25></td>
|
||||
</tr>
|
||||
<tr> <td align=right>Password: </td>
|
||||
<td colspan=2><input id="edit_account_secret" size=16></td>
|
||||
</tr>
|
||||
<tr> <td align=right>Status Message: </td>
|
||||
<td colspan=2><input id="edit_account_status" size=25></td>
|
||||
</tr>
|
||||
<tr> <td align="right" colspan=2 height=10></td></tr>
|
||||
<tr> <td align=center colspan=3>
|
||||
<span class='guiButtonCancel' onclick='ASTGUI.hideDrag(event);'>Cancel</span>
|
||||
<span class='guiButtonEdit' onclick='MANAGE_ACCOUNTS.saveAccount();'>Save</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr> <td align="right" colspan=2 height=10></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/gtalk.js"></script>
|
||||
<script src="js/jquery.tooltip.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
159
old-asterisk/asterisk/static-http/config/guialert.html
Normal file
@@ -0,0 +1,159 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Alert/Progress dialog
|
||||
*
|
||||
* Copyright (C) 2007-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Alert/Progress Dialog</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
#div_alert {
|
||||
font-family: arial, sans-serif, helvetica;
|
||||
width:490;
|
||||
Height: 250px;
|
||||
background-color:#FFFFFF;
|
||||
border-width: 6px;
|
||||
border-color: #DDB988;
|
||||
border-style: solid;
|
||||
cursor: default
|
||||
}
|
||||
|
||||
.alert_title_tr {
|
||||
background: #ECD7BB;
|
||||
/*background-image: url('./images/title_gradient.gif');*/
|
||||
}
|
||||
|
||||
.alert_title {
|
||||
height: 40px;
|
||||
margin:0px;
|
||||
padding-left:25px;
|
||||
cursor: move;
|
||||
/* color:#FFFFFF; */
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.alert_title_span {
|
||||
font-family: arial, sans-serif, helvetica;
|
||||
font-size : 135%;
|
||||
}
|
||||
|
||||
.alert_ok{
|
||||
font-size : 85%;
|
||||
margin-left: 20px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body onload="update()" topmargin=0 leftmargin=0 style="background-color: transparent; cursor: not-allowed">
|
||||
<table width="100%" height="570" align=center border=0><tr><td valign="middle" align=center>
|
||||
<div id="div_alert" STYLE="display:none;">
|
||||
<TABLE cellpadding=0 cellspacing=0 border=0 width="100%">
|
||||
<TR class="alert_title_tr">
|
||||
<TD class="alert_title"><span class="alert_title_span">Alert !</span></TD>
|
||||
</TR>
|
||||
|
||||
<TR> <TD align="center" bgcolor="#FFFFFF" height='150' id='message'> </TD> </TR>
|
||||
|
||||
<TR> <TD align="right">
|
||||
<input type="button" id="ok" onclick="close_guialert()" value="Ok" class="alert_ok">
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</div>
|
||||
|
||||
<div id="div_status" STYLE="display:none; width:360; background-color:#FFFFFF; border-width: 2px; border-color: #7E5538; border-style: solid; background-style: solid; cursor: default">
|
||||
|
||||
<table width="100%" cellpadding=0 cellspacing=0>
|
||||
<TR bgcolor="#7E5538" style="background-image:url('images/title_gradient.gif');">
|
||||
<TD Height="20" align="center">
|
||||
<font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">Loading ...</font>
|
||||
</TD>
|
||||
<TD Height="20" align="right"></TD>
|
||||
<TD width=4></TD>
|
||||
</TR>
|
||||
</table>
|
||||
|
||||
<TABLE cellpadding=0 cellspacing=3 border=0 width="100%">
|
||||
<TR><TD colspan=2 height=10></TD></TR>
|
||||
|
||||
<TR> <TD align="right">
|
||||
<img src='images/loading.gif'>
|
||||
</TD>
|
||||
<TD align="center" bgcolor="#FFFFFF" valign=middle>
|
||||
<div id='div_status_message'></div>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR><TD colspan=2 height=10></TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</td></tr></table>
|
||||
<script>
|
||||
function submitOnEnter(e){
|
||||
if(e.keyCode == 27){
|
||||
close_guialert();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
events = {
|
||||
getTarget: function(x){
|
||||
x = x || window.event;
|
||||
return x.target || x.srcElement;
|
||||
},
|
||||
add: function(a,b,c){ // a is element , b is event (string) , c is the function
|
||||
if( navigator.userAgent.indexOf("MSIE") != -1 ){ a.attachEvent('on'+b, c); }else{ a.addEventListener(b, c, false); }
|
||||
},
|
||||
remove: function(a,b,c){
|
||||
if( navigator.userAgent.indexOf("MSIE") != -1 ){ a.detachEvent('on'+b, c); }else{ a.removeEventListener(b, c, false); }
|
||||
}
|
||||
}
|
||||
|
||||
function update( ){
|
||||
if( navigator.userAgent.indexOf("MSIE") != -1 ){
|
||||
document.body.style.backgroundColor ="#F4EFE5";
|
||||
}
|
||||
if(top.alertmsgtype == 1 ){
|
||||
document.getElementById('message').innerHTML = top.alertmsg ;
|
||||
document.getElementById('div_status').style.display = "none" ;
|
||||
document.getElementById('div_alert').style.display = "" ;
|
||||
try{document.getElementById('ok').focus() ;}catch(e){ }
|
||||
}
|
||||
|
||||
if(top.alertmsgtype == 2 ){
|
||||
document.getElementById('div_status_message').innerHTML = top.alertmsg ;
|
||||
document.getElementById('div_status').style.display = "" ;
|
||||
document.getElementById('div_alert').style.display = "none" ;
|
||||
}
|
||||
|
||||
events.add( document , 'keyup' , submitOnEnter);
|
||||
}
|
||||
|
||||
function close_guialert( ){
|
||||
top.document.getElementById( top.alertframename ).style.display = "none";
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
470
old-asterisk/asterisk/static-http/config/hardware.html
Normal file
@@ -0,0 +1,470 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Digital Card Setup / Detection
|
||||
*
|
||||
* Copyright (C) 2007-2008, Digium, Inc.
|
||||
*
|
||||
* Brandon Kruse <bkruse@digium.com>
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*
|
||||
*
|
||||
** this page is designed to work with the following sample ztscan output
|
||||
** - - - - - - begin ztscan output - - - - - - - -
|
||||
** [3]
|
||||
** active=yes
|
||||
** alarms=UNCONFIGURED
|
||||
** description=T4XXP (PCI) Card 2 Span 1
|
||||
** name=TE4/2/1
|
||||
** manufacturer=Digium
|
||||
** devicetype=Wildcard TE410P/TE405P (1st Gen)
|
||||
** location=PCI Bus 02 Slot 04
|
||||
** basechan=1
|
||||
** totchans=24
|
||||
** irq=21
|
||||
** type=digital-T1
|
||||
** syncsrc=0
|
||||
** lbo=0 db (CSU)/0-133 feet (DSX-1)
|
||||
** coding_opts=B8ZS,AMI
|
||||
** framing_opts=ESF,D4
|
||||
** coding=
|
||||
** framing=
|
||||
** - - - - - - End of ztscan output - - - - - - - -
|
||||
** in the above output, [3] is the span number and the description says 'Card 2 Span 1' which is
|
||||
** still valid because 'span 3' is the 'span 1' on 'card 2'
|
||||
** if your ztscan outputs in some other wiered format, this page will go crazy and might not work as expected.
|
||||
**
|
||||
*** in this page, SPANS[l]['syncsrc'] is NOT the syncsrc from ztscan - but it is read from zaptel.conf
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Zaptel Hardware Configuration</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style>
|
||||
|
||||
.taglist {
|
||||
border: 1px solid #666666;
|
||||
margin-top:10px;
|
||||
margin-bottom:10px;
|
||||
max-width: 80%;
|
||||
}
|
||||
|
||||
.taglist tr.frow {
|
||||
background-color: #6b79a5;
|
||||
color: #CED7EF;
|
||||
}
|
||||
|
||||
.taglist tr.even {
|
||||
background-color: #DFDFDF;
|
||||
}
|
||||
|
||||
.taglist tr.odd{
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.taglist tr.even:hover, .taglist tr.odd:hover {
|
||||
background-color: #a8b6e5;
|
||||
}
|
||||
|
||||
#errmsg{
|
||||
border: 1px solid #666666;
|
||||
margin-left:50px;
|
||||
margin-right:50px;
|
||||
padding : 20px 10px 20px 10px;
|
||||
font-size: 125%;
|
||||
text-align: center;
|
||||
background-color:#FFFFFF;
|
||||
}
|
||||
|
||||
.pageheading{
|
||||
padding : 10px 10px 4px 10px;
|
||||
font-size: 135%;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="#EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
<span id='iframeTitleBar_title'> Hardware Configuration</span>
|
||||
<span class='refresh_icon' onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
|
||||
<TABLE id='tabbedMenu_container' style='display:none;' width='100%' align=center><TR><TD align=center>
|
||||
<div id="tabbedMenu"></div>
|
||||
</TD></TR></table>
|
||||
|
||||
<div id="div_maintable">
|
||||
|
||||
<div id='digital_settings' style='display:none;'>
|
||||
<div class="pageheading">Digital Hardware</div>
|
||||
<div style="overflow:auto;left:40; max-height: 300px;">
|
||||
<table class="taglist" id="digitalcardstable" cellpadding=5 cellspacing=1 border=0 align=center></table>
|
||||
</div><BR>
|
||||
</div>
|
||||
|
||||
<div class="pageheading">Analog Hardware</div>
|
||||
<div style="overflow:auto;left:40">
|
||||
<table id="FXSFXO_ports_td" cellpadding=5 cellspacing=1 align=center border=0 class='taglist' width=480>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<table cellpadding=5 cellspacing=1 align=center border=0>
|
||||
<tr> <td align="right"><B>Tone Region <img src="images/tooltip_info.gif" tip="en,confighw,0" class='tooltipinfo'> : </B>
|
||||
<select id="loadZone">
|
||||
<option value="us">United States/North America</option>
|
||||
<option value="au">Australia</option>
|
||||
<option value="fr">France</option>
|
||||
<option value="nl">Netherlands</option>
|
||||
<option value="uk">United Kingdom</option>
|
||||
<option value="fi">Finland</option>
|
||||
<option value="es">Spain</option>
|
||||
<option value="jp">Japan</option>
|
||||
<option value="no">Norway</option>
|
||||
<option value="at">Austria</option>
|
||||
<option value="nz">New Zealand</option>
|
||||
<option value="it">Italy</option>
|
||||
<option value="us-old">United States Circa 1950 / North America</option>
|
||||
<option value="gr">Greece</option>
|
||||
<option value="tw">Taiwan</option>
|
||||
<option value="cl">Chile</option>
|
||||
<option value="se">Sweden</option>
|
||||
<option value="be">Belgium</option>
|
||||
<option value="sg">Singapore</option>
|
||||
<option value="il">Israel</option>
|
||||
<option value="br">Brazil</option>
|
||||
<option value="hu">Hungary</option>
|
||||
<option value="lt">Lithuania</option>
|
||||
<option value="pl">Poland</option>
|
||||
<option value="za">South Africa</option>
|
||||
<option value="pt">Portugal</option>
|
||||
<option value="ee">Estonia</option>
|
||||
<option value="mx">Mexico</option>
|
||||
<option value="in">India</option>
|
||||
<option value="de">Germany</option>
|
||||
<option value="ch">Switzerland</option>
|
||||
<option value="dk">Denmark</option>
|
||||
<option value="cz">Czech Republic</option>
|
||||
<option value="cn">China</option>
|
||||
<option value="ar">Argentina</option>
|
||||
<option value="my">Malaysia</option>
|
||||
<option value="th">Thailand</option>
|
||||
<option value="bg">Bulgaria</option>
|
||||
<option value="ve">Venezuela</option>
|
||||
<option value="ph">Philippines</option>
|
||||
<option value="ru">Russian Federation</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='center'>
|
||||
<input type='checkbox' id='RESET_ANY_DIGITAL_TRUNKS'> Reset all Previous Digital Trunks Information
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="pageheading">Advanced Settings</div>
|
||||
|
||||
<table align=center>
|
||||
|
||||
<tr> <td align=right>Module Name : </td>
|
||||
<td> <input id="zap_moduleName" dfalt='wctdm24xxp' size=10></td>
|
||||
</tr>
|
||||
<tr><td align=right>Opermode <img src="images/tooltip_info.gif" tip="en,opermode_settings,0" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<input type='checkbox' id='enable_disable_checkbox_opermode'>
|
||||
<select id="opermode" dfalt='USA'>
|
||||
<option value="USA">USA</option>
|
||||
<option value="ARGENTINA">ARGENTINA</option>
|
||||
<option value="AUSTRALIA">AUSTRALIA</option>
|
||||
<option value="AUSTRIA">AUSTRIA</option>
|
||||
<option value="BAHRAIN">BAHRAIN</option>
|
||||
<option value="BELGIUM">BELGIUM</option>
|
||||
<option value="BRAZIL">BRAZIL</option>
|
||||
<option value="BULGARIA">BULGARIA</option>
|
||||
<option value="CANADA">CANADA</option>
|
||||
<option value="CHILE">CHILE</option>
|
||||
<option value="CHINA">CHINA</option>
|
||||
<option value="COLUMBIA">COLUMBIA</option>
|
||||
<option value="CROATIA">CROATIA</option>
|
||||
<option value="CYRPUS">CYRPUS</option>
|
||||
<option value="CZECH">CZECH</option>
|
||||
<option value="DENMARK">DENMARK</option>
|
||||
<option value="ECUADOR">ECUADOR</option>
|
||||
<option value="EGYPT">EGYPT</option>
|
||||
<option value="ELSALVADOR">ELSALVADOR</option>
|
||||
<option value="FCC">FCC</option>
|
||||
<option value="FINLAND">FINLAND</option>
|
||||
<option value="FRANCE">FRANCE</option>
|
||||
<option value="GERMANY">GERMANY</option>
|
||||
<option value="GREECE">GREECE</option>
|
||||
<option value="GUAM">GUAM</option>
|
||||
<option value="HONGKONG">HONGKONG</option>
|
||||
<option value="HUNGARY">HUNGARY</option>
|
||||
<option value="ICELAND">ICELAND</option>
|
||||
<option value="INDIA">INDIA</option>
|
||||
<option value="INDONESIA">INDONESIA</option>
|
||||
<option value="IRELAND">IRELAND</option>
|
||||
<option value="ISRAEL">ISRAEL</option>
|
||||
<option value="ITALY">ITALY</option>
|
||||
<option value="JAPAN">JAPAN</option>
|
||||
<option value="JORDAN">JORDAN</option>
|
||||
<option value="KAZAKHSTAN">KAZAKHSTAN</option>
|
||||
<option value="KUWAIT">KUWAIT</option>
|
||||
<option value="LATVIA">LATVIA</option>
|
||||
<option value="LEBANON">LEBANON</option>
|
||||
<option value="LUXEMBOURG">LUXEMBOURG</option>
|
||||
<option value="MACAO">MACAO</option>
|
||||
<option value="MALAYSIA">MALAYSIA</option>
|
||||
<option value="MALTA">MALTA</option>
|
||||
<option value="MEXICO">MEXICO</option>
|
||||
<option value="MOROCCO">MOROCCO</option>
|
||||
<option value="NETHERLANDS">NETHERLANDS</option>
|
||||
<option value="NEWZEALAND">NEWZEALAND</option>
|
||||
<option value="NIGERIA">NIGERIA</option>
|
||||
<option value="NORWAY">NORWAY</option>
|
||||
<option value="OMAN">OMAN</option>
|
||||
<option value="PAKISTAN">PAKISTAN</option>
|
||||
<option value="PERU">PERU</option>
|
||||
<option value="PHILIPPINES">PHILIPPINES</option>
|
||||
<option value="POLAND">POLAND</option>
|
||||
<option value="PORTUGAL">PORTUGAL</option>
|
||||
<option value="ROMANIA">ROMANIA</option>
|
||||
<option value="RUSSIA">RUSSIA</option>
|
||||
<option value="SAUDIARABIA">SAUDIARABIA</option>
|
||||
<option value="SINGAPORE">SINGAPORE</option>
|
||||
<option value="SLOVAKIA">SLOVAKIA</option>
|
||||
<option value="SLOVENIA">SLOVENIA</option>
|
||||
<option value="SOUTHAFRICA">SOUTHAFRICA</option>
|
||||
<option value="SOUTHKOREA">SOUTHKOREA</option>
|
||||
<option value="SPAIN">SPAIN</option>
|
||||
<option value="SWEDEN">SWEDEN</option>
|
||||
<option value="SWITZERLAND">SWITZERLAND</option>
|
||||
<option value="SYRIA">SYRIA</option>
|
||||
<option value="TAIWAN">TAIWAN</option>
|
||||
<option value="TBR21">TBR21</option>
|
||||
<option value="THAILAND">THAILAND</option>
|
||||
<option value="UAE">UAE</option>
|
||||
<option value="UK">UK</option>
|
||||
<option value="YEMEN">YEMEN</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr><td align=right>a-law override <img src="images/tooltip_info.gif" tip="en,opermode_settings,1" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<input type='checkbox' id='enable_disable_checkbox_alawoverride'>
|
||||
<select id="alawoverride" dfalt='0'>
|
||||
<option value="0">ulaw</option>
|
||||
<option value="1">alaw</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td align=right>fxs honor mode <img src="images/tooltip_info.gif" tip="en,opermode_settings,2" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<input type='checkbox' id='enable_disable_checkbox_fxshonormode'>
|
||||
<select id="fxshonormode" dfalt='0'>
|
||||
<option value="0">apply opermode to fxo modules only </option>
|
||||
<option value="1">apply opermode to fxs and fxo modules</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr><td align=right>boostringer <img src="images/tooltip_info.gif" tip="en,opermode_settings,3" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<input type='checkbox' id='enable_disable_checkbox_boostringer'>
|
||||
<select id="boostringer" dfalt='0'>
|
||||
<option value="0">normal</option>
|
||||
<option value="1">peak(89V)</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td align=right>fastringer <img src="images/tooltip_info.gif" tip="en,opermode_settings,5" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<input type='checkbox' id='enable_disable_checkbox_fastringer'>
|
||||
<select id="fastringer" dfalt='0'>
|
||||
<option value="0">normal</option>
|
||||
<option value="1">fast ringer (25hz) </option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td align=right>lowpower <img src="images/tooltip_info.gif" tip="en,opermode_settings,4" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<input type='checkbox' id='enable_disable_checkbox_lowpower'>
|
||||
<select id="lowpower" dfalt='0'>
|
||||
<option value="0">normal</option>
|
||||
<option value="1">fast ringer to 50V peak</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr> <td align=right>ring detect <img src="images/tooltip_info.gif" tip="en,opermode_settings,6" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<input type='checkbox' id='enable_disable_checkbox_fwringdetect'>
|
||||
<select id="fwringdetect" dfalt='0'>
|
||||
<option value='0'>standard</option>
|
||||
<option value='1'>full wave</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr> <td align=right>MWI mode <img src="images/tooltip_info.gif" tip="en,opermode_settings,7" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<input type='checkbox' id='enable_disable_checkbox_mwimode'>
|
||||
<select id="mwimode" dfalt='none'>
|
||||
<option value='none'>None</option>
|
||||
<option value='FSK'>FSK</option>
|
||||
<option value='NEON'>NEON</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class='neon_settings' style='display:none'>
|
||||
<td align=right>Neon MWI voltage Level :</td>
|
||||
<td> <input id="neonmwi_level" size=2></td>
|
||||
</tr>
|
||||
|
||||
<tr class='neon_settings' style='display:none'>
|
||||
<td align=right>Neon MWI off Limit (ms) :</td>
|
||||
<td> <input id="neonmwi_offlimit" size=4></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div style="overflow:auto;left:40">
|
||||
<table cellpadding=5 cellspacing=1 align=center border=0>
|
||||
<tr> <td height=50 valign='bottom'>
|
||||
<span class='guiButtonCancel' id="cancel_b" onclick='window.location.reload();'>Cancel Changes</span>
|
||||
<span class='guiButtonEdit' id="save_b" onclick='applyDigitalSettings();'>Update Settings</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="errmsg" style="display:none"></div>
|
||||
|
||||
<div id="edit_span" STYLE="width:500; height:340;display:none;" class='dialog'>
|
||||
<TABLE width="100%" cellpadding=0 cellspacing=0>
|
||||
<TR class="dialog_title_tr">
|
||||
<TD class="dialog_title" onmousedown="ASTGUI.startDrag(event);">
|
||||
SPAN : <span id="editspan_SPAN"></span>
|
||||
</TD>
|
||||
<TD class="dialog_title_X" onclick="ASTGUI.hideDrag(event);"> X </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<TABLE align=center cellpadding=2 cellspacing=2 border=0>
|
||||
<TR> <TD align="right">ALARMS:</TD>
|
||||
<TD><span id="editspan_ALARMS"></span></TD>
|
||||
</TR>
|
||||
<TR> <TD align="right">Framing/Coding:</TD>
|
||||
<TD> <select id="editspan_fac"></select> </TD>
|
||||
</TR>
|
||||
<TR> <TD align="right">Channels:</TD>
|
||||
<TD><span id="editspan_channels"></span></TD>
|
||||
</TR>
|
||||
<TR> <TD align="right">Signalling</TD>
|
||||
<TD> <select id="editspan_signalling" onChange="disablEnable_sc();">
|
||||
<option value="pri_net">PRI - Net</option>
|
||||
<option value="pri_cpe">PRI - CPE</option>
|
||||
<option value="em">E & M</option>
|
||||
<option value="em_w">E & M -- Wink</option>
|
||||
<option value="featd">E & M -- featd(DTMF)</option>
|
||||
<option value="fxo_ks">FXOKS</option>
|
||||
<option value="fxo_ls">FXOLS</option>
|
||||
<!--<option value="fxs_ks">FXSKS</option>
|
||||
<option value="fxs_ls">FXSLS</option>-->
|
||||
</select>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR id="signalling_container"> <TD align="right">Switch Type</TD>
|
||||
<TD> <select id="editspan_switchtype">
|
||||
<option value="national">National ISDN 2 (default)</option>
|
||||
<option value="dms100">Nortel DMS100</option>
|
||||
<option value="4ess">AT&T 4ESS</option>
|
||||
<option value="5ess">Lucent 5ESS</option>
|
||||
<option value="euroisdn">EuroISDN</option>
|
||||
<option value="ni1">Old National ISDN 1</option>
|
||||
<option value="qsig">Q.SIG</option>
|
||||
</select>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR> <TD align="right">Sync/Clock Source</TD>
|
||||
<TD> <select id="editspan_syncsrc">
|
||||
</select>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR> <TD align="right">Line Build Out</TD>
|
||||
<TD> <select id="editspan_lbo">
|
||||
<option value="0">0 db (CSU)/0-133 feet (DSX-1)</option>
|
||||
<option value="1">133-266 feet (DSX-1)</option>
|
||||
<option value="2">266-399 feet (DSX-1)</option>
|
||||
<option value="3">399-533 feet (DSX-1)</option>
|
||||
<option value="4">533-655 feet (DSX-1)</option>
|
||||
<option value="5">-7.5db (CSU)</option>
|
||||
<option value="6">-15db (CSU)</option>
|
||||
<option value="7">-22.5db (CSU)</option>
|
||||
</select>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR> <TD align="right" valign=top>Channels:</TD>
|
||||
<TD> <table border=0 cellpadding=2 cellspacing=1>
|
||||
<tr> <td> Use : <select id="edit_DefinedChans"></select> </td> </tr>
|
||||
<tr> <td> From : <span id="edit_labelZapchan"></span> </td> </tr>
|
||||
<tr> <td> Reserved : <span id="edit_labelReserved"></span> </td> </tr>
|
||||
</table>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR> <TD colspan=2 align=center height=50 valign=middle>
|
||||
<span class='guiButtonCancel' id="cancel_a" onclick='canelSpanInfo();'>Cancel</span>
|
||||
<span class='guiButtonEdit' id="save_a" onclick='updateSpanInfo();'>Update</span>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="edit_analog_signalling" STYLE="width:500; height:340;display:none;" class='dialog'>
|
||||
<TABLE width="100%" cellpadding=0 cellspacing=0>
|
||||
<TR class="dialog_title_tr">
|
||||
<TD class="dialog_title" onmousedown="ASTGUI.startDrag(event);">Analog Ports - Signalling Preferences</TD>
|
||||
<TD class="dialog_title_X" onclick="ASTGUI.hideDrag(event);"> X </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<TABLE align=center cellpadding=2 cellspacing=2 border=0>
|
||||
<TR> <TD align="center">
|
||||
<div style='text-align:center;overflow :auto; height:250px; width: 400px;' id='edit_analog_signalling_options_container'>
|
||||
</div>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR> <TD align=center height=50 valign=middle>
|
||||
<span class='guiButtonCancel' onclick='ASTGUI.hideDrag(event);'>Cancel</span>
|
||||
<span class='guiButtonEdit' onclick='digital_miscFunctions.save_analog_signalling_prefs();'>Update</span>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</div>
|
||||
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/hardware.js"></script>
|
||||
<script src="js/jquery.tooltip.js"></script>
|
||||
<script src="js/jquery.autocomplete.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
328
old-asterisk/asterisk/static-http/config/hardware_aa50.html
Normal file
@@ -0,0 +1,328 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* hardware configuration for AA50
|
||||
*
|
||||
* Copyright (C) 2008-2011, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
* Erin Spiceland <espiceland@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>AA50 Hardware Configuration</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style>
|
||||
.hidevpm{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.taglist {
|
||||
border: 1px solid #666666;
|
||||
margin-top:10px;
|
||||
margin-bottom:10px;
|
||||
max-width: 745;
|
||||
}
|
||||
|
||||
.taglist tr.frow {
|
||||
background-color: #6b79a5;
|
||||
color: #CED7EF;
|
||||
}
|
||||
|
||||
.taglist tr.even {
|
||||
background-color: #DFDFDF;
|
||||
}
|
||||
|
||||
.taglist tr.odd{
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.taglist tr.even:hover, .taglist tr.odd:hover {
|
||||
background-color: #a8b6e5;
|
||||
}
|
||||
|
||||
#errmsg{
|
||||
border: 1px solid #666666;
|
||||
margin-left:50px;
|
||||
margin-right:50px;
|
||||
padding : 20px 10px 20px 10px;
|
||||
font-size: 125%;
|
||||
text-align: center;
|
||||
background-color:#FFFFFF;
|
||||
}
|
||||
|
||||
.pageheading{
|
||||
padding : 10px 10px 4px 10px;
|
||||
font-size: 135%;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="#EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
<span id='iframeTitleBar_title'> Analog Hardware Setup & Configuration </span>
|
||||
<span class='refresh_icon' onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
|
||||
<div class="pageheading">Analog Hardware</div>
|
||||
<table id="FXSFXO_ports_td" cellpadding=0 cellspacing=0 align=center border=0 class='taglist' width=480></table>
|
||||
<div style='text-align:center; width:100%'>
|
||||
<B>Tone Region <img src="images/tooltip_info.gif" tip="en,confighw,0" class='tooltipinfo'> : </B>
|
||||
<select id="loadZone">
|
||||
<option value="us">North America -- United States/Canada
|
||||
<option value="us-old">North America -- United States Circa 1950
|
||||
<option value="ar">Argentina</option>
|
||||
<option value="au">Australia</option>
|
||||
<option value="at">Austria</option>
|
||||
<option value="be">Belgium</option>
|
||||
<option value="br">Brazil</option>
|
||||
<option value="bg">Bulgaria</option>
|
||||
<option value="cl">Chile</option>
|
||||
<option value="cn">China</option>
|
||||
<option value="cz">Czech Republic</option>
|
||||
<option value="dk">Denmark</option>
|
||||
<option value="ee">Estonia</option>
|
||||
<option value="fi">Finland</option>
|
||||
<option value="fr">France</option>
|
||||
<option value="de">Germany</option>
|
||||
<option value="gr">Greece</option>
|
||||
<option value="hu">Hungary</option>
|
||||
<option value="in">India</option>
|
||||
<option value="il">Israel</option>
|
||||
<option value="it">Italy</option>
|
||||
<option value="jp">Japan</option>
|
||||
<option value="lt">Lithuania</option>
|
||||
<option value="my">Malaysia</option>
|
||||
<option value="mx">Mexico</option>
|
||||
<option value="nl">Netherlands</option>
|
||||
<option value="nz">New Zealand</option>
|
||||
<option value="no">Norway</option>
|
||||
<option value="ph">Philippines</option>
|
||||
<option value="pl">Poland</option>
|
||||
<option value="pt">Portugal</option>
|
||||
<option value="ru">Russian Federation</option>
|
||||
<option value="sg">Singapore</option>
|
||||
<option value="za">South Africa</option>
|
||||
<option value="es">Spain</option>
|
||||
<option value="se">Sweden</option>
|
||||
<option value="ch">Switzerland</option>
|
||||
<option value="tw">Taiwan</option>
|
||||
<option value="th">Thailand</option>
|
||||
<option value="uk">United Kingdom</option>
|
||||
<option value="ve">Venezuela</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="pageheading">Advanced Settings</div>
|
||||
|
||||
<table align=center>
|
||||
|
||||
<tr><td align=right>Opermode <img src="images/tooltip_info.gif" tip="en,opermode_settings,0" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<select id="opermode" dfalt='USA'>
|
||||
<option value="USA">USA</option>
|
||||
<option value="ARGENTINA">ARGENTINA</option>
|
||||
<option value="AUSTRALIA">AUSTRALIA</option>
|
||||
<option value="AUSTRIA">AUSTRIA</option>
|
||||
<option value="BAHRAIN">BAHRAIN</option>
|
||||
<option value="BELGIUM">BELGIUM</option>
|
||||
<option value="BRAZIL">BRAZIL</option>
|
||||
<option value="BULGARIA">BULGARIA</option>
|
||||
<option value="CANADA">CANADA</option>
|
||||
<option value="CHILE">CHILE</option>
|
||||
<option value="CHINA">CHINA</option>
|
||||
<option value="COLUMBIA">COLUMBIA</option>
|
||||
<option value="CROATIA">CROATIA</option>
|
||||
<option value="CYRPUS">CYRPUS</option>
|
||||
<option value="CZECH">CZECH</option>
|
||||
<option value="DENMARK">DENMARK</option>
|
||||
<option value="ECUADOR">ECUADOR</option>
|
||||
<option value="EGYPT">EGYPT</option>
|
||||
<option value="ELSALVADOR">ELSALVADOR</option>
|
||||
<option value="FCC">FCC</option>
|
||||
<option value="FINLAND">FINLAND</option>
|
||||
<option value="FRANCE">FRANCE</option>
|
||||
<option value="GERMANY">GERMANY</option>
|
||||
<option value="GREECE">GREECE</option>
|
||||
<option value="GUAM">GUAM</option>
|
||||
<option value="HONGKONG">HONGKONG</option>
|
||||
<option value="HUNGARY">HUNGARY</option>
|
||||
<option value="ICELAND">ICELAND</option>
|
||||
<option value="INDIA">INDIA</option>
|
||||
<option value="INDONESIA">INDONESIA</option>
|
||||
<option value="IRELAND">IRELAND</option>
|
||||
<option value="ISRAEL">ISRAEL</option>
|
||||
<option value="ITALY">ITALY</option>
|
||||
<option value="JAPAN">JAPAN</option>
|
||||
<option value="JORDAN">JORDAN</option>
|
||||
<option value="KAZAKHSTAN">KAZAKHSTAN</option>
|
||||
<option value="KUWAIT">KUWAIT</option>
|
||||
<option value="LATVIA">LATVIA</option>
|
||||
<option value="LEBANON">LEBANON</option>
|
||||
<option value="LUXEMBOURG">LUXEMBOURG</option>
|
||||
<option value="MACAO">MACAO</option>
|
||||
<option value="MALAYSIA">MALAYSIA</option>
|
||||
<option value="MALTA">MALTA</option>
|
||||
<option value="MEXICO">MEXICO</option>
|
||||
<option value="MOROCCO">MOROCCO</option>
|
||||
<option value="NETHERLANDS">NETHERLANDS</option>
|
||||
<option value="NEWZEALAND">NEWZEALAND</option>
|
||||
<option value="NIGERIA">NIGERIA</option>
|
||||
<option value="NORWAY">NORWAY</option>
|
||||
<option value="OMAN">OMAN</option>
|
||||
<option value="PAKISTAN">PAKISTAN</option>
|
||||
<option value="PERU">PERU</option>
|
||||
<option value="PHILIPPINES">PHILIPPINES</option>
|
||||
<option value="POLAND">POLAND</option>
|
||||
<option value="PORTUGAL">PORTUGAL</option>
|
||||
<option value="ROMANIA">ROMANIA</option>
|
||||
<option value="RUSSIA">RUSSIA</option>
|
||||
<option value="SAUDIARABIA">SAUDIARABIA</option>
|
||||
<option value="SINGAPORE">SINGAPORE</option>
|
||||
<option value="SLOVAKIA">SLOVAKIA</option>
|
||||
<option value="SLOVENIA">SLOVENIA</option>
|
||||
<option value="SOUTHAFRICA">SOUTHAFRICA</option>
|
||||
<option value="SOUTHKOREA">SOUTHKOREA</option>
|
||||
<option value="SPAIN">SPAIN</option>
|
||||
<option value="SWEDEN">SWEDEN</option>
|
||||
<option value="SWITZERLAND">SWITZERLAND</option>
|
||||
<option value="SYRIA">SYRIA</option>
|
||||
<option value="TAIWAN">TAIWAN</option>
|
||||
<option value="TBR21">TBR21</option>
|
||||
<option value="THAILAND">THAILAND</option>
|
||||
<option value="UAE">UAE</option>
|
||||
<option value="UK">UK</option>
|
||||
<option value="YEMEN">YEMEN</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr><td align=right>a-law override <img src="images/tooltip_info.gif" tip="en,opermode_settings,1" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<select id="alawoverride" dfalt='0'>
|
||||
<option value="0">ulaw</option>
|
||||
<option value="1">alaw</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td align=right>fxs honor mode <img src="images/tooltip_info.gif" tip="en,opermode_settings,2" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<select id="fxshonormode" dfalt='0'>
|
||||
<option value="0">apply opermode to fxo modules only </option>
|
||||
<option value="1">apply opermode to fxs and fxo modules</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr><td align=right>boostringer <img src="images/tooltip_info.gif" tip="en,opermode_settings,3" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<select id="boostringer" dfalt='0'>
|
||||
<option value="0">normal</option>
|
||||
<option value="1">peak(89V)</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td align=right>fastringer <img src="images/tooltip_info.gif" tip="en,opermode_settings,5" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<select id="fastringer" dfalt='0'>
|
||||
<option value="0">normal</option>
|
||||
<option value="1">fast ringer (25hz) </option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td align=right>lowpower <img src="images/tooltip_info.gif" tip="en,opermode_settings,4" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<select id="lowpower" dfalt='0'>
|
||||
<option value="0">normal</option>
|
||||
<option value="1">fast ringer to 50V peak</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr> <td align=right>ring detect <img src="images/tooltip_info.gif" tip="en,opermode_settings,6" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<select id="fwringdetect" dfalt='0'>
|
||||
<option value='0'>standard</option>
|
||||
<option value='1'>full wave</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr> <td align=right>MWI mode <img src="images/tooltip_info.gif" tip="en,opermode_settings,7" class='tooltipinfo'> : </td>
|
||||
<td>
|
||||
<select id="mwimode" dfalt='none'>
|
||||
<option value='none'>None</option>
|
||||
<option value='FSK'>FSK</option>
|
||||
<option value='NEON'>NEON</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class='neon_settings' style='display:none'>
|
||||
<td align=right>Neon MWI voltage Level :</td>
|
||||
<td> <input id="neonmwi_level" size=2></td>
|
||||
</tr>
|
||||
|
||||
<tr class='neon_settings' style='display:none'>
|
||||
<td align=right>Neon MWI off Limit (ms) :</td>
|
||||
<td> <input id="neonmwi_offlimit" size=4></td>
|
||||
</tr>
|
||||
|
||||
<tr class='hidevpm'>
|
||||
<td></td>
|
||||
<td height=35 valign=middle><B> VPM Settings: </B></td>
|
||||
</tr>
|
||||
<tr class='hidevpm'>
|
||||
<td align=right>Echo Cancellation NLP Type <img src="images/tooltip_info.gif" tip="en,opermode_settings,8" class='tooltipinfo'> :</td>
|
||||
<td>
|
||||
<select id="vpmnlptype">
|
||||
<option value='0'>None</option>
|
||||
<option value='1'>Mute</option>
|
||||
<option value='2'>Random Noise</option>
|
||||
<option value='3'>Hoth Noise</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class='hidevpm'>
|
||||
<td align=right>Echo Cancellation NLP Threshold <img src="images/tooltip_info.gif" tip="en,opermode_settings,9" class='tooltipinfo'> :</td>
|
||||
<td>
|
||||
<select id="vpmnlpthresh"></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class='hidevpm'>
|
||||
<td align=right>Echo Cancellation NLP Max Suppression <img src="images/tooltip_info.gif" tip="en,opermode_settings,10" class='tooltipinfo'> :</td>
|
||||
<td>
|
||||
<select id="vpmnlpmaxsupp"></select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
<div style='text-align:center; width:100%'>
|
||||
<BR>
|
||||
<span class='guiButtonCancel' id="cancel_b" onclick='window.location.reload();'>Cancel Changes</span>
|
||||
<span class='guiButtonEdit' id="save_b" onclick='applySettings.updateZaptel();'>Update Settings</span>
|
||||
</div>
|
||||
|
||||
<div id="errmsg" style="display:none"></div>
|
||||
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/hardware_aa50.js"></script>
|
||||
<script src="js/jquery.tooltip.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
525
old-asterisk/asterisk/static-http/config/hardware_dahdi.html
Normal file
@@ -0,0 +1,525 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Digital Card Setup / Detection
|
||||
*
|
||||
* Copyright (C) 2007-2011, Digium, Inc.
|
||||
*
|
||||
* Brandon Kruse <bkruse@digium.com>
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
* Erin Spiceland <espiceland@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*
|
||||
*
|
||||
** this page is designed to work with the following sample ztscan output
|
||||
** - - - - - - begin ztscan output - - - - - - - -
|
||||
** [3]
|
||||
** active=yes
|
||||
** alarms=UNCONFIGURED
|
||||
** description=T4XXP (PCI) Card 2 Span 1
|
||||
** name=TE4/2/1
|
||||
** manufacturer=Digium
|
||||
** devicetype=Wildcard TE410P/TE405P (1st Gen)
|
||||
** location=PCI Bus 02 Slot 04
|
||||
** basechan=1
|
||||
** totchans=24
|
||||
** irq=21
|
||||
** type=digital-T1
|
||||
** syncsrc=0
|
||||
** lbo=0 db (CSU)/0-133 feet (DSX-1)
|
||||
** coding_opts=B8ZS,AMI
|
||||
** framing_opts=ESF,D4
|
||||
** coding=
|
||||
** framing=
|
||||
** - - - - - - End of ztscan output - - - - - - - -
|
||||
** in the above output, [3] is the span number and the description says 'Card 2 Span 1' which is
|
||||
** still valid because 'span 3' is the 'span 1' on 'card 2'
|
||||
** if your ztscan outputs in some other weird format, this page will go crazy and might not work as expected.
|
||||
**
|
||||
*** in this page, SPANS[l]['syncsrc'] is NOT the syncsrc from ztscan - but it is read from zaptel.conf
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>DAHDI Hardware Configuration</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style>
|
||||
|
||||
.taglist {
|
||||
border: 1px solid #666666;
|
||||
margin-top:10px;
|
||||
margin-bottom:10px;
|
||||
max-width: 80%;
|
||||
}
|
||||
|
||||
.taglist tr.frow {
|
||||
background-color: #6b79a5;
|
||||
color: #CED7EF;
|
||||
}
|
||||
|
||||
.taglist tr.even {
|
||||
background-color: #DFDFDF;
|
||||
}
|
||||
|
||||
.taglist tr.odd{
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.taglist tr.even:hover, .taglist tr.odd:hover {
|
||||
background-color: #a8b6e5;
|
||||
}
|
||||
|
||||
#errmsg{
|
||||
border: 1px solid #666666;
|
||||
margin-left:50px;
|
||||
margin-right:50px;
|
||||
padding : 20px 10px 20px 10px;
|
||||
font-size: 125%;
|
||||
text-align: center;
|
||||
background-color:#FFFFFF;
|
||||
}
|
||||
|
||||
.advanced {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.advanced > div > span {
|
||||
float: left;
|
||||
margin-right: 5px;
|
||||
text-align: right;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.advanced > div > input, .advanced > div > select {
|
||||
margin: 2px 0 3px 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#vpmsettings {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pageheading{
|
||||
padding : 10px 10px 4px 10px;
|
||||
font-size: 135%;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="#EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
<span id='iframeTitleBar_title'> Hardware Configuration</span>
|
||||
<span class='refresh_icon' onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
|
||||
<TABLE id='tabbedMenu_container' style='display:none;' width='100%' align=center><TR><TD align=center>
|
||||
<div id="tabbedMenu"></div>
|
||||
</TD></TR></table>
|
||||
|
||||
<div id="div_maintable">
|
||||
|
||||
<div id='digital_settings' style='display:none;'>
|
||||
<div class="pageheading">Digital Hardware</div>
|
||||
<div style="overflow:auto;left:40; max-height: 300px;">
|
||||
<table class="taglist" id="digitalcardstable" cellpadding=5 cellspacing=1 border=0 align=center></table>
|
||||
</div><BR>
|
||||
</div>
|
||||
|
||||
<div class="pageheading">Analog Hardware</div>
|
||||
<div style="overflow:auto;left:40">
|
||||
<table id="FXSFXO_ports_td" cellpadding=5 cellspacing=1 align=center border=0 class='taglist' width=480></table>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<table cellpadding=5 cellspacing=1 align=center border=0>
|
||||
<tr> <td align="right"><B>Tone Region <img src="images/tooltip_info.gif" tip="en,confighw,0" class='tooltipinfo'> : </B>
|
||||
<select id="loadZone">
|
||||
<option value="us">United States/North America</option>
|
||||
<option value="au">Australia</option>
|
||||
<option value="fr">France</option>
|
||||
<option value="nl">Netherlands</option>
|
||||
<option value="uk">United Kingdom</option>
|
||||
<option value="fi">Finland</option>
|
||||
<option value="es">Spain</option>
|
||||
<option value="jp">Japan</option>
|
||||
<option value="no">Norway</option>
|
||||
<option value="at">Austria</option>
|
||||
<option value="nz">New Zealand</option>
|
||||
<option value="it">Italy</option>
|
||||
<option value="us-old">United States Circa 1950 / North America</option>
|
||||
<option value="gr">Greece</option>
|
||||
<option value="tw">Taiwan</option>
|
||||
<option value="cl">Chile</option>
|
||||
<option value="se">Sweden</option>
|
||||
<option value="be">Belgium</option>
|
||||
<option value="sg">Singapore</option>
|
||||
<option value="il">Israel</option>
|
||||
<option value="br">Brazil</option>
|
||||
<option value="hu">Hungary</option>
|
||||
<option value="lt">Lithuania</option>
|
||||
<option value="pl">Poland</option>
|
||||
<option value="za">South Africa</option>
|
||||
<option value="pt">Portugal</option>
|
||||
<option value="ee">Estonia</option>
|
||||
<option value="mx">Mexico</option>
|
||||
<option value="in">India</option>
|
||||
<option value="de">Germany</option>
|
||||
<option value="ch">Switzerland</option>
|
||||
<option value="dk">Denmark</option>
|
||||
<option value="cz">Czech Republic</option>
|
||||
<option value="cn">China</option>
|
||||
<option value="ar">Argentina</option>
|
||||
<option value="my">Malaysia</option>
|
||||
<option value="th">Thailand</option>
|
||||
<option value="bg">Bulgaria</option>
|
||||
<option value="ve">Venezuela</option>
|
||||
<option value="ph">Philippines</option>
|
||||
<option value="ru">Russian Federation</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<span>software echo canceller <img src="images/tooltip_info.gif" tip="en,opermode_settings,11" class='tooltipinfo'>:</span>
|
||||
<input type='checkbox' id='enable_disable_checkbox_echocan'>
|
||||
<select id="echocan" dfalt='0'>
|
||||
<option value="0">mg2</option>
|
||||
<option value="1">kb1</option>
|
||||
<option value="2">sec</option>
|
||||
<option value="3">sec2</option>
|
||||
<option value="4">hpec</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='center'>
|
||||
<input type='checkbox' id='RESET_ANY_DIGITAL_TRUNKS'> Reset all Previous Digital Trunks Information
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="advanced">
|
||||
<div class="pageheading">Advanced Settings</div>
|
||||
<div>
|
||||
<span>Module Name:</span>
|
||||
<input id="zap_moduleName" dfalt='wctdm24xxp' size=10>
|
||||
</div>
|
||||
<div>
|
||||
<span>Opermode <img src="images/tooltip_info.gif" tip="en,opermode_settings,0" class='tooltipinfo'>:</span>
|
||||
<input type='checkbox' id='enable_disable_checkbox_opermode'>
|
||||
<select id="opermode" dfalt='USA'>
|
||||
<option value="USA">USA</option>
|
||||
<option value="ARGENTINA">ARGENTINA</option>
|
||||
<option value="AUSTRALIA">AUSTRALIA</option>
|
||||
<option value="AUSTRIA">AUSTRIA</option>
|
||||
<option value="BAHRAIN">BAHRAIN</option>
|
||||
<option value="BELGIUM">BELGIUM</option>
|
||||
<option value="BRAZIL">BRAZIL</option>
|
||||
<option value="BULGARIA">BULGARIA</option>
|
||||
<option value="CANADA">CANADA</option>
|
||||
<option value="CHILE">CHILE</option>
|
||||
<option value="CHINA">CHINA</option>
|
||||
<option value="COLUMBIA">COLUMBIA</option>
|
||||
<option value="CROATIA">CROATIA</option>
|
||||
<option value="CYRPUS">CYRPUS</option>
|
||||
<option value="CZECH">CZECH</option>
|
||||
<option value="DENMARK">DENMARK</option>
|
||||
<option value="ECUADOR">ECUADOR</option>
|
||||
<option value="EGYPT">EGYPT</option>
|
||||
<option value="ELSALVADOR">ELSALVADOR</option>
|
||||
<option value="FCC">FCC</option>
|
||||
<option value="FINLAND">FINLAND</option>
|
||||
<option value="FRANCE">FRANCE</option>
|
||||
<option value="GERMANY">GERMANY</option>
|
||||
<option value="GREECE">GREECE</option>
|
||||
<option value="GUAM">GUAM</option>
|
||||
<option value="HONGKONG">HONGKONG</option>
|
||||
<option value="HUNGARY">HUNGARY</option>
|
||||
<option value="ICELAND">ICELAND</option>
|
||||
<option value="INDIA">INDIA</option>
|
||||
<option value="INDONESIA">INDONESIA</option>
|
||||
<option value="IRELAND">IRELAND</option>
|
||||
<option value="ISRAEL">ISRAEL</option>
|
||||
<option value="ITALY">ITALY</option>
|
||||
<option value="JAPAN">JAPAN</option>
|
||||
<option value="JORDAN">JORDAN</option>
|
||||
<option value="KAZAKHSTAN">KAZAKHSTAN</option>
|
||||
<option value="KUWAIT">KUWAIT</option>
|
||||
<option value="LATVIA">LATVIA</option>
|
||||
<option value="LEBANON">LEBANON</option>
|
||||
<option value="LUXEMBOURG">LUXEMBOURG</option>
|
||||
<option value="MACAO">MACAO</option>
|
||||
<option value="MALAYSIA">MALAYSIA</option>
|
||||
<option value="MALTA">MALTA</option>
|
||||
<option value="MEXICO">MEXICO</option>
|
||||
<option value="MOROCCO">MOROCCO</option>
|
||||
<option value="NETHERLANDS">NETHERLANDS</option>
|
||||
<option value="NEWZEALAND">NEWZEALAND</option>
|
||||
<option value="NIGERIA">NIGERIA</option>
|
||||
<option value="NORWAY">NORWAY</option>
|
||||
<option value="OMAN">OMAN</option>
|
||||
<option value="PAKISTAN">PAKISTAN</option>
|
||||
<option value="PERU">PERU</option>
|
||||
<option value="PHILIPPINES">PHILIPPINES</option>
|
||||
<option value="POLAND">POLAND</option>
|
||||
<option value="PORTUGAL">PORTUGAL</option>
|
||||
<option value="ROMANIA">ROMANIA</option>
|
||||
<option value="RUSSIA">RUSSIA</option>
|
||||
<option value="SAUDIARABIA">SAUDIARABIA</option>
|
||||
<option value="SINGAPORE">SINGAPORE</option>
|
||||
<option value="SLOVAKIA">SLOVAKIA</option>
|
||||
<option value="SLOVENIA">SLOVENIA</option>
|
||||
<option value="SOUTHAFRICA">SOUTHAFRICA</option>
|
||||
<option value="SOUTHKOREA">SOUTHKOREA</option>
|
||||
<option value="SPAIN">SPAIN</option>
|
||||
<option value="SWEDEN">SWEDEN</option>
|
||||
<option value="SWITZERLAND">SWITZERLAND</option>
|
||||
<option value="SYRIA">SYRIA</option>
|
||||
<option value="TAIWAN">TAIWAN</option>
|
||||
<option value="TBR21">TBR21</option>
|
||||
<option value="THAILAND">THAILAND</option>
|
||||
<option value="UAE">UAE</option>
|
||||
<option value="UK">UK</option>
|
||||
<option value="YEMEN">YEMEN</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<span>a-law override <img src="images/tooltip_info.gif" tip="en,opermode_settings,1" class='tooltipinfo'>:</span>
|
||||
<input type='checkbox' id='enable_disable_checkbox_alawoverride'>
|
||||
<select id="alawoverride" dfalt='0'>
|
||||
<option value="0">ulaw</option>
|
||||
<option value="1">alaw</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<span>fxs honor mode <img src="images/tooltip_info.gif" tip="en,opermode_settings,2" class='tooltipinfo'>:</span>
|
||||
<input type='checkbox' id='enable_disable_checkbox_fxshonormode'>
|
||||
<select id="fxshonormode" dfalt='0'>
|
||||
<option value="0">apply opermode to fxo modules only </option>
|
||||
<option value="1">apply opermode to fxs and fxo modules</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<span>boostringer <img src="images/tooltip_info.gif" tip="en,opermode_settings,3" class='tooltipinfo'>:</span>
|
||||
<input type='checkbox' id='enable_disable_checkbox_boostringer'>
|
||||
<select id="boostringer" dfalt='0'>
|
||||
<option value="0">normal</option>
|
||||
<option value="1">peak(89V)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<span>fastringer <img src="images/tooltip_info.gif" tip="en,opermode_settings,5" class='tooltipinfo'>:</span>
|
||||
<input type='checkbox' id='enable_disable_checkbox_fastringer'>
|
||||
<select id="fastringer" dfalt='0'>
|
||||
<option value="0">normal</option>
|
||||
<option value="1">fast ringer (25hz) </option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<span>lowpower <img src="images/tooltip_info.gif" tip="en,opermode_settings,4" class='tooltipinfo'>:</span>
|
||||
<input type='checkbox' id='enable_disable_checkbox_lowpower'>
|
||||
<select id="lowpower" dfalt='0'>
|
||||
<option value="0">normal</option>
|
||||
<option value="1">fast ringer to 50V peak</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<span>ring detect <img src="images/tooltip_info.gif" tip="en,opermode_settings,6" class='tooltipinfo'>:</span>
|
||||
<input type='checkbox' id='enable_disable_checkbox_fwringdetect'>
|
||||
<select id="fwringdetect" dfalt='0'>
|
||||
<option value='0'>standard</option>
|
||||
<option value='1'>full wave</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<span>MWI mode <img src="images/tooltip_info.gif" tip="en,opermode_settings,7" class='tooltipinfo'>:</span>
|
||||
<input type='checkbox' id='enable_disable_checkbox_mwimode'>
|
||||
<select id="mwimode" dfalt='none'>
|
||||
<option value='none'>None</option>
|
||||
<option value='FSK'>FSK</option>
|
||||
<option value='NEON'>NEON</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class='neon_settings' style='display:none'>
|
||||
<span>Neon MWI voltage Level:</span><input id="neonmwi_level" size=2>
|
||||
<span>Neon MWI off Limit (ms):</span><input id="neonmwi_offlimit" size=4>
|
||||
</div>
|
||||
</div>
|
||||
<div id="vpmsettings" class="advanced">
|
||||
<div class="pageheading">VPM Settings</div>
|
||||
<div>
|
||||
<span>Echo Cancellation NLP Type <img src="images/tooltip_info.gif" tip="en,opermode_settings,8" class='tooltipinfo'> :</span>
|
||||
<select id="vpmnlptype">
|
||||
<option value="0">None</option>
|
||||
<option value="1">Mute</option>
|
||||
<option value="2">Random Noise</option>
|
||||
<option value="3">Hoth Noise</option>
|
||||
<option value="4">Suppression NLP (default)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<span>Echo Cancellation NLP Threshold <img src="images/tooltip_info.gif" tip="en,opermode_settings,9" class='tooltipinfo'> :</span>
|
||||
<select id="vpmnlpthresh"></select>
|
||||
</div>
|
||||
<div>
|
||||
<span>Echo Cancellation NLP Max Suppression <img src="images/tooltip_info.gif" tip="en,opermode_settings,10" class='tooltipinfo'> :</span>
|
||||
<select id="vpmnlpmaxsupp"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align:center; overflow:auto;left:40">
|
||||
<span class='guiButtonCancel' id="cancel_b" onclick='window.location.reload();'>Cancel Changes</span>
|
||||
<span class='guiButtonEdit' id="save_b" onclick='applyDigitalSettings();'>Update Settings</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="errmsg" style="display:none"></div>
|
||||
|
||||
<div id="edit_span" STYLE="width:500; display:none;" class='dialog'>
|
||||
<TABLE width="100%" cellpadding=0 cellspacing=0>
|
||||
<TR class="dialog_title_tr">
|
||||
<TD class="dialog_title" onmousedown="ASTGUI.startDrag(event);">
|
||||
SPAN : <span id="editspan_SPAN"></span>
|
||||
</TD>
|
||||
<TD class="dialog_title_X" onclick="ASTGUI.hideDrag(event);"> X </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<TABLE align=center cellpadding=2 cellspacing=2 border=0>
|
||||
<TR> <TD align="right">ALARMS:</TD>
|
||||
<TD><span id="editspan_ALARMS"></span></TD>
|
||||
</TR>
|
||||
<TR> <TD align="right">Framing/Coding:</TD>
|
||||
<TD> <select id="editspan_fac"></select> </TD>
|
||||
</TR>
|
||||
<TR> <TD align="right">Channels:</TD>
|
||||
<TD><span id="editspan_channels"></span></TD>
|
||||
</TR>
|
||||
<TR> <TD align="right">Signalling</TD>
|
||||
<TD> <select id="editspan_signalling" onChange="disablEnable_sc();">
|
||||
<option value="pri_net">PRI - Net</option>
|
||||
<option value="pri_cpe">PRI - CPE</option>
|
||||
<option value="em">E & M</option>
|
||||
<option value="em_w">E & M -- Wink</option>
|
||||
<option value="featd">E & M -- featd(DTMF)</option>
|
||||
<option value="fxo_ks">FXOKS</option>
|
||||
<option value="fxo_ls">FXOLS</option>
|
||||
<!--<option value="fxs_ks">FXSKS</option>
|
||||
<option value="fxs_ls">FXSLS</option>-->
|
||||
</select>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR id="switchtype_container">
|
||||
<TD align="right"> Switch Type </TD>
|
||||
<TD> <select id="editspan_switchtype">
|
||||
<option value="national">National ISDN 2 (default)</option>
|
||||
<option value="dms100">Nortel DMS100</option>
|
||||
<option value="4ess">AT&T 4ESS</option>
|
||||
<option value="5ess">Lucent 5ESS</option>
|
||||
<option value="euroisdn">EuroISDN</option>
|
||||
<option value="ni1">Old National ISDN 1</option>
|
||||
<option value="qsig">Q.SIG</option>
|
||||
</select>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR> <TD align="right">Sync/Clock Source</TD>
|
||||
<TD> <select id="editspan_syncsrc">
|
||||
</select>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR> <TD align="right">Line Build Out</TD>
|
||||
<TD> <select id="editspan_lbo">
|
||||
<option value="0">0 db (CSU)/0-133 feet (DSX-1)</option>
|
||||
<option value="1">133-266 feet (DSX-1)</option>
|
||||
<option value="2">266-399 feet (DSX-1)</option>
|
||||
<option value="3">399-533 feet (DSX-1)</option>
|
||||
<option value="4">533-655 feet (DSX-1)</option>
|
||||
<option value="5">-7.5db (CSU)</option>
|
||||
<option value="6">-15db (CSU)</option>
|
||||
<option value="7">-22.5db (CSU)</option>
|
||||
</select>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD align="right" valign="top">Pridialplan:</TD>
|
||||
<TD>
|
||||
<select id="editspan_pridialplan">
|
||||
<option value="national">National</option>
|
||||
<option value="dynamic">Dynamic</option>
|
||||
<option value="unknown">Unknown</option>
|
||||
<option value="local">Local</option>
|
||||
<option value="private">Private</option>
|
||||
<option value="international">International</option>
|
||||
</select>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD align="right" valign="top">Prilocaldialplan:</TD>
|
||||
<TD>
|
||||
<select id="editspan_prilocaldialplan">
|
||||
<option value="national">National</option>
|
||||
<option value="dynamic">Dynamic</option>
|
||||
<option value="unknown">Unknown</option>
|
||||
<option value="local">Local</option>
|
||||
<option value="private">Private</option>
|
||||
<option value="international">International</option>
|
||||
</select>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR> <TD align="right" valign=top>Channels:</TD>
|
||||
<TD> <table border=0 cellpadding=2 cellspacing=1>
|
||||
<tr> <td> Use : <select id="edit_DefinedChans"></select> </td> </tr>
|
||||
<tr> <td> From : <span id="edit_labelZapchan"></span> </td> </tr>
|
||||
<tr> <td> Reserved : <span id="edit_labelReserved"></span> </td> </tr>
|
||||
</table>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR> <TD colspan=2 align=center height=50 valign=middle>
|
||||
<span class='guiButtonCancel' id="cancel_a" onclick='canelSpanInfo();'>Cancel</span>
|
||||
<span class='guiButtonEdit' id="save_a" onclick='updateSpanInfo();'>Update</span>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="edit_analog_signalling" STYLE="width:500; height:340;display:none;" class='dialog'>
|
||||
<TABLE width="100%" cellpadding=0 cellspacing=0>
|
||||
<TR class="dialog_title_tr">
|
||||
<TD class="dialog_title" onmousedown="ASTGUI.startDrag(event);">Analog Ports - Signalling Preferences</TD>
|
||||
<TD class="dialog_title_X" onclick="ASTGUI.hideDrag(event);"> X </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<TABLE align=center cellpadding=2 cellspacing=2 border=0>
|
||||
<TR> <TD align="center">
|
||||
<div style='text-align:center;overflow :auto; height:250px; width: 400px;' id='edit_analog_signalling_options_container'>
|
||||
</div>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR> <TD align=center height=50 valign=middle>
|
||||
<span class='guiButtonCancel' onclick='ASTGUI.hideDrag(event);'>Cancel</span>
|
||||
<span class='guiButtonEdit' onclick='digital_miscFunctions.save_analog_signalling_prefs();'>Update</span>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</div>
|
||||
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/hardware_dahdi.js"></script>
|
||||
<script src="js/jquery.tooltip.js"></script>
|
||||
<script src="js/jquery.autocomplete.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
179
old-asterisk/asterisk/static-http/config/home.html
Normal file
@@ -0,0 +1,179 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Login Page
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Mark Spencer <markster@digium.com>
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Login</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body topmargin=0 bgcolor="EFEFEF">
|
||||
|
||||
<div class="iframeTitleBar">Welcome to the Asterisk™ Configuration Panel</div>
|
||||
|
||||
<h2>Asterisk™ Configuration Engine</h2>
|
||||
|
||||
<table align="center" id='loginForm'>
|
||||
<tr> <td colspan="2"><BR></td>
|
||||
<tr> <td align=right>Username:</td>
|
||||
<td><input id="username" size=12 autocomplete="off" disabled></td>
|
||||
</tr>
|
||||
<tr> <td align=right>Password:</td>
|
||||
<td><input type="password" id="secret" size=12 onKeyUp="home_miscFunctions.submitOnEnter(event)" disabled></td>
|
||||
</tr>
|
||||
<tr> <td align='center' colspan='2'>
|
||||
<span class='guiButton' onclick="doLogin();" id='login_button'>Login</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table align="center" id='changePasswordForm' style='display:none;'>
|
||||
<tr> <td colspan="2" align='center' class='lite'><b>Change Password</b></td>
|
||||
<tr> <td align=right>New Password:</td>
|
||||
<td><input id="new_password" size=12 type='password' field_name='Password' validation='alphanumeric'></td>
|
||||
</tr>
|
||||
<tr> <td align=right>Retype New Password:</td>
|
||||
<td><input id="new_password_retype" size=12 type='password' onKeyUp="home_miscFunctions.updateOnEnter(event)"></td>
|
||||
</tr>
|
||||
<tr> <td align='center' colspan='2'>
|
||||
<span class='guiButton' onclick="updatePassword();">Update Password</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div width='95%' style='text-align:center; margin-top:20px;'>
|
||||
<span id="statusbar"> </span>
|
||||
</div>
|
||||
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/jquery.js"></script>
|
||||
<script>
|
||||
|
||||
var setLoggedIn = function(a){
|
||||
DOM_statusbar.innerHTML = '<img src=images/tick.gif border=0> Connected';
|
||||
DOM_login_button.innerHTML = 'Logout';
|
||||
parent.ASTGUI.dialog.hide();
|
||||
DOM_username.disabled = true;
|
||||
DOM_secret.disabled = true ;
|
||||
try{ if (a.welcome_redirect == true){ window.location.href = 'welcome.html'; } }catch(err){ }
|
||||
};
|
||||
|
||||
var localajaxinit = function(){
|
||||
DOM_username = _$('username');
|
||||
DOM_secret = _$('secret');
|
||||
DOM_statusbar = _$('statusbar');
|
||||
DOM_login_button = _$('login_button');
|
||||
|
||||
if( parent.sessionData.isLoggedIn){
|
||||
if( ASTGUI.parseGETparam(window.location.href, 'status') == '1' ){
|
||||
setLoggedIn({ welcome_redirect : true });
|
||||
}else{
|
||||
setLoggedIn({ welcome_redirect : false });
|
||||
}
|
||||
}else{
|
||||
DOM_username.disabled = false;
|
||||
DOM_secret.disabled = false;
|
||||
DOM_username.focus();
|
||||
}
|
||||
}
|
||||
|
||||
function doLogin(){
|
||||
if( parent.sessionData.isLoggedIn == true ){
|
||||
parent.miscFunctions.logoutFunction.confirmlogout();
|
||||
return ;
|
||||
}
|
||||
var f = makeSyncRequest({ action :'login', username: DOM_username.value, secret: DOM_secret.value });
|
||||
f = f.toLowerCase();
|
||||
if(f.match('authentication accepted')){
|
||||
top.log.debug("Login Success result: " + f);
|
||||
setLoggedIn( { welcome_redirect: false } );
|
||||
DOM_secret.blur();
|
||||
parent.ASTGUI.dialog.waitWhile(' <font color=#005119><b>Login Success</b></font>');
|
||||
ASTGUI.feedback({msg:'Login Success', showfor: 4 , color: '#5D7CBA', bgcolor: '#FFFFFF'}) ;
|
||||
top.cookies.set('username', DOM_username.value );
|
||||
|
||||
if( DOM_secret.value == 'password' || DOM_secret.value == DOM_username.value || DOM_secret.value == 'ast-owrt'){
|
||||
ASTGUI.feedback({msg:'Your are using the default password.<BR> Please choose a new password', showfor: 7 , color: '#672b13'}) ;
|
||||
parent.onLogInFunctions.makePings.start();
|
||||
parent.ASTGUI.dialog.hide();
|
||||
_$('loginForm').style.display = 'none';
|
||||
_$('changePasswordForm').style.display = '';
|
||||
_$('new_password').focus();
|
||||
|
||||
}else{
|
||||
parent.onLogInFunctions.checkifLoggedIn();
|
||||
}
|
||||
return;
|
||||
}else if(f.match('authentication failed') ) {
|
||||
top.log.debug("Login failure result: " + f);
|
||||
ASTGUI.feedback({msg:'Invalid Username or Password', showfor: 4, color:'#c42421'}) ;
|
||||
DOM_secret.focus();
|
||||
DOM_secret.select();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var home_miscFunctions = {
|
||||
submitOnEnter: function (e){
|
||||
if(e.keyCode == 13){
|
||||
doLogin();
|
||||
return false;
|
||||
}
|
||||
},
|
||||
updateOnEnter: function (e){
|
||||
if(e.keyCode == 13){
|
||||
updatePassword();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var updatePassword = function(){
|
||||
var CURRENT_Username = top.cookies.get('username');
|
||||
var u = new listOfSynActions('manager.conf') ;
|
||||
|
||||
var newp = ASTGUI.getFieldValue('new_password');
|
||||
var newp_rt = ASTGUI.getFieldValue('new_password_retype');
|
||||
if ( !ASTGUI.validateFields( [ 'new_password' ] ) ){
|
||||
return ;
|
||||
}
|
||||
if( newp.length < 4 ){
|
||||
ASTGUI.highlightField( 'new_password' , 'Password must be atleast 4 digits');
|
||||
return;
|
||||
}
|
||||
if( newp != newp_rt ){
|
||||
ASTGUI.highlightField( 'new_password' , 'Passwords do not match');
|
||||
return;
|
||||
}
|
||||
u.new_action('update', CURRENT_Username, 'secret', newp );
|
||||
u.callActions();
|
||||
|
||||
ASTGUI.feedback( { msg:"Password Updated Successfully", showfor:3 });
|
||||
var t = ASTGUI.cliCommand('manager reload');
|
||||
alert("Password Updated Successfully!! \n\n You will now be redirected to the login page \n You must relogin using your new password") ;
|
||||
var f = makeSyncRequest({ action :'logoff'});
|
||||
parent.window.location.reload();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
337
old-asterisk/asterisk/static-http/config/iax.html
Normal file
@@ -0,0 +1,337 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Global IAX settings
|
||||
*
|
||||
* Copyright (C) 2007-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>IAX Settings</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
#callNumberLimits div span.callnumber_delete {
|
||||
float: right;
|
||||
width: 20px;
|
||||
background: transparent url("./images/delete_circle.png") no-repeat;
|
||||
}
|
||||
#callNumberLimits{
|
||||
height:120px ;
|
||||
background-color:#FFFFFF;
|
||||
padding: 5px;
|
||||
border-width: 1px;
|
||||
border-color: #7E5538;
|
||||
border-style: solid;
|
||||
cursor: default;
|
||||
font: 83%/1.4 arial, helvetica, sans-serif;
|
||||
overflow :auto;
|
||||
}
|
||||
|
||||
#callNumberLimits div {
|
||||
clear :both;
|
||||
padding : 3px 5px 0px 5px;
|
||||
min-height: 20px;
|
||||
}
|
||||
#callNumberLimits div:hover {
|
||||
background-color:#DEDEDE;
|
||||
}
|
||||
|
||||
#callNumberLimits div span.step_desc {
|
||||
float: left;
|
||||
/* max-width: 300px; */
|
||||
background: transparent;
|
||||
}
|
||||
#callNumberLimits div span.step_desc:hover{
|
||||
background-color:#DEDEDE;
|
||||
}
|
||||
|
||||
#callNumberLimits div span.step_up {
|
||||
float: right;
|
||||
width: 20px;
|
||||
background: transparent url("./images/asterisk-arrow-up.png") no-repeat;
|
||||
}
|
||||
|
||||
#callNumberLimits div span.step_down {
|
||||
float: right;
|
||||
width: 20px;
|
||||
background: transparent url("./images/asterisk-arrow-down.png") no-repeat;
|
||||
}
|
||||
|
||||
#callNumberLimits div span.step_delete {
|
||||
float: right;
|
||||
width: 20px;
|
||||
background: transparent url("./images/delete_circle.png") no-repeat;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
IAX (Inter Asterisk Exchange Protocol) Configuration
|
||||
<span style="cursor: pointer; cursor: hand;" onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
|
||||
<center>
|
||||
<div id="tabbedMenu"></div>
|
||||
|
||||
<div style='width: 800px;'>
|
||||
|
||||
<div id='iaxoptions_general' style='display: none;'>
|
||||
<table class="field_text" align="center" width="100%" cellpadding=3 cellspacing=0 border=0>
|
||||
<tr> <td align=right tip="en,iax_general,0" width="50%">Bind Port:</td>
|
||||
<td> <input type='text' size=4 id='bindport' dfalt='4569' pattern='^\d*$' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,1">Bind Address:</td>
|
||||
<td> <input type='text' size=14 dfalt='' id='bindaddr' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,2">IAX1 Compatibility:</td>
|
||||
<td><input type='checkbox' id='iaxcompat' dfalt='n'></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,3">No Checksums:</td>
|
||||
<td><input type='checkbox' id='nochecksums' dfalt='n'></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,4">Delay Reject:</td>
|
||||
<td><input type='checkbox' id='delayreject' dfalt='n'></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,5">ADSI:</td>
|
||||
<td><input type='checkbox' dfalt='n' id='adsi'></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,8">Music On Hold Interpret:</td>
|
||||
<td> <input type='text' size=14 id='mohinterpret' dfalt='default' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,9">Music On Hold Suggest:</td>
|
||||
<td> <input type='text' size=14 id='mohsuggest' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,10">Language:</td>
|
||||
<td> <input type='text' size=3 dfalt='en' id='language' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,11">Bandwidth:</td>
|
||||
<td> <select id="bandwidth" class="input8">
|
||||
<option value="low">low</option>
|
||||
<option value="medium">medium</option>
|
||||
<option value="high">high</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- <div id='iaxoptions_cdr' style='display: none;'>
|
||||
<table class="field_text" align="center" width="100%" cellpadding=3 cellspacing=0 border=0>
|
||||
<tr> <td align=right tip="en,iax_general,6" width="50%">AMA Flags:</td>
|
||||
<td> <input type='text' size=14 id='amaflags' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,7">Accountcode:</td>
|
||||
<td> <input type='text' size=14 id='accountcode' class="input8"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>-->
|
||||
|
||||
|
||||
|
||||
|
||||
<div id='iaxoptions_jitterBuffer' style='display: none;'>
|
||||
<table class="field_text" align="center" width="100%" cellpadding=3 cellspacing=0 border=0>
|
||||
<tr> <td align=right tip="en,iax_general,12" width="50%">Enable Jitter Buffer:</td>
|
||||
<td><input type='checkbox' id='jitterbuffer'></td>
|
||||
</tr>
|
||||
|
||||
<tr> <td align=right tip="en,iax_general,13">Force Jitter Buffer:</td>
|
||||
<td><input type='checkbox' id='forcejitterbuffer'></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,14">Drop Count:</td>
|
||||
<td> <input type='text' size=4 id='dropcount' pattern='^\d*$' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,15">Max Jitter Buffer:</td>
|
||||
<td> <input type='text' size=4 id='maxjitterbuffer' dfalt='1000' pattern='^\d*$' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,16">Max Interpolation Frames:</td>
|
||||
<td> <input type='text' size=4 id='maxjitterinterps' dfalt='10' pattern='^\d*$' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,17">Resync Threshold:</td>
|
||||
<td> <input type='text' size=4 id='resyncthreshold' dfalt='1000' pattern='^\d*$' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,18">Max Excess Buffer:</td>
|
||||
<td> <input type='text' size=4 id='maxexcessbuffer' pattern='^\d*$' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,19">Min Excess Buffer:</td>
|
||||
<td> <input type='text' size=4 id='minexcessbuffer' pattern='^\d*$' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,20">Jitter Shrink Rate:</td>
|
||||
<td> <input type='text' size=4 id='jittershrinkrate' pattern='^\d*$' class="input8"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id='iaxoptions_trunkregistration' style='display: none;'>
|
||||
<table class="field_text" align="center" width="100%" cellpadding=3 cellspacing=0 border=0>
|
||||
<tr> <td colspan=2 align=center><B>IAX Registration Options</B></td></tr>
|
||||
<tr> <td align=right tip="en,iax_general,23" width="50%">Min Reg Expire:</td>
|
||||
<td> <input type='text' size=4 id='minregexpire' dfalt='60' pattern='^\d*$' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,24">Max Reg Expire:</td>
|
||||
<td> <input type='text' size=4 id='maxregexpire' dfalt='60' pattern='^\d*$' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,25">IAX ThreadCount:</td>
|
||||
<td> <input type='text' size=4 id='iaxthreadcount' dfalt='10' pattern='^\d*$' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,26">IAX Max ThreadCount:</td>
|
||||
<td> <input type='text' size=4 id='iaxmaxthreadcount' dfalt='100' pattern='^\d*$' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,29">Auto Kill:</td>
|
||||
<td> <input size=3 type='text' id='autokill' class="input8"></td>
|
||||
</tr>
|
||||
|
||||
<tr> <td align=right tip="en,iax_general,30"><NOBR>Authentication Debugging:</NOBR></td>
|
||||
<td><input type='checkbox' id='authdebug'></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,31">Codec Priority:</td>
|
||||
<td> <select id="codecpriority" dfalt='reqonly' class="input8">
|
||||
<option value="caller">caller</option>
|
||||
<option value="disabled">disabled</option>
|
||||
<option value="reqonly">reqonly</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,32">Type of Service:</td>
|
||||
<td> <select size=1 id="tos" class="input8">
|
||||
<option value='ef'>ef</option>
|
||||
<option value='CS0'>CS0</option>
|
||||
<option value='CS1'>CS1</option>
|
||||
<option value='CS2'>CS2</option>
|
||||
<option value='CS3'>CS3</option>
|
||||
<option value='CS4'>CS4</option>
|
||||
<option value='CS5'>CS5</option>
|
||||
<option value='CS6'>CS6</option>
|
||||
<option value='CS7'>CS7</option>
|
||||
<option value='AF11'>AF11</option>
|
||||
<option value='AF12'>AF12</option>
|
||||
<option value='AF13'>AF13</option>
|
||||
<option value='AF21'>AF21</option>
|
||||
<option value='AF22'>AF22</option>
|
||||
<option value='AF23'>AF23</option>
|
||||
<option value='AF31'>AF31</option>
|
||||
<option value='AF32'>AF32</option>
|
||||
<option value='AF33'>AF33</option>
|
||||
<option value='AF41'>AF41</option>
|
||||
<option value='AF42'>AF42</option>
|
||||
<option value='AF43'>AF43</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr> <td colspan=2 align=center><BR><B>IAX Trunking Options</B></td></tr>
|
||||
<tr> <td align=right tip="en,iax_general,21">Trunk Freq:</td>
|
||||
<td> <input type='text' size=4 id='trunkfreq' dfalt='20' pattern='^\d*$' class="input8"></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,22">Trunk Time Stamps:</td>
|
||||
<td><input type='checkbox' id='trunktimestamps' dfalt='n'></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!--<div id='iaxoptions_realtime' style='display: none;'>
|
||||
<table class="field_text" align="center" width="100%" cellpadding=3 cellspacing=0 border=0>
|
||||
<tr> <td align=right tip="en,iax_general,33" width="50%">Cache Friends:</td>
|
||||
<td><input type='checkbox' id='rtcachefriends'></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,34">Send Registry Updates:</td>
|
||||
<td><input type='checkbox' id='rtupdate'></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,35">Auto-Expire Friends:</td>
|
||||
<td><input type='checkbox' id='rtautoclear'></td>
|
||||
</tr>
|
||||
<tr> <td align=right tip="en,iax_general,36">Ignore Expired Peers:</td>
|
||||
<td><input type='checkbox' id='rtignoreexpire'></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>-->
|
||||
|
||||
<div id='iaxoptions_Codecs' style='display: none;'>
|
||||
<table class="field_text" align="center" width="100%" cellpadding=3 cellspacing=0 border=0>
|
||||
<tr>
|
||||
<td align=right>Allowed Codecs:</td>
|
||||
<td> <span id='allow'></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id='iaxoptions_security' style='display: none;'>
|
||||
<table class="field_text" align="center" width="100%" cellpadding=3 cellspacing=0 border=0>
|
||||
<tr>
|
||||
<td align=right width="50%">Call Token Optional: <img src='images/tooltip_info.gif' alt='' class='tooltipinfo' tip='en,iax_general,40'></td>
|
||||
<td> <input type='text' size=20 id='calltokenoptional' dfalt='' class="input8" validation='iporrange'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right tip="en,iax_general,41" width="50%">Max Call Numbers:</td>
|
||||
<td> <input type='text' size=4 id='maxcallnumbers' dfalt='' validation='numeric' class="input8"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right tooltip="en,iax_general,42" width="50%">Max Nonvalidated Call Numbers:</td>
|
||||
<td> <input type='text' size=4 id='maxcallnumbers_nonvalidated' dfalt='' validation='numeric' class="input8"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right valign=top>Call Number Limits: <img src="images/tooltip_info.gif" tip="en,iax_general,43" class='tooltipinfo'></td>
|
||||
<td><div id='callNumberLimits'></div></td>
|
||||
</tr>
|
||||
<tr class='form_newCallNumberLimit' >
|
||||
<td align=right width="50%"></td>
|
||||
<td>
|
||||
<span class='guiButton' onclick=" showCallNumberLimitsForm(); "><B>Add Call Number Limit</B></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class='form_newCallNumberLimit'>
|
||||
<td align=right valign=top></td>
|
||||
<td align=left width="50%">IP or IP Range: <img src='images/tooltip_info.gif' alt='' class='tooltipinfo' tip='en,iax_general,40'>
|
||||
<input type='text' size=20 id='form_newCallNumberLimit_ip' class="input8" validation='iporrange'></td>
|
||||
</tr>
|
||||
<tr class='form_newCallNumberLimit'>
|
||||
<td align=right valign=top></td>
|
||||
<td align=left width="50%">Max Call Numbers:
|
||||
<input type='text' size=4 id='form_newCallNumberLimit_maxcallnumbers' dfalt='512' validation='numeric' class="input8"></td>
|
||||
</tr>
|
||||
<tr class='form_newCallNumberLimit'>
|
||||
<td align=right width="50%"></td>
|
||||
<td>
|
||||
<span class='guiButtonCancel' onclick='hideCallNumberLimitsForm();'>Cancel</span>
|
||||
<span class='guiButton' onclick='pushNewCallNumberLimit();'> ↑ Add</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style='margin-top:15px; width:100%; text-align:center;'>
|
||||
<span class='guiButtonCancel' onclick='window.location.reload();' style='margin-left:10px'>Cancel</span>
|
||||
<span class='guiButtonEdit' onclick='saveChanges();'>Save</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</center>
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/jquery.tooltip.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/iax.js"></script>
|
||||
<script type='text/javascript'>hideCallNumberLimitsForm();</script>
|
||||
</body>
|
||||
</html>
|
||||
BIN
old-asterisk/asterisk/static-http/config/images/1.gif
Normal file
|
After Width: | Height: | Size: 51 B |
BIN
old-asterisk/asterisk/static-http/config/images/aa50.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 73 B |
BIN
old-asterisk/asterisk/static-http/config/images/add.gif
Normal file
|
After Width: | Height: | Size: 883 B |
BIN
old-asterisk/asterisk/static-http/config/images/adv-v.gif
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/agent_busy.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/ar_down.png
Normal file
|
After Width: | Height: | Size: 233 B |
BIN
old-asterisk/asterisk/static-http/config/images/ar_right.png
Normal file
|
After Width: | Height: | Size: 233 B |
BIN
old-asterisk/asterisk/static-http/config/images/arrow_blank.png
Normal file
|
After Width: | Height: | Size: 216 B |
BIN
old-asterisk/asterisk/static-http/config/images/arrow_down.png
Normal file
|
After Width: | Height: | Size: 220 B |
BIN
old-asterisk/asterisk/static-http/config/images/arrow_up.png
Normal file
|
After Width: | Height: | Size: 209 B |
|
After Width: | Height: | Size: 369 B |
|
After Width: | Height: | Size: 367 B |
|
After Width: | Height: | Size: 1.1 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/asterisk_red.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/bandwidth.gif
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/cancel.gif
Normal file
|
After Width: | Height: | Size: 224 B |
|
After Width: | Height: | Size: 143 B |
BIN
old-asterisk/asterisk/static-http/config/images/delete.gif
Normal file
|
After Width: | Height: | Size: 906 B |
|
After Width: | Height: | Size: 402 B |
BIN
old-asterisk/asterisk/static-http/config/images/digiumlogo.gif
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/dots.gif
Normal file
|
After Width: | Height: | Size: 480 B |
BIN
old-asterisk/asterisk/static-http/config/images/down_arr.gif
Normal file
|
After Width: | Height: | Size: 51 B |
BIN
old-asterisk/asterisk/static-http/config/images/edit.gif
Normal file
|
After Width: | Height: | Size: 169 B |
BIN
old-asterisk/asterisk/static-http/config/images/favicon.ico
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/home.png
Normal file
|
After Width: | Height: | Size: 401 B |
BIN
old-asterisk/asterisk/static-http/config/images/iaxtel.jpg
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/loading.gif
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/ngt.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/panel.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/refresh.png
Normal file
|
After Width: | Height: | Size: 178 B |
BIN
old-asterisk/asterisk/static-http/config/images/simplesignal.jpg
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/slice-v.gif
Normal file
|
After Width: | Height: | Size: 111 B |
BIN
old-asterisk/asterisk/static-http/config/images/split-v.gif
Normal file
|
After Width: | Height: | Size: 650 B |
BIN
old-asterisk/asterisk/static-http/config/images/status_blue.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/status_gray.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/status_green.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/status_red.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
old-asterisk/asterisk/static-http/config/images/tick.gif
Normal file
|
After Width: | Height: | Size: 155 B |
|
After Width: | Height: | Size: 605 B |
BIN
old-asterisk/asterisk/static-http/config/images/tooltip_info.gif
Normal file
|
After Width: | Height: | Size: 260 B |
BIN
old-asterisk/asterisk/static-http/config/images/voicepulse.gif
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
153
old-asterisk/asterisk/static-http/config/incoming.html
Normal file
@@ -0,0 +1,153 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Incoming Calling Rules
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Incoming Calling Rules</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
|
||||
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
|
||||
.table_incomingRulesList {
|
||||
border: 1px solid #666666;
|
||||
margin-top: 5px;
|
||||
margin-bottom:10px;
|
||||
width: 96%;
|
||||
text-align: center;
|
||||
padding : 1px;
|
||||
}
|
||||
|
||||
.table_incomingRulesList tr.frow { background: #6b79a5; color: #CED7EF; }
|
||||
.table_incomingRulesList tr.frow td { font-weight:bold; }
|
||||
.table_incomingRulesList tr td { padding : 3px; }
|
||||
.table_incomingRulesList tr.even { background: #DFDFDF; }
|
||||
.table_incomingRulesList tr.odd { background: #FFFFFF; }
|
||||
.table_incomingRulesList tr.even:hover, .table_incomingRulesList tr.odd:hover {
|
||||
background: #a8b6e5;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="EFEFEF">
|
||||
<div class="iframeTitleBar">
|
||||
Incoming Calling Rules
|
||||
<span class='refresh_icon' onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
|
||||
</div>
|
||||
|
||||
<div class='top_buttons'>
|
||||
<span class='guiButtonNew' onclick='incomingRules_MiscFunctions.new_IR_form();'>New Incoming Rule</span>
|
||||
<span class='lite_Heading' style='margin-left: 80px'> Incoming Calling Rules </span>
|
||||
</div>
|
||||
|
||||
<center> <DIV id='IR_CONTAINER'></DIV> </center>
|
||||
<div id="div_ir_edit" STYLE="width:610;display:none" class='dialog'>
|
||||
<TABLE width="100%" cellpadding=0 cellspacing=0>
|
||||
<TR class="dialog_title_tr">
|
||||
<TD class="dialog_title" onmousedown="ASTGUI.startDrag(event);">
|
||||
<span id="div_ir_edit_title">New Incoming Rule</span></TD>
|
||||
<TD class="dialog_title_X" onclick="ASTGUI.hideDrag(event);"> X </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<TABLE align=center cellpadding=2 cellspacing=2 border=0 width='100%' bgcolor='#FAF7F1'>
|
||||
|
||||
<TR class='hideOnEdit'>
|
||||
<TD align="right"><nobr>Trunk :</nobr></TD>
|
||||
<TD><select id='edit_itrl_trunk' required='yes'></select></TD>
|
||||
</TR>
|
||||
|
||||
<TR class='hideOnEdit'>
|
||||
<TD align="right"><nobr>Time Interval :</nobr></TD>
|
||||
<TD><select id='edit_itrl_tf'></select></TD>
|
||||
</TR>
|
||||
|
||||
<TR> <TD align="right"><nobr>Pattern <img src="images/tooltip_info.gif" tip="en,callingrules,1" class='tooltipinfo'> : </nobr></TD>
|
||||
<TD><input id='edit_itrl_pattern' size=12 field_name='Pattern' validation='dialpattern' required='yes'></select></TD>
|
||||
</TR>
|
||||
|
||||
<TR> <TD align="right"><nobr>Destination :</nobr></TD>
|
||||
<TD><select id='edit_itrl_dest' required='yes'></select></TD>
|
||||
</TR>
|
||||
|
||||
<TR class='localext_byDid' style='display:none'>
|
||||
<TD align="right"><nobr>Local Extension by DID Pattern :</nobr></TD>
|
||||
<TD> ${EXTEN:<input id='edit_itrl_LocalDest_Pattern' size=2>}</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD align="right" colspan=2 height=10> </TD>
|
||||
</TR>
|
||||
|
||||
<TR> <TD align=center valign=middle colspan=2>
|
||||
<span class='guiButtonCancel' onclick='ASTGUI.hideDrag(event);'>Cancel</span>
|
||||
<span class='guiButtonEdit' onclick='incomingRules_MiscFunctions.update_IR();' >Update</span>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</div>
|
||||
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/incoming.js"></script>
|
||||
<script src="js/jquery.tooltip.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
top.document.title = "Incoming Calling Rules";
|
||||
|
||||
incomingRules_MiscFunctions.listAllRulesInTable();
|
||||
|
||||
/* Populate Time Intervals <select> */
|
||||
var itrl_tf = $('#edit_itrl_tf');
|
||||
var list = parent.pbx.time_intervals.list();
|
||||
for (var ti in list) {
|
||||
if (!list.hasOwnProperty(ti)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
itrl_tf.append($('<option>').html(ti).val(ti));
|
||||
};
|
||||
itrl_tf.append($('<option>').html('None (no Time Intervals matched)').val(''));
|
||||
delete itrl_tf;
|
||||
delete list;
|
||||
|
||||
/* Populate Destinations <select> */
|
||||
var dest = $('#edit_itrl_dest');
|
||||
var list = parent.miscFunctions.getAllDestinations();
|
||||
for (var d=0; d<list.length; d++) {
|
||||
dest.append($('<option>').html(list[d].optionText).val(list[d].optionValue));
|
||||
}
|
||||
dest.append($('<option>').html('Local Extension by DID').val('ByDID'));
|
||||
|
||||
/* now lets add some events!! */
|
||||
dest.change(function() {
|
||||
if ($(this).val() === 'ByDID') {
|
||||
$('.localext_byDid').show();
|
||||
} else {
|
||||
$('.localext_byDid').hide();
|
||||
}
|
||||
});
|
||||
$('#edit_itrl_trunk').click(function() {
|
||||
incomingRules_MiscFunctions.enableDisablePattern();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
339
old-asterisk/asterisk/static-http/config/index.html
Normal file
@@ -0,0 +1,339 @@
|
||||
<!--
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Top level index page
|
||||
*
|
||||
* Copyright (C) 2009-2011, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
* Erin Spiceland <espiceland@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Asterisk Configuration GUI</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
|
||||
<link rel="shortcut icon" href="images/favicon.ico" />
|
||||
|
||||
<link href="stylesheets/cfgbasic.css" media="all" rel="Stylesheet" type="text/css" />
|
||||
<style type="text/css"></style>
|
||||
</head>
|
||||
<body topmargin=1 leftmargin=2>
|
||||
<div class="header_row">
|
||||
<div class="main_logo" id="main_logo">
|
||||
<img src="images/digiumlogo.gif" align="left">
|
||||
</div>
|
||||
<div class="feedback_parent">
|
||||
<span id="feedback" class="feedback"></span>
|
||||
</div>
|
||||
<div class='parentTopButtons' id='ptopbuttons'>
|
||||
<span class='button_t1' title='Apply Changes' onClick="miscFunctions.applyChanges()" id='applyChanges_Button' style='display:none;'>Apply Changes</span>
|
||||
<span class='button_t1' title='Logout' onClick="miscFunctions.logoutFunction.confirmlogout()">Logout</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordionAndActive_div">
|
||||
<div id="accordion_div" style='display:none; width: 170px;'>
|
||||
<div page='home.html?status=1'>
|
||||
<div class="ui-accordion-link">Home</div>
|
||||
<div class="ui-accordion-desc">Asterisk Configuration Panel - Please click on a panel to manage related features</div>
|
||||
</div>
|
||||
<div page='digital.html'>
|
||||
<div class="ui-accordion-link">Configure Hardware</div>
|
||||
<div class="ui-accordion-desc">Configure your T1/E1/Analog Cards</div>
|
||||
</div>
|
||||
<div page='misdn.html' class='notinAA50' style='display:none'>
|
||||
<div class="ui-accordion-link">mISDN Config</div>
|
||||
<div class="ui-accordion-desc">mISDN configuration from the asterisk GUI</div>
|
||||
</div>
|
||||
<div page='trunks_analog.html'>
|
||||
<div class="ui-accordion-link">Trunks</div>
|
||||
<div class="ui-accordion-desc">Trunks are outbound lines used to allow the system to make calls to the real world. Trunks can be VoIP lines or traditional telephony lines.</div>
|
||||
</div>
|
||||
<div page='callingrules.html'>
|
||||
<div class="ui-accordion-link">Outgoing Calling Rules</div>
|
||||
<div class="ui-accordion-desc">Calling Rules define dialing permissions and routing rules.</div>
|
||||
</div>
|
||||
<div page='dialplans.html'>
|
||||
<div class="ui-accordion-link">Dial Plans</div>
|
||||
<div class="ui-accordion-desc">A DialPlan is a set of 'Calling Rules' that can be assigned to one or more users.</div>
|
||||
</div>
|
||||
<div page='users.html'>
|
||||
<div class="ui-accordion-link">Users</div>
|
||||
<div class="ui-accordion-desc">Users is a shortcut for quickly adding and removing all the necessary configuration components for any new phone.</div>
|
||||
</div>
|
||||
<div page='ringgroups.html'>
|
||||
<div class="ui-accordion-link">Ring Groups</div>
|
||||
<div class="ui-accordion-desc">Define Ringgroups to dial more than one extension simultaneously, or to ring more than one phone sequentially. This feature may also be called Huntgroups.</div>
|
||||
</div>
|
||||
<div page='mohfiles.html'>
|
||||
<div class="ui-accordion-link">Music On Hold</div>
|
||||
<div class="ui-accordion-desc">'Music On Hold' lets you customize audio tracks for different queues, parked calls etc.</div>
|
||||
</div>
|
||||
<div page='queues.html'>
|
||||
<div class="ui-accordion-link">Call Queues</div>
|
||||
<div class="ui-accordion-desc">Call queues allow calls to be sequenced to one or more agents.</div>
|
||||
</div>
|
||||
<div page='menus.html'>
|
||||
<div class="ui-accordion-link">Voice Menus</div>
|
||||
<div class="ui-accordion-desc">Menus allow for more efficient routing of calls from incoming callers. Also known as IVR (Interactive Voice Response) menus or Digital Receptionist.</div>
|
||||
</div>
|
||||
<div page='timeintervals.html'>
|
||||
<div class="ui-accordion-link">Time Intervals</div>
|
||||
<div class="ui-accordion-desc">Time Intervals are defined ranges of time that will be used by call routing features.</div>
|
||||
</div>
|
||||
<div page='incoming.html'>
|
||||
<div class="ui-accordion-link">Incoming Calling Rules</div>
|
||||
<div class="ui-accordion-desc">Create, modify, prioritize and delete incoming call rules based on Time Intervals.</div>
|
||||
</div>
|
||||
<div page='voicemail.html'>
|
||||
<div class="ui-accordion-link">Voicemail</div>
|
||||
<div class="ui-accordion-desc">General settings for voicemail.</div>
|
||||
</div>
|
||||
<div page='paging.html'>
|
||||
<div class="ui-accordion-link">Paging/Intercom</div>
|
||||
<div class="ui-accordion-desc">Set up 1-Way Paging or 2-Way Intercom for calling individial or group of extensions</div>
|
||||
</div>
|
||||
<div page='meetme.html'>
|
||||
<div class="ui-accordion-link">Conferencing</div>
|
||||
<div class="ui-accordion-desc">MeetMe conference bridging allows quick, ad-hoc conferences with or without security.</div>
|
||||
</div>
|
||||
<div page='followme.html'>
|
||||
<div class="ui-accordion-link">Follow Me</div>
|
||||
<div class="ui-accordion-desc"></div>
|
||||
</div>
|
||||
<div page='gtalk.html' style='display:none'>
|
||||
<div class="ui-accordion-link">Google Talk</div>
|
||||
<div class="ui-accordion-desc">Send or Receive calls from your buddies on Google Talk network</div>
|
||||
</div>
|
||||
<div page='skype.html' style='display:none'>
|
||||
<div class="ui-accordion-link">Skype</div>
|
||||
<div class="ui-accordion-desc">Send or Receive calls from your buddies on Skype network</div>
|
||||
</div>
|
||||
<div page='directory.html'>
|
||||
<div class="ui-accordion-link">Directory</div>
|
||||
<div class="ui-accordion-desc">Preferences for 'Dialing by Name Directory'</div>
|
||||
</div>
|
||||
<div page='features.html'>
|
||||
<div class="ui-accordion-link">Call Features</div>
|
||||
<div class="ui-accordion-desc">Feature Codes and Call parking preferences</div>
|
||||
</div>
|
||||
<div page='vmgroups.html'>
|
||||
<div class="ui-accordion-link">VoiceMail Groups</div>
|
||||
<div class="ui-accordion-desc">Define 'VoiceMail Groups' to leave a voicemail message for a group of users by dialing an extension.</div>
|
||||
</div>
|
||||
<div page='menuprompts_record.html'>
|
||||
<div class="ui-accordion-link">Voice Menu Prompts</div>
|
||||
<div class="ui-accordion-desc">Record or Upload custom VoiceMenu prompts.</div>
|
||||
</div>
|
||||
<div page='sysinfo.html'>
|
||||
<div class="ui-accordion-link">System Info</div>
|
||||
<div class="ui-accordion-desc">System Information.</div>
|
||||
</div>
|
||||
<div page='networking.html' class='forAA50'>
|
||||
<div class="ui-accordion-link">Networking</div>
|
||||
<div class="ui-accordion-desc">Configures networking parameters.</div>
|
||||
</div>
|
||||
<div page='registerg729.html' style='display:none'>
|
||||
<div class="ui-accordion-link">G.729 Codec</div>
|
||||
<div class="ui-accordion-desc">Register & Manage your G.729 Codec License Keys</div>
|
||||
</div>
|
||||
<div page='backup.html'>
|
||||
<div class="ui-accordion-link">Backup</div>
|
||||
<div class="ui-accordion-desc">Backup Management.</div>
|
||||
</div>
|
||||
<div page='flashupdate.html' class='forAA50'>
|
||||
<div class="ui-accordion-link">Update</div>
|
||||
<div class="ui-accordion-desc">Update Firmware installed on the appliance.</div>
|
||||
</div>
|
||||
<div page='upload_abe_overlay.html' class='default_Hidden' style='display:none'>
|
||||
<div class="ui-accordion-link">Update</div>
|
||||
<div class="ui-accordion-desc">Upload a GUI overlay file.</div>
|
||||
</div>
|
||||
<div page='preferences.html'>
|
||||
<div class="ui-accordion-link">Options</div>
|
||||
<div class="ui-accordion-desc">Admin Settings.</div>
|
||||
</div>
|
||||
<div page='asterisklogs.html' class='notinAA50'>
|
||||
<div class="ui-accordion-link">Asterisk Logs</div>
|
||||
<div class="ui-accordion-desc">Asterisk Log messages.</div>
|
||||
</div>
|
||||
<div page='cdr.html' class='AdvancedMode'>
|
||||
<div class="ui-accordion-link">Call Detail Records <sup><font color=#fffc31><b>beta</b></font></sup></div>
|
||||
<div class="ui-accordion-desc">Read all your records from Asterisk.</div>
|
||||
</div>
|
||||
<div page='status.html' class='AdvancedMode'>
|
||||
<div class="ui-accordion-link">Active Channels <sup><font color=#fffc31><b>beta</b></font></sup></div>
|
||||
<div class="ui-accordion-desc">Displays current Active Channels on the PBX, with the options to Hangup or Transfer.</div>
|
||||
</div>
|
||||
<div page='bulkadd.html' class='AdvancedMode'>
|
||||
<div class="ui-accordion-link">Bulk Add <sup><font color=#fffc31><b>beta</b></font></sup></div>
|
||||
<div class="ui-accordion-desc">Add multiple users to the system in one easy step - import from a csv file OR create a range of extensions.</div>
|
||||
</div>
|
||||
<div page='feditor.html' class='AdvancedMode'>
|
||||
<div class="ui-accordion-link">File Editor</div>
|
||||
<div class="ui-accordion-desc">Edit Asterisk Config files</div>
|
||||
</div>
|
||||
<div page='cli.html' class='AdvancedMode'>
|
||||
<div class="ui-accordion-link">Asterisk CLI</div>
|
||||
<div class="ui-accordion-desc">Asterisk Command Line Interface</div>
|
||||
</div>
|
||||
<div page='iax.html' class='AdvancedMode'>
|
||||
<div class="ui-accordion-link">IAX Settings</div>
|
||||
<div class="ui-accordion-desc">Global IAX Settings.</div>
|
||||
</div>
|
||||
<div page='sip.html' class='AdvancedMode'>
|
||||
<div class="ui-accordion-link">SIP Settings</div>
|
||||
<div class="ui-accordion-desc">Global SIP Settings.</div>
|
||||
</div>
|
||||
<!--<div page='cdr.html' class='notinAA50'>
|
||||
<div class="ui-accordion-link">CDRs</div>
|
||||
<div class="ui-accordion-desc">Access all your previous call records.</div>
|
||||
</div>-->
|
||||
<!--
|
||||
<div page='monitor.html'>
|
||||
<div class="ui-accordion-link">Active Calls</div>
|
||||
<div class="ui-accordion-desc">Monitor active calls</div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
<div id="ACTIVE_CONTENT"><noscript>You need to enable Javascript in your browser !!</noscript></div>
|
||||
</div>
|
||||
|
||||
<div class="copyrights">
|
||||
Copyright 2006-2011 Digium, Inc. Digium and Asterisk are registered <a href="http://www.digium.com/en/company/view-policy.php?id=Trademark-Policy" target='_blank'>trademarks</a> of
|
||||
Digium, Inc. All Rights Reserved. <i><a href="http://www.digium.com/en/company/policies.php" target="_blank" id='mainPageLegaInfo_A'>Legal Information</a></i>
|
||||
<div id='parent_div_guiVersion'></div>
|
||||
</div>
|
||||
|
||||
<div id='ajaxstatus' style='display:none;'>Loading..</div>
|
||||
|
||||
<div class="debugWindow">
|
||||
<table cellpadding=2 cellspacing=2 border=0 width="100%">
|
||||
<tr> <td align=left>
|
||||
<span id="dbw_flip" class='dbw_flip_show'>Hide debug messages</span>
|
||||
</td>
|
||||
<td align=right>
|
||||
<input type='checkbox' id='debugWindow_which_Ajax'>
|
||||
<label for='debugWindow_which_Ajax'> Ajax Requests </label>
|
||||
|
||||
<input type='checkbox' id='debugWindow_which_Debug'>
|
||||
<label for='debugWindow_which_Debug'> Debug </label>
|
||||
|
||||
<input type='checkbox' id='debugWindow_which_Error'>
|
||||
<label for='debugWindow_which_Error'> Error </label>
|
||||
|
||||
<input type='checkbox' id='debugWindow_which_Console'>
|
||||
<label for='debugWindow_which_Console'> Console </label>
|
||||
|
||||
<input type='checkbox' id='debugWindow_which_Info'>
|
||||
<label for='debugWindow_which_Info'> Info </label>
|
||||
|
||||
<input type='checkbox' id='debugWindow_which_Warnings'>
|
||||
<label for='debugWindow_which_Warnings'> Warnings </label>
|
||||
|
||||
<span class='guiButton' onclick='miscFunctions.DEBUG_CLEAR();'>Clear</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="debug_messages" style="clear: both;"></div>
|
||||
</div>
|
||||
|
||||
<iframe border="0" marginheight="0" marginwidth="0" id="mainscreen" style="position: absolute;" frameborder="0" scrolling="auto" width="800"></iframe>
|
||||
|
||||
<div id="noResponseFromServer" style="display:none; width:100%; height:100%; ">
|
||||
Could not connect to Server
|
||||
<div style='margin-top: 20px'>
|
||||
<span class='button_t1' onclick='onLogInFunctions.makePings.makeRetryPing();'> Retry </span>
|
||||
<div>
|
||||
</div>
|
||||
|
||||
<script src="js/log.js"></script>
|
||||
<script src="js/session.js"></script>
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/tooltip.js"></script>
|
||||
<script src="js/astman.js"></script>
|
||||
<script src="js/pbx.js"></script>
|
||||
<script src="js/pbx2.js"></script>
|
||||
<script src="js/index.js"></script>
|
||||
<script>
|
||||
// Store any run time data in this Object - ex: detected platform, has compact flash, FXO/FXS ports, etc etc.
|
||||
var sessionData = {
|
||||
finishedParsing : false,
|
||||
PLATFORM: {
|
||||
isAA50 : false, // AA50
|
||||
isUpDog : false, //Project Up Dog
|
||||
isABE : false, // Asterisk Business Edition
|
||||
isOSA : false, // plain OpenSource Asterisk
|
||||
// also look at the 'detectPlatform' function below
|
||||
isAA50_OEM : false, // sessionData.PLATFORM.isAA50_OEM
|
||||
AA50_SKU : '', // sessionData.PLATFORM.AA50_SKU
|
||||
isANOW : false, // Asterisk Now
|
||||
},
|
||||
|
||||
AsteriskVersionString : '',
|
||||
AsteriskVersion: '',
|
||||
AsteriskBranch: '',
|
||||
VersionCache: {},
|
||||
httpConf: { // store any information from http.conf in this object
|
||||
prefix: '',
|
||||
postmappings_defined : false,
|
||||
uploadPaths:{} // post_mappings
|
||||
},
|
||||
GUI_PREFERENCES : {}, // sessionData.GUI_PREFERENCES
|
||||
fbtimer : 0, // feedback message timer
|
||||
cliHistory: [], // Array to store command history from cli page
|
||||
isLoggedIn : false,
|
||||
continueParsing: false,
|
||||
advancedmode: false, // sessionData.advancedmode
|
||||
hasCompactFlash : false, // sessionData.hasCompactFlash
|
||||
listOfCodecs: { // sessionData.listOfCodecs
|
||||
'ulaw' : 'u-law' ,
|
||||
'alaw' : 'a-law' ,
|
||||
'gsm' : 'GSM' ,
|
||||
'ilbc' : 'ILBC' ,
|
||||
'speex': 'SPEEX' ,
|
||||
'g726' : 'G.726' ,
|
||||
'adpcm': 'ADPCM' ,
|
||||
'lpc10': 'LPC10' ,
|
||||
'g729' : 'G.729' ,
|
||||
'g723' : 'G.723'
|
||||
},
|
||||
directories:{},// sessionData.directories
|
||||
FileCache:{}, /* Object to Cache config files:
|
||||
sessionData.FileCache['users.conf'][context].content,
|
||||
sessionData.FileCache['users.conf'].modified
|
||||
sessionData.FileCache['users.conf'][context].modified, */
|
||||
FXO_PORTS_DETECTED : [], // so that we do not have to parse ztscan output each time where we want this list
|
||||
// sessionData.FXO_PORTS_DETECTED
|
||||
FXS_PORTS_DETECTED : [], // so that we do not have to parse ztscan output each time where we want this list
|
||||
// note that the above FXO_PORTS_DETECTED, FXS_PORTS_DETECTED are the actual analog FXS, FXO ports
|
||||
// and NOT the channels on a digital span with FXS or FXO signalling
|
||||
DEBUG_LOG : [], // all the debug log messages will be stored in this array (If debug mode is enabled)
|
||||
DEBUG_MODE : false, // set to true when debugging -- parent.sessionData.DEBUG_MODE
|
||||
DEBUG_WHICH: { Ajax: true, Debug: true, Error: true, Console: true, Info: true, Warn: true } , // parent.sessionData.DEBUG_WHICH.Ajax/Debug/Error/Console/Info/Warn
|
||||
REQUIRE_RESTART : false, // this flag is used to know if there are any updates in zapchan settings
|
||||
// like if a FXS is assigned to a user or an analog trunk is created or something
|
||||
// if this flag is true - we want to throw alert 'on ApplySettings' saying that a restart is required
|
||||
pbxinfo: {}, //object to store all the pbx configuration, the functions in readcfg (pbx.js) uses this object to store the parsed configuration
|
||||
PORTS_SIGNALLING: {
|
||||
// object to store signalling of fx(o/s)(k/l)s ports - as read from zaptel.conf,
|
||||
// if signalling is not defined for a port, gui will assume 'kewl start' as default
|
||||
ks: [], // parent.sessionData.PORTS_SIGNALLING.ks
|
||||
ls:[]
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
41
old-asterisk/asterisk/static-http/config/js/astgui.js
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Javascript functions to manipulate HTML
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Mark Spencer <markster@digium.com>
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
* Ryan Brindley <ryan@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Object holding all the HTML manipulation members and methods.
|
||||
*/
|
||||
var astgui = {};
|
||||
|
||||
/**
|
||||
* All the form members and methods.
|
||||
*/
|
||||
astgui.form = {};
|
||||
|
||||
/**
|
||||
* All the table members and methods.
|
||||
*/
|
||||
astgui.table = {};
|
||||
|
||||
/**
|
||||
* All the dialog members and methods.
|
||||
*/
|
||||
astgui.dialog = {};
|
||||
3414
old-asterisk/asterisk/static-http/config/js/astman.js
Normal file
219
old-asterisk/asterisk/static-http/config/js/astman2.js
Normal file
@@ -0,0 +1,219 @@
|
||||
/*
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Javascript functions for accessing manager over HTTP
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Mark Spencer <markster@digium.com>
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
* Ryan Brindley <ryan@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Asterisk Manager object
|
||||
* This object contains all the methods and variables necessary to communicate with Asterisk.
|
||||
*/
|
||||
var astman = {
|
||||
rawman: '../../rawman' /**< string variable. This holds the HTTP location of rawman. Was formerly named ASTGUI.paths.rawman */
|
||||
};
|
||||
|
||||
/**
|
||||
* Manage Asterisk's Internal Database.
|
||||
*/
|
||||
astman.astdb = {
|
||||
/**
|
||||
* Object contain default values.
|
||||
*/
|
||||
defaults: {
|
||||
dbname: 'astgui' /**< string variable. This holds the default dbname. Was formerly named ASTGUI.globals.GUI_DB */
|
||||
},
|
||||
|
||||
/**
|
||||
* Delete by key.
|
||||
* @param k a db object containing: key[, dbname]
|
||||
* @return true or false
|
||||
*/
|
||||
delete: function(k) {
|
||||
if (!k.hasOwnProperty('dbname')) {
|
||||
k.dbname = this.defaults.dbname;
|
||||
}
|
||||
|
||||
try {
|
||||
var s = astman.cliCommand('database del' + k.dbname + ' ' + k.key);
|
||||
if (!s.contains('entry removed')) {
|
||||
throw new Error(s);
|
||||
}
|
||||
} catch (err) {
|
||||
log.error(err.message);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get by key.
|
||||
* @param k a db object containing: key[, dbname]
|
||||
* @return key value
|
||||
*/
|
||||
get: function(k) {
|
||||
if (!k.hasOwnProperty('dbname')) {
|
||||
k.dbname = this.defaults.dbname;
|
||||
}
|
||||
|
||||
try {
|
||||
if (!k.hasOwnProperty('key')) {
|
||||
log.error('k.key is null, cannot complete astdb.update request');
|
||||
return false;
|
||||
}
|
||||
|
||||
var s = astman.cliCommand('database get ' + k.dbname + ' ' + k.key);
|
||||
if (!s.contains('Value: ')) {
|
||||
throw new Error(astman.parseCLI(s));
|
||||
}
|
||||
} catch (err) {
|
||||
log.error(err.message);
|
||||
return null;
|
||||
}
|
||||
|
||||
var val = astman.parseCLI(s);
|
||||
val.trim().withOut('Value: ');
|
||||
return val.trim();
|
||||
},
|
||||
|
||||
/**
|
||||
* Get all.
|
||||
* @param k a db object containing: [dbname]
|
||||
* @return object with all the key-values
|
||||
*/
|
||||
getAll: function(k) {
|
||||
if (!k.hasOwnProperty('dbname')) {
|
||||
k.dbname = this.defaults.dbname;
|
||||
}
|
||||
|
||||
var db_keys = {};
|
||||
var dbpath = '/' + k.dbname + '/';
|
||||
|
||||
try {
|
||||
var s = astman.cliCommand('database show ' + k.dbname);
|
||||
if (!s.contains(dbpath)) {
|
||||
throw new Error(s);
|
||||
}
|
||||
|
||||
var op = astman.parseCLI(s);
|
||||
if (op.trim() === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
var lines = op.split('\n');
|
||||
lines.each( function(line) {
|
||||
line = line.withOut(dbpath);
|
||||
var key = line.beforeChar(':').trim();
|
||||
var val = line.afterChar(':').trim();
|
||||
if (key !== '') {
|
||||
db_keys[key] = val;
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
log.error(err.message);
|
||||
return null;
|
||||
}
|
||||
|
||||
return db_keys;
|
||||
},
|
||||
|
||||
/**
|
||||
* Update by key.
|
||||
* @param k a db object containing: key, keyvalue[, dbname]
|
||||
* @return true or false
|
||||
*/
|
||||
update: function (k) {
|
||||
if (!k.hasOwnProperty('dbname')) {
|
||||
k.dbname = this.defaults.dbname;
|
||||
}
|
||||
|
||||
try {
|
||||
if (!k.hasOwnProperty('key')) {
|
||||
log.error('k.key is null, cannot complete astdb.update request');
|
||||
return false;
|
||||
} else if (!k.hasOwnProperty('keyvalue')) {
|
||||
log.error('k.keyvalue is null, cannot complete astdb.update request');
|
||||
return false;
|
||||
}
|
||||
|
||||
var s = astman.cliCommand('database put ' + k.dbname + ' ' + k.key + ' ' + k.keyvalue);
|
||||
if(!s.contains('successfully')) {
|
||||
throw new Error(s);
|
||||
}
|
||||
} catch (err) {
|
||||
log.error(s);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Executes a CLI Command.
|
||||
* This function takes a string CLI command and sends it to Asterisk to be executed. This function was formerly named ASTGUI.cliCommand
|
||||
* @param {String} cmd The CLI Command to be executed.
|
||||
* @return the CLI output
|
||||
*/
|
||||
astman.cliCommand = function(cmd) {
|
||||
if (typeof cmd !== 'string') {
|
||||
log.warn('cliCommand: Expecting cmd as String');
|
||||
return '';
|
||||
}
|
||||
|
||||
log.debug('cliCommand: Executing manager command: "' + cmd + '"');
|
||||
return this.makeSyncRequest( {action: 'command', command: cmd });
|
||||
};
|
||||
|
||||
/**
|
||||
* Makes a sync request.
|
||||
* This function takes an object and makes a synchronous ajax request. This function was formerly named makeSyncRequest
|
||||
* @param {Object} params the object containg all the parameters/options
|
||||
* @return {String} response text from the ajax call.
|
||||
*/
|
||||
astman.makeSyncRequest = function(params) {
|
||||
if (top.session && top.session.debug_mode) {
|
||||
log.ajax('makeSyncRequest: AJAX Request: "' + getProperties(param) + '"');
|
||||
}
|
||||
|
||||
if (typeof params !== 'object') {
|
||||
log.error('makeSyncRequest: Expecting params to be an object.');
|
||||
return '';
|
||||
}
|
||||
|
||||
var s = $.ajax({ url: astman.rawman, data: params, async: false});
|
||||
return s.responseText;
|
||||
};
|
||||
|
||||
/**
|
||||
* Parses CLI Responses.
|
||||
* The function takes a raw CLI response and strips unnecessary info, returning only the useful info. This function use to be called ASTGUI.parseCLIResponse.
|
||||
* @param resp The CLI Response to be parsed.
|
||||
* @return {String} the parsed CLI responsed
|
||||
*/
|
||||
astman.parseCLI = function(resp) {
|
||||
if (typeof resp !== 'string') {
|
||||
return resp;
|
||||
}
|
||||
|
||||
resp = resp.replace(/Response: Follows/, '');
|
||||
resp = resp.replace(/Privilege: Command/, '');
|
||||
resp = resp.replace(/--END COMMAND--/, '');
|
||||
|
||||
return resp;
|
||||
};
|
||||
294
old-asterisk/asterisk/static-http/config/js/backup.js
Normal file
@@ -0,0 +1,294 @@
|
||||
/*
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Backup functions
|
||||
*
|
||||
* Copyright (C) 2006-2011, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
* Erin Spiceland <espiceland@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
var bkpPath = top.sessionData.directories.ConfigBkp ;
|
||||
var upload_Filename = ""; // will be updated by upload_form.html
|
||||
var starteduploading = 0;
|
||||
var upload_Path; // path for 'uploads' as defined in http.conf - this variable will be automatically updated from http.conf
|
||||
|
||||
onUploadForm_beforeUploading = function(){
|
||||
if (!parent.sessionData.PLATFORM.isAA50 && !parent.sessionData.PLATFORM.isABE && ASTGUI.version.lt("1.6.0")) {
|
||||
alert("File Uploads are supported in Asterisk 1.6.0 and higher.");
|
||||
return;
|
||||
}
|
||||
starteduploading = 1;
|
||||
parent.ASTGUI.dialog.waitWhile('File Upload in progress, please wait ..');
|
||||
return true;
|
||||
};
|
||||
|
||||
onUploadForm_load = function(){
|
||||
if( parent.sessionData.PLATFORM.isABE ){ // ABE-1600
|
||||
$('#uploadForm_container').hide();
|
||||
return;
|
||||
}
|
||||
if(!top.sessionData.httpConf.postmappings_defined || !top.sessionData.httpConf.uploadPaths['backups'] ){
|
||||
top.log.error('AG102');
|
||||
$('#uploadForm_container').hide();
|
||||
return ;
|
||||
}
|
||||
|
||||
upload_Path = top.sessionData.httpConf.uploadPaths['backups'] ;
|
||||
var upload_action_path = (top.sessionData.httpConf.prefix) ? '/' + top.sessionData.httpConf.prefix + '/backups' : '/backups' ;
|
||||
_$('uploadiframe').contentWindow.document.getElementById('form22').action = upload_action_path ;
|
||||
_$('uploadiframe').contentWindow.document.getElementById('UploadFORM_UPLOAD_BUTTON').value = 'Upload Backup to Unit' ;
|
||||
};
|
||||
|
||||
|
||||
onUploadForm_unload = function(){
|
||||
if(!starteduploading){ return; }
|
||||
parent.ASTGUI.dialog.waitWhile('Backup File Uploaded');
|
||||
ASTGUI.feedback({ msg:'Backup File Uploaded !!', showfor: 3 });
|
||||
$('#uploadForm_container').hide();
|
||||
setTimeout( function(){ window.location.href = 'backup.html'; } , 1000 );
|
||||
return;
|
||||
};
|
||||
|
||||
function localajaxinit() {
|
||||
top.document.title = 'Configuration Backups';
|
||||
if( parent.sessionData.PLATFORM.isAA50 && !parent.sessionData.hasCompactFlash ){
|
||||
$('#nocf').show();
|
||||
$('#thispageContent').hide();
|
||||
return true;
|
||||
}
|
||||
|
||||
var rand_2 = Math.round(100000*Math.random());
|
||||
var tmp_check_perms_guibkps = function(){
|
||||
ASTGUI.dialog.waitWhile('Checking write privileges on backups folder');
|
||||
ASTGUI.systemCmd( "touch "+ top.sessionData.directories.ConfigBkp + rand_2 , function(){
|
||||
|
||||
ASTGUI.listSystemFiles( top.sessionData.directories.ConfigBkp , function(a){
|
||||
a = a.join('');
|
||||
if( a.contains(rand_2) ){
|
||||
ASTGUI.systemCmd( "rm '"+ top.sessionData.directories.ConfigBkp + rand_2 + "'" , function(){});
|
||||
}else{
|
||||
ASTGUI.dialog.alertmsg( 'missing ' + top.sessionData.directories.ConfigBkp + '<BR> OR Asterisk does not have write privileges on ' + top.sessionData.directories.ConfigBkp );
|
||||
return;
|
||||
}
|
||||
|
||||
localajaxinit_2();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
tmp_check_perms_guibkps();
|
||||
|
||||
}
|
||||
|
||||
var localajaxinit_2 = function(){
|
||||
parent.ASTGUI.dialog.waitWhile(' Loading list of Previous Backup files !');
|
||||
parent.ASTGUI.systemCmd( "mkdir -p " + bkpPath , function(){
|
||||
parent.ASTGUI.listSystemFiles( bkpPath , function(bkpfiles) {
|
||||
try{
|
||||
ASTGUI.domActions.clear_table(_$('bkpfilesTable'))
|
||||
for( var i =0 ; i < bkpfiles.length ; i++){
|
||||
addrow_totable( bkpfiles[i].stripTags(), i );
|
||||
}
|
||||
var _bft = _$('bkpfilesTable') ;
|
||||
if( _bft.rows.length == 0 ){
|
||||
_$('table_one').style.display="none";
|
||||
var newRow = _bft.insertRow(-1);
|
||||
var newCell0 = newRow.insertCell(0);
|
||||
newCell0 .align = "center";
|
||||
newCell0 .innerHTML = "<BR><I> No Previous Backup configurations found !!</I> <BR><BR>" +
|
||||
"Please click on the 'Create New Backup' button<BR> to take a backup of the current system configuration<BR><BR>" ;
|
||||
}
|
||||
}finally{
|
||||
parent.ASTGUI.dialog.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function restore_uploadedbkpfile(){
|
||||
|
||||
}
|
||||
|
||||
function addrow_totable(filename, i ){
|
||||
// filename is of format "backup_2008nov19_164527__2008nov19.tar"
|
||||
if(!filename.contains('__')){ return true;}
|
||||
var fname = filename.split("__") ; // var fname[1] = 2007mar12.tar
|
||||
|
||||
var tmp_a = fname[1] ; // tmp_a = 2008nov19.tar
|
||||
if(tmp_a.contains('_sounds.')){
|
||||
tmp_a = tmp_a.withOut('_sounds');
|
||||
fname[0] = fname[0] + '<BR><b>Voicemails & Prompts</b>';
|
||||
}
|
||||
|
||||
var filedate = tmp_a.rChop('.tar');
|
||||
var day = filedate.substr(7);
|
||||
var month = filedate.substr(4,3);
|
||||
var year = filedate.substr(0,4);
|
||||
|
||||
var newRow = _$('bkpfilesTable').insertRow(-1);
|
||||
newRow.style.backgroundColor='#FFFFFF';
|
||||
newRow.onmouseover= function(){ this.style.backgroundColor='#F9F0D1'; };
|
||||
newRow.onmouseout=function(){ this.style.backgroundColor='#FFFFFF'; };
|
||||
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: _$('bkpfilesTable').rows.length , width:35, align:'center' } );
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: fname[0] , width:180 } );
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: month.capitalizeFirstChar() + " " + day + ", " + year , width : 125 } );
|
||||
|
||||
var tmp = "<span onclick='dld_bkp(\""+ filename + "\")'class=\"guiButton\">Download from Unit</span> " +
|
||||
"<span onclick='restore_bkp(\""+ filename + "\")' class=\"guiButton\">Restore Previous Config</span> " +
|
||||
"<span onclick='delete_bkp(\""+ filename + "\")' class=\"guiButtonDelete\">Delete</span>" ;
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: tmp , align:'center'} );
|
||||
}
|
||||
|
||||
|
||||
function dld_bkp( filename ){
|
||||
parent.ASTGUI.systemCmd( "mkdir -p "+ top.sessionData.directories.ConfigBkp_dldPath + " ; /bin/rm " + top.sessionData.directories.ConfigBkp_dldPath + "* ", function(){
|
||||
parent.ASTGUI.systemCmd( "/bin/ln -s "+ bkpPath + filename + " " + top.sessionData.directories.ConfigBkp_dldPath + filename , function(){
|
||||
var location_dir = window.location.href ;
|
||||
location_dir = location_dir.rChop('backup.html') ;
|
||||
var download_link = location_dir + "private/bkps/" + filename ;
|
||||
var save_text = ( jQuery.browser.msie ) ? "'Save Target As...'" : "'Save Link As..'" ;
|
||||
|
||||
ASTGUI.feedback( { msg:'Download using the <i>Download File</i> link', showfor:2 });
|
||||
_$('backup_download_Link_url').innerHTML = '<center><A href="' + download_link + '"><b>Download File</b></A>'
|
||||
+ "<BR>Right Click on the above link and download using the " + save_text + " option</center>" ;
|
||||
$('#backup_download_Link').show();
|
||||
//var dld_window = window.open ("", "mywindow","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=200");
|
||||
//dld_window.document.write('<BR><center><A href="' + download_link + '"><b>Download From Unit</b></A></center>');
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function restore_bkp(filename){
|
||||
if( parent.sessionData.PLATFORM.isAA50 ){
|
||||
if(confirm('This will restart the appliance after restoring the backup configuration. \n\n Are you sure you want to proceed ?')){
|
||||
restore_bkp_step3(bkpPath + filename);
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
if(confirm('All your old configuration will be replaced by this backup configuration. \n\n Are you sure you want to proceed ?')){
|
||||
//parent.astmanEngine.run_tool("rm /etc/asterisk/* -rf ", callback=function(){ } );
|
||||
restore_bkp_step3(bkpPath + filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function restore_bkp_step3(file_fullpath){
|
||||
if( parent.sessionData.PLATFORM.isAA50 ){
|
||||
parent.ASTGUI.dialog.waitWhile(' The System will reboot shortly ');
|
||||
parent.ASTGUI.systemCmd( top.sessionData.directories.script_restoreBackup + " " + file_fullpath, function(){
|
||||
ASTGUI.feedback( { msg:'Configuration restored !!', showfor:2 });
|
||||
parent.miscFunctions.AFTER_REBOOT_CMD();
|
||||
/* ***************** Todo Restart ******************* */
|
||||
//if(starteduploading){ delete_bkp2(file_fullpath); }
|
||||
});
|
||||
}else{
|
||||
parent.ASTGUI.dialog.waitWhile(' Restoring Configuration ');
|
||||
parent.ASTGUI.systemCmd( " tar -xvf " + file_fullpath + ' -C / ', function(){
|
||||
ASTGUI.feedback( { msg:'Configuration restored !!', showfor:2 });
|
||||
|
||||
if(starteduploading){
|
||||
delete_bkp2(file_fullpath);
|
||||
}else{
|
||||
var t = ASTGUI.cliCommand('reload') ;
|
||||
setTimeout( function(){ top.window.location.reload(); } , 1000 );
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function delete_bkp( filename ){
|
||||
if(!confirm("Delete selected Backup Configuration ?")){ return ; }
|
||||
delete_bkp2( bkpPath + filename );
|
||||
}
|
||||
|
||||
function delete_bkp2( file_fullpath ){
|
||||
parent.ASTGUI.systemCmd( "/bin/rm -f " + file_fullpath , function(){
|
||||
ASTGUI.feedback( { msg:'Delete Request Successfull !', showfor:2 });
|
||||
setTimeout( function(){ window.location.reload(); } , 1000 );
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function take_bkp(){
|
||||
ASTGUI.showbg(true);
|
||||
|
||||
var months = ["jan", "feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];
|
||||
var today=new Date()
|
||||
var year = today.getFullYear();
|
||||
var month = months[ today.getMonth() ];
|
||||
var day = today.getDate().addZero();
|
||||
var hour = today.getHours().addZero() ;
|
||||
var minute = today.getMinutes().addZero() ;
|
||||
var seconds = today.getSeconds().addZero() ;
|
||||
var bkpfile = "backup_" + year + month + day + "_" + hour + minute + seconds ;
|
||||
|
||||
ASTGUI.updateFieldToValue( 'newbkp_name', bkpfile );
|
||||
|
||||
if( parent.sessionData.PLATFORM.isAA50 ){
|
||||
$(".AA50only").show();
|
||||
}else{
|
||||
$(".AA50only").hide();
|
||||
}
|
||||
|
||||
$('#newbkp_content').show() ;
|
||||
_$('newbkp_name').focus();
|
||||
}
|
||||
|
||||
function cancel_newbackup(){
|
||||
ASTGUI.showbg(false);
|
||||
_$('newbkp_content').style.display="none" ;
|
||||
}
|
||||
|
||||
function backup_new(){
|
||||
var _nn = _$('newbkp_name');
|
||||
if ( !ASTGUI.checkRequiredFields( [_nn] ) ) return ;
|
||||
if ( !ASTGUI.validateFields( [_nn] ) ) return ;
|
||||
|
||||
var months = ["jan", "feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];
|
||||
var today=new Date()
|
||||
var year = today.getFullYear();
|
||||
var month = months[ today.getMonth() ];
|
||||
var day = today.getDate().addZero();
|
||||
//var hour =addzero(today.getHours());
|
||||
//var minute =addzero(today.getMinutes());
|
||||
//var seconds =addzero(today.getSeconds());
|
||||
var bkpfile = _nn.value +"__" + year + month + day +".tar";
|
||||
|
||||
if( parent.sessionData.PLATFORM.isAA50 ){
|
||||
var fullback = _$('newbkp_completeBackup').checked ;
|
||||
if(fullback){
|
||||
var tmp_script = top.sessionData.directories.script_takeBackup + ' ' + bkpPath + bkpfile + ' ' + 'YES';
|
||||
}else{
|
||||
var tmp_script = top.sessionData.directories.script_takeBackup + ' ' + bkpPath + bkpfile ;
|
||||
}
|
||||
parent.ASTGUI.systemCmd( tmp_script , function(){
|
||||
ASTGUI.feedback( { msg:'Backup Successful', showfor:2 });
|
||||
window.location.reload();
|
||||
}) ;
|
||||
return ;
|
||||
}else{
|
||||
parent.ASTGUI.systemCmd( "tar -chf " + bkpPath + bkpfile + ' ' + ' /etc/asterisk', function(){
|
||||
ASTGUI.feedback( { msg:'Backup Successful', showfor:2 });
|
||||
parent.ASTGUI.dialog.waitWhile('Reloading List of backup Files');
|
||||
setTimeout( function(){ parent.ASTGUI.dialog.hide(); window.location.reload(); } , 2000 );
|
||||
});
|
||||
return ;
|
||||
}
|
||||
}
|
||||
139
old-asterisk/asterisk/static-http/config/js/bulkadd.js
Normal file
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Bulkadd functions
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*/
|
||||
var newusers_list = [];
|
||||
var NEW_USERS = {} ;
|
||||
|
||||
var localajaxinit = function(){
|
||||
ASTGUI.selectbox.populateArray('RANGE_Number', [5,10,15,20,25,30,35,40,45,50]);
|
||||
top.document.title = 'Bulk Add' ;
|
||||
|
||||
(function(){
|
||||
var t = [{ url:'#',
|
||||
desc:'Create New users from CSV list',
|
||||
click_function: function(){
|
||||
$('#table_usersFromCSV').show();
|
||||
$('#table_usersFromRange').hide();
|
||||
}
|
||||
},{ url: '#',
|
||||
desc: 'Create a Range of new users',
|
||||
click_function: function(){
|
||||
$('#table_usersFromCSV').hide();
|
||||
$('#table_usersFromRange').show();
|
||||
}
|
||||
}];
|
||||
ASTGUI.tabbedOptions( _$('tabbedMenu') , t );
|
||||
})();
|
||||
|
||||
$('#tabbedMenu').find('A:eq(0)').click();
|
||||
};
|
||||
|
||||
|
||||
|
||||
var create_NEW_USERS = function(){
|
||||
var addUser_OR_reloadGUI = function(){
|
||||
var tmp_first_user = newusers_list[0];
|
||||
parent.pbx.users.add( tmp_first_user , NEW_USERS[tmp_first_user] , function(){
|
||||
newusers_list.splice(0,1);
|
||||
if( newusers_list.length ){
|
||||
addUser_OR_reloadGUI();
|
||||
}else{
|
||||
alert( 'Users added \n Click Ok to reload GUI' );
|
||||
top.window.location.reload();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ASTGUI.dialog.waitWhile( "Creating list of users ");
|
||||
addUser_OR_reloadGUI();
|
||||
};
|
||||
|
||||
|
||||
|
||||
var addUsers_from_CSV_field = function(){
|
||||
NEW_USERS = {} ;
|
||||
newusers_list = [];
|
||||
|
||||
var csv_text = _$('ta_ba_csv').value ;
|
||||
var tmp_lines = csv_text.split('\n');
|
||||
var tmp_Heads = tmp_lines[0]; tmp_lines.splice(0, 1);
|
||||
var HEADS = tmp_Heads.split(',');
|
||||
if( HEADS[0] != 'User' ){
|
||||
alert('The first column should be User');
|
||||
return;
|
||||
}
|
||||
|
||||
for(var tli =0; tli< tmp_lines.length ; tli++ ){
|
||||
var this_line = tmp_lines[tli];
|
||||
if( this_line.trim() == '' ){ continue; }
|
||||
var this_user_details = this_line.split(',');
|
||||
if( this_user_details.length != HEADS.length ){
|
||||
alert('Error: Invalid Number of Fields in line ' + (tli + 1) );
|
||||
return;
|
||||
}
|
||||
|
||||
var this_user = this_user_details[0]; // User
|
||||
if( parent.miscFunctions.ifExtensionAlreadyExists(this_user) ){
|
||||
alert('Error: Duplicate Extension \n\n '+ ' Extension ' + this_user + ' already exists \n' + ' Please change extension in line ' + (tli + 1) );
|
||||
return;
|
||||
}
|
||||
|
||||
newusers_list.push( this_user ) ;
|
||||
NEW_USERS[ this_user ] = {} ;
|
||||
for( var f = 1 ; f < HEADS.length ; f++ ){
|
||||
NEW_USERS[ this_user ][ HEADS[f] ] = this_user_details[ f ] ;
|
||||
}
|
||||
};
|
||||
|
||||
create_NEW_USERS();
|
||||
};
|
||||
|
||||
|
||||
var add_RangeOfUsers = function(){
|
||||
NEW_USERS = {} ;
|
||||
newusers_list = [];
|
||||
|
||||
var t = Number( ASTGUI.getFieldValue('RANGE_Number') );
|
||||
var tmp_user = Number(ASTGUI.getFieldValue('RANGE_Start'));
|
||||
|
||||
while(t){
|
||||
var tmp_nu = String(tmp_user);
|
||||
if( parent.miscFunctions.ifExtensionAlreadyExists(tmp_nu) ){
|
||||
tmp_user++ ;
|
||||
continue;
|
||||
}
|
||||
|
||||
newusers_list.push(tmp_nu);
|
||||
top.log.debug( 'adding user ' + tmp_nu);
|
||||
NEW_USERS[ tmp_nu ] = {} ;
|
||||
NEW_USERS[ tmp_nu ]['fullname'] = 'User ' + tmp_nu;
|
||||
NEW_USERS[ tmp_nu ]['cid_number'] = tmp_nu;
|
||||
NEW_USERS[ tmp_nu ]['context'] = '';
|
||||
NEW_USERS[ tmp_nu ]['hasvoicemail'] = 'yes';
|
||||
NEW_USERS[ tmp_nu ]['vmsecret'] = tmp_nu;
|
||||
NEW_USERS[ tmp_nu ]['hassip'] = 'yes';
|
||||
NEW_USERS[ tmp_nu ]['hasiax'] = 'yes';
|
||||
NEW_USERS[ tmp_nu ]['secret'] = tmp_nu;
|
||||
tmp_user++ ;
|
||||
t--;
|
||||
}
|
||||
|
||||
create_NEW_USERS();
|
||||
};
|
||||
462
old-asterisk/asterisk/static-http/config/js/callingrules.js
Normal file
@@ -0,0 +1,462 @@
|
||||
/*
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Calling Rules functions
|
||||
*
|
||||
* Copyright (C) 2006-2010, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
* Ryan Brindley <rbrindley@digium.com>
|
||||
* Erin Spiceland <espiceland@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*/
|
||||
/*
|
||||
sessionData.pbxinfo.callingRules : {
|
||||
CallingRule_US : [
|
||||
'_91NXXXXXXXXX,1,Macro( trunkdial-failover-0.1, ${trunk_1}/${EXTEN:1}, ${trunk_2}/${EXTEN:1} )'
|
||||
]
|
||||
}
|
||||
*/
|
||||
|
||||
var EDIT_CR ; //calling rule being edited
|
||||
var EDIT_CR_RULE ;
|
||||
var isNew;
|
||||
|
||||
var newCallingRule_form = function(){
|
||||
isNew = true ;
|
||||
EDIT_CR = '';
|
||||
EDIT_CR_RULE = '';
|
||||
|
||||
_$('cr_dialog_title').innerHTML =' New CallingRule';
|
||||
ASTGUI.resetTheseFields ( [ DOM_new_crl_name, DOM_new_crl_pattern, DOM_new_crl_trunk, DOM_new_crl_tr_stripx, DOM_new_crl_tr_prepend, DOM_new_crl_tr_filter, DOM_new_crl_foChkbx, DOM_new_crl_fotrunk, DOM_new_crl_fotr_stripx, DOM_new_crl_fotr_prepend , DOM_new_crl_fotr_filter, 'toLocalDest' , 'new_crl_localDest', 'new_crl_caller_id'] );
|
||||
_$('toLocalDest').updateStatus();
|
||||
$(DOM_new_CRL_DIV).showWithBg();
|
||||
ASTGUI.feedback({ msg:'New CallingRule !', showfor:1 });
|
||||
};
|
||||
|
||||
var edit_CR_form = function(a,b){
|
||||
isNew = false;
|
||||
_$('cr_dialog_title').innerHTML =' Edit Calling Rule';
|
||||
|
||||
DOM_new_crl_tr_filter.value = '';
|
||||
DOM_new_crl_fotr_filter.value = '';
|
||||
|
||||
EDIT_CR = a;
|
||||
EDIT_CR_RULE = b;
|
||||
var tmp_cr = ASTGUI.parseContextLine.obCallingRule(b) ;
|
||||
|
||||
DOM_new_crl_trunk.selectedIndex = -1;
|
||||
DOM_new_crl_fotrunk.selectedIndex = -1;
|
||||
|
||||
DOM_new_crl_name.value = EDIT_CR.withOut(ASTGUI.contexts.CallingRulePrefix) ;
|
||||
DOM_new_crl_name.disabled = true;
|
||||
DOM_new_crl_pattern.value = tmp_cr.pattern ;
|
||||
DOM_new_crl_caller_id.value = tmp_cr.callerID;
|
||||
_$('new_crl_localDest').selectedIndex = -1;
|
||||
if( tmp_cr.destination ){
|
||||
ASTGUI.selectbox.selectOption('new_crl_localDest', tmp_cr.destination);
|
||||
_$('toLocalDest').checked = true;
|
||||
}else{
|
||||
_$('toLocalDest').checked = false;
|
||||
/* if the trunk is not analog, we can use this value as is. If it is,
|
||||
we need to figure out if it has been converted to a group_X name */
|
||||
if(!parent.pbx.trunks.isAnalog(tmp_cr.firstTrunk)){
|
||||
ASTGUI.updateFieldToValue(DOM_new_crl_trunk, tmp_cr.firstTrunk);
|
||||
}else if(tmp_cr.firstTrunk.indexOf('group_') > -1){
|
||||
ASTGUI.updateFieldToValue(DOM_new_crl_trunk, tmp_cr.firstTrunk);
|
||||
}else{
|
||||
var trunk1_name = parent.pbx.trunks.getName(tmp_cr.firstTrunk);
|
||||
var ded_group = parent.pbx.trunks.getDedicatedGroup(trunk1_name);
|
||||
// if ded_group is null, the trunk is misconfigured; this should never happen
|
||||
ded_group = "group_" + (ded_group ? ded_group : "0");
|
||||
ASTGUI.updateFieldToValue(DOM_new_crl_trunk, ded_group);
|
||||
}
|
||||
|
||||
DOM_new_crl_tr_stripx.value = tmp_cr.stripdigits_firstTrunk ;
|
||||
DOM_new_crl_tr_prepend.value = tmp_cr.firstPrepend ;
|
||||
DOM_new_crl_tr_filter.value = tmp_cr.firstFilter;
|
||||
if(tmp_cr.secondTrunk){
|
||||
DOM_new_crl_foChkbx.checked = true
|
||||
if(!parent.pbx.trunks.isAnalog(tmp_cr.secondTrunk)){
|
||||
//ASTGUI.selectbox.selectOption(DOM_new_crl_fotrunk, tmp_cr.secondTrunk);
|
||||
ASTGUI.updateFieldToValue(DOM_new_crl_fotrunk, tmp_cr.secondTrunk);
|
||||
}else if(tmp_cr.secondTrunk.indexOf('group_') > -1){
|
||||
ASTGUI.updateFieldToValue(DOM_new_crl_fotrunk, tmp_cr.secondTrunk);
|
||||
}else{
|
||||
var trunk2_name = parent.pbx.trunks.getName(tmp_cr.secondTrunk);
|
||||
var ded_group = parent.pbx.trunks.getDedicatedGroup(trunk2_name);
|
||||
// if ded_group is null, the trunk is misconfigured; this should never happen
|
||||
ded_group = "group_" + (ded_group ? ded_group : "0");
|
||||
ASTGUI.updateFieldToValue(DOM_new_crl_fotrunk, ded_group);
|
||||
}
|
||||
DOM_new_crl_fotr_stripx.value = tmp_cr.stripdigits_secondTrunk ;
|
||||
DOM_new_crl_fotr_prepend.value = tmp_cr.secondPrepend ;
|
||||
DOM_new_crl_fotr_filter.value = tmp_cr.secondFilter;
|
||||
} else {
|
||||
DOM_new_crl_foChkbx.checked = false;
|
||||
}
|
||||
en_db_fofields();
|
||||
}
|
||||
|
||||
_$('toLocalDest').updateStatus();
|
||||
$(DOM_new_CRL_DIV).showWithBg();
|
||||
ASTGUI.feedback({ msg:'Edit CallingRule !', showfor:1 });
|
||||
};
|
||||
|
||||
|
||||
var en_db_fofields = function(){
|
||||
var t = !DOM_new_crl_foChkbx.checked;
|
||||
DOM_new_crl_fotrunk.disabled = t;
|
||||
DOM_new_crl_fotr_stripx.disabled = t;
|
||||
DOM_new_crl_fotr_prepend.disabled = t;
|
||||
};
|
||||
|
||||
|
||||
var load_DOMelements = function(){
|
||||
DOM_tbl_crls = _$('table_CRLS_list');
|
||||
// new calling rule dom elements
|
||||
DOM_new_cr_button = _$('new_cr_button');
|
||||
DOM_new_CRL_DIV = _$('new_CRL_DIV');
|
||||
DOM_new_crl_name = _$('new_crl_name');
|
||||
DOM_new_crl_pattern = _$('new_crl_pattern');
|
||||
DOM_new_crl_caller_id= _$('new_crl_caller_id');
|
||||
DOM_new_crl_trunk = _$('new_crl_trunk');
|
||||
DOM_new_crl_tr_stripx = _$('new_crl_tr_stripx');
|
||||
DOM_new_crl_tr_prepend = _$('new_crl_tr_prepend');
|
||||
DOM_new_crl_tr_filter = _$('new_crl_tr_filter');
|
||||
DOM_new_crl_foChkbx = _$('new_crl_foChkbx');
|
||||
DOM_new_crl_fotrunk = _$('new_crl_fotrunk');
|
||||
DOM_new_crl_fotr_stripx = _$('new_crl_fotr_stripx');
|
||||
DOM_new_crl_fotr_prepend = _$('new_crl_fotr_prepend');
|
||||
DOM_new_crl_fotr_filter = _$('new_crl_fotr_filter');
|
||||
DOM_new_crl_tr_filter = _$('new_crl_tr_filter');
|
||||
// new calling rule dom elements
|
||||
(function(){
|
||||
en_db_fofields();
|
||||
ASTGUI.events.add( DOM_new_crl_foChkbx, 'change' , en_db_fofields);
|
||||
ASTGUI.events.add( DOM_new_cr_button , 'click' , newCallingRule_form);
|
||||
|
||||
// list non-analog trunks by trunk.
|
||||
var t = parent.pbx.trunks.list({iax: true, providers: true, sip: true, bri: true, pri: true});
|
||||
var TMP_FORSORT = [];
|
||||
t.each(function(item){
|
||||
TMP_FORSORT.push( parent.pbx.trunks.getName(item) + ':::::::' + item);
|
||||
});
|
||||
TMP_FORSORT.sort();
|
||||
TMP_FORSORT.each( function(this_str){
|
||||
var a = this_str.split(':::::::');
|
||||
ASTGUI.selectbox.append( DOM_new_crl_trunk, a[0], a[1] );
|
||||
ASTGUI.selectbox.append( DOM_new_crl_fotrunk , a[0], a[1] );
|
||||
});
|
||||
|
||||
// list analog trunks by group.
|
||||
var g = parent.pbx.trunks.listAllGroups();
|
||||
g.each( function(group){
|
||||
ASTGUI.selectbox.append( DOM_new_crl_trunk, parent.pbx.trunks.getGroupDescription(group), 'group_' + group);
|
||||
ASTGUI.selectbox.append( DOM_new_crl_fotrunk , parent.pbx.trunks.getGroupDescription(group), 'group_' + group);
|
||||
});
|
||||
|
||||
var modules_show = ASTGUI.cliCommand('module show');
|
||||
if( modules_show.contains('res_skypeforasterisk') && modules_show.contains('chan_skype') ){
|
||||
ASTGUI.selectbox.append( DOM_new_crl_trunk , 'Skype', 'Skype');
|
||||
ASTGUI.selectbox.append( DOM_new_crl_fotrunk , 'Skype', 'Skype');
|
||||
}
|
||||
})();
|
||||
};
|
||||
|
||||
moveCrUpDown = function(context , rule , updown){
|
||||
ASTGUI.miscFunctions.moveUpDown_In_context( context , rule , updown , function(newcontext){
|
||||
parent.sessionData.pbxinfo.callingRules[context] = newcontext ;
|
||||
ASTGUI.feedback( { msg: 'Updated !', showfor: 2 , color: 'blue', bgcolor: '#FFFFFF' } );
|
||||
window.location.reload();
|
||||
});
|
||||
};
|
||||
|
||||
var update_CRLSTable = function(){
|
||||
//DOM_tbl_crls
|
||||
var addCell = ASTGUI.domActions.tr_addCell; // temporarily store the function
|
||||
(function(){ // add first row
|
||||
var newRow = DOM_tbl_crls.insertRow(-1);
|
||||
newRow.className = "frow";
|
||||
addCell( newRow , { html:'', width: '100px' } );
|
||||
addCell( newRow , { html:'Calling Rule'} );
|
||||
addCell( newRow , { html:'Pattern'} );
|
||||
addCell( newRow , { html:'Trunk'} );
|
||||
addCell( newRow , { html:'Failover Trunk'} );
|
||||
addCell( newRow , { html:''} );
|
||||
//addCell( newRow , { html:'OutBound CID'} );
|
||||
})();
|
||||
|
||||
var PreviousTRColor = 'odd' ; // 'odd' : 'even' ;
|
||||
|
||||
(function (){
|
||||
var c = ASTGUI.cloneObject(parent.sessionData.pbxinfo.callingRules) ;
|
||||
for(var d in c){if(c.hasOwnProperty(d)){
|
||||
var crd = c[d]; // temporarily store all the details of this calling rule
|
||||
var tmp = '';
|
||||
PreviousTRColor = (PreviousTRColor == 'odd') ? 'even' : 'odd' ;
|
||||
|
||||
var this_crl_set = ASTGUI.cloneObject(c[d]) ;
|
||||
var crl = d.withOut(ASTGUI.contexts.CallingRulePrefix);
|
||||
|
||||
this_crl_set.each( function(this_rule, this_rule_index ){
|
||||
////////////////////////
|
||||
var tmp_movepriorities = '';
|
||||
if( this_rule_index == 0 ){
|
||||
tmp_movepriorities = '<img src=images/arrow_blank.png border=0> ' ;
|
||||
}else{
|
||||
tmp_movepriorities = "<A href=# title='Move this rule Up'><img src=images/arrow_up.png border=0 onclick=\"moveCrUpDown('" + d + "','" + this_rule+ "', 1)\"></A> " ;
|
||||
}
|
||||
|
||||
if( this_rule_index != ( this_crl_set.length -1 ) ){
|
||||
tmp_movepriorities += "<A href=# title='Move this rule Down'><img src=images/arrow_down.png border=0 onclick=\"moveCrUpDown('" + d + "','" + this_rule+ "', 0)\"></A>" ;
|
||||
}else{
|
||||
tmp_movepriorities += '<img src=images/arrow_blank.png border=0>' ;
|
||||
}
|
||||
//////////////////////
|
||||
|
||||
var tmp_cr = ASTGUI.parseContextLine.obCallingRule(this_rule) ;
|
||||
var newRow = DOM_tbl_crls.insertRow(-1);
|
||||
newRow.className = PreviousTRColor ;
|
||||
|
||||
addCell( newRow , { html: tmp_movepriorities } );
|
||||
addCell( newRow , { html: crl });
|
||||
addCell( newRow , { html: tmp_cr.pattern });
|
||||
|
||||
if( tmp_cr.hasOwnProperty('firstTrunk') ){
|
||||
addCell( newRow , { html: trunkHtml(tmp_cr.firstTrunk) });
|
||||
addCell( newRow , { html: trunkHtml(tmp_cr.secondTrunk) });
|
||||
}else{
|
||||
addCell( newRow , { html: '<i><font color=blue>Local Destination : ' + ASTGUI.parseContextLine.showAs(tmp_cr.destination) + '</font></i>', align: 'left', colspan : 2 });
|
||||
}
|
||||
|
||||
tmp = "<span class='guiButton' onclick=\"edit_CR_form('" + d +"','" + this_rule + "')\">Edit</span>" +
|
||||
"<span class='guiButtonDelete' onclick=\"delete_CR_confirm('" + d +"','" + this_rule + "')\">Delete</span>" ;
|
||||
|
||||
addCell( newRow , { html: tmp} );
|
||||
});
|
||||
}}
|
||||
|
||||
if(DOM_tbl_crls.rows.length == 1){
|
||||
ASTGUI.domActions.clear_table(DOM_tbl_crls);
|
||||
var newRow = DOM_tbl_crls.insertRow(-1);
|
||||
newRow.className = 'even';
|
||||
addCell( newRow , { html:'No CallingRules defined !!'} );
|
||||
return ;
|
||||
}
|
||||
})();
|
||||
};
|
||||
|
||||
var trunkHtml = function(trunk){
|
||||
if(!trunk){ return '<i><font color=red>None Assigned</font></i>'; }
|
||||
var trunk_name = parent.pbx.trunks.getName(trunk);
|
||||
if(trunk_name) { return trunk_name; }
|
||||
if(trunk.indexOf('group_' > -1)){ // it's a new-style analog trunk
|
||||
var group = trunk.replace('group_',"");
|
||||
var tr = parent.pbx.trunks.getTrunkNamesByGroup(group);
|
||||
var trstr = tr.join(", ");
|
||||
if (trstr.length > 30){
|
||||
trstr = trstr.substr(30) + '...';
|
||||
}
|
||||
return "Group " + group + "(" + trstr + ")";
|
||||
}
|
||||
return '<i><font color=red>Invalid Trunk\"' + trunk + '\"</font></i>';
|
||||
};
|
||||
|
||||
var localajaxinit = function() {
|
||||
top.document.title = "Edit Calling Rules";
|
||||
|
||||
var tmp_someArray = parent.miscFunctions.getAllDestinations() ;
|
||||
tmp_someArray.push({ optionText: 'Custom' , optionValue: 'CUSTOM' });
|
||||
ASTGUI.selectbox.populateArray( 'new_crl_localDest' , tmp_someArray);
|
||||
ASTGUI.domActions.showHideClassByCheckBox( 'toLocalDest', 'STT_TR_OPTIONS', true );
|
||||
load_DOMelements();
|
||||
update_CRLSTable();
|
||||
ASTGUI.events.add( 'restore_default_clrs_button', 'click' , restore_default_callingRules );
|
||||
|
||||
$('#new_crl_localDest').change(function(){
|
||||
if( this.value == 'CUSTOM'){
|
||||
$('#new_crl_localDest_CUSTOM_container').show();
|
||||
$('#new_crl_localDest_CUSTOM').val('').focus();
|
||||
}else{
|
||||
$('#new_crl_localDest_CUSTOM_container').hide();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var restore_default_callingRules = function(){
|
||||
if( !confirm( 'This would restore the factory default Calling Rules.'
|
||||
+ '\n Any other custom calling rules will not be edited or deleted.'
|
||||
+ '\n Click OK to continue ' ) )return;
|
||||
|
||||
|
||||
var x = new listOfActions('extensions.conf');
|
||||
x.new_action('delcat', 'CallingRule_Longdistance', '', '');
|
||||
x.new_action('newcat', 'CallingRule_Longdistance', '', '');
|
||||
x.new_action('append', 'CallingRule_Longdistance', 'exten', '_91XXXXXXXXXX!,1,Macro(' + ASTGUI.contexts.dialtrunks + ',${}/${FILTER(0123456789,${EXTEN:1})}, , , )' );
|
||||
|
||||
x.new_action('delcat', 'CallingRule_IAXTEL', '', '');
|
||||
x.new_action('newcat', 'CallingRule_IAXTEL', '', '');
|
||||
x.new_action('append', 'CallingRule_IAXTEL', 'exten', '_91700XXXXXXX!,1,Macro(' + ASTGUI.contexts.dialtrunks + ',${}/${FILTER(0123456789,${EXTEN:1})}, , , )' );
|
||||
|
||||
x.new_action('delcat', 'CallingRule_Local_AreaCode', '', '');
|
||||
x.new_action('newcat', 'CallingRule_Local_AreaCode', '', '');
|
||||
x.new_action('append', 'CallingRule_Local_AreaCode', 'exten', '_9256XXXXXXX!,1,Macro(' + ASTGUI.contexts.dialtrunks + ',${}/${FILTER(0123456789,${EXTEN:4})}, , , )' );
|
||||
|
||||
x.new_action('delcat', 'CallingRule_International', '', '');
|
||||
x.new_action('newcat', 'CallingRule_International', '', '');
|
||||
x.new_action('append', 'CallingRule_International', 'exten', '_9011XXXXX.,1,Macro(' + ASTGUI.contexts.dialtrunks + ',${}/${FILTER(0123456789,${EXTEN:1})}, , , )' );
|
||||
|
||||
x.new_action('delcat', 'CallingRule_Local_7_digits', '', '');
|
||||
x.new_action('newcat', 'CallingRule_Local_7_digits', '', '');
|
||||
x.new_action('append', 'CallingRule_Local_7_digits', 'exten', '_9XXXXXXX!,1,Macro(' + ASTGUI.contexts.dialtrunks + ',${}/${FILTER(0123456789,${EXTEN:1})}, , , )' );
|
||||
|
||||
x.new_action('delcat', 'CallingRule_Emergency', '', '');
|
||||
x.new_action('newcat', 'CallingRule_Emergency', '', '');
|
||||
x.new_action('append', 'CallingRule_Emergency', 'exten', '_911!,1,Macro(' + ASTGUI.contexts.dialtrunks + ',${}/${FILTER(0123456789,${EXTEN:1})}, , , )' );
|
||||
|
||||
|
||||
x.callActions(function(){
|
||||
ASTGUI.feedback( { msg : "Restored 'default Calling Rules' !", showfor: 3, color:'red' });
|
||||
alert( "Restored 'default Calling Rules' !" + '\n' + 'The gui will now reload' );
|
||||
top.window.location.reload();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var new_crl_save_go = function(){
|
||||
if ( !ASTGUI.validateFields( [ DOM_new_crl_name, DOM_new_crl_pattern, 'new_crl_tr_stripx' , 'new_crl_tr_prepend' , 'new_crl_fotr_stripx' , 'new_crl_fotr_prepend' ] ) ){
|
||||
return ;
|
||||
}
|
||||
|
||||
if( _$('toLocalDest').checked ){
|
||||
if ( !ASTGUI.checkRequiredFields([DOM_new_crl_name, DOM_new_crl_pattern]) ){
|
||||
return ;
|
||||
}
|
||||
if( !_$('new_crl_localDest').value ){
|
||||
ASTGUI.feedback( { msg:'select a destination !', showfor:2, color:'red' });
|
||||
return ;
|
||||
}
|
||||
}else{
|
||||
if ( !ASTGUI.checkRequiredFields([DOM_new_crl_name, DOM_new_crl_pattern, DOM_new_crl_trunk ]) ){
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
if(_$('new_crl_foChkbx').checked){
|
||||
if ( !ASTGUI.checkRequiredFields([DOM_new_crl_fotrunk]) ){
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
var caller_id = ASTGUI.getFieldValue('new_crl_caller_id');
|
||||
if(/[^\w\d\s_\-"<>]/.test(caller_id)){
|
||||
ASTGUI.feedback( { msg:'Invalid Caller ID format!', showfor:2, color:'red' });
|
||||
return ;
|
||||
}
|
||||
if (caller_id && caller_id != 'undefined'){
|
||||
caller_id = ',' + caller_id;
|
||||
}else{
|
||||
caller_id = '';
|
||||
}
|
||||
|
||||
if( _$('toLocalDest').checked ){
|
||||
var tmp_new_crl_localDest = ASTGUI.getFieldValue('new_crl_localDest') ;
|
||||
if( tmp_new_crl_localDest == 'CUSTOM' ){
|
||||
var as = DOM_new_crl_pattern.value + ',1,' + ASTGUI.getFieldValue('new_crl_localDest_CUSTOM') ; ////// <<<<<<<<<<<<<<<<<<<
|
||||
}else{
|
||||
var as = DOM_new_crl_pattern.value + ',1,';
|
||||
if(caller_id){
|
||||
var args = ASTGUI.parseContextLine.getArgs(DOM_new_crl_pattern.value + ',1,'+ tmp_new_crl_localDest);
|
||||
as += "Macro(local-callingrule-cid-0.1," + args[0] + ',' + args[1] + ',' + args[2] + caller_id + ')';
|
||||
}else{
|
||||
as += tmp_new_crl_localDest;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
var t1 = ASTGUI.getFieldValue(DOM_new_crl_trunk);
|
||||
var t2 = (DOM_new_crl_foChkbx.checked) ? ASTGUI.getFieldValue(DOM_new_crl_fotrunk) : '';
|
||||
if( _$('new_crl_foChkbx').checked && t1 == t2 ){
|
||||
ASTGUI.feedback( { msg:'Failover trunk can not be same as the primary trunk !', showfor: 3, color:'red' });
|
||||
DOM_new_crl_fotrunk.focus();
|
||||
return ;
|
||||
}
|
||||
|
||||
var g1cid = '';
|
||||
var g2cid = '';
|
||||
if(t1.indexOf("group_") > -1){
|
||||
g1cid = parent.pbx.trunks.getTrunkIdByName(t1);
|
||||
}
|
||||
if(t2.indexOf("group_") > -1){
|
||||
g2cid = parent.pbx.trunks.getTrunkIdByName(t2);
|
||||
}
|
||||
|
||||
var tmp_stripx = DOM_new_crl_tr_stripx.value || '0' ;
|
||||
var tmp_fotr_stripx = DOM_new_crl_fotr_stripx.value || '0' ;
|
||||
var tmp_checkThis = ( DOM_new_crl_pattern.value.beginsWith('_') ) ? DOM_new_crl_pattern.value.length -1 : DOM_new_crl_pattern.value.length ;
|
||||
|
||||
if( Number(tmp_stripx) > tmp_checkThis ){
|
||||
ASTGUI.feedback( { msg:'You can not strip more digits than in the pattern !', showfor: 3, color:'red' });
|
||||
DOM_new_crl_tr_stripx.focus();
|
||||
return ;
|
||||
}
|
||||
|
||||
if( DOM_new_crl_foChkbx.checked && Number(tmp_fotr_stripx) > tmp_checkThis ){
|
||||
ASTGUI.feedback( { msg:'You can not strip more digits than in the pattern !', showfor: 3, color:'red' });
|
||||
DOM_new_crl_fotr_stripx.focus();
|
||||
return ;
|
||||
}
|
||||
|
||||
var t1_braces = (t1 == 'Skype') ? t1 : '${' + t1 + '}' ;
|
||||
var Trunk_Build_str = '${EXTEN:' + tmp_stripx + '}';
|
||||
if(DOM_new_crl_tr_filter.value != ''){
|
||||
Trunk_Build_str = '${FILTER(' + DOM_new_crl_tr_filter.value +',' + Trunk_Build_str + ')}' ;
|
||||
}
|
||||
Trunk_Build_str = ',' + t1_braces + '/' + DOM_new_crl_tr_prepend.value + Trunk_Build_str;
|
||||
var foTrunk_Build_str = '' ;
|
||||
|
||||
if(DOM_new_crl_foChkbx.checked){
|
||||
var t2_braces = (t2 == 'Skype') ? t2 : '${' + t2 + '}' ;
|
||||
foTrunk_Build_str += '${EXTEN:' + tmp_fotr_stripx + '}' ;
|
||||
if(DOM_new_crl_fotr_filter.value != ''){
|
||||
foTrunk_Build_str = '${FILTER(' + DOM_new_crl_fotr_filter.value + ',' + foTrunk_Build_str + ')}' ;
|
||||
}
|
||||
foTrunk_Build_str = t2_braces + '/' + DOM_new_crl_fotr_prepend.value + foTrunk_Build_str;
|
||||
}
|
||||
foTrunk_Build_str = ',' + foTrunk_Build_str;
|
||||
|
||||
var t1_cidarg = ( t1 == 'Skype') ? ',' : ',' + (g1cid ? g1cid : t1);
|
||||
var t2_cidarg = ( t2 == 'Skype') ? ',' : ',' + (g2cid ? g2cid : t2);
|
||||
var as = DOM_new_crl_pattern.value + ',1,Macro(' + ASTGUI.contexts.dialtrunks + Trunk_Build_str + foTrunk_Build_str + t1_cidarg + t2_cidarg + caller_id + ')' ;
|
||||
}
|
||||
|
||||
if( isNew ){
|
||||
parent.pbx.calling_rules.add( DOM_new_crl_name.value , as)
|
||||
ASTGUI.feedback( { msg:'CallingRule Created !', showfor:2, color:'green' });
|
||||
window.location.reload();
|
||||
}else{
|
||||
parent.ASTGUI.dialog.waitWhile(' Updating ...');
|
||||
parent.pbx.calling_rules.edit( EDIT_CR, EDIT_CR_RULE, 'exten='+as )
|
||||
ASTGUI.feedback( { msg:'Calling Rule Updated !', showfor:2, color:'green' });
|
||||
parent.ASTGUI.dialog.hide();
|
||||
window.location.reload();
|
||||
}
|
||||
};
|
||||
|
||||
var delete_CR_confirm = function(a,b){
|
||||
if( !confirm('Delete Calling Rule ?') ) return;
|
||||
parent.pbx.calling_rules.remove(a,b);
|
||||
ASTGUI.feedback( { msg:'Calling Rule Deleted !', showfor:2, color:'red' });
|
||||
window.location.reload();
|
||||
};
|
||||
419
old-asterisk/asterisk/static-http/config/js/cdr.js
Normal file
@@ -0,0 +1,419 @@
|
||||
/*
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* cdr.html functions
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*/
|
||||
var backend = "CDR-CSV";
|
||||
var records = [];
|
||||
var viewCount = 25; /* number of CDR rows displayed at once */
|
||||
var offset = 0; /* index into CDR records for first row of current display */
|
||||
var fields = [ /* Table column header text */
|
||||
"",
|
||||
"Account Code", "Source", "Destination", "Dest. Context",
|
||||
"Caller ID", "Channel", "Dest. Channel", "Last app.",
|
||||
"Last data", "Start time", "Answer Time", "End Time",
|
||||
"Duration", "Billable seconds", "Disposition", "AMA flags",
|
||||
"Unique ID", "Log userfield"
|
||||
];
|
||||
var svindex = [ /* which field to display for short version, add 1 to get index into headers */
|
||||
/* use as-is for index into CDR record fields */
|
||||
/* -1 is special case for first column (black header, 1..n for each row) */
|
||||
-1, 9, 12, 1, 2, 4, 14
|
||||
];
|
||||
var longversion = false; /* long version displays all CDR-CSV fields, short only those selected above */
|
||||
var sortby = 0; /* Which column (CDR field) to sort the displayed CDR list by. */
|
||||
/* negative means descending. Subtract 1 to get index into the records fields array */
|
||||
var maxColumns = 0; /* maximum number of columns found in CDR records */
|
||||
|
||||
var recordsInbound = [];
|
||||
var recordsOutbound = [];
|
||||
var recordsInternal = [];
|
||||
var recordsExternal = [];
|
||||
var recordsSystem = [];
|
||||
var uniqueIDs = [];
|
||||
var recordsSelected = [];
|
||||
|
||||
var showSystemCalls = false; /* don't display CDR records with destination of "asterisk_guitools" */
|
||||
var showOutboundCalls = true;
|
||||
var showInboundCalls = true;
|
||||
var showInternalCalls = true;
|
||||
var showExternalCalls = true;
|
||||
var nSelected = 0;
|
||||
|
||||
function setSortbyField(index) { /* comes here on click on one of the table headers */
|
||||
offset = 0;
|
||||
if (Math.abs(sortby) == index) sortby = -sortby; /* if sorting on same column, simply reverse order */
|
||||
else sortby = index;
|
||||
loadRecords(true);
|
||||
}
|
||||
|
||||
function sortCompare(a,b) {
|
||||
var sb = Math.abs(sortby) - 1; /* subtract one, js arrays are zero-based index */
|
||||
var sign = sortby < 0 ? -1 : 1; /* negative requests descending order */
|
||||
var cmpa = a[sb];
|
||||
var cmpb = b[sb];
|
||||
if (cmpa < cmpb) return(-1*sign); /* returns -1 if ascending, 1 if descending requested */
|
||||
else if (cmpa > cmpb) return(sign); /* returns 1 if ascending, -1 if descending requested */
|
||||
else return(0);
|
||||
}
|
||||
|
||||
function nextPage() {
|
||||
if (nSelected > offset + viewCount) offset += viewCount;
|
||||
loadRecords(false);
|
||||
}
|
||||
|
||||
function prevPage() {
|
||||
if (offset) offset -= viewCount;
|
||||
if (offset < 0) offset = 0;
|
||||
loadRecords(false);
|
||||
}
|
||||
|
||||
function rowClick(tr) {
|
||||
if (tr.asteriskCDRuniqueID) {
|
||||
var i = uniqueIDs.length;
|
||||
var ir = [];
|
||||
while (i--) if (uniqueIDs[i] == tr.asteriskCDRuniqueID) ir.push(i);
|
||||
var x = ir.length;
|
||||
if (x>0) {
|
||||
var td = document.getElementById("cdr_calldetail_text");
|
||||
var txt = (x>1)?"<B>Multiple records with same Unique ID</B><BR><BR>":"";
|
||||
while (x--) {
|
||||
var r = records[ir[x]];
|
||||
txt = txt+"<B>Record "+ir[x]+", ID:</B> "+r[16]+"<B> ("+r.callType+" call)</B><BR>"+
|
||||
"<B>Timestamps:</B> "+r[9]+", "+r[10]+", "+r[11]+"<BR>"+
|
||||
"<B>Durations:</B> "+r[12]+", "+r[13]+"<BR>"+
|
||||
"<B>Disposition/AMA flags:</B> "+r[14]+" / "+r[15]+"<BR>"+
|
||||
"<B>CallerID:</B> "+r[4]+" <B>Source:</B> "+r[1]+" <B>Destination:</B> "+r[2]+"<BR>"+
|
||||
"<B>Source Channel:</B> "+r[5]+"<BR>"+
|
||||
"<B>Destination Channel:</B> "+r[6]+"<BR>"+
|
||||
"<B>Context:</B> "+r[3]+" <B>Application:</B> "+r[7]+" <B>Data:</B> "+r[8]+"<BR>"+
|
||||
"<B>Account code:</B> "+r[0]+
|
||||
" <B>Userfield:</B> "+r[17]+"<BR><BR>";
|
||||
}
|
||||
td.innerHTML = txt;
|
||||
$(document.getElementById("cdr_calldetail_DIV")).showWithBg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function VisibleHeight() { /* need to test to make sure works on all browsers */
|
||||
var h = 0;
|
||||
if( typeof( window.parent.innerHeight ) == 'number' ) {
|
||||
h = window.parent.innerHeight; /* Most browsers except MS IE */
|
||||
}
|
||||
else if(window.parent.document.documentElement &&
|
||||
window.parent.document.documentElement.offsetHeight) {
|
||||
h = window.parent.document.documentElement.offsetHeight; /* MS IE 7 */
|
||||
}
|
||||
else if( document.body && (document.body.clientHeight ) ) {
|
||||
h = document.body.clientHeight;
|
||||
}
|
||||
return h;
|
||||
}
|
||||
function VisibleWidth() { /* need to test to make sure works on all browsers */
|
||||
var w = 0;
|
||||
if( typeof( window.parent.innerWidth ) == 'number' ) {
|
||||
w = window.parent.innerWidth; /* Most browsers except MS IE */
|
||||
}
|
||||
else if(window.parent.document.documentElement &&
|
||||
window.parent.document.documentElement.offsetWidth) {
|
||||
w = window.parent.document.documentElement.offsetWidth; /* MS IE 7 */
|
||||
}
|
||||
else if( document.body && (document.body.clientWidth ) ) {
|
||||
w = document.body.clientWidth;
|
||||
}
|
||||
return w;
|
||||
}
|
||||
|
||||
function isset(obj) {
|
||||
if (typeof obj != "object")
|
||||
return (typeof obj != "undefined");
|
||||
for (var i in obj)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function splitCSV(s) {
|
||||
/* Split a Comma Separated Values string into an array of strings. Without thinking we might */
|
||||
/* use s.split(","); But we have to handle case where comma is legitimately inside a */
|
||||
/* quoted field... "a","b,c","d" must split into 3, not 4 pieces. This nasty looking regular */
|
||||
/* expression does the job s.split(/,(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/); and works on */
|
||||
/* firefox and safari, but fails on IE7/8 when "a",,"b". Should split to 3, IE splits to 2 */
|
||||
/* So, we roll our own here. */
|
||||
var result = [];
|
||||
var inQuote = false;
|
||||
var l = s.length;
|
||||
var i = 0
|
||||
var iStart = 0;
|
||||
for (i=0; i<l; i++) {
|
||||
var c = s.charAt(i);
|
||||
if (c == ',' && !inQuote) {
|
||||
/* found break point */
|
||||
result.push(s.substring(iStart,i));
|
||||
iStart = i+1;
|
||||
}
|
||||
else if (c == '"') inQuote = !inQuote;
|
||||
}
|
||||
/* got to end, push last value */
|
||||
if (iStart<=i) result.push(s.substring(iStart,i));
|
||||
return result;
|
||||
}
|
||||
|
||||
function loadRecords(buildselected) {
|
||||
|
||||
try {
|
||||
|
||||
_$("longFields").checked = longversion;
|
||||
_$("showSystem").checked = showSystemCalls;
|
||||
_$("showOutbound").checked = showOutboundCalls;
|
||||
_$("showInbound").checked = showInboundCalls;
|
||||
_$("showInternal").checked = showInternalCalls;
|
||||
_$("showExternal").checked = showExternalCalls;
|
||||
|
||||
var nCdrs = records.length;
|
||||
if (viewCount == nCdrs) viewCount = -1;
|
||||
ASTGUI.updateFieldToValue( _$("selectViewCount"),viewCount.toString() );
|
||||
if (viewCount == -1) viewCount = nCdrs;
|
||||
|
||||
if (buildselected) {
|
||||
recordsSelected = [];
|
||||
recordsSelected = recordsSelected.concat((showSystemCalls?recordsSystem:[]),(showOutboundCalls?recordsOutbound:[]),(showInboundCalls?recordsInbound:[]),(showInternalCalls?recordsInternal:[]),(showExternalCalls?recordsExternal:[]));
|
||||
nSelected = recordsSelected.length;
|
||||
recordsSelected.sort(sortCompare);
|
||||
}
|
||||
|
||||
if (offset >= nSelected) offset = Math.max(0,nSelected-viewCount);
|
||||
|
||||
var e = _$("cdr_content_container");
|
||||
e.innerHTML = "";
|
||||
|
||||
var d = document.createElement("TABLE")
|
||||
d.id = "table_CDR_list";
|
||||
d.className = "table_CDR";
|
||||
d.cellSpacing = 0;
|
||||
|
||||
if (offset == 0) _$("prevPageBtn").disabled = true;
|
||||
else _$("prevPageBtn").disabled = false;
|
||||
if (offset+viewCount >= nSelected) _$("nextPageBtn").disabled = true;
|
||||
else _$("nextPageBtn").disabled = false;
|
||||
|
||||
_$("info").innerHTML = records.length + " Total records; Viewing " + (offset+1) + "-" + Math.min(offset+viewCount,nSelected) + " of " + nSelected +" Selected";
|
||||
|
||||
var thead = document.createElement("thead");
|
||||
var tr = document.createElement("tr");
|
||||
if (longversion) tr.style.fontSize = "8pt";
|
||||
else tr.style.fontSize = "12pt";
|
||||
for(var i=0;i<=(longversion?maxColumns:(svindex.length-1));i++) {
|
||||
var th = document.createElement("th");
|
||||
var x = longversion?i:(svindex[i]+1);
|
||||
if ($(d).fixedHeader) th.setAttribute("onclick","javascript:setSortbyField("+x+")");
|
||||
else th.onclick=Function('setSortbyField("'+x+'")'); /* needed for IE with no fixedheader */
|
||||
if (x==sortby) th.style.textDecoration = "underline";
|
||||
else if (x==0-sortby) th.style.textDecoration = "overline";
|
||||
th.appendChild(document.createTextNode(fields[x]));
|
||||
tr.appendChild(th);
|
||||
}
|
||||
thead.appendChild(tr);
|
||||
d.appendChild(thead);
|
||||
|
||||
var tbody = document.createElement("tbody");
|
||||
var c = viewCount;
|
||||
var n = 1; /* will use as row numbers (left most column) */
|
||||
for(var i=0;c--&&isset(recordsSelected[i+offset]);i++) {
|
||||
var r = recordsSelected[i+offset];
|
||||
var tr = document.createElement("tr");
|
||||
tr.className = (i%2)?"odd":"even";
|
||||
if (longversion) tr.style.fontSize = "8pt";
|
||||
else tr.style.fontSize = "12pt";
|
||||
if (r.duplicate) tr.style.color = "ff0000";
|
||||
if (r.uniqueID) tr.asteriskCDRuniqueID = r.uniqueID;
|
||||
tr.onclick=function(){rowClick(this);};
|
||||
|
||||
for(var j=-1;j<(longversion?r.length:svindex.length-1);j++) {
|
||||
var td = document.createElement("td");
|
||||
if (j < 0) { /* row numbers (first column) */
|
||||
td.style.textAlign = "right";
|
||||
td.appendChild(document.createTextNode(offset+n));
|
||||
n++;
|
||||
} else {
|
||||
td.appendChild(document.createTextNode(r[(longversion?j:(svindex[j+1]))]));
|
||||
}
|
||||
tr.appendChild(td);
|
||||
}
|
||||
tbody.appendChild(tr);
|
||||
}
|
||||
d.appendChild(tbody);
|
||||
e.appendChild(d);
|
||||
|
||||
} catch(e) {
|
||||
alert(e);
|
||||
}
|
||||
/* table is now built */
|
||||
|
||||
/* Would like to size the width and height of the table to use up all the visible */
|
||||
/* space in the browser window... for optimum usability with scroll bars, etc. */
|
||||
/* but, don't make it any smaller than 300 pixels wide and 200 pixels high */
|
||||
/* -20's are to make room for scroll bars */
|
||||
var tableWidth = Math.max(VisibleWidth() - ASTGUI.domActions.findPos(e).cleft -
|
||||
ASTGUI.domActions.findPos(this.parent.DOM_mainscreen).cleft - 20,
|
||||
300);
|
||||
var tableHeight = Math.max(VisibleHeight() - ASTGUI.domActions.findPos(e).ctop -
|
||||
ASTGUI.domActions.findPos(this.parent.DOM_mainscreen).ctop - 20,
|
||||
200);
|
||||
|
||||
if ($(d).fixedHeader) {
|
||||
/* Add the fixed (will not scroll) header. */
|
||||
$(d).fixedHeader({ width: tableWidth, height: tableHeight});
|
||||
}
|
||||
else {
|
||||
/* The fixedHeader jQuery plugin is missing */
|
||||
/* In this case just set the height of the container so that */
|
||||
/* we scroll within the visible window */
|
||||
e.style.width = tableWidth;
|
||||
e.style.height = tableHeight;
|
||||
}
|
||||
|
||||
parent.ASTGUI.dialog.hide();
|
||||
}
|
||||
|
||||
var localajaxinit = function() {
|
||||
|
||||
_$('engine').innerHTML = backend;
|
||||
|
||||
_$("longFields").onclick = function(){longversion=this.checked; loadRecords(false);};
|
||||
_$("showSystem").onclick = function(){showSystemCalls=this.checked; loadRecords(true);};
|
||||
_$("showOutbound").onclick = function(){showOutboundCalls=this.checked; loadRecords(true);};
|
||||
_$("showInbound").onclick = function(){showInboundCalls=this.checked; loadRecords(true);};
|
||||
_$("showInternal").onclick = function(){showInternalCalls=this.checked; loadRecords(true);};
|
||||
_$("showExternal").onclick = function(){showExternalCalls=this.checked; loadRecords(true);};
|
||||
_$("selectViewCount").onchange = function(){offset=0; viewCount=parseInt(this.value); loadRecords(false);};
|
||||
|
||||
top.document.title = "CDR Viewer" ;
|
||||
|
||||
var jc = context2json({filename: "cdr.conf", context: "general", usf:1 });
|
||||
|
||||
if( jc.hasOwnProperty('enable') && !jc['enable'].isAstTrue() ) {
|
||||
alert("You do not have CDR enabled. Set enabled = yes in cdr.conf");
|
||||
}
|
||||
|
||||
var c = context2json({ filename:'http.conf', context: 'general', usf:1 });
|
||||
|
||||
if( c.hasOwnProperty('enablestatic') && !c['enablestatic'].isAstTrue() ) {
|
||||
alert("You do not have static file support in http.conf. Set 'enablestatic' = yes in http.conf");
|
||||
}
|
||||
|
||||
parent.ASTGUI.dialog.waitWhile(' Grabbing your Records... ');
|
||||
|
||||
parent.ASTGUI.systemCmd(top.sessionData.directories.script_mastercsvexists, function (){
|
||||
var content = ASTGUI.loadHTML("./Master.csv"); /* "./" is good enough. */
|
||||
records = content.split("\n");
|
||||
var intDest = parent.pbx.users.list();
|
||||
|
||||
for(var i=0;i<records.length;i++) {
|
||||
records[i] = splitCSV(records[i]); /* cannot use records[i].split(","); */
|
||||
var nColumns = records[i].length;
|
||||
maxColumns = Math.max(maxColumns,nColumns);
|
||||
if (nColumns < 2) {
|
||||
/* humm, line didn't contain enough number of commas */
|
||||
/* could be bogus data or blank line. Either way it will */
|
||||
/* cause problems later. We should delete the record */
|
||||
records.splice(i,1);
|
||||
/* now it is gone, but next record has moved up one index */
|
||||
/* so we need to decrement i so that we don't skip over it. */
|
||||
i--;
|
||||
/* Which will work unless the browser javascript for-loop */
|
||||
/* optimizer is buggy (records.length must be calculated each loop) */
|
||||
continue;
|
||||
}
|
||||
var r = records[i];
|
||||
var toExternal = false;
|
||||
var fromExternal = false;
|
||||
var toAndFromInternal = false;
|
||||
var toAndFromExternal = false;
|
||||
var systemCall = false;
|
||||
for (j=0; j<nColumns; j++) {
|
||||
/* Strips quotation marks from each record*/
|
||||
r[j] = r[j].toString().replace(/^[\"]{1}/, "").replace(/[\"]{1}$/, "");
|
||||
if ((j==12) || (j==13)) { /* duration or billable seconds */
|
||||
/* converts seconds to HH:MM:SS. */
|
||||
var s = parseInt(r[j]);
|
||||
var h = Math.floor(s/3600); s = s%3600;
|
||||
var m = Math.floor(s/60); s = s%60;
|
||||
r[j] = h+":"+(m<10?("0"+m):m)+":"+(s<10?("0"+s):s);
|
||||
}
|
||||
else if (j==4) { /* callerID, may have double quotation marks */
|
||||
r[j] = r[j].toString().replace(/\"\"/g, '\"');
|
||||
}
|
||||
else if (j==3) { /* destination context */
|
||||
if (r[j]=="asterisk_guitools") systemCall = true;
|
||||
}
|
||||
else if (j==5) { /* originating channel */
|
||||
var chanName = r[j].substring(r[j].indexOf('/')+1,r[j].lastIndexOf('-'));
|
||||
if (chanName.search('@default')>1) {
|
||||
/* system generated local calls may have @default after name */
|
||||
chanName = chanName.slice(0,chanName.indexOf('@'));
|
||||
}
|
||||
if (intDest.contains(chanName) || (chanName.length == 0)) toExternal = true;
|
||||
else fromExternal = true;
|
||||
}
|
||||
else if (j==6) { /* destination channel */
|
||||
var chanName = r[j].substring(r[j].indexOf('/')+1,r[j].lastIndexOf('-'));
|
||||
if (intDest.contains(chanName) || (chanName.length == 0)) toAndFromInternal = toExternal;
|
||||
else toAndFromExternal = fromExternal;
|
||||
}
|
||||
else if (j==16) { /* Unique ID */
|
||||
if (systemCall) {
|
||||
/* if we just flagged this record as a system call */
|
||||
/* there may be another record that is part of the same */
|
||||
/* system call. If so it will have the same "first" part */
|
||||
/* of unique ID, and the second part will be +/- 1 */
|
||||
/* This will most likely be the immediately prior record */
|
||||
/* which should be an "Internal" call */
|
||||
var UIDParts = r[j].split('.');
|
||||
if (recordsInternal.length>0) {
|
||||
var priorUIDParts = recordsInternal[recordsInternal.length-1][j].split('.');
|
||||
if (UIDParts[0] == priorUIDParts[0]) {
|
||||
recordsSystem.push(recordsInternal.pop());
|
||||
recordsSystem[recordsSystem.length-1].callType = "System";
|
||||
}
|
||||
}
|
||||
}
|
||||
r.uniqueID = r[j];
|
||||
var dup = uniqueIDs.indexOf(r.uniqueID);
|
||||
if (dup >= 0) { /* another CDR record has identical uniqueID! */
|
||||
r.duplicate = dup;
|
||||
records[dup].duplicate = i;
|
||||
}
|
||||
uniqueIDs[i] = r.uniqueID;
|
||||
}
|
||||
}
|
||||
if (systemCall) { r.callType = "System"; recordsSystem.push(r); }
|
||||
else if (toAndFromInternal) { r.callType = "Internal"; recordsInternal.push(r); }
|
||||
else if (toAndFromExternal) { r.callType = "External"; recordsExternal.push(r); }
|
||||
else if (fromExternal) { r.callType = "Inbound"; recordsInbound.push(r); }
|
||||
else { r.callType = "Outbound"; recordsOutbound.push(r); }
|
||||
records[i] = r;
|
||||
|
||||
}
|
||||
sortby = -10; /* start date/time is 10th field in record, negative means descending */
|
||||
maxColumns = Math.min(maxColumns,fields.length-1); /* we don't understand any CDR fields */
|
||||
/* that are after the end of the fields[] array */
|
||||
loadRecords(true);
|
||||
});
|
||||
|
||||
}
|
||||
250
old-asterisk/asterisk/static-http/config/js/dialplans.js
Normal file
@@ -0,0 +1,250 @@
|
||||
/*
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* dialplans.html functions
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*/
|
||||
var isNewDP ;
|
||||
var EDIT_DP ;
|
||||
var cr_chkbxClass = "callingRules_Chkboxes";
|
||||
var CONTEXTS_CR = [] ; // store all callingrule contexts and other standard contexts in this array
|
||||
|
||||
var show_NewDialPlan_form = function(){
|
||||
isNewDP = true;
|
||||
EDIT_DP = '';
|
||||
resetEditForm();
|
||||
$(DOM_Edit_DLPN_DIV).showWithBg();
|
||||
};
|
||||
|
||||
var show_EditDialPlan_form = function(k){
|
||||
isNewDP = false;
|
||||
EDIT_DP = k;
|
||||
resetEditForm();
|
||||
$(DOM_Edit_DLPN_DIV).showWithBg();
|
||||
};
|
||||
|
||||
var delete_DP_confirm = function(k){
|
||||
var ul = parent.pbx.users.list();
|
||||
for( var f=0 ; f < ul.length ; f++ ){
|
||||
if( parent.sessionData.pbxinfo.users[ ul[f] ].getProperty('context') == k ){
|
||||
ASTGUI.feedback( { msg:'Can not delete dialplan !<BR> The selected Dial Plan is in use by one or more users.', showfor:3, color:'red' } );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if( !confirm(' Delete DialPlan ' + k.withOut(ASTGUI.contexts.CallingPlanPrefix) + '?' ) ){ return; }
|
||||
parent.ASTGUI.dialog.waitWhile(' Applying Changes ...');
|
||||
parent.pbx.call_plans.remove(k);
|
||||
var after = function(){
|
||||
ASTGUI.feedback( { msg: 'deleted DialPlan !', showfor: 2 , color: 'blue', bgcolor: '#FFFFFF' } );
|
||||
parent.ASTGUI.dialog.hide();
|
||||
window.location.reload();
|
||||
};
|
||||
setTimeout(after, 700);
|
||||
};
|
||||
|
||||
var edit_DP_save_go = function(){
|
||||
if( !ASTGUI.validateFields([ DOM_edit_dlpn_name ]) ){
|
||||
return ;
|
||||
}
|
||||
if( !ASTGUI.checkRequiredFields([ DOM_edit_dlpn_name ]) ){
|
||||
return ;
|
||||
}
|
||||
|
||||
if (DOM_edit_dlpn_name.value.length > 70) {
|
||||
ASTGUI.feedback({ msg: 'Dialplan name is too long. Please keep it under 70 chars.', showfor: 3, color: 'red'});
|
||||
DOM_edit_dlpn_name.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
var dp_name = DOM_edit_dlpn_name.value;
|
||||
|
||||
if( isNewDP ){ // check if there is already a DialPlan by this name
|
||||
var tmp_dps = parent.pbx.call_plans.list() ;
|
||||
if( tmp_dps.contains( ASTGUI.contexts.CallingPlanPrefix + dp_name ) ){
|
||||
ASTGUI.feedback( { msg:' DialPlan name already in use ! <BR> Please choose another name.', showfor: 3, color:'red' } );
|
||||
DOM_edit_dlpn_name.focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var dp = { includes: ASTGUI.domActions.get_checked(cr_chkbxClass) };
|
||||
dp = ASTGUI.toCustomObject(dp) ;
|
||||
parent.ASTGUI.dialog.waitWhile(' Applying Changes ...');
|
||||
|
||||
var after = function(){
|
||||
parent.ASTGUI.dialog.hide();
|
||||
ASTGUI.feedback( { msg: 'DialPlan updated !', showfor: 2 , color: 'blue', bgcolor: '#FFFFFF' } );
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
var add = function(){
|
||||
if( isNewDP == false && dp_name != EDIT_DP){ // if dialplan name is changed, update any users context who have this dialplan
|
||||
(function(){
|
||||
var ul = parent.pbx.users.list();
|
||||
ul.each(
|
||||
function(user){
|
||||
if( parent.sessionData.pbxinfo.users[user].context == EDIT_DP ){
|
||||
var t = ASTGUI.contexts.CallingPlanPrefix + dp_name ;
|
||||
parent.pbx.users.edit(user, {context: t });
|
||||
}
|
||||
}
|
||||
);
|
||||
})();
|
||||
}
|
||||
parent.pbx.call_plans.add(dp_name, dp , after );
|
||||
};
|
||||
if(isNewDP){
|
||||
add();
|
||||
}else{
|
||||
parent.pbx.call_plans.remove(EDIT_DP);
|
||||
setTimeout(add, 700);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var resetEditForm = function(){
|
||||
if(isNewDP){
|
||||
_$('Edit_dialog_title').innerHTML = 'Create New DialPlan';
|
||||
ASTGUI.domActions.unCheckAll( cr_chkbxClass );
|
||||
ASTGUI.domActions.checkSelected( cr_chkbxClass, ASTGUI.includeContexts ) ;
|
||||
DOM_edit_dlpn_name.value = parent.pbx.call_plans.nextAvailable() ;
|
||||
return ;
|
||||
}
|
||||
|
||||
_$('Edit_dialog_title').innerHTML = 'Edit DialPlan ' ;
|
||||
DOM_edit_dlpn_name.value = EDIT_DP.withOut(ASTGUI.contexts.CallingPlanPrefix);
|
||||
var theseRules = ASTGUI.cloneObject( parent.sessionData.pbxinfo.callingPlans[EDIT_DP].includes ) ;
|
||||
// We really do not need to cloneObject() here
|
||||
// but IE is attaching prototype methods as if they are real methods to any /string / array / Objects in a parent iframe
|
||||
// and when we access them again , we get 'trying to access method from a freed script' error
|
||||
|
||||
ASTGUI.domActions.checkSelected( cr_chkbxClass, theseRules ) ;
|
||||
}
|
||||
|
||||
var set_thisDP_as_default = function(a){
|
||||
ASTGUI.updateaValue({ file: ASTGUI.globals.configfile, context :'general', variable :'default_dialplan', value : a });
|
||||
parent.sessionData.GUI_PREFERENCES.default_dialplan = a;
|
||||
ASTGUI.feedback( { msg: 'Updated default DialPlan !', showfor: 2 , color: 'blue', bgcolor: '#FFFFFF' } );
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
var load_CallingPlansTable = function(){
|
||||
var addCell = ASTGUI.domActions.tr_addCell; // temporarily store the function
|
||||
(function(){ // add first row
|
||||
var newRow = DOM_table_DialPlans_list.insertRow(-1);
|
||||
newRow.className = "frow";
|
||||
addCell( newRow , { html:'Default' } );
|
||||
addCell( newRow , { html:'Dial Plan'} );
|
||||
addCell( newRow , { html:'Calling Rules', width: '610px'} );
|
||||
addCell( newRow , { html:'Options', width: '120px'} );
|
||||
})();
|
||||
|
||||
(function (){
|
||||
var c = parent.pbx.call_plans.list() ;
|
||||
c.each(function(plan){
|
||||
var newRow = DOM_table_DialPlans_list.insertRow(-1);
|
||||
newRow.className = ((DOM_table_DialPlans_list.rows.length)%2==1)?'odd':'even';
|
||||
var img_name = ( parent.sessionData.GUI_PREFERENCES.default_dialplan == plan ) ? 'images/edit.gif' : 'images/checkbox_blank.gif';
|
||||
addCell( newRow , { html: "<A href='#' TITLE='Set this as the default dial plan when creating new users'><img src=" + img_name + " border=0 onclick=\"set_thisDP_as_default('" + plan +"')\"></A>" } );
|
||||
addCell( newRow , { html: plan.withOut( ASTGUI.contexts.CallingPlanPrefix )});
|
||||
|
||||
var dr_woPfx = [] ;
|
||||
var this_includes = parent.sessionData.pbxinfo.callingPlans[plan].includes;
|
||||
try{
|
||||
for (var k = 0 ; k < this_includes.length ; k++){
|
||||
var k_each = this_includes[k] ;
|
||||
if( CONTEXTS_CR.contains(k_each) ){
|
||||
dr_woPfx.push( k_each.lChop(ASTGUI.contexts.CallingRulePrefix) );
|
||||
}else{
|
||||
dr_woPfx.push( '<font color=red>' + k_each.lChop(ASTGUI.contexts.CallingRulePrefix) + '?</font>' );
|
||||
}
|
||||
}
|
||||
}catch(err){
|
||||
top.log.error(err.description);
|
||||
}
|
||||
|
||||
addCell( newRow , { html: dr_woPfx.join(', ') } );
|
||||
|
||||
var tmp = "<span class='guiButton' onclick=\"show_EditDialPlan_form('" + plan +"')\">Edit</span>" +
|
||||
"<span class='guiButtonDelete' onclick=\"delete_DP_confirm('" + plan +"')\">Delete</span>" ;
|
||||
addCell( newRow , { html: tmp } );
|
||||
});
|
||||
|
||||
if(DOM_table_DialPlans_list.rows.length == 1){
|
||||
ASTGUI.domActions.clear_table(DOM_table_DialPlans_list);
|
||||
var newRow = DOM_table_DialPlans_list.insertRow(-1);
|
||||
newRow.className = 'even';
|
||||
addCell( newRow , { html:'No DialPlans defined !!'} );
|
||||
return ;
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
var load_callingRules_checkboxes = function(){
|
||||
|
||||
var g = parent.sessionData.pbxinfo.callingRules.getOwnProperties() ;
|
||||
var f = {};
|
||||
g.each(function(rule){
|
||||
f[rule] = rule.withOut(ASTGUI.contexts.CallingRulePrefix);
|
||||
CONTEXTS_CR.push(rule);
|
||||
});
|
||||
if( CONTEXTS_CR.length ){
|
||||
ASTGUI.domActions.populateCheckBoxes( DOM_edit_includeCheckboxes_div , f, cr_chkbxClass);
|
||||
}else{
|
||||
|
||||
var tmp_span = document.createElement('span');
|
||||
tmp_span.innerHTML = 'You do not have any calling Rules defined !<BR> <A href=#>click here</A> to manage calling rules.';
|
||||
$(DOM_edit_includeCheckboxes_div).css( 'border', '1px solid #CDCDCD' );
|
||||
$(DOM_edit_includeCheckboxes_div).css( 'text-align', 'center' );
|
||||
|
||||
ASTGUI.events.add( tmp_span , 'click' , function(){
|
||||
$(DOM_Edit_DLPN_DIV).hideWithBg();
|
||||
parent.miscFunctions.click_panel('callingrules.html');
|
||||
} );
|
||||
|
||||
DOM_edit_includeCheckboxes_div.appendChild(tmp_span);
|
||||
}
|
||||
var f = {};
|
||||
ASTGUI.includeContexts.each( function(ct){ f[ct] = ct; CONTEXTS_CR.push(ct); });
|
||||
ASTGUI.domActions.populateCheckBoxes( DOM_edit_LC_includeCheckboxes_div , f, cr_chkbxClass);
|
||||
};
|
||||
|
||||
|
||||
function localajaxinit(){
|
||||
top.document.title = 'Manage Dialplans' ;
|
||||
// show list of dialplans
|
||||
// - each dialplan is a set of calling rules
|
||||
// OnEdit show Checkboxes - which are ticked
|
||||
DOM_table_DialPlans_list = _$('table_DialPlans_list');
|
||||
DOM_Edit_DLPN_DIV = _$('Edit_DLPN_DIV');
|
||||
DOM_edit_dlpn_name = _$('edit_dlpn_name');
|
||||
DOM_edit_includeCheckboxes_div = _$('edit_includeCheckboxes_div');
|
||||
DOM_edit_LC_includeCheckboxes_div = _$('edit_LC_includeCheckboxes_div');
|
||||
|
||||
load_callingRules_checkboxes();
|
||||
load_CallingPlansTable();
|
||||
|
||||
(function(){
|
||||
var t = context2json({ filename: ASTGUI.globals.configfile , context : 'general' , usf:1 });
|
||||
parent.sessionData.GUI_PREFERENCES.default_dialplan = t.getProperty('default_dialplan');
|
||||
})();
|
||||
};
|
||||
509
old-asterisk/asterisk/static-http/config/js/effects.core.js
Normal file
@@ -0,0 +1,509 @@
|
||||
/*
|
||||
* jQuery UI Effects 1.5.3
|
||||
*
|
||||
* Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/
|
||||
*/
|
||||
;(function($) {
|
||||
|
||||
$.effects = $.effects || {}; //Add the 'effects' scope
|
||||
|
||||
$.extend($.effects, {
|
||||
save: function(el, set) {
|
||||
for(var i=0;i<set.length;i++) {
|
||||
if(set[i] !== null) $.data(el[0], "ec.storage."+set[i], el[0].style[set[i]]);
|
||||
}
|
||||
},
|
||||
restore: function(el, set) {
|
||||
for(var i=0;i<set.length;i++) {
|
||||
if(set[i] !== null) el.css(set[i], $.data(el[0], "ec.storage."+set[i]));
|
||||
}
|
||||
},
|
||||
setMode: function(el, mode) {
|
||||
if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle
|
||||
return mode;
|
||||
},
|
||||
getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value
|
||||
// this should be a little more flexible in the future to handle a string & hash
|
||||
var y, x;
|
||||
switch (origin[0]) {
|
||||
case 'top': y = 0; break;
|
||||
case 'middle': y = 0.5; break;
|
||||
case 'bottom': y = 1; break;
|
||||
default: y = origin[0] / original.height;
|
||||
};
|
||||
switch (origin[1]) {
|
||||
case 'left': x = 0; break;
|
||||
case 'center': x = 0.5; break;
|
||||
case 'right': x = 1; break;
|
||||
default: x = origin[1] / original.width;
|
||||
};
|
||||
return {x: x, y: y};
|
||||
},
|
||||
createWrapper: function(el) {
|
||||
if (el.parent().attr('id') == 'fxWrapper')
|
||||
return el;
|
||||
var props = {width: el.outerWidth({margin:true}), height: el.outerHeight({margin:true}), 'float': el.css('float')};
|
||||
el.wrap('<div id="fxWrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');
|
||||
var wrapper = el.parent();
|
||||
if (el.css('position') == 'static'){
|
||||
wrapper.css({position: 'relative'});
|
||||
el.css({position: 'relative'});
|
||||
} else {
|
||||
var top = el.css('top'); if(isNaN(parseInt(top))) top = 'auto';
|
||||
var left = el.css('left'); if(isNaN(parseInt(left))) left = 'auto';
|
||||
wrapper.css({ position: el.css('position'), top: top, left: left, zIndex: el.css('z-index') }).show();
|
||||
el.css({position: 'relative', top:0, left:0});
|
||||
}
|
||||
wrapper.css(props);
|
||||
return wrapper;
|
||||
},
|
||||
removeWrapper: function(el) {
|
||||
if (el.parent().attr('id') == 'fxWrapper')
|
||||
return el.parent().replaceWith(el);
|
||||
return el;
|
||||
},
|
||||
setTransition: function(el, list, factor, val) {
|
||||
val = val || {};
|
||||
$.each(list,function(i, x){
|
||||
unit = el.cssUnit(x);
|
||||
if (unit[0] > 0) val[x] = unit[0] * factor + unit[1];
|
||||
});
|
||||
return val;
|
||||
},
|
||||
animateClass: function(value, duration, easing, callback) {
|
||||
|
||||
var cb = (typeof easing == "function" ? easing : (callback ? callback : null));
|
||||
var ea = (typeof easing == "object" ? easing : null);
|
||||
|
||||
return this.each(function() {
|
||||
|
||||
var offset = {}; var that = $(this); var oldStyleAttr = that.attr("style") || '';
|
||||
if(typeof oldStyleAttr == 'object') oldStyleAttr = oldStyleAttr["cssText"]; /* Stupidly in IE, style is a object.. */
|
||||
if(value.toggle) { that.hasClass(value.toggle) ? value.remove = value.toggle : value.add = value.toggle; }
|
||||
|
||||
//Let's get a style offset
|
||||
var oldStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
|
||||
if(value.add) that.addClass(value.add); if(value.remove) that.removeClass(value.remove);
|
||||
var newStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
|
||||
if(value.add) that.removeClass(value.add); if(value.remove) that.addClass(value.remove);
|
||||
|
||||
// The main function to form the object for animation
|
||||
for(var n in newStyle) {
|
||||
if( typeof newStyle[n] != "function" && newStyle[n] /* No functions and null properties */
|
||||
&& n.indexOf("Moz") == -1 && n.indexOf("length") == -1 /* No mozilla spezific render properties. */
|
||||
&& newStyle[n] != oldStyle[n] /* Only values that have changed are used for the animation */
|
||||
&& (n.match(/color/i) || (!n.match(/color/i) && !isNaN(parseInt(newStyle[n],10)))) /* Only things that can be parsed to integers or colors */
|
||||
&& (oldStyle.position != "static" || (oldStyle.position == "static" && !n.match(/left|top|bottom|right/))) /* No need for positions when dealing with static positions */
|
||||
) offset[n] = newStyle[n];
|
||||
}
|
||||
|
||||
that.animate(offset, duration, ea, function() { // Animate the newly constructed offset object
|
||||
// Change style attribute back to original. For stupid IE, we need to clear the damn object.
|
||||
if(typeof $(this).attr("style") == 'object') { $(this).attr("style")["cssText"] = ""; $(this).attr("style")["cssText"] = oldStyleAttr; } else $(this).attr("style", oldStyleAttr);
|
||||
if(value.add) $(this).addClass(value.add); if(value.remove) $(this).removeClass(value.remove);
|
||||
if(cb) cb.apply(this, arguments);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//Extend the methods of jQuery
|
||||
$.fn.extend({
|
||||
//Save old methods
|
||||
_show: $.fn.show,
|
||||
_hide: $.fn.hide,
|
||||
__toggle: $.fn.toggle,
|
||||
_addClass: $.fn.addClass,
|
||||
_removeClass: $.fn.removeClass,
|
||||
_toggleClass: $.fn.toggleClass,
|
||||
// New ec methods
|
||||
effect: function(fx,o,speed,callback) {
|
||||
return $.effects[fx] ? $.effects[fx].call(this, {method: fx, options: o || {}, duration: speed, callback: callback }) : null;
|
||||
},
|
||||
show: function() {
|
||||
if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])))
|
||||
return this._show.apply(this, arguments);
|
||||
else {
|
||||
var o = arguments[1] || {}; o['mode'] = 'show';
|
||||
return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
|
||||
}
|
||||
},
|
||||
hide: function() {
|
||||
if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])))
|
||||
return this._hide.apply(this, arguments);
|
||||
else {
|
||||
var o = arguments[1] || {}; o['mode'] = 'hide';
|
||||
return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
|
||||
}
|
||||
},
|
||||
toggle: function(){
|
||||
if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])) || (arguments[0].constructor == Function))
|
||||
return this.__toggle.apply(this, arguments);
|
||||
else {
|
||||
var o = arguments[1] || {}; o['mode'] = 'toggle';
|
||||
return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
|
||||
}
|
||||
},
|
||||
addClass: function(classNames,speed,easing,callback) {
|
||||
return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);
|
||||
},
|
||||
removeClass: function(classNames,speed,easing,callback) {
|
||||
return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames);
|
||||
},
|
||||
toggleClass: function(classNames,speed,easing,callback) {
|
||||
return speed ? $.effects.animateClass.apply(this, [{ toggle: classNames },speed,easing,callback]) : this._toggleClass(classNames);
|
||||
},
|
||||
morph: function(remove,add,speed,easing,callback) {
|
||||
return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]);
|
||||
},
|
||||
switchClass: function() {
|
||||
return this.morph.apply(this, arguments);
|
||||
},
|
||||
// helper functions
|
||||
cssUnit: function(key) {
|
||||
var style = this.css(key), val = [];
|
||||
$.each( ['em','px','%','pt'], function(i, unit){
|
||||
if(style.indexOf(unit) > 0)
|
||||
val = [parseFloat(style), unit];
|
||||
});
|
||||
return val;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* jQuery Color Animations
|
||||
* Copyright 2007 John Resig
|
||||
* Released under the MIT and GPL licenses.
|
||||
*/
|
||||
|
||||
// We override the animation for all of these color styles
|
||||
jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
|
||||
jQuery.fx.step[attr] = function(fx){
|
||||
if ( fx.state == 0 ) {
|
||||
fx.start = getColor( fx.elem, attr );
|
||||
fx.end = getRGB( fx.end );
|
||||
}
|
||||
|
||||
fx.elem.style[attr] = "rgb(" + [
|
||||
Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
|
||||
Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
|
||||
Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
|
||||
].join(",") + ")";
|
||||
}
|
||||
});
|
||||
|
||||
// Color Conversion functions from highlightFade
|
||||
// By Blair Mitchelmore
|
||||
// http://jquery.offput.ca/highlightFade/
|
||||
|
||||
// Parse strings looking for color tuples [255,255,255]
|
||||
function getRGB(color) {
|
||||
var result;
|
||||
|
||||
// Check if we're already dealing with an array of colors
|
||||
if ( color && color.constructor == Array && color.length == 3 )
|
||||
return color;
|
||||
|
||||
// Look for rgb(num,num,num)
|
||||
if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
|
||||
return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];
|
||||
|
||||
// Look for rgb(num%,num%,num%)
|
||||
if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
|
||||
return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
|
||||
|
||||
// Look for #a0b1c2
|
||||
if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
|
||||
return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
|
||||
|
||||
// Look for #fff
|
||||
if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
|
||||
return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
|
||||
|
||||
// Look for rgba(0, 0, 0, 0) == transparent in Safari 3
|
||||
if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
|
||||
return colors['transparent']
|
||||
|
||||
// Otherwise, we're most likely dealing with a named color
|
||||
return colors[jQuery.trim(color).toLowerCase()];
|
||||
}
|
||||
|
||||
function getColor(elem, attr) {
|
||||
var color;
|
||||
|
||||
do {
|
||||
color = jQuery.curCSS(elem, attr);
|
||||
|
||||
// Keep going until we find an element that has color, or we hit the body
|
||||
if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
|
||||
break;
|
||||
|
||||
attr = "backgroundColor";
|
||||
} while ( elem = elem.parentNode );
|
||||
|
||||
return getRGB(color);
|
||||
};
|
||||
|
||||
// Some named colors to work with
|
||||
// From Interface by Stefan Petre
|
||||
// http://interface.eyecon.ro/
|
||||
|
||||
var colors = {
|
||||
aqua:[0,255,255],
|
||||
azure:[240,255,255],
|
||||
beige:[245,245,220],
|
||||
black:[0,0,0],
|
||||
blue:[0,0,255],
|
||||
brown:[165,42,42],
|
||||
cyan:[0,255,255],
|
||||
darkblue:[0,0,139],
|
||||
darkcyan:[0,139,139],
|
||||
darkgrey:[169,169,169],
|
||||
darkgreen:[0,100,0],
|
||||
darkkhaki:[189,183,107],
|
||||
darkmagenta:[139,0,139],
|
||||
darkolivegreen:[85,107,47],
|
||||
darkorange:[255,140,0],
|
||||
darkorchid:[153,50,204],
|
||||
darkred:[139,0,0],
|
||||
darksalmon:[233,150,122],
|
||||
darkviolet:[148,0,211],
|
||||
fuchsia:[255,0,255],
|
||||
gold:[255,215,0],
|
||||
green:[0,128,0],
|
||||
indigo:[75,0,130],
|
||||
khaki:[240,230,140],
|
||||
lightblue:[173,216,230],
|
||||
lightcyan:[224,255,255],
|
||||
lightgreen:[144,238,144],
|
||||
lightgrey:[211,211,211],
|
||||
lightpink:[255,182,193],
|
||||
lightyellow:[255,255,224],
|
||||
lime:[0,255,0],
|
||||
magenta:[255,0,255],
|
||||
maroon:[128,0,0],
|
||||
navy:[0,0,128],
|
||||
olive:[128,128,0],
|
||||
orange:[255,165,0],
|
||||
pink:[255,192,203],
|
||||
purple:[128,0,128],
|
||||
violet:[128,0,128],
|
||||
red:[255,0,0],
|
||||
silver:[192,192,192],
|
||||
white:[255,255,255],
|
||||
yellow:[255,255,0],
|
||||
transparent: [255,255,255]
|
||||
};
|
||||
|
||||
/*
|
||||
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
||||
*
|
||||
* Uses the built in easing capabilities added In jQuery 1.1
|
||||
* to offer multiple easing options
|
||||
*
|
||||
* TERMS OF USE - jQuery Easing
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2008 George McGinley Smith
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
// t: current time, b: begInnIng value, c: change In value, d: duration
|
||||
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
||||
|
||||
jQuery.extend( jQuery.easing,
|
||||
{
|
||||
def: 'easeOutQuad',
|
||||
swing: function (x, t, b, c, d) {
|
||||
//alert(jQuery.easing.default);
|
||||
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
||||
},
|
||||
easeInQuad: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t + b;
|
||||
},
|
||||
easeOutQuad: function (x, t, b, c, d) {
|
||||
return -c *(t/=d)*(t-2) + b;
|
||||
},
|
||||
easeInOutQuad: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t + b;
|
||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||
},
|
||||
easeInCubic: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t + b;
|
||||
},
|
||||
easeOutCubic: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t + 1) + b;
|
||||
},
|
||||
easeInOutCubic: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t + 2) + b;
|
||||
},
|
||||
easeInQuart: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t + b;
|
||||
},
|
||||
easeOutQuart: function (x, t, b, c, d) {
|
||||
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
||||
},
|
||||
easeInOutQuart: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
||||
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
||||
},
|
||||
easeInQuint: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t*t + b;
|
||||
},
|
||||
easeOutQuint: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
||||
},
|
||||
easeInOutQuint: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
||||
},
|
||||
easeInSine: function (x, t, b, c, d) {
|
||||
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
||||
},
|
||||
easeOutSine: function (x, t, b, c, d) {
|
||||
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
||||
},
|
||||
easeInOutSine: function (x, t, b, c, d) {
|
||||
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
||||
},
|
||||
easeInExpo: function (x, t, b, c, d) {
|
||||
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
||||
},
|
||||
easeOutExpo: function (x, t, b, c, d) {
|
||||
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
||||
},
|
||||
easeInOutExpo: function (x, t, b, c, d) {
|
||||
if (t==0) return b;
|
||||
if (t==d) return b+c;
|
||||
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
||||
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
||||
},
|
||||
easeInCirc: function (x, t, b, c, d) {
|
||||
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
||||
},
|
||||
easeOutCirc: function (x, t, b, c, d) {
|
||||
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
||||
},
|
||||
easeInOutCirc: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
||||
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
||||
},
|
||||
easeInElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
},
|
||||
easeOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
||||
},
|
||||
easeInOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
||||
},
|
||||
easeInBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*(t/=d)*t*((s+1)*t - s) + b;
|
||||
},
|
||||
easeOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
||||
},
|
||||
easeInOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
||||
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
||||
},
|
||||
easeInBounce: function (x, t, b, c, d) {
|
||||
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
||||
},
|
||||
easeOutBounce: function (x, t, b, c, d) {
|
||||
if ((t/=d) < (1/2.75)) {
|
||||
return c*(7.5625*t*t) + b;
|
||||
} else if (t < (2/2.75)) {
|
||||
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
||||
} else if (t < (2.5/2.75)) {
|
||||
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
||||
} else {
|
||||
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
||||
}
|
||||
},
|
||||
easeInOutBounce: function (x, t, b, c, d) {
|
||||
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
||||
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
*
|
||||
* TERMS OF USE - EASING EQUATIONS
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2001 Robert Penner
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* jQuery UI Effects Highlight
|
||||
*
|
||||
* Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Highlight
|
||||
*
|
||||
* Depends:
|
||||
* effects.core.js
|
||||
*/
|
||||
;(function($) {
|
||||
|
||||
$.effects.highlight = function(o) {
|
||||
|
||||
return this.queue(function() {
|
||||
|
||||
// Create element
|
||||
var el = $(this), props = ['backgroundImage','backgroundColor','opacity'];
|
||||
|
||||
// Set options
|
||||
var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
|
||||
var color = o.options.color || "#ffff99"; // Default highlight color
|
||||
var oldColor = el.css("backgroundColor");
|
||||
|
||||
// Adjust
|
||||
$.effects.save(el, props); el.show(); // Save & Show
|
||||
el.css({backgroundImage: 'none', backgroundColor: color}); // Shift
|
||||
|
||||
// Animation
|
||||
var animation = {backgroundColor: oldColor };
|
||||
if (mode == "hide") animation['opacity'] = 0;
|
||||
|
||||
// Animate
|
||||
el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
|
||||
if(mode == "hide") el.hide();
|
||||
$.effects.restore(el, props);
|
||||
if (mode == "show" && jQuery.browser.msie) this.style.removeAttribute('filter');
|
||||
if(o.callback) o.callback.apply(this, arguments);
|
||||
el.dequeue();
|
||||
}});
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
656
old-asterisk/asterisk/static-http/config/js/features.js
Normal file
@@ -0,0 +1,656 @@
|
||||
/* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* Call Features javascript
|
||||
*
|
||||
* Copyright (C) 2007-2008, Digium, Inc.
|
||||
*
|
||||
* Ryan Brindley <rbrindley@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*/
|
||||
var exten_conf;
|
||||
var feat_conf;
|
||||
var gui_conf;
|
||||
var amap_table = $('#application_map_list tbody');
|
||||
var amap_enabled = [];
|
||||
var amap_orig_name;
|
||||
var vals = {};
|
||||
var dial_options;
|
||||
var dial_options_list = ['t', 'T', 'h', 'H', 'k', 'K'];
|
||||
var apps = [ 'Answer', 'Background', 'Busy', 'Congestion', 'DigitTimeout', 'DISA', 'ResponseTimeout', 'Playback' , 'UserEvent' , 'Wait', 'WaitExten', 'Hangup' ];
|
||||
|
||||
/**
|
||||
* function to edit options
|
||||
* @param obj the DOM object
|
||||
*/
|
||||
var edit = function(obj) {
|
||||
vals[obj.attr('id')] = obj.val();
|
||||
if (typeof edit_funcs[obj.attr('id')] !== 'function') {
|
||||
top.log.error('edit: edit_funcs["' + obj.attr('id') + '"] is not a function.');
|
||||
updateMsg(obj, 'error', 'Error: Edit function was not found.');
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
edit_funcs[obj.attr('id')](obj.val());
|
||||
updateMsg(obj, 'edit');
|
||||
} catch(e) {
|
||||
switch (e.name) {
|
||||
case 'ShouldRemoveException':
|
||||
updateMsg(obj, 'error', 'Error: Should be removed instead.');
|
||||
default:
|
||||
updateMsg(obj, 'error', e.message);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* object to hold all the (asterisk) editing/removing functions.
|
||||
* This is done instead of generalizing them into sectioned objects
|
||||
* because the layout/sections/organization may change.
|
||||
* NOTE: only dial options use remove_funcs, removing for the others
|
||||
* is just their edit_func with '' as the val
|
||||
*/
|
||||
var edit_funcs = {};
|
||||
var remove_funcs = {};
|
||||
|
||||
edit_funcs['feature_featuredigittimeout'] = function(val) {
|
||||
/* lets validate the val */
|
||||
validate(val, {num: true, positive: true});
|
||||
|
||||
/* kk, all good, now update asterisk and go */
|
||||
return sendUpdate({cxt: 'general', name: 'featuredigittimeout', val: val});
|
||||
};
|
||||
|
||||
edit_funcs['parkext'] = function(val) {
|
||||
/* lets validate */
|
||||
validate(val, {num: true, positive: true, extens: true});
|
||||
|
||||
/* custom validation to make sure it doesn't step over parkpos */
|
||||
var parkpos = $('#parkpos').val();
|
||||
parkpos = parkpos.split('-');
|
||||
parkpos[0] = parseInt(parkpos[0], 10);
|
||||
parkpos[1] = parseInt(parkpos[1], 10);
|
||||
/* return error if parkpos is properly defined and val is inbetween the parkpos numbers */
|
||||
if (!isNaN(parkpos[0]) && !isNaN(parkpos[1]) && val >= parkpos[0] && val <= parkpos[1]) {
|
||||
throw RangeError('Invalid: Conflicts with Parked Call extensions (' + parkpos[0] + '-' + parkpos[1] + ').');
|
||||
}
|
||||
|
||||
/* kk, all good, now update asterisk and go */
|
||||
return sendUpdate({cxt: 'general', name: 'parkext', val: val});
|
||||
};
|
||||
|
||||
edit_funcs['parkpos'] = function(val) {
|
||||
/* validate special format */
|
||||
if (!val.match(/^[0-9][0-9]*\-[0-9][0-9]*$/)) {
|
||||
throw TypeError('Invalid: Please use "<num>-<num>" format');
|
||||
}
|
||||
|
||||
/* lets split */
|
||||
var splits = val.split('-');
|
||||
var pos_start = parseInt(splits[0], 10);
|
||||
var pos_end = parseInt(splits[1], 10);
|
||||
|
||||
/* now lets validate the start and end */
|
||||
validate(pos_start, {num: true, positive: true});
|
||||
validate(pos_end, {num: true, positive: true});
|
||||
|
||||
/* we need to do a special validate for extens */
|
||||
gui_conf = context2json({
|
||||
filename: 'guipreferences.conf',
|
||||
context: 'general',
|
||||
usf: 1
|
||||
});
|
||||
var prefs = {ue: 'User Extensions', mm: 'Conference Extensions', qe: 'Queue Extensions', vme: 'Voicemail Extensions', rge: 'Ring Group Extensions', vmg: 'Voicemail Group Extensions'};
|
||||
for (pref in prefs) {
|
||||
if (!prefs.hasOwnProperty(pref)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var start = gui_conf[pref + '_start'];
|
||||
var end = gui_conf[pref + '_end'];
|
||||
|
||||
if ((pos_start >= start && pos_start <= end) || (pos_end >= start && pos_end <= end) || (pos_start < start && pos_end >= start)) {
|
||||
top.log.warn('edit_funcs[\'parkext\']: conflicts with ' + pref + '.');
|
||||
throw RangeError('Invalid: Conflicts with ' + prefs[pref] + ' range, ' + start + '-' + end);
|
||||
}
|
||||
}
|
||||
|
||||
/* kk, all good, now update asterisk and go */
|
||||
return sendUpdate({cxt: 'general', name: 'parkpos', val: val});
|
||||
}
|
||||
|
||||
edit_funcs['parkingtime'] = function(val) {
|
||||
/* lets validate */
|
||||
validate(val, {num: true, positive: true});
|
||||
|
||||
/* kk, all good, now update asterisk and go */
|
||||
return sendUpdate({cxt: 'general', name: 'parkingtime', val: val});
|
||||
};
|
||||
|
||||
edit_funcs['fmap_blindxfer'] = function(val) {
|
||||
/* lets validate */
|
||||
validate(val, {keypress: true});
|
||||
|
||||
/* kk, all good, now update asterisk and go */
|
||||
return sendUpdate({cxt: 'featuremap', name: 'blindxfer', val: val});
|
||||
};
|
||||
|
||||
edit_funcs['fmap_disconnect'] = function(val) {
|
||||
/* lets validate */
|
||||
validate(val, {keypress: true});
|
||||
|
||||
/* kk, all good, now update asterisk and go */
|
||||
return sendUpdate({cxt: 'featuremap', name: 'disconnect', val: val});
|
||||
};
|
||||
|
||||
edit_funcs['fmap_atxfer'] = function(val) {
|
||||
/* lets validate */
|
||||
validate(val, {keypress: true});
|
||||
|
||||
/* kk, all good, now update asterisk and go */
|
||||
return sendUpdate({cxt: 'featuremap', name: 'atxfer', val: val});
|
||||
};
|
||||
|
||||
edit_funcs['fmap_parkcall'] = function(val) {
|
||||
/* lets validate */
|
||||
validate(val, {keypress: true});
|
||||
|
||||
/* kk, all good, now update asterisk and go */
|
||||
return sendUpdate({cxt: 'featuremap', name: 'parkcall', val: val});
|
||||
};
|
||||
|
||||
/* dynamically define all the dial options edit/remove funcs since there the same */
|
||||
for (var i=0; i<dial_options_list.length; i++) {
|
||||
edit_funcs['dial_'+dial_options_list[i]] = function(val) {
|
||||
top.pbx.dial_options.add(val);
|
||||
}
|
||||
remove_funcs['dial_'+dial_options_list[i]] = function(val) {
|
||||
top.pbx.dial_options.remove(val);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function to load options
|
||||
*/
|
||||
var load = function() {
|
||||
exten_conf = context2json({
|
||||
filename: 'extensions.conf',
|
||||
context: 'globals',
|
||||
usf: 1
|
||||
});
|
||||
|
||||
var dial_options = exten_conf['DIALOPTIONS'] || '';
|
||||
|
||||
if (exten_conf['FEATURES'] && exten_conf['FEATURES'].length) {
|
||||
amap_enabled = exten_conf['FEATURES'].split('#');
|
||||
}
|
||||
|
||||
/* set all the enabled dial options to checked */
|
||||
dial_opts = dial_options.split('');
|
||||
for (var i=0; i<dial_opts.length; i++) {
|
||||
$('#dial_'+dial_opts[i]).attr('checked', 'checked').parents('.feature').removeClass('disabled');
|
||||
}
|
||||
|
||||
feat_conf = config2json({
|
||||
filename: 'features.conf',
|
||||
usf: 1
|
||||
});
|
||||
|
||||
if (!feat_conf['general'] || !feat_conf['featuremap'] || !feat_conf['applicationmap']) {
|
||||
var u = new listOfSynActions('features.conf');
|
||||
if( !feat_conf.hasOwnProperty('general') ) {
|
||||
u.new_action('newcat', 'general', '', '');
|
||||
}
|
||||
if( !feat_conf.hasOwnProperty('featuremap') ) {
|
||||
u.new_action('newcat', 'feature_map', '', '');
|
||||
}
|
||||
if( !feat_conf.hasOwnProperty('applicationmap') ) {
|
||||
u.new_action('newcat', 'applicationmap', '', '');
|
||||
}
|
||||
u.callActions();
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
|
||||
/* look through the features in feature_map and get the values from features.conf */
|
||||
$('#feature_map > .feature > :text').each(function() {
|
||||
var vari = $(this).attr('id').split('_')[1];
|
||||
$(this).val(feat_conf['featuremap'][vari]);
|
||||
if (feat_conf['featuremap'][vari]) {
|
||||
$(this).parents('.feature').removeClass('disabled');
|
||||
}
|
||||
});
|
||||
/* look through the features in call_parking and get the values from features.conf */
|
||||
$('#call_parking > .feature > :text').each(function() {
|
||||
var vari = $(this).attr('id');
|
||||
$(this).val(feat_conf['general'][vari]);
|
||||
if (feat_conf['general'][vari]) {
|
||||
$(this).parents('.feature').removeClass('disabled');
|
||||
}
|
||||
});
|
||||
/* look through the features in feature_options and get the values from features.conf */
|
||||
$('#feature_options > .feature > :text').each(function() {
|
||||
var vari = $(this).attr('id').split('_')[1];
|
||||
$(this).val(feat_conf['general'][vari]);
|
||||
if (feat_conf['general'][vari]) {
|
||||
$(this).parents('.feature').removeClass('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
var amap = feat_conf['applicationmap'];
|
||||
for (var name in amap) {
|
||||
if (!amap.hasOwnProperty(name)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
listAmap(name);
|
||||
}
|
||||
|
||||
if (amap_table.find('tr:not(.template)').length === 0) {
|
||||
var row = $('<tr>').attr('colspan', '7').addClass('noapps').html('No Application Maps Defined.');
|
||||
amap_table.append(row);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var listAmap = function(name) {
|
||||
/* is it new or not? */
|
||||
if (name) {
|
||||
/* list an existing amap */
|
||||
var amap_fields = feat_conf['applicationmap'][name].split(',');
|
||||
} else {
|
||||
/* set a new amap default values */
|
||||
name = '';
|
||||
var amap_fields = ['', 'self', '', ''];
|
||||
}
|
||||
|
||||
if (amap_table.find('tr:not(.template)').length) {
|
||||
amap_table.find('tr.noapps').remove();
|
||||
}
|
||||
|
||||
var row = $('#application_map_list > tbody > tr.template').clone();
|
||||
/* only set id if its an existing amap */
|
||||
/* only check for enabled if its an existing amap */
|
||||
if (name !== '') {
|
||||
row.attr('id', 'amap_' + name);
|
||||
row.find('.enabled :checkbox').attr('checked', (amap_enabled.contains(name)?true:false));
|
||||
}
|
||||
row.find('.name :text').attr('value', name);
|
||||
row.find('.digits :text').attr('value', amap_fields[0]);
|
||||
row.find('.active option[value='+amap_fields[1]+']').attr('selected', true);
|
||||
row.find('.app_name :text')
|
||||
.attr('value', amap_fields[2])
|
||||
.autocomplete(apps, {
|
||||
autoFill: true,
|
||||
width: 150
|
||||
});
|
||||
row.find('.app_args :text').attr('value', amap_fields[3]);
|
||||
amap_table.append(row);
|
||||
row.removeClass('template');
|
||||
};
|
||||
|
||||
/**
|
||||
* create a new application map row
|
||||
*/
|
||||
var newAmap = function() {
|
||||
listAmap('');
|
||||
};
|
||||
|
||||
var editAmap = function(obj) {
|
||||
var vali = '';
|
||||
var resp;
|
||||
|
||||
/* get the variables */
|
||||
obj = obj.parents('tr');
|
||||
var enabled = obj.find('.enabled > input').attr('checked');
|
||||
var name = obj.find('.name > :text').val();
|
||||
var digits = obj.find('.digits > :text').val();
|
||||
var active = obj.find('.active option:selected').val();
|
||||
var app_name = obj.find('.app_name :text').val();
|
||||
var app_args = obj.find('.app_args :text').val();
|
||||
|
||||
if (!validateAmap(obj, {name: name, digits: digits, app_name: app_name}, true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* generate the applicationmap string */
|
||||
var value = [digits, active, app_name, app_args].join();
|
||||
|
||||
/* time to upload to Asterisk */
|
||||
var actions = listOfSynActions('features.conf');
|
||||
if (obj.attr('id').substring(5) !== name) {
|
||||
actions.new_action('delete', 'applicationmap', obj.attr('id').substring(5), '');
|
||||
}
|
||||
actions.new_action('update', 'applicationmap', name, value);
|
||||
|
||||
resp = actions.callActions();
|
||||
if (!resp.contains('Response: Success')) {
|
||||
top.log.error('editAmap: error updating features.conf');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
actions.clearActions('extensions.conf');
|
||||
resp = '';
|
||||
|
||||
if (obj.attr('id') !== '') {
|
||||
amap_enabled.splice(amap_enabled.indexOf(obj.attr('id').substring('5'), 1));
|
||||
}
|
||||
amap_enabled.push(name);
|
||||
actions.new_action('update', 'globals', 'FEATURES', amap_enabled.join('#'));
|
||||
|
||||
resp = actions.callActions();
|
||||
if (!resp.contains('Response: Success')) {
|
||||
top.log.error('editAmap: error updating features.conf');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
obj.attr('id', 'name');
|
||||
return true;
|
||||
};
|
||||
|
||||
var disableAmap = function(obj) {
|
||||
/* if it doesn't exist, do nothing */
|
||||
if (!amap_enabled.contains(obj.parents('tr').attr('id').substring(5))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* remove from list and make string */
|
||||
amap_enabled.splice(amap_enabled.indexOf(obj.parents('tr').attr('id').substring(5)), 1);
|
||||
var str = amap_enabled.join('#');
|
||||
|
||||
/* update Asterisk */
|
||||
var actions = new listOfSynActions('extensions.conf');
|
||||
actions.new_action('update', 'globals', 'FEATURES', str);
|
||||
|
||||
var resp = actions.callActions();
|
||||
if (!resp.contains('Response: Success')) {
|
||||
top.log.error('disableAmap: error updating extensions.conf.');
|
||||
top.log.error(resp);
|
||||
amap_enabled.push(obj.parents('tr').attr('id').substring(5));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
var enableAmap = function(obj) {
|
||||
/* if it already exists, do nothing */
|
||||
if (amap_enabled.contains(obj.parents('tr').attr('id').substring(5))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* add to list and make string */
|
||||
amap_enabled.push(obj.parents('tr').attr('id').substring(5));
|
||||
var str = amap_enabled.join('#');
|
||||
|
||||
/* update Asterisk */
|
||||
var actions = new listOfSynActions('extensions.conf');
|
||||
actions.new_action('update', 'globals', 'FEATURES', str);
|
||||
|
||||
var resp = actions.callActions();
|
||||
if (!resp.contains('Response: Success')) {
|
||||
top.log.error('enableAmap: error updating extensions.conf.');
|
||||
top.log.error(resp);
|
||||
amap_enabled.splice(amap_enabled.indexOf(obj.parents('tr').attr('id').substring(5)), 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
var removeAmap = function(obj) {
|
||||
/* if this doesn't have an id, its most likely a 'new, unsaved' amap */
|
||||
if (!obj.parents('tr').attr('id')) {
|
||||
obj.parents('tr').queue(function() {
|
||||
$(this).fadeOut(500);
|
||||
$(this).dequeue();
|
||||
});
|
||||
obj.parents('tr').queue(function() {
|
||||
$(this).remove();
|
||||
$(this).dequeue();
|
||||
});
|
||||
return true;
|
||||
}
|
||||
var name = obj.parents('tr').attr('id').substring('5'); /* amap_XXXNAMEXXX */
|
||||
var actions = new listOfSynActions('extensions.conf');
|
||||
var resp;
|
||||
|
||||
if (amap_enabled.contains(name)) {
|
||||
amap_enabled.splice(amap_enabled.indexOf(name), 1);
|
||||
actions.new_action('update', 'globals', 'FEATURES', amap_enabled.join('#'));
|
||||
|
||||
resp = actions.callActions();
|
||||
if (!resp.contains('Response: Success')) {
|
||||
top.log.error('removeAmap: Error updating extensions.conf');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
actions.clearActions('features.conf');
|
||||
|
||||
actions.new_action('delete', 'applicationmap', name, '');
|
||||
|
||||
resp = actions.callActions();
|
||||
if (!resp.contains('Response: Success')) {
|
||||
top.log.error('removeAmap: Error updating features.conf');
|
||||
return false;
|
||||
}
|
||||
|
||||
obj.parents('tr').queue(function() {
|
||||
$(this).fadeOut(500);
|
||||
$(this).dequeue();
|
||||
});
|
||||
obj.parents('tr').queue(function() {
|
||||
$(this).remove();
|
||||
$(this).dequeue();
|
||||
});
|
||||
// if number of rows is one, the table is about to be empty
|
||||
if (amap_table.find('tr:not(.template)').length === 1) {
|
||||
var row = $('<tr>').attr('colspan', '7').addClass('noapps').html('No Application Maps Defined.');
|
||||
amap_table.append(row);
|
||||
}
|
||||
};
|
||||
|
||||
var validateAmap = function(obj, params, focus) {
|
||||
/* used for single validatation */
|
||||
if (params.variable) {
|
||||
switch(params.variable) {
|
||||
case 'name':
|
||||
params.name = params.value;
|
||||
break;
|
||||
case 'digits':
|
||||
params.digits = params.value;
|
||||
break;
|
||||
case 'app_name':
|
||||
params.app_name = params.value;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
delete params.variable;
|
||||
delete params.value;
|
||||
}
|
||||
/* lets validate all the variables before we send */
|
||||
try {
|
||||
if (typeof params.name !== 'undefined') {
|
||||
vali = 'name';
|
||||
validate(params.name, {notnull: true, str: true, aststr: true});
|
||||
}
|
||||
if (typeof params.digits !== 'undefined') {
|
||||
vali = 'digits';
|
||||
validate(params.digits, {notnull: true, keypress: true});
|
||||
}
|
||||
if (typeof params.app_name !== 'undefined') {
|
||||
vali = 'app_name';
|
||||
validate(params.app_name, {notnull: true, str: true});
|
||||
}
|
||||
} catch(e) {
|
||||
if (focus) {
|
||||
obj.find('td.'+vali+' input').focus()
|
||||
}
|
||||
obj.find('td.'+vali+' input').addClass('error');
|
||||
top.log.error(e.message);
|
||||
return false;
|
||||
}
|
||||
|
||||
obj.find('input').removeClass('error');
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* function to removing options
|
||||
* @param obj the DOM object
|
||||
*/
|
||||
var remove = function(obj) {
|
||||
vals[obj.attr('id')] = obj.val();
|
||||
if (obj.attr('type') === 'checkbox') {
|
||||
if (typeof remove_funcs[obj.attr('id')] !== 'function') {
|
||||
top.log.error('remove: remove_funcs["' + obj.attr('id') + '"] is not a function.');
|
||||
updateMsg(obj, 'error', 'Error: Remove function was not found.');
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (typeof edit_funcs[obj.attr('id')] !== 'function') {
|
||||
top.log.error('remove: edit_funcs["' + obj.attr('id') + '"] is not a function.');
|
||||
updateMsg(obj, 'error', 'Error: Remove function was not found.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if (obj.attr('type') === 'checkbox') {
|
||||
remove_funcs[obj.attr('id')](obj.val());
|
||||
} else {
|
||||
edit_funcs[obj.attr('id')]('');
|
||||
}
|
||||
|
||||
updateMsg(obj, 'remove');
|
||||
} catch(e) {
|
||||
switch (e.name) {
|
||||
default:
|
||||
updateMsg(obj, 'error', e.message);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* sends updates to Asterisk.
|
||||
* @param cxt variable's context.
|
||||
* @param name variable name.
|
||||
* @param val variable value.
|
||||
* @throws CommunicationError.
|
||||
* @return boolean of success.
|
||||
*/
|
||||
var sendUpdate = function(params) {
|
||||
if (!params.cxt || !params.name) {
|
||||
top.log.error('sendUpdate: params.cxt or params.name is undefined.');
|
||||
throw TypeError('Error: params.cxt or params.name is undefined.');
|
||||
}
|
||||
|
||||
var actions = listOfSynActions('features.conf');
|
||||
actions.new_action('update', params.cxt, params.name, params.val);
|
||||
var resp = actions.callActions();
|
||||
if (!resp.contains('Response: Success')) {
|
||||
top.log.error('sendUpdate: error updating features.conf.');
|
||||
throw CommunicationError('Error: Unable to update features.conf.');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* function to show update mesgs
|
||||
* @param obj the DOM object
|
||||
* @param msg the msg to display
|
||||
*/
|
||||
var updateMsg = function(obj, type, err) {
|
||||
var type = type || '';
|
||||
var err = err || '';
|
||||
switch(type) {
|
||||
case 'edit':
|
||||
obj.siblings('.update').hide();
|
||||
obj.parents('.feature').effect('highlight', {color: '#aeffae'}, 1000);
|
||||
break;
|
||||
case 'error':
|
||||
obj.siblings('.update').html(err);
|
||||
obj.siblings('.update').show();
|
||||
break;
|
||||
default:
|
||||
obj.siblings('.update').hide();
|
||||
obj.parents('.feature').effect('highlight', {color: '#ffaeae'}, 1000);
|
||||
}
|
||||
};
|
||||
|
||||
var validate = function(val, chks) {
|
||||
/* does val exist? */
|
||||
if (chks.notnull && (typeof val === 'undefined' || val === '' || val === null)) {
|
||||
top.log.error('validate: val is not defined.');
|
||||
throw TypeError('Invalid: This cannot be empty.');
|
||||
}
|
||||
|
||||
/* make sure val is a num */
|
||||
if (chks.num && !val.toString().match(/^[0-9][0-9]*$/)) {
|
||||
top.log.error('validate: val needs to be a number.');
|
||||
throw TypeError('Invalid: This needs to be a number.');
|
||||
}
|
||||
|
||||
/* is val a string? */
|
||||
if (chks.str && typeof val !== 'string') {
|
||||
top.log.error('validate: val needs to be a string.');
|
||||
throw TypeError('Invalid: This needs to be a string.');
|
||||
}
|
||||
|
||||
/* make sure its 0 or more */
|
||||
if (chks.positive && val < 0) {
|
||||
top.log.warn('validate: val needs to be 0 or greater.');
|
||||
throw RangeError('Invalid: This needs to be 0 or greater.');
|
||||
}
|
||||
|
||||
/* lets make sure the exten doesn't conflict with any extension ranges */
|
||||
if (chks.extens) {
|
||||
gui_conf = context2json({
|
||||
filename: 'guipreferences.conf',
|
||||
context: 'general',
|
||||
usf: 1
|
||||
});
|
||||
var prefs = {ue: 'User Extensions', mm: 'Conference Extensions', qe: 'Queue Extensions', vme: 'Voicemail Extensions', rge: 'Ring Group Extensions', vmg: 'Voicemail Group Extensions'};
|
||||
for (pref in prefs) {
|
||||
if (!prefs.hasOwnProperty(pref)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var start = parseInt(gui_conf[pref + '_start'], 10);
|
||||
var end = parseInt(gui_conf[pref + '_end'], 10);
|
||||
|
||||
if (val >= start && val <= end) {
|
||||
top.log.warn('validate: conflicts with ' + pref + '.');
|
||||
throw RangeError('Invalid: Conflicts with ' + prefs[pref] + ' range, ' + start + '-' + end);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (chks.keypress && val !== '' && !val.match(/^[0-9#\*][0-9#\*]*$/)) {
|
||||
top.log.error('validate: val should only contain 0-9, #, or *.');
|
||||
throw TypeError('Invalid: This should only contain 0-9, #, or *.');
|
||||
}
|
||||
|
||||
if (chks.aststr && !val.match(/^[a-zA-Z0-9_-][a-zA-Z0-9_-]*$/)) {
|
||||
top.log.error('validate: val should only contain a-z, A-Z, 0-9, _, or -.');
|
||||
throw TypeError('Invalid: This should only contain a-z, A-Z, 0-9, _, or -');
|
||||
}
|
||||
};
|
||||
|
||||
/********* EXCEPTIONS **********/
|
||||
var CommunicationError = function(msg) {
|
||||
this.name = "CommunicationError";
|
||||
this.msg = msg || "An error occurred while communicating with Asterisk.";
|
||||
};
|
||||
292
old-asterisk/asterisk/static-http/config/js/feditor.js
Normal file
@@ -0,0 +1,292 @@
|
||||
/*
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* feditor.html functions
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*/
|
||||
var global_contextBeingEdited = "";
|
||||
var global_fileBeingEdited = "";
|
||||
|
||||
var show_createfile = function(){
|
||||
var f = ASTGUI.domActions.findPos(_$('createfile_button')) ;
|
||||
_$('CreateFile').style.left = f.cleft ;
|
||||
_$('CreateFile').style.top = f.ctop ;
|
||||
_$('CreateFile').style.display = "" ;
|
||||
_$('New_FileName').value = "";
|
||||
_$('New_FileName').focus();
|
||||
};
|
||||
|
||||
var create_file = function(){
|
||||
var fn = _$('New_FileName').value;
|
||||
if( !fn.endsWith('.conf') ) { fn = fn+'.conf'; }
|
||||
|
||||
ASTGUI.miscFunctions.createConfig( fn, function(){
|
||||
cancel_file();
|
||||
ASTGUI.selectbox.append(_$('filenames'),fn, fn);
|
||||
_$('filenames').selectedIndex = _$('filenames').options.length -1 ;
|
||||
loadfile();
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var cancel_file = function(){
|
||||
_$('CreateFile').style.display = "none" ;
|
||||
};
|
||||
|
||||
var delete_context = function(){
|
||||
if(!confirm("Are you sure you want to delete the selected context ?")){ return true; }
|
||||
var u = new listOfSynActions(global_fileBeingEdited) ;
|
||||
u.new_action('delcat', global_contextBeingEdited, '', '');
|
||||
u.callActions();
|
||||
try{
|
||||
_$('AddContext').style.display = "none";
|
||||
_$('div_editcontext').style.display = "none";
|
||||
global_contextBeingEdited = "";
|
||||
ASTGUI.feedback( { msg:'context deleted', showfor:2 });
|
||||
var t = config2json( { filename:global_fileBeingEdited , usf:0 } )
|
||||
fileparsed(t);
|
||||
}catch(err){}
|
||||
};
|
||||
|
||||
var cancel_context = function(){
|
||||
global_contextBeingEdited = "";
|
||||
_$('div_editcontext').style.display = "none";
|
||||
};
|
||||
|
||||
var update_context = function(){ // rename from global_contextBeingEdited to $('context_edited').value
|
||||
var u = new listOfSynActions(global_fileBeingEdited) ;
|
||||
u.new_action('renamecat', global_contextBeingEdited, '', _$('context_edited').value );
|
||||
u.callActions();
|
||||
_$('AddContext').style.display = "none";
|
||||
_$('div_editcontext').style.display = "none";
|
||||
global_contextBeingEdited = "";
|
||||
ASTGUI.feedback( { msg:'Context Updated', showfor:2 });
|
||||
var t = config2json( { filename:global_fileBeingEdited , usf:0 } )
|
||||
fileparsed(t);
|
||||
};
|
||||
|
||||
var localajaxinit = function(){
|
||||
top.document.title = "File Editor";
|
||||
parent.ASTGUI.dialog.waitWhile('loading list of filenames ..');
|
||||
ASTGUI.selectbox.append(_$('filenames'),"Config Files", "");
|
||||
_$('filenames').options[0].style.fontWeight = "bold";
|
||||
parent.ASTGUI.listSystemFiles( top.sessionData.directories.asteriskConfig , function(listOfFiles) {
|
||||
try{
|
||||
listOfFiles.each( function( file ) {
|
||||
if( file.endsWith('.conf') ){ ASTGUI.selectbox.append( _$('filenames'), file , file ); }
|
||||
});
|
||||
}catch(err){
|
||||
|
||||
}finally{
|
||||
parent.ASTGUI.dialog.hide();
|
||||
}
|
||||
});
|
||||
ASTGUI.events.add( _$('filenames') , 'change' , loadfile );
|
||||
};
|
||||
|
||||
var loadfile = function(){
|
||||
if( !_$('filenames').value ) return;
|
||||
global_fileBeingEdited = _$('filenames').value ;
|
||||
_$('AddContext').style.display = "none";
|
||||
_$('div_filename').style.display = "";
|
||||
_$('CurrentFileName').innerHTML = global_fileBeingEdited;
|
||||
var t = config2json({ filename: global_fileBeingEdited , usf:0 });
|
||||
fileparsed(t);
|
||||
};
|
||||
|
||||
|
||||
var showeditcontextContent = function(event){
|
||||
var t = (event.srcElement)?event.srcElement:this;
|
||||
_$('AddContext').style.display = "none";
|
||||
_$('div_editcontext').style.display = "none";
|
||||
var i_id = t.getAttribute('id') ;
|
||||
global_contextBeingEdited = t.getAttribute('context');
|
||||
_$(i_id).insertBefore(_$('div_editcontextContent'), null );
|
||||
_$('div_editcontextContent').style.display = "";
|
||||
_$('context_Content').value = t.CONTEXTCONTENT ;
|
||||
_$('context_Content').rows = t.CONTEXTCONTENT_ROWS + 3;
|
||||
//_$('context_edited').size = f.length;
|
||||
_$('context_Content').focus();
|
||||
};
|
||||
|
||||
|
||||
var cancel_contextContent = function(){
|
||||
global_contextBeingEdited = "";
|
||||
_$('div_editcontextContent').style.display = "none";
|
||||
};
|
||||
|
||||
|
||||
var update_contextContent = function(){
|
||||
parent.ASTGUI.dialog.waitWhile('Saving Changes ...');
|
||||
var after_emptyContext = function(){
|
||||
var x = new listOfActions(global_fileBeingEdited);
|
||||
var u = _$('context_Content').value.split("\n") ;
|
||||
u.each(function(line){
|
||||
var y = ASTGUI.parseContextLine.read(line);
|
||||
if(y.length)
|
||||
x.new_action('append', global_contextBeingEdited , y[0], y[1] );
|
||||
});
|
||||
var cb = function(){
|
||||
_$('div_editcontextContent').style.display = "none";
|
||||
global_contextBeingEdited = "";
|
||||
try{
|
||||
var t = config2json( { filename:global_fileBeingEdited , usf:0 } );
|
||||
fileparsed(t);
|
||||
}finally{
|
||||
parent.ASTGUI.dialog.hide();
|
||||
}
|
||||
};
|
||||
x.callActions(cb) ;
|
||||
};
|
||||
ASTGUI.miscFunctions.empty_context({ filename: global_fileBeingEdited, context: global_contextBeingEdited, cb: after_emptyContext });
|
||||
};
|
||||
|
||||
|
||||
var fileparsed = function(c){
|
||||
_$('temp_holding').insertBefore(_$('div_editcontext'), null );
|
||||
_$('temp_holding').insertBefore(_$('div_editcontextContent'), null );
|
||||
_$('div_editcontext').style.display = "none";
|
||||
_$('div_editcontextContent').style.display = "none";
|
||||
|
||||
var zz = _$('file_output');
|
||||
var p = "";
|
||||
var rows ;
|
||||
ASTGUI.domActions.removeAllChilds (zz);
|
||||
|
||||
for( var d in c ){
|
||||
if ( c.hasOwnProperty(d) ) {
|
||||
var h = document.createElement("div");
|
||||
var h_id = "context_" + d;
|
||||
h.setAttribute("id",h_id);
|
||||
h.setAttribute("context",d);
|
||||
h.align="left";
|
||||
h.style.backgroundColor = '#4D5423';
|
||||
h.style.color = '#FFFFFF';
|
||||
h.style.marginTop = '15px' ;
|
||||
h.style.width = '95%';
|
||||
h.style.fontFamily = "'trebuchet ms',helvetica,sans-serif";
|
||||
h.style.fontSize = '10pt' ;
|
||||
h.style.padding = '2px 2px 3px 3px' ;
|
||||
//h.innerHTML = " [" + d + "]";
|
||||
(function(){
|
||||
var sp_0 = document.createElement("span");
|
||||
sp_0.innerHTML = " + ";
|
||||
sp_0.className = 'spzero';
|
||||
sp_0.id = 'context_spanOne_' + d ;
|
||||
h.appendChild(sp_0);
|
||||
|
||||
var sp_1 = document.createElement("span");
|
||||
sp_1.innerHTML = " [" + d + "]";
|
||||
sp_1.className = 'spzero';
|
||||
sp_1.id = 'context_spanTwo_' + d ;
|
||||
h.appendChild(sp_1);
|
||||
|
||||
$(sp_1).click( function(event){
|
||||
var t = (event.srcElement)?event.srcElement : this;
|
||||
event.cancelBubble = true;
|
||||
if (event.stopPropagation) event.stopPropagation();
|
||||
|
||||
t.parentNode.insertBefore( _$('div_editcontext'), null );
|
||||
global_contextBeingEdited = this.id.lChop('context_spanTwo_');
|
||||
_$('AddContext').style.display = "none";
|
||||
_$('div_editcontextContent').style.display = "none";
|
||||
_$('div_editcontext').style.display = "";
|
||||
_$('context_edited').value = global_contextBeingEdited ;
|
||||
_$('context_edited').size = global_contextBeingEdited.length;
|
||||
_$('context_edited').focus();
|
||||
|
||||
});
|
||||
|
||||
$(h).click(function(){
|
||||
var context_name = this.id.lChop('context_');
|
||||
var tmp_i_id = "contextContent_" + context_name ;
|
||||
var r = this.childNodes[0] ;
|
||||
if( r.innerHTML.contains('-') ){
|
||||
r.innerHTML = " + ";
|
||||
$('#'+tmp_i_id).hide();
|
||||
}else if( r.innerHTML.contains('+') ){
|
||||
r.innerHTML = "<font size='+2'> - </font>";
|
||||
$('#'+tmp_i_id).show();
|
||||
}
|
||||
});
|
||||
})();
|
||||
zz.appendChild(h);
|
||||
|
||||
var i = document.createElement("div");
|
||||
var i_id = "contextContent_" + d;
|
||||
i.setAttribute("id", i_id );
|
||||
i.setAttribute("context",d);
|
||||
i.align= "left";
|
||||
i.style.backgroundColor = '#E0E6C4';
|
||||
i.style.marginTop = '5px' ;
|
||||
i.style.width = '95%';
|
||||
i.style.fontSize = '9pt' ;
|
||||
i.style.padding = '2px 2px 3px 3px' ;
|
||||
i.style.fontFamily = 'courier' ;
|
||||
|
||||
var temp_contextContent = "" ;
|
||||
rows = 0;
|
||||
if(c[d].length == 0){i.innerHTML += " <BR>" ;}
|
||||
for(var r=0; r < c[d].length ; r++ ){
|
||||
p = unescape( c[d][r] );
|
||||
i.innerHTML += " " + p.replace(/</g, '<').replace(/>/g, '>') + "<BR>" ;
|
||||
temp_contextContent += p + "\n";
|
||||
rows++;
|
||||
}
|
||||
|
||||
i.CONTEXTCONTENT = temp_contextContent ;
|
||||
i.CONTEXTCONTENT_ROWS = rows ;
|
||||
i.style.display = 'none' ;
|
||||
zz.appendChild(i);
|
||||
//Rico.Corner.round("contextContent_" + d, {compact:true});
|
||||
ASTGUI.events.add( _$(i_id) , 'click', showeditcontextContent );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var stopBubble = function(b){
|
||||
if (!b) { b = window.event; }
|
||||
b.cancelBubble = true;
|
||||
};
|
||||
|
||||
var show_addcontext = function(){
|
||||
var acb = ASTGUI.domActions.findPos( _$('AddContextButton') ) ;
|
||||
_$('AddContext').style.left = acb.cleft;
|
||||
_$('AddContext').style.top = acb.ctop ;
|
||||
_$('AddContext').style.display = "" ;
|
||||
_$('New_ContextName').value = "";
|
||||
_$('New_ContextName').focus();
|
||||
};
|
||||
|
||||
|
||||
var cancel_addcontext = function(){
|
||||
_$('AddContext').style.display = "none";
|
||||
_$('New_ContextName').value = "";
|
||||
};
|
||||
|
||||
var add_context = function(){
|
||||
var u = new listOfSynActions(global_fileBeingEdited) ;
|
||||
u.new_action('newcat', _$('New_ContextName').value , '', '');
|
||||
u.callActions();
|
||||
ASTGUI.feedback( { msg:'Context Added', showfor:2 });
|
||||
cancel_addcontext();
|
||||
global_contextBeingEdited = "";
|
||||
var t = config2json( { filename:global_fileBeingEdited , usf:0 } );
|
||||
fileparsed(t);
|
||||
|
||||
};
|
||||
275
old-asterisk/asterisk/static-http/config/js/flashupdate.js
Normal file
@@ -0,0 +1,275 @@
|
||||
/*
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* flashupdate.html functions
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*/
|
||||
var uImage_filename;
|
||||
var uImage_uploadpath = "/var/lib/asterisk/sounds/imageupdate";
|
||||
loaded_external = false;
|
||||
current_version = '';
|
||||
starteduploading = 0;
|
||||
var overlay_upload_Path ;
|
||||
var overlay_disk_Path = '/var/lib/asterisk/sounds/asteriskoverlay/';
|
||||
|
||||
var check_forNewFirmwareVersions = function(){
|
||||
parent.ASTGUI.dialog.waitWhile(' Checking for firmware updates ...');
|
||||
$.getScript( ASTGUI.globals.firmwareVersionUrl , function(){
|
||||
parent.ASTGUI.dialog.hide();
|
||||
try{
|
||||
if(loaded_external){
|
||||
// latest_firmware_version
|
||||
var cv = {};
|
||||
var lv = {};
|
||||
|
||||
var tmp_current_version_array = current_version.split('.') ;
|
||||
var tmp_latest_firmware_version_array = latest_firmware_version.split('.');
|
||||
|
||||
if( tmp_current_version_array.length >= 3 ){
|
||||
cv.major = Number( tmp_current_version_array[0] || 0 ) ;
|
||||
cv.minor = Number( tmp_current_version_array[1] || 0 ) ;
|
||||
cv.point = Number( tmp_current_version_array[2] || 0 ) ;
|
||||
cv.subpoint = Number( tmp_current_version_array[3] || 0 ) ;
|
||||
|
||||
lv.major = Number( tmp_latest_firmware_version_array[0] || 0 ) ;
|
||||
lv.minor = Number( tmp_latest_firmware_version_array[1] || 0 ) ;
|
||||
lv.point = Number( tmp_latest_firmware_version_array[2] || 0 ) ;
|
||||
lv.subpoint = Number( tmp_latest_firmware_version_array[3] || 0 ) ;
|
||||
|
||||
if(lv.major > cv.major || (lv.major == cv.major && lv.minor > cv.minor) || ( cv.major == lv.major && cv.minor == lv.minor && lv.point > cv.point ) || ( cv.major == lv.major && cv.minor == lv.minor && lv.point == cv.point && lv.subpoint > cv.subpoint ) ){
|
||||
alert('A newer version of firmware ('+ latest_firmware_version +') is available !!');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
alert( 'You have ' + current_version + ' installed !!' + '\n'
|
||||
+ 'The latest firmware version is ' + latest_firmware_version );
|
||||
return;
|
||||
}
|
||||
}catch(err){}
|
||||
});
|
||||
|
||||
(function (){
|
||||
var oops = function(){
|
||||
if(loaded_external){return;}
|
||||
parent.ASTGUI.dialog.hide();
|
||||
alert("could not connect to the server");
|
||||
};
|
||||
setTimeout( oops , 70000 ); // if not in 7 seconds - then consider as failed
|
||||
})();
|
||||
};
|
||||
|
||||
|
||||
var execute_applyuimage = function(a){
|
||||
var b;
|
||||
ASTGUI.feedback( { msg:'Upgrading firmware', showfor:30 });
|
||||
parent.ASTGUI.dialog.waitWhile('Upgrading Firmware ... ');
|
||||
|
||||
if(a=="http"){
|
||||
b = "imageupload wget -O "+ uImage_uploadpath + "/uImage " + _$('httpurl').value;
|
||||
}else if(a == "file"){
|
||||
b = "imageupload mv " + uImage_uploadpath + "/" + uImage_filename + " " + uImage_uploadpath + "/uImage";
|
||||
}else if(a == "tftp"){
|
||||
if( _$('tftp_filename').value.length ){
|
||||
var fname = " " + _$('tftp_filename').value ;
|
||||
}else{
|
||||
var fname = "" ;
|
||||
}
|
||||
b = "imageupload tftp -g -r " + fname + " -l " + uImage_uploadpath + "/uImage " + _$('tftpurl').value;
|
||||
}
|
||||
parent.ASTGUI.systemCmd( b, function(){ check_flashupdateresult();} );
|
||||
};
|
||||
|
||||
|
||||
var check_flashupdateresult = function(){
|
||||
var tmp = ASTGUI.loadHTML('/static/flashresult');
|
||||
if ( tmp.match("FAIL: ") ) {
|
||||
parent.ASTGUI.dialog.hide();
|
||||
ASTGUI.feedback( { msg:'Firmware upgrade FAILED', showfor:5 });
|
||||
alert("Firmware Update FAILED" + "\n"+ tmp);
|
||||
return ;
|
||||
}
|
||||
if ( tmp.match("PASS: ") ) {
|
||||
flashupdate_success();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var flashupdate_success = function(){
|
||||
parent.ASTGUI.dialog.hide();
|
||||
ASTGUI.feedback( { msg:'Firmware image copied', showfor:5 });
|
||||
top.cookies.set('firmware_reboot','yes');
|
||||
_$('fstatus').innerHTML = 'Finished copying firmware';
|
||||
parent.ASTGUI.yesOrNo({
|
||||
hideNo: true,
|
||||
msg: "Finished copying firmware <BR> Click 'Ok' to reboot your appliance. <BR><BR> Note: reboot might take 5 to 8 minutes while upgrading firmware" ,
|
||||
ifyes: function(){
|
||||
if( parent.sessionData.PLATFORM.isAA50 && top.cookies.get('configFilesChanged') == 'yes' ){
|
||||
parent.ASTGUI.dialog.waitWhile('Rebooting !');
|
||||
setTimeout( function(){
|
||||
parent.ASTGUI.dialog.hide();
|
||||
parent.ASTGUI.yesOrNo({
|
||||
msg: 'You have unsaved changes !! <BR>Do you want to save these changes before rebooting ?' ,
|
||||
ifyes: function(){
|
||||
ASTGUI.systemCmd ('save_config', function(){
|
||||
top.cookies.set( 'configFilesChanged' , 'no' );
|
||||
ASTGUI.systemCmd ('reboot', parent.miscFunctions.AFTER_REBOOT_CMD );
|
||||
});
|
||||
},
|
||||
ifno:function(){
|
||||
top.cookies.set( 'configFilesChanged' , 'no' );
|
||||
ASTGUI.systemCmd ('reboot', parent.miscFunctions.AFTER_REBOOT_CMD );
|
||||
},
|
||||
title : 'Save changes before reboot ?',
|
||||
btnYes_text :'Yes',
|
||||
btnNo_text : 'No'
|
||||
});
|
||||
}, 2000 );
|
||||
}else{
|
||||
ASTGUI.systemCmd ('reboot', parent.miscFunctions.AFTER_REBOOT_CMD );
|
||||
}
|
||||
},
|
||||
ifno:function(){
|
||||
|
||||
},
|
||||
title : 'Click Ok to reboot',
|
||||
btnYes_text :'Ok',
|
||||
btnNo_text : 'Cancel'
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
var localajaxinit = function (){
|
||||
top.document.title = 'Update appliance firmware' ;
|
||||
if( !parent.sessionData.hasCompactFlash ){
|
||||
//ASTGUI.dialog.alertmsg('You need a CompactFlash® to use this feature');
|
||||
_$('nocf').style.display = '';
|
||||
return false;
|
||||
}
|
||||
|
||||
_$('mainDiv').style.display = '';
|
||||
_$('updatetype_http').checked = true;
|
||||
switch_httptftp('h');
|
||||
|
||||
var c = config2json({filename:'http.conf', usf:1});
|
||||
_$('tdupload').style.display = ( c.hasOwnProperty('post_mappings') && c['post_mappings'].hasOwnProperty('uploads') && c['post_mappings']['uploads'] == uImage_uploadpath) ? '' : 'none';
|
||||
|
||||
ASTGUI.systemCmdWithOutput( "ls /var/lib/asterisk/sounds/a*" , function(a){
|
||||
if( a.contains('/var/lib/asterisk/sounds/asteriskoverlay') ){
|
||||
_$('uploadOVERLAY_iframe').src = "upload_form.html" ;
|
||||
$("#overlayUpload_TR").show();
|
||||
}
|
||||
if(!parent.sessionData.PLATFORM.isAA50_OEM ){
|
||||
$('#UpdatePolycomFirmware').show();
|
||||
ASTGUI.systemCmdWithOutput( 'firmware_version' , function(a){
|
||||
current_version = a.trim();
|
||||
_$('span_current_fwversion').innerHTML = '<B> Current Firmware version : ' + current_version + ' </B>';
|
||||
_$('check_forNewFirmwareVersions_button').style.display = '';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var switch_httptftp = function(a){
|
||||
if(a=='h'){
|
||||
_$('tr_1').style.display = "";
|
||||
_$('tr_2').style.display = "none";
|
||||
_$('tr_3').style.display = "none";
|
||||
}
|
||||
if(a=='t'){
|
||||
_$('tr_1').style.display = "none";
|
||||
_$('tr_2').style.display = "";
|
||||
_$('tr_3').style.display = "";
|
||||
}
|
||||
};
|
||||
|
||||
var call_flashupdate = function(){
|
||||
var h = _$('updatetype_http');
|
||||
var hu = _$('httpurl');
|
||||
var t = _$('updatetype_tftp');
|
||||
var tu = _$('tftpurl');
|
||||
|
||||
if( h.checked && !hu.value.length ){
|
||||
ASTGUI.dialog.alertmsg('Please enter the url of the flash image');
|
||||
return false;
|
||||
}
|
||||
|
||||
if( t.checked && !tu.value.length ){
|
||||
ASTGUI.dialog.alertmsg('Please enter a TFTP server');
|
||||
return false;
|
||||
}
|
||||
|
||||
if( h.checked ){
|
||||
execute_applyuimage("http");
|
||||
return;
|
||||
}
|
||||
|
||||
if( t.checked ){
|
||||
execute_applyuimage("tftp");
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var onUploadForm_load = function(){
|
||||
if(!top.sessionData.httpConf.postmappings_defined || !top.sessionData.httpConf.uploadPaths['backups'] ){
|
||||
top.log.error('AG102');
|
||||
$('#uploadForm_container').hide();
|
||||
return ;
|
||||
}
|
||||
|
||||
overlay_upload_Path = top.sessionData.httpConf.uploadPaths['backups'] ;
|
||||
var upload_action_path = (top.sessionData.httpConf.prefix) ? '/' + top.sessionData.httpConf.prefix + '/backups' : '/backups' ;
|
||||
_$('uploadOVERLAY_iframe').contentWindow.document.getElementById('form22').action = upload_action_path ;
|
||||
_$('uploadOVERLAY_iframe').contentWindow.document.getElementById('UploadFORM_UPLOAD_BUTTON').value = 'Upload OverLay file' ;
|
||||
};
|
||||
|
||||
|
||||
var onUploadForm_beforeUploading = function(){
|
||||
if( !upload_Filename || !upload_Filename.toLowerCase().endsWith('.tar') ){
|
||||
alert('overlay file needs to be a tar file !');
|
||||
return false;
|
||||
}
|
||||
|
||||
starteduploading = 1;
|
||||
parent.ASTGUI.dialog.waitWhile('File Upload in progress, please wait ..');
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
var onUploadForm_unload = function(){
|
||||
if(!starteduploading){ return; }
|
||||
if ( overlay_upload_Path.endsWith('/') ){ overlay_upload_Path = overlay_upload_Path.rChop('/'); }
|
||||
|
||||
ASTGUI.feedback({ msg:'Overlay File Uploaded !!', showfor: 3 });
|
||||
$('#overlayUpload_TR').hide();
|
||||
parent.ASTGUI.dialog.waitWhile('unpacking overlay file');
|
||||
|
||||
|
||||
ASTGUI.systemCmd( 'rm '+ overlay_disk_Path + '* -rf' , function(){
|
||||
ASTGUI.systemCmd( 'tar -xf '+ overlay_upload_Path + '/' + upload_Filename + ' -C ' + overlay_disk_Path, function(){
|
||||
ASTGUI.systemCmd( 'rm -f '+ overlay_upload_Path + '/' + upload_Filename , function(){
|
||||
ASTGUI.feedback({ msg:'Done !!', showfor: 3 });
|
||||
var t = top.window.location.href;
|
||||
top.window.location.replace(t,true);
|
||||
});
|
||||
});
|
||||
});
|
||||
return;
|
||||
};
|
||||
372
old-asterisk/asterisk/static-http/config/js/followme.js
Normal file
@@ -0,0 +1,372 @@
|
||||
/*
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* follow.html functions
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*/
|
||||
var EDIT_USER ;
|
||||
var CURRENT_DESTINATIONS = [] ;
|
||||
var FOLLOWME_OPTIONS = '';
|
||||
|
||||
var load_users_table = function(){
|
||||
var TBL = _$('table_userslist') ;
|
||||
var addCell = ASTGUI.domActions.tr_addCell;
|
||||
var ul = parent.pbx.users.list(); ul = ul.sortNumbers( );
|
||||
|
||||
if(!ul.length){
|
||||
ASTGUI.domActions.clear_table(TBL);
|
||||
var newRow = TBL.insertRow(-1);
|
||||
newRow.className = 'even';
|
||||
addCell( newRow , { html:'No users created !!'} );
|
||||
return ;
|
||||
}
|
||||
|
||||
(function(){ // add first row
|
||||
var newRow = TBL.insertRow(-1);
|
||||
newRow.className = "frow";
|
||||
addCell( newRow , { html:'Extension'});
|
||||
addCell( newRow , { html:'Follow Me'});
|
||||
addCell( newRow , { html:'Follow Order'});
|
||||
|
||||
addCell( newRow , { html:''});
|
||||
})();
|
||||
|
||||
var ext_globals = context2json({filename: 'extensions.conf', context: 'globals' , usf: 1});
|
||||
var followme_cnf = config2json({filename: 'followme.conf', usf: 0});
|
||||
|
||||
|
||||
if( ext_globals.hasOwnProperty('FOLLOWMEOPTIONS') ){
|
||||
FOLLOWME_OPTIONS = ext_globals.FOLLOWMEOPTIONS ;
|
||||
_$('chk_fmoptions_s').checked = ( FOLLOWME_OPTIONS.contains('s') ) ? true : false;
|
||||
_$('chk_fmoptions_a').checked = ( FOLLOWME_OPTIONS.contains('a') ) ? true : false;
|
||||
_$('chk_fmoptions_n').checked = ( FOLLOWME_OPTIONS.contains('n') ) ? true : false;
|
||||
}
|
||||
|
||||
ul.each( function(user){ // list each user in table
|
||||
var fmvar = 'FOLLOWME_' + user ;
|
||||
|
||||
var newRow = TBL.insertRow(-1);
|
||||
newRow.className = ((TBL.rows.length)%2==1)?'odd':'even';
|
||||
addCell( newRow , { html: user });
|
||||
if ( ext_globals.hasOwnProperty(fmvar) && ext_globals[fmvar] == '1' ){
|
||||
addCell( newRow , { html: '<font color=green><b>Enabled</b></font>' });
|
||||
var tmp_a = "<span class='guiButton' onclick=\"show_Edit_FollowMeUser('" + user +"', 1)\">Edit</span> " ;
|
||||
}else{
|
||||
addCell( newRow , { html: '<font color=red><b>Disabled<b></font>' });
|
||||
var tmp_a = "<span class='guiButton' onclick=\"show_Edit_FollowMeUser('" + user +"', 0)\">Edit</span> " ;
|
||||
}
|
||||
if( followme_cnf.hasOwnProperty(user) && followme_cnf[user].containsLike('number=') ){
|
||||
var tmp_followorder = [];
|
||||
followme_cnf[user].each( function(line){
|
||||
if (line.beginsWith('number=') ){
|
||||
line = line.lChop('number=') ;
|
||||
// var fl_number = line.split(',')[0] ;
|
||||
// var fl_seconds = line.split(',')[1];
|
||||
tmp_followorder.push( line.split(',')[0].split('&').join(' & ') );
|
||||
}
|
||||
});
|
||||
tmp_followorder = tmp_followorder.join(', ');
|
||||
addCell( newRow , { html: (tmp_followorder.length > 50) ? tmp_followorder.substr(0,50) + '....' : tmp_followorder , align :'left' });
|
||||
}else{
|
||||
addCell( newRow , { html: '<i>Not Configured</i>' });
|
||||
}
|
||||
addCell( newRow , { html: tmp_a , align:'center' });
|
||||
} );
|
||||
};
|
||||
|
||||
|
||||
var localajaxinit = function(){
|
||||
ASTGUI.tabbedOptions( _$('tabbedMenu') , [
|
||||
{ url: '#',
|
||||
desc: 'FollowMe Preferences for Users',
|
||||
click_function: function(){ $('#div_ONE_FOLLOWMEUSERS').show(); $('#div_TWO_FOLLOWME_PREFS').hide(); }
|
||||
},{
|
||||
url: '#',
|
||||
desc: 'FollowMe Options',
|
||||
click_function: function(){ $('#div_ONE_FOLLOWMEUSERS').hide(); $('#div_TWO_FOLLOWME_PREFS').show(); }
|
||||
}
|
||||
]);
|
||||
|
||||
ASTGUI.events.add( 'newFM_Number_radio_local', 'click' , function(){
|
||||
$('#FMU_newNumber_local').hide();
|
||||
$('#FMU_newNumber_External').hide();
|
||||
|
||||
if( _$('newFM_Number_radio_local').checked ){
|
||||
$('#FMU_newNumber_local').show();
|
||||
}
|
||||
});
|
||||
|
||||
ASTGUI.events.add( 'newFM_Number_radio_Externals', 'click' , function(){
|
||||
$('#FMU_newNumber_local').hide();
|
||||
$('#FMU_newNumber_External').hide();
|
||||
|
||||
if( _$('newFM_Number_radio_Externals').checked ){
|
||||
$('#FMU_newNumber_External').show();
|
||||
}
|
||||
});
|
||||
|
||||
followMe_MiscFunctions.load_LocalExtensionsList();
|
||||
top.document.title = 'Follow Me' ;
|
||||
|
||||
load_users_table();
|
||||
|
||||
$('#tabbedMenu').find('A:eq(0)').click();
|
||||
|
||||
(function(){
|
||||
var mcls = config2json({filename: 'musiconhold.conf', usf: 1});
|
||||
for (var this_class in mcls ){
|
||||
if(mcls.hasOwnProperty(this_class)){
|
||||
ASTGUI.selectbox.append('FMU_moh', this_class, this_class );
|
||||
}
|
||||
}
|
||||
_$('FMU_moh').selectedIndex = -1;
|
||||
|
||||
var c = parent.pbx.call_plans.list() ;
|
||||
var tmp_pfx = ASTGUI.contexts.CallingPlanPrefix ;
|
||||
for( var c_t = 0 ; c_t < c.length ; c_t++ ){
|
||||
ASTGUI.selectbox.append( 'FMU_context' , c[c_t].withOut(tmp_pfx) , c[c_t] );
|
||||
}
|
||||
})();
|
||||
|
||||
$('#sqDestinations').click(function(event){
|
||||
var s = ASTGUI.events.getTarget(event);
|
||||
var cl = $(s).attr("class") ;
|
||||
if(!cl || !cl.beginsWith('step_') ){return;}
|
||||
var stepNo = Number( s.parentNode.STEPNO );
|
||||
switch(cl){
|
||||
case 'step_delete':
|
||||
CURRENT_DESTINATIONS.splice(stepNo,1);
|
||||
break;
|
||||
case 'step_up':
|
||||
if(stepNo == 0) return;
|
||||
var tmp = CURRENT_DESTINATIONS[stepNo] ;
|
||||
CURRENT_DESTINATIONS.splice(stepNo, 1);
|
||||
CURRENT_DESTINATIONS.splice(stepNo-1, 0, tmp);
|
||||
break;
|
||||
case 'step_down':
|
||||
if(stepNo == (CURRENT_DESTINATIONS.length-1) ) return;
|
||||
var tmp = CURRENT_DESTINATIONS[stepNo] ;
|
||||
CURRENT_DESTINATIONS.splice(stepNo+2, 0, tmp);
|
||||
CURRENT_DESTINATIONS.splice(stepNo, 1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
followMe_MiscFunctions.refresh_allDestinations();
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
var show_Edit_FollowMeUser = function(u, fm_ed){
|
||||
|
||||
EDIT_USER = u ;
|
||||
followMe_MiscFunctions.reset_Fields();
|
||||
|
||||
// load fields
|
||||
if( !fm_ed ){
|
||||
fm_ed = 0;
|
||||
}else{
|
||||
fm_ed = Number(fm_ed);
|
||||
}
|
||||
|
||||
if( fm_ed ){
|
||||
_$('FMU_Enable').checked = true ;
|
||||
_$('FMU_Disable').checked = false ;
|
||||
}else{
|
||||
_$('FMU_Enable').checked = false ;
|
||||
_$('FMU_Disable').checked = true ;
|
||||
}
|
||||
|
||||
CURRENT_DESTINATIONS = [];
|
||||
|
||||
ASTGUI.updateFieldToValue('FMU_context', parent.sessionData.pbxinfo.users[EDIT_USER].getProperty('context'));
|
||||
|
||||
var cxt = context2json({ filename:'followme.conf' , context : EDIT_USER , usf: 0 });
|
||||
if(!cxt){ cxt = []; }
|
||||
for( var t =0; t < cxt.length ; t++ ){
|
||||
|
||||
if( cxt[t].beginsWith('musicclass=') ){
|
||||
ASTGUI.updateFieldToValue('FMU_moh', cxt[t].afterChar('=') );
|
||||
}
|
||||
|
||||
if( cxt[t].beginsWith('context=') ){
|
||||
ASTGUI.updateFieldToValue('FMU_context', cxt[t].afterChar('=') );
|
||||
}
|
||||
|
||||
if( cxt[t].beginsWith('number=') ){
|
||||
CURRENT_DESTINATIONS.push( cxt[t].afterChar('=') );
|
||||
}
|
||||
}
|
||||
|
||||
followMe_MiscFunctions.hide_FORM_newFM_Number();
|
||||
followMe_MiscFunctions.refresh_allDestinations();
|
||||
|
||||
$('#div_followUser_edit').showWithBg();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var save_FollowMeUser = function(){
|
||||
// update follow me status of the user in extensions.conf
|
||||
// update followme.conf with all other chosen preferences
|
||||
// reload the page
|
||||
|
||||
var fm_enabled = ( _$('FMU_Enable').checked ) ? '1' : '0' ;
|
||||
ASTGUI.updateaValue({ file:'extensions.conf', context :'globals', variable : 'FOLLOWME_' + EDIT_USER , value : fm_enabled });
|
||||
|
||||
var FOLLOWME_CONF = config2json({ filename:'followme.conf', usf:0 });
|
||||
|
||||
var u = new listOfActions('followme.conf');
|
||||
if( FOLLOWME_CONF.hasOwnProperty(EDIT_USER) ){ u.new_action('delcat', EDIT_USER , '', ''); }
|
||||
u.new_action( 'newcat', EDIT_USER , '', '');
|
||||
u.new_action( 'append', EDIT_USER , 'musicclass', ASTGUI.getFieldValue('FMU_moh') );
|
||||
u.new_action( 'append', EDIT_USER , 'context', ASTGUI.getFieldValue('FMU_context') );
|
||||
for( var t=0; t < CURRENT_DESTINATIONS.length ; t++ ){
|
||||
u.new_action( 'append', EDIT_USER , 'number', CURRENT_DESTINATIONS[t] );
|
||||
}
|
||||
|
||||
var uinfo = parent.sessionData.pbxinfo.users[EDIT_USER];
|
||||
if( !uinfo.getProperty('hasvoicemail').isAstTrue() ){
|
||||
ASTGUI.updateaValue({file:'users.conf', context : EDIT_USER, variable :'hasvoicemail', value :'yes'});
|
||||
parent.sessionData.pbxinfo.users[EDIT_USER].hasvoicemail = 'yes';
|
||||
}
|
||||
|
||||
u.callActions( function(){
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
var followMe_MiscFunctions = {
|
||||
|
||||
load_LocalExtensionsList : function(){ // followMe_MiscFunctions.load_LocalExtensionsList()
|
||||
ASTGUI.selectbox.clear('FMU_newNumber_local');
|
||||
var ul = parent.pbx.users.list(); ul = ul.sortNumbers( );
|
||||
ul.each( function(user){
|
||||
ASTGUI.selectbox.append('FMU_newNumber_local', user + ' ' + parent.sessionData.pbxinfo.users[user].getProperty('fullname') , user);
|
||||
});
|
||||
},
|
||||
|
||||
show_FORM_newFM_Number : function(){ // followMe_MiscFunctions.show_FORM_newFM_Number()
|
||||
ASTGUI.updateFieldToValue( 'FMU_newNumber_seconds', '30' );
|
||||
_$('newFM_Number_radio_local').checked = true;
|
||||
_$('newFM_Number_radio_Externals').checked = false;
|
||||
_$('newFM_Order_radio_after').checked = true;
|
||||
_$('newFM_Order_radio_alongWith').checked = false;
|
||||
_$('FMU_newNumber_local').selectedIndex = -1 ;
|
||||
ASTGUI.updateFieldToValue('FMU_newNumber_External', '');
|
||||
$('#FMU_newNumber_local').show();
|
||||
$('#FMU_newNumber_External').hide();
|
||||
$('.FORM_newFM_Number').show();
|
||||
$($('.FORM_newFM_Number')[0]).hide();
|
||||
$('#lastRow_Edit').hide();
|
||||
},
|
||||
|
||||
hide_FORM_newFM_Number : function(){ // followMe_MiscFunctions.hide_FORM_newFM_Number()
|
||||
$('.FORM_newFM_Number').hide();
|
||||
$($('.FORM_newFM_Number')[0]).show();
|
||||
$('#lastRow_Edit').show();
|
||||
},
|
||||
|
||||
reset_Fields : function(){ // followMe_MiscFunctions.reset_Fields()
|
||||
ASTGUI.resetTheseFields ([ 'FMU_Enable', 'FMU_Disable', 'FMU_moh', 'FMU_context','FMU_newNumber_local','FMU_newNumber_seconds' ]);
|
||||
ASTGUI.domActions.removeAllChilds( 'sqDestinations' ); CURRENT_DESTINATIONS = [] ;
|
||||
|
||||
},
|
||||
|
||||
refresh_allDestinations: function(){ // followMe_MiscFunctions.refresh_allDestinations()
|
||||
ASTGUI.domActions.removeAllChilds( 'sqDestinations' );
|
||||
var add_sqStep = function(a){
|
||||
var txt = CURRENT_DESTINATIONS[a];
|
||||
var tmp = document.createElement('div');
|
||||
tmp.STEPNO = a ;
|
||||
var sp_desc = document.createElement('span');
|
||||
sp_desc.className = 'step_desc';
|
||||
sp_desc.innerHTML = txt.split(',')[0].split('&').join(' <B>&</B> ') + ' (' + txt.split(',')[1] + ' seconds)' ;
|
||||
var sp_up = document.createElement('span');
|
||||
sp_up.className = 'step_up';
|
||||
sp_up.innerHTML = ' ';
|
||||
var sp_down = document.createElement('span');
|
||||
sp_down.className = 'step_down';
|
||||
sp_down.innerHTML = ' ';
|
||||
var sp_delete = document.createElement('span');
|
||||
sp_delete.className = 'step_delete';
|
||||
sp_delete.innerHTML = ' ';
|
||||
|
||||
tmp.appendChild(sp_desc) ;
|
||||
tmp.appendChild(sp_delete) ;
|
||||
tmp.appendChild(sp_up) ;
|
||||
tmp.appendChild(sp_down) ;
|
||||
_$('sqDestinations').appendChild(tmp) ;
|
||||
};
|
||||
for( var t=0; t < CURRENT_DESTINATIONS.length ; t++ ){
|
||||
add_sqStep(t);
|
||||
}
|
||||
},
|
||||
|
||||
push_newdest: function(){ // followMe_MiscFunctions.push_newdest() ;
|
||||
var tmp_seconds = ASTGUI.getFieldValue( 'FMU_newNumber_seconds' ) || '30' ;
|
||||
if( _$('newFM_Number_radio_local').checked ){
|
||||
if( _$('FMU_newNumber_local').selectedIndex == -1 ){
|
||||
ASTGUI.highlightField( 'FMU_newNumber_local', 'Please select a Local Extension to Dial !');
|
||||
return;
|
||||
}
|
||||
var tmp_number = ASTGUI.getFieldValue('FMU_newNumber_local');
|
||||
}
|
||||
if( _$('newFM_Number_radio_Externals').checked ){
|
||||
if( !ASTGUI.getFieldValue('FMU_newNumber_External') ){
|
||||
ASTGUI.highlightField( 'FMU_newNumber_External', 'Please Enter a Number to Dial !');
|
||||
return;
|
||||
}
|
||||
var tmp_number = ASTGUI.getFieldValue('FMU_newNumber_External');
|
||||
}
|
||||
if( tmp_number.contains('-') ) tmp_number = tmp_number.withOut('-');
|
||||
var tmp_dest = tmp_number + ',' + tmp_seconds;
|
||||
|
||||
var tmp_last = CURRENT_DESTINATIONS.lastValue();
|
||||
if( _$('newFM_Order_radio_after').checked || !tmp_last){
|
||||
CURRENT_DESTINATIONS.push(tmp_dest);
|
||||
}
|
||||
|
||||
if ( _$('newFM_Order_radio_alongWith').checked && tmp_last){
|
||||
CURRENT_DESTINATIONS.replaceLastWith( tmp_last.split(',')[0] + '&' + tmp_dest );
|
||||
}
|
||||
|
||||
this.refresh_allDestinations();
|
||||
this.hide_FORM_newFM_Number();
|
||||
//ASTGUI.resetTheseFields (['FMU_newNumber','FMU_newNumber_seconds' ]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var update_FollowMe_Options = function(){
|
||||
|
||||
FOLLOWME_OPTIONS = '';
|
||||
|
||||
if( _$('chk_fmoptions_n').checked ) FOLLOWME_OPTIONS = FOLLOWME_OPTIONS + 'n' ;
|
||||
if( _$('chk_fmoptions_a').checked ) FOLLOWME_OPTIONS = FOLLOWME_OPTIONS + 'a' ;
|
||||
if( _$('chk_fmoptions_s').checked ) FOLLOWME_OPTIONS = FOLLOWME_OPTIONS + 's' ;
|
||||
|
||||
ASTGUI.updateaValue({ file:'extensions.conf', context :'globals', variable :'FOLLOWMEOPTIONS', value : FOLLOWME_OPTIONS });
|
||||
ASTGUI.feedback({msg:' Saved !!', showfor: 3 , color: '#5D7CBA', bgcolor: '#FFFFFF'}) ;
|
||||
|
||||
};
|
||||
274
old-asterisk/asterisk/static-http/config/js/gtalk.js
Normal file
@@ -0,0 +1,274 @@
|
||||
var GTALK_CNF , JABBER_CNF, EXTENSIONS_CNF;
|
||||
|
||||
var EDIT_BUDDY ;
|
||||
var EDIT_ACCOUNT ;
|
||||
|
||||
|
||||
var MANAGE_BUDDIES = {
|
||||
listBuddies : function(){ // MANAGE_BUDDIES.listBuddies
|
||||
var addCell = ASTGUI.domActions.tr_addCell; // temporarily store the function
|
||||
var TBL = _$('table_BuddiesList');
|
||||
ASTGUI.domActions.clear_table(TBL);
|
||||
|
||||
|
||||
for( buddy in GTALK_CNF ){
|
||||
if( !GTALK_CNF.hasOwnProperty(buddy) || buddy == 'general' ) continue;
|
||||
|
||||
var newRow = TBL.insertRow(-1);
|
||||
newRow.className = ((TBL.rows.length)%2==1)?'odd':'even';
|
||||
addCell( newRow , { html:GTALK_CNF[buddy].username , align:'left'});
|
||||
|
||||
var tmp_context = GTALK_CNF[buddy].context || '' ;
|
||||
|
||||
var dest_line = ( tmp_context && tmp_context.contains(ASTGUI.contexts.gtalkIncomingContext) && EXTENSIONS_CNF.hasOwnProperty(tmp_context) ) ? EXTENSIONS_CNF[tmp_context][0] : '' ;
|
||||
var dest_args = ASTGUI.parseContextLine.getArgs(dest_line) ;
|
||||
addCell( newRow , { html: ASTGUI.parseContextLine.toKnownContext(dest_args) , align:'left' } );
|
||||
|
||||
|
||||
addCell( newRow , { html:GTALK_CNF[buddy].connection });
|
||||
|
||||
var tmp = "<span class='guiButton' onclick=\"MANAGE_BUDDIES.edit_buddy_form('" + buddy +"')\">Edit</span> "
|
||||
+ "<span class='guiButtonDelete' onclick=\"MANAGE_BUDDIES.deleteBuddy('" + buddy +"')\">Delete</span>" ;
|
||||
addCell( newRow , { html: tmp });
|
||||
}
|
||||
|
||||
if( TBL.rows.length == 0 ){
|
||||
var newRow = TBL.insertRow(-1);
|
||||
addCell( newRow , { html: "<BR>No peers configured. To send or receive calls from your friends on google talk, Add the peer name by clicking on the 'New peer' button.<BR><BR>" });
|
||||
}else{
|
||||
var newRow = TBL.insertRow(0);
|
||||
newRow.className = 'frow' ;
|
||||
addCell( newRow , { html: 'UserName' , align: 'left' });
|
||||
addCell( newRow , { html: 'Incoming Calls', align: 'left' });
|
||||
addCell( newRow , { html: 'Connection' });
|
||||
addCell( newRow , { html: '' });
|
||||
}
|
||||
},
|
||||
|
||||
deleteBuddy : function(a , silentmode){ // MANAGE_BUDDIES.deleteBuddy(); use silentmode to delete while editing buddy
|
||||
if(!silentmode){
|
||||
if( !confirm("Delete peer '"+ a + "' ?") ) return true;
|
||||
}
|
||||
|
||||
var u = new listOfSynActions('gtalk.conf');
|
||||
u.new_action('delcat', a, '', '');
|
||||
u.callActions();
|
||||
|
||||
u.clearActions('extensions.conf');
|
||||
u.new_action('delcat', GTALK_CNF[a].context , '', '');
|
||||
u.callActions();
|
||||
|
||||
if(!silentmode){
|
||||
ASTGUI.feedback( { msg:"deleted peer '" + a + "'" , showfor: 3, color:'red', bgcolor:'#FFFFFF' } );
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
|
||||
addBuddy: function(){ // MANAGE_BUDDIES.addBuddy();
|
||||
|
||||
if ( EDIT_BUDDY ){
|
||||
this.deleteBuddy(EDIT_BUDDY , true);
|
||||
}
|
||||
|
||||
var v = new listOfActions('gtalk.conf');
|
||||
var tmp_uname = ASTGUI.getFieldValue('edit_buddyName_text');
|
||||
var tmp_connection = ASTGUI.getFieldValue('edit_buddyConnection_select');
|
||||
if( !tmp_uname.contains('@') ){
|
||||
tmp_uname = tmp_uname + '@gmail.com';
|
||||
}
|
||||
var catname = ( EDIT_BUDDY ) ? EDIT_BUDDY : tmp_uname.beforeChar('@');
|
||||
|
||||
v.new_action('newcat', catname, '', '');
|
||||
v.new_action('append', catname , 'username', tmp_uname );
|
||||
v.new_action('append', catname , 'disallow', 'all');
|
||||
v.new_action('append', catname , 'allow', 'all');
|
||||
v.new_action('append', catname , 'context', ASTGUI.contexts.gtalkIncomingContext + catname );
|
||||
|
||||
v.new_action('append', catname , 'connection', tmp_connection );
|
||||
v.callActions( function(){
|
||||
|
||||
var W = new listOfSynActions('extensions.conf') ;
|
||||
W.new_action('newcat', ASTGUI.contexts.gtalkIncomingContext + catname , '', '');
|
||||
W.new_action('append', ASTGUI.contexts.gtalkIncomingContext + catname , 'exten', 's,1,' + ASTGUI.getFieldValue('edit_buddyIncomingCalls_select') );
|
||||
W.callActions();
|
||||
|
||||
ASTGUI.feedback( { msg:"updated peer" , showfor: 3, color:'red', bgcolor:'#FFFFFF' } );
|
||||
window.location.reload();
|
||||
});
|
||||
},
|
||||
|
||||
new_buddy_form : function(){ // MANAGE_BUDDIES.new_buddy_form();
|
||||
EDIT_BUDDY = '';
|
||||
ASTGUI.resetTheseFields([ 'edit_buddyName_text', 'edit_buddyConnection_select', 'edit_buddyIncomingCalls_select']);
|
||||
$('#buddy_editdiv .dialog_title > span').html('Add Peer');
|
||||
$('#buddy_editdiv').showWithBg();
|
||||
},
|
||||
|
||||
edit_buddy_form : function(a){ // MANAGE_BUDDIES.edit_buddy_form();
|
||||
if(!a) return;
|
||||
EDIT_BUDDY = a;
|
||||
ASTGUI.updateFieldToValue( 'edit_buddyName_text', GTALK_CNF[EDIT_BUDDY].username );
|
||||
ASTGUI.updateFieldToValue( 'edit_buddyConnection_select', GTALK_CNF[EDIT_BUDDY].connection );
|
||||
|
||||
var dest_line = ( EXTENSIONS_CNF.hasOwnProperty( GTALK_CNF[EDIT_BUDDY].context ) ) ? EXTENSIONS_CNF[ GTALK_CNF[EDIT_BUDDY].context ][0] : '' ;
|
||||
ASTGUI.selectbox.selectDestinationOption( 'edit_buddyIncomingCalls_select' , ASTGUI.parseContextLine.getAppWithArgs(dest_line) );
|
||||
|
||||
$('#buddy_editdiv .dialog_title > span').html( 'Edit Peer ' + EDIT_BUDDY);
|
||||
$('#buddy_editdiv').showWithBg();
|
||||
}
|
||||
};
|
||||
|
||||
var MANAGE_ACCOUNTS = {
|
||||
listAccounts : function(){
|
||||
var addCell = ASTGUI.domActions.tr_addCell; // temporarily store the function
|
||||
var TBL = _$('table_AccountsList');
|
||||
ASTGUI.domActions.clear_table(TBL);
|
||||
|
||||
for( account in JABBER_CNF ){
|
||||
if( !JABBER_CNF.hasOwnProperty(account) || account == 'general' ) continue;
|
||||
ASTGUI.selectbox.append('edit_buddyConnection_select', account , account);
|
||||
|
||||
var newRow = TBL.insertRow(-1);
|
||||
newRow.className = ((TBL.rows.length)%2==1) ? 'odd':'even';
|
||||
addCell( newRow , { html: JABBER_CNF[account].username, align: 'left' });
|
||||
addCell( newRow , { html: account, align: 'left' });
|
||||
var tmp = "<span class='guiButton' onclick=\"MANAGE_ACCOUNTS.edit_Account_form('" + account +"')\">Edit</span> "
|
||||
+ "<span class='guiButtonDelete' onclick=\"MANAGE_ACCOUNTS.deleteAccount('" + account +"')\">Delete</span>" ;
|
||||
addCell( newRow , { html: tmp, align: 'center' });
|
||||
}
|
||||
|
||||
if( TBL.rows.length == 0 ){
|
||||
var newRow = TBL.insertRow(-1);
|
||||
addCell( newRow , { html: "<BR>No google talk accounts configured. <BR> Please click on 'New gtalk Account' button to send and receive calls via your google talk account.<BR><BR>"});
|
||||
}else{
|
||||
var newRow = TBL.insertRow(0);
|
||||
newRow.className = 'frow' ;
|
||||
addCell( newRow , { html: 'UserName' , align: 'left' });
|
||||
addCell( newRow , { html: 'Account', align: 'left' });
|
||||
addCell( newRow , { html: '' });
|
||||
}
|
||||
},
|
||||
|
||||
deleteAccount : function(a, silentmode){ // MANAGE_ACCOUNTS.deleteAccount()
|
||||
if(!silentmode && !confirm("Delete account '"+ a + "' ?")) { return true; }
|
||||
var u = new listOfSynActions('jabber.conf') ;
|
||||
u.new_action('delcat', a, '', '');
|
||||
u.callActions();
|
||||
if( !silentmode ){
|
||||
ASTGUI.feedback({ msg:"Deleted jabber account '" + a + "'", showfor: 3, color:'red', bgcolor:'#FFFFFF' });
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
|
||||
saveAccount : function(){ // MANAGE_ACCOUNTS.saveAccount()
|
||||
if ( EDIT_ACCOUNT ){
|
||||
this.deleteAccount(EDIT_ACCOUNT, true);
|
||||
}
|
||||
|
||||
var v = new listOfActions('jabber.conf');
|
||||
var tmp_uname = ASTGUI.getFieldValue('edit_account_text');
|
||||
if( !tmp_uname.contains('@') ){
|
||||
tmp_uname = tmp_uname + '@gmail.com';
|
||||
}
|
||||
var catname = ( EDIT_ACCOUNT ) ? EDIT_ACCOUNT : tmp_uname.beforeChar('@');
|
||||
v.new_action('newcat', catname, '', '');
|
||||
v.new_action('append', catname , 'type', 'client');
|
||||
v.new_action('append', catname , 'serverhost', 'talk.google.com');
|
||||
v.new_action('append', catname , 'username', tmp_uname);
|
||||
v.new_action('append', catname , 'secret', ASTGUI.getFieldValue('edit_account_secret'));
|
||||
v.new_action('append', catname , 'port', '5222');
|
||||
v.new_action('append', catname , 'usetls', 'yes');
|
||||
v.new_action('append', catname , 'usesasl', 'yes');
|
||||
v.new_action('append', catname , 'statusmessage', ASTGUI.getFieldValue('edit_account_status'));
|
||||
v.new_action('append', catname , 'timeout', '100');
|
||||
v.callActions( function(){
|
||||
ASTGUI.feedback( { msg:"updated account" , showfor: 3, color:'red', bgcolor:'#FFFFFF' } );
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
new_Account_form : function(){ // MANAGE_ACCOUNTS.new_Account_form()
|
||||
EDIT_ACCOUNT = '';
|
||||
ASTGUI.resetTheseFields([ 'edit_account_text', 'edit_account_secret','edit_account_status' ]);
|
||||
$('#account_editdiv .dialog_title > span').html('Add new Account');
|
||||
$('#account_editdiv').showWithBg();
|
||||
},
|
||||
|
||||
edit_Account_form : function(a){ // MANAGE_ACCOUNTS.edit_Account_form()
|
||||
if(!a) return;
|
||||
EDIT_ACCOUNT = a;
|
||||
|
||||
ASTGUI.updateFieldToValue( 'edit_account_text', JABBER_CNF[EDIT_ACCOUNT].username );
|
||||
ASTGUI.updateFieldToValue( 'edit_account_secret', JABBER_CNF[EDIT_ACCOUNT].secret );
|
||||
ASTGUI.updateFieldToValue( 'edit_account_status', JABBER_CNF[EDIT_ACCOUNT].statusmessage );
|
||||
|
||||
$('#account_editdiv .dialog_title > span').html('Edit Account ' + EDIT_ACCOUNT );
|
||||
$('#account_editdiv').showWithBg();
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
var localajaxinit = function(){
|
||||
top.document.title = 'Google Talk Preferences' ;
|
||||
GTALK_CNF = config2json({ filename:'gtalk.conf', usf:1 }); // buddies
|
||||
JABBER_CNF = config2json({ filename:'jabber.conf', usf:1 }); // accounts
|
||||
EXTENSIONS_CNF = config2json({ filename:'extensions.conf', usf:0 });
|
||||
|
||||
var someArray = parent.miscFunctions.getAllDestinations() ;
|
||||
ASTGUI.selectbox.populateArray('edit_buddyIncomingCalls_select', someArray);
|
||||
|
||||
(function(){
|
||||
// check if the general section of the config files are configured
|
||||
var u = new listOfSynActions('gtalk.conf') ;
|
||||
if( !GTALK_CNF.hasOwnProperty('general') ){
|
||||
u.new_action('newcat', 'general' , '', '');
|
||||
}
|
||||
if( GTALK_CNF.hasOwnProperty('general') && !GTALK_CNF['general'].hasOwnProperty('allowguest') ){
|
||||
u.new_action('append', 'general' , 'allowguest', 'no');
|
||||
}
|
||||
|
||||
var v = new listOfSynActions('jabber.conf') ;
|
||||
if( !JABBER_CNF.hasOwnProperty('general') ){
|
||||
v.new_action('newcat', 'general' , '', '');
|
||||
}
|
||||
if( JABBER_CNF.hasOwnProperty('general') && !JABBER_CNF['general'].hasOwnProperty('autoprune') ){
|
||||
v.new_action('append', 'general' , 'autoprune', 'no');
|
||||
}
|
||||
if( JABBER_CNF.hasOwnProperty('general') && !JABBER_CNF['general'].hasOwnProperty('autoregister') ){
|
||||
v.new_action('append', 'general' , 'autoregister', 'yes');
|
||||
}
|
||||
|
||||
if( u.actionCount || v.actionCount ) {
|
||||
u.callActions();
|
||||
v.callActions();
|
||||
window.location.reload();
|
||||
}
|
||||
})();
|
||||
|
||||
(function(){
|
||||
var t = [{ url:'#',
|
||||
desc:'Google Talk Accounts',
|
||||
click_function: function(){
|
||||
$('#table_BuddiesList_DIV').hide();
|
||||
$('#table_AccountsList_DIV').show();
|
||||
}
|
||||
},{ url: '#',
|
||||
desc: ' Peers ',
|
||||
click_function: function(){
|
||||
$('#table_BuddiesList_DIV').show();
|
||||
$('#table_AccountsList_DIV').hide();
|
||||
}
|
||||
}];
|
||||
|
||||
ASTGUI.tabbedOptions( _$('tabbedMenu') , t );
|
||||
|
||||
$('#tabbedMenu').find('A:eq(0)').click();
|
||||
})();
|
||||
|
||||
MANAGE_ACCOUNTS.listAccounts();
|
||||
MANAGE_BUDDIES.listBuddies();
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
gui_version = '2.1.0-rc1';
|
||||
1195
old-asterisk/asterisk/static-http/config/js/hardware.js
Normal file
400
old-asterisk/asterisk/static-http/config/js/hardware_aa50.js
Normal file
@@ -0,0 +1,400 @@
|
||||
/*
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* hardware_aa50.html functions
|
||||
*
|
||||
* Copyright (C) 2006-2011, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
* Erin Spiceland <espiceland@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*/
|
||||
var oldLoadZone;
|
||||
var hwcfgfile = ASTGUI.globals.hwcfgFile ;
|
||||
var HAS_ANALOGHARDWARE = true; // if the user does not have any hardware - always set parent.sessionData.REQUIRE_RESTART to false
|
||||
var isREVC = false;
|
||||
|
||||
|
||||
var applySettings = {
|
||||
save_opermode_settings: function(){ // applySettings.save_opermode_settings();
|
||||
ASTGUI.dialog.waitWhile('saving...');
|
||||
var u = new listOfSynActions(ASTGUI.globals.configfile);
|
||||
u.new_action('update', 'general', 'opermode', ASTGUI.getFieldValue('opermode') );
|
||||
u.new_action('update', 'general', 'alawoverride', ASTGUI.getFieldValue('alawoverride') );
|
||||
u.new_action('update', 'general', 'fxshonormode', ASTGUI.getFieldValue('fxshonormode') );
|
||||
u.new_action('update', 'general', 'boostringer', ASTGUI.getFieldValue('boostringer') );
|
||||
u.callActions();
|
||||
u.clearActions();
|
||||
|
||||
u.new_action('update', 'general', 'mwimode', ASTGUI.getFieldValue('mwimode') );
|
||||
if( ASTGUI.getFieldValue('mwimode') == 'NEON' ){
|
||||
u.new_action('update', 'general', 'neonmwi_level', ASTGUI.getFieldValue('neonmwi_level') );
|
||||
u.new_action('update', 'general', 'neonmwi_offlimit', ASTGUI.getFieldValue('neonmwi_offlimit') );
|
||||
}
|
||||
u.new_action('update', 'general', 'lowpower', ASTGUI.getFieldValue('lowpower') );
|
||||
u.new_action('update', 'general', 'fastringer', ASTGUI.getFieldValue('fastringer') );
|
||||
u.new_action('update', 'general', 'fwringdetect', ASTGUI.getFieldValue('fwringdetect') );
|
||||
u.callActions();
|
||||
u.clearActions();
|
||||
|
||||
if( isREVC ){
|
||||
u.new_action('update', 'general', 'vpmnlptype', ASTGUI.getFieldValue('vpmnlptype') );
|
||||
u.new_action('update', 'general', 'vpmnlpthresh', ASTGUI.getFieldValue('vpmnlpthresh') );
|
||||
u.new_action('update', 'general', 'vpmnlpmaxsupp', ASTGUI.getFieldValue('vpmnlpmaxsupp') );
|
||||
u.callActions();
|
||||
}
|
||||
|
||||
ASTGUI.dialog.waitWhile('updating modprobe.conf ...');
|
||||
var cmd1 = "cp /etc/asterisk/modprobe_default /etc/modprobe.conf";
|
||||
var params = "options sx00i ";
|
||||
var h = ASTGUI.getFieldValue('opermode') ;
|
||||
if(h){ params += " opermode=" + h; }
|
||||
h = ASTGUI.getFieldValue('alawoverride') ;
|
||||
if(h){ params += " alawoverride=" + h; }
|
||||
h = ASTGUI.getFieldValue('fxshonormode') ;
|
||||
if(h){ params += " fxshonormode=" + h; }
|
||||
h = ASTGUI.getFieldValue('boostringer') ;
|
||||
if(h){ params += " boostringer=" + h; }
|
||||
h = ASTGUI.getFieldValue('lowpower') ;
|
||||
if(h){ params += " lowpower=" + h; }
|
||||
h = ASTGUI.getFieldValue('fastringer') ;
|
||||
if(h){ params += " fastringer=" + h; }
|
||||
h = ASTGUI.getFieldValue('fwringdetect') ;
|
||||
if(h == '1'){ params += " fwringdetect=" + h; }
|
||||
|
||||
if( ASTGUI.getFieldValue('mwimode') == 'NEON'){
|
||||
params += " neonmwi_monitor=1";
|
||||
var h = ASTGUI.getFieldValue('neonmwi_level');
|
||||
if(h){ params += ' neonmwi_level=' + h ; }
|
||||
var h = ASTGUI.getFieldValue('neonmwi_offlimit');
|
||||
if(h){ params += ' neonmwi_offlimit=' + h ; }
|
||||
}else{
|
||||
params += " neonmwi_monitor=0";
|
||||
}
|
||||
|
||||
if( isREVC ){
|
||||
h = ASTGUI.getFieldValue('vpmnlptype') ;
|
||||
if(h){ params += " vpmnlptype=" + h; }
|
||||
h = ASTGUI.getFieldValue('vpmnlpthresh') ;
|
||||
if(h){ params += " vpmnlpthresh=" + h; }
|
||||
h = ASTGUI.getFieldValue('vpmnlpmaxsupp');
|
||||
if(h){ params += " vpmnlpmaxsupp=" + h; }
|
||||
}
|
||||
|
||||
var cmd2 = "echo \"" + params + "\" >> /etc/modprobe.conf ";
|
||||
|
||||
var update_usersConf = function(){
|
||||
// update MWI settings in users.conf
|
||||
var u = new listOfSynActions('users.conf');
|
||||
if( ASTGUI.getFieldValue('mwimode') == 'FSK'){
|
||||
u.new_action('update', 'general' , 'mwimonitor', 'fsk');
|
||||
u.new_action('update', 'general' , 'mwilevel', '512');
|
||||
u.new_action('update', 'general' , 'mwimonitornotify', '__builtin__');
|
||||
}
|
||||
if( ASTGUI.getFieldValue('mwimode') == 'NEON'){
|
||||
u.new_action('delete', 'general' , 'mwilevel', '','');
|
||||
u.new_action('update', 'general' , 'mwimonitor', 'neon');
|
||||
u.new_action('update', 'general' , 'mwimonitornotify', '__builtin__');
|
||||
}
|
||||
u.callActions();
|
||||
ASTGUI.dialog.hide();
|
||||
ASTGUI.feedback( { msg:"updated settings !!", showfor: 3 });
|
||||
alert('New settings will be applied on reboot!');
|
||||
window.location.reload();
|
||||
|
||||
};
|
||||
|
||||
ASTGUI.systemCmd( cmd1, function(){
|
||||
ASTGUI.systemCmd( cmd2, function(){
|
||||
ASTGUI.dialog.waitWhile('updating Analog Trunks with MWI settings ...');
|
||||
update_usersConf();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
generate_zaptel: function(){
|
||||
parent.ASTGUI.systemCmd( top.sessionData.directories.script_generateZaptel + " applysettings" , function(){
|
||||
parent.sessionData.REQUIRE_RESTART = true ;
|
||||
parent.ASTGUI.systemCmd( "ztcfg -vv" , function(){
|
||||
applySettings.save_opermode_settings();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
updateZaptel: function(){ // applySettings.updateZaptel();
|
||||
parent.ASTGUI.dialog.waitWhile('Saving Changes ...');
|
||||
var context = 'general';
|
||||
var x = new listOfActions('applyzap.conf');
|
||||
x.new_action('delcat', context,"", "");
|
||||
x.new_action('newcat', context, "", "");
|
||||
// write back any actual analog ports
|
||||
parent.sessionData.PORTS_SIGNALLING.ls = []; // reset previous signalling data
|
||||
parent.sessionData.PORTS_SIGNALLING.ks = [];
|
||||
|
||||
if( parent.sessionData.FXO_PORTS_DETECTED.length){
|
||||
|
||||
//x.new_action('append', context, 'fxsks', parent.sessionData.FXO_PORTS_DETECTED.join(',')); // FXO ports will be fxs signalled
|
||||
(function(){
|
||||
var ks_fxoPorts = [];
|
||||
var ls_fxoPorts = [];
|
||||
var t = parent.sessionData.FXO_PORTS_DETECTED ;
|
||||
for( var i = 0 ; i < t.length ; i++){
|
||||
if( _$('sig_analog_port_' + t[i] ).value == 'ls' ){
|
||||
ls_fxoPorts.push( t[i] );
|
||||
}else{
|
||||
ks_fxoPorts.push( t[i] );
|
||||
}
|
||||
}
|
||||
if( ls_fxoPorts.length ){
|
||||
x.new_action('append', context, 'fxsls', ls_fxoPorts.join(',')); // FXO ports will be fxs signalled
|
||||
}
|
||||
if( ks_fxoPorts.length ){
|
||||
x.new_action('append', context, 'fxsks', ks_fxoPorts.join(',')); // FXO ports will be fxs signalled
|
||||
}
|
||||
parent.sessionData.PORTS_SIGNALLING.ls = parent.sessionData.PORTS_SIGNALLING.ls.concat(ls_fxoPorts);
|
||||
parent.sessionData.PORTS_SIGNALLING.ks = parent.sessionData.PORTS_SIGNALLING.ks.concat(ks_fxoPorts);
|
||||
})();
|
||||
}
|
||||
|
||||
if( parent.sessionData.FXS_PORTS_DETECTED.length){
|
||||
//x.new_action('append', context, 'fxoks', parent.sessionData.FXS_PORTS_DETECTED.join(',')); // FXS ports will be fxo signalled
|
||||
(function(){
|
||||
var ks_fxsPorts = [];
|
||||
var ls_fxsPorts = [];
|
||||
var t = parent.sessionData.FXS_PORTS_DETECTED ;
|
||||
for( var i = 0 ; i < t.length ; i++){
|
||||
if( _$('sig_analog_port_' + t[i] ).value == 'ls' ){
|
||||
ls_fxsPorts.push( t[i] );
|
||||
}else{
|
||||
ks_fxsPorts.push( t[i] );
|
||||
}
|
||||
}
|
||||
if( ls_fxsPorts.length ){
|
||||
x.new_action('append', context, 'fxols', ls_fxsPorts.join(',')); // FXS ports will be fxo signalled
|
||||
}
|
||||
if( ks_fxsPorts.length ){
|
||||
x.new_action('append', context, 'fxoks', ks_fxsPorts.join(',')); // FXS ports will be fxo signalled
|
||||
}
|
||||
parent.sessionData.PORTS_SIGNALLING.ls = parent.sessionData.PORTS_SIGNALLING.ls.concat(ls_fxsPorts);
|
||||
parent.sessionData.PORTS_SIGNALLING.ks = parent.sessionData.PORTS_SIGNALLING.ks.concat(ks_fxsPorts);
|
||||
})();
|
||||
}
|
||||
x.new_action('append', context, 'loadzone', _$('loadZone').value);
|
||||
x.new_action('append', context, 'defaultzone', _$('loadZone').value);
|
||||
x.callActions( applySettings.generate_zaptel );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var localajaxinit = function(){
|
||||
ASTGUI.Log.Debug("Starting Loading Page hardware_aa50.html .. start function: window.onload()");
|
||||
ASTGUI.dialog.waitWhile('Detecting Hardware ...');
|
||||
top.document.title = "Analog Hardware Setup & Configuration";
|
||||
load_currentAnalogSettings();
|
||||
ASTGUI.Log.Debug("end of function: window.onload()");
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var load_currentAnalogSettings = function(){
|
||||
if(!parent.sessionData.FXS_PORTS_DETECTED.length && !parent.sessionData.FXO_PORTS_DETECTED.length ){
|
||||
var newRow = _$('FXSFXO_ports_td').insertRow(-1) ;
|
||||
newRow.className = 'even' ;
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: 'No Analog Hardware detected !!' , align: 'center' } );
|
||||
HAS_ANALOGHARDWARE = false;
|
||||
}else{
|
||||
ASTGUI.dialog.waitWhile('loading current hardware settings ...');
|
||||
(function(){
|
||||
var tbl = _$('FXSFXO_ports_td');
|
||||
var addCell = ASTGUI.domActions.tr_addCell;
|
||||
var newRow = tbl.insertRow(-1);
|
||||
newRow.className = "frow";
|
||||
addCell( newRow , { html:'<B>Type</B>', align: 'center'});
|
||||
addCell( newRow , { html:'<B>Signalling</B>', align: 'center' });
|
||||
addCell( newRow , { html:'<B>User/Trunk</B>', align: 'center' });
|
||||
|
||||
var h_2_orig = document.createElement('select');
|
||||
ASTGUI.selectbox.append( h_2_orig, 'Kewl Start', 'ks');
|
||||
ASTGUI.selectbox.append( h_2_orig, 'Loop Start', 'ls');
|
||||
h_2_orig.className = 'input8';
|
||||
|
||||
parent.sessionData.FXS_PORTS_DETECTED.each( function( this_fxs_port ){
|
||||
var newRow = tbl.insertRow(-1);
|
||||
newRow.className = "even";
|
||||
var tmp_user_str = '<font color=red>unassigned</font>';
|
||||
var users = parent.sessionData.pbxinfo.users ;
|
||||
for( var this_user in users ){
|
||||
if( users.hasOwnProperty(this_user) ){
|
||||
if( users[this_user].getProperty('zapchan') == this_fxs_port ){
|
||||
tmp_user_str = this_user + ' ('+ users[this_user].getProperty('fullname') + ')';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
addCell( newRow , { html: '<B>FXS Port </B>', align:'center' });
|
||||
var newcell = newRow.insertCell( newRow.cells.length );
|
||||
var h_3 = document.createElement('span'); h_3.innerHTML = 'Port ' + this_fxs_port + ' : ' ;
|
||||
var h_2 = h_2_orig.cloneNode(true);
|
||||
h_2.id = 'sig_analog_port_' + this_fxs_port ;
|
||||
h_2.selectedIndex = ( ASTGUI.miscFunctions.ArrayContains(parent.sessionData.PORTS_SIGNALLING.ls, this_fxs_port ) ) ? 1 : 0 ;
|
||||
newcell.appendChild( h_3 );
|
||||
newcell.appendChild( h_2 );
|
||||
newcell.align = 'center';
|
||||
addCell( newRow , { html: tmp_user_str });
|
||||
|
||||
} );
|
||||
|
||||
|
||||
parent.sessionData.FXO_PORTS_DETECTED.each( function( this_fxo_port ){
|
||||
var newRow = tbl.insertRow(-1);
|
||||
newRow.className = "odd";
|
||||
var tmp_user_str = '<font color=red>unassigned</font>';
|
||||
var atrunks = parent.sessionData.pbxinfo['trunks']['analog'] ;
|
||||
for( var this_trunk in atrunks ){
|
||||
if( atrunks.hasOwnProperty(this_trunk) ){
|
||||
var tmp = atrunks[this_trunk].getProperty('zapchan').split(',') ;
|
||||
if( tmp.contains(this_fxo_port) ){
|
||||
tmp_user_str = atrunks[this_trunk].getProperty('trunkname') ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addCell( newRow , { html: '<B>FXO Port </B>', align:'center' });
|
||||
|
||||
var newcell = newRow.insertCell( newRow.cells.length );
|
||||
var h_3 = document.createElement('span'); h_3.innerHTML = 'Port ' + this_fxo_port + ' : ' ;
|
||||
var h_2 = h_2_orig.cloneNode(true);
|
||||
h_2.id = 'sig_analog_port_' + this_fxo_port ;
|
||||
h_2.selectedIndex = ( ASTGUI.miscFunctions.ArrayContains(parent.sessionData.PORTS_SIGNALLING.ls, this_fxo_port ) ) ? 1 : 0 ;
|
||||
newcell.appendChild( h_3 );
|
||||
newcell.appendChild( h_2 );
|
||||
newcell.align = 'center';
|
||||
|
||||
addCell( newRow , { html: tmp_user_str });
|
||||
});
|
||||
})();
|
||||
}
|
||||
|
||||
(function(){ // load tonezone/loadzone
|
||||
// we parse zaptel.conf to get the loadzone
|
||||
var tmp_file = ASTGUI.globals.zaptelIncludeFile;
|
||||
var parseZaptelconf = function(zp){
|
||||
var t = zp['general'] ; // t is an array
|
||||
var line = '';
|
||||
_$('loadZone').selectedIndex = 0;
|
||||
for( var g=0; g < t.length; g++ ){
|
||||
line = t[g];
|
||||
try{
|
||||
if( line.beginsWith('loadzone=')) {
|
||||
ASTGUI.selectbox.selectOption( _$('loadZone'), line.lChop('loadzone=') );
|
||||
return;
|
||||
}
|
||||
}catch(err){
|
||||
_$('loadZone').selectedIndex = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
var s = $.ajax({ url: ASTGUI.paths.rawman+'?action=getconfig&filename=' + tmp_file , async: false }).responseText;
|
||||
if( s.contains('Response: Error') && s.contains('Message: Config file not found') ){
|
||||
ASTGUI.systemCmd( "touch /etc/asterisk/" + tmp_file, function(){
|
||||
var u = new listOfSynActions(tmp_file) ;
|
||||
u.new_action('delcat', 'general', "", "");
|
||||
u.new_action('newcat', 'general', "", "");
|
||||
u.new_action('update', 'general', '#include "../zaptel.conf" ;', ' ;');
|
||||
u.callActions();
|
||||
var q = config2json({filename:tmp_file, usf:0});
|
||||
parseZaptelconf(q);
|
||||
});
|
||||
return;
|
||||
}else{
|
||||
var q = config2json({ configFile_output:s , usf:0 });
|
||||
if( q.hasOwnProperty('general') ){
|
||||
parseZaptelconf(q);
|
||||
}
|
||||
}
|
||||
top.log.debug("end of function: loadConfigFiles.load_zaptel_conf()");
|
||||
})();
|
||||
|
||||
(function(){ // load modprobe settings
|
||||
ASTGUI.selectbox.populateOptions ( 'vpmnlpthresh', 50) ;
|
||||
ASTGUI.selectbox.populateOptions ( 'vpmnlpmaxsupp', 50) ;
|
||||
ASTGUI.selectbox.insert_before('vpmnlpmaxsupp', '0', '0', 0) ;
|
||||
|
||||
var c = context2json ({ filename: ASTGUI.globals.configfile , context: 'general', usf: 1 });
|
||||
ASTGUI.updateFieldToValue( 'opermode' , c.getProperty('opermode') );
|
||||
ASTGUI.updateFieldToValue( 'alawoverride' , c.getProperty('alawoverride') );
|
||||
ASTGUI.updateFieldToValue( 'fxshonormode' , c.getProperty('fxshonormode') );
|
||||
ASTGUI.updateFieldToValue( 'boostringer' , c.getProperty('boostringer') );
|
||||
ASTGUI.updateFieldToValue( 'lowpower' , c.getProperty('lowpower') );
|
||||
ASTGUI.updateFieldToValue( 'fastringer' , c.getProperty('fastringer') );
|
||||
ASTGUI.updateFieldToValue( 'fwringdetect' , c.getProperty('fwringdetect') );
|
||||
ASTGUI.updateFieldToValue( 'neonmwi_level' , c.getProperty('neonmwi_level') || '75' );
|
||||
ASTGUI.updateFieldToValue( 'neonmwi_offlimit' , c.getProperty('neonmwi_offlimit') || '16000' );
|
||||
ASTGUI.updateFieldToValue( 'mwimode' , c.getProperty('mwimode') );
|
||||
|
||||
if(c.getProperty('mwimode') == 'NEON')$(".neon_settings").show();
|
||||
|
||||
ASTGUI.events.add( _$('mwimode'), 'change' , function(){
|
||||
if( _$('mwimode').value == 'NEON'){
|
||||
$(".neon_settings").show();
|
||||
}else{
|
||||
$(".neon_settings").hide();
|
||||
}
|
||||
}) ;
|
||||
|
||||
parent.ASTGUI.systemCmd( ' touch /etc/asterisk/applyzap.conf', function(){ // run ztscan and then try loading ztscan.conf
|
||||
setTimeout( function(){
|
||||
var DAHDI_version = "0";
|
||||
ASTGUI.systemCmdWithOutput( 'cat /sys/module/dahdi/version' , function(output){
|
||||
output = output.trim();
|
||||
if(output){
|
||||
DAHDI_version = output;
|
||||
}else{
|
||||
ASTGUI.systemCmdWithOutput( 'modinfo -F version dahdi' , function(output){
|
||||
output = output.trim();
|
||||
if(output){
|
||||
DAHDI_version = output;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
ASTGUI.systemCmdWithOutput( 'cat /proc/cmdline' , function(output){
|
||||
ASTGUI.dialog.hide();
|
||||
if( output.contains('boardrev=C') ){
|
||||
$('.hidevpm').show();
|
||||
isREVC = true;
|
||||
if(DAHDI_version.versionGreaterOrEqualTo("2.4.0") || parent.sessionData.PLATFORM.isAA50){
|
||||
ASTGUI.selectbox.append('vpmnlptype', "NLP Suppression", 4);
|
||||
ASTGUI.selectbox.append('vpmnlptype', "NLP AutoSuppression (default)", 6);
|
||||
ASTGUI.updateFieldToValue( 'vpmnlptype' , c.getProperty('vpmnlptype') || '6' );
|
||||
ASTGUI.updateFieldToValue( 'vpmnlpthresh' , c.getProperty('vpmnlpthresh') || '22' );
|
||||
ASTGUI.updateFieldToValue( 'vpmnlpmaxsupp' , c.getProperty('vpmnlpmaxsupp') || '10' );
|
||||
}else{
|
||||
ASTGUI.selectbox.append('vpmnlptype', "NLP Suppression (default)", 4);
|
||||
ASTGUI.updateFieldToValue( 'vpmnlptype' , c.getProperty('vpmnlptype') || '4' );
|
||||
ASTGUI.updateFieldToValue( 'vpmnlpthresh' , c.getProperty('vpmnlpthresh') || '24' );
|
||||
ASTGUI.updateFieldToValue( 'vpmnlpmaxsupp' , c.getProperty('vpmnlpmaxsupp') || '24' );
|
||||
}
|
||||
}
|
||||
});
|
||||
} , 700);
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
}; // End of load_currentAnalogSettings()
|
||||
1306
old-asterisk/asterisk/static-http/config/js/hardware_dahdi.js
Normal file
191
old-asterisk/asterisk/static-http/config/js/iax.js
Normal file
@@ -0,0 +1,191 @@
|
||||
/*
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* iax.html functions
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*/
|
||||
//Realtime : 'rtcachefriends', 'rtignoreexpire', 'rtupdate', 'rtautoclear'
|
||||
// CDR: amaflags, accountcode
|
||||
|
||||
var fieldnames = [ 'adsi', 'authdebug', 'autokill', 'bandwidth', 'bindaddr', 'bindport', 'codecpriority', 'delayreject', 'dropcount', 'forcejitterbuffer', 'iaxcompat', 'iaxmaxthreadcount', 'iaxthreadcount', 'jitterbuffer', 'jittershrinkrate', 'language', 'maxexcessbuffer', 'maxjitterbuffer', 'maxjitterinterps', 'maxregexpire', 'minexcessbuffer', 'minregexpire', 'mohinterpret', 'mohsuggest', 'nochecksums','resyncthreshold', 'tos', 'trunkfreq', 'trunktimestamps', 'calltokenoptional', 'maxcallnumbers', 'maxcallnumbers_nonvalidated'];
|
||||
var callNumberLimitsList = [];
|
||||
|
||||
var localajaxinit = function(){
|
||||
top.document.title = 'global IAX settings' ;
|
||||
(function(){
|
||||
var hideall = function(){
|
||||
$('#iaxoptions_general').hide() ;
|
||||
//$('#iaxoptions_cdr').hide() ;
|
||||
$('#iaxoptions_jitterBuffer').hide() ;
|
||||
$('#iaxoptions_trunkregistration').hide() ;
|
||||
//$('#iaxoptions_realtime').hide() ;
|
||||
$('#iaxoptions_Codecs').hide() ;
|
||||
$('#iaxoptions_security').hide() ;
|
||||
};
|
||||
|
||||
var t = [
|
||||
{url:'#', desc:'General', click_function: function(){ hideall(); $('#iaxoptions_general').show(); } } ,
|
||||
//{url:'#', desc:'CDR', click_function: function(){ hideall(); $('#iaxoptions_cdr').show(); } },
|
||||
{url:'#', desc:'Jitter Buffer', click_function: function(){ hideall(); $('#iaxoptions_jitterBuffer').show();} },
|
||||
{url:'#', desc:'Registration', click_function: function(){ hideall(); $('#iaxoptions_trunkregistration').show(); } },
|
||||
//{url:'#', desc:'Realtime', click_function: function(){ hideall(); $('#iaxoptions_realtime').show(); } },
|
||||
{url:'#', desc:'Codecs', click_function: function(){ hideall(); $('#iaxoptions_Codecs').show(); } },
|
||||
{url:'#', desc:'Security', click_function: function(){ hideall(); $('#iaxoptions_security').show(); } }
|
||||
];
|
||||
ASTGUI.tabbedOptions( _$('tabbedMenu') , t );
|
||||
$('#tabbedMenu').find('A:eq(0)').click();
|
||||
})();
|
||||
|
||||
var c = context2json({ filename:'iax.conf' , context : 'general' , usf:1 });
|
||||
var AU = ASTGUI.updateFieldToValue ; // temporarily cache function
|
||||
fieldnames.each( function(fld){
|
||||
var val = ( c[fld] ) ? c[fld] : '';
|
||||
AU(fld,val) ;
|
||||
});
|
||||
|
||||
var d = context2json({ filename:'iax.conf' , context : 'callnumberlimits' , usf:0 });
|
||||
if(d){
|
||||
d.each( function(fld){
|
||||
pushNewCallNumberLimit(fld);
|
||||
});
|
||||
}
|
||||
|
||||
var disallowed = false;
|
||||
var real_codecs;
|
||||
ASTGUI.CODECSLIST.populateCodecsList(_$('allow'));
|
||||
if( c.hasOwnProperty('allow') ){ real_codecs = c['array']; }
|
||||
if( c.hasOwnProperty('disallow') ) { disallowed = c['disallow'].split(','); }
|
||||
var default_selected = ['ulaw','alaw','gsm'];
|
||||
default_selected.each( function(val) {
|
||||
if (!disallowed.contains(val)) {
|
||||
real_codecs = real_codecs + "," + val;
|
||||
}
|
||||
});
|
||||
ASTGUI.CODECSLIST.selectCodecs(_$('allow'), real_codecs);
|
||||
}
|
||||
|
||||
|
||||
var saveChanges = function(){
|
||||
var cat = 'general';
|
||||
var after = function(){
|
||||
parent.ASTGUI.dialog.hide();
|
||||
ASTGUI.feedback({ msg:'Changes Saved !', showfor:2 });
|
||||
};
|
||||
var skip_ifempty = ['register', 'localnet', 'externhost', 'externip'];
|
||||
var x = new listOfActions('iax.conf');
|
||||
/* Can't use fieldnames.each here because the return statement
|
||||
would return from the anonymous function passed to the iterator,
|
||||
not saveChanges(). */
|
||||
for(var i = 0; i < fieldnames.length ; i++){
|
||||
var fld = fieldnames[i];
|
||||
var val = ASTGUI.getFieldValue(fld).trim();
|
||||
if (val == "") {
|
||||
if (skip_ifempty.contains(fld)) {
|
||||
return;
|
||||
}
|
||||
x.new_action('delete', cat , fld , '') ;
|
||||
} else {
|
||||
if (!ASTGUI.validateFields([fld])) { return; }
|
||||
x.new_action('update', cat , fld , val) ;
|
||||
}
|
||||
}
|
||||
|
||||
x.new_action('delcat', 'callnumberlimits', '', '');
|
||||
if (callNumberLimitsList.length >= 0){
|
||||
x.new_action('newcat', 'callnumberlimits', '', '')
|
||||
}
|
||||
|
||||
callNumberLimitsList.each( function(eachOne){
|
||||
var pieces = eachOne.split('=');
|
||||
x.new_action('append', 'callnumberlimits' , pieces[0], pieces[1]) ;
|
||||
});
|
||||
|
||||
x.new_action('delete', cat , 'disallow', '' ) ;
|
||||
x.new_action('delete', cat , 'allow', '' ) ;
|
||||
x.new_action('append', cat , 'disallow', 'all' ) ;
|
||||
x.new_action('append', cat , 'allow', ASTGUI.CODECSLIST.getSelectedCodecs(_$('allow')) ) ;
|
||||
|
||||
parent.ASTGUI.dialog.waitWhile(' Saving ...');
|
||||
setTimeout( function(){ x.callActions(after) ; } , 300 );
|
||||
hideCallNumberLimitsForm();
|
||||
}
|
||||
|
||||
var showCallNumberLimitsForm = function(){
|
||||
ASTGUI.updateFieldToValue('form_newCallNumberLimit_ip', '');
|
||||
ASTGUI.updateFieldToValue('form_newCallNumberLimit_maxcallnumbers', '');
|
||||
$('.form_newCallNumberLimit').show();
|
||||
$($('.form_newCallNumberLimit')[0]).hide();
|
||||
}
|
||||
|
||||
var hideCallNumberLimitsForm = function(){
|
||||
$('.form_newCallNumberLimit').hide();
|
||||
$($('.form_newCallNumberLimit')[0]).show();
|
||||
}
|
||||
|
||||
var pushNewCallNumberLimit = function(limit_str){
|
||||
if(limit_str){
|
||||
var p = limit_str.split("=");
|
||||
var new_ip = p[0];
|
||||
var new_maxcallnumbers = p[1];
|
||||
}else{
|
||||
var new_ip = ASTGUI.getFieldValue( 'form_newCallNumberLimit_ip' );
|
||||
var new_maxcallnumbers = ASTGUI.getFieldValue( 'form_newCallNumberLimit_maxcallnumbers' );
|
||||
}
|
||||
var tmp_pieces = new_ip.split("/");
|
||||
if (!limit_str && !ASTGUI.validateFields(['form_newCallNumberLimit_ip'])){
|
||||
return;
|
||||
} else if (!callNumberLimitsList.contains(new_ip + "=" + new_maxcallnumbers)){
|
||||
callNumberLimitsList.push(new_ip + "=" + new_maxcallnumbers);
|
||||
clearCallNumberLimitsForm();
|
||||
refreshCallNumberLimitsList();
|
||||
}
|
||||
}
|
||||
|
||||
var deleteCallNumber = function(indexno){
|
||||
callNumberLimitsList.splice(indexno, 1);
|
||||
refreshCallNumberLimitsList();
|
||||
}
|
||||
|
||||
var clearCallNumberLimitsForm = function(){
|
||||
ASTGUI.updateFieldToValue('form_newCallNumberLimit_ip', '');
|
||||
ASTGUI.updateFieldToValue('form_newCallNumberLimit_maxcallnumbers', '');
|
||||
}
|
||||
|
||||
var refreshCallNumberLimitsList = function(){
|
||||
ASTGUI.domActions.removeAllChilds( 'callNumberLimits');
|
||||
|
||||
for (var i = 0; i < callNumberLimitsList.length; i++){
|
||||
var pieces = callNumberLimitsList[i].split("=");
|
||||
|
||||
var row_div = document.createElement('div');
|
||||
row_div.id = callNumberLimitsList[i];
|
||||
row_div.innerHTML = pieces[0] + " = " + pieces[1];
|
||||
|
||||
var sp_delete = document.createElement('span');
|
||||
sp_delete.className = 'callnumber_delete';
|
||||
sp_delete.innerHTML = ' ';
|
||||
sp_delete.id = "callNumberLimit" + i;
|
||||
row_div.appendChild(sp_delete);
|
||||
|
||||
_$('callNumberLimits').appendChild(row_div);
|
||||
$('#callNumberLimit' + i).click(function(e){
|
||||
deleteCallNumber($(this).attr('id').substr(15));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
392
old-asterisk/asterisk/static-http/config/js/incoming.js
Normal file
@@ -0,0 +1,392 @@
|
||||
/*
|
||||
* Asterisk-GUI - an Asterisk configuration interface
|
||||
*
|
||||
* incoming.html functions
|
||||
*
|
||||
* Copyright (C) 2006-2008, Digium, Inc.
|
||||
*
|
||||
* Pari Nannapaneni <pari@digium.com>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*
|
||||
*/
|
||||
var STRING_SEPERATOR = '#######' ; // will be used to store 'actual context line + contextname' as a DOM attribute, will not be written to any file
|
||||
var isNewIR = false;
|
||||
var EDIT_CONTEXT_IR = '';
|
||||
var EDIT_CONTEXT_IR_LINE = '';
|
||||
var EX_CF;
|
||||
|
||||
var incomingRules_MiscFunctions = {
|
||||
// newRow.ACTUAL_LINE__CONTEXT = did_this_rule + STRING_SEPERATOR + ASTGUI.contexts.TrunkDIDPrefix + this_trunk ;
|
||||
|
||||
moveUpDown_In_context: function(context, rule , updown ){ // var incomingRules_MiscFunctions.moveUpDown_In_context( ct , rule , bool )
|
||||
parent.ASTGUI.dialog.waitWhile('Updating Incoming Rule ...');
|
||||
ASTGUI.miscFunctions.moveUpDown_In_context( context , rule , updown , function(newcontext){
|
||||
parent.ASTGUI.dialog.hide();
|
||||
ASTGUI.feedback( { msg: 'updated !', showfor: 2 , color: 'green', bgcolor: '#FFFFFF' } );
|
||||
window.location.reload();
|
||||
});
|
||||
},
|
||||
|
||||
edit_IR : function(s){
|
||||
isNewIR = false ;
|
||||
var k = s.parentNode;
|
||||
while( k.tagName != 'TR' ){ k = k.parentNode; }
|
||||
|
||||
if ( jQuery.browser.msie ){
|
||||
var ALC = $(k).attr('ACTUAL_LINE__CONTEXT') || '';
|
||||
}else{
|
||||
var ALC = ( k.hasOwnProperty('ACTUAL_LINE__CONTEXT') ) ? k.ACTUAL_LINE__CONTEXT : '';
|
||||
}
|
||||
|
||||
if( !ALC || !ALC.contains(STRING_SEPERATOR) ) return ;
|
||||
|
||||
EDIT_CONTEXT_IR = ALC.split(STRING_SEPERATOR)[1] ;
|
||||
EDIT_CONTEXT_IR_LINE = ALC.split(STRING_SEPERATOR)[0] ;
|
||||
|
||||
if( !EDIT_CONTEXT_IR.contains(ASTGUI.contexts.TimeIntervalPrefix) && EDIT_CONTEXT_IR.endsWith(ASTGUI.contexts.TrunkDefaultSuffix) ){
|
||||
var tmp_TRUNK = EDIT_CONTEXT_IR.lChop(ASTGUI.contexts.TrunkDIDPrefix).beforeStr( ASTGUI.contexts.TrunkDefaultSuffix );
|
||||
}else{
|
||||
var tmp_TRUNK = EDIT_CONTEXT_IR.lChop(ASTGUI.contexts.TrunkDIDPrefix).beforeStr( '_' + ASTGUI.contexts.TimeIntervalPrefix );
|
||||
}
|
||||
|
||||
var tmp_edit_itrl_tf = EDIT_CONTEXT_IR.afterStr( ASTGUI.contexts.TimeIntervalPrefix ) ;
|
||||
|
||||
$('.hideOnEdit').hide();
|
||||
_$('div_ir_edit_title').innerHTML = 'Edit Incoming Calling Rule, Trunk: ' + tmp_TRUNK + ' , Time Interval: ' + ( tmp_edit_itrl_tf || 'none' ) ;
|
||||
|
||||
ASTGUI.updateFieldToValue( 'edit_itrl_trunk', tmp_TRUNK ) ;
|
||||
ASTGUI.updateFieldToValue( 'edit_itrl_tf', tmp_edit_itrl_tf ) ;
|
||||
ASTGUI.updateFieldToValue( 'edit_itrl_pattern', ASTGUI.parseContextLine.getExten( EDIT_CONTEXT_IR_LINE ) );
|
||||
|
||||
$('.localext_byDid').hide();
|
||||
if( EDIT_CONTEXT_IR_LINE.contains(',1,Goto(default,${EXTEN') ){
|
||||
$('.localext_byDid').show();
|
||||
ASTGUI.updateFieldToValue( 'edit_itrl_dest', 'ByDID' );
|
||||
var tmp_ldp = EDIT_CONTEXT_IR_LINE.betweenXY('{','}').lChop('EXTEN').lChop(':') ;
|
||||
if( !tmp_ldp.length ){ tmp_ldp = '0'; }
|
||||
ASTGUI.updateFieldToValue( 'edit_itrl_LocalDest_Pattern', tmp_ldp );
|
||||
}else{
|
||||
ASTGUI.updateFieldToValue( 'edit_itrl_dest', ASTGUI.parseContextLine.getAppWithArgs( EDIT_CONTEXT_IR_LINE ) );
|
||||
}
|
||||
|
||||
incomingRules_MiscFunctions.enableDisablePattern();
|
||||
ASTGUI.feedback( { msg: 'Edit Incoming Rule !', showfor: 2 , color: 'green', bgcolor: '#FFFFFF' } );
|
||||
$('#div_ir_edit').showWithBg();
|
||||
},
|
||||
|
||||
delete_IR : function(s){ // incomingRules_MiscFunctions.delete_IR()
|
||||
//var s = ASTGUI.events.getTarget(event);
|
||||
if (!confirm( "Are you sure you want to delete this 'Incoming Rule' ?" ) ) { return; }
|
||||
|
||||
var k = s.parentNode;
|
||||
while( k.tagName != 'TR' ){ k = k.parentNode; }
|
||||
|
||||
if ( jQuery.browser.msie ){
|
||||
var ALC = $(k).attr('ACTUAL_LINE__CONTEXT') || '';
|
||||
}else{
|
||||
var ALC = ( k.hasOwnProperty('ACTUAL_LINE__CONTEXT') ) ? k.ACTUAL_LINE__CONTEXT : '';
|
||||
}
|
||||
|
||||
if( !ALC || !ALC.contains(STRING_SEPERATOR) ) return ;
|
||||
|
||||
var TMP_CONTEXT = ALC.split(STRING_SEPERATOR)[1] ;
|
||||
var TMP_LINE = ALC.split(STRING_SEPERATOR)[0] ;
|
||||
|
||||
var resp = top.pbx.trunks.rules.remove({cxt: TMP_CONTEXT, line: TMP_LINE});
|
||||
if (!resp) {
|
||||
ASTGUI.feedback({
|
||||
color: 'red',
|
||||
msg: 'Error removing Calling Rule.',
|
||||
showfor: 2
|
||||
});
|
||||
} else {
|
||||
ASTGUI.feedback({
|
||||
color: 'green',
|
||||
msg: 'Deleted Incoming Rule.',
|
||||
showfor: 2
|
||||
});
|
||||
}
|
||||
|
||||
window.location.reload();
|
||||
return;
|
||||
},
|
||||
|
||||
listAllRulesInTable : function(){ // incomingRules_MiscFunctions.listAllRulesInTable();
|
||||
EX_CF = config2json({filename:'extensions.conf', usf:0 });
|
||||
var t = parent.pbx.trunks.list() || [];
|
||||
|
||||
if ( !t.length ){
|
||||
|
||||
var TBL = document.createElement('TABLE');
|
||||
TBL.cellPadding = 0;
|
||||
TBL.cellSpacing = 0;
|
||||
TBL.border = 0;
|
||||
TBL.className = 'table_incomingRulesList';
|
||||
|
||||
var newRow = TBL.insertRow(-1);
|
||||
newRow.className = 'even';
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: 'You do not have any trunks created. <BR> You need to have atleast one trunk to be able to manage incoming call rules.', width: '95%' } );
|
||||
|
||||
var tbl_heading = document.createElement('div');
|
||||
tbl_heading.style.marginTop = '35px';
|
||||
tbl_heading.appendChild(TBL);
|
||||
_$('IR_CONTAINER').appendChild(tbl_heading);
|
||||
$('.top_buttons').hide();
|
||||
return;
|
||||
}
|
||||
|
||||
var TMP_FORSORT = [];
|
||||
t.each( function(item){
|
||||
TMP_FORSORT.push( parent.pbx.trunks.getName(item) + STRING_SEPERATOR + item);
|
||||
});
|
||||
|
||||
TMP_FORSORT.sort();
|
||||
TMP_FORSORT.each( function(this_str){
|
||||
var a = this_str.split(STRING_SEPERATOR); // a[0] is trunkname , a[1] is trunk
|
||||
var this_trunk = a[1];
|
||||
var this_trunk_label = a[0];
|
||||
var ttype = parent.pbx.trunks.getType(this_trunk);
|
||||
var defaultContext_ContextName = ASTGUI.contexts.TrunkDIDPrefix + this_trunk + ASTGUI.contexts.TrunkDefaultSuffix ;
|
||||
|
||||
ASTGUI.selectbox.append('edit_itrl_trunk', this_trunk_label , this_trunk );
|
||||
|
||||
var TBL = document.createElement('TABLE');
|
||||
TBL.cellPadding = 0;
|
||||
TBL.cellSpacing = 0;
|
||||
TBL.border = 0;
|
||||
TBL.className = 'table_incomingRulesList';
|
||||
|
||||
var newRow = TBL.insertRow(-1);
|
||||
newRow.className = 'frow';
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: '', width: '25px' } );
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: 'Time Interval' } );
|
||||
if( ttype != 'analog' ){
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: 'Pattern' } );
|
||||
}
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: 'Destination' } );
|
||||
if( ttype != 'analog' ){
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: 'Sort' } );
|
||||
}
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: '' } );
|
||||
|
||||
var PREVIOUS_SET_BGClass = 'odd' ; // odd or even
|
||||
|
||||
if( ! EX_CF.hasOwnProperty( ASTGUI.contexts.TrunkDIDPrefix + this_trunk ) ){ return ; }
|
||||
|
||||
EX_CF[ASTGUI.contexts.TrunkDIDPrefix + this_trunk].each( function( did_this_rule , main_did_index ){
|
||||
|
||||
// If is a TimeInterval Context
|
||||
if( did_this_rule.beginsWith( 'include=' ) && did_this_rule.contains( '_' + ASTGUI.contexts.TimeIntervalPrefix ) ){
|
||||
var THIS_TRUNK_TIMEFRAME_CONTEXT = did_this_rule.betweenXY('=', top.session.delimiter);
|
||||
var THIS_TIMEFRAME = THIS_TRUNK_TIMEFRAME_CONTEXT.lChop( ASTGUI.contexts.TrunkDIDPrefix + this_trunk + '_' + ASTGUI.contexts.TimeIntervalPrefix );
|
||||
if( ! EX_CF.hasOwnProperty( THIS_TRUNK_TIMEFRAME_CONTEXT ) ){ return ; }
|
||||
|
||||
EX_CF[ THIS_TRUNK_TIMEFRAME_CONTEXT ].each( function( this_rule , this_rule_index ){
|
||||
var tmp_exten = ASTGUI.parseContextLine.getExten(this_rule) ;
|
||||
if ( tmp_exten == 's' && this_rule.contains('ExecIf') ){ return ;}
|
||||
var newRow = TBL.insertRow(-1);
|
||||
newRow.ACTUAL_LINE__CONTEXT = this_rule + STRING_SEPERATOR + THIS_TRUNK_TIMEFRAME_CONTEXT ;
|
||||
if ( this_rule_index == 0 ){
|
||||
PREVIOUS_SET_BGClass = (PREVIOUS_SET_BGClass == 'odd')? 'even' : 'odd' ;
|
||||
if( main_did_index != 0 ){
|
||||
var tmp_MOVE_TI_UP = "<A href=# title='Move this time Interval context Up'><img src=images/arrow_up.png border=0 onclick=\"incomingRules_MiscFunctions.moveUpDown_In_context('" + ASTGUI.contexts.TrunkDIDPrefix + this_trunk + "','" + did_this_rule + "', 1)\"></A>" ;
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: tmp_MOVE_TI_UP }) ;
|
||||
}else{
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: '' }) ;
|
||||
}
|
||||
}else{
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: '' } );
|
||||
}
|
||||
|
||||
newRow.className = PREVIOUS_SET_BGClass ;
|
||||
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: THIS_TIMEFRAME });
|
||||
if( ttype != 'analog' && tmp_exten == 's' ){
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: "'s' (CatchAll)" });
|
||||
}else if( ttype != 'analog' && tmp_exten == '_X.' ){
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: "'_X.' (CatchAll)" });
|
||||
}else if( ttype != 'analog' ){
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: tmp_exten });
|
||||
}
|
||||
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: ASTGUI.parseContextLine.showAs(this_rule) });
|
||||
|
||||
if( ttype != 'analog' ){
|
||||
var tmp_movepriorities = '';
|
||||
if( this_rule_index == 0 ){
|
||||
tmp_movepriorities = '<img src=images/arrow_blank.png border=0> ' ;
|
||||
}else{
|
||||
tmp_movepriorities = "<A href=# title='Move this rule Up'><img src=images/arrow_up.png border=0 onclick=\"incomingRules_MiscFunctions.moveUpDown_In_context('" + THIS_TRUNK_TIMEFRAME_CONTEXT + "','" + this_rule+ "', 1)\"></A> " ;
|
||||
}
|
||||
|
||||
if( this_rule_index != (EX_CF[ THIS_TRUNK_TIMEFRAME_CONTEXT ].length -1 ) ){
|
||||
tmp_movepriorities += "<A href=# title='Move this rule Down'><img src=images/arrow_down.png border=0 onclick=\"incomingRules_MiscFunctions.moveUpDown_In_context('" + THIS_TRUNK_TIMEFRAME_CONTEXT + "','" + this_rule+ "', 0)\"></A>" ;
|
||||
}else{
|
||||
tmp_movepriorities += '<img src=images/arrow_blank.png border=0>' ;
|
||||
}
|
||||
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: tmp_movepriorities } );
|
||||
}
|
||||
|
||||
var tmp_editstr = [] ;
|
||||
tmp_editstr[0] = "<span class='guiButton' onclick=\"incomingRules_MiscFunctions.edit_IR(this)\">Edit</span> " ;
|
||||
// if( tmp_exten != 's' && tmp_exten != '_X.' ){
|
||||
tmp_editstr[1] = "<span class='guiButtonDelete' onclick=\"incomingRules_MiscFunctions.delete_IR(this)\">Delete</span>" ;
|
||||
// }
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: tmp_editstr.join(' ') } );
|
||||
});
|
||||
|
||||
// Default incoming rules (no time Interval matched)
|
||||
}else if( did_this_rule == 'include=' + defaultContext_ContextName ){
|
||||
|
||||
if( !EX_CF.hasOwnProperty(defaultContext_ContextName) ){ return; }
|
||||
|
||||
var defaultContext = EX_CF[ defaultContext_ContextName ];
|
||||
var tmp_defaultContext_length = EX_CF[ defaultContext_ContextName ].length ;
|
||||
|
||||
defaultContext.each( function( this_defaultRule , this_defaultRule_Index ){
|
||||
if( ! this_defaultRule.beginsWith( 'exten=' ) ){ return ; }// RULES in the main DID_trunk_x
|
||||
var tmp_exten = ASTGUI.parseContextLine.getExten(this_defaultRule);
|
||||
if ( tmp_exten == 's' && this_defaultRule.contains('ExecIf') ){ return ;}
|
||||
var newRow = TBL.insertRow(-1);
|
||||
newRow.className = (PREVIOUS_SET_BGClass == 'odd')? 'even' : 'odd' ;
|
||||
newRow.ACTUAL_LINE__CONTEXT = this_defaultRule + STRING_SEPERATOR + defaultContext_ContextName ;
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: '' });
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: '<font color=red>none (no TimeIntervals matched)</font>' });
|
||||
if( ttype != 'analog' ){
|
||||
|
||||
if( tmp_exten == 's' ){
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: "'s' (CatchAll)"});
|
||||
}else if ( tmp_exten == '_X.' ){
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: "'_X.' (CatchAll)"});
|
||||
}else{
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: tmp_exten });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: ASTGUI.parseContextLine.showAs(this_defaultRule) });
|
||||
|
||||
if( ttype != 'analog' ){
|
||||
var tmp_movepriorities = '' ;
|
||||
|
||||
if( this_defaultRule_Index != 0 ){
|
||||
tmp_movepriorities += "<A href=# title='Move this rule Up'><img src=images/arrow_up.png border=0 onclick=\"incomingRules_MiscFunctions.moveUpDown_In_context('" + defaultContext_ContextName + "','" + this_defaultRule + "', 1)\"></A> " ;
|
||||
}else{
|
||||
tmp_movepriorities += '<img src=images/arrow_blank.png border=0> ' ;
|
||||
}
|
||||
|
||||
if( this_defaultRule_Index != (tmp_defaultContext_length - 1) ){
|
||||
tmp_movepriorities += "<A href=# title='Move this rule Down'><img src=images/arrow_down.png border=0 onclick=\"incomingRules_MiscFunctions.moveUpDown_In_context('" + defaultContext_ContextName + "','" + this_defaultRule + "', 0)\"></A>" ;
|
||||
}else{
|
||||
tmp_movepriorities += '<img src=images/arrow_blank.png border=0> ' ;
|
||||
}
|
||||
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: tmp_movepriorities } );
|
||||
}
|
||||
|
||||
var tmp_editstr = [] ;
|
||||
tmp_editstr[0] = "<span class='guiButton' onclick=\"incomingRules_MiscFunctions.edit_IR(this)\">Edit</span> " ;
|
||||
tmp_editstr[1] = "<span class='guiButtonDelete' onclick=\"incomingRules_MiscFunctions.delete_IR(this)\">Delete</span>" ;
|
||||
ASTGUI.domActions.tr_addCell( newRow , { html: tmp_editstr.join(' ') });
|
||||
});
|
||||
}else{
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
var tbl_heading = document.createElement('div');
|
||||
tbl_heading.style.marginTop = '15px';
|
||||
tbl_heading.innerHTML = '<B>Trunk - ' + this_trunk_label + '</B>';
|
||||
_$('IR_CONTAINER').appendChild(tbl_heading);
|
||||
_$('IR_CONTAINER').appendChild(TBL);
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
new_IR_form: function(){
|
||||
isNewIR = true ;
|
||||
ASTGUI.resetTheseFields(['edit_itrl_trunk', 'edit_itrl_tf', 'edit_itrl_pattern', 'edit_itrl_dest' ]);
|
||||
incomingRules_MiscFunctions.enableDisablePattern();
|
||||
$('.localext_byDid').hide();
|
||||
_$('div_ir_edit_title').innerHTML = 'New Incoming Rule';
|
||||
ASTGUI.feedback( { msg: 'New Incoming Rule !', showfor: 2 , color: 'green', bgcolor: '#FFFFFF' } );
|
||||
$('.hideOnEdit').show();
|
||||
$('#div_ir_edit').showWithBg();
|
||||
},
|
||||
|
||||
|
||||
enableDisablePattern: function(){ // incomingRules_MiscFunctions.enableDisablePattern() ;
|
||||
var tn = _$('edit_itrl_trunk').value ;
|
||||
if (!tn){
|
||||
_$('edit_itrl_pattern').disabled = false;
|
||||
return ;
|
||||
}
|
||||
var ttype = parent.pbx.trunks.getType(tn);
|
||||
_$('edit_itrl_pattern').disabled = (ttype == 'analog') ? true : false;
|
||||
if( ttype == 'analog' ){
|
||||
_$('edit_itrl_pattern').value = 's' ;
|
||||
}
|
||||
},
|
||||
|
||||
update_IR : function(){ // incomingRules_MiscFunctions.update_IR() ;
|
||||
|
||||
if( !ASTGUI.checkRequiredFields([ 'edit_itrl_trunk', 'edit_itrl_dest', 'edit_itrl_pattern' ]) ){
|
||||
return ;
|
||||
}
|
||||
|
||||
if( _$('edit_itrl_tf').selectedIndex == -1 ){
|
||||
ASTGUI.feedback ({ msg: 'Please select a Time Interval !' , showfor:2, color:'#a02920' });
|
||||
return ;
|
||||
}
|
||||
if( !ASTGUI.validateFields([ 'edit_itrl_pattern' ]) ){
|
||||
return ;
|
||||
}
|
||||
|
||||
var this_trunk = ASTGUI.getFieldValue('edit_itrl_trunk');
|
||||
var this_tiName = ASTGUI.getFieldValue('edit_itrl_tf') ;
|
||||
var TMP_NEW_PATTERN = ASTGUI.getFieldValue('edit_itrl_pattern');
|
||||
var dest = $('#edit_itrl_dest').val();
|
||||
var local_dest = ASTGUI.getFieldValue('edit_itrl_LocalDest_Pattern');
|
||||
var time_int_name = $('#edit_itrl_tf option:selected').text();
|
||||
time_int_name = (time_int_name.contains('no Time Intervals')) ? '' : time_int_name;
|
||||
|
||||
if( ASTGUI.getFieldValue('edit_itrl_dest') == 'ByDID' && parent.pbx.trunks.getType(this_trunk) == 'analog' ){
|
||||
ASTGUI.feedback ({ msg: 'Local Extension by DID is not applicable for Analog Trunks !' , showfor:3, color:'red' });
|
||||
return ;
|
||||
}
|
||||
|
||||
if( isNewIR == true ){ // create new Incoming Rule
|
||||
parent.ASTGUI.dialog.waitWhile('Creating Incoming Rule ...');
|
||||
|
||||
if (parent.pbx.trunks.rules.add({trunk: this_trunk, name: time_int_name, time_interval: time_int_name, dest: dest, pattern: TMP_NEW_PATTERN, digits: local_dest})) {
|
||||
ASTGUI.feedback({ msg: 'Added!', showfor: 2, color: 'blue', bgcolor: '#ffffff'});
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
parent.ASTGUI.dialog.hide();
|
||||
}else{ // edit/update existing incoming rule
|
||||
var resp = parent.pbx.trunks.rules.edit({
|
||||
line: EDIT_CONTEXT_IR_LINE,
|
||||
dest: dest,
|
||||
digits: local_dest,
|
||||
cxt: EDIT_CONTEXT_IR,
|
||||
pattern: TMP_NEW_PATTERN
|
||||
});
|
||||
if (resp) {
|
||||
ASTGUI.feedback( { msg: 'Updated !', showfor: 2 , color: 'blue', bgcolor: '#FFFFFF' } );
|
||||
}
|
||||
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||