sdk add conference rtp forward api

This commit is contained in:
heavyrian2012
2022-12-13 17:38:21 +08:00
parent 9047020d69
commit 9c69fbc7d4
5 changed files with 41 additions and 0 deletions
@@ -94,6 +94,7 @@ public interface APIPath {
String Conference_Create = "/admin/conference/create";
String Conference_Destroy = "/admin/conference/destroy";
String Conference_Recording = "/admin/conference/recording";
String Conference_Rtp_Forward = "/admin/conference/rtp_forward";
String Channel_User_Info = "/channel/user_info";
String Channel_Update_Profile = "/channel/update_profile";
@@ -61,6 +61,8 @@ public enum ErrorCode {
ERROR_CODE_SECRET_CHAT_MO_DISABLED(86, "origin side disable secret chat"),
ERROR_CODE_SECRET_CHAT_MT_DISABLED(87, "target side disable secret chat"),
ERROR_CODE_CONFERENCE_ERROR(90, "Conference server response error"),
ERROR_CODE_FUNCTION_DISABLED(220, "function disabled"),
ERROR_CODE_CHANNEL_NO_EXIST(236, "channel no exist"),
@@ -0,0 +1,20 @@
package cn.wildfirechat.pojos;
public class PojoConferenceRtpForwardReq {
public String roomId;
public String publisherId;
public String host;
public int audioPort;
public int videoPort;
public PojoConferenceRtpForwardReq() {
}
public PojoConferenceRtpForwardReq(String roomId, String publisherId, String host, int audioPort, int videoPort) {
this.roomId = roomId;
this.publisherId = publisherId;
this.host = host;
this.audioPort = audioPort;
this.videoPort = videoPort;
}
}
@@ -45,4 +45,15 @@ public class ConferenceAdmin {
PojoConferenceRoomId conferenceRoomId = new PojoConferenceRoomId(roomId, advance);
return AdminHttpUtils.httpJsonPost(path, conferenceRoomId, Void.class);
}
public static IMResult<Void> rtpForward(String roomId, String userId, String rtpHost, int rtpPort) throws Exception {
String path = APIPath.Conference_Rtp_Forward;
PojoConferenceRtpForwardReq req = new PojoConferenceRtpForwardReq();
req.roomId = roomId;
req.publisherId = userId;
req.host = rtpHost;
req.audioPort = rtpPort;
req.videoPort = rtpPort;
return AdminHttpUtils.httpJsonPost(path, req, Void.class);
}
}
@@ -1708,5 +1708,12 @@ public class Main {
System.out.println("list participants success");
}
}
IMResult<Void> rtpForwardResult = ConferenceAdmin.rtpForward("5156250396", "lhgqmws2k", "192.168.1.81", 8000);
if(rtpForwardResult == null || rtpForwardResult.getErrorCode() != ErrorCode.ERROR_CODE_SUCCESS) {
System.out.println("rtp forward failure");
} else {
System.out.println("rtp forward success");
}
}
}