Commit 5ae1ea18 by 刘鹏

feat : 星链 倾诉日志更改参数

parent 34f14462
...@@ -5,7 +5,7 @@ ext { ...@@ -5,7 +5,7 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.25", "m-confide" : "0.0.49.28",
"m-consultant" : "0.0.60.03", "m-consultant" : "0.0.60.03",
"m-fm" : "0.0.30.04", "m-fm" : "0.0.30.04",
"m-user" : "0.0.61.94", "m-user" : "0.0.61.94",
...@@ -39,7 +39,7 @@ ext { ...@@ -39,7 +39,7 @@ ext {
"ydl-webview" : "0.0.38.47", "ydl-webview" : "0.0.38.47",
"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.46", "m-audioim" : "0.0.49.29.49",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
...@@ -88,7 +88,7 @@ ext { ...@@ -88,7 +88,7 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.25", "m-confide" : "0.0.49.28",
"m-consultant" : "0.0.60.03", "m-consultant" : "0.0.60.03",
"m-fm" : "0.0.30.07", "m-fm" : "0.0.30.07",
"m-user" : "0.0.61.94", "m-user" : "0.0.61.94",
...@@ -114,14 +114,13 @@ ext { ...@@ -114,14 +114,13 @@ ext {
"m-dynamic-api" : "0.0.3.71", "m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.40.77", "ydl-platform" : "0.0.40.77",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.47", "ydl-webview" : "0.0.38.47",
"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.46", "m-audioim" : "0.0.49.29.49",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
......
...@@ -451,7 +451,8 @@ class YDLavManager { ...@@ -451,7 +451,8 @@ class YDLavManager {
if (TextUtils.isEmpty(userId) || userId ?: "0" <= "0") { if (TextUtils.isEmpty(userId) || userId ?: "0" <= "0") {
//如果uid为空或小于等于0 ,则不进行登录,因为uid为0也会登录成功,会导致后面uid正确时无法登录 //如果uid为空或小于等于0 ,则不进行登录,因为uid为0也会登录成功,会导致后面uid正确时无法登录
LogUtil.e("[agora]login-uid:$userId") LogUtil.e("[agora]login-uid:$userId")
AliYunRichLogsHelper.getInstance().sendRichLog(AliYunLogConfig.AGORA,"uid为空或小于等于0 ,则不进行登录 login-uid:$userId") AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "uid为空或小于等于0 ,则不进行登录 login-uid:$userId")
return return
} }
isOnlineRtm = true isOnlineRtm = true
...@@ -687,7 +688,10 @@ class YDLavManager { ...@@ -687,7 +688,10 @@ class YDLavManager {
override fun onMessageReceived(message: RTMMesssage, userId: Int) { override fun onMessageReceived(message: RTMMesssage, userId: Int) {
LogUtil.i("[agora]onMessageReceived:${message.text} -->uid:$userId") LogUtil.i("[agora]onMessageReceived:${message.text} -->uid:$userId")
AliYunRichLogsHelper.getInstance() AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "onMessageReceived:${message.text} -->uid:$userId") .sendRichLog(
AliYunLogConfig.AGORA,
"onMessageReceived:${message.text} -->uid:$userId"
)
} }
override fun onConnectionStateChanged(state: Int, reason: Int) { override fun onConnectionStateChanged(state: Int, reason: Int) {
...@@ -717,4 +721,23 @@ class YDLavManager { ...@@ -717,4 +721,23 @@ class YDLavManager {
} }
} }
} }
/**
* 倾诉日志
* @param session 通话业务id
* @param status 状态:01通话中(不影响通话的事件) 10:拨打 20未拨通 30未接通 40 接通 50挂断 60断线 70重连 80 呼叫方信号 90 被呼叫方信号
* @param res 上报的详细
* @param line 载体:1.网易 2.中国移动(双呼)3.联通 4.华为 5.糖猫-联通 7:声网 8:微信 10:新移动
* */
fun callEventSave(
status: String,
res: String,
session: String?,
line: String
) {
AudioApiRequestUtil.callEventSave(session, line, status, res)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe()
}
} }
\ No newline at end of file
package com.ydl.audioim.bean
/**
* 星链-倾诉日志请求参数
* */
data class CallEventRequestBody(
var session :String?,
var line :String,
var status :String,
var response :String,
var eventTime :String
)
...@@ -2,6 +2,7 @@ package com.ydl.audioim.http ...@@ -2,6 +2,7 @@ package com.ydl.audioim.http
import com.google.gson.Gson import com.google.gson.Gson
import com.ydl.audioim.bean.AgoraTokenResponse import com.ydl.audioim.bean.AgoraTokenResponse
import com.ydl.audioim.bean.CallEventRequestBody
import com.ydl.audioim.bean.ConnectBean import com.ydl.audioim.bean.ConnectBean
import com.ydl.audioim.http.command.ConnectCommand import com.ydl.audioim.http.command.ConnectCommand
import com.ydl.audioim.http.command.ConnectExceptionCommand import com.ydl.audioim.http.command.ConnectExceptionCommand
...@@ -32,9 +33,9 @@ class AudioApiRequestUtil { ...@@ -32,9 +33,9 @@ class AudioApiRequestUtil {
*/ */
fun connectListen(cmd: ConnectCommand): Observable<BaseAPIResponse<ConnectBean>> { fun connectListen(cmd: ConnectCommand): Observable<BaseAPIResponse<ConnectBean>> {
return RxUtils.mapObservable(cmd) return RxUtils.mapObservable(cmd)
.flatMap { it -> .flatMap { it ->
YDLHttpUtils.obtainApi(AudioNetAPi::class.java).connectListen(it) YDLHttpUtils.obtainApi(AudioNetAPi::class.java).connectListen(it)
} }
} }
/** /**
...@@ -71,7 +72,10 @@ class AudioApiRequestUtil { ...@@ -71,7 +72,10 @@ class AudioApiRequestUtil {
*/ */
fun connectException(param: ConnectExceptionCommand): Observable<BaseAPIResponse<Any>> { fun connectException(param: ConnectExceptionCommand): Observable<BaseAPIResponse<Any>> {
var str = Gson().toJson(param) var str = Gson().toJson(param)
val body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), str) as RequestBody val body = RequestBody.create(
MediaType.parse("application/json; charset=utf-8"),
str
) as RequestBody
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).connectException(body) return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).connectException(body)
} }
...@@ -80,7 +84,10 @@ class AudioApiRequestUtil { ...@@ -80,7 +84,10 @@ class AudioApiRequestUtil {
*/ */
fun noticeServerPush(param: NoticePushCommand): Observable<BaseResponse<Any>> { fun noticeServerPush(param: NoticePushCommand): Observable<BaseResponse<Any>> {
var str = Gson().toJson(param) var str = Gson().toJson(param)
val body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), str) as RequestBody val body = RequestBody.create(
MediaType.parse("application/json; charset=utf-8"),
str
) as RequestBody
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).noticeServerPush(body) return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).noticeServerPush(body)
} }
...@@ -95,19 +102,33 @@ class AudioApiRequestUtil { ...@@ -95,19 +102,33 @@ class AudioApiRequestUtil {
* 获取声网登录token * 获取声网登录token
*/ */
fun listenToken(cmd: ListenTokenCmd): Observable<BaseResponse<ListenTokenBean>> { fun listenToken(cmd: ListenTokenCmd): Observable<BaseResponse<ListenTokenBean>> {
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).listenToken(NetworkParamsUtils.getMaps(cmd)) return YDLHttpUtils.obtainApi(AudioNetAPi::class.java)
.listenToken(NetworkParamsUtils.getMaps(cmd))
} }
fun callEndStatusUpdate(channelId: String, endStatus: Int, msg: String): Observable<BaseAPIResponse<Any>> { fun callEndStatusUpdate(
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).callEndStatusUpdate(channelId, endStatus, msg) channelId: String,
endStatus: Int,
msg: String
): Observable<BaseAPIResponse<Any>> {
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java)
.callEndStatusUpdate(channelId, endStatus, msg)
} }
fun callEventSave( session: String?, fun callEventSave(
line: String, session: String?,
status: String, line: String,
reponse: String): Observable<BaseAPIResponse<Any>> { status: String,
response: String
): Observable<BaseAPIResponse<Any>> {
var eventTime = TimeUtil.getNowDatetime() var eventTime = TimeUtil.getNowDatetime()
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).callEventSave(session,eventTime,line,status,reponse) var param = CallEventRequestBody(session, line, status, response, eventTime);
var str = Gson().toJson(param)
val body = RequestBody.create(
MediaType.parse("application/json; charset=utf-8"),
str
) as RequestBody
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).callEventSave(body)
} }
} }
} }
\ No newline at end of file
...@@ -76,11 +76,5 @@ interface AudioNetAPi { ...@@ -76,11 +76,5 @@ interface AudioNetAPi {
//倾诉事件上报接口 //倾诉事件上报接口
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json") @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
@POST("call/v1/event/save") @POST("call/v1/event/save")
fun callEventSave( fun callEventSave(@Body body: RequestBody): Observable<BaseAPIResponse<Any>>
@Query("session") session: String?,
@Query("eventTime") eventTime: String,
@Query("line") line: String,
@Query("status") status: String,
@Query("reponse") reponse: String
): Observable<BaseAPIResponse<Any>>
} }
\ No newline at end of file
...@@ -24,7 +24,6 @@ import com.tbruyelle.rxpermissions2.RxPermissions ...@@ -24,7 +24,6 @@ import com.tbruyelle.rxpermissions2.RxPermissions
import com.ydl.audioim.BuildConfig import com.ydl.audioim.BuildConfig
import com.ydl.audioim.R import com.ydl.audioim.R
import com.ydl.audioim.YDLavManager import com.ydl.audioim.YDLavManager
import com.ydl.audioim.http.AudioApiRequestUtil
import com.ydl.audioim.http.command.ConnectExceptionCommand import com.ydl.audioim.http.command.ConnectExceptionCommand
import com.ydl.audioim.http.command.PayLoad import com.ydl.audioim.http.command.PayLoad
import com.ydl.audioim.player.AudioPlayer import com.ydl.audioim.player.AudioPlayer
...@@ -1111,10 +1110,6 @@ class ConsultantAudioHomeActivity : ...@@ -1111,10 +1110,6 @@ class ConsultantAudioHomeActivity :
session: String? = channelToken, session: String? = channelToken,
line: String = "7" line: String = "7"
) { ) {
YDLavManager.instances.callEventSave(status, res, session, line)
AudioApiRequestUtil.callEventSave(session, line, status, res)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe()
} }
} }
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