Commit 8c3b433e by 严久程

通话结束后增加接口调用

parent 82809e56
ext { ext {
kotlin_version = "1.3.21" kotlin_version = "1.3.21"
dev_mode = true dev_mode = false
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.48.23", "m-confide" : "0.0.48.42",
"m-consultant" : "0.0.59.10", "m-consultant" : "0.0.59.10",
"m-fm" : "0.0.29.9", "m-fm" : "0.0.29.9",
"m-user" : "0.0.60.8", "m-user" : "0.0.60.8",
"m-home" : "0.0.22.3", "m-home" : "0.0.22.3",
"m-im" : "0.0.18.4", "m-im" : "0.0.18.5",
"m-dynamic" : "0.0.7.7", "m-dynamic" : "0.0.7.7",
"m-article" : "0.0.0.5", "m-article" : "0.0.0.5",
...@@ -28,7 +28,7 @@ ext { ...@@ -28,7 +28,7 @@ ext {
"m-tests-api" : "0.0.2", "m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.15", "m-user-api" : "0.0.10.15",
"m-home-api" : "0.0.4.1", "m-home-api" : "0.0.4.1",
"m-im-api" : "0.0.12.19", "m-im-api" : "0.0.12.20",
"m-dynamic-api" : "0.0.3.7", "m-dynamic-api" : "0.0.3.7",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
...@@ -39,7 +39,7 @@ ext { ...@@ -39,7 +39,7 @@ ext {
"ydl-webview" : "0.0.38.31", "ydl-webview" : "0.0.38.31",
"ydl-media" : "0.0.21.6", "ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.9", "ydl-pay" : "0.0.18.9",
"m-audioim" : "0.0.49.2", "m-audioim" : "0.0.49.13",
"ydl-flutter-base": "0.0.14.14", "ydl-flutter-base": "0.0.14.14",
//以下 几乎不会动 //以下 几乎不会动
...@@ -111,7 +111,7 @@ ext { ...@@ -111,7 +111,7 @@ ext {
"m-tests-api" : "0.0.2", "m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.15", "m-user-api" : "0.0.10.15",
"m-home-api" : "0.0.4.1", "m-home-api" : "0.0.4.1",
"m-im-api" : "0.0.12.18", "m-im-api" : "0.0.12.20",
"m-dynamic-api" : "0.0.3.7", "m-dynamic-api" : "0.0.3.7",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
...@@ -122,7 +122,7 @@ ext { ...@@ -122,7 +122,7 @@ ext {
"ydl-webview" : "0.0.38.31", "ydl-webview" : "0.0.38.31",
"ydl-media" : "0.0.21.6", "ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.9", "ydl-pay" : "0.0.18.9",
"m-audioim" : "0.0.49.2", "m-audioim" : "0.0.49.13",
"ydl-flutter-base": "0.0.14.14", "ydl-flutter-base": "0.0.14.14",
//以下 几乎不会动 //以下 几乎不会动
......
package com.ydl.audioim.bean;
/**
* @author jiucheng
* @描述:自定义的Invitation
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2020/4/23
*/
public class AgoraInvitationBean {
public String data;
public String business="agora";
public String callType;//1发起呼叫 2接受呼叫 3取消呼叫 4拒绝呼叫邀请 5呼叫超时
}
...@@ -3,7 +3,9 @@ package com.ydl.audioim.http ...@@ -3,7 +3,9 @@ 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.ConnectBean import com.ydl.audioim.bean.ConnectBean
import com.ydl.audioim.http.command.* import com.ydl.audioim.http.command.ConnectCommand
import com.ydl.audioim.http.command.ConnectExceptionCommand
import com.ydl.audioim.http.command.NoticePushCommand
import com.ydl.consultantim.bean.ListenTokenBean import com.ydl.consultantim.bean.ListenTokenBean
import com.ydl.consultantim.command.ListenTokenCmd import com.ydl.consultantim.command.ListenTokenCmd
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
...@@ -29,8 +31,7 @@ class AudioApiRequestUtil { ...@@ -29,8 +31,7 @@ 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 { .flatMap { it ->
it->
YDLHttpUtils.obtainApi(AudioNetAPi::class.java).connectListen(it) YDLHttpUtils.obtainApi(AudioNetAPi::class.java).connectListen(it)
} }
} }
...@@ -85,15 +86,19 @@ class AudioApiRequestUtil { ...@@ -85,15 +86,19 @@ class AudioApiRequestUtil {
/** /**
* 获取声网登录token * 获取声网登录token
*/ */
fun getAgoraToken(): Observable<BaseAPIResponse<AgoraTokenResponse>>{ fun getAgoraToken(): Observable<BaseAPIResponse<AgoraTokenResponse>> {
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).getAgoraToken() return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).getAgoraToken()
} }
/** /**
* 获取声网登录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<BaseResponse<Any>> {
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).callEndStatusUpdate(channelId, endStatus, msg)
}
} }
} }
\ No newline at end of file
...@@ -69,4 +69,7 @@ interface AudioNetAPi { ...@@ -69,4 +69,7 @@ interface AudioNetAPi {
fun listenToken(@FieldMap map: Map<String, String>): Observable<BaseResponse<ListenTokenBean>> fun listenToken(@FieldMap map: Map<String, String>): Observable<BaseResponse<ListenTokenBean>>
@GET("message/call-end/agora")
fun callEndStatusUpdate(channelId:String,endStatus:Int,msg:String): Observable<BaseResponse<Any>>
} }
\ No newline at end of file
...@@ -42,7 +42,7 @@ import java.util.concurrent.Executors ...@@ -42,7 +42,7 @@ import java.util.concurrent.Executors
*/ */
class ImObserversHelper { class ImObserversHelper {
var imCustomNotificationCallBack: IMRegisterObserverCustomNotificationCallBack? = null var imCustomNotificationCallBack: IMRegisterObserverCustomNotificationCallBack? = null
set(value) { set(value) {
field = value field = value
} }
...@@ -174,7 +174,7 @@ class ImObserversHelper { ...@@ -174,7 +174,7 @@ class ImObserversHelper {
private var receiveSystemMessageObserver: Observer<CustomNotification> = Observer<CustomNotification> { private var receiveSystemMessageObserver: Observer<CustomNotification> = Observer<CustomNotification> {
LogUtil.e(it.content) LogUtil.e(it.content)
imCustomNotificationCallBack?.onObserverCustomNotification(it.content) imCustomNotificationCallBack?.onObserverCustomNotification(it.fromAccount, it.sessionId, it.content)
} }
private var msgRevokeFilter = MsgRevokeFilter { message -> private var msgRevokeFilter = MsgRevokeFilter { message ->
......
...@@ -9,5 +9,5 @@ package com.yidianling.im.api.bean ...@@ -9,5 +9,5 @@ package com.yidianling.im.api.bean
*/ */
interface IMRegisterObserverCustomNotificationCallBack { interface IMRegisterObserverCustomNotificationCallBack {
fun onObserverCustomNotification(content: String) fun onObserverCustomNotification(fromUid:String,toUid:String,content: String)
} }
\ 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