| | |
| | | package com.genersoft.iot.vmp.gb28181.transmit.cmd.impl;
|
| | |
|
| | | import java.text.ParseException;
|
| | | import java.util.regex.Matcher;
|
| | | import java.util.regex.Pattern;
|
| | |
|
| | | import javax.sip.ClientTransaction;
|
| | | import javax.sip.Dialog;
|
| | | import javax.sip.InvalidArgumentException;
|
| | | import javax.sip.SipException;
|
| | | import javax.sip.SipFactory;
|
| | | import javax.sip.SipProvider;
|
| | | import javax.sip.TransactionDoesNotExistException;
|
| | | import javax.sip.address.Address;
|
| | | import javax.sip.address.SipURI;
|
| | | import javax.sip.header.ViaHeader;
|
| | | import javax.sip.message.Request;
|
| | |
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.boot.autoconfigure.security.SecurityProperties.Headers;
|
| | | import org.springframework.beans.factory.annotation.Qualifier;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.genersoft.iot.vmp.conf.SipConfig;
|
| | | import com.genersoft.iot.vmp.gb28181.SipLayer;
|
| | | import com.genersoft.iot.vmp.gb28181.bean.Device;
|
| | | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderProvider;
|
| | | import com.genersoft.iot.vmp.gb28181.utils.DateUtil;
|
| | |
|
| | | import java.util.regex.Pattern;
|
| | | import java.util.regex.Matcher;
|
| | |
|
| | | /**
|
| | | * @Description:设备能力接口,用于定义设备的控制、查询能力
|
| | |
| | | private SIPRequestHeaderProvider headerProvider;
|
| | |
|
| | | @Autowired
|
| | | private SipLayer sipLayer;
|
| | | private VideoStreamSessionManager streamSession;
|
| | |
|
| | | @Autowired
|
| | | private VideoStreamSessionManager streamSession;
|
| | | @Qualifier(value="tcpSipProvider")
|
| | | private SipProvider tcpSipProvider;
|
| | | |
| | | @Autowired
|
| | | @Qualifier(value="udpSipProvider")
|
| | | private SipProvider udpSipProvider;
|
| | |
|
| | | /**
|
| | | * 云台方向放控制,使用配置文件中的默认镜头移动速度
|
| | |
| | | String protocol = viaHeader.getTransport().toUpperCase();
|
| | | ClientTransaction clientTransaction = null;
|
| | | if("TCP".equals(protocol)) {
|
| | | clientTransaction = sipLayer.getTcpSipProvider().getNewClientTransaction(byeRequest);
|
| | | clientTransaction = tcpSipProvider.getNewClientTransaction(byeRequest);
|
| | | } else if("UDP".equals(protocol)) {
|
| | | clientTransaction = sipLayer.getUdpSipProvider().getNewClientTransaction(byeRequest);
|
| | | clientTransaction = udpSipProvider.getNewClientTransaction(byeRequest);
|
| | | }
|
| | | dialog.sendRequest(clientTransaction);
|
| | | } catch (TransactionDoesNotExistException e) {
|
| | |
| | | private ClientTransaction transmitRequest(Device device, Request request) throws SipException {
|
| | | ClientTransaction clientTransaction = null;
|
| | | if("TCP".equals(device.getTransport())) {
|
| | | clientTransaction = sipLayer.getTcpSipProvider().getNewClientTransaction(request);
|
| | | clientTransaction = tcpSipProvider.getNewClientTransaction(request);
|
| | | } else if("UDP".equals(device.getTransport())) {
|
| | | clientTransaction = sipLayer.getUdpSipProvider().getNewClientTransaction(request);
|
| | | clientTransaction = udpSipProvider.getNewClientTransaction(request);
|
| | | }
|
| | | clientTransaction.sendRequest();
|
| | | return clientTransaction;
|