diff --git a/common/src/main/java/cn/wildfirechat/common/APIPath.java b/common/src/main/java/cn/wildfirechat/common/APIPath.java index d98a536b..d3cd6bd1 100644 --- a/common/src/main/java/cn/wildfirechat/common/APIPath.java +++ b/common/src/main/java/cn/wildfirechat/common/APIPath.java @@ -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"; diff --git a/common/src/main/java/cn/wildfirechat/common/ErrorCode.java b/common/src/main/java/cn/wildfirechat/common/ErrorCode.java index 393cd0f6..b34d91bd 100755 --- a/common/src/main/java/cn/wildfirechat/common/ErrorCode.java +++ b/common/src/main/java/cn/wildfirechat/common/ErrorCode.java @@ -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"), diff --git a/common/src/main/java/cn/wildfirechat/pojos/PojoConferenceRtpForwardReq.java b/common/src/main/java/cn/wildfirechat/pojos/PojoConferenceRtpForwardReq.java new file mode 100644 index 00000000..389047da --- /dev/null +++ b/common/src/main/java/cn/wildfirechat/pojos/PojoConferenceRtpForwardReq.java @@ -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; + } +} diff --git a/sdk/src/main/java/cn/wildfirechat/sdk/ConferenceAdmin.java b/sdk/src/main/java/cn/wildfirechat/sdk/ConferenceAdmin.java index 12036138..e1bfaa8c 100644 --- a/sdk/src/main/java/cn/wildfirechat/sdk/ConferenceAdmin.java +++ b/sdk/src/main/java/cn/wildfirechat/sdk/ConferenceAdmin.java @@ -45,4 +45,15 @@ public class ConferenceAdmin { PojoConferenceRoomId conferenceRoomId = new PojoConferenceRoomId(roomId, advance); return AdminHttpUtils.httpJsonPost(path, conferenceRoomId, Void.class); } + + public static IMResult 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); + } } diff --git a/sdk/src/main/java/cn/wildfirechat/sdk/Main.java b/sdk/src/main/java/cn/wildfirechat/sdk/Main.java index 8643328a..c99d0a02 100644 --- a/sdk/src/main/java/cn/wildfirechat/sdk/Main.java +++ b/sdk/src/main/java/cn/wildfirechat/sdk/Main.java @@ -1708,5 +1708,12 @@ public class Main { System.out.println("list participants success"); } } + + IMResult 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"); + } } }