Browse Source

ssrc规则修改

ntv-wangjian 3 years ago
parent
commit
c1abe83619
1 changed files with 13 additions and 4 deletions
  1. 13
    4
      GB28181Session.js

+ 13
- 4
GB28181Session.js View File

65
 
65
 
66
         this.TAG = 'sip';
66
         this.TAG = 'sip';
67
 
67
 
68
+        //ntv add play mode prop
69
+        this.playmode='';
70
+
68
         context.sessions.set(this.id, this);
71
         context.sessions.set(this.id, this);
69
     }
72
     }
70
 
73
 
738
             //let ssrc = "0" + channelId.substring(16, 20) + channelId.substring(3, 8);
741
             //let ssrc = "0" + channelId.substring(16, 20) + channelId.substring(3, 8);
739
             let ssed = channelId.substring(13, 20);
742
             let ssed = channelId.substring(13, 20);
740
             let ised = '' + (parseInt(ssed)*13+10000);
743
             let ised = '' + (parseInt(ssed)*13+10000);
741
-            let ssrc = "0" + ssed + ised.substring(3,5);
744
+            let ssrc = "1" + ssed + ised.substring(3,5);
742
 
745
 
743
             let host = rhost || "127.0.0.1";
746
             let host = rhost || "127.0.0.1";
744
 
747
 
840
                                                 to: response.headers.to,
843
                                                 to: response.headers.to,
841
                                                 from: response.headers.from,
844
                                                 from: response.headers.from,
842
                                                 'call-id': response.headers['call-id'],
845
                                                 'call-id': response.headers['call-id'],
843
-                                                cseq: { method: 'BYE', seq: response.headers.cseq.seq++ }//需额外加1
846
+                                                //cseq: { method: 'BYE', seq: response.headers.cseq.seq++ }//需额外加1
847
+                                                cseq: { method: 'BYE', seq: response.headers.cseq.seq+1 }  // ntv modify, 上一语句是基本语法不熟悉,实际没有加1
844
                                             }
848
                                             }
845
                                         }
849
                                         }
846
 
850
 
849
 
853
 
850
                                     result.data = { ssrc: ssrc };
854
                                     result.data = { ssrc: ssrc };
851
 
855
 
856
+                                    //ntv
857
+                                    that.playmode='realplay';
858
+
852
                                     resolve(result);
859
                                     resolve(result);
853
                                 }
860
                                 }
854
                                 break;
861
                                 break;
879
                         Logger.log(`[${this.id}] StopRealPlay status=${response.status}`);
886
                         Logger.log(`[${this.id}] StopRealPlay status=${response.status}`);
880
                         
887
                         
881
                         if(response.status==200){
888
                         if(response.status==200){
882
-                            //ntv add 真正结束了才能执行这两句
883
-                            context.nodeEvent.emit('stopPlayed', session.ssrc);
889
+                            /** 
890
+                            ntv remove rtp连接断开时再emit这条消息,放到了stream/session中执行
891
+                            */
892
+                            //context.nodeEvent.emit('stopPlayed', session.ssrc);
884
                             delete this.dialogs[key];
893
                             delete this.dialogs[key];
885
                         }
894
                         }
886
                     });
895
                     });

Loading…
Cancel
Save