Commit 869dcb6b by 严久程

声网日志文件和路径更改

parent a18c9d6a
...@@ -42,7 +42,7 @@ ext { ...@@ -42,7 +42,7 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.48.7.17", "m-confide" : "0.0.48.7.19",
"m-consultant" : "0.0.57.4", "m-consultant" : "0.0.57.4",
"m-fm" : "0.0.29.3", "m-fm" : "0.0.29.3",
"m-user" : "0.0.60.1", "m-user" : "0.0.60.1",
...@@ -75,7 +75,7 @@ ext { ...@@ -75,7 +75,7 @@ ext {
"ydl-webview" : "0.0.38.24", "ydl-webview" : "0.0.38.24",
"ydl-media" : "0.0.20", "ydl-media" : "0.0.20",
"ydl-pay" : "0.0.17", "ydl-pay" : "0.0.17",
"m-audioim" : "0.0.48.3.6", "m-audioim" : "0.0.48.3.8",
"ydl-flutter-base": "0.0.10.9", "ydl-flutter-base": "0.0.10.9",
//以下 几乎不会动 //以下 几乎不会动
...@@ -121,7 +121,7 @@ ext { ...@@ -121,7 +121,7 @@ ext {
"ydl-webview" : "0.0.38.24", "ydl-webview" : "0.0.38.24",
"ydl-media" : "0.0.20", "ydl-media" : "0.0.20",
"ydl-pay" : "0.0.17", "ydl-pay" : "0.0.17",
"m-audioim" : "0.0.48.3.6", "m-audioim" : "0.0.48.3.8",
"ydl-flutter-base": "0.0.10.9", "ydl-flutter-base": "0.0.10.9",
//以下 几乎不会动 //以下 几乎不会动
......
...@@ -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.2.1@aar'){ api ('com.ydl:ydl-av:1.2.4@aar'){
transitive = true transitive = true
} }
......
...@@ -40,6 +40,7 @@ import com.ydl.webview.NewH5Activity ...@@ -40,6 +40,7 @@ import com.ydl.webview.NewH5Activity
import com.ydl.webview.RefreshWebEvent import com.ydl.webview.RefreshWebEvent
import com.ydl.ydl_av.chat.bean.AudioMessageBean import com.ydl.ydl_av.chat.bean.AudioMessageBean
import com.ydl.ydl_av.messge_service.YDLRTMClient import com.ydl.ydl_av.messge_service.YDLRTMClient
import com.ydl.ydl_av.messge_service.callback.CancelCallStatusListener
import com.ydl.ydl_av.voice.listener.IYDLVoiceEventHandler import com.ydl.ydl_av.voice.listener.IYDLVoiceEventHandler
import com.ydl.ydl_av.voice.manager.YDLVoiceManager import com.ydl.ydl_av.voice.manager.YDLVoiceManager
import com.ydl.ydl_image.config.SimpleImageOpConfiger import com.ydl.ydl_image.config.SimpleImageOpConfiger
...@@ -413,7 +414,7 @@ class AudioHomeActivity : ...@@ -413,7 +414,7 @@ class AudioHomeActivity :
Observable.create<Any> { Observable.create<Any> {
try { try {
val content = Gson().toJson(logBean) val content = Gson().toJson(logBean)
AudioLogUtils.writeAgoraLog(content) AudioLogUtils.writeAgoraLog(content,"confide")
} catch (e: Exception) { } catch (e: Exception) {
} }
}.subscribeOn(Schedulers.io()) }.subscribeOn(Schedulers.io())
...@@ -639,20 +640,27 @@ class AudioHomeActivity : ...@@ -639,20 +640,27 @@ class AudioHomeActivity :
} }
}, { }, {
LogUtil.d(it.message) LogUtil.d(it.message)
}, { }) {
waittingStatus() waittingStatus()
if (!isConnectSuccess) { if (!isConnectSuccess) {
//关闭音乐 //关闭音乐
stopPlaying() stopPlaying()
//提示切换传统线路 //提示切换传统线路
//发送消息通知专家用户已挂断 //发送消息通知专家用户已挂断
YDLRTMClient.instances.cancelCall(listenerUid, channelId) YDLRTMClient.instances.cancelCall(listenerUid, channelId,object :CancelCallStatusListener{
override fun onFailure(errorMsg: String?, errorCode: Int) {
YDLRTMClient.instances.cancelCall(listenerUid, channelId,null)
}
override fun onSuccess() {
}
})
//通话结束或挂断时,上传日志文件 //通话结束或挂断时,上传日志文件
uploadLog() uploadLog()
showChooseDialog(2) showChooseDialog(2)
} }
}) }
//双重保险:加入频道成功,通过服务端发推送给专家 //双重保险:加入频道成功,通过服务端发推送给专家
noticeServerPush(true) noticeServerPush(true)
...@@ -695,7 +703,15 @@ class AudioHomeActivity : ...@@ -695,7 +703,15 @@ class AudioHomeActivity :
*/ */
private fun userCloseCalling() { private fun userCloseCalling() {
//发送消息通知专家用户已挂断 //发送消息通知专家用户已挂断
YDLRTMClient.instances.cancelCall(listenerUid, channelId) //发送消息通知专家用户已挂断
YDLRTMClient.instances.cancelCall(listenerUid, channelId,object :CancelCallStatusListener{
override fun onFailure(errorMsg: String?, errorCode: Int) {
YDLRTMClient.instances.cancelCall(listenerUid, channelId,null)
}
override fun onSuccess() {
}
})
//通话结束或挂断时,上传日志文件 //通话结束或挂断时,上传日志文件
uploadLog() uploadLog()
handler!!.postDelayed({ handler!!.postDelayed({
...@@ -780,7 +796,15 @@ class AudioHomeActivity : ...@@ -780,7 +796,15 @@ class AudioHomeActivity :
} else { } else {
//未连接成功,切换axb时:需发送消息通知专家端用户已挂断 //未连接成功,切换axb时:需发送消息通知专家端用户已挂断
//发送消息通知专家用户已挂断 //发送消息通知专家用户已挂断
YDLRTMClient.instances.cancelCall(listenerUid, channelId) //发送消息通知专家用户已挂断
YDLRTMClient.instances.cancelCall(listenerUid, channelId,object :CancelCallStatusListener{
override fun onFailure(errorMsg: String?, errorCode: Int) {
YDLRTMClient.instances.cancelCall(listenerUid, channelId,null)
}
override fun onSuccess() {
}
})
leaveChannel() leaveChannel()
} }
} }
......
...@@ -29,10 +29,10 @@ class AudioLogUtils { ...@@ -29,10 +29,10 @@ class AudioLogUtils {
@SuppressLint("SimpleDateFormat") @SuppressLint("SimpleDateFormat")
private val format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss") private val format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
fun writeAgoraLog(content: String) { fun writeAgoraLog(content: String, fileName: String) {
Observable.create<Any> { Observable.create<Any> {
try { try {
writeLog(content) writeLog(content, fileName)
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
LogUtil.d("writeLog_complete") LogUtil.d("writeLog_complete")
} }
...@@ -42,10 +42,10 @@ class AudioLogUtils { ...@@ -42,10 +42,10 @@ class AudioLogUtils {
.subscribe() .subscribe()
} }
private fun writeLog(content: String) { private fun writeLog(content: String, fileName: String) {
try { try {
val folder = getLogFolder() val folder = getLogFolder()
val file = File(folder, "AgoraInfoLog") val file = File(folder, fileName)
if (!file.exists() || !file.isFile) { if (!file.exists() || !file.isFile) {
file.createNewFile() file.createNewFile()
} }
......
...@@ -137,6 +137,8 @@ class ConsultantAudioHomeActivity : ...@@ -137,6 +137,8 @@ class ConsultantAudioHomeActivity :
//5s倒计时,5s后还是连接中,则直接关闭页面 //5s倒计时,5s后还是连接中,则直接关闭页面
connectingStatusWaitingTimeCount() connectingStatusWaitingTimeCount()
tv_tips.visibility=View.INVISIBLE
} }
} }
...@@ -897,7 +899,7 @@ class ConsultantAudioHomeActivity : ...@@ -897,7 +899,7 @@ class ConsultantAudioHomeActivity :
private fun writeAgoraLog(content: String) { private fun writeAgoraLog(content: String) {
Observable.create<Any> { Observable.create<Any> {
try { try {
AudioLogUtils.writeAgoraLog(content) AudioLogUtils.writeAgoraLog(content,"consult")
} catch (e: Exception) { } catch (e: Exception) {
} }
}.subscribeOn(Schedulers.io()) }.subscribeOn(Schedulers.io())
......
...@@ -226,12 +226,12 @@ class LogHelper private constructor() { ...@@ -226,12 +226,12 @@ class LogHelper private constructor() {
//获取声网日志 //获取声网日志
private fun getAgoraLog(context: Context): File { private fun getAgoraLog(context: Context): File {
val agora = FileUtils.getSDDirectory() + "/" + context.packageName + "/agorasdk.log" // val agora = FileUtils.getSDDirectory() + "/" + context.packageName + "/agorasdk.log"
val filePath = context.filesDir.path + "/agorasdk.log" val filePath = context.filesDir.path + "/agorasdk.log"
return File(agora) return File(filePath)
} }
private object Holder { private object Holder {
......
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