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
cae8715d
Commit
cae8715d
authored
Mar 22, 2023
by
Kulya
😊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix StafStatsApp errors
parent
73ad9438
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
40 deletions
+48
-40
AloVoiceActions.php
vendor/alovoice/src/AloVoiceActions.php
+4
-2
AloVoiceAgi.php
vendor/alovoice/src/AloVoiceAgi.php
+6
-0
AloVoiceConnector.php
vendor/alovoice/src/AloVoiceConnector.php
+36
-36
AloVoiceHandle.php
vendor/alovoice/src/AloVoiceHandle.php
+1
-1
autoload.php
vendor/autoload.php
+1
-1
No files found.
vendor/alovoice/src/AloVoiceActions.php
View file @
cae8715d
...
@@ -522,10 +522,12 @@ class AloVoiceActions
...
@@ -522,10 +522,12 @@ class AloVoiceActions
$userId
=
''
;
$userId
=
''
;
if
(
!
empty
(
$bxPhoneUsers
[
$arPeer
[
"cid_num"
]])){
if
(
!
empty
(
$bxPhoneUsers
[
$arPeer
[
"cid_num"
]])){
$u
=
$bxPhoneUsers
[
$arPeer
[
"cid_num"
]];
$u
=
$bxPhoneUsers
[
$arPeer
[
"cid_num"
]];
$userFullname
=
$u
[
"NAME"
]
.
' '
.
$u
[
"LAST_NAME"
];
$uName
=
(
!
empty
(
$u
[
"NAME"
]))
?
$u
[
"NAME"
]
:
''
;
$uLastName
=
(
!
empty
(
$u
[
"LAST_NAME"
]))
?
$u
[
"LAST_NAME"
]
:
''
;
$userFullname
=
$uName
.
' '
.
$uLastName
;
$userLink
=
'https://'
.
$this
->
configs
[
"bitrix_domain"
]
.
'/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"].'</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>'
;
$userLine
=
'<a href="https://'
.
$this
->
configs
[
"bitrix_domain"
]
.
'/company/personal/user/'
.
$u
[
"ID"
]
.
'/" target="_blank">'
.
$u
serFullname
.
' ('
.
$arPeer
[
"cid_num"
]
.
')</a>'
;
$userId
=
$u
[
"ID"
];
$userId
=
$u
[
"ID"
];
}
}
/*
/*
...
...
vendor/alovoice/src/AloVoiceAgi.php
View file @
cae8715d
...
@@ -64,13 +64,19 @@ class AloVoiceAgi
...
@@ -64,13 +64,19 @@ class AloVoiceAgi
// }
// }
if
(
$_SERVER
[
'argv'
][
1
]
==
"aftercall"
){
if
(
$_SERVER
[
'argv'
][
1
]
==
"aftercall"
){
$this
->
aLog
(
"--------------AGi aftercall RET! "
);
return
true
;
return
true
;
}
}
$this
->
AGI
->
answer
();
$this
->
AGI
->
answer
();
$this
->
AGI
->
set_music
(
true
,
'default'
);
$this
->
AGI
->
set_music
(
true
,
'default'
);
$this
->
aLog
(
"--------------AGi after set_music "
);
$respNumber
=
$this
->
getEntityResposibleNumber
(
$callerid
);
$respNumber
=
$this
->
getEntityResposibleNumber
(
$callerid
);
$this
->
aLog
(
"--------------AGi after getEntityResposibleNumber... "
);
$respWaitTime
=
(
!
empty
(
$this
->
config
[
"resposible_wait"
]))
?
$this
->
config
[
"resposible_wait"
]
:
40
;
$respWaitTime
=
(
!
empty
(
$this
->
config
[
"resposible_wait"
]))
?
$this
->
config
[
"resposible_wait"
]
:
40
;
$this
->
aLog
(
""
,
"--------------AGi RESP and WAIT TIME: ("
.
json_encode
(
$respNumber
)
.
") - ["
.
$respWaitTime
.
"]--------"
);
$this
->
aLog
(
""
,
"--------------AGi RESP and WAIT TIME: ("
.
json_encode
(
$respNumber
)
.
") - ["
.
$respWaitTime
.
"]--------"
);
...
...
vendor/alovoice/src/AloVoiceConnector.php
View file @
cae8715d
...
@@ -23,7 +23,7 @@ class AloVoiceConnector
...
@@ -23,7 +23,7 @@ class AloVoiceConnector
public
function
__construct
()
{
public
function
__construct
()
{
$this
->
configFile
=
__DIR__
.
'/config.json'
;
$this
->
configFile
=
__DIR__
.
'/config.json'
;
$this
->
rootdir
=
dirname
(
dirname
(
dirname
(
__DIR__
)))
.
'/'
;
$this
->
rootdir
=
dirname
(
dirname
(
dirname
(
__DIR__
)))
.
'/'
;
$this
->
alvhost
=
(
!
empty
(
$_SERVER
[
"HTTP_HOST"
]))
?
'https://'
.
$_SERVER
[
"HTTP_HOST"
]
.
'/bx24/'
:
'https://t
ug
.alovoice.uz/bx24/'
;
$this
->
alvhost
=
(
!
empty
(
$_SERVER
[
"HTTP_HOST"
]))
?
'https://'
.
$_SERVER
[
"HTTP_HOST"
]
.
'/bx24/'
:
'https://t
el
.alovoice.uz/bx24/'
;
$this
->
settings
=
false
;
$this
->
settings
=
false
;
$this
->
configs
=
$this
->
getConfigs
();
$this
->
configs
=
$this
->
getConfigs
();
$this
->
isAmi
=
false
;
$this
->
isAmi
=
false
;
...
@@ -228,7 +228,7 @@ class AloVoiceConnector
...
@@ -228,7 +228,7 @@ class AloVoiceConnector
$this
->
eLog
(
$_REQUEST
,
"------ AloVoiceConnector: RUN REQUEST----------"
);
$this
->
eLog
(
$_REQUEST
,
"------ AloVoiceConnector: RUN REQUEST----------"
);
$this
->
eLog
(
$_FILES
,
"--== AloVoiceConnector FILES:"
);
$this
->
eLog
(
$_FILES
,
"--== AloVoiceConnector FILES:"
);
$this
->
eLog
(
$_SERVER
,
"------ AloVoiceConnector: RUN SERVER ----------"
);
//
$this->eLog($_SERVER,"------ AloVoiceConnector: RUN SERVER ----------");
if
(
!
empty
(
$_REQUEST
[
'afile'
])){
if
(
!
empty
(
$_REQUEST
[
'afile'
])){
return
$this
->
getWavAudio
(
$_REQUEST
[
'afile'
]);
return
$this
->
getWavAudio
(
$_REQUEST
[
'afile'
]);
...
@@ -2409,23 +2409,23 @@ CFU=';
...
@@ -2409,23 +2409,23 @@ CFU=';
$userID
=
(
!
empty
(
$queryData
[
"USER_ID"
]))
?
$queryData
[
"USER_ID"
]
:
""
;
$userID
=
(
!
empty
(
$queryData
[
"USER_ID"
]))
?
$queryData
[
"USER_ID"
]
:
""
;
if
(
empty
(
$userID
)
&&
!
empty
(
$full
[
"BX24_USERID"
])){
$userID
=
$full
[
"BX24_USERID"
];
}
if
(
empty
(
$userID
)
&&
!
empty
(
$full
[
"BX24_USERID"
])){
$userID
=
$full
[
"BX24_USERID"
];
}
$stRes
=
self
::
statAPI
(
"update"
,[
//
$stRes = self::statAPI("update",[
'where'
=>
[
"ID"
=>
$full
[
"ALV_ECALLID"
]],
//
'where' => ["ID" => $full["ALV_ECALLID"]],
"KEY"
=>
"4Ad49wD"
,
//
"KEY" => "4Ad49wD",
'fields'
=>
[
//
'fields' => [
"DIALSTATUS"
=>
'DIALBEGIN'
,
//
"DIALSTATUS" => 'DIALBEGIN',
"TIME_DIALBEGIN"
=>
time
(),
//
"TIME_DIALBEGIN" => time(),
"BXCALLID"
=>
(
!
empty
(
$bxRes
[
"result"
][
"CALL_ID"
]))
?
$bxRes
[
"result"
][
"CALL_ID"
]
:
""
,
//
"BXCALLID" => (!empty($bxRes["result"]["CALL_ID"])) ? $bxRes["result"]["CALL_ID"] : "",
"CHANNEL"
=>
(
!
empty
(
$full
[
"channel"
]))
?
$full
[
"channel"
]
:
""
,
//
"CHANNEL" => (!empty($full["channel"])) ? $full["channel"] : "",
"USER_ID"
=>
$userID
,
//
"USER_ID" => $userID,
"FROM_NUMBER"
=>
$from_number
,
//
"FROM_NUMBER" => $from_number,
"TO_NUMBER"
=>
$to_number
,
//
"TO_NUMBER" => $to_number,
"LINE_NUMBER"
=>
(
!
empty
(
$queryData
[
"LINE_NUMBER"
]))
?
$queryData
[
"LINE_NUMBER"
]
:
""
,
//
"LINE_NUMBER" => (!empty($queryData["LINE_NUMBER"])) ? $queryData["LINE_NUMBER"] : "",
// "QUEUENUM" => "99999",
//
//
"QUEUENUM" => "99999",
"INNER_PHONE"
=>
$innerphone
,
//
"INNER_PHONE" => $innerphone,
"DIRECTION"
=>
(
!
empty
(
$direction
))
?
$direction
:
"INBOUND"
,
//
"DIRECTION" => (!empty($direction)) ? $direction : "INBOUND",
]
//
]
]);
//
]);
// $stRes = self::statAPI("insert",[
// $stRes = self::statAPI("insert",[
// 'fields' => [
// 'fields' => [
...
@@ -2512,22 +2512,22 @@ CFU=';
...
@@ -2512,22 +2512,22 @@ CFU=';
}
}
}
}
$stRes
=
self
::
statAPI
(
"update"
,[
//
$stRes = self::statAPI("update",[
'where'
=>
[
"ID"
=>
$full
[
"ALV_ECALLID"
]],
//
'where' => ["ID" => $full["ALV_ECALLID"]],
"KEY"
=>
"4Ad49wD"
,
//
"KEY" => "4Ad49wD",
'fields'
=>
[
//
'fields' => [
"FULLINFO"
=>
json_encode
(
$full
),
//
"FULLINFO" => json_encode($full),
"QUEUENUM"
=>
(
!
empty
(
$full
[
"QUEUENUM"
]))
?
$full
[
"QUEUENUM"
]
:
""
,
//
"QUEUENUM" => (!empty($full["QUEUENUM"])) ? $full["QUEUENUM"] : "",
"ANSWEREDTIME"
=>
$duration
,
//
"ANSWEREDTIME" => $duration,
"TIME_QUEUEJOINTIME"
=>
(
!
empty
(
$full
[
"QUEUEJOINTIME"
]))
?
$full
[
"QUEUEJOINTIME"
]
:
""
,
//
"TIME_QUEUEJOINTIME" => (!empty($full["QUEUEJOINTIME"])) ? $full["QUEUEJOINTIME"] : "",
"TIME_HANGUP"
=>
time
(),
//
"TIME_HANGUP" => time(),
"LAST_POSITION"
=>
$lastPosition
,
//
"LAST_POSITION" => $lastPosition,
"DIALSTATUS"
=>
$dialStatus
,
//
"DIALSTATUS" => $dialStatus,
"REC"
=>
(
!
empty
(
$queryData
[
"RECORD_URL"
]))
?
$queryData
[
"RECORD_URL"
]
:
""
,
//
"REC" => (!empty($queryData["RECORD_URL"])) ? $queryData["RECORD_URL"] : "",
"GOOD"
=>
(
!
empty
(
$duration
)
&&
$duration
>
$goodSecods
)
?
1
:
NULL
//
"GOOD" => (!empty($duration) && $duration>$goodSecods) ? 1 : NULL
]
//
]
]);
//
]);
self
::
eLog
(
$stRes
,
"--== finishCall STATAPI RES:"
);
//
self::eLog($stRes,"--== finishCall STATAPI RES:");
}
}
...
@@ -3529,7 +3529,7 @@ CFU=';
...
@@ -3529,7 +3529,7 @@ CFU=';
}
}
public
function
statAPI
(
$m
,
$p
){
public
function
statAPI
(
$m
,
$p
){
return
[];
if
(
empty
(
$m
)){
return
false
;
}
if
(
empty
(
$m
)){
return
false
;
}
$params
=
[
"method"
=>
$m
];
$params
=
[
"method"
=>
$m
];
...
...
vendor/alovoice/src/AloVoiceHandle.php
View file @
cae8715d
...
@@ -429,7 +429,7 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
...
@@ -429,7 +429,7 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
$searchNumber
=
substr
(
$eventKeys
[
"calleridnum"
],
-
9
);
$searchNumber
=
substr
(
$eventKeys
[
"calleridnum"
],
-
9
);
}
}
$bxchannels
[
$eventKeys
[
"linkedid"
]][
"ALV_ECALLID"
]
=
ALVC
::
beginCall
(
$eventKeys
);
$bxchannels
[
$eventKeys
[
"linkedid"
]][
"ALV_ECALLID"
]
=
0
;
//
ALVC::beginCall($eventKeys);
$bxchannels
[
$eventKeys
[
"linkedid"
]][
"calls"
]
=
array
();
$bxchannels
[
$eventKeys
[
"linkedid"
]][
"calls"
]
=
array
();
$BX_USERID
=
1
;
$BX_USERID
=
1
;
...
...
vendor/autoload.php
View file @
cae8715d
...
@@ -27,7 +27,7 @@ function sess($key=null, $value=null){
...
@@ -27,7 +27,7 @@ function sess($key=null, $value=null){
}
}
}
}
if
(
isset
(
$key
)
&&
$key
!=
null
&&
(
!
isset
(
$value
)
||
$value
!=
null
)
){
if
(
isset
(
$key
)
&&
$key
!=
null
&&
(
!
isset
(
$value
)
||
$value
!=
null
)
&&
isset
(
$arAllSess
[
$key
])
){
return
$arAllSess
[
$key
];
return
$arAllSess
[
$key
];
}
}
...
...
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