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.
 
 
 
 
 
 

306 lines
17 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title> <?= TITLE_SITE ?></title>
<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"];
$id = $_POST['id'];
$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();
$fields = [
'context' => null,
'callerid' => null,
'allowguest' => 'no',
'realm' => null,
'bindport' => '5060',
'bindaddr' => '0.0.0.0',
'tos_sip' => 'cs0',
'tos_audio' => 'cs1',
'tos_video' => 'cs0',
'maxexpiry' => '1200',
'minexpiry' => '60',
'sipdebug' => 'no',
'relaxdtmf' => 'yes',
'notifymimetype' => null,
'buggymwi' => null,
'vmexten' => null,
'mohinterpret' => null, 'mohsuggest' => null, 'language' => null,
'progressinband' => null, 'useragent' => null, 'promiscredir' => null,
'userqphone' => null, 'dtmfmode' => null, 'compactheaders' => null,
'videosupport' => null, 'alwaysauthreject' => null, 'g726nonstandard' => null,
'matchexterniplocally' => null, 'regcontext' => null, 'rtpkeepalive' => null,
'recordhistory' => null, 'dumphistory' => null, 'trustrpid' => null,
'sendrpid' => null, 'allowsubscribe' => null, 'subscribecontext' => null, 'notifyringing' => null,
'notifyhold' => null, 'limitonpeers' => null, 't38pt_udptl' => null, 'externip' => null,
'externhost' => null, 'localnet' => null, 'extranet' => null, 'nat' => null, 'canreinvite' => null,
'directrtpsetup' => null, 'rtcachefriends' => null, 'rtsavesysname' => null,
'rtupdate' => null, 'rtautoclear' => null, 'ignoreregexpire' => null, 'domain' => null,
'autodomain' => null, 'allowexternaldomains' => null, 'fromdomain' => null, 'jbenable' => null,
'jbforce' => null, 'jbmaxsize' => null, 'jbresyncthreshold' => null, 'jbimpl' => null, 'jblog' => null, 'auth' => null,
];
if ($acao == "salva") {
foreach ($_POST as $k => $v) {
if (array_key_exists($k, $fields) && $k != 'id') {
$fields[$k] = trim($v) ?? $fields[$k];
}
}
$where = " id = {$id} and org_id = {$org_id};";
UpdateDb($dbcon, 'pbx_sip_general', $fields, $where);
gera_arquivos($dbcon, 'SIP_GENERAL');
echo '<script type="text/javascript">fecha_popup();</script>';
}
$query = "SELECT * FROM pbx_sip_general where org_id = {$org_id} limit 1";
$result = pg_query($dbcon, $query);
while ($dados = pg_fetch_array($result)) { ?>
<link href="admin/css/forms.css" rel="stylesheet" type="text/css">
<form id="form1" name="form1" action="index.php?idProg=11109&pbxRequest=1&acao=salva" method="post">
<input name="callerid" type="hidden" class="validate[optional,custom[onlyNumber],length[0,100]] caixas" id="callerid2" value="<?= $dados["callerid"]; ?>" size="10" maxlength="20" />
<table width="460" border="1" align="center" cellpadding="0" cellspacing="0" class="tabela">
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA" background="img/button03.gif">
<td width="405" align="center" background="img/button03.gif" class="cabecalho">CONFIGURA&Ccedil;&Atilde;O GLOBAL DO SIP</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 width=" 33%">
<fieldset>
<legend class="labels">Aceita Convidados:</legend>
<?php
switch (trim($dados["allowguest"])) {
case 'yes':
$allowguest1 = 'checked';
break;
case 'no':
$allowguest2 = 'checked';
break;
}
?>
<input name="allowguest" type="radio" value="yes" <?= $allowguest1; ?> />
Sim
<input name="allowguest" type="radio" value="no" <?= $allowguest2; ?> />
N&atilde;o
</fieldset>
</td>
<td width="33%">
<fieldset>
<legend class="labels"> Interface de Rede :</legend>
<input name="bindaddr" type="text" class="caixas" id="bindaddr2" value="<?= $dados["bindaddr"]; ?>" size="15" maxlength="20" />
</fieldset>
</td>
<td width="33%">
<fieldset>
<legend class="labels">Porta:</legend>
<input name="bindport" type="text" class="validate[required,custom[onlyNumber],length[0,100]] caixas" id="bindport2" value="<?= $dados["bindport"]; ?>" size="10" maxlength="6" />
</fieldset>
</td>
</tr>
</table>
</td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td class="labels">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="33%">
<fieldset>
<legend class="labels">tos_sip:</legend>
<select name="tos_sip" class="validate[required] caixas" id="select">
<?php foreach ($toss as $v) { ?>
<option value="<?= $v ?>" <?= ($v == trim($dados['tos_sip'])) ? 'selected' : null; ?>><?= $v ?></option>
<?php } ?>
</select>
</fieldset>
</td>
<td width="33%">
<fieldset>
<legend class="labels">tos_audio:</legend>
<select name="tos_audio" id="select2" class="validate[required] caixas">
<?php foreach ($toss as $v) { ?>
<option value="<?= $v ?>" <?= ($v == trim($dados['tos_audio'])) ? 'selected' : null; ?>><?= $v ?></option>
<?php } ?>
</select>
</fieldset>
</td>
<td width="33%">
<fieldset>
<legend class="labels">tos_video:</legend>
<select name="tos_video" class="validate[required] caixas" id="select3">
<?php foreach ($toss as $v) { ?>
<option value="<?= $v ?>" <?= ($v == trim($dados['tos_video'])) ? 'selected' : null; ?>><?= $v ?></option>
<?php } ?>
</select>
</fieldset>
</td>
</tr>
</table>
</td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td class="labels">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%">
<fieldset>
<legend class="labels">
Tempo maximo para expirar:</legend>
<input name="maxexpiry" type="text" class="validate[optional,custom[onlyNumber],length[0,100]] caixas" id="maxexpiry2" value="<?= $dados["maxexpiry"]; ?>" size="10" maxlength="6" />
</fieldset>
</td>
<td>
<fieldset>
<legend class="labels">
Tempo minimo para expirar:</legend>
<input name="minexpiry" type="text" class="validate[optional,custom[onlyNumber],length[0,100]] caixas" id="minexpiry2" value="<?= $dados["minexpiry"]; ?>" size="10" maxlength="10" />
</fieldset>
</td>
</tr>
</table>
</td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td class="labels">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<fieldset>
<legend class="labels">Debug:</legend>
<?php
switch (trim($dados["sipdebug"])) {
case 'yes':
$sipdebug1 = 'checked';
break;
case 'no':
$sipdebug2 = 'checked';
break;
}
?>
<input name="sipdebug" type="radio" value="yes" <?= $sipdebug1; ?> />
Sim
<input name="sipdebug" type="radio" value="no" <?= $sipdebug2; ?> />
N&atilde;o
</fieldset>
</td>
<td>
<fieldset>
<legend class="labels">relaxdtmf:</legend>
<?php
switch (trim($dados["relaxdtmf"])) {
case 'yes':
$relaxdtmf1 = 'checked';
break;
case 'no':
$relaxdtmf2 = 'checked';
break;
}
?>
<input name="relaxdtmf" type="radio" value="yes" <?= $relaxdtmf1; ?> />
Sim
<input name="relaxdtmf" type="radio" value="no" <?= $relaxdtmf2; ?> />
N&atilde;o
</fieldset>
</td>
</tr>
</table>
</td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td class="labels">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%">
<fieldset>
<legend class="labels"> Ip P&uacute;blico:</legend>
<input name="externip" type="text" class="validate[optional,length[0,120]] caixas" id="externip" value="<?= $dados["externip"]; ?>" size="35" maxlength="120" />
</fieldset>
</td>
<td>
<fieldset>
<legend class="labels">Host:</legend>
<input name="externhost" type="text" class="validate[optional,length[0,120]] caixas" id="externhost" value="<?= $dados["externhost"]; ?>" size="35" maxlength="120" />
</fieldset>
</td>
</tr>
</table>
</td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td class="labels">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<fieldset>
<legend class="labels"> Redes:</legend>
<textarea name="localnet" cols="80" rows="6" class="caixas" id="localnet"><?= $dados["localnet"]; ?></textarea>
</fieldset>
</td>
</tr>
<tr>
<td width="100%">
<fieldset>
<legend class="labels"> Redes Permitidas para Autentica<EFBFBD><EFBFBD>o de Ramais:</legend>
<textarea name="extranet" cols="80" rows="6" class="caixas" id="extranet"><?= $dados["extranet"]; ?></textarea>
</fieldset>
</td>
</tr>
</table>
</td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td class="labels">&nbsp;</td>
</tr>
<tr bordercolor="#EAEAEA" bgcolor="#EAEAEA">
<td>
<div align="center">
<input name="Submit" type="button" class="labels" onclick="fecha_popup()" value="Fechar" id="btfechar">
<input name="Submit" type="submit" class="labels" value="Salvar">
</div>
</td>
</tr>
</table>
</form>
<?php } ?>
<script type="text/javascript">
$(document).ready(function() {
$('#btfechar').click(function() {
var $ = window.parent.$;
var jQuery = window.parent.jQuery;
$.unblockUI({
fadeOut: 200
});
});
});
</script>
</body>