Commit 381ea98e by ydl

callStatus异常上传逻辑更新

parent 07bf6e50
...@@ -171,6 +171,8 @@ class AudioHomeActivity : ...@@ -171,6 +171,8 @@ class AudioHomeActivity :
private var isLeavelChannel: Boolean = false private var isLeavelChannel: Boolean = false
private var hasUpLoadLog = false private var hasUpLoadLog = false
private var callStatus: Int = -1
/** /**
* 声网事件回调 (SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等) * 声网事件回调 (SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等)
*/ */
...@@ -1099,6 +1101,10 @@ class AudioHomeActivity : ...@@ -1099,6 +1101,10 @@ class AudioHomeActivity :
} }
} }
fun uploadExceptionStatus(msg: String, status: Int) {
callStatus = status
uploadException(msg, callback = null)
}
/** /**
* 上传错误日志 * 上传错误日志
...@@ -1114,7 +1120,7 @@ class AudioHomeActivity : ...@@ -1114,7 +1120,7 @@ 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) var connectException = ConnectExceptionCommand(time + zhu, "2", eventType, payLoad, callStatus)
YDLavManager.instances.uploadException(connectException, callback) YDLavManager.instances.uploadException(connectException, callback)
} }
......
...@@ -114,10 +114,9 @@ class YDLavManager { ...@@ -114,10 +114,9 @@ class YDLavManager {
//通话结束或挂断时,上传日志文件 //通话结束或挂断时,上传日志文件
act.uploadLog() act.uploadLog()
act.leaveChannel() act.leaveChannel()
act.uploadExceptionStatus("对方已拒绝", 2)
} }
} }
} }
override fun onCallCanceled(response: CallLocalResponse?) { override fun onCallCanceled(response: CallLocalResponse?) {
...@@ -127,6 +126,7 @@ class YDLavManager { ...@@ -127,6 +126,7 @@ class YDLavManager {
if (act is AudioHomeActivity) { if (act is AudioHomeActivity) {
act.runOnUiThread { act.runOnUiThread {
act.writeAgoraLog("主叫呼叫取消:超时或主动取消") act.writeAgoraLog("主叫呼叫取消:超时或主动取消")
act.uploadExceptionStatus("已取消", 1)
} }
} }
} }
...@@ -150,6 +150,7 @@ class YDLavManager { ...@@ -150,6 +150,7 @@ class YDLavManager {
if (act is AudioHomeActivity) { if (act is AudioHomeActivity) {
act.runOnUiThread { act.runOnUiThread {
act.writeAgoraLog("呼叫失败:${errorCode}") act.writeAgoraLog("呼叫失败:${errorCode}")
act.uploadExceptionStatus("对方未接听", 3)
// //通话结束或挂断时,上传日志文件 // //通话结束或挂断时,上传日志文件
// act.uploadLog() // act.uploadLog()
// act.leaveChannel() // act.leaveChannel()
...@@ -173,12 +174,22 @@ class YDLavManager { ...@@ -173,12 +174,22 @@ class YDLavManager {
override fun onRemoteInvitationRefused(response: CallRemoteResponse?) { override fun onRemoteInvitationRefused(response: CallRemoteResponse?) {
//返回给被叫 //返回给被叫
LogUtil.e("[agora]已拒绝来自${response?.callerId}的呼叫") LogUtil.e("[agora]已拒绝来自${response?.callerId}的呼叫")
val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is ConsultantAudioHomeActivity) {
act.uploadExceptionStatus("已拒绝", 2)
}
} }
override fun onRemoteInvitationCanceled(response: CallRemoteResponse?) { override fun onRemoteInvitationCanceled(response: CallRemoteResponse?) {
//返回给被叫 //返回给被叫
LogUtil.e("[agora]主叫${response?.callerId}已取消呼叫邀请") LogUtil.e("[agora]主叫${response?.callerId}已取消呼叫邀请")
AudioLogUtils.writeAgoraLog("呼叫邀请被取消:主叫主动取消", FILE_NAME) AudioLogUtils.writeAgoraLog("呼叫邀请被取消:主叫主动取消", FILE_NAME)
val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is ConsultantAudioHomeActivity) {
act.uploadExceptionStatus("对方已取消", 1)
}
closePage() closePage()
} }
...@@ -187,6 +198,10 @@ class YDLavManager { ...@@ -187,6 +198,10 @@ class YDLavManager {
LogUtil.e("[agora]来自主叫${response?.callerId}的呼叫邀请进程失败:${response?.response}") LogUtil.e("[agora]来自主叫${response?.callerId}的呼叫邀请进程失败:${response?.response}")
if (errorCode == RtmStatusCode.RemoteInvitationError.REMOTE_INVITATION_ERR_INVITATION_EXPIRE) {//呼叫邀请过期 if (errorCode == RtmStatusCode.RemoteInvitationError.REMOTE_INVITATION_ERR_INVITATION_EXPIRE) {//呼叫邀请过期
AudioLogUtils.writeAgoraLog("呼叫邀请被取消:呼叫邀请过期", FILE_NAME) AudioLogUtils.writeAgoraLog("呼叫邀请被取消:呼叫邀请过期", FILE_NAME)
val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is ConsultantAudioHomeActivity) {
act.uploadExceptionStatus("未接听", 3)
}
} else { } else {
AudioLogUtils.writeAgoraLog("呼叫邀请被取消:错误原因(${errorCode})", FILE_NAME) AudioLogUtils.writeAgoraLog("呼叫邀请被取消:错误原因(${errorCode})", FILE_NAME)
} }
......
...@@ -867,6 +867,11 @@ class ConsultantAudioHomeActivity : ...@@ -867,6 +867,11 @@ class ConsultantAudioHomeActivity :
.subscribe() .subscribe()
} }
fun uploadExceptionStatus(msg: String, status: Int) {
callStatus = status
uploadException(msg)
}
/** /**
* 上传错误日志 * 上传错误日志
*/ */
......
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