Commit 184b10f0 by 霍志良

feat:升级m-confide组件(检测到系统来电中断声网通话)

parent d9e04fab
......@@ -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,12 +399,13 @@ class AudioHomeActivity :
updateExpertStatus(false, 1)
}, 500)
}
//本地音频状态变化
override fun onLocalAudioStateChanged(localVideoState: Int, error: Int) {
super.onLocalAudioStateChanged(localVideoState, error)
if(error==8){
//当检测到系统来电中断通话
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) {
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment