parent
13106b1ffd
commit
f4a8260ff1
|
|
@ -1,3 +1,5 @@
|
||||||
# customcontexts-fpbx
|
# customcontexts-fpbx
|
||||||
|
|
||||||
Модуль Custom Conexts, адаптированный для FreePBX 15, 16
|
Модуль Custom Conexts, адаптированный для работы с FreePBX 15, 16
|
||||||
|
|
||||||
|
Является модификацией оригинального FreePBX модуля Custom Contexts из репозитория Unsupported (не поддерживается с 2017г.)
|
||||||
|
|
@ -0,0 +1,818 @@
|
||||||
|
<?php
|
||||||
|
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
|
||||||
|
/* $Id:$ */
|
||||||
|
|
||||||
|
//used to get module information
|
||||||
|
function customcontexts_getmodulevalue($id) {
|
||||||
|
static $moduledisplayname = null;
|
||||||
|
static $moduleversion = null;
|
||||||
|
global $db;
|
||||||
|
switch ($id) {
|
||||||
|
case 'moduledisplayname':
|
||||||
|
if ($moduledisplayname === null) {
|
||||||
|
$module_info = module_getinfo('customcontexts');
|
||||||
|
$moduledisplayname = $module_info['customcontexts']['name'];
|
||||||
|
}
|
||||||
|
return $moduledisplayname;
|
||||||
|
break;
|
||||||
|
case 'moduleversion':
|
||||||
|
if ($moduleversion === null) {
|
||||||
|
$moduleversion = modules_getversion('customcontexts');
|
||||||
|
}
|
||||||
|
return $moduleversion;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$sql = "select value from customcontexts_module where id = '$id'";
|
||||||
|
$results = $db->getAll($sql);
|
||||||
|
if(DB::IsError($results)) {
|
||||||
|
$results = null;
|
||||||
|
}
|
||||||
|
return isset($results)?$results[0][0]:null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//used to get module information
|
||||||
|
function customcontexts_setmodulevalue($id,$value) {
|
||||||
|
global $db;
|
||||||
|
$sql = "update customcontexts_module set value = '$value' where id = '$id'";
|
||||||
|
$db->query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
//after dialplan is created and ready for injection, we grab the includes of any context the user added in admin
|
||||||
|
function customcontexts_hookGet_config($engine) {
|
||||||
|
global $db;
|
||||||
|
global $ext;
|
||||||
|
switch($engine) {
|
||||||
|
case 'asterisk':
|
||||||
|
$sql = 'UPDATE customcontexts_includes_list SET missing = 1 WHERE context
|
||||||
|
NOT IN (SELECT context FROM customcontexts_contexts_list WHERE locked = 1)';
|
||||||
|
$db->query($sql);
|
||||||
|
$sql = 'SELECT context FROM customcontexts_contexts_list';
|
||||||
|
$sections = $db->getAll($sql);
|
||||||
|
if(DB::IsError($results)) {
|
||||||
|
$results = null;
|
||||||
|
}
|
||||||
|
foreach ($sections as $section) {
|
||||||
|
$section = $section[0];
|
||||||
|
$i = 0;
|
||||||
|
if (isset($ext->_includes[$section])) {
|
||||||
|
foreach ($ext->_includes[$section] as $include) {
|
||||||
|
$i = $i + 1;
|
||||||
|
if ($section == 'outbound-allroutes') {
|
||||||
|
$sql = 'INSERT INTO customcontexts_includes_list
|
||||||
|
(context, include, description, missing, sort)
|
||||||
|
VALUES ("'.$section.'", "'.$include['include'].'",
|
||||||
|
"'.$include['comment'].'", "0", "'.($i+100).'")
|
||||||
|
ON DUPLICATE KEY UPDATE sort = "'.($i+100).'", missing = "0"';
|
||||||
|
$db->query($sql);
|
||||||
|
} else {
|
||||||
|
$sql = 'UPDATE customcontexts_includes_list SET missing = "0", sort = "'.$i.'"
|
||||||
|
WHERE context = "'.$section.'" and include = "'.$include['include'].'"';
|
||||||
|
$db->query($sql);
|
||||||
|
}
|
||||||
|
$sql = 'INSERT IGNORE INTO customcontexts_includes_list
|
||||||
|
(context, include, description, sort)
|
||||||
|
VALUES ("'.$section.'", "'.$include['include'].'",
|
||||||
|
"'.$include['include'].'", "'.$i.'")';
|
||||||
|
$db->query($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$sql = "delete from customcontexts_includes_list where missing = 1";
|
||||||
|
$db->query($sql);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// provide hook for routing
|
||||||
|
function customcontexts_hook_core($viewing_itemid, $target_menuid) {
|
||||||
|
switch ($target_menuid) {
|
||||||
|
// only provide display for outbound routing
|
||||||
|
case 'routing':
|
||||||
|
/*$route = substr($viewing_itemid,4);$hookhtml = '';return $hookhtml;*/
|
||||||
|
return '';
|
||||||
|
break;
|
||||||
|
case 'devices':
|
||||||
|
case 'extensions':
|
||||||
|
if((isset($_REQUEST['tech_hardware']) && !empty($_REQUEST['tech_hardware'])) || (isset($_REQUEST['extdisplay']) && !empty($_REQUEST['extdisplay']))){
|
||||||
|
return load_view(__DIR__.'/views/extensions_hook.php');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//this lists all includes from the sql database (for the requsted context) which we parsed out of the dialplan
|
||||||
|
//from any contexts the user entered in admin - information was saved to database on the last reload
|
||||||
|
|
||||||
|
function customcontexts_getincludeslist($context) {
|
||||||
|
global $db;
|
||||||
|
// $sql = "select include, description from customcontexts_includes_list where context = '".$context."' order by description";
|
||||||
|
$sql = "SELECT include, customcontexts_includes_list.description,
|
||||||
|
COUNT(customcontexts_contexts_list.context) AS preemptcount
|
||||||
|
FROM customcontexts_includes_list
|
||||||
|
LEFT OUTER JOIN customcontexts_contexts_list
|
||||||
|
ON include = customcontexts_contexts_list.context
|
||||||
|
WHERE customcontexts_includes_list.context = '$context'
|
||||||
|
ORDER BY customcontexts_includes_list.sort,
|
||||||
|
customcontexts_includes_list.description";
|
||||||
|
$results = $db->getAll($sql);
|
||||||
|
if(DB::IsError($results)) {
|
||||||
|
$results = array();
|
||||||
|
}
|
||||||
|
foreach ($results as $val) {
|
||||||
|
$tmparray[] = array($val[0], $val[1], $val[2]);
|
||||||
|
}
|
||||||
|
return $tmparray;
|
||||||
|
}
|
||||||
|
|
||||||
|
//lists any contexts the user entered in admin for us to parse for includes to make available to his custom contexts
|
||||||
|
function customcontexts_getcontextslist() {
|
||||||
|
global $db;
|
||||||
|
$sql = "select context, description from customcontexts_contexts_list order by description";
|
||||||
|
$results = $db->getAll($sql);
|
||||||
|
if(DB::IsError($results)) {
|
||||||
|
$results = array();
|
||||||
|
}
|
||||||
|
foreach ($results as $val) {
|
||||||
|
$tmparray[] = array($val[0], $val[1]);
|
||||||
|
}
|
||||||
|
return $tmparray;
|
||||||
|
}
|
||||||
|
|
||||||
|
//these are the users selections of includes for the selected custom context
|
||||||
|
function customcontexts_getincludes($context) {
|
||||||
|
global $db;
|
||||||
|
$sql = "select customcontexts_contexts_list.context, customcontexts_contexts_list.description as contextdescription, customcontexts_includes_list.include, customcontexts_includes_list.description, if(saved.include is null, 'no', if(saved.timegroupid is null, 'yes', saved.timegroupid)) as allow, saved.sort from customcontexts_contexts_list inner join customcontexts_includes_list on customcontexts_contexts_list.context = customcontexts_includes_list.context left outer join (select * from customcontexts_includes where context = '$context') saved on customcontexts_includes_list.include = saved.include order by customcontexts_contexts_list.description, customcontexts_includes_list.description";
|
||||||
|
/* $sql = "SELECT customcontexts_contexts_list.context,
|
||||||
|
customcontexts_contexts_list.description AS contextdescription,
|
||||||
|
customcontexts_includes_list.include,
|
||||||
|
customcontexts_includes_list.description,
|
||||||
|
IF(saved.include is null, 'no',
|
||||||
|
IF(saved.timegroupid is null, IF(saved.userules is null, 'yes', saved.userules),
|
||||||
|
saved.timegroupid)) AS allow,
|
||||||
|
IF(saved.sort is null,customcontexts_includes_list.sort,saved.sort) AS sort,
|
||||||
|
COUNT(preemptcheck.context) AS preemptcount FROM customcontexts_contexts_list
|
||||||
|
INNER JOIN customcontexts_includes_list
|
||||||
|
ON customcontexts_contexts_list.context = customcontexts_includes_list.context
|
||||||
|
LEFT OUTER JOIN (SELECT * from customcontexts_includes WHERE context = '$context') AS saved
|
||||||
|
ON customcontexts_includes_list.include = saved.include
|
||||||
|
LEFT OUTER JOIN customcontexts_contexts_list preemptcheck
|
||||||
|
ON customcontexts_includes_list.include = preemptcheck.context
|
||||||
|
LEFT OUTER JOIN outbound_route_sequence
|
||||||
|
ON REPLACE(customcontexts_includes_list.include,'outrt-','') = outbound_route_sequence.route_id,
|
||||||
|
customcontexts_contexts_list.description,
|
||||||
|
customcontexts_includes_list.include,
|
||||||
|
customcontexts_includes_list.description,
|
||||||
|
IF(saved.include is null, 'no', IF(saved.timegroupid is null, 'yes', saved.timegroupid)),
|
||||||
|
saved.sort,
|
||||||
|
customcontexts_contexts_list.description
|
||||||
|
ORDER BY
|
||||||
|
IF(saved.sort is null,201,saved.sort),
|
||||||
|
customcontexts_includes_list.sort,
|
||||||
|
outbound_route_sequence.seq,
|
||||||
|
customcontexts_contexts_list.description,
|
||||||
|
customcontexts_includes_list.description"; */
|
||||||
|
$results = sql($sql,'getAll');
|
||||||
|
foreach ($results as $val){
|
||||||
|
$tmparray[] = array($val[0], $val[1], $val[2], $val[3], $val[4], $val[5], $val[6]);
|
||||||
|
}
|
||||||
|
//0-context 1-contextdescription 2-include 3-description 4-allow 5-sort 6-preemptcount
|
||||||
|
return $tmparray;
|
||||||
|
}
|
||||||
|
|
||||||
|
//these are the users custom contexts
|
||||||
|
function customcontexts_getcontexts() {
|
||||||
|
global $db;
|
||||||
|
$tmparray = array();
|
||||||
|
$sql = "select context, description from customcontexts_contexts order by description";
|
||||||
|
$results = $db->getAll($sql);
|
||||||
|
if(DB::IsError($results)) {
|
||||||
|
$results = array();
|
||||||
|
}
|
||||||
|
foreach ($results as $val) {
|
||||||
|
$tmparray[] = array($val[0], $val[1]);
|
||||||
|
}
|
||||||
|
return $tmparray;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* allow reload to get our config
|
||||||
|
* we add all user custom contexts ad include his selected includes
|
||||||
|
* also maybe allow the user to specify invalid destination
|
||||||
|
*/
|
||||||
|
function customcontexts_get_config($engine) {
|
||||||
|
global $ext;
|
||||||
|
switch($engine) {
|
||||||
|
case 'asterisk':
|
||||||
|
global $db;
|
||||||
|
$sql = "SELECT context, dialrules, faildestination, featurefaildestination,
|
||||||
|
failpin, featurefailpin FROM customcontexts_contexts";
|
||||||
|
$results = $db->getAll($sql);
|
||||||
|
if(DB::IsError($results)) {
|
||||||
|
$results = array();
|
||||||
|
}
|
||||||
|
foreach ($results as $val) {
|
||||||
|
$context = $val[0];
|
||||||
|
//$ext->_exts[$context][] = null;
|
||||||
|
//partially stolen from outbound routing
|
||||||
|
$dialpattern = explode("\n",$val[1]);
|
||||||
|
if (!$dialpattern) {
|
||||||
|
$dialpattern = array();
|
||||||
|
}
|
||||||
|
foreach (array_keys($dialpattern) as $key) {
|
||||||
|
//trim it
|
||||||
|
$dialpattern[$key] = trim($dialpattern[$key]);
|
||||||
|
|
||||||
|
// remove blanks
|
||||||
|
if ($dialpattern[$key] == "") {
|
||||||
|
unset($dialpattern[$key]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove leading underscores (we do that on backend)
|
||||||
|
if ($dialpattern[$key][0] == "_") {
|
||||||
|
$dialpattern[$key] = substr($dialpattern[$key],1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// check for duplicates, and re-sequence
|
||||||
|
$dialpattern = array_values(array_unique($dialpattern));
|
||||||
|
if (is_array($dialpattern)) {
|
||||||
|
foreach ($dialpattern as $pattern) {
|
||||||
|
if (false !== ($pos = strpos($pattern,"|"))) {
|
||||||
|
// we have a | meaning to not pass the digits on
|
||||||
|
// (ie, 9|NXXXXXX should use the pattern _9NXXXXXX but only pass NXXXXXX, not the leading 9)
|
||||||
|
|
||||||
|
$pattern = str_replace("|","",$pattern); // remove all |'s
|
||||||
|
$exten = "EXTEN:".$pos; // chop off leading digit
|
||||||
|
} else {
|
||||||
|
// we pass the full dialed number as-is
|
||||||
|
$exten = "EXTEN";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!preg_match("/^[0-9*]+$/",$pattern)) {
|
||||||
|
// note # is not here, as asterisk doesn't recoginize it as a normal digit, thus it requires _ pattern matching
|
||||||
|
|
||||||
|
// it's not strictly digits, so it must have patterns, so prepend a _
|
||||||
|
$pattern = "_".$pattern;
|
||||||
|
}
|
||||||
|
$ext->add($context,$pattern, '', new ext_goto('1','${'.$exten.'}',$context.'_rulematch'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//switch to first line to deny all access when time group deleted
|
||||||
|
//$sql = "select include, time from customcontexts_includes left outer join customcontexts_timegroups_detail on customcontexts_includes.timegroupid = customcontexts_timegroups_detail.timegroupid where context = '".$context."' and (customcontexts_includes.timegroupid is null or customcontexts_timegroups_detail.timegroupid is not null) order by sort";
|
||||||
|
$sql = "SELECT include, time, userules, seq FROM customcontexts_includes
|
||||||
|
LEFT OUTER JOIN timegroups_details
|
||||||
|
ON customcontexts_includes.timegroupid = timegroups_details.timegroupid
|
||||||
|
LEFT OUTER JOIN outbound_route_sequence
|
||||||
|
ON REPLACE(include,'outrt-','') = outbound_route_sequence.route_id
|
||||||
|
WHERE context = '$context' ORDER BY sort, seq";
|
||||||
|
$results2 = $db->getAll($sql);
|
||||||
|
if(DB::IsError($results2)) {
|
||||||
|
$results2 = array();
|
||||||
|
}
|
||||||
|
foreach ($results2 as $inc) {
|
||||||
|
$time = isset($inc[1])?'|'.$inc[1]:'';
|
||||||
|
switch ($inc[2]) {
|
||||||
|
case 'allowmatch':
|
||||||
|
if (is_array($dialpattern)) {
|
||||||
|
$ext->addInclude($context.'_rulematch',$inc[0].$time);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'denymatch':
|
||||||
|
$ext->addInclude($context,$inc[0].$time);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$ext->addInclude($context,$inc[0].$time);
|
||||||
|
if (is_array($dialpattern)) {
|
||||||
|
$ext->addInclude($context.'_rulematch',$inc[0].$time);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//these go in funny "exten => s,1,Macro(hangupcall,)"
|
||||||
|
//i'd rather use the base extension class to type it normally, but there is a bug in the class see ticket http://www.freepbx.org/trac/ticket/1453
|
||||||
|
$ext->add($context,'s', '', new ext_macro('hangupcall'));
|
||||||
|
$ext->add($context,'h', '', new ext_macro('hangupcall'));
|
||||||
|
$ext->addInclude($context,$context.'_bad-number');
|
||||||
|
$ext->addInclude($context,'bad-number');
|
||||||
|
if (is_array($dialpattern)) {
|
||||||
|
$ext->add($context.'_rulematch','s', '', new ext_macro('hangupcall'));
|
||||||
|
$ext->add($context.'_rulematch','h', '', new ext_macro('hangupcall'));
|
||||||
|
$ext->addInclude($context.'_rulematch',$context.'_bad-number');
|
||||||
|
$ext->addInclude($context.'_rulematch','bad-number');
|
||||||
|
}
|
||||||
|
$ext->_exts[$context.'_bad-number'][] = null;
|
||||||
|
if (isset($val[2]) && (!$val[2] == '')) {
|
||||||
|
$goto = explode(',',$val[2]);
|
||||||
|
if (isset($val[4]) && ($val[4] <> '')) {
|
||||||
|
$ext->add($context.'_bad-number', '_X.', '', new ext_authenticate($val[4]));
|
||||||
|
}
|
||||||
|
$ext->add($context.'_bad-number', '_X.', '', new ext_goto($goto[2],$goto[1],$goto[0]));
|
||||||
|
}
|
||||||
|
if (isset($val[3]) && (!$val[3] == '')) {
|
||||||
|
$goto = explode(',',$val[3]);
|
||||||
|
if (isset($val[5]) && ($val[5] <> '')) {
|
||||||
|
$ext->add($context.'_bad-number', '_*.', '', new ext_authenticate($val[5]));
|
||||||
|
}
|
||||||
|
$ext->add($context.'_bad-number', '_*.', '', new ext_goto($goto[2],$goto[1],$goto[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// returns a associative arrays with keys 'destination' and 'description'
|
||||||
|
// it allows custom contexts to be chosen as destinations
|
||||||
|
//this may seem a bit strange, but it works simply it sends the user to the EXTEN he dialed (or IVR option) within the selected context
|
||||||
|
function customcontexts_destinations() {
|
||||||
|
$contexts = customcontexts_getcontexts();
|
||||||
|
$extens[] = array('destination' => 'from-internal,${EXTEN},1', 'description' => 'Full Internal Access');
|
||||||
|
if (is_array($contexts)) {
|
||||||
|
foreach ($contexts as $r) {
|
||||||
|
$extens[] = array('destination' => $r[0].',${EXTEN},1', 'description' => $r[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $extens;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* admin page helper
|
||||||
|
* we are using gui styles so there is very little on the page
|
||||||
|
* the admin page is used to list _existing_ contexts for us to parse for includes
|
||||||
|
* these contexts/includes can be tagged with a description for the user to select on the custom contexts page
|
||||||
|
*/
|
||||||
|
function customcontexts_customcontextsadmin_configpageinit($dispnum) {
|
||||||
|
global $currentcomponent;
|
||||||
|
switch ($dispnum) {
|
||||||
|
case 'customcontextsadmin':
|
||||||
|
$currentcomponent->addguifunc('customcontexts_customcontextsadmin_configpageload');
|
||||||
|
$currentcomponent->addprocessfunc('customcontexts_customcontextsadmin_configprocess', 5);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//this is the dirty work displaying the admin page
|
||||||
|
function customcontexts_customcontextsadmin_configpageload() {
|
||||||
|
global $currentcomponent;
|
||||||
|
$contexterr = 'Context may not be left blank and must contain only letters, numbers and a few select characters!';
|
||||||
|
$descerr = 'Description must be alpha-numeric, and may not be left blank';
|
||||||
|
$extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null;
|
||||||
|
$action= isset($_REQUEST['action'])?$_REQUEST['action']:null;
|
||||||
|
if ($action == 'del') {
|
||||||
|
$currentcomponent->addguielem('_top', new gui_pageheading('title', _("Context").": $extdisplay"." удален!", false), 0);
|
||||||
|
} else {
|
||||||
|
//need to get module name/type dynamically
|
||||||
|
$query = ($_SERVER['QUERY_STRING'])?$_SERVER['QUERY_STRING']:'type=tool&display=customcontextsadmin&extdisplay='.$extdisplay;
|
||||||
|
$delURL = $_SERVER['PHP_SELF'].'?'.$query.'&action=del';
|
||||||
|
$info = 'The context which contains includes which you would like to make available to '.customcontexts_getmodulevalue('moduledisplayname').'. Any context you enter here will be parsed for includes and you can then include them in your own '.customcontexts_getmodulevalue('moduledisplayname').'. Removing them here does NOT delete the context, rather makes them unavailable to your '.customcontexts_getmodulevalue('moduledisplayname').'.';
|
||||||
|
$currentcomponent->addguielem('_top', new gui_hidden('action', ($extdisplay ? 'edit' : 'add')));
|
||||||
|
$currentcomponent->addguielem('_bottom', new gui_link('help', _(customcontexts_getmodulevalue('moduledisplayname')." v".customcontexts_getmodulevalue('moduleversion')), 'http://www.freepbx.org/support/documentation/module-documentation/third-party-unsupported-modules/customcontexts', true, false), 0);
|
||||||
|
if (!$extdisplay) {
|
||||||
|
$currentcomponent->addguielem('_top', new gui_pageheading('title', _("Добавить контекст"), false), 0);
|
||||||
|
$currentcomponent->addguielem('Context', new gui_textbox('extdisplay', '', 'Контекст', $info, 'isWhitespace() || !isFilename()', $contexterr, false), 3);
|
||||||
|
$currentcomponent->addguielem('Context', new gui_textbox('description', '', 'Описание', 'This will display as a heading for the available includes on the '.customcontexts_getmodulevalue('moduledisplayname').' page.', '!isAlphanumeric() || isWhitespace()', $descerr, false), 3);
|
||||||
|
} else {
|
||||||
|
$savedcontext = customcontexts_customcontextsadmin_get($extdisplay);
|
||||||
|
$context = $savedcontext[0];
|
||||||
|
$description = $savedcontext[1];
|
||||||
|
$locked = $savedcontext[2];
|
||||||
|
$currentcomponent->addguielem('_top', new gui_hidden('extdisplay', $extdisplay));
|
||||||
|
$currentcomponent->addguielem('_top', new gui_pageheading('title', _("Edit Context").": $description", false), 0);
|
||||||
|
if ($locked == false) {
|
||||||
|
$currentcomponent->addguielem('_top', new gui_link('del', "<span class='btn fa'>"._("Remove Context").": $context </span><br>", $delURL, true, false), 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$currentcomponent->addguielem('_top', new gui_label('del', _("Context").": $context не может быть удален!<br>", $delURL, true, false), 0);
|
||||||
|
}
|
||||||
|
$currentcomponent->addguielem('Context', new gui_textbox('description', $description, 'Описание', 'This will display as a heading for the available includes on the '.customcontexts_getmodulevalue('moduledisplayname').' page.', '!isAlphanumeric() || isWhitespace()', $descerr, false), 3);
|
||||||
|
$inclist = customcontexts_getincludeslist($extdisplay);
|
||||||
|
$inclist = is_array($inclist)?$inclist:array();
|
||||||
|
foreach ($inclist as $val) {
|
||||||
|
if ($val[2] > 0) {
|
||||||
|
$currentcomponent->addguielem('Includes Descriptions', new gui_textbox('includes['.$val[0].']', $val[1], '<font color="red"><strong>'.$val[0].'</strong></font>', 'This will display as the name of the include on the '.customcontexts_getmodulevalue('moduledisplayname').' page.<BR><font color="red"><strong>NOTE: This include should have a description denoting the fact that allowing it may allow another ENTIRE context!</strong></font>', '!isAlphanumeric() || isWhitespace()', $descerr, false), 3);
|
||||||
|
} else {
|
||||||
|
$currentcomponent->addguielem('Includes Descriptions', new gui_textbox('includes['.$val[0].']', $val[1], $val[0], 'This will display as the name of the include on the '.customcontexts_getmodulevalue('moduledisplayname').' page.', '!isAlphanumeric() || isWhitespace()', $descerr, false), 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//handle the admin submit button
|
||||||
|
function customcontexts_customcontextsadmin_configprocess() {
|
||||||
|
$action= isset($_REQUEST['action'])?$_REQUEST['action']:null;
|
||||||
|
$context= isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null;
|
||||||
|
$description= isset($_REQUEST['description'])?$_REQUEST['description']:null;
|
||||||
|
//addslashes
|
||||||
|
switch ($action) {
|
||||||
|
case 'add':
|
||||||
|
customcontexts_customcontextsadmin_add($context,$description);
|
||||||
|
break;
|
||||||
|
case 'edit':
|
||||||
|
customcontexts_customcontextsadmin_edit($context,$description);
|
||||||
|
$includes = isset($_REQUEST['includes'])?$_REQUEST['includes']:null;
|
||||||
|
customcontexts_customcontextsadmin_editincludes($context,$includes);
|
||||||
|
break;
|
||||||
|
case 'del':
|
||||||
|
customcontexts_customcontextsadmin_del($context);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//retrieve a single context for the admin page
|
||||||
|
function customcontexts_customcontextsadmin_get($context) {
|
||||||
|
global $db;
|
||||||
|
$sql = "select context, description, locked from customcontexts_contexts_list where context = '$context'";
|
||||||
|
$results = $db->getAll($sql);
|
||||||
|
if(DB::IsError($results)) {
|
||||||
|
$results = null;
|
||||||
|
}
|
||||||
|
$tmparray = array($results[0][0], $results[0][1], $results[0][2]);
|
||||||
|
return $tmparray;
|
||||||
|
}
|
||||||
|
|
||||||
|
//add a single context for admin
|
||||||
|
function customcontexts_customcontextsadmin_add($context,$description) {
|
||||||
|
global $db;
|
||||||
|
$sql = "insert customcontexts_contexts_list (context, description) VALUES ('$context','$description')";
|
||||||
|
$db->query($sql);
|
||||||
|
needreload();
|
||||||
|
}
|
||||||
|
|
||||||
|
//del a single context from admin
|
||||||
|
function customcontexts_customcontextsadmin_del($context) {
|
||||||
|
global $db;
|
||||||
|
$sql = "delete from customcontexts_includes_list where context = '$context'";
|
||||||
|
$db->query($sql);
|
||||||
|
$sql = "delete from customcontexts_contexts_list where context = '$context'";
|
||||||
|
$db->query($sql);
|
||||||
|
needreload();
|
||||||
|
}
|
||||||
|
|
||||||
|
//update a single context for admin
|
||||||
|
function customcontexts_customcontextsadmin_edit($context,$description) {
|
||||||
|
global $db;
|
||||||
|
$sql = "update customcontexts_contexts_list set description = '$description' where context = '$context'";
|
||||||
|
$db->query($sql);
|
||||||
|
needreload();
|
||||||
|
}
|
||||||
|
|
||||||
|
//edit the includes under a single admin context
|
||||||
|
function customcontexts_customcontextsadmin_editincludes($context,$includes) {
|
||||||
|
global $db;
|
||||||
|
$sql = "delete from customcontexts_includes_list where context = '$context'";
|
||||||
|
$db->query($sql);
|
||||||
|
$includes = is_array($includes)?$includes:array();
|
||||||
|
foreach ($includes as $key=>$val) {
|
||||||
|
$sql = "insert customcontexts_includes_list (context, include, description) values ('$context','$key','$val')";
|
||||||
|
$db->query($sql);
|
||||||
|
}
|
||||||
|
needreload();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------
|
||||||
|
|
||||||
|
/* custom contexts page helper
|
||||||
|
* we are using gui styles so there is very little on the page
|
||||||
|
* the custom contexts page is used to create _new_ contexts for use in the dialplan
|
||||||
|
* these contexts can include any includes which were made available from admin
|
||||||
|
*/
|
||||||
|
function customcontexts_customcontexts_configpageinit($dispnum) {
|
||||||
|
global $currentcomponent;
|
||||||
|
switch ($dispnum) {
|
||||||
|
case 'customcontexts':
|
||||||
|
$currentcomponent->addoptlistitem('includeyn', 'yes', 'Allow');
|
||||||
|
$currentcomponent->addoptlistitem('includeyn', 'no', 'Deny');
|
||||||
|
$currentcomponent->addoptlistitem('includeyn', 'allowmatch', 'Allow Rules');
|
||||||
|
$currentcomponent->addoptlistitem('includeyn', 'denymatch', 'Deny Rules');
|
||||||
|
$timegroups = timeconditions_timegroups_list_groups();
|
||||||
|
$timegroups = is_array($timegroups)?$timegroups:array();
|
||||||
|
foreach ($timegroups as $val) {
|
||||||
|
$currentcomponent->addoptlistitem('includeyn', $val[0], $val[1]);
|
||||||
|
}
|
||||||
|
$currentcomponent->setoptlistopts('includeyn', 'sort', false);
|
||||||
|
for($i = 0; $i <= 300; $i++) {
|
||||||
|
$currentcomponent->addoptlistitem('includesort', $i - 50, $i);
|
||||||
|
}
|
||||||
|
$currentcomponent->addguifunc('customcontexts_customcontexts_configpageload');
|
||||||
|
$currentcomponent->addprocessfunc('customcontexts_customcontexts_configprocess', 5);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//actually render the custom contexts page
|
||||||
|
function customcontexts_customcontexts_configpageload() {
|
||||||
|
global $currentcomponent;
|
||||||
|
$contexterr = 'Context may not be left blank and must contain only letters, numbers and a few select characters!';
|
||||||
|
$descerr = 'Description must be alpha-numeric, and may not be left blank';
|
||||||
|
$extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null;
|
||||||
|
$action= isset($_REQUEST['action'])?$_REQUEST['action']:null;
|
||||||
|
$showsort = isset($_REQUEST['showsort'])?$_REQUEST['showsort']:null;
|
||||||
|
if (isset($showsort) && $showsort <> customcontexts_getmodulevalue('displaysortforincludes')) {
|
||||||
|
customcontexts_setmodulevalue('displaysortforincludes', $showsort);
|
||||||
|
}
|
||||||
|
if ($action == 'del') {
|
||||||
|
$currentcomponent->addguielem('_top', new gui_pageheading('title', _("Context").": $extdisplay"." удален!", false), 0);
|
||||||
|
} else {
|
||||||
|
//need to get page name/type dynamically
|
||||||
|
//caused trouble on dup or del after dup or rename
|
||||||
|
//$query = ($_SERVER['QUERY_STRING'])?$_SERVER['QUERY_STRING']:'type=setup&display=customcontexts&extdisplay='.$extdisplay;
|
||||||
|
$query = 'type=setup&display=customcontexts&extdisplay='.$extdisplay;
|
||||||
|
$delURL = $_SERVER['PHP_SELF'].'?'.$query.'&action=del';
|
||||||
|
$dupURL = $_SERVER['PHP_SELF'].'?'.$query.'&action=dup';
|
||||||
|
$info = 'The custom context to make will be available in your dialplan. These contexts can be used as a context for a device/extension to allow them limited access to your dialplan.';
|
||||||
|
$currentcomponent->addguielem('_bottom', new gui_link('ver', _(customcontexts_getmodulevalue('moduledisplayname')." v".customcontexts_getmodulevalue('moduleversion')), 'http://www.freepbx.org/support/documentation/module-documentation/third-party-unsupported-modules/customcontexts', true, false), 0);
|
||||||
|
if (!$extdisplay) {
|
||||||
|
$currentcomponent->addguielem('_top', new gui_pageheading('title', _("Добавить контекст"), false), 0);
|
||||||
|
$currentcomponent->addguielem('Context', new gui_textbox('extdisplay', '', 'Контекст', $info, 'isWhitespace() || !isFilename()', $contexterr, false), 3);
|
||||||
|
$currentcomponent->addguielem('Context', new gui_textbox('description', '', 'Описание', 'This will display as the name of this custom context.', '!isAlphanumeric() || isWhitespace()', $descerr, false), 3);
|
||||||
|
} else {
|
||||||
|
$savedcontext = customcontexts_customcontexts_get($extdisplay);
|
||||||
|
$context = $savedcontext[0];
|
||||||
|
$description = $savedcontext[1];
|
||||||
|
$rulestext = $savedcontext[2];
|
||||||
|
$faildest = $savedcontext[3];
|
||||||
|
$featurefaildest = $savedcontext[4];
|
||||||
|
$failpin = $savedcontext[5];
|
||||||
|
$featurefailpin = $savedcontext[6];
|
||||||
|
$currentcomponent->addguielem('_top', new gui_hidden('extdisplay', $extdisplay));
|
||||||
|
$currentcomponent->addguielem('_top', new gui_pageheading('title', _("Edit Context").": $description", false), 0);
|
||||||
|
//$currentcomponent->addguielem('_top', new gui_link('del', _("Delete Context")." $context", $delURL, true, false), 0);
|
||||||
|
$currentcomponent->addguielem('_top', new guielement('del', '<tr><td colspan ="2"><b><a class="btn fa" href="'.$delURL.'" onclick="return confirm(\'Are you sure you want to delete '.$context.'?\')">Удалить контекст '.$context.'</a></b></td></tr><br>', ''),3);
|
||||||
|
$currentcomponent->addguielem('_top', new gui_link('dup', "<span class='btn fa'>"._("Duplicate Context")." $context </span> <br>", $dupURL, true, false), 3);
|
||||||
|
$showsort = customcontexts_getmodulevalue('displaysortforincludes');
|
||||||
|
if ($showsort == 1) {
|
||||||
|
//$sortURL = $_SERVER['PHP_SELF'].'?'.$query.'&showsort=0';
|
||||||
|
//$currentcomponent->addguielem('_top', new gui_link('showsort', "Hide Sort Option", $sortURL, true, false), 0);
|
||||||
|
} else {
|
||||||
|
$sortURL = $_SERVER['PHP_SELF'].'?'.$query.'&showsort=1';
|
||||||
|
$currentcomponent->addguielem('_top', new gui_link('showsort', "Show Sort Option", $sortURL, true, false), 0);
|
||||||
|
}
|
||||||
|
$currentcomponent->addguielem('Context', new gui_textbox('newcontext', $extdisplay, 'Контекст', $info, 'isWhitespace() || !isFilename()', $contexterr, false), 2);
|
||||||
|
$currentcomponent->addguielem('Context', new gui_textbox('description', $description, 'Описание', 'This will display as the name of this custom context.', '', '', false), 2);
|
||||||
|
$ruledesc = 'If defined, you will have the option for each portion of the dialplan to Allow Rule, and that inclued will only be available if the number dialed matches these rules, or Deny Rule, and that include will only be available if the dialed number does NOT match these rules. You may use a pipe | to strip the preceeding digits.';
|
||||||
|
$ruleshtml = '<tr><td valign="top"><a href="#" class="info">Правила вызовов<span>'.$ruledesc.'</span></a></td><td><textarea cols="20" rows="5" id="dialpattern" name="dialpattern">'.$rulestext.'</textarea></td></tr>';
|
||||||
|
$currentcomponent->addguielem('Context', new guielement('rulesbox',$ruleshtml,''), 3);
|
||||||
|
|
||||||
|
$currentcomponent->addguielem('Failover Destination', new gui_textbox('failpin', $failpin, 'PIN', 'Enter a numeric PIN to require authentication before continuing to destination.', '!isPINList()', 'PIN must be numeric!', true), 4);
|
||||||
|
$currentcomponent->addguielem('Feature Code Failover Destination', new gui_textbox('featurefailpin', $featurefailpin, 'PIN', 'Enter a numeric PIN to require authentication before continuing to destination.', '!isPINList()', 'PIN must be numeric!', true), 4);
|
||||||
|
$currentcomponent->addguielem('Failover Destination', new gui_drawselects('dest0', 0, $faildest, 'Failover Destination'));
|
||||||
|
$currentcomponent->addguielem('Feature Code Failover Destination', new gui_drawselects('dest1', 1, $featurefaildest, 'Failover Destination'));
|
||||||
|
$currentcomponent->addguielem('Set All', new gui_selectbox('setall', $currentcomponent->getoptlist('includeyn'), '', 'Set All To:', 'Choose allow to allow access to all includes, choose deny to deny access.',true,'javascript:for (i=0;i<document.forms[\'frm_customcontexts\'].length;i++) {if(document.forms[\'frm_customcontexts\'][i].type==\'select-one\' && document.forms[\'frm_customcontexts\'][i].name.indexOf(\'[allow]\') >= 0 ) {document.forms[\'frm_customcontexts\'][i].selectedIndex = document.forms[\'frm_customcontexts\'][\'setall\'].selectedIndex-1;}}'),2);
|
||||||
|
$inclist = customcontexts_getincludes($extdisplay);
|
||||||
|
$inclist = is_array($inclist)?$inclist:array();
|
||||||
|
foreach ($inclist as $val) {
|
||||||
|
if ($showsort == 1) {
|
||||||
|
if ($val[6] > 0) {
|
||||||
|
//$currentcomponent->addguielem($val[1], new gui_selectbox('includes['.$val[2].'][allow]', $currentcomponent->getoptlist('includeyn'), $val[4], '<font color="red"><strong>'.$val[3].'</strong></font>', $val[2].': Choose allow to allow access to this include, choose deny to deny access.<BR><font color="red"><strong>NOTE: Allowing this include may automatically allow another ENTIRE context!</strong></font>',false));
|
||||||
|
$gui1 = new gui_selectbox('includes['.$val[2].'][allow]',
|
||||||
|
$currentcomponent->getoptlist('includeyn'), $val[4],
|
||||||
|
'<font color="red"><strong>'.$val[3].'</strong></font>',
|
||||||
|
$val[2].': Choose allow to allow access to this include, choose deny to deny access.<BR><font color="red"><strong>NOTE: Allowing this include may automatically allow another ENTIRE context!</strong></font>',false);
|
||||||
|
} else {
|
||||||
|
//$currentcomponent->addguielem($val[1], new gui_selectbox('includes['.$val[2].'][allow]', $currentcomponent->getoptlist('includeyn'), $val[4], $val[3], $val[2].': Choose allow to allow access to this include, choose deny to deny access.',false));
|
||||||
|
$gui1 = new gui_selectbox('includes['.$val[2].'][allow]',
|
||||||
|
$currentcomponent->getoptlist('includeyn'), $val[4], $val[3],
|
||||||
|
$val[2].': Choose allow to allow access to this include, choose deny to deny access.',false);
|
||||||
|
}
|
||||||
|
//$currentcomponent->addguielem($val[1], new gui_selectbox('includes['.$val[2].'][sort]', $currentcomponent->getoptlist('includesort'), $val[5], '<div align="right">Priority</div>', 'Choose a priority with which to sort this option. Lower numbers have a higher priority.',false));
|
||||||
|
$guisort = new gui_selectbox('includes['.$val[2].'][sort]', $currentcomponent->getoptlist('includesort'), $val[5], 'Priority', 'Choose a priority with which to sort this option. Lower numbers have a higher priority.',false);
|
||||||
|
$inchtml = '<tr><td colspan="2"><table width="100%"><tr><td></td><td width="18%"></td></tr>'.$gui1->generatehtml().'</table></td><td><table align="right">'.$guisort->generatehtml().'</table></td></tr>';
|
||||||
|
$currentcomponent->addguielem($val[1], new guielement('$val[0]',$inchtml,''),3);
|
||||||
|
} else {
|
||||||
|
if ($val[6] > 0) {
|
||||||
|
$currentcomponent->addguielem($val[1], new gui_selectbox('includes['.$val[2].'][allow]',
|
||||||
|
$currentcomponent->getoptlist('includeyn'), $val[4],
|
||||||
|
'<font color="red"><strong>'.$val[3].'</strong></font>', $val[2].': Choose allow to allow access to this include, choose deny to deny access.<BR><font color="red"><strong>NOTE: Allowing this include may automatically allow another ENTIRE context!</strong></font>',false));
|
||||||
|
} else {
|
||||||
|
$currentcomponent->addguielem($val[1], new gui_selectbox('includes['.$val[2].'][allow]',
|
||||||
|
$currentcomponent->getoptlist('includeyn'), $val[4],
|
||||||
|
$val[3], $val[2].': Choose allow to allow access to this include, choose deny to deny access.',false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$currentcomponent->addguielem('_top', new gui_hidden('action', ($extdisplay ? 'edit' : 'add')));
|
||||||
|
}
|
||||||
|
|
||||||
|
//handle custom contexts page submit button
|
||||||
|
function customcontexts_customcontexts_configprocess() {
|
||||||
|
$action= isset($_REQUEST['action'])?$_REQUEST['action']:null;
|
||||||
|
$context= isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null;
|
||||||
|
$newcontext= isset($_REQUEST['newcontext'])?$_REQUEST['newcontext']:null;
|
||||||
|
$description= isset($_REQUEST['description'])?$_REQUEST['description']:null;
|
||||||
|
$dialrules= isset($_REQUEST['dialpattern'])?$_REQUEST['dialpattern']:null;
|
||||||
|
$faildest= isset($_REQUEST["goto0"])?$_REQUEST[$_REQUEST['goto0'].'0']:null;
|
||||||
|
$featurefaildest= isset($_REQUEST["goto1"])?$_REQUEST[$_REQUEST['goto1'].'1']:null;
|
||||||
|
$failpin= isset($_REQUEST['failpin'])?$_REQUEST['failpin']:null;
|
||||||
|
$featurefailpin= isset($_REQUEST['featurefailpin'])?$_REQUEST['featurefailpin']:null;
|
||||||
|
|
||||||
|
//addslashes
|
||||||
|
switch ($action) {
|
||||||
|
case 'add':
|
||||||
|
customcontexts_customcontexts_add($context,$description,$dialrules,$faildest,$featurefaildest,$failpin,$featurefailpin);
|
||||||
|
break;
|
||||||
|
case 'edit':
|
||||||
|
if ($context <> $newcontext) {
|
||||||
|
$_REQUEST['extdisplay'] = isset($_REQUEST['extdisplay'])?$newcontext:null;
|
||||||
|
}
|
||||||
|
customcontexts_customcontexts_edit($context,$newcontext,$description,$dialrules,$faildest,$featurefaildest,$failpin,$featurefailpin);
|
||||||
|
$includes = isset($_REQUEST['includes'])?$_REQUEST['includes']:null;
|
||||||
|
customcontexts_customcontexts_editincludes($context,$includes,$newcontext);
|
||||||
|
break;
|
||||||
|
case 'del':
|
||||||
|
customcontexts_customcontexts_del($context);
|
||||||
|
$_REQUEST['extdisplay'] = null;
|
||||||
|
break;
|
||||||
|
case 'dup':
|
||||||
|
$newcontext = customcontexts_customcontexts_duplicatecontext($context);
|
||||||
|
if ($context <> $newcontext) {
|
||||||
|
$_REQUEST['extdisplay'] = isset($_REQUEST['extdisplay'])?$newcontext:null;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//retrieve a single custom context for the custom contexts page
|
||||||
|
function customcontexts_customcontexts_get($context) {
|
||||||
|
global $db;
|
||||||
|
$sql = "select context, description, dialrules, faildestination, featurefaildestination, failpin, featurefailpin from customcontexts_contexts where context = '$context'";
|
||||||
|
$results = $db->getAll($sql);
|
||||||
|
if(DB::IsError($results)) {
|
||||||
|
$results = null;
|
||||||
|
}
|
||||||
|
$tmparray = array($results[0][0], $results[0][1], $results[0][2], $results[0][3], $results[0][4], $results[0][5], $results[0][6]);
|
||||||
|
return $tmparray;
|
||||||
|
}
|
||||||
|
|
||||||
|
//add a new custom context for custom contexts page
|
||||||
|
function customcontexts_customcontexts_add($context,$description,$dialrules,$faildest,$featurefaildest,$failpin,$featurefailpin) {
|
||||||
|
global $db;
|
||||||
|
$sql = "insert customcontexts_contexts (context, description, dialrules, faildestination, featurefaildestination, failpin, featurefailpin) VALUES ('$context','$description','$dialrules','$faildest','$featurefaildest','$failpin','$featurefailpin')";
|
||||||
|
$db->query($sql);
|
||||||
|
needreload();
|
||||||
|
}
|
||||||
|
|
||||||
|
//delete a single custom context from the custom contexts page
|
||||||
|
function customcontexts_customcontexts_del($context) {
|
||||||
|
global $db;
|
||||||
|
$sql = "delete from customcontexts_includes where context = '$context'";
|
||||||
|
$db->query($sql);
|
||||||
|
$sql = "delete from customcontexts_contexts where context = '$context'";
|
||||||
|
$db->query($sql);
|
||||||
|
needreload();
|
||||||
|
}
|
||||||
|
|
||||||
|
//update a single custom context from the custom contexts page
|
||||||
|
function customcontexts_customcontexts_edit($context,$newcontext,$description,$dialrules,$faildest,$featurefaildest,$failpin,$featurefailpin) {
|
||||||
|
global $db;
|
||||||
|
if (!isset($newcontext) || ($newcontext == '')) {
|
||||||
|
$newcontext = $context;
|
||||||
|
}
|
||||||
|
$sql = "update customcontexts_contexts set context = '$newcontext', description = '$description', dialrules = '$dialrules', faildestination = '$faildest', featurefaildestination = '$featurefaildest', failpin = '$failpin', featurefailpin = '$featurefailpin' where context = '$context'";
|
||||||
|
$db->query($sql);
|
||||||
|
needreload();
|
||||||
|
}
|
||||||
|
|
||||||
|
//update the includes under a single custom context from the custom contexts page
|
||||||
|
function customcontexts_customcontexts_editincludes($context,$includes,$newcontext) {
|
||||||
|
global $db;
|
||||||
|
$sql = "delete from customcontexts_includes where context = '$context'";
|
||||||
|
$db->query($sql);
|
||||||
|
if (!isset($newcontext) || ($newcontext == '')) {
|
||||||
|
$newcontext = $context;
|
||||||
|
}
|
||||||
|
$includes = is_array($includes)?$includes:array();
|
||||||
|
foreach ($includes as $key=>$val) {
|
||||||
|
if ($val['allow'] <> 'no') {
|
||||||
|
$timegroup = 'null';
|
||||||
|
$sort = 0;
|
||||||
|
$userules = null;
|
||||||
|
if (is_numeric($val['allow'])) {
|
||||||
|
$timegroup = $val['allow'];
|
||||||
|
} else {
|
||||||
|
if ($val['allow'] <> 'yes') {
|
||||||
|
$userules = $val['allow'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (is_numeric($val['sort'])) {
|
||||||
|
$sort = $val['sort'];
|
||||||
|
}
|
||||||
|
$sql = "insert customcontexts_includes (context, include, timegroupid, sort, userules) values ('$newcontext','$key', $timegroup, $sort, '$userules')";
|
||||||
|
$db->query($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
needreload();
|
||||||
|
}
|
||||||
|
|
||||||
|
function customcontexts_customcontexts_duplicatecontext($context) {
|
||||||
|
global $db;
|
||||||
|
$suffix = '_2';
|
||||||
|
$counter = 2;
|
||||||
|
$sql = "select description, dialrules, faildestination, featurefaildestination, failpin, featurefailpin from customcontexts_contexts where context = '$context'";
|
||||||
|
$results = $db->getAll($sql);
|
||||||
|
if(DB::IsError($results)) {
|
||||||
|
$results = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$description = $results[0][0];
|
||||||
|
$dialrules = $results[0][1];
|
||||||
|
$faildest = $results[0][2];
|
||||||
|
$featurefaildest = $results[0][3];
|
||||||
|
$failpin = $results[0][4];
|
||||||
|
$featurefailpin = $results[0][5];
|
||||||
|
$sql = "select count(*) from customcontexts_contexts where context = '".$context.$suffix."' or description = '".$description.$suffix."'";
|
||||||
|
$results = $db->getAll($sql);
|
||||||
|
if(DB::IsError($results)) {
|
||||||
|
$results = null;
|
||||||
|
}
|
||||||
|
while ($results[0][0] > 0) {
|
||||||
|
$counter = $counter + 1;
|
||||||
|
$suffix = '_'.$counter;
|
||||||
|
$sql = "select count(*) from customcontexts_contexts where context = '".$context.$suffix."' or description = '".$description.$suffix."'";
|
||||||
|
$results = $db->getAll($sql);
|
||||||
|
if(DB::IsError($results)) {
|
||||||
|
$results = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
customcontexts_customcontexts_add($context.$suffix,$description.$suffix,$dialrules,$faildest,$featurefaildest,$failpin,$featurefailpin);
|
||||||
|
$includes = customcontexts_getincludes($context);
|
||||||
|
$includes = is_array($includes)?$includes:array();
|
||||||
|
foreach ($includes as $val) {
|
||||||
|
$newincludes[$val[2]] = array("allow"=>"$val[4]", "sort"=>"$val[5]");
|
||||||
|
}
|
||||||
|
customcontexts_customcontexts_editincludes($context.$suffix,$newincludes,$context.$suffix);
|
||||||
|
needreload();
|
||||||
|
return $context.$suffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* callback to Time Groups Module so it can display usage information
|
||||||
|
of specific groups
|
||||||
|
*/
|
||||||
|
function customcontexts_timegroups_usage($group_id) {
|
||||||
|
|
||||||
|
$group_id = q($group_id);
|
||||||
|
$results = sql("SELECT DISTINCT context, timegroupid FROM customcontexts_includes WHERE timegroupid = $group_id","getAll",DB_FETCHMODE_ASSOC);
|
||||||
|
if (empty($results)) {
|
||||||
|
return array();
|
||||||
|
} else {
|
||||||
|
foreach ($results as $result) {
|
||||||
|
$usage_arr[] = array(
|
||||||
|
"url_query" => "display=customcontexts&extdisplay=".$result['context'],
|
||||||
|
"description" => sprintf(_("Custom Context: %s"),$result['context']),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return $usage_arr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function customcontexts_check_destinations($dest=true) {
|
||||||
|
global $active_modules;
|
||||||
|
|
||||||
|
$destlist = array();
|
||||||
|
if (is_array($dest) && empty($dest)) {
|
||||||
|
return $destlist;
|
||||||
|
}
|
||||||
|
$sql = "SELECT context, description, faildestination, featurefaildestination FROM customcontexts_contexts";
|
||||||
|
if ($dest !== true) {
|
||||||
|
$sql .= " WHERE (faildestination in ('".implode("','",$dest)."') ) OR (featurefaildestination in ('".implode("','",$dest)."') )";
|
||||||
|
}
|
||||||
|
$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
|
||||||
|
|
||||||
|
$type = isset($active_modules['customcontexts']['type'])?$active_modules['customcontexts']['type']:'setup';
|
||||||
|
|
||||||
|
foreach ($results as $result) {
|
||||||
|
$thisdest = $result['faildestination'];
|
||||||
|
// blank destinations in custom context are valid
|
||||||
|
if (!$thisdest) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$thisid = $result['context'];
|
||||||
|
$description = sprintf(_("Custom Context: %s (%s)"),$result['description'],$result['context']);
|
||||||
|
$thisurl = 'config.php?display=customcontexts&extdisplay='.urlencode($thisid);
|
||||||
|
if ($dest === true || $dest = $thisdest) {
|
||||||
|
$destlist[] = array(
|
||||||
|
'dest' => $thisdest,
|
||||||
|
'description' => $description,
|
||||||
|
'edit_url' => $thisurl,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$thisdest = $result['featurefaildestination'];
|
||||||
|
if ($dest === true || $dest = $thisdest) {
|
||||||
|
$destlist[] = array(
|
||||||
|
'dest' => $thisdest,
|
||||||
|
'description' => $description,
|
||||||
|
'edit_url' => $thisurl,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $destlist;
|
||||||
|
}
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,154 @@
|
||||||
|
# This file is part of FreePBX.
|
||||||
|
#
|
||||||
|
# FreePBX is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# FreePBX is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with FreePBX. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# FreePBX language template for customcontexts
|
||||||
|
# Copyright (C) 2008, 2009, 2010 Bandwith.com
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2018-10-30 15:10-0400\n"
|
||||||
|
"PO-Revision-Date: 2015-07-07 16:14+0200\n"
|
||||||
|
"Last-Translator: Chavdar <chavdar_75@yahoo.com>\n"
|
||||||
|
"Language-Team: Bulgarian <http://weblate.freepbx.org/projects/fpbxcn/"
|
||||||
|
"customcontexts/bg_BG/>\n"
|
||||||
|
"Language: bg_BG\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||||
|
"X-Generator: Weblate 2.2-dev\n"
|
||||||
|
|
||||||
|
#: functions.inc.php:375 functions.inc.php:534
|
||||||
|
msgid " v"
|
||||||
|
msgstr " v"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:23
|
||||||
|
msgid "ALLOW ALL (Default)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:377 functions.inc.php:536
|
||||||
|
msgid "Add Context"
|
||||||
|
msgstr "Добави Context"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Add Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Add User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:6
|
||||||
|
msgid "Connectivity"
|
||||||
|
msgstr "Свързване"
|
||||||
|
|
||||||
|
#: functions.inc.php:368 functions.inc.php:392 functions.inc.php:525
|
||||||
|
#: page.customcontexts.php:21 page.customcontextsadmin.php:24
|
||||||
|
msgid "Context"
|
||||||
|
msgstr "Context"
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:8
|
||||||
|
msgid ""
|
||||||
|
"Creates custom contexts which can be used to allow limited access to "
|
||||||
|
"dialplan applications. Allows for time restrictions on any dialplan access. "
|
||||||
|
"Allows for pattern matching to allow/deny. Allows for failover destinations, "
|
||||||
|
"and PIN protected failover. This can be very useful for multi-tennant "
|
||||||
|
"systems. Inbound routing can be done using DID or zap channel routing,\tthis "
|
||||||
|
"module allows for selective outbound routing. House/public phones can be "
|
||||||
|
"placed in a restricted context allowing them only internal calls."
|
||||||
|
msgstr ""
|
||||||
|
"Създава потребителски контексти, които могат да бъдат използвани за да се "
|
||||||
|
"позволи ограничен достъп до плановете за набиране. Дава възможност за "
|
||||||
|
"времеви ограничения на всеки план за набиране. Позволява при съвпадение на "
|
||||||
|
"модел да позволи/отмени набирането. Дава възможност за направления при "
|
||||||
|
"проваляне и защита с PIN за направления при проваляне. Това може да бъде "
|
||||||
|
"много полезно за multi-tennant системи. Входящите маршрути могат да се "
|
||||||
|
"направят с помощта на DID или ZAP маршрутизация на каналите,\tтози модул "
|
||||||
|
"позволява селективно изходящо маршрутизиране. Обществени телефони могат да "
|
||||||
|
"бъдат поставени в ограничен контекст, който да им позволява само вътрешни "
|
||||||
|
"обаждания."
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
msgid "Custom Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:773
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s"
|
||||||
|
msgstr "Потребителски Context: %s"
|
||||||
|
|
||||||
|
#: functions.inc.php:802
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s (%s)"
|
||||||
|
msgstr "Потребителски Context: %s (%s)"
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:4 customcontexts.i18n.php:10
|
||||||
|
msgid "Custom Contexts"
|
||||||
|
msgstr "Потребителски Contexts"
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:12
|
||||||
|
msgid "Custom Contexts Admin"
|
||||||
|
msgstr "Custom Contexts Админ"
|
||||||
|
|
||||||
|
#: functions.inc.php:552
|
||||||
|
msgid "Duplicate Context"
|
||||||
|
msgstr "Дублирай Context"
|
||||||
|
|
||||||
|
#: functions.inc.php:386 functions.inc.php:549
|
||||||
|
msgid "Edit Context"
|
||||||
|
msgstr "Редактирай Context"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Edit Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Edit User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:388
|
||||||
|
msgid "Remove Context"
|
||||||
|
msgstr "Премахни Context"
|
||||||
|
|
||||||
|
#: install.php:33
|
||||||
|
msgid "Time Conditions Module required and not present .. aborting install"
|
||||||
|
msgstr ""
|
||||||
|
"Изисква се модул Времеви Условия, който не е инсталиран .. прекъсване на "
|
||||||
|
"инсталацията"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
#, php-format
|
||||||
|
msgid ""
|
||||||
|
"You can select a custom context from this list to limit this user to "
|
||||||
|
"portions of the dialplan you defined in the %s module."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:141 install.php:149
|
||||||
|
msgid "done"
|
||||||
|
msgstr "изпълнено"
|
||||||
|
|
||||||
|
#: install.php:135
|
||||||
|
msgid "migrating customcontexts_timegroups if needed.."
|
||||||
|
msgstr "мигриране на customcontexts_timegroups ако е необходимо.."
|
||||||
|
|
||||||
|
#: install.php:142
|
||||||
|
msgid ""
|
||||||
|
"removing customcontexts_timegroups and customcontexts_tiemgroups_detail "
|
||||||
|
"tables.."
|
||||||
|
msgstr ""
|
||||||
|
"премахване customcontexts_timegroups и customcontexts_tiemgroups_detail "
|
||||||
|
"таблици.."
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,123 @@
|
||||||
|
# This file is part of FreePBX.
|
||||||
|
#
|
||||||
|
# FreePBX is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# FreePBX is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with FreePBX. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# FreePBX language template for customcontexts
|
||||||
|
# Copyright (C) 2008, 2009, 2010 Bandwith.com
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2015-11-24 14:17-0800\n"
|
||||||
|
"PO-Revision-Date: 2014-11-10 16:18+0200\n"
|
||||||
|
"Last-Translator: Chavdar <chavdar_75@yahoo.com>\n"
|
||||||
|
"Language-Team: Bulgarian <http://git.freepbx.org/projects/freepbx/"
|
||||||
|
"customcontexts/bg/>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Language: bg\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||||
|
"X-Generator: Weblate 1.10-dev\n"
|
||||||
|
|
||||||
|
#: functions.inc.php:413 functions.inc.php:572
|
||||||
|
msgid " v"
|
||||||
|
msgstr " v"
|
||||||
|
|
||||||
|
#: functions.inc.php:415 functions.inc.php:574
|
||||||
|
msgid "Add Context"
|
||||||
|
msgstr "Добави Context"
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:6 customcontexts.i18n.php:12
|
||||||
|
msgid "Connectivity"
|
||||||
|
msgstr "Свързване"
|
||||||
|
|
||||||
|
#: functions.inc.php:406 functions.inc.php:430 functions.inc.php:563
|
||||||
|
#: page.customcontexts.php:21 page.customcontextsadmin.php:24
|
||||||
|
msgid "Context"
|
||||||
|
msgstr "Context"
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:8
|
||||||
|
msgid ""
|
||||||
|
"Creates custom contexts which can be used to allow limited access to "
|
||||||
|
"dialplan applications. Allows for time restrictions on any dialplan access. "
|
||||||
|
"Allows for pattern matching to allow/deny. Allows for failover destinations, "
|
||||||
|
"and PIN protected failover. This can be very useful for multi-tennant "
|
||||||
|
"systems. Inbound routing can be done using DID or zap channel routing,\tthis "
|
||||||
|
"module allows for selective outbound routing. House/public phones can be "
|
||||||
|
"placed in a restricted context allowing them only internal calls."
|
||||||
|
msgstr ""
|
||||||
|
"Създава потребителски контексти, които могат да бъдат използвани за да се "
|
||||||
|
"позволи ограничен достъп до плановете за набиране. Дава възможност за "
|
||||||
|
"времеви ограничения на всеки план за набиране. Позволява при съвпадение на "
|
||||||
|
"модел да позволи/отмени набирането. Дава възможност за направления при "
|
||||||
|
"проваляне и защита с PIN за направления при проваляне. Това може да бъде "
|
||||||
|
"много полезно за multi-tennant системи. Входящите маршрути могат да се "
|
||||||
|
"направят с помощта на DID или ZAP маршрутизация на каналите,\tтози модул "
|
||||||
|
"позволява селективно изходящо маршрутизиране. Обществени телефони могат да "
|
||||||
|
"бъдат поставени в ограничен контекст, който да им позволява само вътрешни "
|
||||||
|
"обаждания."
|
||||||
|
|
||||||
|
#: functions.inc.php:811
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s"
|
||||||
|
msgstr "Custom Context: %s"
|
||||||
|
|
||||||
|
#: functions.inc.php:840
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s (%s)"
|
||||||
|
msgstr "Custom Context: %s (%s)"
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:4 customcontexts.i18n.php:10
|
||||||
|
msgid "Custom Contexts"
|
||||||
|
msgstr "Custom Contexts"
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:14
|
||||||
|
msgid "Custom Contexts Admin"
|
||||||
|
msgstr "Custom Contexts Админ"
|
||||||
|
|
||||||
|
#: functions.inc.php:590
|
||||||
|
msgid "Duplicate Context"
|
||||||
|
msgstr "Дублирай Context"
|
||||||
|
|
||||||
|
#: functions.inc.php:424 functions.inc.php:587
|
||||||
|
msgid "Edit Context"
|
||||||
|
msgstr "Редактирай Context"
|
||||||
|
|
||||||
|
#: functions.inc.php:426
|
||||||
|
msgid "Remove Context"
|
||||||
|
msgstr "Премахни Context"
|
||||||
|
|
||||||
|
#: install.php:33
|
||||||
|
msgid "Time Conditions Module required and not present .. aborting install"
|
||||||
|
msgstr ""
|
||||||
|
"Изисква се модул Времеви Условия, който не е инсталиран .. прекъсване на "
|
||||||
|
"инсталацията"
|
||||||
|
|
||||||
|
#: install.php:141 install.php:149
|
||||||
|
msgid "done"
|
||||||
|
msgstr "изпълнено"
|
||||||
|
|
||||||
|
#: install.php:135
|
||||||
|
msgid "migrating customcontexts_timegroups if needed.."
|
||||||
|
msgstr "мигриране на customcontexts_timegroups ако е необходимо.."
|
||||||
|
|
||||||
|
#: install.php:142
|
||||||
|
msgid ""
|
||||||
|
"removing customcontexts_timegroups and customcontexts_tiemgroups_detail "
|
||||||
|
"tables.."
|
||||||
|
msgstr ""
|
||||||
|
"премахване customcontexts_timegroups и customcontexts_tiemgroups_detail "
|
||||||
|
"таблици.."
|
||||||
|
|
@ -0,0 +1,134 @@
|
||||||
|
# This file is part of FreePBX.
|
||||||
|
#
|
||||||
|
# For licensing information, please see the file named LICENSE located in the module directory
|
||||||
|
#
|
||||||
|
# FreePBX language template for customcontexts
|
||||||
|
# Copyright (C) 2008-2020 Sangoma Technologies, Inc.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2020-06-24 04:17+0000\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"Language: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=utf-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: functions.inc.php:375
|
||||||
|
#: functions.inc.php:534
|
||||||
|
msgid " v"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:23
|
||||||
|
msgid "ALLOW ALL (Default)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:377
|
||||||
|
#: functions.inc.php:536
|
||||||
|
msgid "Add Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Add Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Add User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:6
|
||||||
|
msgid "Connectivity"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:368
|
||||||
|
#: functions.inc.php:392
|
||||||
|
#: functions.inc.php:525
|
||||||
|
#: page.customcontexts.php:21
|
||||||
|
#: page.customcontextsadmin.php:24
|
||||||
|
msgid "Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:8
|
||||||
|
msgid ""
|
||||||
|
"Creates custom contexts which can be used to allow limited access to "
|
||||||
|
"dialplan applications. Allows for time restrictions on any dialplan access. "
|
||||||
|
"Allows for pattern matching to allow/deny. Allows for failover destinations, "
|
||||||
|
"and PIN protected failover. This can be very useful for multi-tennant "
|
||||||
|
"systems. Inbound routing can be done using DID or zap channel routing,\tthis "
|
||||||
|
"module allows for selective outbound routing. House/public phones can be "
|
||||||
|
"placed in a restricted context allowing them only internal calls."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
msgid "Custom Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:773
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:802
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s (%s)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:4
|
||||||
|
#: customcontexts.i18n.php:10
|
||||||
|
msgid "Custom Contexts"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:12
|
||||||
|
msgid "Custom Contexts Admin"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:552
|
||||||
|
msgid "Duplicate Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:386
|
||||||
|
#: functions.inc.php:549
|
||||||
|
msgid "Edit Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Edit Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Edit User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:388
|
||||||
|
msgid "Remove Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:33
|
||||||
|
msgid "Time Conditions Module required and not present .. aborting install"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
#, php-format
|
||||||
|
msgid ""
|
||||||
|
"You can select a custom context from this list to limit this user to "
|
||||||
|
"portions of the dialplan you defined in the %s module."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:141
|
||||||
|
#: install.php:149
|
||||||
|
msgid "done"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:135
|
||||||
|
msgid "migrating customcontexts_timegroups if needed.."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:142
|
||||||
|
msgid ""
|
||||||
|
"removing customcontexts_timegroups and customcontexts_tiemgroups_detail "
|
||||||
|
"tables.."
|
||||||
|
msgstr ""
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,127 @@
|
||||||
|
# This file is part of FreePBX.
|
||||||
|
#
|
||||||
|
# For licensing information, please see the file named LICENSE located in the module directory
|
||||||
|
#
|
||||||
|
# FreePBX language template for customcontexts
|
||||||
|
# Copyright (C) 2008-2015 Sangoma, Inc.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2018-10-30 15:10-0400\n"
|
||||||
|
"PO-Revision-Date: 2015-08-17 16:25-0700\n"
|
||||||
|
"Last-Translator: Automatically generated\n"
|
||||||
|
"Language-Team: none\n"
|
||||||
|
"Language: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#: functions.inc.php:375 functions.inc.php:534
|
||||||
|
msgid " v"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:23
|
||||||
|
msgid "ALLOW ALL (Default)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:377 functions.inc.php:536
|
||||||
|
msgid "Add Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Add Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Add User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:6
|
||||||
|
msgid "Connectivity"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:368 functions.inc.php:392 functions.inc.php:525
|
||||||
|
#: page.customcontexts.php:21 page.customcontextsadmin.php:24
|
||||||
|
msgid "Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:8
|
||||||
|
msgid ""
|
||||||
|
"Creates custom contexts which can be used to allow limited access to "
|
||||||
|
"dialplan applications. Allows for time restrictions on any dialplan access. "
|
||||||
|
"Allows for pattern matching to allow/deny. Allows for failover destinations, "
|
||||||
|
"and PIN protected failover. This can be very useful for multi-tennant "
|
||||||
|
"systems. Inbound routing can be done using DID or zap channel routing,\tthis "
|
||||||
|
"module allows for selective outbound routing. House/public phones can be "
|
||||||
|
"placed in a restricted context allowing them only internal calls."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
msgid "Custom Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:773
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:802
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s (%s)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:4 customcontexts.i18n.php:10
|
||||||
|
msgid "Custom Contexts"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:12
|
||||||
|
msgid "Custom Contexts Admin"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:552
|
||||||
|
msgid "Duplicate Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:386 functions.inc.php:549
|
||||||
|
msgid "Edit Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Edit Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Edit User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:388
|
||||||
|
msgid "Remove Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:33
|
||||||
|
msgid "Time Conditions Module required and not present .. aborting install"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
#, php-format
|
||||||
|
msgid ""
|
||||||
|
"You can select a custom context from this list to limit this user to "
|
||||||
|
"portions of the dialplan you defined in the %s module."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:141 install.php:149
|
||||||
|
msgid "done"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:135
|
||||||
|
msgid "migrating customcontexts_timegroups if needed.."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:142
|
||||||
|
msgid ""
|
||||||
|
"removing customcontexts_timegroups and customcontexts_tiemgroups_detail "
|
||||||
|
"tables.."
|
||||||
|
msgstr ""
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,153 @@
|
||||||
|
# This file is part of FreePBX.
|
||||||
|
#
|
||||||
|
# FreePBX is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# FreePBX is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with FreePBX. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# FreePBX language template for customcontexts
|
||||||
|
# Copyright (C) 2008, 2009, 2010 Bandwith.com
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2018-10-30 15:10-0400\n"
|
||||||
|
"PO-Revision-Date: 2015-04-25 07:59+0200\n"
|
||||||
|
"Last-Translator: Victor <victor.martinez@neocenter.com>\n"
|
||||||
|
"Language-Team: Spanish <http://weblate.freepbx.org/projects/fpbxcn/"
|
||||||
|
"customcontexts/es_ES/>\n"
|
||||||
|
"Language: es_ES\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||||
|
"X-Generator: Weblate 2.2-dev\n"
|
||||||
|
|
||||||
|
#: functions.inc.php:375 functions.inc.php:534
|
||||||
|
msgid " v"
|
||||||
|
msgstr " v"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:23
|
||||||
|
msgid "ALLOW ALL (Default)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:377 functions.inc.php:536
|
||||||
|
msgid "Add Context"
|
||||||
|
msgstr "Agregar Contexto"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Add Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Add User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:6
|
||||||
|
msgid "Connectivity"
|
||||||
|
msgstr "Conectividad"
|
||||||
|
|
||||||
|
#: functions.inc.php:368 functions.inc.php:392 functions.inc.php:525
|
||||||
|
#: page.customcontexts.php:21 page.customcontextsadmin.php:24
|
||||||
|
msgid "Context"
|
||||||
|
msgstr "Contexto"
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:8
|
||||||
|
msgid ""
|
||||||
|
"Creates custom contexts which can be used to allow limited access to "
|
||||||
|
"dialplan applications. Allows for time restrictions on any dialplan access. "
|
||||||
|
"Allows for pattern matching to allow/deny. Allows for failover destinations, "
|
||||||
|
"and PIN protected failover. This can be very useful for multi-tennant "
|
||||||
|
"systems. Inbound routing can be done using DID or zap channel routing,\tthis "
|
||||||
|
"module allows for selective outbound routing. House/public phones can be "
|
||||||
|
"placed in a restricted context allowing them only internal calls."
|
||||||
|
msgstr ""
|
||||||
|
"Crea contextos personalizados que pueden ser utilizados para permitir acceso "
|
||||||
|
"limitado a las aplicaciones del dialplan. Permite las restricciones de "
|
||||||
|
"tiempo en cualquier acceso al dialplan. Permite la comparación de patrones "
|
||||||
|
"para permitir / denegar. Permite destinos failover, y PIN failover "
|
||||||
|
"protegido. Esto puede ser muy útil para sistemas multi-Tennant. El "
|
||||||
|
"erutamiento inboubd se puede hacer mediante DID o a través canal zap, → este "
|
||||||
|
"módulo permite enrutamiento outbound selectivo. Casa / teléfonos públicos "
|
||||||
|
"se pueden colocar en un contexto restringido permitiéndo sólo llamadas "
|
||||||
|
"internas."
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
msgid "Custom Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:773
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s"
|
||||||
|
msgstr "Contexto Personalizado: %s"
|
||||||
|
|
||||||
|
#: functions.inc.php:802
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s (%s)"
|
||||||
|
msgstr "Contexto Personalizado: %s (%s)"
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:4 customcontexts.i18n.php:10
|
||||||
|
msgid "Custom Contexts"
|
||||||
|
msgstr "Contextos Personalizados"
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:12
|
||||||
|
msgid "Custom Contexts Admin"
|
||||||
|
msgstr "Administración de contextos personlizado"
|
||||||
|
|
||||||
|
#: functions.inc.php:552
|
||||||
|
msgid "Duplicate Context"
|
||||||
|
msgstr "Duplicar Contexto"
|
||||||
|
|
||||||
|
#: functions.inc.php:386 functions.inc.php:549
|
||||||
|
msgid "Edit Context"
|
||||||
|
msgstr "Editar Contexto"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Edit Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Edit User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:388
|
||||||
|
msgid "Remove Context"
|
||||||
|
msgstr "Remover Contexto"
|
||||||
|
|
||||||
|
#: install.php:33
|
||||||
|
msgid "Time Conditions Module required and not present .. aborting install"
|
||||||
|
msgstr ""
|
||||||
|
"Módulo de Condiciones de tiempo requerido y no presente .. abortar "
|
||||||
|
"instalación"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
#, php-format
|
||||||
|
msgid ""
|
||||||
|
"You can select a custom context from this list to limit this user to "
|
||||||
|
"portions of the dialplan you defined in the %s module."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:141 install.php:149
|
||||||
|
msgid "done"
|
||||||
|
msgstr "Listo"
|
||||||
|
|
||||||
|
#: install.php:135
|
||||||
|
msgid "migrating customcontexts_timegroups if needed.."
|
||||||
|
msgstr "migrar customcontexts _timegroups si es necesario .."
|
||||||
|
|
||||||
|
#: install.php:142
|
||||||
|
msgid ""
|
||||||
|
"removing customcontexts_timegroups and customcontexts_tiemgroups_detail "
|
||||||
|
"tables.."
|
||||||
|
msgstr ""
|
||||||
|
"eliminando customcontexts_timegroups y mesas "
|
||||||
|
"customcontexts_tiemgroups_detail .."
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,137 @@
|
||||||
|
# This file is part of FreePBX.
|
||||||
|
#
|
||||||
|
# FreePBX is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# FreePBX is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with FreePBX. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# FreePBX language template for customcontexts
|
||||||
|
# Copyright (C) 2008, 2009, 2010 Bandwith.com
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2018-10-30 15:10-0400\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"Language: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: functions.inc.php:375 functions.inc.php:534
|
||||||
|
msgid " v"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:23
|
||||||
|
msgid "ALLOW ALL (Default)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:377 functions.inc.php:536
|
||||||
|
msgid "Add Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Add Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Add User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:6
|
||||||
|
msgid "Connectivity"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:368 functions.inc.php:392 functions.inc.php:525
|
||||||
|
#: page.customcontexts.php:21 page.customcontextsadmin.php:24
|
||||||
|
msgid "Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:8
|
||||||
|
msgid ""
|
||||||
|
"Creates custom contexts which can be used to allow limited access to "
|
||||||
|
"dialplan applications. Allows for time restrictions on any dialplan access. "
|
||||||
|
"Allows for pattern matching to allow/deny. Allows for failover destinations, "
|
||||||
|
"and PIN protected failover. This can be very useful for multi-tennant "
|
||||||
|
"systems. Inbound routing can be done using DID or zap channel routing,\tthis "
|
||||||
|
"module allows for selective outbound routing. House/public phones can be "
|
||||||
|
"placed in a restricted context allowing them only internal calls."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
msgid "Custom Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:773
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:802
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s (%s)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:4 customcontexts.i18n.php:10
|
||||||
|
msgid "Custom Contexts"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:12
|
||||||
|
msgid "Custom Contexts Admin"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:552
|
||||||
|
msgid "Duplicate Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:386 functions.inc.php:549
|
||||||
|
msgid "Edit Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Edit Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Edit User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:388
|
||||||
|
msgid "Remove Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:33
|
||||||
|
msgid "Time Conditions Module required and not present .. aborting install"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
#, php-format
|
||||||
|
msgid ""
|
||||||
|
"You can select a custom context from this list to limit this user to "
|
||||||
|
"portions of the dialplan you defined in the %s module."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:141 install.php:149
|
||||||
|
msgid "done"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:135
|
||||||
|
msgid "migrating customcontexts_timegroups if needed.."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:142
|
||||||
|
msgid ""
|
||||||
|
"removing customcontexts_timegroups and customcontexts_tiemgroups_detail "
|
||||||
|
"tables.."
|
||||||
|
msgstr ""
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,132 @@
|
||||||
|
# This file is part of FreePBX.
|
||||||
|
#
|
||||||
|
# For licensing information, please see the file named LICENSE located in the module directory
|
||||||
|
#
|
||||||
|
# FreePBX language template for customcontexts
|
||||||
|
# Copyright (C) 2008-2015 Sangoma, Inc.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2018-10-30 15:10-0400\n"
|
||||||
|
"PO-Revision-Date: 2017-05-30 21:10+0200\n"
|
||||||
|
"Last-Translator: Rafael <rafael@ibinetwork.com.br>\n"
|
||||||
|
"Language-Team: Portuguese (Brazil) <http://weblate.freepbx.org/projects/"
|
||||||
|
"fpbxcn/customcontexts/pt_BR/>\n"
|
||||||
|
"Language: pt_BR\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||||
|
"X-Generator: Weblate 2.4\n"
|
||||||
|
|
||||||
|
#: functions.inc.php:375 functions.inc.php:534
|
||||||
|
msgid " v"
|
||||||
|
msgstr " v"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:23
|
||||||
|
msgid "ALLOW ALL (Default)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:377 functions.inc.php:536
|
||||||
|
msgid "Add Context"
|
||||||
|
msgstr "Adicionar Contexto"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Add Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Add User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:6
|
||||||
|
msgid "Connectivity"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:368 functions.inc.php:392 functions.inc.php:525
|
||||||
|
#: page.customcontexts.php:21 page.customcontextsadmin.php:24
|
||||||
|
msgid "Context"
|
||||||
|
msgstr "Contexto"
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:8
|
||||||
|
msgid ""
|
||||||
|
"Creates custom contexts which can be used to allow limited access to "
|
||||||
|
"dialplan applications. Allows for time restrictions on any dialplan access. "
|
||||||
|
"Allows for pattern matching to allow/deny. Allows for failover destinations, "
|
||||||
|
"and PIN protected failover. This can be very useful for multi-tennant "
|
||||||
|
"systems. Inbound routing can be done using DID or zap channel routing,\tthis "
|
||||||
|
"module allows for selective outbound routing. House/public phones can be "
|
||||||
|
"placed in a restricted context allowing them only internal calls."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
msgid "Custom Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:773
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s"
|
||||||
|
msgstr "Contexto Personalizado: %s"
|
||||||
|
|
||||||
|
#: functions.inc.php:802
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s (%s)"
|
||||||
|
msgstr "Contexto Personalizado: %s (%s)"
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:4 customcontexts.i18n.php:10
|
||||||
|
msgid "Custom Contexts"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:12
|
||||||
|
msgid "Custom Contexts Admin"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:552
|
||||||
|
msgid "Duplicate Context"
|
||||||
|
msgstr "Clonar Contexto"
|
||||||
|
|
||||||
|
#: functions.inc.php:386 functions.inc.php:549
|
||||||
|
msgid "Edit Context"
|
||||||
|
msgstr "Editar Contexto"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Edit Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Edit User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:388
|
||||||
|
msgid "Remove Context"
|
||||||
|
msgstr "Remover Contexto"
|
||||||
|
|
||||||
|
#: install.php:33
|
||||||
|
msgid "Time Conditions Module required and not present .. aborting install"
|
||||||
|
msgstr ""
|
||||||
|
"Módulo Time Conditions requerido e não instalado... cancelando instalação"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
#, php-format
|
||||||
|
msgid ""
|
||||||
|
"You can select a custom context from this list to limit this user to "
|
||||||
|
"portions of the dialplan you defined in the %s module."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:141 install.php:149
|
||||||
|
msgid "done"
|
||||||
|
msgstr "pronto"
|
||||||
|
|
||||||
|
#: install.php:135
|
||||||
|
msgid "migrating customcontexts_timegroups if needed.."
|
||||||
|
msgstr "migrando customcontexts_timegroups se necessário.."
|
||||||
|
|
||||||
|
#: install.php:142
|
||||||
|
msgid ""
|
||||||
|
"removing customcontexts_timegroups and customcontexts_tiemgroups_detail "
|
||||||
|
"tables.."
|
||||||
|
msgstr ""
|
||||||
|
"removendo customcontexts_timegroups e customcontexts_tiemgroups_detail "
|
||||||
|
"tabelas.."
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,133 @@
|
||||||
|
# This file is part of FreePBX.
|
||||||
|
#
|
||||||
|
# For licensing information, please see the file named LICENSE located in the module directory
|
||||||
|
#
|
||||||
|
# FreePBX language template for customcontexts
|
||||||
|
# Copyright (C) 2008-2015 Sangoma, Inc.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: 1.5\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2018-10-30 15:10-0400\n"
|
||||||
|
"PO-Revision-Date: 2016-04-29 18:58+0200\n"
|
||||||
|
"Last-Translator: ded <ceo@postmet.com>\n"
|
||||||
|
"Language-Team: Russian <http://weblate.freepbx.org/projects/fpbxcn/"
|
||||||
|
"customcontexts/ru/>\n"
|
||||||
|
"Language: ru\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
||||||
|
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||||
|
"X-Generator: Weblate 2.4\n"
|
||||||
|
|
||||||
|
#: functions.inc.php:375 functions.inc.php:534
|
||||||
|
msgid " v"
|
||||||
|
msgstr " v"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:23
|
||||||
|
msgid "ALLOW ALL (Default)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:377 functions.inc.php:536
|
||||||
|
msgid "Add Context"
|
||||||
|
msgstr "Добавить контекст"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Add Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Add User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:6
|
||||||
|
msgid "Connectivity"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:368 functions.inc.php:392 functions.inc.php:525
|
||||||
|
#: page.customcontexts.php:21 page.customcontextsadmin.php:24
|
||||||
|
msgid "Context"
|
||||||
|
msgstr "Контекст"
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:8
|
||||||
|
msgid ""
|
||||||
|
"Creates custom contexts which can be used to allow limited access to "
|
||||||
|
"dialplan applications. Allows for time restrictions on any dialplan access. "
|
||||||
|
"Allows for pattern matching to allow/deny. Allows for failover destinations, "
|
||||||
|
"and PIN protected failover. This can be very useful for multi-tennant "
|
||||||
|
"systems. Inbound routing can be done using DID or zap channel routing,\tthis "
|
||||||
|
"module allows for selective outbound routing. House/public phones can be "
|
||||||
|
"placed in a restricted context allowing them only internal calls."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
msgid "Custom Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:773
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s"
|
||||||
|
msgstr "Пользовательский контекст: %s"
|
||||||
|
|
||||||
|
#: functions.inc.php:802
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s (%s)"
|
||||||
|
msgstr "Пользовательский контекст: %s(%s)"
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:4 customcontexts.i18n.php:10
|
||||||
|
msgid "Custom Contexts"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:12
|
||||||
|
msgid "Custom Contexts Admin"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:552
|
||||||
|
msgid "Duplicate Context"
|
||||||
|
msgstr "Дублировать контекст"
|
||||||
|
|
||||||
|
#: functions.inc.php:386 functions.inc.php:549
|
||||||
|
msgid "Edit Context"
|
||||||
|
msgstr "Редактировать контекст"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Edit Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Edit User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:388
|
||||||
|
msgid "Remove Context"
|
||||||
|
msgstr "Удалить контекст"
|
||||||
|
|
||||||
|
#: install.php:33
|
||||||
|
msgid "Time Conditions Module required and not present .. aborting install"
|
||||||
|
msgstr ""
|
||||||
|
"Отстутствует необходимый модуль Условия По Времени... завершение установки"
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
#, php-format
|
||||||
|
msgid ""
|
||||||
|
"You can select a custom context from this list to limit this user to "
|
||||||
|
"portions of the dialplan you defined in the %s module."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:141 install.php:149
|
||||||
|
msgid "done"
|
||||||
|
msgstr "выполнено"
|
||||||
|
|
||||||
|
#: install.php:135
|
||||||
|
msgid "migrating customcontexts_timegroups if needed.."
|
||||||
|
msgstr "перенос customcontexts_timegroups если необходимо.."
|
||||||
|
|
||||||
|
#: install.php:142
|
||||||
|
msgid ""
|
||||||
|
"removing customcontexts_timegroups and customcontexts_tiemgroups_detail "
|
||||||
|
"tables.."
|
||||||
|
msgstr ""
|
||||||
|
"удаление таблиц customcontexts_timegroups и "
|
||||||
|
"customcontexts_tiemgroups_detail.."
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,125 @@
|
||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
#, fuzzy
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Custom Context Swedish Language\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2018-10-30 15:10-0400\n"
|
||||||
|
"PO-Revision-Date: 2010-06-19 11:41:+0200\n"
|
||||||
|
"Last-Translator: Mikael Carlsson <mickecamino@gmail.com>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"Language: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: functions.inc.php:375 functions.inc.php:534
|
||||||
|
msgid " v"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:23
|
||||||
|
msgid "ALLOW ALL (Default)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:377 functions.inc.php:536
|
||||||
|
msgid "Add Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Add Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Add User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:6
|
||||||
|
msgid "Connectivity"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:368 functions.inc.php:392 functions.inc.php:525
|
||||||
|
#: page.customcontexts.php:21 page.customcontextsadmin.php:24
|
||||||
|
msgid "Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:8
|
||||||
|
msgid ""
|
||||||
|
"Creates custom contexts which can be used to allow limited access to "
|
||||||
|
"dialplan applications. Allows for time restrictions on any dialplan access. "
|
||||||
|
"Allows for pattern matching to allow/deny. Allows for failover destinations, "
|
||||||
|
"and PIN protected failover. This can be very useful for multi-tennant "
|
||||||
|
"systems. Inbound routing can be done using DID or zap channel routing,\tthis "
|
||||||
|
"module allows for selective outbound routing. House/public phones can be "
|
||||||
|
"placed in a restricted context allowing them only internal calls."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
msgid "Custom Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:773
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:802
|
||||||
|
#, php-format
|
||||||
|
msgid "Custom Context: %s (%s)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:4 customcontexts.i18n.php:10
|
||||||
|
msgid "Custom Contexts"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: customcontexts.i18n.php:12
|
||||||
|
msgid "Custom Contexts Admin"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:552
|
||||||
|
msgid "Duplicate Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:386 functions.inc.php:549
|
||||||
|
msgid "Edit Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:32
|
||||||
|
msgid "Edit Extension"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:34
|
||||||
|
msgid "Edit User"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: functions.inc.php:388
|
||||||
|
msgid "Remove Context"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:33
|
||||||
|
msgid "Time Conditions Module required and not present .. aborting install"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: views/extensions_hook.php:38
|
||||||
|
#, php-format
|
||||||
|
msgid ""
|
||||||
|
"You can select a custom context from this list to limit this user to "
|
||||||
|
"portions of the dialplan you defined in the %s module."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:141 install.php:149
|
||||||
|
msgid "done"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:135
|
||||||
|
msgid "migrating customcontexts_timegroups if needed.."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: install.php:142
|
||||||
|
msgid ""
|
||||||
|
"removing customcontexts_timegroups and customcontexts_tiemgroups_detail "
|
||||||
|
"tables.."
|
||||||
|
msgstr ""
|
||||||
|
|
@ -0,0 +1,170 @@
|
||||||
|
<?php /* $Id: install.php $ */
|
||||||
|
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
global $db;
|
||||||
|
global $amp_conf;
|
||||||
|
|
||||||
|
if (! function_exists("out")) {
|
||||||
|
function out($text) {
|
||||||
|
echo $text."<br />";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists("outn")) {
|
||||||
|
function outn($text) {
|
||||||
|
echo $text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: returning false will fail the install with #4345 checked in
|
||||||
|
//
|
||||||
|
if (!function_exists('timeconditions_timegroups_add_group_timestrings')) {
|
||||||
|
out(_('Time Conditions Module required and not present .. aborting install'));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql[] ="CREATE TABLE `customcontexts_contexts` (
|
||||||
|
`context` varchar(100) NOT NULL DEFAULT '',
|
||||||
|
`description` varchar(100) NOT NULL DEFAULT '',
|
||||||
|
`dialrules` varchar(1000) DEFAULT NULL,
|
||||||
|
`faildestination` varchar(250) DEFAULT NULL,
|
||||||
|
`featurefaildestination` varchar(250) DEFAULT NULL,
|
||||||
|
`failpin` varchar(100) DEFAULT NULL,
|
||||||
|
`failpincdr` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
`featurefailpin` varchar(100) DEFAULT NULL,
|
||||||
|
`featurefailpincdr` tinyint(1) NOT NULL DEFAULT '0'
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;";
|
||||||
|
|
||||||
|
|
||||||
|
$sql[] ="CREATE TABLE `customcontexts_contexts_list` (
|
||||||
|
`context` varchar(100) NOT NULL DEFAULT '',
|
||||||
|
`description` varchar(100) NOT NULL DEFAULT '',
|
||||||
|
`locked` tinyint(1) NOT NULL DEFAULT '0'
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;";
|
||||||
|
|
||||||
|
$sql[] ="INSERT INTO `customcontexts_contexts_list` (`context`, `description`, `locked`) VALUES
|
||||||
|
('from-internal', 'Default Internal Context', 1),
|
||||||
|
('from-internal-additional', 'Internal Dialplan', 0),
|
||||||
|
('outbound-allroutes', 'Outbound Routes', 0);";
|
||||||
|
|
||||||
|
$sql[] ="CREATE TABLE `customcontexts_includes` (
|
||||||
|
`context` varchar(100) NOT NULL DEFAULT '',
|
||||||
|
`include` varchar(100) NOT NULL DEFAULT '',
|
||||||
|
`timegroupid` int DEFAULT NULL,
|
||||||
|
`sort` int NOT NULL DEFAULT '0',
|
||||||
|
`missing` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
`userules` varchar(10) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;";
|
||||||
|
|
||||||
|
// $sql[] ="ALTER IGNORE TABLE `customcontexts_includes` ADD `timegroupid` INT NULL AFTER `include`";
|
||||||
|
|
||||||
|
$sql[] ="CREATE TABLE `customcontexts_includes_list` (
|
||||||
|
`context` varchar(100) NOT NULL DEFAULT '',
|
||||||
|
`include` varchar(100) NOT NULL DEFAULT '',
|
||||||
|
`description` varchar(100) NOT NULL DEFAULT '',
|
||||||
|
`sort` int NOT NULL DEFAULT '0'
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;";
|
||||||
|
|
||||||
|
// $sql[] ="ALTER IGNORE TABLE `customcontexts_includes_list` ADD `missing` BOOL NOT NULL DEFAULT '0'";
|
||||||
|
|
||||||
|
|
||||||
|
$sql[] ="INSERT INTO `customcontexts_includes_list` (`context`, `include`, `description`, `sort`) VALUES
|
||||||
|
('from-internal', 'from-internal-additional', 'ENTIRE Basic Internal Dialplan', 0),
|
||||||
|
('from-internal', 'from-internal-custom', 'Custom Internal Dialplan', 0),
|
||||||
|
('from-internal', 'parkedcalls', 'Call Parking', 0),
|
||||||
|
('from-internal-additional', 'outbound-allroutes', 'ALL OUTBOUND ROUTES', 0);";
|
||||||
|
|
||||||
|
// $sql[] ="UPDATE `customcontexts_includes_list` SET `description` = 'ALL OUTBOUND ROUTES' WHERE `context` = 'from-internal-additional' AND `include` = 'outbound-allroutes'";
|
||||||
|
|
||||||
|
$sql[] ="CREATE TABLE `customcontexts_module` (
|
||||||
|
`id` varchar(50) NOT NULL DEFAULT '',
|
||||||
|
`value` varchar(100) NOT NULL DEFAULT ''
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;";
|
||||||
|
|
||||||
|
$sql[] ="INSERT INTO `customcontexts_module` (`id`, `value`) VALUES
|
||||||
|
('displaysortforincludes', '1'),
|
||||||
|
('moduledisplayname', 'Custom Contexts'),
|
||||||
|
('modulerawname', 'customcontexts'),
|
||||||
|
('moduleversion', '0.3.2');";
|
||||||
|
|
||||||
|
$sql[] ="ALTER TABLE `customcontexts_contexts`
|
||||||
|
ADD PRIMARY KEY (`context`),
|
||||||
|
ADD UNIQUE KEY `description` (`description`);";
|
||||||
|
|
||||||
|
$sql[] ="ALTER TABLE `customcontexts_contexts_list`
|
||||||
|
ADD PRIMARY KEY (`context`),
|
||||||
|
ADD UNIQUE KEY `description` (`description`);";
|
||||||
|
|
||||||
|
$sql[] ="ALTER TABLE `customcontexts_includes`
|
||||||
|
ADD PRIMARY KEY (`context`,`include`),
|
||||||
|
ADD KEY `sort` (`sort`);";
|
||||||
|
|
||||||
|
$sql[] ="ALTER TABLE `customcontexts_includes_list`
|
||||||
|
ADD PRIMARY KEY (`context`,`include`);";
|
||||||
|
|
||||||
|
$sql[] ="ALTER TABLE `customcontexts_module`
|
||||||
|
ADD PRIMARY KEY (`id`);
|
||||||
|
COMMIT;";
|
||||||
|
|
||||||
|
// $sql[] ="UPDATE `customcontexts_module` set `value` = '0.3.2' where `id` = 'moduleversion';";
|
||||||
|
|
||||||
|
foreach ($sql as $q){
|
||||||
|
$db->query($q);
|
||||||
|
if(DB::IsError($q)) {
|
||||||
|
out("FATAL: ".$q->getDebugInfo()."\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
customcontexts_updatedb();
|
||||||
|
|
||||||
|
//bring db up to date on install/upgrade
|
||||||
|
function customcontexts_updatedb() {
|
||||||
|
global $db;
|
||||||
|
$sql = "ALTER IGNORE TABLE `customcontexts_includes` ADD `timegroupid` INT NULL AFTER `include` ;";
|
||||||
|
$db->query($sql);
|
||||||
|
$sql = "ALTER IGNORE TABLE `customcontexts_includes_list` ADD `missing` BOOL NOT NULL DEFAULT '0';";
|
||||||
|
$db->query($sql);
|
||||||
|
$sql = "ALTER IGNORE TABLE `customcontexts_contexts` ADD `dialrules` VARCHAR( 1000 ) NULL;";
|
||||||
|
$db->query($sql);
|
||||||
|
$sql = "ALTER IGNORE TABLE `customcontexts_includes` ADD `userules` VARCHAR( 10 ) NULL ;";
|
||||||
|
$db->query($sql);
|
||||||
|
$sql = "ALTER IGNORE TABLE `customcontexts_contexts` ADD `faildestination` VARCHAR( 250 ) NULL , ADD `featurefaildestination` VARCHAR( 250 ) NULL ;";
|
||||||
|
$db->query($sql);
|
||||||
|
//0.3.0
|
||||||
|
$sql = "ALTER IGNORE TABLE `customcontexts_contexts` ADD `failpin` VARCHAR( 100 ) NULL , ADD `failpincdr` BOOL NOT NULL DEFAULT '0', ADD `featurefailpin` VARCHAR( 100 ) NULL , ADD `featurefailpincdr` BOOL NOT NULL DEFAULT '0';";
|
||||||
|
$db->query($sql);
|
||||||
|
//0.3.2
|
||||||
|
$sql = "ALTER IGNORE TABLE `customcontexts_includes_list` ADD `sort` INT NOT NULL DEFAULT '0';";
|
||||||
|
$db->query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
$tgs = $db->getAll('SELECT * FROM customcontexts_timegroups',DB_FETCHMODE_ASSOC);
|
||||||
|
if(!DB::IsError($tgs)) {
|
||||||
|
outn(_("migrating customcontexts_timegroups if needed.."));
|
||||||
|
foreach ($tgs as $tg) {
|
||||||
|
$tg_strings = sql('SELECT time FROM customcontexts_timegroups_detail WHERE timegroupid = '.$tg['id'].' ORDER BY id','getCol','time');
|
||||||
|
$tg_id = timeconditions_timegroups_add_group_timestrings($tg['description'],$tg_strings);
|
||||||
|
sql("UPDATE customcontexts_includes set timegroupid = $tg_id WHERE timegroupid = {$tg['id']}");
|
||||||
|
}
|
||||||
|
out(_("done"));
|
||||||
|
outn(_("removing customcontexts_timegroups and customcontexts_tiemgroups_detail tables.."));
|
||||||
|
unset($sql);
|
||||||
|
$sql[] = "DROP TABLE IF EXISTS `customcontexts_timegroups`";
|
||||||
|
$sql[] = "DROP TABLE IF EXISTS `customcontexts_timegroups_detail`";
|
||||||
|
foreach ($sql as $q){
|
||||||
|
$db->query($q);
|
||||||
|
}
|
||||||
|
out(_("done"));
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
-----BEGIN PGP SIGNED MESSAGE-----
|
||||||
|
Hash: SHA1
|
||||||
|
|
||||||
|
;################################################
|
||||||
|
;# FreePBX Module Signature File #
|
||||||
|
;################################################
|
||||||
|
;# Do not alter the contents of this file! If #
|
||||||
|
;# this file is tampered with, the module will #
|
||||||
|
;# fail validation and be marked as invalid! #
|
||||||
|
;################################################
|
||||||
|
|
||||||
|
[config]
|
||||||
|
version=1
|
||||||
|
hash=sha256
|
||||||
|
signedwith=B53D215A755231A3
|
||||||
|
signedby='FreePBX Mirror Servers <security@freepbx.org>'
|
||||||
|
repo=unsupported
|
||||||
|
timestamp=1592972254.8089
|
||||||
|
[hashes]
|
||||||
|
LICENSE = 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643
|
||||||
|
README.md = ee87de1997a103bb5c9c99451bdfd214d5382df96a95815081158add14602809
|
||||||
|
functions.inc.php = 8a530f2f03f99d145e9988e7fe6a02be20f681e1c1ec373848e893eabd02dd35
|
||||||
|
install.php = ada8153ff31e2354f6bc9e607efb54979e68e2012c515e9fdeb6290f73437b73
|
||||||
|
module.xml = 590650f51cc5cd90ebc8a13e72989f6b738ff6c43db74e83b5ca19150b4c1cc8
|
||||||
|
page.customcontexts.php = 5acabcbe7fbe35174f58742c5e5eabb7e43271029738e0bb4d1f3fb55b849e96
|
||||||
|
page.customcontextsadmin.php = b54cf5d75a2b4df1dd3f301303763a9ac9036dccf9e1c461d3d87c59bed22afb
|
||||||
|
uninstall.php = ad22a52f158c971536c47f11e178697001cfddfe17925f909bdd7bae529348c5
|
||||||
|
views/extensions_hook.php = 7c4b8214d40cd496bdf55648269c2b5ddf2ac4fe4e51a6e428cd7c9440ba6e86
|
||||||
|
;# End
|
||||||
|
-----BEGIN PGP SIGNATURE-----
|
||||||
|
Version: GnuPG v2.0.22 (GNU/Linux)
|
||||||
|
|
||||||
|
iQIcBAEBAgAGBQJe8tPeAAoJELU9IVp1UjGjgzoQAM9MRkapFpAbQlvVoFJT2hE7
|
||||||
|
Cex82fPOyXZvgfiNHP0jRviLk0XR8VcVPRhVH7U4X4QQlJ12BE/CrT2FrfDSvYDg
|
||||||
|
HQ7nxN5SgwdeMNUSqTFZpxNO28WprOwPjBMVaEo5sgnHS5V3DHLt7bl8n4LgdTdc
|
||||||
|
3Vb+1wH5PkWziQ9udw8c9OArB8hMUrW+zwJFYBJfUjNY05/jZV6auhsktOLHzwWm
|
||||||
|
xhFGXijRxrdgesgkEP7t+Mo8JoToIJwXbHJNVfGkuT6P/nM+UHTuJIGom0Vuln//
|
||||||
|
Jes0O8Hs9oEiONVpCbhEeW0xXClmtd9PI1uhqPimA8b8/k7+XiOSwozHG0cbFkua
|
||||||
|
OYecc4VcbKABr0sbTs4cGN+O1lUQaOmpFUClq8s8Lanqh2M5mxNU7+2xq/j0yfrs
|
||||||
|
ACoPJ3Jpk1P1cz7cV2SqHljcrG1z3WuRJMWFnKS4I+WyBJeAztDhUu3TYu5QXpXH
|
||||||
|
qDxLvuGFaMTZx33LnjShZsNbo58f8QFAEWxVEcI/tpQZkohHQj1fyqQNsxVjwkAG
|
||||||
|
p6DyAazxw5ihyDv74xHHbdF8Rc5G58NddrAjCrtF0cxgaFFgYd0cU1gRr+HdOj8N
|
||||||
|
1Zxw7J/wdKdsEEBdwBpw9+nWup16eBBBBJ2ciMea2z9Fh8PIIp5bEpFMcoEenNx5
|
||||||
|
MsfK46EC2mIhw7dx3BmJ
|
||||||
|
=sU84
|
||||||
|
-----END PGP SIGNATURE-----
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
<module>
|
||||||
|
<rawname>customcontexts</rawname>
|
||||||
|
<repo>unsupported</repo>
|
||||||
|
<name>Custom Contexts</name>
|
||||||
|
<version>16.0.0.1</version>
|
||||||
|
<category>Connectivity</category>
|
||||||
|
<license>GPLv2+</license>
|
||||||
|
<licenselink>http://www.gnu.org/licenses/gpl-2.0.txt</licenselink>
|
||||||
|
<description>
|
||||||
|
Creates custom contexts which can be used to allow limited access to dialplan applications. Allows for time restrictions on any dialplan access. Allows for pattern matching to allow/deny. Allows for failover destinations, and PIN protected failover. This can be very useful for multi-tennant systems. Inbound routing can be done using DID or zap channel routing, this module allows for selective outbound routing. House/public phones can be placed in a restricted context allowing them only internal calls.
|
||||||
|
</description>
|
||||||
|
<menuitems>
|
||||||
|
<customcontexts>Custom Contexts</customcontexts>
|
||||||
|
<customcontextsadmin>Custom Contexts Admin</customcontextsadmin>
|
||||||
|
</menuitems>
|
||||||
|
<depends>
|
||||||
|
<version>16.0</version>
|
||||||
|
<module>core</module>
|
||||||
|
<module>timeconditions</module>
|
||||||
|
</depends>
|
||||||
|
<changelog>
|
||||||
|
*16.0.0.1* Supported FreePBX 16, PHP 7.4.X, MySQL 8.0.X
|
||||||
|
*13.0.3.2* Fix FREEPBX-21593
|
||||||
|
*13.0.3.1* FREEPBX-17779
|
||||||
|
*13.0.3* FREEPBX-14687 move custom contexts into Advanced Tab and hide old context
|
||||||
|
*13.0.2* FREEPBX-10723 Array validation
|
||||||
|
*13.0.1* FREEPBX-10448 html updates, FREEPBX-10723 array validation
|
||||||
|
*2.11.0.2* Clarify GPLv2 Licence.
|
||||||
|
*2.11.0.1* Fix module.xml
|
||||||
|
*2.11.0.0* bump version
|
||||||
|
*2.10.0.1* #5478
|
||||||
|
*2.10.0.0* new version changes
|
||||||
|
*2.9.0.0* #4986, 2.9 bump
|
||||||
|
</changelog>
|
||||||
|
<attention>
|
||||||
|
This is an non official repo dev advanced module for FreePBX 16 without any support! You should not use it without understanding asterisk dialplans! This is meant as a convenience tool for someone who would have had to resort to config editing. If you experience problems with it, just disable it and no harm done. REMEMBER! Any device placed in a restricted context will have no access to the dialplan if this module is disabled until it is placed in a normal context!
|
||||||
|
</attention>
|
||||||
|
<supported>
|
||||||
|
<version>16.0</version>
|
||||||
|
</supported>
|
||||||
|
</module>
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php /* $Id: page.customcontexts.php $ */
|
||||||
|
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
|
||||||
|
//
|
||||||
|
//This program is free software; you can redistribute it and/or
|
||||||
|
//modify it under the terms of the GNU General Public License
|
||||||
|
//as published by the Free Software Foundation; either version 2
|
||||||
|
//of the License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
//This program is distributed in the hope that it will be useful,
|
||||||
|
//but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
//GNU General Public License for more details.
|
||||||
|
|
||||||
|
$dispnum = 'customcontexts'; //used for switch on config.php
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="rnav">
|
||||||
|
<?php
|
||||||
|
$contexts = customcontexts_getcontexts();
|
||||||
|
drawListMenu($contexts, $skip, $type, $display, $extdisplay, _("Context"));
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?php /* $Id: page.customcontextsadmin.php $ */
|
||||||
|
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
|
||||||
|
//
|
||||||
|
//This program is free software; you can redistribute it and/or
|
||||||
|
//modify it under the terms of the GNU General Public License
|
||||||
|
//as published by the Free Software Foundation; either version 2
|
||||||
|
//of the License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
//This program is distributed in the hope that it will be useful,
|
||||||
|
//but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
//GNU General Public License for more details.
|
||||||
|
|
||||||
|
$dispnum = 'customcontextsadmin'; //used for switch on config.php
|
||||||
|
|
||||||
|
//isset($_REQUEST['action'])?$action = $_REQUEST['action']:$action='';
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="rnav">
|
||||||
|
<?php
|
||||||
|
$contexts = customcontexts_getcontextslist();
|
||||||
|
drawListMenu($contexts, $skip, $type, $display, $extdisplay, _("Context"));
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?php /* $Id: uninstall.php $ */
|
||||||
|
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
|
||||||
|
//
|
||||||
|
//This program is free software; you can redistribute it and/or
|
||||||
|
//modify it under the terms of the GNU General Public License
|
||||||
|
//as published by the Free Software Foundation; either version 2
|
||||||
|
//of the License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
//This program is distributed in the hope that it will be useful,
|
||||||
|
//but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
//GNU General Public License for more details.
|
||||||
|
|
||||||
|
$sql[] = "DROP TABLE IF EXISTS `customcontexts_contexts`";
|
||||||
|
$sql[] = "DROP TABLE IF EXISTS `customcontexts_contexts_list`";
|
||||||
|
$sql[] = "DROP TABLE IF EXISTS `customcontexts_includes`";
|
||||||
|
$sql[] = "DROP TABLE IF EXISTS `customcontexts_includes_list`";
|
||||||
|
$sql[] = "DROP TABLE IF EXISTS `customcontexts_module`";
|
||||||
|
$sql[] = "DROP TABLE IF EXISTS `customcontexts_timegroups`";
|
||||||
|
$sql[] = "DROP TABLE IF EXISTS `customcontexts_timegroups_detail`";
|
||||||
|
foreach ($sql as $q){
|
||||||
|
$db->query($q);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<font color="red"><strong>You have uninstalled the Custom Contexts Module!<BR>
|
||||||
|
Remember to place all of your devices into local contexts or they will not have dialplan access!</strong></font><BR>
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
<?php
|
||||||
|
global $currentcomponent;
|
||||||
|
$device_info = core_devices_get($_REQUEST['extdisplay']);
|
||||||
|
if (empty($device_info)) {
|
||||||
|
$cc = 'from-internal';
|
||||||
|
} else {
|
||||||
|
$tech = $device_info['tech'];
|
||||||
|
switch ($tech) {
|
||||||
|
case 'pjsip':
|
||||||
|
case 'iax2':
|
||||||
|
case 'iax':
|
||||||
|
case 'sip':
|
||||||
|
case 'dahdi':
|
||||||
|
case 'zap':
|
||||||
|
$_REQUEST['tech'] = $tech;
|
||||||
|
$cc = $device_info['context'];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$cc = 'from-internal';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$contextssel = customcontexts_getcontexts();
|
||||||
|
$currentcomponent->addoptlistitem('contextssel', 'from-internal', _('ALLOW ALL (Default)'));
|
||||||
|
$curcontext = !empty($cc)?$cc:'from-internal';
|
||||||
|
$contextssel = is_array($contextssel)?$contextssel:array();
|
||||||
|
foreach ($contextssel as $val) {
|
||||||
|
$currentcomponent->addoptlistitem('contextssel', $val[0], $val[1]);
|
||||||
|
}
|
||||||
|
$category = 'advanced';
|
||||||
|
|
||||||
|
if ( $_REQUEST['display'] == 'extensions' ) {
|
||||||
|
$section = (isset($_REQUEST['extdisplay']) ? modgettext::_("Edit Extension",'core') : modgettext::_("Add Extension",'core'));
|
||||||
|
} else {
|
||||||
|
$section = (isset($_REQUEST['extdisplay']) ? modgettext::_("Edit User",'core') : modgettext::_("Add User",'core'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$currentcomponent->setoptlistopts('contextssel', 'sort', false);
|
||||||
|
$currentcomponent->addguielem($section, new gui_selectbox('customcontext', $currentcomponent->getoptlist('contextssel'), $curcontext, _('Custom Context'), sprintf(_('You can select a custom context from this list to limit this user to portions of the dialplan you defined in the %s module.'),customcontexts_getmodulevalue('moduledisplayname')),false), 4, null, $category);
|
||||||
|
$js = '<script type="text/javascript" id="customcontext_js">$(document).ready(function() {$("#devinfo_context").parents(".element-container").remove();$("#customcontext").attr("name","devinfo_context");$("#customcontext_js").parents(".element-container").remove();});</script>';
|
||||||
|
$currentcomponent->addguielem($section, new guielement('test-html', $js, ''),4, null, $category);
|
||||||
Loading…
Reference in New Issue