Commit 184b10f0 by 霍志良

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

parent d9e04fab
...@@ -195,6 +195,7 @@ class AudioHomeActivity : ...@@ -195,6 +195,7 @@ class AudioHomeActivity :
private var hasUpLoadLog = false private var hasUpLoadLog = false
private var callStatus: Int = -1 private var callStatus: Int = -1
/** /**
* dialStatus 专家通话状态。 * dialStatus 专家通话状态。
*/ */
...@@ -348,7 +349,10 @@ class AudioHomeActivity : ...@@ -348,7 +349,10 @@ class AudioHomeActivity :
if (reason == 3) { if (reason == 3) {
writeAgoraLog("通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})") writeAgoraLog("通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})")
AliYunRichLogsHelper.getInstance() AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})") .sendRichLog(
AliYunLogConfig.AGORA,
"通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})"
)
// com.yidianling.common.tools.ToastUtil.toastShort("专家已挂断") // com.yidianling.common.tools.ToastUtil.toastShort("专家已挂断")
//通话结束或挂断时,上传日志文件 //通话结束或挂断时,上传日志文件
uploadLog() uploadLog()
...@@ -395,12 +399,13 @@ class AudioHomeActivity : ...@@ -395,12 +399,13 @@ class AudioHomeActivity :
updateExpertStatus(false, 1) updateExpertStatus(false, 1)
}, 500) }, 500)
} }
//本地音频状态变化 //本地音频状态变化
override fun onLocalAudioStateChanged(localVideoState: Int, error: Int) { override fun onLocalAudioStateChanged(localVideoState: Int, error: Int) {
super.onLocalAudioStateChanged(localVideoState, error) super.onLocalAudioStateChanged(localVideoState, error)
if(error==8){
//当检测到系统来电中断通话
writeAgoraLog("当检测到系统来电中断通话$error") writeAgoraLog("当检测到系统来电中断通话$error")
if (error == 8) {
//当检测到系统来电中断通话
leaveChannel() leaveChannel()
} }
...@@ -551,7 +556,8 @@ class AudioHomeActivity : ...@@ -551,7 +556,8 @@ class AudioHomeActivity :
val uid = YdlCommonRouterManager.getYdlCommonRoute().getUid().toString() val uid = YdlCommonRouterManager.getYdlCommonRoute().getUid().toString()
YDLavManager.instances.login(uid) { _isSuccess, _msg -> YDLavManager.instances.login(uid) { _isSuccess, _msg ->
// writeAgoraLog("拨打电话界面打开RTM重新登录,uid=${uid}") // 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) writeAgoraLog(result)
} }
} }
...@@ -664,7 +670,12 @@ class AudioHomeActivity : ...@@ -664,7 +670,12 @@ class AudioHomeActivity :
} }
else -> { else -> {
// 拒绝权限操作发送给服务端 // 拒绝权限操作发送给服务端
uploadException("AudioNotAuth","zhu",YDLavManager.AUDIO_NO_AUTH_ERROR_CODE,null) uploadException(
"AudioNotAuth",
"zhu",
YDLavManager.AUDIO_NO_AUTH_ERROR_CODE,
null
)
writeAgoraLog("拒绝请求音频权限") writeAgoraLog("拒绝请求音频权限")
AliYunRichLogsHelper.getInstance() AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "拒绝请求音频权限") .sendRichLog(AliYunLogConfig.AGORA, "拒绝请求音频权限")
...@@ -741,7 +752,10 @@ class AudioHomeActivity : ...@@ -741,7 +752,10 @@ class AudioHomeActivity :
) { msg, code -> ) { msg, code ->
writeAgoraLog("未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断") writeAgoraLog("未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断")
AliYunRichLogsHelper.getInstance() AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断") .sendRichLog(
AliYunLogConfig.AGORA,
"未接听时:主叫(用户)主动挂断失败,msg=$msg($code),再次挂断"
)
} }
//通话结束或挂断时,上传日志文件 //通话结束或挂断时,上传日志文件
uploadLog() uploadLog()
...@@ -848,7 +862,8 @@ class AudioHomeActivity : ...@@ -848,7 +862,8 @@ class AudioHomeActivity :
* 线路选择弹窗 * 线路选择弹窗
*/ */
private fun showChooseDialog(type: Int) { private fun showChooseDialog(type: Int) {
val dialog = AxbConfirmDialog(mContext, type, object : AxbConfirmDialog.OnClickEnsureListener { val dialog =
AxbConfirmDialog(mContext, type, object : AxbConfirmDialog.OnClickEnsureListener {
override fun onClickEnsure() { override fun onClickEnsure() {
writeAgoraLog("主叫点击切换AXB按钮") writeAgoraLog("主叫点击切换AXB按钮")
AliYunRichLogsHelper.getInstance() AliYunRichLogsHelper.getInstance()
...@@ -1275,13 +1290,18 @@ class AudioHomeActivity : ...@@ -1275,13 +1290,18 @@ class AudioHomeActivity :
var uid: String = var uid: String =
ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid!! ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid!!
var payLoad = PayLoad(channelId ?: "0", time, uid, "1", "999", message) 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) YDLavManager.instances.uploadException(connectException, callback)
} }
fun writeAgoraLog(content: String, isAppend: Boolean = true) { fun writeAgoraLog(content: String, isAppend: Boolean = true) {
try { 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) { } 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