| | |
| | | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderPlarformProvider; |
| | | import com.genersoft.iot.vmp.gb28181.utils.DateUtil; |
| | | import com.genersoft.iot.vmp.utils.DateUtil; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | |
| | | import javax.sip.header.*; |
| | | import javax.sip.message.Request; |
| | | import java.lang.reflect.Field; |
| | | import java.net.InetAddress; |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | |
| | | // 设置编码, 防止中文乱码 |
| | | messageFactory.setDefaultContentEncodingCharset(characterSet); |
| | | Dialog dialog = subscribeInfo.getDialog(); |
| | | if (dialog == null || !dialog.getState().equals(DialogState.CONFIRMED)) return; |
| | | if (dialog == null || !dialog.getState().equals(DialogState.CONFIRMED)) { |
| | | return; |
| | | } |
| | | SIPRequest notifyRequest = (SIPRequest)dialog.createRequest(Request.NOTIFY); |
| | | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); |
| | | notifyRequest.setContent(catalogXmlContent, contentTypeHeader); |
| | |
| | | } |
| | | notifyRequest.addHeader(event); |
| | | SipURI sipURI = (SipURI) notifyRequest.getRequestURI(); |
| | | if (subscribeInfo.getTransaction() != null) { |
| | | SIPRequest request = (SIPRequest) subscribeInfo.getTransaction().getRequest(); |
| | | sipURI.setHost(request.getRemoteAddress().getHostAddress()); |
| | | sipURI.setPort(request.getRemotePort()); |
| | | }else { |
| | | sipURI.setHost(parentPlatform.getServerIP()); |
| | | sipURI.setPort(parentPlatform.getServerPort()); |
| | | } |
| | | sipURI.setHost(parentPlatform.getServerIP()); |
| | | sipURI.setPort(parentPlatform.getServerPort()); |
| | | |
| | | ClientTransaction transaction = null; |
| | | if ("TCP".equals(parentPlatform.getTransport())) { |