Commit e9037c13 by 严久程

接口参数

parent ebe6578a
......@@ -5,7 +5,7 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.48.47",
"m-confide" : "0.0.48.48",
"m-consultant" : "0.0.59.10",
"m-fm" : "0.0.29.9",
"m-user" : "0.0.60.8",
......@@ -39,7 +39,7 @@ ext {
"ydl-webview" : "0.0.38.31",
"ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.9",
"m-audioim" : "0.0.49.21",
"m-audioim" : "0.0.49.22",
"ydl-flutter-base": "0.0.14.14",
//以下 几乎不会动
......@@ -122,7 +122,7 @@ ext {
"ydl-webview" : "0.0.38.31",
"ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.9",
"m-audioim" : "0.0.49.21",
"m-audioim" : "0.0.49.22",
"ydl-flutter-base": "0.0.14.14",
//以下 几乎不会动
......
......@@ -191,17 +191,16 @@ class AudioHomeActivity :
runOnUiThread {
when (warn) {
103, 105, 107 -> {
YDLavManager.instances.callEndStatusUpdate(
channelId!!,
4,
"收到频道回调警告信息$warn"
)
writeAgoraLog("通话挂断:网络异常(${warn})")
showToast("当前网络较差,请更换网络!")
//通话结束或挂断时,上传日志文件
uploadLog()
leaveChannel()
YDLavManager.instances.callEndStatusUpdate(
channelId!!,
4,
"收到频道回调警告信息$warn"
)
}
}
}
......@@ -303,12 +302,12 @@ class AudioHomeActivity :
super.onConnectionStateChanged(state, reason)
// 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑
if (reason == 3) {
YDLavManager.instances.callEndStatusUpdate(channelId!!, 4, "服务端踢人触发的回调")
writeAgoraLog("通话结束:原因(${reason})")
com.yidianling.common.tools.ToastUtil.toastShort("专家已挂断")
//通话结束或挂断时,上传日志文件
uploadLog()
leaveChannel()
YDLavManager.instances.callEndStatusUpdate(channelId!!, 4, "服务端踢人触发的回调")
}
}
......@@ -517,11 +516,11 @@ class AudioHomeActivity :
return@setOnClickListener
}
if (isConnectSuccess) {
YDLavManager.instances.callEndStatusUpdate(channelId!!, 3, "主叫主动挂断")
writeAgoraLog("已接通:主叫主动挂断")
updateExpertStatus(false, 1)
leaveChannel()
uploadLog()
YDLavManager.instances.callEndStatusUpdate(channelId!!, 3, "主叫主动挂断")
} else {
userCloseCalling()
}
......@@ -607,37 +606,37 @@ class AudioHomeActivity :
waitDisposable =
Observable.interval(0, 100, TimeUnit.MILLISECONDS).subscribeOn(Schedulers.computation())
.take(600).observeOn(AndroidSchedulers.mainThread()).subscribe({
tv_change_time_counter.text = "${60 - it / 10}s"
var result = it.toFloat() / 2.5f
progress_view.setProgress(result)
if (result >= 100f && !iv_hang_up.isEnabled) {
//挂断按钮可点击
iv_hang_up.isEnabled = true
iv_hang_up.setImageResource(R.drawable.audioim_img_hang_up)
}
}, {
LogUtil.d(it.message)
}) {
waittingStatus()
if (!isConnectSuccess) {
//关闭音乐
stopPlaying()
writeAgoraLog("未接通挂断:60s等待倒计时结束挂断")
//提示切换传统线路
//发送消息通知专家用户已挂断
YDLavManager.instances.cancelCall(
listenerUid!!,
channelId!!,
sendDoctocrMsg!!
) { msg, code ->
writeAgoraLog("未接听时:主叫主动挂断失败,msg=$msg($code),再次挂断")
tv_change_time_counter.text = "${60 - it / 10}s"
var result = it.toFloat() / 2.5f
progress_view.setProgress(result)
if (result >= 100f && !iv_hang_up.isEnabled) {
//挂断按钮可点击
iv_hang_up.isEnabled = true
iv_hang_up.setImageResource(R.drawable.audioim_img_hang_up)
}
//通话结束或挂断时,上传日志文件
uploadLog()
}, {
LogUtil.d(it.message)
}) {
waittingStatus()
if (!isConnectSuccess) {
//关闭音乐
stopPlaying()
writeAgoraLog("未接通挂断:60s等待倒计时结束挂断")
//提示切换传统线路
//发送消息通知专家用户已挂断
YDLavManager.instances.cancelCall(
listenerUid!!,
channelId!!,
sendDoctocrMsg!!
) { msg, code ->
writeAgoraLog("未接听时:主叫主动挂断失败,msg=$msg($code),再次挂断")
}
//通话结束或挂断时,上传日志文件
uploadLog()
showChooseDialog(2)
showChooseDialog(2)
}
}
}
//双重保险:加入频道成功,通过服务端发推送给专家
noticeServerPush(true)
......
......@@ -473,7 +473,6 @@ class YDLavManager {
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
LogUtil.d("callEndStatusUpdate success")
}, {
LogUtil.d("callEndStatusUpdate error: ${it.message}")
})
......
......@@ -97,7 +97,7 @@ class AudioApiRequestUtil {
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).listenToken(NetworkParamsUtils.getMaps(cmd))
}
fun callEndStatusUpdate(channelId: String, endStatus: Int, msg: String): Observable<BaseResponse<Any>> {
fun callEndStatusUpdate(channelId: String, endStatus: Int, msg: String): Observable<BaseAPIResponse<Any>> {
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).callEndStatusUpdate(channelId, endStatus, msg)
}
}
......
......@@ -69,8 +69,8 @@ interface AudioNetAPi {
fun listenToken(@FieldMap map: Map<String, String>): Observable<BaseResponse<ListenTokenBean>>
@Headers( YDL_DOMAIN + YDL_DOMAIN_JAVA)
@GET("message/call-end/agora")
fun callEndStatusUpdate(@Query("channelId") channelId:String,@Query("endStatus") endStatus:Int,@Query("msg") msg:String): Observable<BaseResponse<Any>>
@Headers( YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun callEndStatusUpdate(@Query("channelId") channelId:String,@Query("endStatus") endStatus:Int,@Query("msg") msg:String): Observable<BaseAPIResponse<Any>>
}
\ No newline at end of file
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