Commit 5045e797 authored by Kulya's avatar Kulya 😊

Add show and copy inner number function

parent fd319175
[Unit]
Description=AloVoice Service
Requires=mysqld.service memcached.service
After=mysqld.service memcached.service
[Service]
User=root
Type=simple
TimeoutSec=0
PIDFile=/var/run/amibx.pid
ExecStart=/usr/bin/php -f /var/www/html/bx24/listener.php test> /dev/null 2>/dev/null
ExecStop=/bin/kill -HUP $MAINPID #It's the default you can change whats happens on stop command
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartSec=42s
StandardOutput=null #If you don't want to make toms of logs you can set it null if you sent a file or some other options it will send all php output to this one.
StandardError=/var/log/myphpdaemon.log
[Install]
WantedBy=default.target
<?php if(!empty($arResult["header"])) { ?>
<!-- <h1><?php echo $arResult["header"]; ?></h1> -->
<h1 class="text-center pt-2">
<h1 class="text-center pt-2" title="<?php echo $arResult['password'];?>" onclick="showMyPassword('<?php echo $arResult['password'];?>');" style="cursor:pointer;">
<?php echo "Ваш внутренний номер телефонии: ".$arResult['number'].""; ?>
</h1>
<?php } ?>
<?php
// var_dump($arResult);
if( !empty($arResult["link"]) ){
?>
<div class="pt-3">
......@@ -54,4 +55,17 @@ elseif( !empty($arResult["body"]) ){
// Это если ошибка
echo $arResult["body"];
}
?>
\ No newline at end of file
?>
<script>
function showMyPassword(pass){
copyToClipboardText(pass);
aloModal({
label: "Пароль для номера",
body: "<code>"+pass+"</code>",
btn: "Скопировать",
callback: function(){
console.log("Check copy pass:",pass);
}
});
}
</script>
\ No newline at end of file
......@@ -102,6 +102,23 @@ function doAloVoiceCmd(cmd,data,cbk){
function formatBytes(a,b=2,k=1024){with(Math){let d=floor(log(a)/log(k));return 0==a?"0 Bytes":parseFloat((a/pow(k,d)).toFixed(max(0,b)))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][d]}}
function copyToClipboardText(ctext) {
console.log("Check copy:",ctext);
var $temp = $("<input>");
$("body").append($temp);
$temp.val(ctext).select();
document.execCommand("copy");
$temp.remove();
}
function copyToClipboard(element) {
var $temp = $("<input>");
$("body").append($temp);
$temp.val($(element).text()).select();
document.execCommand("copy");
$temp.remove();
}
function aloModal(params){
/*
label
......
......@@ -187,7 +187,8 @@ class AloVoiceActions
$doCmds = $this->runAsteriskAction([
'dnds' => new \PAMI\Message\Action\CommandAction('database show DND'),
'peers' => new \PAMI\Message\Action\CommandAction('data get /asterisk/channel/sip/peers 1=1 peers/peer/cid_num,peers/peer/useragent,peers/peer/secret,peers/peer/lastms,peers/peer/fullcontact'),
'peers' => new \PAMI\Message\Action\CommandAction('data get /asterisk/channel/sip/peers 1=1 peers/peer/cid_num,peers/peer/useragent,peers/peer/secret,peers/peer/lastms,peers/peer/fullcontact,peers/peer/lastms,peers/peer/lastms'),
// 'peers' => new \PAMI\Message\Action\CommandAction('data get /asterisk/channel/sip/peers'),
'channels' => new \PAMI\Message\Action\CoreShowChannelsAction(),
'queues' => new \PAMI\Message\Action\QueueStatusAction(),
]);
......@@ -437,9 +438,9 @@ class AloVoiceActions
if(!empty($bxPhoneUsers[$arPeer["cid_num"]])){
$u = $bxPhoneUsers[$arPeer["cid_num"]];
$userFullname = $u["NAME"].' '.$u["LAST_NAME"];
$userLink = 'https://4uz.bitrix24.ru/company/personal/user/'.$u["ID"].'/';
$userLink = 'https://'.$this->configs["bitrix_domain"].'/company/personal/user/'.$u["ID"].'/';
// $userLine = '<a href="https://4uz.bitrix24.ru/company/personal/user/'.$u["ID"].'/" target="_blank">'.$u["NAME"].' '.$u["LAST_NAME"].'</a>';
$userLine = '<a href="https://4uz.bitrix24.ru/company/personal/user/'.$u["ID"].'/" target="_blank">'.$u["NAME"].' '.$u["LAST_NAME"].' ('.$arPeer["cid_num"].')</a>';
$userLine = '<a href="https://'.$this->configs["bitrix_domain"].'/company/personal/user/'.$u["ID"].'/" target="_blank">'.$u["NAME"].' '.$u["LAST_NAME"].' ('.$arPeer["cid_num"].')</a>';
$userId = $u["ID"];
}
/*
......@@ -635,7 +636,7 @@ class AloVoiceActions
$userLine = '';
if(!empty($bxPhoneUsers[$arPeer["cid_num"]])){
$u = $bxPhoneUsers[$arPeer["cid_num"]];
$userLine = '<a href="https://4uz.bitrix24.ru/company/personal/user/'.$u["ID"].'/" target="_blank">'.$u["NAME"].' '.$u["LAST_NAME"].' ('.$arPeer["cid_num"].')</a>';
$userLine = '<a href="https://'.$this->configs["bitrix_domain"].'/company/personal/user/'.$u["ID"].'/" target="_blank">'.$u["NAME"].' '.$u["LAST_NAME"].' ('.$arPeer["cid_num"].')</a>';
}
if(empty($arPeer["cid_num"]) || strlen($arPeer["cid_num"])>4){
......
......@@ -1186,7 +1186,7 @@ class AloVoiceConnector
$arAlvSections["callscripts"] = array( "name" => "Скрипты звонков", "perms" => "admin");
$arAlvSections["crmsettings"] = array( "name" => "CRM Настройки", "perms" => "admin");
$arAlvSections["billzsettings"] = array( "name" => "Billz Настройки", "perms" => "admin");
// $arAlvSections["tgsettings"] = array( "name" => "Телеграм", "perms" => "admin");
$arAlvSections["tgsettings"] = array( "name" => "Телеграм", "perms" => "admin");
$arAlvSections["integrations"] = array( "name" => "Интеграции", "perms" => "admin");
// $arAlvSections["tests"] = array( "name" => "Тест", "perms" => "admin");
}
......@@ -1473,13 +1473,14 @@ class AloVoiceConnector
$arResult = ['page'=>'user_profile_menu'];
$arResult['header'] = 'Программа для звонков в Windows';
$arResult['body'] = '';
// var_dump($arSoftphone);
if(!empty($arSoftphone["link"])){
if($num=="2424"){
// var_dump($arSoftphone);
}
$arResult['link'] = $arSoftphone["link"];
$arResult['qrpng'] = $arSoftphone["qrpng"];
$arResult['password'] = $arSoftphone["password"];
$arResult['number'] = $num;
}
else{
......@@ -1622,7 +1623,7 @@ class AloVoiceConnector
$qrPng = self::make_qraccount($configs,$out_ip.":".$out_port,$num,$passPeer);
if(file_exists($softfoneUserExe)){
return ["link"=>$newUseSoftfoneLink,"qrpng"=>$qrPng,];
return ["link"=>$newUseSoftfoneLink,"qrpng"=>$qrPng,"password"=>$passPeer];
}
$newUserSftSipperFile = $newUseSoftfoneDir.'sipper.ini';
......@@ -1639,10 +1640,10 @@ class AloVoiceConnector
$exeChPrRes = exec($sampleSoftfoneExeMaker.' '.$softfoneUserExe.' '.$newUserSftProviderFile);
$res = [$title,$ip,$bxaddr,$port,$num,$passPeer,$newUseSoftfoneDir,$sipperPutRes,$providerPutRes,"qrpng"=>$qrPng,"exeChRes"=>$exeChRes,"exeChPrRes"=>$exeChPrRes,"link"=>$newUseSoftfoneLink];
$res = [$title,$ip,$bxaddr,$port,$num,$passPeer,$newUseSoftfoneDir,$sipperPutRes,$providerPutRes,"qrpng"=>$qrPng,"exeChRes"=>$exeChRes,"exeChPrRes"=>$exeChPrRes,"link"=>$newUseSoftfoneLink,"password"=>$passPeer];
}
else{
$res = ["result"=>"Directory Ready","dir"=>$sampleSoftfoneExe,"isSample"=>file_exists($sampleSoftfoneExe)];
$res = ["result"=>"Directory Ready","dir"=>$sampleSoftfoneExe,"isSample"=>file_exists($sampleSoftfoneExe),"password"=>$passPeer];
}
......
......@@ -1652,7 +1652,7 @@ function(result){
'title'=>'Событие дел',
'status'=>'off',
)];
$res['nextintegration'] = 'status_alotg';
$res['nextintegration'] = 'status_alosms';
$res['rescheck'] = $arResults;
return $res;
......@@ -1688,26 +1688,26 @@ function(result){
// }
// private function status_alosms($r=false) {
// $integrations = [];
// $arResults = BxRest::call('messageservice.sender.list');
// if(!empty($arResults["result"]) && in_array("alosms",$arResults["result"])){
// $integrations[] = array(
// 'code'=>'smsservice',
// 'title'=>'SMS сервис (alosms)',
// 'status'=>'on',
// );
// }
// $res['lines'] = (!empty($integrations)) ? $integrations : [array(
// 'code'=>'smsservice',
// 'title'=>'SMS сервис',
// 'status'=>'off',
// )];
// $res['nextintegration'] = 'status_alotg';
// $res['rescheck'] = $arResults;
private function status_alosms($r=false) {
$integrations = [];
$arResults = BxRest::call('messageservice.sender.list');
if(!empty($arResults["result"]) && in_array("alosms",$arResults["result"])){
$integrations[] = array(
'code'=>'smsservice',
'title'=>'SMS сервис (alosms)',
'status'=>'on',
);
}
$res['lines'] = (!empty($integrations)) ? $integrations : [array(
'code'=>'smsservice',
'title'=>'SMS сервис',
'status'=>'off',
)];
$res['nextintegration'] = 'status_alotg';
$res['rescheck'] = $arResults;
// return $res;
// }
return $res;
}
// private function status_aloetc($r=false) {
// $integrations = [];
// $arResults = BxRest::call('messageservice.sender.list');
......
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