Merge branch 'master' into dev/springBoot3
This commit is contained in:
@@ -3,6 +3,8 @@ package com.genersoft.iot.vmp.gb28181.bean;
|
||||
import gov.nist.javax.sip.message.SIPResponse;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.sip.header.EventHeader;
|
||||
|
||||
@Data
|
||||
public class SipTransactionInfo {
|
||||
|
||||
@@ -12,6 +14,7 @@ public class SipTransactionInfo {
|
||||
private String viaBranch;
|
||||
private int expires;
|
||||
private String user;
|
||||
private String eventId;
|
||||
|
||||
// 自己是否媒体流发送者
|
||||
private boolean asSender;
|
||||
@@ -22,6 +25,10 @@ public class SipTransactionInfo {
|
||||
this.toTag = response.getToTag();
|
||||
this.viaBranch = response.getTopmostViaHeader().getBranch();
|
||||
this.asSender = asSender;
|
||||
EventHeader header = (EventHeader)response.getHeader(EventHeader.NAME);
|
||||
if (header != null) {
|
||||
this.eventId = header.getEventId();
|
||||
}
|
||||
}
|
||||
|
||||
public SipTransactionInfo(SIPResponse response) {
|
||||
@@ -30,6 +37,10 @@ public class SipTransactionInfo {
|
||||
this.toTag = response.getToTag();
|
||||
this.viaBranch = response.getTopmostViaHeader().getBranch();
|
||||
this.asSender = false;
|
||||
EventHeader header = (EventHeader)response.getHeader(EventHeader.NAME);
|
||||
if (header != null) {
|
||||
this.eventId = header.getEventId();
|
||||
}
|
||||
}
|
||||
|
||||
public SipTransactionInfo() {
|
||||
|
||||
@@ -269,12 +269,15 @@ public class SIPRequestHeaderProvider {
|
||||
ExpiresHeader expireHeader = SipFactory.getInstance().createHeaderFactory().createExpiresHeader(expires);
|
||||
request.addHeader(expireHeader);
|
||||
|
||||
// Event
|
||||
EventHeader eventHeader = SipFactory.getInstance().createHeaderFactory().createEventHeader(event);
|
||||
|
||||
int random = (int) Math.floor(Math.random() * 10000);
|
||||
eventHeader.setEventId(random + "");
|
||||
request.addHeader(eventHeader);
|
||||
// Event
|
||||
EventHeader eventHeader = SipFactory.getInstance().createHeaderFactory().createEventHeader(event);
|
||||
if (sipTransactionInfo != null && sipTransactionInfo.getEventId() != null) {
|
||||
eventHeader.setEventId(sipTransactionInfo.getEventId());
|
||||
}else {
|
||||
int random = (int) Math.floor(Math.random() * 10000);
|
||||
eventHeader.setEventId(random + "");
|
||||
}
|
||||
request.addHeader(eventHeader);
|
||||
|
||||
ContentTypeHeader contentTypeHeader = SipFactory.getInstance().createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml");
|
||||
request.setContent(content, contentTypeHeader);
|
||||
|
||||
@@ -1203,7 +1203,13 @@ public class SIPCommander implements ISIPCommander {
|
||||
} else {
|
||||
callIdHeader = sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport());
|
||||
}
|
||||
SIPRequest request = (SIPRequest) headerProvider.createSubscribeRequest(device, subscribePostitionXml.toString(), sipTransactionInfo, device.getSubscribeCycleForMobilePosition(), "presence",callIdHeader); //Position;id=" + tm.substring(tm.length() - 4));
|
||||
|
||||
int subscribeCycleForMobilePosition = device.getSubscribeCycleForMobilePosition();
|
||||
if (subscribeCycleForMobilePosition > 0) {
|
||||
// 移动位置订阅有效期不小于 30 秒
|
||||
subscribeCycleForMobilePosition = Math.max(subscribeCycleForMobilePosition, 30);
|
||||
}
|
||||
SIPRequest request = (SIPRequest) headerProvider.createSubscribeRequest(device, subscribePostitionXml.toString(), sipTransactionInfo, subscribeCycleForMobilePosition, "presence",callIdHeader); //Position;id=" + tm.substring(tm.length() - 4));
|
||||
|
||||
sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent, okEvent);
|
||||
return request;
|
||||
@@ -1275,8 +1281,13 @@ public class SIPCommander implements ISIPCommander {
|
||||
callIdHeader = sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport());
|
||||
}
|
||||
|
||||
int subscribeCycleForCatalog = device.getSubscribeCycleForCatalog();
|
||||
if (subscribeCycleForCatalog > 0) {
|
||||
// 目录订阅有效期不小于 30 秒
|
||||
subscribeCycleForCatalog = Math.max(subscribeCycleForCatalog, 30);
|
||||
}
|
||||
// 有效时间默认为60秒以上
|
||||
SIPRequest request = (SIPRequest) headerProvider.createSubscribeRequest(device, cmdXml.toString(), sipTransactionInfo, device.getSubscribeCycleForCatalog(), "Catalog",
|
||||
SIPRequest request = (SIPRequest) headerProvider.createSubscribeRequest(device, cmdXml.toString(), sipTransactionInfo, subscribeCycleForCatalog, "Catalog",
|
||||
callIdHeader);
|
||||
sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent, okEvent);
|
||||
return request;
|
||||
|
||||
@@ -17,5 +17,8 @@ public class ABLUrls {
|
||||
@JSONField(name = "http-mp4")
|
||||
private String httpMp4;
|
||||
|
||||
@JSONField(name = "http-hls")
|
||||
private String httpHls;
|
||||
|
||||
private String download;
|
||||
}
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.genersoft.iot.vmp.media.abl.bean;
|
||||
|
||||
public class AblUrls {
|
||||
private String rtsp;
|
||||
private String rtmp;
|
||||
private String httpFlv;
|
||||
private String wsFlv;
|
||||
private String httpMp4;
|
||||
private String httpHls;
|
||||
|
||||
public String getRtsp() {
|
||||
return rtsp;
|
||||
}
|
||||
|
||||
public void setRtsp(String rtsp) {
|
||||
this.rtsp = rtsp;
|
||||
}
|
||||
|
||||
public String getRtmp() {
|
||||
return rtmp;
|
||||
}
|
||||
|
||||
public void setRtmp(String rtmp) {
|
||||
this.rtmp = rtmp;
|
||||
}
|
||||
|
||||
public String getHttpFlv() {
|
||||
return httpFlv;
|
||||
}
|
||||
|
||||
public void setHttpFlv(String httpFlv) {
|
||||
this.httpFlv = httpFlv;
|
||||
}
|
||||
|
||||
public String getWsFlv() {
|
||||
return wsFlv;
|
||||
}
|
||||
|
||||
public void setWsFlv(String wsFlv) {
|
||||
this.wsFlv = wsFlv;
|
||||
}
|
||||
|
||||
public String getHttpMp4() {
|
||||
return httpMp4;
|
||||
}
|
||||
|
||||
public void setHttpMp4(String httpMp4) {
|
||||
this.httpMp4 = httpMp4;
|
||||
}
|
||||
|
||||
public String getHttpHls() {
|
||||
return httpHls;
|
||||
}
|
||||
|
||||
public void setHttpHls(String httpHls) {
|
||||
this.httpHls = httpHls;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.genersoft.iot.vmp.media.abl.bean.hook;
|
||||
|
||||
import com.genersoft.iot.vmp.media.abl.bean.AblUrls;
|
||||
import com.genersoft.iot.vmp.media.abl.bean.ABLUrls;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -108,5 +108,5 @@ public class OnStreamArriveABLHookParam extends ABLHookParam{
|
||||
private Integer audioBitrate;
|
||||
|
||||
|
||||
private AblUrls url;
|
||||
private ABLUrls url;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user