forked from SimplesIP/pabx-app
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
226 lines
12 KiB
226 lines
12 KiB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|
<html> |
|
|
|
<head> |
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
|
<link rel="stylesheet" href="admin/css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="ISO-8859-1" /> |
|
<script type="text/javascript" src="admin/js/jquery-1.4.js"></script> |
|
<script type="text/javascript" src="admin/js/jquery.blockUI.js?v2.29"></script> |
|
<script src="admin/js/jquery.min.js" type="text/javascript"></script> |
|
<script src="admin/js/jquery.validationEngine.js" type="text/javascript"></script> |
|
<script src="admin/js/jquery.validationEngine-en.js" type="text/javascript"></script> |
|
<script src="admin/js/pbxAjax.js" type="text/javascript"></script> |
|
|
|
<script> |
|
$(document).ready(function() { |
|
$("#form1").validationEngine({ |
|
sucess: function() { |
|
document.form1.submit(); |
|
}, |
|
failure: function() {} |
|
}) |
|
}); |
|
</script> |
|
<link href="admin/css/forms.css" rel="stylesheet" type="text/css"> |
|
</head> |
|
|
|
<body> |
|
<?php |
|
$acao = $_GET["acao"]; |
|
$toss = ['cs0', 'cs1', 'cs2', 'cs3', 'cs4', 'cs5', 'cs6', 'cs7', 'af11', 'af12', 'af13', 'af21', 'af22', 'af23', 'af31', 'af32', 'af33', 'af41', 'af42', 'af43', 'ef']; |
|
$org_id = GetOrganizacao(); |
|
|
|
if ($acao == 'salva') { |
|
$bindport = trim($_POST["bindport"]); |
|
$bindaddr = trim($_POST["bindaddr"]); |
|
$autokill = trim($_POST["autokill"]); |
|
$amaflags = trim($_POST["amaflags"]); |
|
$accountcode = trim($_POST["accountcode"]); |
|
$trunkfreq = trim($_POST["trunkfreq"]); |
|
$trunktimestamps = trim($_POST["trunktimestamps"]); |
|
$minregexpire = trim($_POST["minregexpire"]); |
|
$maxregexpire = trim($_POST["maxregexpire"]); |
|
$authdebug = trim($_POST["authdebug"]); |
|
$tos = trim($_POST["tos"]); |
|
|
|
$query = "UPDATE pbx_iax_general SET bindport='$bindport', bindaddr='$bindaddr',autokill='$autokill', |
|
amaflags='$amaflags', accountcode='$accountcode', trunkfreq='$trunkfreq', trunktimestamps='$trunktimestamps', |
|
minregexpire='$minregexpire', maxregexpire='$maxregexpire', authdebug='$authdebug', tos='$tos'"; |
|
|
|
pg_query($dbcon, $query); //gera arquivos e executa o reload dos dados no asterisk |
|
gera_arquivos($dbcon, 'IAX_GENERAL'); |
|
?> |
|
<script type="text/javascript"> |
|
fecha_popup(); |
|
</script> |
|
|
|
<?php |
|
} |
|
|
|
$query = "SELECT * FROM pbx_iax_general WHERE org_id = {$org_id}"; |
|
$result = pg_query($dbcon, $query); |
|
while ($dados = pg_fetch_array($result)) { |
|
?> |
|
<form name="form1" method="post" action="index.php?idProg=11110&pbxRequest=1&acao=salva" id="form1"> |
|
<table width="548" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#EAEAEA" bgcolor="#EAEAEA" class="tabela"> |
|
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA" background="img/button03.gif"> |
|
<td class="cabecalho2"> |
|
<div align="center" class="cabecalho" style="font-size: 12px">CONFIGURAÇÃO GLOBAL dE RAMAL IAX </div> |
|
</td> |
|
</tr> |
|
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA"> |
|
<td class="labels"> |
|
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
|
<tr> |
|
<td> |
|
<input name="id" type="text" value="<?= $dados["id"]; ?>" hidden /> |
|
</td> |
|
<td> |
|
<fieldset> |
|
<legend class="labels">Porta:</legend> |
|
<input name="bindport" type="text" class="validate[required,custom[onlyNumber],length[0,100]] caixas" id="bindport" value="<?= $dados["bindport"]; ?>" size="10" /> |
|
</fieldset> |
|
</td> |
|
<td> |
|
<fieldset> |
|
<legend class="labels">Interface de Rede:</legend> |
|
<input name="bindaddr" type="text" class="validate[required] caixas" id="bindaddr2" value="<?= $dados["bindaddr"]; ?>" size="20" /> |
|
</fieldset> |
|
</td> |
|
<td> |
|
<fieldset> |
|
<legend class="labels"> Desconectar Automatico:</legend> |
|
<?php |
|
switch (trim($dados["autokill"])) { |
|
case 'yes': |
|
$autokill1 = 'checked'; |
|
break; |
|
case 'no': |
|
$autokill2 = 'checked'; |
|
break; |
|
} |
|
?> |
|
<input name="autokill" type="radio" value="yes" <?= $autokill1; ?> /> |
|
Sim |
|
<input name="autokill" type="radio" value="no" <?= $autokill2; ?> /> |
|
Não |
|
</fieldset> |
|
</td> |
|
<td> |
|
<input name="amaflags" type="hidden" value=""> |
|
</td> |
|
</tr> |
|
</table> |
|
</td> |
|
</tr> |
|
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA"> |
|
<td class="labels"> |
|
<div align="right"></div> |
|
<div align="right"></div> |
|
<div align="left"> |
|
<table border="0" cellspacing="0" cellpadding="0"> |
|
<tr> |
|
<td> |
|
<fieldset> |
|
<legend class="labels">Monitorar Trunk:</legend> |
|
<input name="trunkfreq" type="text" class="caixas" id="trunkfreq2" value="<?= $dados["trunkfreq"]; ?>" size="10" maxlength="10" /> |
|
</fieldset> |
|
</td> |
|
<td> |
|
<fieldset> |
|
<legend class="labels">Tempo minimo para expirar:</legend> |
|
<input name="minregexpire" type="text" class="validate[optional,custom[onlyNumber],length[0,100]] caixas" id="minregexpire" value="<?= $dados["minregexpire"]; ?>" size="10" maxlength="10" /> |
|
|
|
</fieldset> |
|
</td> |
|
<td> |
|
<input name="trunktimestamps" type="hidden" value="no" /> |
|
</td> |
|
<td></td> |
|
</tr> |
|
</table> |
|
</div> |
|
</td> |
|
</tr> |
|
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA"> |
|
<td class="labels"> |
|
<div align="right"></div> |
|
<div align="right"></div> |
|
<div align="left"> |
|
</div> |
|
<div align="right"></div> |
|
<div align="left"> |
|
</div> |
|
<div align="right"></div> |
|
<div align="left"> |
|
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
|
<tr> |
|
<td> |
|
<fieldset> |
|
<legend class="labels">Tempo maximo para expirar:</legend> |
|
<input name="maxregexpire" type="text" class="validate[optional,custom[onlyNumber],length[0,100]] caixas" id="maxregexpire2" value="<?= $dados["maxregexpire"]; ?>" size="10" maxlength="10" /> |
|
</fieldset> |
|
</td> |
|
<td> |
|
<fieldset> |
|
<legend class="labels">Debug de Autenticação :</legend> |
|
<?php |
|
switch (trim($dados["autokill"])) { |
|
case 'yes': |
|
$autokill1 = 'checked'; |
|
break; |
|
case 'no': |
|
$autokill2 = 'checked'; |
|
break; |
|
} |
|
?> |
|
<input name="authdebug" type="radio" value="yes" <?= $autokill1; ?> /> |
|
Sim |
|
<input name="authdebug" type="radio" value="no" <?= $autokill2; ?> /> |
|
Não |
|
</fieldset> |
|
</td> |
|
<td> |
|
<fieldset> |
|
<legend class="labels">Tos:</legend> |
|
<select name="tos" class="caixas" id="select2"> |
|
<?php foreach ($toss as $v) { ?> |
|
<option value="<?= $v ?>" <?= ($v == trim($dados['tos'])) ? 'selected' : null; ?>><?= $v ?></option> |
|
<?php } ?> |
|
</select> |
|
</fieldset> |
|
</td> |
|
</tr> |
|
</table> |
|
</div> |
|
</td> |
|
</tr> |
|
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA"> |
|
<td> |
|
<div align="center"> |
|
<span class="style1"> |
|
<input name="Submit2" type="button" class="labels" onclick="fecha_popup()" value="Fechar" id="btfechar"> |
|
</span> |
|
<input name="Submit" type="submit" class="labels" value="Salvar"> |
|
</div> |
|
</td> |
|
</tr> |
|
</table> |
|
</form> |
|
<?php } ?> |
|
</form> |
|
<script type="text/javascript"> |
|
$(document).ready(function() { |
|
$('#btfechar').click(function() { |
|
var $ = window.parent.$; |
|
var jQuery = window.parent.jQuery; |
|
$.unblockUI({ |
|
fadeOut: 200 |
|
}); |
|
|
|
}); |
|
}); |
|
</script> |
|
</body> |
|
|
|
</html>
|