panlinlin
2021-04-15 937e59143004b11a808eb93eb894ffe53871a19a
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
@@ -23,7 +23,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
// import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
@@ -341,7 +340,7 @@
   @Override
   public void playStreamCmd(Device device, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent) {
      try {
         if (device == null) return;
         String ssrc = streamSession.createPlaySsrc();
         String streamId = null;
         if (rtpEnable) {
@@ -366,9 +365,14 @@
         // 添加订阅
         JSONObject subscribeKey = new JSONObject();
         subscribeKey.put("app", "rtp");
         subscribeKey.put("id", streamId);
         subscribeKey.put("stream", streamId);
         subscribeKey.put("regist", true);
         subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, subscribeKey, event);
         subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey, json->{
            if (json.getJSONArray("tracks") == null) return;
            event.response(json);
            subscribe.removeSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey);
         });
         //
         StringBuffer content = new StringBuffer(200);
         content.append("v=0\r\n");
@@ -466,9 +470,14 @@
         // 添加订阅
         JSONObject subscribeKey = new JSONObject();
         subscribeKey.put("app", "rtp");
         subscribeKey.put("id", streamId);
         subscribeKey.put("stream", streamId);
         subscribeKey.put("regist", true);
         subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, subscribeKey, event);
         subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey, json->{
            if (json.getJSONArray("tracks") == null) return;
            event.response(json);
            subscribe.removeSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey);
         });
         StringBuffer content = new StringBuffer(200);
           content.append("v=0\r\n");