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
8fa95e5a
Commit
8fa95e5a
authored
Jul 21, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:去除无服务状态提示,阿里云日志加入channel信息方便问题排查
parent
d5e9314c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
84 deletions
+97
-84
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+40
-32
ConsultantAudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/consultantim/ConsultantAudioHomeActivity.kt
+57
-51
ExpertConsultServiceListDialog2.kt
m-im/src/main/java/com/yidianling/uikit/custom/widget/expertConsultService/view/ExpertConsultServiceListDialog2.kt
+0
-1
No files found.
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
8fa95e5a
...
...
@@ -283,7 +283,7 @@ class AudioHomeActivity :
LogUtil
.
e
(
"[agora]发生警告回调$warn"
)
writeAgoraLog
(
"声网警告回调($warn)"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"声网警告回调($warn)"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"声网警告回调($warn)
channelId:${channelId}
"
)
//103:没有可用的频道资源。可能是因为服务端没法分配频道资源
//104:查找频道超时。在加入频道时 SDK 先要查找指定的频道,出现该警告一般是因为网络太差,连接不到服务器
//105:查找频道请求被服务器拒绝。服务器可能没有办法处理这个请求或请求是非法的
...
...
@@ -301,7 +301,7 @@ class AudioHomeActivity :
uploadException
(
"mRtcEventHandler-onError:errorCode--%${err}"
,
callback
=
null
)
writeAgoraLog
(
"声网错误回调errorCode--%${err}"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"声网错误回调errorCode--%${err}"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"声网错误回调errorCode--%${err}
channelId:${channelId}
"
)
//3:SDK 初始化失败。Agora 建议尝试以下处理方法
//7:SDK 尚未初始化,就调用其 API。请确认在调用 API 之前已创建 RtcEngine 对象并完成初始化
//9:没有操作权限。请检查用户是否授予 app 音视频设备使用权限。
...
...
@@ -367,7 +367,7 @@ class AudioHomeActivity :
super
.
onRtcStats
(
stats
)
writeAgoraLog
(
"声网onRtcStats:users:${stats?.users}"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"声网onRtcStats:users:${stats?.users}"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"声网onRtcStats:users:${stats?.users}
channelId:${channelId}
"
)
// 不需要移动端做离开房间逻辑,服务端会判断进行踢人逻辑
//因为用户端直接加入了频道,防止该回调执行时,专家还未加入频道,因此在连接成功之后,才进行频道人数判断
// if (isConnectSuccess && null != stats?.users && stats.users == 1) {
...
...
@@ -391,7 +391,7 @@ class AudioHomeActivity :
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})"
"通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})
channelId:${channelId}
"
)
// com.yidianling.common.tools.ToastUtil.toastShort("专家已挂断")
//通话结束或挂断时,上传日志文件
...
...
@@ -407,7 +407,7 @@ class AudioHomeActivity :
LogUtil
.
e
(
"[agora]离开频道回调"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"离开频道回调"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"离开频道回调
channelId:${channelId}
"
)
//通话结束或挂断时,上传日志文件
uploadLog
()
}
...
...
@@ -419,7 +419,7 @@ class AudioHomeActivity :
LogUtil
.
e
(
"[agora]远端用户/主播加入频道回调"
)
onPeerJoined
()
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"远端用户/主播加入频道回调"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"远端用户/主播加入频道回调
channelId:${channelId}
"
)
}
override
fun
onUserOffline
(
uid
:
Int
,
elapsed
:
Int
)
{
...
...
@@ -429,7 +429,7 @@ class AudioHomeActivity :
LogUtil
.
e
(
"[agora]远端用户$uid 离开频道回调"
)
writeAgoraLog
(
"接通后通话结束:对方已挂断"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"接通后通话结束:对方已挂断"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"接通后通话结束:对方已挂断
channelId:${channelId}
"
)
//通话结束或挂断时,上传日志文件
uploadLog
()
showToast
(
"专家已挂断"
)
...
...
@@ -465,6 +465,8 @@ class AudioHomeActivity :
if
(
txQuality
in
1
..
2
&&
rxQuality
in
1
..
2
)
{
""
}
else
if
(
txQuality
>=
5
||
rxQuality
>=
5
)
{
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"您的网络已断开 channelId:${channelId}"
)
"您的网络已断开"
}
else
{
status
=
if
(
txQuality
>=
4
||
rxQuality
>=
4
)
{
...
...
@@ -472,6 +474,8 @@ class AudioHomeActivity :
}
else
{
1
}
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"您的网络状况不佳 channelId:${channelId}"
)
"您的网络状况不佳"
}
}
...
...
@@ -479,6 +483,8 @@ class AudioHomeActivity :
if
(
txQuality
in
1
..
2
&&
rxQuality
in
1
..
2
)
{
""
}
else
if
(
txQuality
>=
5
||
rxQuality
>=
5
)
{
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"对方的网络已断开 channelId:${channelId}"
)
"对方的网络已断开"
}
else
{
status
=
if
(
txQuality
>=
4
||
rxQuality
>=
4
)
{
...
...
@@ -486,6 +492,8 @@ class AudioHomeActivity :
}
else
{
1
}
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"对方的网络状况不佳 channelId:${channelId}"
)
"对方的网络状况不佳"
}
}
...
...
@@ -515,7 +523,7 @@ class AudioHomeActivity :
writeAgoraLog
(
"通话页面打开的时候,RTM登录状态码:${YDLavManager.sdkStatus}"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
RTM
,
"通话页面打开的时候,RTM登录状态码:${YDLavManager.sdkStatus}"
)
.
sendRichLog
(
AliYunLogConfig
.
RTM
,
"通话页面打开的时候,RTM登录状态码:${YDLavManager.sdkStatus}
channelId:${channelId}
"
)
if
(
YDLavManager
.
sdkStatus
!=
Constants
.
CONNECTION_STATE_CONNECTED
)
{
//再次登录声网,确保声网登录状态
reLoginRTM
()
...
...
@@ -588,7 +596,7 @@ class AudioHomeActivity :
dialStatus
=
intent
.
getStringExtra
(
IntentConstants
.
INTENT_DIALSTATUS
)
writeAgoraLog
(
"专家的通话状态dialStatus:$dialStatus"
,
false
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"专家的通话状态dialStatus:$dialStatus"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"专家的通话状态dialStatus:$dialStatus
channelId:${channelId}
"
)
isShowAXB
=
intent
.
getBooleanExtra
(
IntentConstants
.
INTENT_ISSHOWAXB
,
true
)
val
logBean
=
AgoraLogInfoBean
(
...
...
@@ -604,7 +612,7 @@ class AudioHomeActivity :
val
content
=
Gson
().
toJson
(
logBean
)
writeAgoraLog
(
"主叫方发送的邀请通话消息内容:$content"
,
true
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"主叫方发送的邀请通话消息内容:$content"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"主叫方发送的邀请通话消息内容:$content
channelId:${channelId}
"
)
localRemainTime
=
remainTime
?.
toInt
()
?:
1500
handler
=
Handler
()
...
...
@@ -630,7 +638,7 @@ class AudioHomeActivity :
writeAgoraLog
(
"RMT状态:${YDLavManager.sdkStatus},重新登录RMT"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
RTM
,
"RMT状态:${YDLavManager.sdkStatus},重新登录RMTt"
)
.
sendRichLog
(
AliYunLogConfig
.
RTM
,
"RMT状态:${YDLavManager.sdkStatus},重新登录RMTt
channelId:${channelId}
"
)
val
uid
=
YdlCommonRouterManager
.
getYdlCommonRoute
().
getUid
().
toString
()
YDLavManager
.
instances
.
login
(
uid
)
{
_isSuccess
,
_msg
->
// writeAgoraLog("拨打电话界面打开RTM重新登录,uid=${uid}")
...
...
@@ -644,7 +652,7 @@ class AudioHomeActivity :
callEventSave
(
"20"
,
"通话页面打开"
)
writeAgoraLog
(
"用户拨打电话界面开启"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户拨打电话界面开启"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户拨打电话界面开启
channelId:${channelId}
"
)
//水波纹view初始化
wave_view
.
setDuration
(
6000
)
wave_view
.
setStyle
(
Paint
.
Style
.
STROKE
)
...
...
@@ -695,13 +703,13 @@ class AudioHomeActivity :
audio_mute_text
.
text
=
"麦克风已关"
voiceManage
?.
getVoiceApi
()
?.
enableLocalAudio
(
false
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户端点击:麦克风已关"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户端点击:麦克风已关
channelId:${channelId}
"
)
}
else
{
iv_mute_on_off
.
isSelected
=
true
iv_mute_on_off
.
setImageResource
(
R
.
drawable
.
audiohome_muteon
)
audio_mute_text
.
text
=
"麦克风已开"
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户端点击:麦克风已开"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户端点击:麦克风已开
channelId:${channelId}
"
)
voiceManage
?.
getVoiceApi
()
?.
enableLocalAudio
(
true
)
}
}
...
...
@@ -713,7 +721,7 @@ class AudioHomeActivity :
return
@setOnClickListener
}
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户端点击:切换线路"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户端点击:切换线路
channelId:${channelId}
"
)
ActionCountUtils
.
record
(
"call_phone_page"
,
"call_phone_icon_click"
,
"0"
,
"4"
)
showChooseDialog
(
1
)
...
...
@@ -722,7 +730,7 @@ class AudioHomeActivity :
iv_hang_up
.
setOnClickListener
{
if
(!
canHangUp
)
{
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户端点击:挂断,展示提示弹窗"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户端点击:挂断,展示提示弹窗
channelId:${channelId}
"
)
showHangUpTimeOnlineDialog
()
return
@setOnClickListener
}
...
...
@@ -734,7 +742,7 @@ class AudioHomeActivity :
if
(
isConnectSuccess
)
{
writeAgoraLog
(
"已接通:主叫主动挂断"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"已接通:主叫主动挂断"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"已接通:主叫主动挂断
channelId:${channelId}
"
)
updateExpertStatus
(
false
,
1
)
leaveChannel
()
uploadLog
()
...
...
@@ -759,13 +767,13 @@ class AudioHomeActivity :
iv_hands_free
.
setImageResource
(
R
.
drawable
.
audioim_img_hands_free_unuse
)
hands_free_text
.
text
=
"扬声器已关"
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户端点击:免提,扬声器已关"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户端点击:免提,扬声器已关
channelId:${channelId}
"
)
}
else
{
iv_hands_free
.
isSelected
=
true
iv_hands_free
.
setImageResource
(
R
.
drawable
.
audioim_img_hands_free
)
hands_free_text
.
text
=
"扬声器已开"
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户端点击:免提,扬声器已开"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户端点击:免提,扬声器已开
channelId:${channelId}
"
)
}
//已经接通
...
...
@@ -796,7 +804,7 @@ class AudioHomeActivity :
writeAgoraLog
(
"请求音频权限通过"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"请求音频权限通过"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"请求音频权限通过
channelId:${channelId}
"
)
init
()
}
...
...
@@ -812,7 +820,7 @@ class AudioHomeActivity :
writeAgoraLog
(
"拒绝请求音频权限"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"拒绝请求音频权限"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"拒绝请求音频权限
channelId:${channelId}
"
)
uploadLog
()
showStorageDialog
()
...
...
@@ -823,7 +831,7 @@ class AudioHomeActivity :
callEventSave
(
"80"
,
"请求音频权限异常${e.message}"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"请求音频权限异常${e.message}"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"请求音频权限异常${e.message}
channelId:${channelId}
"
)
init
()
}
...
...
@@ -934,7 +942,7 @@ class AudioHomeActivity :
writeAgoraLog
(
"主叫(用户)发送通话邀请"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"主叫(用户)发送通话邀请$msgBean"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"主叫(用户)发送通话邀请$msgBean
channelId:${channelId}
"
)
rtcCall
()
//开始50s等待倒计时
...
...
@@ -987,7 +995,7 @@ class AudioHomeActivity :
LogUtil
.
d
(
it
.
message
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"倒计时异常${it.message}"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"倒计时异常${it.message}
channelId:${channelId}
"
)
dismissHangUpTimeOnlineDialog
()
...
...
@@ -1007,7 +1015,7 @@ class AudioHomeActivity :
writeAgoraLog
(
"未接通挂断:50s等待倒计时结束挂断"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"未接通挂断:50s等待倒计时结束挂断"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"未接通挂断:50s等待倒计时结束挂断
channelId:${channelId}
"
)
//提示切换传统线路
//发送消息通知专家用户已挂断
YDLavManager
.
instances
.
cancelCall
(
...
...
@@ -1021,7 +1029,7 @@ class AudioHomeActivity :
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断"
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断
channelId:${channelId}
"
)
}
//通话结束或挂断时,上传日志文件
...
...
@@ -1081,7 +1089,7 @@ class AudioHomeActivity :
writeAgoraLog
(
"未接听时:主叫(用户)主动挂断,取消呼叫"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫(用户)主动挂断,取消呼叫"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫(用户)主动挂断,取消呼叫
channelId:${channelId}
"
)
LogUtil
.
e
(
"未接听挂断"
)
//发送消息通知专家用户已挂断
YDLavManager
.
instances
.
cancelCall
(
...
...
@@ -1093,7 +1101,7 @@ class AudioHomeActivity :
writeAgoraLog
(
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断
channelId:${channelId}
"
)
}
//通话结束或挂断时,上传日志文件
uploadLog
()
...
...
@@ -1129,7 +1137,7 @@ class AudioHomeActivity :
writeAgoraLog
(
"主叫点击切换AXB按钮"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"主叫点击切换AXB按钮"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"主叫点击切换AXB按钮
channelId:${channelId}
"
)
switchAXB
()
}
...
...
@@ -1155,7 +1163,7 @@ class AudioHomeActivity :
writeAgoraLog
(
"离开房间成功,主叫切换AXB之后"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"离开房间成功,主叫切换AXB之后"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"离开房间成功,主叫切换AXB之后
channelId:${channelId}
"
)
mPresenter
.
getAXBPhone
(
ConnectCommand
(
listenId
!!
,
"1"
))
}
...
...
@@ -1192,7 +1200,7 @@ class AudioHomeActivity :
writeAgoraLog
(
"未接听时:主叫主动挂断失败,msg=$msg($code),再次挂断"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫主动挂断失败,msg=$msg($code),再次挂断"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"未接听时:主叫主动挂断失败,msg=$msg($code),再次挂断
channelId:${channelId}
"
)
}
leaveChannel
()
}
...
...
@@ -1419,7 +1427,7 @@ class AudioHomeActivity :
cmd
.
status
=
"CALL_OFF"
}
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户加入频道后,通知服务端发送推送"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户加入频道后,通知服务端发送推送
channelId:${channelId}
"
)
mPresenter
.
noticeServerPush
(
cmd
)
}
...
...
m-audioim/src/main/java/com/ydl/consultantim/ConsultantAudioHomeActivity.kt
View file @
8fa95e5a
...
...
@@ -119,6 +119,18 @@ class ConsultantAudioHomeActivity :
*/
private
var
isConnectSuccess
:
Boolean
=
false
companion
object
{
const
val
PARAM
:
String
=
"param"
//0.未接听 1.已接听
const
val
STATUS_NOT_ANSWERED
=
0
const
val
STATUS_ANSWERED
=
1
//666.未接听,直接挂断 667.已接听,正常挂断 668:未接听,用户端取消了
const
val
RESULT_NOT_ANSWERED_CODE
=
666
const
val
RESULT_ANSWERED_CODE
=
667
const
val
RESULT_USER_CANCEL
=
668
}
/**
* 事件回调 (SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等)
*/
...
...
@@ -131,6 +143,8 @@ class ConsultantAudioHomeActivity :
*/
override
fun
onUserMuteAudio
(
uid
:
Int
,
muted
:
Boolean
)
{
callEventSave
(
"80"
,
"uid:${uid} 开启了静音 = ${muted}"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"咨询用户端:咨询用户端:uid:${uid} 开启了静音 = ${muted} channelId:${mAudioMessageBean?.channelId}"
)
// runOnUiThread {
// showToast("对方静音了,提醒他打开!")
// }
...
...
@@ -143,12 +157,12 @@ class ConsultantAudioHomeActivity :
LogUtil
.
e
(
"[agora]$uid 加入频道回调"
)
writeAgoraLog
(
"被叫(用户)加入声网($channel)频道成功"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
被叫(用户)
加入声网($channel)频道成功"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
咨询用户端:被叫(用户)uid:${uid}
加入声网($channel)频道成功"
)
runOnUiThread
{
// 加入频道后再通知用户已接受
// YDLRTMClient.instances.acceptCall(mAudioMessageBean?.channelId)
YDLavManager
.
instances
.
acceptCall
(
mAudioMessageBean
!!
.
userId
!!
,
mAudioMessageBean
?
.
userId
!!
,
mAudioMessageBean
?.
channelId
,
Gson
().
toJson
(
mAudioMessageBean
)
)
...
...
@@ -174,7 +188,7 @@ class ConsultantAudioHomeActivity :
LogUtil
.
e
(
"[agora]$uid 重新加入频道回调"
)
writeAgoraLog
(
"被叫(用户)重新加入声网频道($channel)成功"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
被叫(用户)
重新加入声网频道($channel)成功"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
咨询用户端:被叫(用户)uid:${uid}
重新加入声网频道($channel)成功"
)
runOnUiThread
{
if
(!
isConnectSuccess
)
{
...
...
@@ -195,7 +209,7 @@ class ConsultantAudioHomeActivity :
LogUtil
.
e
(
"[agora]远端用户加入频道回调"
)
writeAgoraLog
(
"主叫(专家)加入声网频道成功"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
主叫(专家)加入声网频道成功
"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
咨询用户端:主叫(专家)uid:${uid}加入声网频道成功 channelId:${mAudioMessageBean?.channelId}
"
)
//另一方加入频道成功
runOnUiThread
{
...
...
@@ -269,7 +283,7 @@ class ConsultantAudioHomeActivity :
callEventSave
(
"52"
,
"自己离开频道回调"
)
LogUtil
.
e
(
"[agora]自己离开频道回调"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
自己离开频道回调
"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
咨询用户端:自己离开频道回调 channelId:${mAudioMessageBean?.channelId}
"
)
//通知php 通话已结束
close
(
RESULT_ANSWERED_CODE
,
""
)
...
...
@@ -313,7 +327,7 @@ class ConsultantAudioHomeActivity :
showToast
(
"对方已挂断"
)
writeAgoraLog
(
"通话接通后挂断:主叫(专家)离开频道"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
通话接通后挂断:主叫(专家)离开频道
"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
咨询用户端:通话接通后挂断:主叫(专家)$uid 离开频道 channelId:${mAudioMessageBean?.channelId}
"
)
if
(
null
!=
totalDisposable
)
{
totalDisposable
!!
.
dispose
()
...
...
@@ -331,7 +345,7 @@ class ConsultantAudioHomeActivity :
}
LogUtil
.
e
(
"[agora]发生警告回调=$warn"
)
writeAgoraLog
(
"声网警告回调码:($warn)"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
声网警告回调码:($warn)
"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
咨询用户端:声网警告回调码:($warn) channelId:${mAudioMessageBean?.channelId}
"
)
//103:没有可用的频道资源。可能是因为服务端没法分配频道资源
//104:查找频道超时。在加入频道时 SDK 先要查找指定的频道,出现该警告一般是因为网络太差,连接不到服务器
...
...
@@ -359,7 +373,7 @@ class ConsultantAudioHomeActivity :
LogUtil
.
e
(
"[agora] 发生错误回调 =$err"
)
writeAgoraLog
(
"声网错误回调errorCode--%${err}"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
声网错误回调errorCode--%${err
}"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
咨询用户端:声网错误回调errorCode--%${err} channelId:${mAudioMessageBean?.channelId
}"
)
//3:SDK 初始化失败。Agora 建议尝试以下处理方法
//7:SDK 尚未初始化,就调用其 API。请确认在调用 API 之前已创建 RtcEngine 对象并完成初始化
...
...
@@ -411,7 +425,7 @@ class ConsultantAudioHomeActivity :
YDLavManager
.
instances
.
callEndStatusUpdate
(
mAudioMessageBean
?.
channelId
!!
,
4
,
"频道的错误回调信息${err}"
"频道的错误回调信息${err}
"
)
}
}
...
...
@@ -430,6 +444,8 @@ class ConsultantAudioHomeActivity :
if
(
txQuality
in
1
..
2
&&
rxQuality
in
1
..
2
)
{
""
}
else
if
(
txQuality
>=
5
||
rxQuality
>=
5
)
{
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"咨询用户端:您的网络已断开 channelId:${mAudioMessageBean?.channelId}"
)
"您的网络已断开"
}
else
{
status
=
if
(
txQuality
>=
4
||
rxQuality
>=
4
)
{
...
...
@@ -437,6 +453,8 @@ class ConsultantAudioHomeActivity :
}
else
{
1
}
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"咨询用户端:您的网络状况不佳 channelId:${mAudioMessageBean?.channelId}"
)
"您的网络状况不佳"
}
}
...
...
@@ -444,6 +462,8 @@ class ConsultantAudioHomeActivity :
if
(
txQuality
in
1
..
2
&&
rxQuality
in
1
..
2
)
{
""
}
else
if
(
txQuality
>=
5
||
rxQuality
>=
5
)
{
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"咨询用户端:对方的网络已断开 channelId:${mAudioMessageBean?.channelId}"
)
"对方的网络已断开"
}
else
{
status
=
if
(
txQuality
>=
4
||
rxQuality
>=
4
)
{
...
...
@@ -451,6 +471,8 @@ class ConsultantAudioHomeActivity :
}
else
{
1
}
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"咨询用户端:对方的网络状况不佳 channelId:${mAudioMessageBean?.channelId}"
)
"对方的网络状况不佳"
}
}
...
...
@@ -468,18 +490,7 @@ class ConsultantAudioHomeActivity :
return
R
.
layout
.
audioim_cativity_consultant_audio_home
}
companion
object
{
const
val
PARAM
:
String
=
"param"
//0.未接听 1.已接听
const
val
STATUS_NOT_ANSWERED
=
0
const
val
STATUS_ANSWERED
=
1
//666.未接听,直接挂断 667.已接听,正常挂断 668:未接听,用户端取消了
const
val
RESULT_NOT_ANSWERED_CODE
=
666
const
val
RESULT_ANSWERED_CODE
=
667
const
val
RESULT_USER_CANCEL
=
668
}
override
fun
initDataAndEvent
()
{
EventBus
.
getDefault
().
register
(
this
)
...
...
@@ -607,7 +618,7 @@ class ConsultantAudioHomeActivity :
callEventSave
(
"90"
,
"通话频道不存在"
)
LogUtil
.
e
(
"[agora]token not null"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
token isEmpty
"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
咨询用户端:token isEmpty channelId:${mAudioMessageBean?.channelId}
"
)
showToast
(
"通话频道不存在"
)
finish
()
...
...
@@ -691,7 +702,7 @@ class ConsultantAudioHomeActivity :
LogUtil
.
e
(
"[agora] joinChannel:$account"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
joinChannel:$account
"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
咨询用户端:joinChannel:$account channelId:${mAudioMessageBean?.channelId}
"
)
voiceManage
?.
getVoiceApi
()
?.
joinChannel
(
channelToken
...
...
@@ -929,7 +940,7 @@ class ConsultantAudioHomeActivity :
runOnUiThread
{
LogUtil
.
e
(
"[agora]close(code:$code,msg:$msg)"
)
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
close(code:$code,msg:$msg)
"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
咨询用户端:close(code:$code,msg:$msg) channelId:${mAudioMessageBean?.channelId}
"
)
//上传日志文件
uploadLog
()
...
...
@@ -940,6 +951,8 @@ class ConsultantAudioHomeActivity :
RESULT_ANSWERED_CODE
->
{
//已接听,正常挂断
//离开频道
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"咨询用户端:已接听,正常挂断 channelId:${mAudioMessageBean?.channelId}"
)
leaveChannel
()
}
RESULT_NOT_ANSWERED_CODE
->
{
...
...
@@ -961,7 +974,7 @@ class ConsultantAudioHomeActivity :
}
ActivityManager
.
getInstance
().
removeStack
(
activity
=
this
)
LogUtil
.
e
(
"[agora]页面移除"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
页面移除
"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"
咨询用户端:页面移除 channelId:${mAudioMessageBean?.channelId}
"
)
finish
()
}
}
...
...
@@ -977,15 +990,17 @@ class ConsultantAudioHomeActivity :
* 停止播放
*/
private
fun
stopPlaying
()
{
if
(
mPlayer
!=
null
)
{
mPlayer
!!
.
pause
()
}
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"咨询用户端:stopPlaying channelId:${mAudioMessageBean?.channelId}"
)
mPlayer
?.
pause
()
}
/**
* 播放结束音频
*/
private
fun
playFinishMusic
()
{
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"咨询用户端:playFinishMusic channelId:${mAudioMessageBean?.channelId}"
)
if
(
mPlayer
==
null
)
{
mPlayer
=
AudioPlayer
(
this
,
true
)
}
...
...
@@ -1012,6 +1027,8 @@ class ConsultantAudioHomeActivity :
1
,
"被叫加入频道后主叫未加入超时"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"咨询用户端:15s后如果还是处于连接中,则直接退出当前页面 channelId:${mAudioMessageBean?.channelId}"
)
writeAgoraLog
(
"通话未接通挂断:连接中的状态超过5s自动挂断"
)
showToast
(
"用户已挂断"
)
close
(
RESULT_NOT_ANSWERED_CODE
,
""
)
...
...
@@ -1025,28 +1042,16 @@ class ConsultantAudioHomeActivity :
*/
private
fun
leaveChannel
()
{
uploadException
(
""
,
"zhu"
,
"108"
)
if
(
totalDisposable
!=
null
)
{
totalDisposable
!!
.
dispose
()
}
if
(
connectingStatusDisposable
!=
null
)
{
connectingStatusDisposable
!!
.
dispose
()
}
if
(
null
!=
voiceManage
&&
null
!=
voiceManage
!!
.
getVoiceApi
())
{
voiceManage
!!
.
getVoiceApi
().
leaveChannel
()
voiceManage
!!
.
getVoiceApi
().
destroy
()
voiceManage
=
null
}
if
(
mPlayer
!=
null
)
{
mPlayer
!!
.
clear
()
}
if
(
null
!=
sensorManager
)
{
sensorManager
!!
.
unregisterListener
(
this
)
}
totalDisposable
?.
dispose
()
connectingStatusDisposable
?.
dispose
()
voiceManage
?.
getVoiceApi
()
?.
leaveChannel
()
voiceManage
?.
getVoiceApi
()
?.
destroy
()
voiceManage
=
null
mPlayer
?.
clear
()
sensorManager
?.
unregisterListener
(
this
)
//唤醒设备
if
(
null
!=
localWakeLock
&&
localWakeLock
!!
.
isHeld
)
{
localWakeLock
!!
.
release
()
if
(
localWakeLock
?.
isHeld
==
true
)
{
localWakeLock
?
.
release
()
}
sensorManager
=
null
localWakeLock
=
null
...
...
@@ -1054,9 +1059,7 @@ class ConsultantAudioHomeActivity :
}
private
fun
voiceDestory
()
{
if
(
null
!=
voiceManage
&&
null
!=
voiceManage
!!
.
getVoiceApi
())
{
voiceManage
!!
.
getVoiceApi
().
destroy
()
}
voiceManage
?.
getVoiceApi
()
?.
destroy
()
voiceManage
=
null
}
...
...
@@ -1108,6 +1111,8 @@ class ConsultantAudioHomeActivity :
override
fun
onDestroy
()
{
LogUtil
.
e
(
"http-------------onDestory"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"咨询用户端:onDestroy channelId:${mAudioMessageBean?.channelId}"
)
leaveChannel
()
voiceDestory
()
isConnectSuccess
=
false
...
...
@@ -1123,6 +1128,7 @@ class ConsultantAudioHomeActivity :
}
}
super
.
onDestroy
()
}
...
...
m-im/src/main/java/com/yidianling/uikit/custom/widget/expertConsultService/view/ExpertConsultServiceListDialog2.kt
View file @
8fa95e5a
...
...
@@ -115,7 +115,6 @@ class ExpertConsultServiceListDialog2(
}
else
{
dialog_ll_empty
.
visibility
=
View
.
VISIBLE
ToastUtil
.
toastShort
(
"咨询师暂未发布服务"
)
}
},
Consumer
{
throwable
:
Throwable
?
->
})
}
...
...
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