Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
杨凯
YDL-Component-Medical
Commits
184b10f0
Commit
184b10f0
authored
Aug 23, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:升级m-confide组件(检测到系统来电中断声网通话)
parent
d9e04fab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
12 deletions
+32
-12
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+32
-12
No files found.
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
184b10f0
...
...
@@ -195,6 +195,7 @@ class AudioHomeActivity :
private
var
hasUpLoadLog
=
false
private
var
callStatus
:
Int
=
-
1
/**
* dialStatus 专家通话状态。
*/
...
...
@@ -348,7 +349,10 @@ class AudioHomeActivity :
if
(
reason
==
3
)
{
writeAgoraLog
(
"通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})"
)
// com.yidianling.common.tools.ToastUtil.toastShort("专家已挂断")
//通话结束或挂断时,上传日志文件
uploadLog
()
...
...
@@ -395,14 +399,15 @@ class AudioHomeActivity :
updateExpertStatus
(
false
,
1
)
},
500
)
}
//本地音频状态变化
override
fun
onLocalAudioStateChanged
(
localVideoState
:
Int
,
error
:
Int
)
{
super
.
onLocalAudioStateChanged
(
localVideoState
,
error
)
if
(
error
==
8
){
//当检测到系统来电中断通话
writeAgoraLog
(
"当检测到系统来电中断通话$error"
)
leaveChannel
()
}
writeAgoraLog
(
"当检测到系统来电中断通话$error"
)
if
(
error
==
8
)
{
//当检测到系统来电中断通话
leaveChannel
()
}
}
...
...
@@ -551,7 +556,8 @@ class AudioHomeActivity :
val
uid
=
YdlCommonRouterManager
.
getYdlCommonRoute
().
getUid
().
toString
()
YDLavManager
.
instances
.
login
(
uid
)
{
_isSuccess
,
_msg
->
// writeAgoraLog("拨打电话界面打开RTM重新登录,uid=${uid}")
val
result
=
if
(
_isSuccess
)
"拨打电话界面打开RMT重新登录成功,uid=${uid}"
else
"拨打电话界面打开RMT登录失败:$_msg,uid=${uid}"
val
result
=
if
(
_isSuccess
)
"拨打电话界面打开RMT重新登录成功,uid=${uid}"
else
"拨打电话界面打开RMT登录失败:$_msg,uid=${uid}"
writeAgoraLog
(
result
)
}
}
...
...
@@ -664,7 +670,12 @@ class AudioHomeActivity :
}
else
->
{
// 拒绝权限操作发送给服务端
uploadException
(
"AudioNotAuth"
,
"zhu"
,
YDLavManager
.
AUDIO_NO_AUTH_ERROR_CODE
,
null
)
uploadException
(
"AudioNotAuth"
,
"zhu"
,
YDLavManager
.
AUDIO_NO_AUTH_ERROR_CODE
,
null
)
writeAgoraLog
(
"拒绝请求音频权限"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"拒绝请求音频权限"
)
...
...
@@ -741,7 +752,10 @@ class AudioHomeActivity :
)
{
msg
,
code
->
writeAgoraLog
(
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断"
)
}
//通话结束或挂断时,上传日志文件
uploadLog
()
...
...
@@ -848,7 +862,8 @@ class AudioHomeActivity :
* 线路选择弹窗
*/
private
fun
showChooseDialog
(
type
:
Int
)
{
val
dialog
=
AxbConfirmDialog
(
mContext
,
type
,
object
:
AxbConfirmDialog
.
OnClickEnsureListener
{
val
dialog
=
AxbConfirmDialog
(
mContext
,
type
,
object
:
AxbConfirmDialog
.
OnClickEnsureListener
{
override
fun
onClickEnsure
()
{
writeAgoraLog
(
"主叫点击切换AXB按钮"
)
AliYunRichLogsHelper
.
getInstance
()
...
...
@@ -1275,13 +1290,18 @@ class AudioHomeActivity :
var
uid
:
String
=
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
?.
uid
!!
var
payLoad
=
PayLoad
(
channelId
?:
"0"
,
time
,
uid
,
"1"
,
"999"
,
message
)
var
connectException
=
ConnectExceptionCommand
(
time
+
zhu
,
"2"
,
eventType
,
payLoad
,
callStatus
)
var
connectException
=
ConnectExceptionCommand
(
time
+
zhu
,
"2"
,
eventType
,
payLoad
,
callStatus
)
YDLavManager
.
instances
.
uploadException
(
connectException
,
callback
)
}
fun
writeAgoraLog
(
content
:
String
,
isAppend
:
Boolean
=
true
)
{
try
{
AudioLogUtils
.
writeAgoraLog
(
"$content-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}"
,
"confide.log"
,
isAppend
)
AudioLogUtils
.
writeAgoraLog
(
"$content-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}"
,
"confide.log"
,
isAppend
)
}
catch
(
e
:
Exception
)
{
}
}
...
...
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