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
312ab74a
Commit
312ab74a
authored
Mar 23, 2023
by
Kulya
😊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix versions-1
parent
8e6d7866
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
37 deletions
+94
-37
settings.php
template/settings.php
+8
-1
AloVoiceActions.php
vendor/alovoice/src/AloVoiceActions.php
+43
-12
AloVoiceConnector.php
vendor/alovoice/src/AloVoiceConnector.php
+7
-1
AloVoiceHandle.php
vendor/alovoice/src/AloVoiceHandle.php
+35
-23
version
vendor/alovoice/src/version
+1
-0
No files found.
template/settings.php
View file @
312ab74a
...
...
@@ -111,12 +111,19 @@
</div>
</div>
<div
class=
"flex-row py-2"
>
<label
for=
"changeassignedid"
class=
"col-4 col-form-label text-right p-r-10"
>
Менять ответственного если общался не текущий ответственный?
</label>
<div
class=
"col-auto"
>
<div
class=
"form-check form-switch"
>
<input
class=
"form-check-input"
type=
"checkbox"
role=
"switch"
id=
"changeassignedid"
checked
>
</div>
</div>
</div>
<div
class=
"flex-row py-2"
>
<label
for=
"showcallcard"
class=
"col-4 col-form-label text-right p-r-10"
>
Запускать окно обработки звонка?
</label>
<div
class=
"col-auto"
>
<div
class=
"form-check form-switch"
>
<input
class=
"form-check-input"
type=
"checkbox"
role=
"switch"
id=
"showcallcard"
checked
>
<!--label class="form-check-label" for="showcallcard">Вкл</label-->
</div>
</div>
</div>
...
...
vendor/alovoice/src/AloVoiceActions.php
View file @
312ab74a
...
...
@@ -332,7 +332,7 @@ class AloVoiceActions
$arLocalChannels
=
array
();
$arChans
[
"queue_incoms"
]
=
[];
$arChans
[
"Incom"
]
=
[];
// Outlines
foreach
(
$CoreShowChannelsEvents
as
$schan
){
if
(
!
empty
(
$schan
)){
$cKeys
=
$schan
->
getKeys
();
...
...
@@ -356,7 +356,8 @@ class AloVoiceActions
$queue_ins
[
$mtchnum
[
1
]]
=
$cKeys
[
"exten"
];
}
elseif
(
(
!
empty
(
$cKeys
[
"application"
]))
&&
(
$cKeys
[
"application"
]
==
"Queue"
)
&&
(
!
empty
(
$cKeys
[
"exten"
]))
){
$arChans
[
"Incom"
][
$cKeys
[
"exten"
]]
=
$cKeys
;
$extNumber
=
(
!
empty
(
$cKeys
[
"connectedlinenum"
])
&&
is_numeric
(
$cKeys
[
"connectedlinenum"
]))
?
$cKeys
[
"connectedlinenum"
]
:
$cKeys
[
"exten"
];
$arChans
[
"Incom"
][
$extNumber
]
=
$cKeys
;
}
elseif
(
(
!
empty
(
$cKeys
[
"application"
]))
&&
(
$cKeys
[
"application"
]
==
"BackGround"
)
&&
(
!
empty
(
$cKeys
[
"exten"
]))
){
$arChans
[
"other_plays"
][]
=
$cKeys
;
...
...
@@ -371,6 +372,17 @@ class AloVoiceActions
$arChans
[
"other_plays"
][]
=
$cKeys
;
}
}
elseif
(
!
empty
(
$cKeys
[
"applicationdata"
])
&&
$cKeys
[
"applicationdata"
]
==
"(Outgoing Line)"
&&
$cKeys
[
"context"
]
==
"from-internal"
){
if
(
!
empty
(
$cKeys
[
"exten"
])
&&
$cKeys
[
"linkedid"
]
==
$cKeys
[
"uniqueid"
]){
$arChans
[
"Outlines"
][
$cKeys
[
"calleridnum"
]]
=
$cKeys
;
}
else
{
if
(
empty
(
$arChans
[
"Incom"
][
$cKeys
[
"calleridnum"
]])){
$arChans
[
"Incom"
][
$cKeys
[
"calleridnum"
]]
=
$cKeys
;
}
}
}
}
}
...
...
@@ -414,7 +426,11 @@ class AloVoiceActions
foreach
(
$queue_ins
as
$inum
=>
$qis
){
$arChans
[
"queue_incoms"
][
$qis
]
=
$queue_chans
[
$inum
]
;
$queue_chans
[
$inum
][
"queue_number"
]
=
$qis
;
if
(
empty
(
$arChans
[
"Incom"
][
$inum
])){
$arChans
[
"Incom"
][
$inum
]
=
$queue_chans
[
$inum
]
;
}
}
foreach
(
$arChnls
as
$cKeys
){
...
...
@@ -425,13 +441,27 @@ class AloVoiceActions
$arOnumLine
=
(
!
empty
(
$arOnLine
[
2
]))
?
explode
(
","
,
$arOnLine
[
2
])
:
[
''
];
$cKeys
[
"outnum"
]
=
$arOnumLine
[
0
];
if
(
(
!
empty
(
$cKeys
[
"applicationdata"
]))
&&
(
$cKeys
[
"applicationdata"
]
==
"(Outgoing Line)"
)
&&
(
$cKeys
[
"context"
]
==
"from-internal"
)){
if
(
!
empty
(
$cKeys
[
"exten"
])){
$arChans
[
"Outlines"
][
$cKeys
[
"calleridnum"
]]
=
$cKeys
;
}
else
{
$arChans
[
"Incom"
][
$cKeys
[
"calleridnum"
]]
=
$cKeys
;
}
$arChans
[
"InOutTest"
][
$cKeys
[
"calleridnum"
]]
=
$cKeys
;
// if( !empty($cKeys["applicationdata"]) && $cKeys["applicationdata"]=="(Outgoing Line)" && $cKeys["context"]=="from-internal"){
// if(!empty($cKeys["exten"]) && $cKeys["linkedid"]==$cKeys["uniqueid"]){
// $arChans["Outlines"][$cKeys["calleridnum"]] = $cKeys;
// }
// else {
// if(empty($arChans["Incom"][$cKeys["calleridnum"]])){
// $arChans["Incom"][$cKeys["calleridnum"]] = $cKeys;
// }
// }
// }
// else
if
(
!
empty
(
$arChans
[
"Incom"
][
$cKeys
[
"connectedlinenum"
]])){
$origChanState
=
$arChans
[
"Incom"
][
$cKeys
[
"connectedlinenum"
]][
"channelstate"
];
$origDuration
=
$arChans
[
"Incom"
][
$cKeys
[
"connectedlinenum"
]][
"duration"
];
$arChans
[
"Incom"
][
$cKeys
[
"connectedlinenum"
]]
=
$cKeys
;
$arChans
[
"Incom"
][
$cKeys
[
"connectedlinenum"
]][
"channelstate"
]
=
$origChanState
;
$arChans
[
"Incom"
][
$cKeys
[
"connectedlinenum"
]][
"duration"
]
=
$origDuration
;
}
if
(
(
!
empty
(
$cKeys
[
"context"
]))
&&
(
$cKeys
[
"context"
]
==
"macro-dialout-trunk"
||
$cKeys
[
"context"
]
==
"macro-dial-one"
)
){
...
...
@@ -561,14 +591,14 @@ class AloVoiceActions
}
if
(
!
empty
(
$arChans
[
"Incom"
][
$arPeer
[
"cid_num"
]])
&&
$arChans
[
"Incom"
][
$arPeer
[
"cid_num"
]][
'channelstate'
]
==
'4'
){
if
(
!
empty
(
$arChans
[
"Incom"
][
$arPeer
[
"cid_num"
]])
&&
(
$arChans
[
"Incom"
][
$arPeer
[
"cid_num"
]][
'channelstate'
]
==
'4'
||
$arChans
[
"Incom"
][
$arPeer
[
"cid_num"
]][
'channelstate'
]
==
'5'
)
){
$agStatus
=
'incring'
;
}
if
(
!
empty
(
$arChans
[
"Incom"
][
$arPeer
[
"cid_num"
]])
&&
$arChans
[
"Incom"
][
$arPeer
[
"cid_num"
]][
'channelstate'
]
==
'6'
){
$agStatus
=
'inccall'
;
}
if
(
!
empty
(
$arChans
[
"Out"
][
$arPeer
[
"cid_num"
]])
&&
$arChans
[
"Out"
][
$arPeer
[
"cid_num"
]][
'channelstate'
]
==
'4'
){
if
(
!
empty
(
$arChans
[
"Out"
][
$arPeer
[
"cid_num"
]])
&&
(
$arChans
[
"Out"
][
$arPeer
[
"cid_num"
]][
'channelstate'
]
==
'4'
||
$arChans
[
"Out"
][
$arPeer
[
"cid_num"
]][
'channelstate'
]
==
'5'
)
){
$agStatus
=
'outring'
;
}
if
(
!
empty
(
$arChans
[
"Out"
][
$arPeer
[
"cid_num"
]])
&&
$arChans
[
"Out"
][
$arPeer
[
"cid_num"
]][
'channelstate'
]
==
'6'
){
...
...
@@ -622,6 +652,7 @@ class AloVoiceActions
// 'headers' => $arHeaders,
'agents'
=>
$arPeers
,
'channels'
=>
$arChans
,
'chtst'
=>
$arChnls
,
'queues'
=>
$arQueues
,
'src'
=>
$serializedPeers
,
'auth_test'
=>
sess
(
"BX_AUTH_ID"
),
...
...
vendor/alovoice/src/AloVoiceConnector.php
View file @
312ab74a
...
...
@@ -42,6 +42,12 @@ class AloVoiceConnector
];
}
public
function
getVersion
(){
$verTxt
=
file_get_contents
(
'version'
);
return
(
!
empty
(
$verTxt
))
?
$verTxt
:
'2.721'
;
}
public
function
isDevelopServer
(){
return
(
$_SERVER
[
"HTTP_HOST"
]
==
"tug.alovoice.uz"
);
}
...
...
@@ -2373,7 +2379,7 @@ CFU=';
}
if
(
empty
(
$outBxCallId
)){
if
(
strlen
(
$queryData
[
"PHONE_NUMBER"
])
==
9
){
if
(
!
empty
(
$queryData
[
"PHONE_NUMBER"
])
&&
strlen
(
$queryData
[
"PHONE_NUMBER"
])
==
9
){
$queryData
[
"PHONE_NUMBER"
]
=
"+998"
.
$queryData
[
"PHONE_NUMBER"
];
}
$bxRes
=
BxRest
::
call
(
"telephony.externalcall.register"
,
$queryData
);
...
...
vendor/alovoice/src/AloVoiceHandle.php
View file @
312ab74a
...
...
@@ -539,6 +539,8 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
$callRegisterParams
[
"CRM_CREATE"
]
=
0
;
//TODO Delete after test
self
::
eLog
(
$callRegisterParams
,
"--== DialBegin check callRegisterParams: "
,
true
);
$searchNumber
=
ALVC
::
nn
(
$callRegisterParams
[
"PHONE_NUMBER"
]);
$searchNumberLittle
=
substr
(
$searchNumber
,
-
9
);
...
...
@@ -666,6 +668,8 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
}
elseif
(
(
$eventName
==
"Newstate"
)
&&
(
(
$eventKeys
[
"exten"
]
!=
"*78"
)
||
(
$eventKeys
[
"exten"
]
!=
"*76"
)
||
(
$eventKeys
[
"exten"
]
!=
"*79"
))
&&
(
$eventKeys
[
"channelstate"
]
==
"6"
)
&&
(
$eventKeys
[
"priority"
]
==
"1"
)
)
{
// && ($eventKeys["calleridnum"] == $eventKeys["exten"]) && ($eventKeys["exten"] != "ACALLER")
self
::
eLog
(
$eventKeys
,
"--== NewSTATE UP Keys:"
,
true
);
$changeassignedid
=
$this
->
config
[
"changeassignedid"
];
$isChangeassignedid
=
(
!
empty
(
$changeassignedid
)
&&
(
$changeassignedid
===
"true"
||
$changeassignedid
===
true
));
$regParams
=
(
!
empty
(
$bxchannels
[
$eventKeys
[
"linkedid"
]][
"BX24_REGISTER_PARAMS"
]))
?
$bxchannels
[
$eventKeys
[
"linkedid"
]][
"BX24_REGISTER_PARAMS"
]
:
[];
...
...
@@ -674,10 +678,13 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
if
(
!
empty
(
$this
->
bxusers
[
$eventKeys
[
"exten"
]])){
$upUserID
=
$this
->
bxusers
[
$eventKeys
[
"exten"
]][
"ID"
];
if
(
!
empty
(
$regParams
[
$eventKeys
[
"exten"
]][
"CRM_ENTITY_ID"
])){
$crmEntType
=
strtolower
(
$regParams
[
$eventKeys
[
"exten"
]][
"CRM_ENTITY_TYPE"
]);
$crmEntId
=
$regParams
[
$eventKeys
[
"exten"
]][
"CRM_ENTITY_ID"
];
//ASSIGNED_BY_ID
//crm.lead.update
if
(
$isChangeassignedid
){
$crmEntity
=
'crm.'
.
$crmEntType
.
'.update'
;
$crmUpdateParams
=
array
(
'id'
=>
$crmEntId
,
...
...
@@ -694,6 +701,7 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
}
}
}
}
elseif
(
!
empty
(
$eventKeys
[
"channelstate"
])
&&
$eventName
==
"DialEnd"
&&
$eventKeys
[
"channelstate"
]
==
"6"
&&
$eventKeys
[
"dialstatus"
]
==
"ANSWER"
)
{
//arr:{"event":"DialEnd","privilege":"call,all","channel":"Dongle\/dongle3-0100000006","channelstate":"6","channelstatedesc":"Up","calleridnum":"+998994412860","calleridname":"dongle3","connectedlinenum":"<unknown>","connectedlinename":"<unknown>","language":"ru","accountcode":"","context":"ext-queues","exten":"10","priority":"40","uniqueid":"1579771666.108","linkedid":"1579771666.108","destchannel":"Local\/1004@from-queue-00000030;1","destchannelstate":"6","destchannelstatedesc":"Up","destcalleridnum":"+998994008840","destcalleridname":"<unknown>","destconnectedlinenum":"+998994412860","destconnectedlinename":"dongle3","destlanguage":"ru","destaccountcode":"","destcontext":"from-queue","destexten":"10","destpriority":"1","destuniqueid":"1579771667.121","destlinkedid":"1579771666.108","dialstatus":"ANSWER"}
...
...
@@ -775,6 +783,8 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
self
::
eLog
(
$eventKeys
,
"--== eventKeys on "
.
$eventName
,
true
);
self
::
eLog
(
$this
->
bxusers
,
"--================== MAIN CALL CHECk USERS ==============----------------"
,
true
);
self
::
eLog
(
$chVars
,
"--===== MAIN CALL HANGUP VARS: ======------"
,
true
);
$changeassignedid
=
$this
->
config
[
"changeassignedid"
];
$isChangeassignedid
=
(
!
empty
(
$changeassignedid
)
&&
(
$changeassignedid
===
"true"
||
$changeassignedid
===
true
));
if
(
!
empty
(
$chVars
[
"DIALSTATUS"
])
){
$dialstatus
=
$chVars
[
"DIALSTATUS"
];
...
...
@@ -799,9 +809,10 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
}
else
{
$asgUserId
=
$this
->
config
[
"miscallagentid"
];
}
}
if
(
$isChangeassignedid
){
$crmUpdateParams
=
array
(
'id'
=>
$crmEntId
,
'fields'
=>
array
(
...
...
@@ -811,6 +822,7 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
$updResult
=
BxRest
::
call
(
$crmEntity
,
$crmUpdateParams
);
self
::
eLog
(
$updResult
,
"--===== MAIN CALL HANGUP LEAD updResult: ======------"
,
true
);
}
}
break
;
}
...
...
@@ -915,7 +927,7 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
if
(
!
empty
(
$chVars
[
"BX24_CALLERID"
])
&&
!
empty
(
$chVars
[
"BX24_DIRECTION"
])
&&
$chVars
[
"BX24_DIRECTION"
]
==
"OUTCALL"
){
$innerPhone
=
$chVars
[
"BX24_CALLERID"
];
}
if
(
empty
(
$innerPhone
)
&&
$chVars
[
"context"
]
==
"from-internal"
&&
!
empty
(
$chVars
[
"calleridnum"
])){
if
(
empty
(
$innerPhone
)
&&
!
empty
(
$chVars
[
"context"
])
&&
$chVars
[
"context"
]
==
"from-internal"
&&
!
empty
(
$chVars
[
"calleridnum"
])
&&
is_numeric
(
$chVars
[
"calleridnum"
])){
$innerPhone
=
$chVars
[
"calleridnum"
];
}
$regParams
=
array
(
...
...
vendor/alovoice/src/version
0 → 100644
View file @
312ab74a
2.716
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