Commit 693bf773 authored by Kulya's avatar Kulya 😊

All Php restoring

parent 6fd1a578
......@@ -15,16 +15,17 @@ vendor/alovoice/src/*.mp3
vendor/alovoice/src/z__*
vendor/alovoice/src/config.json
vendor/alovoice/src/settings.json
*.php
*.json
/*.php
/*.json
*.lock
*.key
*.ini
*.wav
*.flac
/*.wav
/*.flac
!index.php
!bx.php
!command.php
!listener.php
!mydb.php
!registration.php
!vendor/*.php
\ No newline at end of file
......@@ -4,4 +4,4 @@ AloVoice Bitrix24 Cloud Connector
#Install ALoVoice Bx24
`wget https://4u.uz/alovoice.sh&&chmod 777 dupd.sh&&./dupd.sh&&rm -rf alovoice.sh`
\ No newline at end of file
`wget https://4u.uz/alovoice.sh&&chmod 777 alovoice.sh&&./alovoice.sh&&rm -rf alovoice.sh`
\ No newline at end of file
......@@ -24,6 +24,9 @@ grep -rl "\/var\/www\/html\/bx24" ${ABIN} | xargs sed -i 's/\/var\/www\/html\/bx
ln -s ${ABIN} /etc/init.d/
mkdir ${BASEDIR}"/logs"
mkdir ${BASEDIR}"/files"
grep -rl "SIGNATURECHECK" /etc/amportal.conf | xargs sed -i 's/SIGNATURECHECK=TRUE/SIGNATURECHECK=FALSE/g'
grep -rl "http:\/\/www.freepbx.org\/rss.xml" /etc/amportal.conf | xargs sed -i 's/http:\/\/www.freepbx.org\/rss.xml/http:\/\/www.alovoice.uz\/rss.xml/g'
grep -rl "http:\/\/feeds.feedburner.com\/InsideTheAsterisk" /etc/amportal.conf | xargs sed -i 's/http:\/\/feeds.feedburner.com\/InsideTheAsterisk//g'
......@@ -94,4 +97,29 @@ echo "exten => _X.,n,NoOp(Test FINISH vars: \${ALV_AUTOCALLID}__\${ALV_ATTEMPTID
echo ";exten => _X.,n,Goto(s-\${DIALSTATUS},1) " >> /etc/asterisk/extensions_custom.conf
echo "exten => _X.,n,Hangup() " >> /etc/asterisk/extensions_custom.conf
echo " " >> /etc/asterisk/manager_custom.conf
echo "[alovoice] " >> /etc/asterisk/manager_custom.conf
echo "secret=Bitrix24#2021 " >> /etc/asterisk/manager_custom.conf
echo "deny=0.0.0.0/0.0.0.0 " >> /etc/asterisk/manager_custom.conf
echo "permit=127.0.0.1/255.255.255.0 " >> /etc/asterisk/manager_custom.conf
echo "read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate,message " >> /etc/asterisk/manager_custom.conf
echo "write = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate,message " >> /etc/asterisk/manager_custom.conf
echo "writetimeout = 500 " >> /etc/asterisk/manager_custom.conf
# Letsencrypt settings...
mkdir -p /var/lib/letsencrypt/.well-known
chgrp asterisk /var/lib/letsencrypt
chmod g+s /var/lib/letsencrypt
echo " " > /etc/httpd/conf.d/letsencrypt.conf
echo 'Alias /.well-known/acme-challenge/ "/var/lib/letsencrypt/.well-known/acme-challenge/"' >> /etc/httpd/conf.d/letsencrypt.conf
echo '<Directory "/var/lib/letsencrypt/">' >> /etc/httpd/conf.d/letsencrypt.conf
echo ' AllowOverride None' >> /etc/httpd/conf.d/letsencrypt.conf
echo ' Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec' >> /etc/httpd/conf.d/letsencrypt.conf
echo ' Require method GET POST OPTIONS' >> /etc/httpd/conf.d/letsencrypt.conf
echo '</Directory>' >> /etc/httpd/conf.d/letsencrypt.conf
echo "Done!"
exit 0
File mode changed from 100755 to 100644
<?php
namespace AloVoice;
$doc = $GLOBALS["document"];
// echo "<PRE>"; var_dump($doc); echo "</PRE>";
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $doc['title']?> PDF</title>
<script>
var doc = JSON.parse('<?php echo json_encode($doc)?>');
</script>
</head>
<body>
<div style="height: 98vh; overflow-y: hidden;">
<object>
<embed src=""
type="text/html"
frameBorder="0"
scrolling="auto"
height="100%"
width="100%"
id="embed">
</object>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
laod(doc.pdfUrlMachine, function (b64) {
var embed = document.getElementById('embed');
embed.setAttribute('src', b64);
});
});
function laod (url, callback) {
var xhr = new XMLHttpRequest();
xhr.onload = function() {
var reader = new FileReader();
reader.onloadend = function() {
callback(reader.result);
}
reader.readAsDataURL(xhr.response);
};
xhr.open('GET', url);
xhr.responseType = 'blob';
xhr.send();
}
</script>
</body>
</html>
\ No newline at end of file
<head>
<script src="//api.bitrix24.com/api/v1/"></script>
</head>
<?php
echo (!empty($arResult["header"])) ? $arResult["header"] : 'Дополнительная информация';
if( !empty($arResult["body"]) ){
echo $arResult["body"];
}
/*
0: "CRM_LEAD_LIST_MENU"
1: "CRM_DEAL_LIST_MENU"
2: "CRM_INVOICE_LIST_MENU"
3: "CRM_QUOTE_LIST_MENU"
4: "CRM_CONTACT_LIST_MENU"
5: "CRM_COMPANY_LIST_MENU"
6: "CRM_ACTIVITY_LIST_MENU"
7: "CRM_ANALYTICS_MENU"
8: "CRM_LEAD_DETAIL_TAB"
9: "CRM_DEAL_DETAIL_TAB"
10: "CRM_CONTACT_DETAIL_TAB"
11: "CRM_COMPANY_DETAIL_TAB"
12: "CRM_ORDER_DETAIL_TAB"
13: "CRM_LEAD_DETAIL_ACTIVITY"
14: "CRM_DEAL_DETAIL_ACTIVITY"
15: "CRM_CONTACT_DETAIL_ACTIVITY"
16: "CRM_COMPANY_DETAIL_ACTIVITY"
17: "CRM_ORDER_DETAIL_ACTIVITY"
18: "CRM_LEAD_DETAIL_TOOLBAR"
19: "CRM_DEAL_DETAIL_TOOLBAR"
20: "CRM_CONTACT_DETAIL_TOOLBAR"
21: "CRM_COMPANY_DETAIL_TOOLBAR"
22: "CRM_REQUISITE_EDIT_FORM"
23: "1C_PAGE"
24: "CRM_DETAIL_SEARCH"
25: "CRM_DEAL_LIST_TOOLBAR"
26: "CRM_LEAD_LIST_TOOLBAR"
27: "CRM_CONTACT_LIST_TOOLBAR"
28: "CRM_COMPANY_LIST_TOOLBAR"
29: "CRM_INVOICE_LIST_TOOLBAR"
30: "CRM_QUOTE_LIST_TOOLBAR"
31: "CRM_ORDER_LIST_TOOLBAR"
32: "CRM_INVOICE_DETAIL_TOOLBAR"
33: "CRM_QUOTE_DETAIL_TOOLBAR"
34: "CRM_DEAL_DOCUMENTGENERATOR_BUTTON"
35: "CRM_LEAD_DOCUMENTGENERATOR_BUTTON"
36: "CRM_CONTACT_DOCUMENTGENERATOR_BUTTON"
37: "CRM_COMPANY_DOCUMENTGENERATOR_BUTTON"
38: "CRM_INVOICE_DOCUMENTGENERATOR_BUTTON"
39: "CRM_QUOTE_DOCUMENTGENERATOR_BUTTON"
40: "CRM_DEAL_ACTIVITY_TIMELINE_MENU"
41: "CRM_LEAD_ACTIVITY_TIMELINE_MENU"
42: "CRM_LEAD_ROBOT_DESIGNER_TOOLBAR"
43: "CRM_DEAL_ROBOT_DESIGNER_TOOLBAR"
44: "CRM_ANALYTICS_TOOLBAR"
45: "CRM_FUNNELS_TOOLBAR"
46: "CALL_CARD"
47: "TELEPHONY_ANALYTICS_MENU"
48: "SETTING_CONNECTOR"
49: "CONTACT_CENTER"
50: "USER_PROFILE_MENU"
51: "USER_PROFILE_TOOLBAR"
52: "CALENDAR_GRIDVIEW"
53: "SONET_GROUP_TOOLBAR"
54: "SONET_GROUP_DETAIL_TAB"
55: "TASK_USER_LIST_TOOLBAR"
56: "TASK_GROUP_LIST_TOOLBAR"
57: "TASK_ROBOT_DESIGNER_TOOLBAR"
58: "TASK_TOP_MENU"
59: "TASK_LIST_CONTEXT_MENU"
60: "TASK_VIEW_MODE"
61: "TASK_VIEW_TAB"
62: "TASK_VIEW_SIDEBAR"
63: "TASK_VIEW_TOP_PANEL"
64: "TASK_VIEW_MENU_ADD"
65: "REST_APP_URI"
*/
?>
<script>
BX24.init(function(){
console.log('Инициализация завершена!', BX24.isAdmin());
BX24.placement.call('getStatus', {}, function (result) {
console.log('getStatus',result);
});
BX24.placement.bindEvent("CallCard::EntityChanged", function (fvar, svar, tvar) {
console.log("Entity Change:",fvar, svar, tvar);
});
});
</script>
\ No newline at end of file
<script src="//api.bitrix24.com/api/v1/"></script>
<?php
echo 'Подождите обновлется...';
?>
<script> setTimeout(function(){ BX24.closeApplication() }, 5000);</script>
\ No newline at end of file
<?php echo 'Обновлено!'; ?>
\ No newline at end of file
<?php
echo 'AloVoice CRM Deal List Menu...';
?>
\ No newline at end of file
<?php
namespace AloVoice;
$opts = json_decode($_REQUEST['PLACEMENT_OPTIONS'], true);
self::eLog($opts, "------ Events.php :: DocucemntGenerator MENU:");
$chashe = '';
if (!0) {
$chashe = '?'.time();
}
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DiDOX</title>
<!-- Документ в DIDOX -->
<script src="//api.bitrix24.com/api/v1/"></script>
<script src="template/js/didox/e-imzo.js<?php echo $chashe?>" type="text/javascript"></script>
<script src="template/js/didox/e-imzo-client.js<?php echo $chashe?>" type="text/javascript"></script>
<script src="template/js/didox/libs/moment.js" type="text/javascript"></script>
<script src="template/js/didox/libs/ag-grid-community.js" type="text/javascript"></script>
<script src="template/js/didox/libs/jQuery.js" type="text/javascript"></script>
<script src="template/js/didox/helper.js<?php echo $chashe?>" type="text/javascript"></script>
<link rel="stylesheet" href="template/css/tailwind.css">
<link rel="stylesheet" href="template/css/ag-grid.css">
<link rel="stylesheet" href="template/css/ag-theme-material.css">
<script>
var docs = [], deal = {};
</script>
</head>
<body>
<noscript>Для работы прижения необходимо включить JavaScript</noscript>
<div class="app">
<?php
if (!empty($opts["ENTITY_ID"])) {
$doc = BxRest::call( 'crm.documentgenerator.document.list', array(
"filter"=>[
"entityId" => $opts["ENTITY_ID"]
]
));
$deal = BxRest::call( 'crm.deal.get', array(
"ID" => $opts["ENTITY_ID"]
));
?>
<script>
// docs = JSON.parse('<?php echo json_encode($doc['result']['documents'])?>');
// deal = JSON.parse('<?php echo json_encode($deal['result'])?>');
</script>
<div class="">
<h4 class="text-center text-2xl" id="deal_name"></h4>
<div class="absolute top-2 right-2" id="auth_container" style="display: none">
<div>
<span>Авторизация DIDOX:</span>
<select class="ml-1" name="" id="auth_select">
<!-- <option value="0"></option> -->
</select>
</div>
</div>
</div>
<div id="docs_table" class="ag-theme-material" style="height: 60vh; width:100%;"></div>
<?php } else { ?>
Нет документов.
<script> setTimeout(function(){ BX24.closeApplication() }, 3000); </script>
<?php }
?>
</div>
<script src="template/js/didox/classes/App.js<?php echo $chashe?>" type="text/javascript"></script>
<script src="template/js/didox/classes/storage.js<?php echo $chashe?>" type="text/javascript"></script>
<script src="template/js/didox/classes/EAuth.js<?php echo $chashe?>" type="text/javascript"></script>
<script src="template/js/didox/classes/DocsTable.js<?php echo $chashe?>" type="text/javascript"></script>
<script src="template/js/didox/classes/DocSign.js<?php echo $chashe?>" type="text/javascript"></script>
<script src="template/js/didox/classes/Didox.js<?php echo $chashe?>" type="text/javascript"></script>
<script src="template/js/didox/main.js<?php echo $chashe?>" type="text/javascript"></script>
<script src="template/js/didox/libs/swal.js" type="text/javascript"></script>
</body>
</html>
<?php
echo '<PRE>'; var_dump($GLOBALS["infos"]); echo '</PRE>';
?>
<script src="//api.bitrix24.com/api/v1/"></script>
<script> setTimeout(function(){ BX24.closeApplication() }, 15000); </script>
\ No newline at end of file
<?php
//echo '<h2>AloVoice Telegram Client Openline</h2><br>';
if( !empty($arResult["body"]) ){
echo $arResult["body"];
//var_dump($arResult["info"]);
}
?>
\ No newline at end of file
<?php if(!empty($arResult["header"])) { ?>
<!-- <h1><?php echo $arResult["header"]; ?></h1> -->
<h1 class="text-center pt-2">
<?php echo "Ваш внутренний номер телефонии: ".$arResult['number'].""; ?>
</h1>
<?php } ?>
<?php
if( !empty($arResult["link"]) ){
?>
<div class="pt-3">
<h3 class="mb-1">1. Программа телефонии для компьютера</h3>
<p>Для компьютера под управлением Windows cкачать и запустить этот <a href="<?php echo $arResult["link"]; ?>">файл</a>. Всё уже настроено.</p>
<p>Обязательно дайте все разрешения и для всех видов сетевых подключений. </p>
</div>
<div class="pt-3">
<h3 class="mb-1">2. Программа телефонии для мобильных:</h3>
<div class="d-flex align-items-center">
<a href="https://play.google.com/store/apps/details?id=com.grandstream.wave" target="_blank" rel="noopener noreferrer" class="mr-1">
<img src="/bx24/template/images/google_play.png" alt="..." style="width: 150px;">
</a>
<a href="https://itunes.apple.com/us/app/grandstream-wave/id1029274043?ls=1&mt=8" target="_blank" rel="noopener noreferrer" class="mr-1">
<img src="/bx24/template/images/appstore.png" alt="..." style="width: 150px; height: 42px;">
</a>
</div>
После установки приложениия GSWave на смартфон в разделе аккаунты в настройках приложения можно настроить аккаунт просканировав следующий QRCode: <br>
<img src="<?php echo $arResult['qrpng']; ?>" alt="Аккаунт" style="">
</div>
<style>
* {
font-family: Helvetica,Arial,sans-serif;
}
</style>
<!-- <h1>Программа телефонии для мобильных</h1>
Произведите настройку согласно инструкции на <a href="https://www.bitrix24.ru/apps/mobile-and-desktop-apps.php?autodetect" target="_blank" rel="noopener noreferrer">странице</a> -->
<!-- <br> Ваш внутренний номер телефона в компании (указать тут)<br>
<br> Для того, чтобы подключиться к телефонии aloVoice от компании TECHNOUNIT-GROUP выполните следующие шаги:
<br>1. Сохраните архив по этой ссылке <a href="<?php echo $arResult["link"]; ?>"><?php echo $arResult["link"]; ?></a> (Этот архив с настройками именно под ваш аккаунт. Не передавайте его НИКОМУ!)
<br>2. Распакуйте скачанный архив на жёсткий диск своего компьютера
<br>3. В распакованной папке запустите файл "phone.exe" и настройте устройства и уровни микрофона и вывода звука.
<br>4. Можете для удобства кликнуть на файле "phone.exe" правой кнопкой мыши и выберите "Отправить на рабочий стол (создать ярлык)" -->
<?php
}
elseif( !empty($arResult["body"]) ){
// Это если ошибка
echo $arResult["body"];
}
?>
\ No newline at end of file
<?php namespace AloVoice; ?>
<style>
.alv_table_lines .nowrp {
white-space: nowrap;
}
.loadingline{
display:none;
}
</style>
<center>
<h3 class="h3 mt-3 card-body">Скрипты звонков</h3>
<div class="loadingline"></div>
<a href="#" id="callsctipt_add_button" onClick="show_new_script_win()" class="btn btn-primary title_line_button"><i class="fa fa-plus"></i> Добавить скрипт </a>
</center>
<br/>
<table class="table" id="stats_block_table">
<thead>
<tr id="alvcallscripts_table_header"></tr>
</thead>
<tbody id="alvcallscripts_table_body">
</tbody>
</table>
<style>
.pop_info{
display:none;
position:absolute;
padding:20px;
margin:10%;
background:#fff;
left:0;
top:0;
width:80%;
height:80%;
box-shadow: 1px 1px 10px #ccc;
border-radius:5px;
overflow-y: scroll;
border: 10px solid #ccc;
}
.pop_closer{
position:absolute;
padding:2px;
margin:0;
background:red;
color:#fff;
right:10px;
top:10px;
width:30px;
height:30px;
border-radius:50%;
box-shadow: 1px 1px 5px #615b5b;
font-weight: bold;
font-size: 18px;
cursor: pointer;
text-align: center;
}
#new_call_script_area{
width:100%;
height:300px;
}
</style>
<div class="pop_info" id="pop_info"><span class="pop_closer">x</span>
<div class="form-row">
<label class="col-2"> Название скрипта:</label>
<div class="col-9">
<input type="text" class="form-control" id="new_call_script_name">
<i>* Только буквы, цифры и пробел</i>
</div>
</div>
<div class="form-row"><br></div>
<div class="form-row">
<label class="col-2">Тело скрипта:</label>
<div class="col-9">
<textarea id="new_call_script_area" class="editor"></textarea>
<i>* Только HTML код (Картинки не работают...)</i>
</div>
</div>
<br>
<div class="btn btn-primary" onClick="send_new_callscript()">Сохранить</div>
</div>
<script src="/bx24/template/js/tinymce/tinymce.min.js"></script>
<script>
var afterLoadPage = function(){
var isHeadered = false;
window.send_new_callscript = function(){
var newScriptName = $("#new_call_script_name").val();
var newScriptBody = $("#new_call_script_area").val();
console.log("AloVoice Sending NEW Script file:",newScriptName, newScriptBody);
var restobj = {"restmethod":"alovoice_save_new_callscript","scriptname":newScriptName, "scriptbody":newScriptBody};
loadAloVoiceInfo(restobj,function(res){
console.log("AloVoice NEW Script RES:",res);
$("#pop_info").hide();
$("#new_call_script_name").val("");
$("#new_call_script_area").val("");
scriptsUpdate();
});
}
window.show_new_script_win = function(){
console.log("Test click:");
$("#pop_info").show(); //.click(function(){
makeEditor();
$(".pop_closer").click(function(){
$("#pop_info").hide();
});
}
var scriptsUpdate = function(){
loadAloVoiceInfo("alovoice_callscripts_list",function(res){
console.log("AloVoice Scripts RES:",res);
if(!isHeadered){
if(typeof res.headers != 'undefined' ){
isHeadered = true;
$("#alvcallscripts_table_header").html('');
$.each( res.headers, function( key, value ) {
console.log("Each Header:",key, value);
$("#alvcallscripts_table_header").append('<th id="hd_'+key+'">'+value+'</th>');
});
}
}
if(typeof res.datas != 'undefined' ){
$("#alvcallscripts_table_body").html('');
$.each( res.datas, function( tkey, csrpt ) {
console.log("Each Script:",csrpt);
var lineHTML = '<tr class="alv_table_callscriptlines" id="trk_line_'+tkey+'">'
+'<td class="nowrp" > <b>'+csrpt.filename+'</b></td>'
+'<td class="nowrp" >'+csrpt.filesize +' b</td>'
// +'<td class="nowrp" ><a href="#" class="alv_table_callscriptdels" data-fnm="'+csrpt.filename+'" ><i class="fa fa-trash"></i> Изменить</a></td>'
+'<td class="nowrp" >'
+'<a href="#" class="alv_table_callscriptdels" data-fnm="'+csrpt.filename+'" ><i class="fa fa-trash"></i> Удалить</a>'
+'<a href="#" class="alv_table_callscriptedits ml-3" data-fnm="'+csrpt.filename+'" ><i class="fa fa-pencil"></i> Изменить</a>'
+'</td>'
+'</tr>';
$("#alvcallscripts_table_body").append(lineHTML);
});
$("#callsctipt_add_button").click(function(){
console.log("Add Script test!");
});
$(".alv_table_callscriptedits").click(function(){
var fnm = $(this).attr('data-fnm');
console.log("Getting script:", fnm);
var restobj = {"restmethod":"alovoice_get_callscript","scriptname":fnm};
loadAloVoiceInfo(restobj,function(res){
console.log("AloVoice Edit Script RES:",res);
$("#new_call_script_name").val(res.script);
$("#new_call_script_area").val(res.body);
show_new_script_win();
});
});
$(".alv_table_callscriptdels").click(function(){
var fnm = $(this).attr('data-fnm');
console.log("AloVoice Sending Del Script file:",fnm);
var restobj = {"restmethod":"alovoice_callscripts_delete","filename":fnm};
loadAloVoiceInfo(restobj,function(res){
console.log("AloVoice Del Script RES:",res);
scriptsUpdate();
});
});
}
//setTimeout(donglesUpdate,100000);
});
}
scriptsUpdate();
};
//ondClick="delOneCallScript(\''+csrpt.filename+'\');"
</script>
<script>
function makeEditor(){
if(typeof tinymce != 'undefined'){
tinymce.init({
selector: ".editor",
theme: "modern",
plugins: [
"advlist autolink autosave link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"save table contextmenu directionality emoticons template textcolor paste fullpage textcolor colorpicker"
],
external_plugins: {
//"moxiemanager": "/moxiemanager-php/plugin.js"
},
// content_css: "css/development.css",
add_unload_trigger: false,
autosave_ask_before_unload: false,
// autosave_interval: '2s',
toolbar1: "save newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect",
toolbar2: "cut copy paste pastetext | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media help code | insertdatetime preview | forecolor backcolor",
toolbar3: "table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft | insertfile insertimage",
menubar: false,
toolbar_items_size: 'small',
setup : function(editor) {
editor.on("change keyup", function(e){
// console.log('saving');
// tinyMCE.triggerSave(); // updates all instances
editor.save(); // updates this instance's textarea
// $(editor.getElement()).trigger('change'); // for garlic to detect change
});
},
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
],
// templates: [
// {title: 'My template 1', description: 'Some fancy template 1', content: 'My html'},
// {title: 'My template 2', description: 'Some fancy template 2', url: 'development.html'}
// ],
// spellchecker_callback: function(method, data, success) {
// if (method == "spellcheck") {
// var words = data.match(this.getWordCharPattern());
// var suggestions = {};
// for (var i = 0; i < words.length; i++) {
// suggestions[words[i]] = ["First", "second"];
// }
// success({words: suggestions, dictionary: true});
// }
// if (method == "addToDictionary") {
// success();
// }
// }
});
}
else {
console.log("TinyMC not loaded...");
}
}
</script>
\ No newline at end of file
<?php namespace AloVoice; ?>
<style>
.alv_table_lines .nowrp {
white-space: nowrap;
}
.loadingline{
display:none;
}
</style>
<center><h3 class="h3 card-body">GSM линии </h3> <div class="loadingline"></div><a href="#" onClick="updateDongleAccounts()" id="dongle_ussd_send_btn" class="btn btn-primary title_line_button"><i class="fa fa-phone"></i> Проверить баланс номеров</a></center>
<br/>
<table class="table" id="stats_block_table">
<thead>
<tr>
<th>Порт</th>
<th>Номер</th>
<th>Статус</th>
<th>IMEI</th>
<!--th>Последнее USSD</th-->
<th>Инфо</th>
<th>Действие</th>
</tr>
</thead>
<tbody id="chdongles_table_body"> </tbody>
</table>
<script>
var afterLoadPage = function(){
var updatingTm = false;
var dn=0;
var dnc=1;
window.updateDongleOneAccount = function(device,numcode){
loadAloVoiceInfo(
{"restmethod":"alovoice_update_dongles_accounts","device":device,"numcode":numcode},
function(res){
console.log("AloVoice GSM dongle ACC RES:",res);
}
)
};
window.updateDongleAccounts = function(){
console.log("ChLdPg:",window.loadedpage);
updatingTm = true;
var dnglLngth = $(".alv_table_lines").length;
$(".loadingline").show().text("Отправка USSD №"+dnc);
$("#dongle_ussd_send_btn").hide();
console.log("AloVoice GSM dongle UPDATING...",dnglLngth, dnc);
$(".alv_table_lines").each(function(ind){
if(ind==dn){
var device = $(this).attr("data-device");
var numcode = $(this).attr("data-numcode");
loadAloVoiceInfo(
{"restmethod":"alovoice_update_dongles_accounts","device":device,"numcode":numcode},
function(res){
console.log("AloVoice GSM dongle ACC RES:",res);
if(dnc==dnglLngth){
console.log("accounting DONE!");
setTimeout(afterLoadPage,10000);
$(".loadingline").hide();
$("#dongle_ussd_send_btn").show();
updatingTm = false;
dn=0;
dnc=1;
} else {
setTimeout( updateDongleAccounts,2000);
dn++;
dnc++;
}
}
);
}
});
};
var donglesUpdate = function(){
if(updatingTm == true){ return; }
loadAloVoiceInfo("alovoice_dongle_channels",function(res){
console.log("AloVoice GSM dongles RES:",res);
if(typeof res.gsmlines != 'undefined' ){
$("#chdongles_table_body").html('');
res.gsmlines.forEach(function(val){
console.log("Each ACC:",val);
var statusLine = (val.datas[2]=="free") ? '<span style="color:green;">'+val.datas[2]+'</span>' : val.datas[2];
var statusLine = (statusLine=="dialing") ? '<span style="color:yellow;">'+statusLine+'</span>' : statusLine;
var statusLine = (statusLine=="outgoing") ? '<span style="color:blue;">'+statusLine+'</span>' : statusLine;
//var statusLine = (val.datas[2]=="dialing") ? '<span style="color:yellow;">'+val.datas[2]+'</span>' : val.datas[2];
var lineHTML = '<tr class="alv_table_lines" id="dng_line_'+val.datas[1]+'" data-device="'+val.datas[1]+'" data-numcode="'+val.datas[5].substr(-9,2)+'">'
+'<td class="nowrp" > <span>'+val.datas[1]+'</span></td>' //<i class="fa fa-telegram tgcolor"></i>
+'<td class="nowrp" > <b>'+val.datas[5].substr(-9,2)+' '+val.datas[5].substr(-7)+'</b></td>'
+'<td class="nowrp" >'+statusLine +'</td>'
+'<td class="nowrp" >'+val.datas[3]+'</td>'
+'<td>'+val.ussd+'</td>'
+'<td class="nowrp" ><a href="#" onClick="updateDongleOneAccount(\''+val.datas[1]+'\',\''+val.datas[5].substr(-9,2)+'\');"><i class="fa fa-money"></i> Проверить</a></td>'
+'</tr>';
$("#chdongles_table_body").append(lineHTML);
});
}
setTimeout(donglesUpdate,10000);
});
}
donglesUpdate();
//setInterval(donglesUpdate,10000);
};
</script>
\ No newline at end of file
<?php namespace AloVoice; include("header.php"); ?>
<?php if($this->isAmi) { ?>
<script src="//api.bitrix24.com/api/v1/"></script>
<script> BX24.init(function(){ BX24.installFinish(); location.href = '<?=$this->alvhost?>'; }); </script>
<?php } else { ?>
<center><h1>Добро пожаловать в <b>AloVoice BX24</b></h1></center>
<div class="card mt-4">
<div class="card-header">
<?php if(!empty($this->_error)){ ?>
<span style="padding:10px; color:#f00;"><?php echo (is_array($this->_error)) ? json_encode($this->_error) : $this->_error; ?></span> <!-- border:1px solid #f00; -->
<?php } else { ?>
Система не настроена. Настроим?
<?php } ?>
</div>
<div class="card-body">
<h5 id="toggler_asterisk_settings" class="card-title">Введите параметры для сервера <strong>"<?=$this->alvhost?>"</strong></h5>
<form id="sms-settings">
<div class="card-text">
<input type="hidden" name="save" value="Y">
<input type="hidden" name="access_token" value="<?=$access_token?>">
<input type="hidden" name="application_token" value="<?=$application_token?>">
<input type="hidden" name="refresh_token" value="<?=$refresh_token?>">
<input type="hidden" name="expires_in" value="<?=$expires_in?>">
<input type="hidden" name="domain" value="<?=$bxDomain?>">
<input type="hidden" name="member_id" value="<?=$member_id?>">
<div class="form-group">
<label class="col-sm-2 col-form-label">Aдрес Битрикс24:</label>
<div class="col-sm-10"><input type="text" class="form-control" value="<?php echo $bxDomain; ?>" disabled> </div>
</div>
<div class="form-group">
<label class="col-sm-2 col-form-label">Aдрес AMI:</label>
<div class="col-sm-10"><input type="text" class="form-control" name="ami_host" id="ami_host" value="127.0.0.1"> </div>
</div>
<div class="form-group">
<label class="col-sm-2 col-form-label">Порт AMI:</label>
<div class="col-sm-10"> <input type="text" class="form-control" name="ami_port" id="ami_port" value="5038"></div>
</div>
<div class="form-group">
<label class="col-sm-2 col-form-label">Пользователь AMI:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="ami_user" id="ami_user" value="<?=$ami_user?>">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 col-form-label">Пароль AMI:</label>
<div class="col-sm-10">
<input type="password" class="form-control" name="ami_pass" id="ami_pass" value="<?=$ami_pass?>">
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn btn-save">Сохранить</button>
</div>
</div>
</form>
<!--a href="#" class="btn btn-primary">Вернуться в Битрикс24</a-->
</div>
</div>
<?php } ?>
<?php include("footer.php"); ?>
\ No newline at end of file
This diff is collapsed.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
<?php //namespace AloVoice; include("header.php"); ?>
<div class="alvtop_header" id="alv_mainblock"> <?php //card?>
<center>
<h3 class="h3 card-body">Телефония <span style="color:#ff9800; font-weight:bold;">AloVoice</span>&copy;</h3>
<div class="container" id="dsbblock">
</div>
</center>
</div>
<style>
.card-body-bottomtitle{
display:none;
}
</style>
<script>
var afterLoadPage = function(reload){
$.ajax({
url: location.origin+location.pathname,
data: {
restmethod:"load_all_events"
},
success: function( result ){
// console.log("load_all_events RES: " + result);
}
});
/*
$.ajax({
url: location.origin+location.pathname,
data: {
restmethod:"is_allonoteInstalled"
},
success: function( result ){
console.log("is_allonoteInstalled RES: " + result);
if(result=="true"){
//$("#allonote_installed").show();
//$("#allonote_install").hide();
$("#dsbblock").append('<div class="row">Сервис SMS "AlloNote" - запущен!</div>');
} else {
$("#dsbblock").append('<div class="row">Сервис SMS "AlloNote" - не запущен!</div>');
//$("#allonote_installed").hide();
//$("#allonote_install").show();
}
}
});
$.ajax({
url: location.origin+location.pathname,
data: {
restmethod:"is_allotginstalled"
},
success: function( result ){
console.log("is_allotginstalled RES: " + result);
if(result=="true"){
$("#dsbblock").append('<div class="row">Сервис Телеграм "AlloTG" - не запущен!</div>');
//$("#allotg_installed").show();
//$("#allotg_install").hide();
} else {
$("#dsbblock").append('<div class="row">Сервис Телеграм "AlloTG" - не запущен!</div>');
//$("#allotg_installed").hide();
//$("#allotg_install").show();
}
}
});
*/
};
</script>
<?php //include("footer.php"); ?>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php namespace AloVoice;
?><!--===============================================================================================-->
<div class="modal fade" id="alvModal" tabindex="-1" role="dialog" aria-labelledby="alvModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="alvModalLabel">New message</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="alvModalBody">
</div>
<div class="modal-footer" id="alvModalFooter">
<button type="button" class="btn btn-secondary" id="modalCloseBtn" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="alvModalSendBtn">Send message</button>
</div>
</div>
</div>
</div>
</div>
<h5 class="h5 card-body card-body-bottomtitle">Телефония <span style="color:#ff9800; font-weight:bold;">AloVoice</span>&copy;</h5>
<script src="template/vendor/jquery/jquery-3.2.1.min.js"></script>
<script src="template/vendor/bootstrap/js/popper.js"></script>
<script src="template/vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="template/vendor/select2/select2.min.js"></script>
<script src="template/js/microne.js<?php echo '?t='.time();?>"></script>
<script src="template/js/main.js<?php echo '?t='.time();?>"></script>
<script src="template/js/feather-icons.js<?php echo '?t='.time();?>"></script>
<script src="template/js/feather.js<?php echo '?t='.time();?>"></script>
<!--===============================================================================================-->
</body>
</html>
<?php namespace AloVoice; include("header.php"); ?>
<div class="container">
<?php if(!empty($formHTML)){ echo $formHTML; } ?>
</div>
<?php include("footer.php"); ?>
\ No newline at end of file
<?php namespace AloVoice;
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>AloVoice beta</title>
<?php if(empty($isFullPage)){ ?>
<!-- подключаем библиотеку BX24 -->
<script src="//api.bitrix24.com/api/v1/"></script>
<?php } ?>
<!--===============================================================================================-->
<link rel="icon" type="image/png" href="<?=$this->alvhost?>template/images/icons/favicon.ico"/>
<link rel="stylesheet" type="text/css" href="<?=$this->alvhost?>template/vendor/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="<?=$this->alvhost?>template/fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="<?=$this->alvhost?>template/vendor/animate/animate.css">
<link rel="stylesheet" type="text/css" href="<?=$this->alvhost?>template/vendor/select2/select2.min.css">
<link rel="stylesheet" type="text/css" href="<?=$this->alvhost?>template/vendor/perfect-scrollbar/perfect-scrollbar.css">
<link rel="stylesheet" type="text/css" href="<?=$this->alvhost?>template/css/util.css">
<link rel="stylesheet" type="text/css" href="<?=$this->alvhost?>template/css/main.css<?php echo '?t='.time();?>">
<!--===============================================================================================-->
<!-- feather -->
<!-- <script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> -->
<style>
.alvcontainer {
margin-right: auto;
margin-left: auto;
padding-right: 10px;
padding-left: 10px;
width: 90%;
}
</style>
</head>
<body>
<div class="alvcontainer">
<?php if(!empty($arAlvSections)) { ?>
<div class="row menu_top">
<ul class="alv_topmenu" id="myTab" role="tablist">
<?php foreach($arAlvSections as $sid => $section){ ?>
<li class="nav-item">
<a class="nav-link alv_navliink <?php if( $sid==$loadPage ) { echo "active"; } ?>" id="<?php echo $sid; ?>-tab" data-toggle="tab" href="#<?php echo $sid; ?>" role="tab" aria-controls="<?php echo $sid; ?>" aria-selected="true"><b><?php echo $section["name"]; ?></b></a>
</li>
<?php } ?>
</ul>
</div>
<?php } ?>
<?php if(empty($isFullPage)){ ?>
<script>
//var bx24 = new BX24();
BX24.init(function(){
console.log('Инициализация завершена!', BX24.isAdmin());
});
function alv() {
console.log(" --- === beginALV === ---");
}
</script>
<?php } ?>
\ No newline at end of file
<?php namespace AloVoice; include("header.php"); ?>
<center><h2>Добро пожаловать в AloVoice BX24</h2></center>
<div class="card">
<div class="card-body">
<h5 id="toggler_asterisk_settings" class="card-title">Введите параметры для сервера <strong>"<?php echo $_SERVER["HTTP_HOST"]?>"</strong></h5>
<form id="sms-settings">
<div class="card-text">
<input type="hidden" name="save" value="Y">
<input type="hidden" name="access_token" value="<?=$_REQUEST['AUTH_ID'];?>">
<input type="hidden" name="refresh_token" value="<?=$_REQUEST['REFRESH_ID'];?>">
<input type="hidden" name="expires_in" value="<?=$_REQUEST['AUTH_EXPIRES'];?>">
<input type="hidden" name="domain" value="<?=$bxDomain;?>">
<input type="hidden" name="member_id" value="<?=$_REQUEST['member_id'];?>">
<div class="form-group">
<label class="col-sm-2 col-form-label">Aдрес Битрикс24:</label>
<div class="col-sm-10"><input type="text" class="form-control" value="<?php echo $bxDomain; ?>" disabled> </div>
</div>
<div class="form-group">
<label class="col-sm-2 col-form-label">Aдрес AMI:</label>
<div class="col-sm-10"><input type="text" class="form-control" name="ami_host" id="ami_host" value="127.0.0.1"> </div>
</div>
<div class="form-group">
<label class="col-sm-2 col-form-label">Порт AMI:</label>
<div class="col-sm-10"> <input type="text" class="form-control" name="ami_port" id="ami_port" value="5038"></div>
</div>
<div class="form-group"> <label class="col-sm-2 col-form-label">Пользователь AMI:</label> <div class="col-sm-10"><input type="text" class="form-control" name="ami_user" id="ami_user"> </div> </div>
<div class="form-group"> <label class="col-sm-2 col-form-label">Пароль AMI:</label> <div class="col-sm-10"><input type="text" class="form-control" name="ami_pass" id="ami_pass"> </div> </div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn btn-save">Сохранить</button>
</div>
</div>
</form>
<!--a href="#" class="btn btn-primary">Вернуться в Битрикс24</a-->
</div>
</div>
<script src="//api.bitrix24.com/api/v1/"></script>
<script>
BX24.init(function() {
var size = BX24.getScrollSize();
BX24.resizeWindow(size.scrollWidth, 400);
BX24.fitWindow();
console.log(size);
$('#alv_install').submit(function(e) {
e.preventDefault();
BX24.installFinish();
});
});
</script>
<?php include("footer.php"); ?>
\ No newline at end of file
<div class="alvtop_header" id="alv_mainblock"> <?php //card?>
<center>
<h3 class="h3 card-body">Интеграции</h3>
<div class="container" id="integrationsblock">
<table class="table" id="stats_block_table">
<thead>
<tr>
<th>Интеграция</th>
<th>Статус</th>
<th>Действие</th>
</tr>
</thead>
<tbody id="integrations_table_body"></tbody>
</table>
</div>
</center>
</div>
<script>
var loadAlovoiceStatusLine = function(method,cbk){
console.log(method+" BEGIN... ");
$.ajax({
url: location.origin+location.pathname,
dataType: "json",
data: {
restmethod:(method) ? method : 'status_integration'
},
success: function( result ){
console.log(method+" RES: " , result);
if(result.lines){
result.lines.forEach(function(itg){
if(typeof itg.code !== 'undefined' ){
$("#"+itg.code).remove();
$("#integrations_table_body").append(getStatusLineHtml(itg));
}
});
}
if(typeof result.nextintegration !== 'undefined' ){
loadAlovoiceStatusLine(result.nextintegration);
}
if(typeof cbk !== 'undefined'){
cbk(result);
}
}
});
}
// BX24.callMethod(
// 'crm.activity.add',
// {
// fields:
// {
// "OWNER_TYPE_ID": 2,
// "OWNER_ID": 882,
// "PROVIDER_ID": 'REST_APP',
// "PROVIDER_TYPE_ID": 'ecpsign',
// "SUBJECT": "Документ подписан",
// "COMPLETED": "Y",
// "RESPONSIBLE_ID": 1,
// "DESCRIPTION": "Подписанный документ: Договор (SOFT) PRO-23"
// }
// },
// function(result)
// {
// if(result.error())
// alert("Error: " + result.error());
// else
// {
// alert("Success: " + result.data());
// }
// }
// );
// BX24.callMethod(
// 'crm.activity.add',
// {
// fields:
// {
// "OWNER_TYPE_ID": 2,
// "OWNER_ID": 882,
// "PROVIDER_ID": 'REST_APP',
// "PROVIDER_TYPE_ID": 'ecpsign',
// "SUBJECT": "Подписан документ: Договор (SOFT) PRO-23",
// "COMPLETED": "Y",
// "RESPONSIBLE_ID": 1,
// "DESCRIPTION": '[2198]',
// }
// },
// function(result)
// {
// if(result.error())
// console.log("Error: " , result.error());
// else
// {
// console.log("Success: " , result.data());
// }
// }
// );
var start_integration = function(code){
//console.log("integration_on code:" , code);
loadAloVoiceInfo(
{"restmethod":"integration_on","code":code},
function(res){
console.log("integration_on RES:" , code, res);
if(res.result && res.result == "success"){
var iTitle = $('#title_'+code).text();
$("#"+code).remove();
var ingHtml = getStatusLineHtml({code:code,title:iTitle,status:'on'});
console.log("itg HTML:",ingHtml);
$("#integrations_table_body").append(ingHtml);
}
}
);
};
var stop_integration = function(code){
aloModal({
label: 'Отключения интеграции',
body: 'Вы уверены отключить - "'+$('#title_'+code).text()+'"?',
btn: 'Отключить',
callback:function(){
$.ajax({
url: location.origin+location.pathname,
dataType: "json",
data: {
restmethod:'integration_off',
code:code
},
success: function( result ){
console.log("integration_off RES: " , code, result);
if(result.result && result.result == "success"){
var iTitle = $('#title_'+code).text();
$("#"+code).remove();
var ingHtml = getStatusLineHtml({code:code,title:iTitle,status:'off'});
console.log("itg HTML:",ingHtml);
$("#integrations_table_body").append(ingHtml);
}
}
});
}
});
};
var getStatusLineHtml = function(itg){
var stCode = (typeof itg.code !== 'undefined' ) ? itg.code : 'Code';
var stTitle = (typeof itg.title !== 'undefined' ) ? itg.title : 'Title';
var stStatus = (typeof itg.status !== 'undefined' ) ? itg.status : 'Status';
var stText = (stStatus=="off") ? '<span class="badge badge-secondary">Отключён</span>' : '<span class="badge badge-success">Включён</span>';
var stLineHtml = '<tr id="'+stCode+'">';
stLineHtml += '<td id="title_'+stCode+'">'+stTitle+'</td>';
stLineHtml += '<td>'+stText+'</td>';
if(stStatus=="off"){
stLineHtml += '<td><div onclick="start_integration(\''+stCode+'\');" class="btn btn-success">Вкл</div></td>';
} else {
stLineHtml += '<td><div onclick="stop_integration(\''+stCode+'\');" class="btn btn-danger">Выкл</div></td>';
}
stLineHtml += '</tr>';
return stLineHtml;
}
var afterLoadPage = function(reload){
console.log("Integrations page running...");
loadAlovoiceStatusLine(); //'status_integration'
};
</script>
\ No newline at end of file
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php namespace AloVoice; ?>
<style>
.alv_table_lines .nowrp {
white-space: nowrap;
}
.loadingline{
display:none;
}
</style>
<center>
<h3 class="h3 card-body">Внутренние номера</h3>
<div class="loadingline"></div>
<!---a href="#" onClick="addNewTrunk()" id="trunk_add_button" class="btn btn-primary title_line_button"><i class="fa fa-arrow-down"></i> + Добавить </a--->
</center>
<br/>
<table class="table" id="stats_block_table">
<thead>
<tr id="alvtrunks_table_header"></tr>
</thead>
<tbody id="alvtrunks_table_body"> </tbody>
</table>
<script>
var afterLoadPage = function(){
var isHeadered = false;
var peersUpdate = function(){
//if(updatingTm == true){ return; }
loadAloVoiceInfo("alovoice_peers_list",function(res){
console.log("AloVoice Peers RES:",res);
if(!isHeadered){
if(typeof res.headers != 'undefined' ){
isHeadered = true;
$("#alvtrunks_table_header").html('');
$.each( res.headers, function( key, value ) {
console.log("Each Header:",key, value);
$("#alvtrunks_table_header").append('<th id="hd_'+key+'">'+value+'</th>');
});
}
}
if(typeof res.datas != 'undefined' ){
$("#alvtrunks_table_body").html('');
$.each( res.datas, function( tkey, peer ) {
console.log("Each peer:",peer);
var lineHTML = '<tr class="alv_table_lines" id="trk_line_'+peer.id+'">'
$.each( res.headers, function( hkey, value ) {
lineHTML += '<td>'+peer[hkey]+'</td>'
});
lineHTML += '</tr>';
/*let status = (peer.status == 'Off') ? '<span class="off_tg_status badge badge-secondary">Выключен</span>' : '<span class="active_tg_status badge badge-success">'+peer.status+'</span>';
var lineHTML = '<tr class="alv_table_lines" id="trk_line_'+peer.id+'" data-device="'+peer.type+'" data-numcode="'+peer.name+'">'
+'<td class="nowrp" > <span>'+trunk.id+'</span></td>'
+'<td class="nowrp" > <b>'+trunk.name+'</b></td>'
+'<td class="nowrp" >'+trunk.type +'</td>'
+'<td>'+trunk.number+'</td>'
+'<td>'+trunk.maxchannels+'</td>'
+'<td>'+status+'</td>'
+'<td class="nowrp" ><a href="#" onClick="updateOneTrunk(\''+trunk.id+'\');"><i class="fa fa-money"></i> Проверить</a></td>'
+'';*/
$("#alvtrunks_table_body").append(lineHTML);
});
}
//setTimeout(donglesUpdate,100000);
});
}
peersUpdate();
};
</script>
\ No newline at end of file
This diff is collapsed.
<?php namespace AloVoice; ?>
<center><h3 class="h3 card-body">Настройки</h3></center>
<form id="alv_settings_form">
<div class="form-row">
<div class="form-group col-md-12">
<label for="asterisk_host">IP или доменный Адрес Менеджера Астериск (AMI)</label>
<input type="text" class="form-control form-control" id="asterisk_host" placeholder="" value="">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="asterisk_port">Порт Менеджера Астериск (AMI)</label>
<input type="text" class="form-control form-control" id="asterisk_port" placeholder="" value="">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="asterisk_user">Пользователь Менеджера Астериск (AMI)</label>
<input type="text" class="form-control form-control" id="asterisk_username" placeholder="" value="">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="asterisk_pass">Пароль к Менеджеру Астериск (AMI)</label>
<input type="password" class="form-control form-control" id="asterisk_secret" placeholder="" value="">
</div>
</div>
<div class="form-row">
<div class="form-group mx-2">
<label class="" for="asterisk_pass">Диапазон номеров для автоназначения сотрудникам</label>
</div>
<div class="form-group form-row">
<div class="col-3">
<input type="number" class="form-control" id="unumbers_from" placeholder="" value="">
</div>
<div class="col-1 text-center"> - </div>
<div class="col-3">
<input type="number" class="form-control" id="unumbers_to" placeholder="" value="">
</div>
</div>
</div>
<div class="form-row">
<div class="form-group mx-2">
<label class="" for="sipaddress_local">SIP адрес и порт (локальный)</label>
</div>
<div class="form-group form-row">
<div class="col-4">
<input type="text" class="form-control" id="sipaddress_local" placeholder="" value="">
</div>
<div class="col-1 text-center"> - </div>
<div class="col-2">
<input type="text" class="form-control" id="sipport_local" placeholder="" value="">
</div>
</div>
</div>
<div class="form-row">
<div class="form-group mx-2">
<label class="" for="sipaddress_out">SIP адрес и порт (внешний)</label>
</div>
<div class="form-group form-row">
<div class="col-4">
<input type="text" class="form-control" id="sipaddress_out" placeholder="" value="">
</div>
<div class="col-1 text-center"> - </div>
<div class="col-2">
<input type="text" class="form-control" id="sipport_out" placeholder="" value="">
</div>
</div>
</div>
<div class="form-row">
<div class="form-group mx-2">
<label class="" for="miscallagentname">Кто ОТВЕТСТВЕННЫЙ по умолчанию: </label>
</div>
<div class="form-group">
<input class="form-control" type="text" id="miscallagentname" disabled>
<input type="hidden" id="miscallagentid">
</div>
<div class="form-group">
<div class="btn btn-primary mb-2" onclick="BX24.selectUser(selectmiscallagentid)">Выбрать...</div>
</div>
</div>
<div class="form-group row">
<div class="form-group ml-4">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="showcallcard">
<label class="form-check-label" for="showcallcard">Запускать окно обработки звонка</label>
</div>
</div>
</div>
<div class="form-group row">
<div class="form-group ml-4">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="autocreatelead">
<label class="form-check-label" for="autocreatelead">Авто создание лида при вызове</label>
</div>
</div>
</div>
<div class="form-group row">
<div class="form-group ml-4">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="add_to_chat">
<label class="form-check-label" for="add_to_chat">Оповещать о всех звонках в чате</label>
</div>
</div>
</div>
<br>
<a href="#" class="btn btn-primary" id="save_alovoice_settings">Сохранить</a>
</form>
<script>
//-lg
var afterLoadPage = function(){
window.selectmiscallagentid = function(user){
if(typeof user !== 'undefined' && typeof user.id !== 'undefined' && typeof user.name !== 'undefined'){
$("#miscallagentid").val(user.id);
$("#miscallagentname").val(user.name);
}
}
loadAloVoiceInfo("alovoice_settings",function(res){
/*
// 'host' => $this->config["asterisk_host"],
// 'port' => $this->config["asterisk_port"],
// 'username' => $this->config["asterisk_username"],
// 'secret' => $this->config["asterisk_secret"]
*/
console.log("AloVoice settings RES:",res);
$.each(res,function(ks,vs){
if($("#"+ks)){
if($("#"+ks).prop("tagName")=="SELECT"){
$("#"+ks).val(vs).change();
}
else if($("#"+ks).attr('type')=="checkbox"){
$("#"+ks).prop('checked',(vs=="true") ? true : false);
}
else{
$("#"+ks).val(vs);
}
}
});
// if(typeof res.host !== 'undefined' ){ $("#asterisk_host").val(res.host); }
// if(typeof res.port !== 'undefined' ){ $("#asterisk_port").val(res.port); }
// if(typeof res.username !== 'undefined' ){ $("#asterisk_user").val(res.username); }
// if(typeof res.secret !== 'undefined' ){ $("#asterisk_pass").val(res.secret); }
// if(typeof res.unumbers_from !== 'undefined' ){ $("#unumbers_from").val(res.unumbers_from); }
// if(typeof res.unumbers_to !== 'undefined' ){ $("#unumbers_to").val(res.unumbers_to); }
$("#save_alovoice_settings").click(function(){
var saveElements = {};
var last = $("input").length-1;
$.each($("select"),function(ind,obj){
console.log("Check VAL:",$(obj).attr("id"), "[",$(obj).val(),"]");
saveElements[$(obj).attr("id")] = $(obj).val();
});
$.each($("input"),function(ind,obj){
var iVal = ($(obj).attr('type')=="checkbox") ? $(obj).prop('checked') : $(obj).val();
console.log("Check VAL:",$(obj).attr("id"), "[",iVal,"]");
saveElements[$(obj).attr("id")] = iVal;
if(last == ind){
console.log("Finish: ",saveElements);
saveElements["restmethod"] = "savealovoicesettings";
loadAloVoiceInfo(saveElements,function(res){
console.log("Save RES: ",res);
$("#alv_settings_form").prepend('<div class="alert alert-success" id="savesuccesbox" role="alert">Настройки сохранены!</div>');
setTimeout(function(){
$("#savesuccesbox").remove();
},3000);
});
}
});
});
});
}
</script>
\ No newline at end of file
<?php namespace AloVoice; ?>
<center>
<h3 class="h3 card-body">Записи для звонков</h3>
<a href="#" onClick="addNewSoundAccount()" data-toggle="modal" data-target="#alvModal" class="btn btn-primary title_line_button"><i class="fa fa-telegram"></i>+ Добавить запись</a>
</center>
<style>
.alv_table_lines .nowrp {
white-space: nowrap;
}
.loadingline{
display:none;
}
</style>
<table class="table" id="stats_block_table">
<thead>
<tr id="alvsounds_table_header"></tr>
</thead>
<tbody id="alvsounds_table_body"> </tbody>
</table>
<script>
//-lg
var afterLoadPage = function(){
var isHeadered = false;
loadAloVoiceInfo("alovoice_sounds_list",function(res){
console.log("AloVoice Sounds RES:",res);
window.alovoiceallsounds = res.datas;
window.alovoiceallsoundsheaders = res.headers;
window.soundspath = res.path;
if(!isHeadered){
if(typeof res.headers != 'undefined' ){
isHeadered = true;
$("#alvsounds_table_header").html('');
$.each( res.headers, function( key, value ) {
console.log("Each Header:",key, value);
$("#alvsounds_table_header").append('<th id="hd_'+key+'">'+value+'</th>');
});
}
}
if(typeof res.datas != 'undefined' ){
$("#alvsounds_table_body").html('');
$.each( res.datas, function( skey, sound ) {
sound['id'] = skey;
sound['link'] = window.soundspath + sound.name;
$("#alvsounds_table_body").append(makeLineHtml(sound));
});
setTimeout(makePlayers,500);
}
});
}
function makePlayers(sid){
var elm = (typeof sid != 'undefined') ? sid : '.mp3player';
$(elm).css({width:'16px',height:'17px',margin:'3px 8px'});
$(elm).each(function(){
var filePath = $(this).attr('data-file');
var m = new Microne(this);
m.source(filePath);
});
}
function makeLineHtml(sound){
console.log("Each Sound:",sound);
var lineHTML = '<tr class="alv_table_lines" id="trk_line_'+sound.id+'" data-title="'+sound.title+'">';
$.each( window.alovoiceallsoundsheaders, function( hkey, hvalue ) {
var lineclass= 'nowrp';
if(hkey=="actions"){
lineclass = 'nowrp d-flex flex-row';
var fileExt = (typeof sound.ext != ' undefined') ? sound.ext : sound.name.slice(-3);
var value = '<div class="mp3player" id="snd_plr_'+sound.id+'" data-file="'+window.soundspath + sound.time+'.'+fileExt+'"></div>';
value += '<a href="#" onClick="deleteOneSound(\''+sound.id+'\');"><i class="fa fa-trash"></i> Удалить</a>';
} else if(hkey=="size") {
var value = formatBytes(sound.size);
} else if(hkey=="time") {
var value = new Date(sound.time * 1000).toISOString().slice(0, 19).replace('T', ' ');
} else if(hkey=="id") {
var value = sound.id;
} else {
var value = sound[hkey];
}
lineHTML += '<td class="'+lineclass+'" > '+value+'</td>';
});
lineHTML += '</tr>';
return lineHTML;
}
function deleteOneSound(fileid){
console.log("Begin deleting:",fileid, window.alovoiceallsounds[fileid]);
aloModal({
label: "Удаления записи...",
body: '<br> <h3>Вы точно хотите удалить запись: ['+window.alovoiceallsounds[fileid]['title']+']</h3>',
btn: "Удалить",
nohide: true,
callback: function(){
console.log("START deleting:",fileid, window.alovoiceallsounds[fileid]);
loadAloVoiceInfo({"restmethod":"deletealovoiceonesound","fileid":fileid},function(res){
console.log("Del RES: ",res);
if(typeof res.deleted != 'undefined'){
$("#trk_line_"+res.deleted).remove();
$("#modalCloseBtn").click();
}
});
}
});
}
function addNewSoundAccount(){
// var confcodesent = false;
console.log("Begin adding snd........");
aloModal({
label: "Добавить запись",
body: '<br> <form>'
+'<div class="form-group">'
+'<input type="text" class="form-control" id="alv_sound_name" placeholder="Введите названия для записи">'
+'</div>'
+'<div class="form-group">'
+'<label for="alv_sound_file" class="btn btn-primary afilelabel">Выберите файл записи - *.mp3</label>'
+'<input type="file" class="sound-file-input myfileinput" id="alv_sound_file" name="alv_sound_file" required accept=".mp3" onChange="doUpload(this)">'
+'</div>'
+'</form>',
btn: "Отправить",
nohide: true,
callback: function(){
// $("#tgaddformlabel").text("Введите код подтверждения:");
// $("#tgnumber").val("").attr("id","tgnumbercode");
//$("#modalCloseBtn").click();
var soundName = $("#alv_sound_name").val();
if(!soundName){ alert("No Name sound"); return true; }
var saveElements = window.uploadedarfile;
saveElements["restmethod"] = "savealovoiceonesound";
saveElements["title"] = soundName;
loadAloVoiceInfo(saveElements,function(res){
console.log("Save RES: ",res);
if(typeof res.time != 'undefined'){
res["id"] = res.time;
res['link'] = window.soundspath + res.name;
$("#alvsounds_table_body").append(makeLineHtml(res));
setTimeout(function(){makePlayers('#snd_plr_'+res.time)},500);
$("#modalCloseBtn").click();
}
// $("#alv_settings_form").prepend('<div class="alert alert-success" id="savesuccesbox" role="alert">Настройки сохранены!</div>');
// setTimeout(function(){
// $("#savesuccesbox").remove();
// },3000);
});
}
});
}
</script>
\ No newline at end of file
<?php namespace AloVoice; ?>
<style>
.row{
display:flex !important;
}
.queues_content{
position: absolute;
width: 100%;
left: 0;
}
.queues_agent_icon {
position: absolute;
bottom: 21px;
right: 30px;
width: 15px;
height: 15px;
}
</style>
<div class="queues_content px-2">
<div class="row" >
<h3 class="h3 card-body text-center">Статистика агентов</h3>
</div>
<div class="row p-1 bg-light border">
<div class="col-12">
<div id="agentstats"> Ждите, загружается информация...</div>
<div>
<button type="button" class="btn btn-outline-info" id="queues_update">
<i data-feather="rotate-ccw" class="w-2 h-2" width="0.7em" height="0.7em"></i> Обновить
</button>
</div>
</div>
</div>
</div>
<br/>
<script>
// if (window.intervalId) {
// console.log(intervalId);
// try {
// clearInterval(window.intervalId)
// } catch (error) {
// }
// }
var afterLoadPage = function () {
window.makeStatistics = function() {
loadAloVoiceInfo("alovoice_get_agents", function (res) {
// window.res = res
// console.warn(res)
console.log('Res Agents:', res)
});
}
window.makeStatistics();
}
</script>
\ No newline at end of file
This diff is collapsed.
<?php namespace AloVoice; ?>
<center>
<h3 class="h3 card-body">Настройки Telegram</h3>
<a href="#" onClick="addTgAccount()" data-toggle="modal" data-target="#alvModal" class="btn btn-primary title_line_button"><i class="fa fa-telegram"></i>+ Добавить аккаунт</a>
</center>
<br/>
<table class="table" id="stats_block_table" style="display:none; vertical-align: middle; text-align: center;">
<thead>
<tr>
<th rowspan="2" style="vertical-align: middle; text-align: center;">Аккаунт</th>
<th rowspan="2" style="vertical-align: middle; text-align: center;">Состояние</th>
<th colspan="4" style="vertical-align: middle; text-align: center;">Исключения</th>
<th rowspan="2" style="vertical-align: middle; text-align: center;">Действие</th>
</tr>
<tr>
<th style="vertical-align: middle; text-align: center;">Группы</th>
<th style="vertical-align: middle; text-align: center;">Каналы</th>
<th style="vertical-align: middle; text-align: center;">Боты</th>
<th style="vertical-align: middle; text-align: center;">АвтоLead</th>
</tr>
</thead>
<tbody id="service_table_body"> <tr><td>Загрузка информации об Аккаунтах...</td></tr></tbody>
</table>
<a href="#" onClick="testfunc()" class="btn btn-primary">Test</a>
<div id="testbox"></div>
<script>
var afterLoadPage = function(reload){
if(typeof reload == 'undefined' ){ var reload = false; }
AloTelegram("get_telegram_accounts",{},function(res){
console.log("AloVoice TG settings RES:",res.length, res);
if(res.length > 0){
$("#stats_block_table").show();
$("#service_table_body").html("");
res.forEach(function(val){
console.log("Each ACC:",val);
var lineHTML = makeAccountLineHtml(val);
$("#service_table_body").append(lineHTML);
});
}
});
}
/*
setTimeout(function(){
setInterval(function(){
afterLoadPage(true);
},5000);
},5000);
*/
function makeAccountLineHtml(val){
var actHtml = (val.status == 'on') ? '<br><a href="#" onClick="stopTgAccount(\''+val.phone+'\');"><i class="fa fa-stop"></i> Остановить</a>' : '<br><a href="#" onClick="runTgAccount(\''+val.phone+'\');"><i class="fa fa-play"></i> Запустить</a>';
var userHtml = (val.status == 'on') ? ' '+val.name+' ('+val.username+')' : '';
var delHTML = '<a href="#" onClick="delTgAccount(\''+val.phone+'\');"><i class="fa fa-trash"></i> Удалить</a>';
console.log("User HTML check:",userHtml);
var grCheckBox = '<input type="checkbox" name="is_group_ex_'+val.phone+'">';
var chanCheckBox = '<input type="checkbox" name="is_channel_ex_'+val.phone+'">';
var botCheckBox = '<input type="checkbox" name="is_bot_ex_'+val.phone+'">';
var isAutoLeadBox = '<input type="checkbox" name="is_auto_lead_'+val.phone+'">';
var lineHTML = '<tr id="tg_line_'+val.phone+'">'
+'<td id="tg_line_name_'+val.phone+'" ><i class="fa fa-telegram tgcolor"></i> <span>'+val.phone+''+userHtml+'</span></td>'
+'<td id="tg_line_status_'+val.phone+'"> '+val.active+' </td>'
+'<td style="text-align: center;"> '+grCheckBox+' </td>'
+'<td style="text-align: center;"> '+chanCheckBox+' </td>'
+'<td style="text-align: center;"> '+botCheckBox+' </td>'
+'<td style="text-align: center;"> '+isAutoLeadBox+' </td>'
+'<td id="tg_line_actions_'+val.phone+'">'
+delHTML
+actHtml
+'</td>'
+'</tr>';
return lineHTML;
}
function testfunc(){
let dt = prompt('Чо искать?', 123456789);
if(dt){
loadAloVoiceInfo({ restmethod:"alovoice_findcontactinfo", 'number':dt },function(res){
console.log("AloVoice TG TESTs:",res);
});
/*AloTelegram("get_loaduserphoto",{'dt':dt},function(res){
console.log("AloVoice TG TESTs:",res);
})*/
/*
AloTelegram("get_contact_bynumber",{'number':dt},function(res){
console.log("AloVoice TG TESTs:",res);
});*/
}
//AloTelegram("get_loadcontactslist",{},function(res){
// console.log("AloVoice TG TESTs:",res);
//});
/*let dt = prompt('Чо грузить?', 123);
if(dt!=123){
AloTelegram("get_testfunc",{'dt':dt},function(res){
console.log("AloVoice TG TESTs:",res);
});
}*/
//01000000182773072d9f0000000000001d3a41e62f1c9b0b
}
function stopTgAccount(tgnumber){
console.log("Begin STOP tg accc.........",tgnumber);
$("#tg_line_actions_"+tgnumber).html("Остановливается...");
AloTelegram("stop_profile_by_number",{'TGNUMBER':tgnumber},function(res){
console.log("AloVoice TG STOP RES:",res);
setTimeout(function(){
checkTgAccountStatus(tgnumber);
},1000);
});
}
function runTgAccount(tgnumber){
console.log("Begin RUN tg accc.........",tgnumber);
$("#tg_line_actions_"+tgnumber).html("Запускается...");
AloTelegram("run_profile_by_number",{'TGNUMBER':tgnumber},function(res){
console.log("AloVoice TG RUN RES:",res);
//afterLoadPage();
if(typeof res.answer !== 'undefined' && res.answer == 'sent' ){
$("#tg_line_actions_"+tgnumber).html("Запущен!");
//afterLoadPage(true);
//$("#stats_block_table").show();
setTimeout(function(){
checkTgAccountStatus(tgnumber);
},2000);
}
});
}
function checkTgAccountStatus(tgnumber){
AloTelegram("get_telegram_account_status",{'TGNUMBER':tgnumber},function(res){
console.log("AloVoice TG ACC s tstus RES:",res);
if(typeof res.phone !== 'undefined'){
var lineHTML = makeAccountLineHtml(res)
$("#tg_line_"+tgnumber).replaceWith(lineHTML);
//$("#tg_line_status_"+tgnumber).html(lineHTML);
}
});
}
function delTgAccount(tgnumber){
$("#tg_line_actions_"+tgnumber).html("Loading...");
console.log("Begin DELETE tg accc.........",tgnumber);
AloTelegram("delete_telegram_account",{'TGNUMBER':tgnumber},function(res){
console.log("AloVoice TG DELETE RES:",res);
if(typeof res.answer!=="undefined"){
$("#tg_line_"+tgnumber).remove();
//afterLoadPage(true);
}
});
}
function addTgAccount(){
var confcodesent = false;
console.log("Begin add tg accc.........");
aloModal({
label: "Добавить ТГ Аккаунт",
body: '<br> <form><div class="form-group"><label for="tgnumber" class="col-form-label" id="tgaddformlabel">Введите номер Аккаунта:</label><input type="number" class="form-control" id="tgnumber"><small id="tgnumberBlock" class="form-text text-muted">Пример: 998991234567</small></div></form>',
btn: "Отправить",
nohide: true,
callback: function(){
var tgnumber = $("#tgnumber").val();
console.log("Registering TG ACC: ", tgnumber);
AloTelegram("register_account",{'TGNUMBER':tgnumber},function(res){
console.log("AloVoice TG settings RES:",res);
if(typeof res.answer !== 'undefined' && res.answer.length > 0){
$("#stats_block_table").show();
}
});
setTimeout(function(){
var cntd = 30;
console.log("Showing confirm win ACC: ", cntd);
$("#tgaddformlabel").text("Введите код подтверждения:");
$("#tgnumber").val("").attr("id","tgnumbercode");
$("#tgnumberBlock").text("Код подтверждения из Telegramа или смс.").after('<span id="contdowntime">'+cntd+'</span>');
$("#alvModalSendBtn").attr("class","btn btn-success").click(function(){
if(confcodesent==false){
var tgconfcode = $("#tgnumbercode").val();
// $("#modalCloseBtn").click();
console.log("Sending... AloVoice TG CONF CODE :",{'TGNUMBER':tgnumber,"TGCONFCODE":tgconfcode});
AloTelegram("register_account_confcode",{'TGNUMBER':tgnumber,"TGCONFCODE":tgconfcode},function(res){
console.log("AloVoice TG CONF CODE RES:",res);
if(typeof res.answer !== 'undefined' && res.answer.length > 0){
//afterLoadPage();
console.log("Check CONF CODE Answer: ",res.answer);
if(res.answer=="sent"){
$("#contdowntime").remove();
$("#modalCloseBtn").click();
}
if(res.answer=="waitpass"){
cntd = 60;
confcodesent = true;
$("#tgaddformlabel").text("Введите двух факторный пароль:");
$("#tgnumbercode").val("").attr("id","tgfapassword");
}
}
});
}
else{
cntd = 30;
var tgfapassword = $("#tgfapassword").val();
var passsendobj = {'TGNUMBER':tgnumber,"TGPASS":tgfapassword};
console.log("Sending... AloVoice TG CONF CODE :",passsendobj);
AloTelegram("register_account_fapassword",passsendobj,function(res){
console.log("AloVoice TG 2FA Password sending Res:",res);
$("#modalCloseBtn").click();
});
}
});
setInterval(function(){ if(cntd>0) { cntd = cntd-1; $("#contdowntime").text(cntd); } else{ $("#contdowntime").remove(); $("#tgnumberBlock").html("Время истекло!"); } },1000);
},500);
}
});
}
</script>
\ No newline at end of file
<?php namespace AloVoice; ?>
<style>
.alv_table_lines .nowrp {
white-space: nowrap;
}
.loadingline{
display:none;
}
</style>
<center>
<h3 class="h3 card-body">Линии</h3>
<div class="loadingline"></div>
<!---a href="#" onClick="addNewTrunk()" id="trunk_add_button" class="btn btn-primary title_line_button"><i class="fa fa-arrow-down"></i> + Добавить </a--->
</center>
<br/>
<table class="table" id="stats_block_table">
<thead>
<tr id="alvtrunks_table_header"></tr>
</thead>
<tbody id="alvtrunks_table_body"> </tbody>
</table>
<script>
var afterLoadPage = function(){
var isHeadered = false;
/*
var dn=0;
var dnc=1;
window.updateDongleOneAccount = function(device,numcode){
loadAloVoiceInfo(
{"restmethod":"alovoice_update_dongles_accounts","device":device,"numcode":numcode},
function(res){
console.log("AloVoice GSM dongle ACC RES:",res);
}
)
};
window.updateDongleAccounts = function(){
console.log("ChLdPg:",window.loadedpage);
updatingTm = true;
var dnglLngth = $(".alv_table_lines").length;
$(".loadingline").show().text("Отправка USSD №"+dnc);
$("#dongle_ussd_send_btn").hide();
console.log("AloVoice GSM dongle UPDATING...",dnglLngth, dnc);
$(".alv_table_lines").each(function(ind){
if(ind==dn){
var device = $(this).attr("data-device");
var numcode = $(this).attr("data-numcode");
loadAloVoiceInfo(
{"restmethod":"alovoice_update_dongles_accounts","device":device,"numcode":numcode},
function(res){
console.log("AloVoice GSM dongle ACC RES:",res);
if(dnc==dnglLngth){
console.log("accounting DONE!");
setTimeout(afterLoadPage,10000);
$(".loadingline").hide();
$("#dongle_ussd_send_btn").show();
updatingTm = false;
dn=0;
dnc=1;
} else {
setTimeout( updateDongleAccounts,2000);
dn++;
dnc++;
}
}
);
}
});
};
*/
var trunksUpdate = function(){
//if(updatingTm == true){ return; }
loadAloVoiceInfo("alovoice_trunks_list",function(res){
console.log("AloVoice Trunks RES:",res);
if(!isHeadered){
if(typeof res.headers != 'undefined' ){
isHeadered = true;
$("#alvtrunks_table_header").html('');
$.each( res.headers, function( key, value ) {
console.log("Each Header:",key, value);
$("#alvtrunks_table_header").append('<th id="hd_'+key+'">'+value+'</th>');
});
}
}
if(typeof res.datas != 'undefined' ){
$("#alvtrunks_table_body").html('');
$.each( res.datas, function( tkey, trunk ) {
console.log("Each Trunk:",trunk);
/*var statusLine = (val.datas[2]=="free") ? '<span style="color:green;">'+val.datas[2]+'</span>' : val.datas[2];
var statusLine = (statusLine=="dialing") ? '<span style="color:yellow;">'+statusLine+'</span>' : statusLine;
var statusLine = (statusLine=="outgoing") ? '<span style="color:blue;">'+statusLine+'</span>' : statusLine;
//var statusLine = (val.datas[2]=="dialing") ? '<span style="color:yellow;">'+val.datas[2]+'</span>' : val.datas[2];
*/
let status = (trunk.status == 'On') ? '<span class="active_tg_status badge badge-success">Активный</span>' : '<span class="off_tg_status badge badge-secondary">Выключен</span>';
var lineHTML = '<tr class="alv_table_lines" id="trk_line_'+trunk.id+'" data-device="'+trunk.type+'" data-numcode="'+trunk.name+'">'
+'<td class="nowrp" > <span>'+trunk.id+'</span></td>'
+'<td class="nowrp" > <b>'+trunk.name+'</b></td>'
+'<td class="nowrp" >'+trunk.type +'</td>'
+'<td>'+trunk.number+'</td>'
+'<td>'+trunk.maxchannels+'</td>'
+'<td>'+status+'</td>'
+'<td class="nowrp" ><a href="#" onClick="updateOneTrunk(\''+trunk.id+'\');"><i class="fa fa-money"></i> Проверить</a></td>'
+'</tr>';
$("#alvtrunks_table_body").append(lineHTML);
});
}
//setTimeout(donglesUpdate,100000);
});
}
trunksUpdate();
};
</script>
\ No newline at end of file
<?php namespace AloVoice; include("header.php"); ?>
<?php
//echo '<PRE>';
//echo '</PRE>';
//var_dump($result["arStaffs"]);
//var_dump($arResult["arStaffsNumbers"]);
//var_dump($arResult["arStaffs"]);
//var_dump($arResult);
?>
<div class="card">
User Main...
</div>
<?php include("footer.php"); ?>
\ No newline at end of file
<?php namespace AloVoice; include("header.php"); ?>
<center>Добро пожаловать в AloVoice BX24</center>
<?php include("footer.php"); ?>
\ No newline at end of file
This diff is collapsed.
<?php namespace AloVoice;
require(__DIR__."/pdu/Exception/InvalidArgumentException.php");
require(__DIR__."/pdu/Pdu/Pdu.php");
require(__DIR__."/pdu/Pdu/PduFactory.php");
require(__DIR__."/pdu/Utf8/Utf8.php");
class AloPdu
{
const VERSION = '1.1';
public static function decode($t){
return \Application\Pdu\PduFactory::decode($t);
}
}
\ No newline at end of file
This diff is collapsed.
<?php namespace AloVoice; date_default_timezone_set('Asia/Tashkent');
use AloVoice\AloVoiceConnector as ALVC;
class AloVoiceAgi
{
private $options;
private $config;
private $smsparts;
public function __construct($config) {
$this->config = $config;
}
public function run($datas) {
self::aLog($_SERVER['argv'],'----=== RUN ARG vars:');
self::aLog($datas,'----=== RUN AGI datas:');
$crmPhoneSearchResult = BxRest::call("crm.duplicate.findbycomm",array(
'type' => "PHONE",
'values' => [$datas["caller_id"]],
));
self::aLog($crmPhoneSearchResult,'----=== AGI BX PHONE Search RES:');
$crmEntitySearchResult = BxRest::call("telephony.externalCall.searchCrmEntities",array(
'PHONE_NUMBER' => $datas["caller_id"],
));
self::aLog($crmEntitySearchResult,'----=== AGI BX ENTITY Search RES:');
// $agi = new AGI();
// $called_ext = $agi->request['agi_extension'];
//
if(!empty($_SERVER['argv'][1])){
// $runMethod = strtolower($_SERVER['argv'][1]);
// if(method_exists($this,strtolower($runMethod))){
// $rq=[];
// if(count($_SERVER['argv'])>2){
// foreach($_SERVER['argv'] as $i=>$arg){
// if($i>1){
// $v = explode("=",$arg);
// if(!empty($v[1])){ $rq[$v[0]] = $v[1]; } else { $rq[] = $v[0]; }
// }
// }
// }
// return $this->$runMethod($rq);
// }
}
echo '111';
return false;
}
public function consoleMethod($r) {
if(!empty($_SERVER['argv'][1])){
$runMethod = strtolower($_SERVER['argv'][1]);
if(method_exists($this,strtolower($runMethod))){
$rq=[];
if(count($_SERVER['argv'])>2){
foreach($_SERVER['argv'] as $i=>$arg){
if($i>1){
$v = explode("=",$arg);
if(!empty($v[1])){ $rq[$v[0]] = $v[1]; } else { $rq[] = $v[0]; }
}
}
}
return $this->$runMethod($rq);
}
}
return false;
}
public function aLog($d,$t='') {
ALVC::eLog($d, $t, 'agi');
}
}
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{"lead":{"calllistfieldcode":["BIRTHDATE","POST","ASSIGNED_BY_ID","COMPANY_ID","CONTACT_ID","UF_CRM_1623313128984","UF_CRM_1622711887190"],"innfieldcode":"UF_CRM_1622117814212","COMPANY_TITLE":"tax_name","ADDRESS":"tax_address","UF_CRM_1623313128984":"tax_nc6Code","UF_CRM_1623313151583":"tax_ns2Code","UF_CRM_1623313168504":"tax_ns2Name","UF_CRM_1633692023863":"tax_gdFullName","UF_CRM_1622711887190":"tax_nc6Name","UF_CRM_1622117814212":"tax_tin","UF_CRM_1622711954430":"tax_regDate","UF_CRM_1622711963973":"tax_regNum","UF_CRM_1622711973694":"tax_stateName","UF_CRM_1622715062745":"tax_account","UF_CRM_1622738392572":"tax_gdTin","UF_CRM_1622738308815":"tax_gbFullName","UF_CRM_1622738365245":"tax_gbTin","UF_CRM_615D520E740A3":"tax_address"},"deal":{"calllistfieldcode":["TYPE_ID","STAGE_ID","COMPANY_ID","CONTACT_ID","ASSIGNED_BY_ID","UF_CRM_60BA15B2F0D99"],"innfieldcode":"UF_CRM_60B72515DC39D","UF_CRM_5DE02C4C568DB":"tax_gdFullName","UF_CRM_5DE02C4C66040":"tax_gdTelWork","UF_CRM_5DE02C4C72179":"tax_name","UF_CRM_60B72515DC39D":"tax_tin","UF_CRM_60BA15B411AD7":"tax_regDate","UF_CRM_60BA15B4214A2":"tax_regNum","UF_CRM_60BA15B438613":"tax_stateName","UF_CRM_60BA15B446199":"tax_account","UF_CRM_60BA15B45285C":"tax_gbFullName","UF_CRM_60BA15B45E7B5":"tax_gbTin","UF_CRM_60BA15B46D212":"tax_gdTin","UF_CRM_60CB5612E366C":"tax_nc6Code","UF_CRM_60CB561304885":"tax_ns2Code","UF_CRM_60CB561315A54":"tax_ns2Name","UF_CRM_6164273528359":"tax_gdFullName"},"company":{"calllistfieldcode":["EMPLOYEES","CONTACT_ID","UF_CRM_1622703891784"],"innfieldcode":"UF_CRM_60B886D267730","TITLE":"tax_name","ADDRESS":"tax_address","ADDRESS_CITY":"tax_ns10Name","ADDRESS_REGION":"tax_ns11Name","ADDRESS_LEGAL":"tax_address","REG_ADDRESS_CITY":"tax_ns10Name","REG_ADDRESS_REGION":"tax_ns11Name","UF_CRM_1622703891784":"tax_nc6Name","UF_CRM_1622704357946":"tax_regDate","UF_CRM_1622704595752":"tax_regNum","UF_CRM_1622704692703":"tax_stateName","UF_CRM_60B886D267730":"tax_tin","UF_CRM_1622713755473":"tax_account","UF_CRM_60CB548946EF2":"tax_nc6Code","UF_CRM_60CB5489533B5":"tax_ns2Code","UF_CRM_60CB5489608DC":"tax_ns2Name","UF_CRM_616427350AE49":"tax_gdFullName","UF_CRM_60CB5489994FC":"tax_ns4Name","UF_CRM_60CB5489C46C3":"tax_gdTin","UF_CRM_60CB5489D1161":"tax_gbFullName","UF_CRM_60CB5489DEF29":"tax_gbTin","UF_CRM_1572143605":"tax_address"},"contact":{"calllistfieldcode":["PHOTO","BIRTHDATE","TYPE_ID","POST","COMPANY_ID"],"innfieldcode":"UF_CRM_61331D519F3FB"},"requisite":{"innfieldcode":"UF_CRM_1611577475","NAME":"tax_name","CODE":"tax_tin","RQ_NAME":"tax_gdFullName","RQ_COMPANY_NAME":"tax_name","RQ_COMPANY_FULL_NAME":"tax_nameFull","RQ_DIRECTOR":"tax_gdFullName","RQ_ACCOUNTANT":"tax_gbFullName","RQ_CEO_NAME":"tax_gdFullName","RQ_PHONE":"tax_gdTelWork","RQ_INN":"tax_tin","RQ_OKVED":"tax_nc6Code","RQ_IIN":"tax_tin","RQ_ST_CERT_NUM":"tax_regNum","RQ_ST_CERT_DATE":"tax_dateTin","RQ_REGON":"tax_ns10Code","UF_CRM_1571140284":"tax_nc6Code","UF_CRM_1571235456":"tax_ns2Name","UF_CRM_1571236111":"tax_ns2Code","UF_CRM_1571236735":"tax_account","UF_CRM_1572142377":"tax_gdFullName","UF_CRM_1622633054":"tax_address"}}
\ No newline at end of file
{"time":1633419921,"token":"4d02ecf7-06aa-405a-b4ca-c153cafc19fd"}
\ No newline at end of file
{
"hunter":{
"grade":"1",
"fix":{
"price": "1000000",
"weight": "50%",
},
"flex":{
"price": "1000000",
"weight": "50%",
},
},
"gloser":{
"grade":"2",
"fix":{
"price": "1500000",
"weight": "50%",
},
"flex":{
"price": "1500000",
"weight": "50%",
},
},
"farmer":{
"grade":"3",
"fix":{
"price": "2000000",
"weight": "50%",
},
"flex":{
"price": "2000000",
"weight": "50%",
},
},
"rop":{
"grade":"4",
"fix":{
"price": "2500000",
"weight": "50%",
},
"flex":{
"price": "2500000",
"weight": "50%",
},
}
}
\ No newline at end of file
{"bitrix_domain":"4uz.bitrix24.ru","alovoice_host":"https:\/\/sms.4u.uz\/bx24\/","files_folder":"files\/","asterisk_host":"127.0.0.1","asterisk_scheme":"tcp:\/\/","asterisk_port":"5038","asterisk_username":"alvBX24Bitrix","asterisk_secret":"alv0c3BX24#B1trix","connect_timeout":100,"read_timeout":1000,"basedir":"\/var\/www\/html\/bx24","asterisk_user":"alvBX24Bitrix","asterisk_pass":"alv0c3BX24#B1trix","unumbers_from":"3001","unumbers_to":"3099","sipaddress_local":"192.168.123.6","sipport_local":"5060","sipaddress_out":"alovoice.4u.uz","sipport_out":"5060","showcallcard":"true","autocreatelead":"true","miscallagentid":"1","miscallagentname":"TECHNO UNIT","add_to_chat":"true"}
\ No newline at end of file
<?php date_default_timezone_set('Asia/Tashkent');
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitf58fdfe0aa16c06fb8c15e615f0e7753::getLoader();
This diff is collapsed.
<?php // autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'AloVoice\\' => array($vendorDir . '/alovoice/src'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
'PAMI\\' => array($vendorDir . '/marcelog/pami/src/PAMI'),
'TGA\\' => array($vendorDir . '/tg/src')
);
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitf58fdfe0aa16c06fb8c15e615f0e7753
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitf58fdfe0aa16c06fb8c15e615f0e7753', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitf58fdfe0aa16c06fb8c15e615f0e7753', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitf58fdfe0aa16c06fb8c15e615f0e7753::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
return $loader;
}
}
This diff is collapsed.
This diff is collapsed.
{
"name": "marcelog/pami",
"type": "library",
"description": "Asterisk Manager Interface (AMI) client for PHP, event driven, object oriented",
"keywords": ["asterisk","ami","client","telephony","voip","event","action","manager","monitor"],
"homepage": "http://marcelog.github.com/PAMI",
"license": "Apache2",
"authors": [
{
"name": "Marcelo Gornstein",
"email": "marcelog@gmail.com",
"homepage": "http://marcelog.github.com/",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"PAMI\\": "src/PAMI"
}
},
"require": {
"php": ">=5.3.3",
"psr/log": ">= 1.0.0"
},
"require-dev": {
"phpunit/phpunit": "4.*",
"monolog/monolog": "1.*",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/phpdocumentor": "2.*",
"phing/phing": "2.*",
"phpmd/phpmd": "2.*",
"satooshi/php-coveralls": "1.0.1",
"evert/phpdoc-md" : "~0.1.1",
"codeclimate/php-test-reporter": "dev-master",
"sebastian/phpcpd": "*",
"marcelog/PAGI": "2.*"
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File mode changed from 100755 to 100644
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment