|
@@ -1,12 +1,10 @@
|
|
|
package org.jetlinks.community.media.transmit;
|
|
package org.jetlinks.community.media.transmit;
|
|
|
|
|
|
|
|
|
|
|
|
|
-import gov.nist.javax.sip.header.SIPDateHeader;
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.jetlinks.community.media.bean.StreamInfo;
|
|
import org.jetlinks.community.media.bean.StreamInfo;
|
|
|
import org.jetlinks.community.media.entity.MediaDevice;
|
|
import org.jetlinks.community.media.entity.MediaDevice;
|
|
|
-import org.jetlinks.community.media.bean.SipServerConfig;
|
|
|
|
|
-import org.jetlinks.community.media.bean.WvpSipDate;
|
|
|
|
|
|
|
+import org.jetlinks.community.media.entity.SipGateway;
|
|
|
import org.jetlinks.community.media.sip.SipContext;
|
|
import org.jetlinks.community.media.sip.SipContext;
|
|
|
import org.jetlinks.community.media.storage.impl.RedisCacheStorageImpl;
|
|
import org.jetlinks.community.media.storage.impl.RedisCacheStorageImpl;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
@@ -21,9 +19,6 @@ import javax.sip.header.*;
|
|
|
import javax.sip.message.Request;
|
|
import javax.sip.message.Request;
|
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
|
|
-import java.util.Calendar;
|
|
|
|
|
-import java.util.Locale;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @description:摄像头命令request创造器 TODO 冗余代码太多待优化
|
|
* @description:摄像头命令request创造器 TODO 冗余代码太多待优化
|
|
@@ -40,7 +35,7 @@ public class SIPRequestHeaderProvider {
|
|
|
// private VideoStreamSessionManager streamSession;
|
|
// private VideoStreamSessionManager streamSession;
|
|
|
|
|
|
|
|
public Request createMessageRequest(MediaDevice device, String content, String viaTag, String fromTag, String toTag, CallIdHeader callIdHeader) throws ParseException, InvalidArgumentException, PeerUnavailableException {
|
|
public Request createMessageRequest(MediaDevice device, String content, String viaTag, String fromTag, String toTag, CallIdHeader callIdHeader) throws ParseException, InvalidArgumentException, PeerUnavailableException {
|
|
|
- SipServerConfig sipConfig=SipContext.getConfig();
|
|
|
|
|
|
|
+ SipGateway sipConfig=SipContext.getConfig();
|
|
|
SipFactory sipFactory=SipContext.getSipFactory();
|
|
SipFactory sipFactory=SipContext.getSipFactory();
|
|
|
Request request = null;
|
|
Request request = null;
|
|
|
// sipuri
|
|
// sipuri
|
|
@@ -73,7 +68,7 @@ public class SIPRequestHeaderProvider {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public Request createInviteRequest(MediaDevice device, String channelId, String content, String viaTag, String fromTag, String toTag, String ssrc, CallIdHeader callIdHeader) throws ParseException, InvalidArgumentException, PeerUnavailableException {
|
|
public Request createInviteRequest(MediaDevice device, String channelId, String content, String viaTag, String fromTag, String toTag, String ssrc, CallIdHeader callIdHeader) throws ParseException, InvalidArgumentException, PeerUnavailableException {
|
|
|
- SipServerConfig sipConfig=SipContext.getConfig();
|
|
|
|
|
|
|
+ SipGateway sipConfig=SipContext.getConfig();
|
|
|
SipFactory sipFactory=SipContext.getSipFactory();
|
|
SipFactory sipFactory=SipContext.getSipFactory();
|
|
|
Request request = null;
|
|
Request request = null;
|
|
|
//请求行
|
|
//请求行
|
|
@@ -131,7 +126,7 @@ public class SIPRequestHeaderProvider {
|
|
|
|
|
|
|
|
|
|
|
|
|
public Request createPlaybackInviteRequest(MediaDevice device, String channelId, String content, String viaTag, String fromTag, String toTag, CallIdHeader callIdHeader, String ssrc) throws ParseException, InvalidArgumentException, PeerUnavailableException {
|
|
public Request createPlaybackInviteRequest(MediaDevice device, String channelId, String content, String viaTag, String fromTag, String toTag, CallIdHeader callIdHeader, String ssrc) throws ParseException, InvalidArgumentException, PeerUnavailableException {
|
|
|
- SipServerConfig sipConfig=SipContext.getConfig();
|
|
|
|
|
|
|
+ SipGateway sipConfig=SipContext.getConfig();
|
|
|
SipFactory sipFactory=SipContext.getSipFactory();
|
|
SipFactory sipFactory=SipContext.getSipFactory();
|
|
|
Request request = null;
|
|
Request request = null;
|
|
|
//请求行
|
|
//请求行
|
|
@@ -173,7 +168,7 @@ public class SIPRequestHeaderProvider {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public Request createByteRequest(MediaDevice device, String channelId, String viaTag, String fromTag, String toTag, String callId) throws ParseException, InvalidArgumentException, PeerUnavailableException {
|
|
public Request createByteRequest(MediaDevice device, String channelId, String viaTag, String fromTag, String toTag, String callId) throws ParseException, InvalidArgumentException, PeerUnavailableException {
|
|
|
- SipServerConfig sipConfig=SipContext.getConfig();
|
|
|
|
|
|
|
+ SipGateway sipConfig=SipContext.getConfig();
|
|
|
SipFactory sipFactory=SipContext.getSipFactory();
|
|
SipFactory sipFactory=SipContext.getSipFactory();
|
|
|
Request request = null;
|
|
Request request = null;
|
|
|
//请求行
|
|
//请求行
|
|
@@ -205,7 +200,7 @@ public class SIPRequestHeaderProvider {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public Request createSubscribeRequest(MediaDevice device, String content, String viaTag, String fromTag, String toTag, Integer expires, String event, CallIdHeader callIdHeader) throws ParseException, InvalidArgumentException, PeerUnavailableException {
|
|
public Request createSubscribeRequest(MediaDevice device, String content, String viaTag, String fromTag, String toTag, Integer expires, String event, CallIdHeader callIdHeader) throws ParseException, InvalidArgumentException, PeerUnavailableException {
|
|
|
- SipServerConfig sipConfig=SipContext.getConfig();
|
|
|
|
|
|
|
+ SipGateway sipConfig=SipContext.getConfig();
|
|
|
SipFactory sipFactory=SipContext.getSipFactory();
|
|
SipFactory sipFactory=SipContext.getSipFactory();
|
|
|
Request request = null;
|
|
Request request = null;
|
|
|
// sipuri
|
|
// sipuri
|
|
@@ -254,7 +249,7 @@ public class SIPRequestHeaderProvider {
|
|
|
|
|
|
|
|
public Request createInfoRequest(MediaDevice device, StreamInfo streamInfo, String content, Long cseq)
|
|
public Request createInfoRequest(MediaDevice device, StreamInfo streamInfo, String content, Long cseq)
|
|
|
throws PeerUnavailableException, ParseException, InvalidArgumentException {
|
|
throws PeerUnavailableException, ParseException, InvalidArgumentException {
|
|
|
- SipServerConfig sipConfig=SipContext.getConfig();
|
|
|
|
|
|
|
+ SipGateway sipConfig=SipContext.getConfig();
|
|
|
SipFactory sipFactory=SipContext.getSipFactory();
|
|
SipFactory sipFactory=SipContext.getSipFactory();
|
|
|
Request request = null;
|
|
Request request = null;
|
|
|
//todo
|
|
//todo
|