Commit 726181ac by 万齐军

网络质量bug fix

parent 7a9181f0
......@@ -243,6 +243,8 @@ class AudioHomeActivity :
private var hasHandleRefused = false
private var hasJoinChannel = false
private val tvNetDelay: TextView by lazy { findViewById(R.id.tvDelay) }
private val tvNetDown: TextView by lazy { findViewById(R.id.tvDown) }
private val tvNetUp: TextView by lazy { findViewById(R.id.tvUp) }
......@@ -459,9 +461,9 @@ class AudioHomeActivity :
.sendRichLog(AliYunLogConfig.AGORA, "远端用户/主播加入频道回调 channelId:${channelId}")
}
override fun onUserOffline(uid: Int, elapsed: Int) {
super.onUserOffline(uid, elapsed)
callEventSave("51", "uid:${uid}离开频道回调 elapsed:${elapsed}")
override fun onUserOffline(uid: Int, reason: Int) {
super.onUserOffline(uid, reason)
callEventSave("51", "uid:${uid}离开频道回调 elapsed:${reason}")
LogUtil.e("[agora]远端用户$uid 离开频道回调")
writeAgoraLog("接通后通话结束:对方已挂断")
......@@ -469,9 +471,12 @@ class AudioHomeActivity :
.sendRichLog(AliYunLogConfig.AGORA, "接通后通话结束:对方已挂断 channelId:${channelId}")
//通话结束或挂断时,上传日志文件
uploadLog()
AudioApiRequestUtil.reportCallEvent(channelId, RtcEvent(RtcEvent.Event.remoteLeave))
AudioApiRequestUtil.reportCallEvent(channelId, RtcEvent(RtcEvent.Event.remoteLeave), retCode = reason)
showToast("专家已挂断")
//UserOffLine之后,销毁界面,解决,userOffline有回调之后,onConnectionStateChanged(服务端踢人方法没有调),导致记录时长异常。
if (reason == Constants.USER_OFFLINE_DROPPED) {
YDLavManager.instances.callEndStatusUpdate(channelId, 3, "对方超时掉线")
}
leaveChannel()
if (totalDisposable != null) {
......@@ -777,7 +782,7 @@ class AudioHomeActivity :
.sendRichLog(AliYunLogConfig.AGORA, "用户端点击:切换线路 channelId:${channelId}")
ActionCountUtils.record("call_phone_page", "call_phone_icon_click", "0", "4")
showChooseDialog(1)
showChooseDialog(2)
}
//挂断
iv_hang_up.setOnClickListener {
......@@ -1136,6 +1141,7 @@ class AudioHomeActivity :
* 声网加入频道
*/
fun joinChannel() {
if (hasJoinChannel) return
callEventSave("20", "对方(专家)接受了通话邀请,主叫(用户)开始加入频道:$channelId")
writeAgoraLog("对方(专家)接受了通话邀请,主叫(用户)开始加入频道:$channelId")
......@@ -1148,6 +1154,9 @@ class AudioHomeActivity :
"Extra Optional Data",
YdlCommonRouterManager.getYdlCommonRoute().getUid()
)
if (joinCode != null && joinCode == 0) {
hasJoinChannel = true
}
if (joinCode != null && joinCode < 0) {
AudioApiRequestUtil.reportCallEvent(channelId, RtcEvent(RtcEvent.Event.joinFail), retCode = joinCode)
}
......
......@@ -172,7 +172,7 @@ annotation class ReportLevel
sealed class CallEvent(val eventType: EventType, val name: String, val desc: String, @ReportLevel val reportLevel: Int)
class RtcEvent(val event: Event) :
CallEvent(EventType.RTC, event.name.lowercase(Locale.getDefault()), event.desc, event.reportLevel) {
CallEvent(EventType.RTC, event.name, event.desc, event.reportLevel) {
@Suppress("EnumEntryName")
enum class Event(val desc: String, @ReportLevel val reportLevel: Int) {
initSdk("初始化SDK", REPORT_LEVEL_WARN),
......@@ -194,7 +194,7 @@ class RtcEvent(val event: Event) :
}
class IMEvent(event: Event) : CallEvent(EventType.IM, event.name.lowercase(Locale.getDefault()), event.desc, event.reportLevel) {
class IMEvent(event: Event) : CallEvent(EventType.IM, event.name, event.desc, event.reportLevel) {
@Suppress("EnumEntryName")
enum class Event(val desc: String, @ReportLevel val reportLevel: Int) {
rtmLogin("登录RTM", REPORT_LEVEL_INFO),
......@@ -213,7 +213,7 @@ class IMEvent(event: Event) : CallEvent(EventType.IM, event.name.lowercase(Local
}
class LoginEvent(event: Event) :
CallEvent(EventType.LOGIN, event.name.lowercase(Locale.getDefault()), event.desc, event.reportLevel) {
CallEvent(EventType.LOGIN, event.name, event.desc, event.reportLevel) {
@Suppress("EnumEntryName")
enum class Event(val desc: String, @ReportLevel val reportLevel: Int) {
userLogin("用户登录", REPORT_LEVEL_INFO),
......@@ -224,7 +224,7 @@ class LoginEvent(event: Event) :
}
class DeviceEvent(event: Event) :
CallEvent(EventType.DEVICE, event.name.lowercase(Locale.getDefault()), event.desc, event.reportLevel) {
CallEvent(EventType.DEVICE, event.name, event.desc, event.reportLevel) {
@Suppress("EnumEntryName")
enum class Event(val desc: String, @ReportLevel val reportLevel: Int) {
beForeground("回到前台", REPORT_LEVEL_INFO),
......
......@@ -22,6 +22,7 @@ import retrofit2.http.*
interface AudioNetAPi {
@GET("counselor/consultationCall/queryCallInfo")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun checkCall(@Query("calleeUid") calleeUid: String?): Observable<BaseAPIResponse<CallCheckBean>>
/**
* 通话开始回调
......
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