Commit 7f08c113 by 刘鹏

Merge branch 'feat/qj/fix_2axb' into 'release'

补充埋点

See merge request app_android_lib/YDL-Component!369
parents bdcb05d0 eeeab294
......@@ -30,10 +30,7 @@ import com.hjq.permissions.XXPermissions
import com.ydl.audioim.bean.AgoraInvitationBean
import com.ydl.audioim.bean.AgoraLogInfoBean
import com.ydl.audioim.contract.IAudioHomeActivityContract
import com.ydl.audioim.http.AudioApiRequestUtil
import com.ydl.audioim.http.AudioNetAPi
import com.ydl.audioim.http.LeaveChannelReason
import com.ydl.audioim.http.RtcEvent
import com.ydl.audioim.http.*
import com.ydl.audioim.http.command.ConnectCommand
import com.ydl.audioim.http.command.ConnectExceptionCommand
import com.ydl.audioim.http.command.NoticePushCommand
......@@ -259,16 +256,24 @@ class AudioHomeActivity :
if (fromUid == listenerUid) {
try {
val bean = Gson().fromJson(content, AgoraInvitationBean::class.java)
var desc = bean.callType
when (bean.callType) {
"2" -> {//接受
runOnUiThread {
joinChannel()
}
desc = "接受"
}
"4" -> {//拒绝
onCallRefused()
desc = "拒绝"
}
}
AudioApiRequestUtil.reportCallEvent(
channelId,
IMEvent(IMEvent.Event.callNotificationReceived),
errorReason = desc
)
} catch (throwable: Throwable) {
LogUtil.e(throwable.message)
}
......
......@@ -285,17 +285,17 @@ class YDLavManager {
fun rtcCall(listenerUid: String?, channelId: String?, sendDoctocrMsg: String?) {
YDLRTMClient.instances.call(listenerUid, channelId, sendDoctocrMsg)
AudioApiRequestUtil.reportCallEvent(channelId, IMEvent(IMEvent.Event.startCall))
sendCustomNotification(listenerUid!!, sendDoctocrMsg!!, "1")
sendCustomNotification(listenerUid!!, sendDoctocrMsg!!, "1", channelId)
}
fun acceptCall(toUid: String, channelId: String?, data: String) {
YDLRTMClient.instances.acceptCall(channelId)
sendCustomNotification(toUid, data, "2")
sendCustomNotification(toUid, data, "2", channelId)
}
fun refuseCall(toUid: String, channelId: String?, data: String) {
YDLRTMClient.instances.refuseCall(channelId)
sendCustomNotification(toUid, data, "4")
sendCustomNotification(toUid, data, "4", channelId)
}
fun cancelCall(
......@@ -319,10 +319,10 @@ class YDLavManager {
callEndStatusUpdate(channelId, 1, "主叫取消呼叫")
AudioApiRequestUtil.reportCallEvent(channelId, IMEvent(IMEvent.Event.callCancel))
sendCustomNotification(listenerUid, data, "3")
sendCustomNotification(listenerUid, data, "3", channelId)
}
private fun sendCustomNotification(toUid: String, data: String, callType: String) {
private fun sendCustomNotification(toUid: String, data: String, callType: String, channelId: String?) {
val infoBean = AgoraInvitationBean()
infoBean.data = data
infoBean.callType = callType
......@@ -337,6 +337,13 @@ class YDLavManager {
AliYunLogConfig.YUNXIN,
"云信发送通话邀请异常${throwable.message}"
)
if (callType == "1") {
AudioApiRequestUtil.reportCallEvent(
channelId,
IMEvent(IMEvent.Event.callNotificationSend),
errorReason = throwable.message
)
}
}
override fun onFailed(code: Int) {
......@@ -346,6 +353,13 @@ class YDLavManager {
AliYunLogConfig.YUNXIN,
"云信发送通话邀请失败${code}"
)
if (callType == "1") {
AudioApiRequestUtil.reportCallEvent(
channelId,
IMEvent(IMEvent.Event.callNotificationSend),
retCode = code
)
}
}
override fun onSuccess() {
......@@ -358,6 +372,9 @@ class YDLavManager {
AliYunLogConfig.YUNXIN,
"云信发送通话邀请成功"
)
if (callType == "1") {
AudioApiRequestUtil.reportCallEvent(channelId, IMEvent(IMEvent.Event.callNotificationSend))
}
}
})
}, 300)
......
......@@ -209,6 +209,8 @@ class IMEvent(event: Event) : CallEvent(EventType.IM, event.name, event.desc, ev
callSuccess("呼叫成功", REPORT_LEVEL_INFO),
callFail("呼叫失败", REPORT_LEVEL_ERROR),
callCancel("呼叫取消", REPORT_LEVEL_WARN),
callNotificationSend("补偿im发送", REPORT_LEVEL_WARN),
callNotificationReceived("补偿im收到", REPORT_LEVEL_WARN),
}
}
......
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