Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AmiBX
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bitrix
AmiBX
Commits
8e88d715
Commit
8e88d715
authored
Apr 11, 2022
by
Kulya
😊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Обновлен метод выыода настроек своего номера
parent
ae1e736f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
38 deletions
+49
-38
AloVoiceConnector.php
vendor/alovoice/src/AloVoiceConnector.php
+8
-32
AloVoiceHandle.php
vendor/alovoice/src/AloVoiceHandle.php
+30
-3
BitrixEvents.php
vendor/alovoice/src/BitrixEvents.php
+7
-2
SIPNotifyAction.php
...marcelog/pami/src/PAMI/Message/Action/SIPNotifyAction.php
+4
-1
No files found.
vendor/alovoice/src/AloVoiceConnector.php
View file @
8e88d715
...
@@ -1447,46 +1447,22 @@ class AloVoiceConnector
...
@@ -1447,46 +1447,22 @@ class AloVoiceConnector
public
function
doUserProfileMenu
(){
public
function
doUserProfileMenu
(){
if
(
empty
(
$_REQUEST
[
"PLACEMENT_OPTIONS"
])){
$gotUser
=
BxRest
::
call
(
"user.current"
);
return
[
'page'
=>
'user_profile_menu'
,
"body"
=>
"Нет параметров"
];
}
$arOpts
=
json_decode
(
$_REQUEST
[
"PLACEMENT_OPTIONS"
],
true
);
// if(empty($arOpts) || empty($arOpts["USER_ID"])){
// return ['page'=>'user_profile_menu',"body"=>"Сотрудник или номер не найден"];
// }
// return ['page'=>'user_profile_menu',"body"=>$arOpts["USER_ID"]];
if
(
empty
(
$gotUser
[
"result"
])){
if
(
!
empty
(
$arOpts
[
"USER_ID"
])){
return
[
'page'
=>
'user_profile_menu'
,
"body"
=>
"Сотрудник или номер не найден!"
];
$gotUser
=
BxRest
::
call
(
'user.get'
,[
'ID'
=>
$arOpts
[
"USER_ID"
]
]);
if
(
!
empty
(
$gotUser
[
"result"
])){
$arUser
=
$gotUser
[
"result"
][
0
];
}
}
if
(
empty
(
$arUser
)){
$gotUser
=
BxRest
::
call
(
"user.current"
);
if
(
!
empty
(
$gotUser
[
"result"
])){
$arUser
=
$gotUser
[
"result"
];
}
}
}
$arUser
=
$gotUser
[
"result"
];
if
(
empty
(
$arUser
)){
return
[
'page'
=>
'user_profile_menu'
,
"body"
=>
"Сотрудник или номер не найден"
];
}
if
(
empty
(
$arUser
[
"UF_PHONE_INNER"
])){
if
(
empty
(
$arUser
[
"UF_PHONE_INNER"
])){
return
[
'page'
=>
'user_profile_menu'
,
"body"
=>
"Нету номера"
];
return
[
'page'
=>
'user_profile_menu'
,
"body"
=>
"Нету номера"
];
}
}
$num
=
$arUser
[
"UF_PHONE_INNER"
];
$num
=
$arUser
[
"UF_PHONE_INNER"
];
// if($num=="2424"){
$arSoftphone
=
self
::
getUserSoftphoneExe
(
$num
);
// $num = "3031";
// }
if
(
$num
==
"2424"
){
$arSoftphone
=
self
::
getUserSoftphoneExe
(
$num
);
}
else
{
$arSoftphone
=
self
::
getUserSoftphoneExe
(
$num
);
// $arSoftphone = self::getUserSoftphone($num);
}
$arResult
=
[
'page'
=>
'user_profile_menu'
];
$arResult
=
[
'page'
=>
'user_profile_menu'
];
$arResult
[
'header'
]
=
'Программа для звонков в Windows'
;
$arResult
[
'header'
]
=
'Программа для звонков в Windows'
;
...
@@ -2592,7 +2568,7 @@ CFU=';
...
@@ -2592,7 +2568,7 @@ CFU=';
));
));
$this
->
_client
->
open
();
$this
->
_client
->
open
();
$listener
=
new
AloVoiceHandle
(
$this
->
configs
,
$bxonusers
);
$listener
=
new
AloVoiceHandle
(
$this
->
_client
,
$this
->
configs
,
$bxonusers
);
$this
->
_client
->
registerEventListener
(
array
(
$listener
,
'handle'
));
$this
->
_client
->
registerEventListener
(
array
(
$listener
,
'handle'
));
//$this->_client->registerEventListener(function ($event) { });
//$this->_client->registerEventListener(function ($event) { });
...
...
vendor/alovoice/src/AloVoiceHandle.php
View file @
8e88d715
...
@@ -14,7 +14,8 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
...
@@ -14,7 +14,8 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
public
static
$event
;
public
static
$event
;
public
static
$configs
;
public
static
$configs
;
public
function
__construct
(
$configs
=
[],
$bxusers
=
[])
{
public
function
__construct
(
\PAMI\Client\Impl\ClientImpl
$client
,
$configs
=
[],
$bxusers
=
[])
{
$this
->
client
=
$client
;
$this
->
config
=
$configs
;
$this
->
config
=
$configs
;
$this
->
bxusers
=
$bxusers
;
$this
->
bxusers
=
$bxusers
;
$this
->
bxuserstime
=
time
();
$this
->
bxuserstime
=
time
();
...
@@ -49,12 +50,12 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
...
@@ -49,12 +50,12 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
$this
->
bxusers
=
ALVC
::
getUsersList
(
false
,
true
);
$this
->
bxusers
=
ALVC
::
getUsersList
(
false
,
true
);
$this
->
bxuserstime
=
time
();
$this
->
bxuserstime
=
time
();
}
}
//self::eLog($bxchannels,"--== NOW bxchannels:");
//self::eLog($bxchannels,"--== NOW bxchannels:");
$eventName
=
$event
->
getName
();
$eventName
=
$event
->
getName
();
$eventKeys
=
$event
->
getKeys
();
$eventKeys
=
$event
->
getKeys
();
//
self::eLog($eventKeys,"--== eventKeys on ".$eventName, true);
self
::
eLog
(
$eventKeys
,
"--== eventKeys on "
.
$eventName
,
true
);
//Пришел новый звонок
//Пришел новый звонок
if
(
$eventName
==
"DongleNewSMS"
)
{
if
(
$eventName
==
"DongleNewSMS"
)
{
...
@@ -73,6 +74,32 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
...
@@ -73,6 +74,32 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
file_put_contents
(
$fPath
,
"Time:"
.
$nowtime
.
' '
.
$msgTxt
);
file_put_contents
(
$fPath
,
"Time:"
.
$nowtime
.
' '
.
$msgTxt
);
}
}
elseif
(
$eventName
==
"DeviceStateChange"
)
{
list
(
$proto
,
$peer
)
=
explode
(
"/"
,
$eventKeys
[
"device"
]);
if
(
empty
(
$peer
)){
$peer
=
preg_replace
(
"/[^0-9]/"
,
''
,
$eventKeys
[
"device"
]);
}
self
::
eLog
([
$proto
,
$peer
],
"--== Event ProtoPeer:"
,
true
);
// self::eLog($event->getState(),"--== Event getStatus:", true);
if
(
!
empty
(
$peer
)){
$this
->
client
->
send
(
new
\PAMI\Message\Action\SIPNotifyAction
(
$peer
,
"STATE="
.
$eventKeys
[
"state"
]));
}
}
elseif
(
$eventName
==
"ExtensionStatus"
)
{
// self::eLog($eventKeys,"--== eventKeys on ".$eventName, true);
$exten
=
$event
->
getExtension
();
self
::
eLog
(
$event
->
getExtension
(),
"--== Event Extension:"
,
true
);
self
::
eLog
(
$event
->
getStatus
(),
"--== Event getStatus:"
,
true
);
$this
->
client
->
send
(
new
\PAMI\Message\Action\SIPNotifyAction
(
$exten
,
"STATUS="
.
$event
->
getStatus
()));
}
elseif
(
$eventName
==
"DongleNewCMGR"
)
{
elseif
(
$eventName
==
"DongleNewCMGR"
)
{
$entTypes
=
array
(
$entTypes
=
array
(
"LEAD"
=>
1
,
"LEAD"
=>
1
,
...
...
vendor/alovoice/src/BitrixEvents.php
View file @
8e88d715
...
@@ -1350,11 +1350,16 @@ class BitrixEvents
...
@@ -1350,11 +1350,16 @@ class BitrixEvents
if
(
!
empty
(
$arLead
[
"OPPORTUNITY"
])){
//&& empty($arLead["UF_CRM_1619575012878"])
if
(
!
empty
(
$arLead
[
"OPPORTUNITY"
])){
//&& empty($arLead["UF_CRM_1619575012878"])
$oprtnty
=
round
(
$arLead
[
"OPPORTUNITY"
]);
$oprtnty
=
round
(
$arLead
[
"OPPORTUNITY"
]);
$oprtntyTxt
=
ALVC
::
num2str
(
$oprtnty
);
$oprtntyTxt
=
ALVC
::
num2str
(
$oprtnty
);
$resDealSave
=
BxRest
::
call
(
'crm.lead.update'
,
array
(
"id"
=>
$leadID
,
"fields"
=>
[
"UF_CRM_1619575012878"
=>
$oprtntyTxt
])
);
if
(
$arLead
[
"UF_CRM_1619575012878"
]
!=
$oprtntyTxt
){
$resDealSave
=
BxRest
::
call
(
'crm.lead.update'
,
array
(
"id"
=>
$leadID
,
"fields"
=>
[
"UF_CRM_1619575012878"
=>
$oprtntyTxt
])
);
ALVC
::
eLog
(
$resDealSave
,
"------ Events.php :: lead Update Oport TXT: "
.
$oprtntyTxt
);
}
ALVC
::
eLog
(
$resDealSave
,
"------ Events.php :: lead Update Oport TXT: "
.
$oprtntyTxt
);
}
}
if
(
empty
(
$arLead
[
"OPPORTUNITY"
])
&&
!
empty
(
$arLead
[
"UF_CRM_1619575012878"
])){
if
(
empty
(
$arLead
[
"OPPORTUNITY"
])
&&
!
empty
(
$arLead
[
"UF_CRM_1619575012878"
])){
...
...
vendor/marcelog/pami/src/PAMI/Message/Action/SIPNotifyAction.php
View file @
8e88d715
...
@@ -50,9 +50,12 @@ class SIPNotifyAction extends ActionMessage
...
@@ -50,9 +50,12 @@ class SIPNotifyAction extends ActionMessage
*
*
* @return void
* @return void
*/
*/
public
function
__construct
(
$channel
)
public
function
__construct
(
$channel
,
$info
=
''
)
{
{
parent
::
__construct
(
'SIPnotify'
);
parent
::
__construct
(
'SIPnotify'
);
$this
->
setKey
(
'Channel'
,
$channel
);
$this
->
setKey
(
'Channel'
,
$channel
);
if
(
!
empty
(
$info
)){
$this
->
setKey
(
'Variable'
,
$info
);
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment