Commit 886fb7aa by 刘鹏

Merge branch 'dev_2022_04_14' into 最新Dev

# Conflicts:
#	config.gradle
parents fe34a805 503189c0
...@@ -5,12 +5,12 @@ ext { ...@@ -5,12 +5,12 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.53", "m-confide" : "0.0.49.64",
"m-consultant" : "0.0.60.11", "m-consultant" : "0.0.60.11",
"m-fm" : "0.0.30.04", "m-fm" : "0.0.30.04",
"m-user" : "0.0.62.01", "m-user" : "0.0.62.01",
"m-home" : "0.0.23.16", "m-home" : "0.0.23.16",
"m-im" : "0.0.21.18", "m-im" : "0.0.21.21",
"m-dynamic" : "0.0.7.35", "m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
...@@ -33,13 +33,13 @@ ext { ...@@ -33,13 +33,13 @@ ext {
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//第一步 //第一步
"ydl-platform" : "0.0.40.83", "ydl-platform" : "0.0.40.89",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.58", "ydl-webview" : "0.0.38.58",
"ydl-media" : "0.0.21.42", "ydl-media" : "0.0.21.42",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.70", "m-audioim" : "0.0.49.29.84",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
...@@ -89,12 +89,12 @@ ext { ...@@ -89,12 +89,12 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.52", "m-confide" : "0.0.49.64",
"m-consultant" : "0.0.60.11", "m-consultant" : "0.0.60.11",
"m-fm" : "0.0.30.07", "m-fm" : "0.0.30.07",
"m-user" : "0.0.62.01", "m-user" : "0.0.62.01",
"m-home" : "0.0.22.98", "m-home" : "0.0.22.98",
"m-im" : "0.0.21.18", "m-im" : "0.0.21.21",
"m-dynamic" : "0.0.7.35", "m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
...@@ -116,13 +116,13 @@ ext { ...@@ -116,13 +116,13 @@ ext {
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//第一步 //第一步
"ydl-platform" : "0.0.40.83", "ydl-platform" : "0.0.40.89",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.58", "ydl-webview" : "0.0.38.58",
"ydl-media" : "0.0.21.42", "ydl-media" : "0.0.21.42",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.70", "m-audioim" : "0.0.49.29.84",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
......
...@@ -75,7 +75,7 @@ dependencies { ...@@ -75,7 +75,7 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler" kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api "com.alibaba:arouter-api:$arouter_api" api "com.alibaba:arouter-api:$arouter_api"
api ('com.ydl:ydl-av:1.3.4@aar'){ api ('com.ydl:ydl-av:1.3.8@aar'){
transitive = true transitive = true
} }
......
...@@ -227,7 +227,9 @@ class AudioHomeActivity : ...@@ -227,7 +227,9 @@ class AudioHomeActivity :
// 声网发出警告错误码,不应该直接离开房间 // 声网发出警告错误码,不应该直接离开房间
} }
/**
* https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html
* */
override fun onError(err: Int) { override fun onError(err: Int) {
super.onError(err) super.onError(err)
uploadException("mRtcEventHandler-onError:errorCode--%${err}", callback = null) uploadException("mRtcEventHandler-onError:errorCode--%${err}", callback = null)
...@@ -236,6 +238,7 @@ class AudioHomeActivity : ...@@ -236,6 +238,7 @@ class AudioHomeActivity :
.sendRichLog(AliYunLogConfig.AGORA, "声网错误回调errorCode--%${err}") .sendRichLog(AliYunLogConfig.AGORA, "声网错误回调errorCode--%${err}")
//3:SDK 初始化失败。Agora 建议尝试以下处理方法 //3:SDK 初始化失败。Agora 建议尝试以下处理方法
//7:SDK 尚未初始化,就调用其 API。请确认在调用 API 之前已创建 RtcEngine 对象并完成初始化 //7:SDK 尚未初始化,就调用其 API。请确认在调用 API 之前已创建 RtcEngine 对象并完成初始化
//9:没有操作权限。请检查用户是否授予 app 音视频设备使用权限。
//10:API 调用超时。有些 API 调用需要 SDK 返回结果,如果 SDK 处理时间过长,超过 10 秒没有返回,会出现此错误 //10:API 调用超时。有些 API 调用需要 SDK 返回结果,如果 SDK 处理时间过长,超过 10 秒没有返回,会出现此错误
//17:加入频道被拒绝。一般有以下原因: //17:加入频道被拒绝。一般有以下原因:
//用户已进入频道,再次调用加入频道的 API,例如 joinChannel,会返回此错误。停止调用该方法即可。 //用户已进入频道,再次调用加入频道的 API,例如 joinChannel,会返回此错误。停止调用该方法即可。
...@@ -308,7 +311,9 @@ class AudioHomeActivity : ...@@ -308,7 +311,9 @@ class AudioHomeActivity :
// leaveChannel() // leaveChannel()
// } // }
} }
/**
* https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#a31b2974a574ec45e62bb768e17d1f49e
* */
override fun onConnectionStateChanged(state: Int, reason: Int) { override fun onConnectionStateChanged(state: Int, reason: Int) {
super.onConnectionStateChanged(state, reason) super.onConnectionStateChanged(state, reason)
// 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑 // 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑
...@@ -802,7 +807,7 @@ class AudioHomeActivity : ...@@ -802,7 +807,7 @@ class AudioHomeActivity :
* param mRtcEventHandler 事件回调(SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等) * param mRtcEventHandler 事件回调(SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等)
*/ */
voiceManage = YDLVoiceManager(this, BuildConfig.AGORA_APPID, mRtcEventHandler) voiceManage = YDLVoiceManager(this, BuildConfig.AGORA_APPID, mRtcEventHandler)
voiceManage!!.init() voiceManage?.init()
} }
/** /**
...@@ -1175,6 +1180,8 @@ class AudioHomeActivity : ...@@ -1175,6 +1180,8 @@ class AudioHomeActivity :
} else { } else {
cmd.status = "CALL_OFF" cmd.status = "CALL_OFF"
} }
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "用户加入频道后,通知服务端发送推送")
mPresenter.noticeServerPush(cmd) mPresenter.noticeServerPush(cmd)
} }
...@@ -1201,8 +1208,6 @@ class AudioHomeActivity : ...@@ -1201,8 +1208,6 @@ class AudioHomeActivity :
sensorManager!!.getDefaultSensor(Sensor.TYPE_PROXIMITY), sensorManager!!.getDefaultSensor(Sensor.TYPE_PROXIMITY),
SensorManager.SENSOR_DELAY_NORMAL SensorManager.SENSOR_DELAY_NORMAL
) )
ActionCountUtils.count( ActionCountUtils.count(
"shengwang_popup_layer_page|shengwang_popup_layer_page_visit", "shengwang_popup_layer_page|shengwang_popup_layer_page_visit",
"", "",
......
...@@ -4,6 +4,7 @@ import android.annotation.SuppressLint ...@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.os.Handler import android.os.Handler
import android.text.TextUtils import android.text.TextUtils
import android.util.Log
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.google.gson.Gson import com.google.gson.Gson
import com.ydl.audioim.bean.AgoraInvitationBean import com.ydl.audioim.bean.AgoraInvitationBean
...@@ -66,6 +67,9 @@ class YDLavManager { ...@@ -66,6 +67,9 @@ class YDLavManager {
fun init(context: Context, appId: String) { fun init(context: Context, appId: String) {
YDLRTMClient.instances.init(context, appId, listener) YDLRTMClient.instances.init(context, appId, listener)
if (EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().unregister(this)
}
EventBus.getDefault().register(this) EventBus.getDefault().register(this)
//设置回调 //设置回调
setCallback() setCallback()
...@@ -693,7 +697,9 @@ class YDLavManager { ...@@ -693,7 +697,9 @@ class YDLavManager {
"onMessageReceived:${message.text} -->uid:$userId" "onMessageReceived:${message.text} -->uid:$userId"
) )
} }
/**
* https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#a31b2974a574ec45e62bb768e17d1f49e
* */
override fun onConnectionStateChanged(state: Int, reason: Int) { override fun onConnectionStateChanged(state: Int, reason: Int) {
sdkStatus = state sdkStatus = state
writeAgoraLog( writeAgoraLog(
......
...@@ -2,14 +2,17 @@ package com.ydl.audioim.presenter ...@@ -2,14 +2,17 @@ package com.ydl.audioim.presenter
import android.annotation.SuppressLint import android.annotation.SuppressLint
import com.ydl.audioim.BuildConfig import com.ydl.audioim.BuildConfig
import com.ydl.ydl_av.chat.config.YDLChatParam
import com.ydl.audioim.contract.IAudioHomeActivityContract import com.ydl.audioim.contract.IAudioHomeActivityContract
import com.ydl.audioim.http.command.* import com.ydl.audioim.http.command.ConnectCommand
import com.ydl.audioim.http.command.NoticePushCommand
import com.ydl.audioim.model.AudioHomeModelImpl import com.ydl.audioim.model.AudioHomeModelImpl
import com.ydl.audioim.utils.AudioLogUtils import com.ydl.audioim.utils.AudioLogUtils
import com.ydl.ydl_av.chat.config.YDLChatParam
import com.ydl.ydlcommon.mvp.base.BasePresenter import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.router.YdlCommonRouterManager import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.utils.LogUtil import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.log.AliYunLogConfig
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import com.ydl.ydlcommon.utils.log.LogHelper import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
...@@ -113,30 +116,55 @@ class AudioHomePresenterImpl : ...@@ -113,30 +116,55 @@ class AudioHomePresenterImpl :
if (it.data?.dialDetail?.callConnectType ?: -1 == 1) { if (it.data?.dialDetail?.callConnectType ?: -1 == 1) {
//axb //axb
mView.switchAXBResponse(it.data?.dialDetail?.phoneNu ?: "") mView.switchAXBResponse(it.data?.dialDetail?.phoneNu ?: "")
AudioLogUtils.writeAgoraLog("连接成功,连接状态:${it.data?.dialDetail?.dialStatus}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time AudioLogUtils.writeAgoraLog(
)}", "confide.log", true) "连接成功,连接状态:${it.data?.dialDetail?.dialStatus}-------Time:${
AudioLogUtils.format.format(
Calendar.getInstance().time
)
}", "confide.log", true
)
} else { } else {
ToastHelper.show(it.data?.dialDetail?.dialReason ?: "连接失败") ToastHelper.show(it.data?.dialDetail?.dialReason ?: "连接失败")
AudioLogUtils.writeAgoraLog("连接状态:${it.data?.dialDetail?.dialStatus}失败原因:${it.data?.dialDetail?.dialReason}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time AudioLogUtils.writeAgoraLog(
)}", "confide.log", true) "连接状态:${it.data?.dialDetail?.dialStatus}失败原因:${it.data?.dialDetail?.dialReason}-------Time:${
AudioLogUtils.format.format(
Calendar.getInstance().time
)
}", "confide.log", true
)
LogHelper.getInstance().uploadLog(false) LogHelper.getInstance().uploadLog(false)
} }
} else { } else {
ToastHelper.show(it.data?.dialDetail?.dialReason ?: "连接失败") ToastHelper.show(it.data?.dialDetail?.dialReason ?: "连接失败")
AudioLogUtils.writeAgoraLog("连接状态:${it.data?.dialDetail?.dialStatus}失败原因:${it.data?.dialDetail?.dialReason}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time AudioLogUtils.writeAgoraLog(
)}", "confide.log", true) "连接状态:${it.data?.dialDetail?.dialStatus}失败原因:${it.data?.dialDetail?.dialReason}-------Time:${
AudioLogUtils.format.format(
Calendar.getInstance().time
)
}", "confide.log", true
)
LogHelper.getInstance().uploadLog(false) LogHelper.getInstance().uploadLog(false)
} }
} else { } else {
ToastHelper.show(it.data?.dialDetail?.dialReason ?: "连接失败") ToastHelper.show(it.data?.dialDetail?.dialReason ?: "连接失败")
AudioLogUtils.writeAgoraLog("连接状态:${it.data?.dialDetail?.dialStatus}失败原因:${it.data?.dialDetail?.dialReason}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time AudioLogUtils.writeAgoraLog(
)}", "confide.log", true) "连接状态:${it.data?.dialDetail?.dialStatus}失败原因:${it.data?.dialDetail?.dialReason}-------Time:${
AudioLogUtils.format.format(
Calendar.getInstance().time
)
}", "confide.log", true
)
LogHelper.getInstance().uploadLog(false) LogHelper.getInstance().uploadLog(false)
} }
}, { e -> }, { e ->
LogUtil.d(e.message) LogUtil.d(e.message)
AudioLogUtils.writeAgoraLog("连接状态:${e.message}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time AudioLogUtils.writeAgoraLog(
)}", "confide.log", true) "连接状态:${e.message}-------Time:${
AudioLogUtils.format.format(
Calendar.getInstance().time
)
}", "confide.log", true
)
LogHelper.getInstance().uploadLog(false) LogHelper.getInstance().uploadLog(false)
}) })
} }
...@@ -152,25 +180,46 @@ class AudioHomePresenterImpl : ...@@ -152,25 +180,46 @@ class AudioHomePresenterImpl :
.subscribe({ .subscribe({
if (it.code == 200) { if (it.code == 200) {
AudioLogUtils.writeAgoraLog( AudioLogUtils.writeAgoraLog(
"通知服务端发送推送成功-------Time:${AudioLogUtils.format.format( "通知服务端发送推送成功-------Time:${
Calendar.getInstance().time AudioLogUtils.format.format(
)}", "confide.log", true Calendar.getInstance().time
)
}", "confide.log", true
) )
AliYunRichLogsHelper.getInstance()
.sendRichLog(
AliYunLogConfig.AGORA,
"通知服务端发送推送成功----接口:push/notify/doctor ---Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}"
)
} else { } else {
LogUtil.e(it.msg) LogUtil.e(it.msg)
AudioLogUtils.writeAgoraLog( AudioLogUtils.writeAgoraLog(
"通知服务端发送推送失败${it.msg}-------Time:${AudioLogUtils.format.format( "通知服务端发送推送失败${it.msg}-------Time:${
Calendar.getInstance().time AudioLogUtils.format.format(
)}", "confide.log", true Calendar.getInstance().time
)
}", "confide.log", true
) )
AliYunRichLogsHelper.getInstance()
.sendRichLog(
AliYunLogConfig.AGORA,
"通知服务端发送推送失败${it.msg}--接口:push/notify/doctor -----Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}"
)
LogHelper.getInstance().uploadLog(false) LogHelper.getInstance().uploadLog(false)
} }
}, { e -> }, { e ->
AudioLogUtils.writeAgoraLog( AudioLogUtils.writeAgoraLog(
"通知服务端发送推送失败${e.message}-------Time:${AudioLogUtils.format.format( "通知服务端发送推送失败${e.message}-------Time:${
Calendar.getInstance().time AudioLogUtils.format.format(
)}", "confide.log", true Calendar.getInstance().time
)
}", "confide.log", true
) )
AliYunRichLogsHelper.getInstance()
.sendRichLog(
AliYunLogConfig.AGORA,
"通知服务端发送推送失败${e.message}--接口:push/notify/doctor -----Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}"
)
LogHelper.getInstance().uploadLog(false) LogHelper.getInstance().uploadLog(false)
LogUtil.e(e.message) LogUtil.e(e.message)
}) })
......
...@@ -211,6 +211,33 @@ class ConsultantAudioHomeActivity : ...@@ -211,6 +211,33 @@ class ConsultantAudioHomeActivity :
override fun onRtcStats(stats: IRtcEngineEventHandler.RtcStats?) { override fun onRtcStats(stats: IRtcEngineEventHandler.RtcStats?) {
} }
/**
* * 该回调在网络连接状态发生改变的时候触发,并告知用户当前的网络连接状态,和引起网络状态改变的原因。
* @param state 当前的网络连接状态:
* CONNECTION_STATE_DISCONNECTED(1):网络连接断开
* CONNECTION_STATE_CONNECTING(2):建立网络连接中
* CONNECTION_STATE_CONNECTED(3):网络已连接
* CONNECTION_STATE_RECONNECTING(4):重新建立网络连接中
* CONNECTION_STATE_FAILED(5):网络连接失败
* @param reason 引起当前网络连接状态发生改变的原因:
* CONNECTION_CHANGED_CONNECTING(0):建立网络连接中
* CONNECTION_CHANGED_JOIN_SUCCESS(1):成功加入频道
* CONNECTION_CHANGED_INTERRUPTED(2):网络连接中断
* CONNECTION_CHANGED_BANNED_BY_SERVER(3):网络连接被服务器禁止
* CONNECTION_CHANGED_JOIN_FAILED(4):加入频道失败
* CONNECTION_CHANGED_LEAVE_CHANNEL(5):离开频道
* CONNECTION_CHANGED_INVALID_APP_ID(6):不是有效的 APP ID。请更换有效的 APP ID 重新加入频道
* CONNECTION_CHANGED_INVALID_CHANNEL_NAME(7):不是有效的频道名。请更换有效的频道名重新加入频道
* CONNECTION_CHANGED_INVALID_TOKEN(8):生成的 Token 无效。一般有以下原因:
* 在控制台上启用了 App Certificate,但加入频道未使用 Token。当启用了 App Certificate,必须使用 Token
* 在调用 joinChannel 加入频道时指定的 uid 与生成 Token 时传入的 uid 不一致
* CONNECTION_CHANGED_TOKEN_EXPIRED(9):当前使用的 Token 过期,不再有效,需要重新在你的服务端申请生成 Token
* CONNECTION_CHANGED_REJECTED_BY_SERVER(10):此用户被服务器禁止
* CONNECTION_CHANGED_SETTING_PROXY_SERVER(11):由于设置了代理服务器,SDK 尝试重连
* CONNECTION_CHANGED_RENEW_TOKEN(12):更新 Token 引起网络连接状态改变
* CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED(13):客户端 IP 地址变更,可能是由于网络类型,或网络运营商的 IP 或端口发生改变引起
* CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT(14):SDK 和服务器连接保活超时,进入自动重连状态
* */
override fun onConnectionStateChanged(state: Int, reason: Int) { override fun onConnectionStateChanged(state: Int, reason: Int) {
super.onConnectionStateChanged(state, reason) super.onConnectionStateChanged(state, reason)
// 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑 // 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑
......
...@@ -630,9 +630,9 @@ object IMChatUtil { ...@@ -630,9 +630,9 @@ object IMChatUtil {
if (!(promptRule == 4 || promptRule == 5)) { if (!(promptRule == 4 || promptRule == 5)) {
val showExpertList = !(promptRule == 1 || promptRule == 3) val showExpertList = !(promptRule == 1 || promptRule == 3)
if (actionHandler.userType == USER_TYPE_EXPERT && status == 2) { //当该专家离线时 if (actionHandler.userType == USER_TYPE_EXPERT && status == 2) { //当该专家离线时
sendRecommendExpertListMessage(1, showExpertList, toUid, actionHandler) // sendRecommendExpertListMessage(1, showExpertList, toUid, actionHandler)
} else if (actionHandler.userType == USER_TYPE_EXPERT && status >= 3) { //当该专家忙碌时 } else if (actionHandler.userType == USER_TYPE_EXPERT && status >= 3) { //当该专家忙碌时
sendRecommendExpertListMessage(2, showExpertList, toUid, actionHandler) // sendRecommendExpertListMessage(2, showExpertList, toUid, actionHandler)
} }
} }
} }
......
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