|
@@ -65,6 +65,9 @@ class NodeSipSession {
|
65
|
65
|
|
66
|
66
|
this.TAG = 'sip';
|
67
|
67
|
|
|
68
|
+ //ntv add play mode prop
|
|
69
|
+ this.playmode='';
|
|
70
|
+
|
68
|
71
|
context.sessions.set(this.id, this);
|
69
|
72
|
}
|
70
|
73
|
|
|
@@ -738,7 +741,7 @@ class NodeSipSession {
|
738
|
741
|
//let ssrc = "0" + channelId.substring(16, 20) + channelId.substring(3, 8);
|
739
|
742
|
let ssed = channelId.substring(13, 20);
|
740
|
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
|
746
|
let host = rhost || "127.0.0.1";
|
744
|
747
|
|
|
@@ -840,7 +843,8 @@ class NodeSipSession {
|
840
|
843
|
to: response.headers.to,
|
841
|
844
|
from: response.headers.from,
|
842
|
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,6 +853,9 @@ class NodeSipSession {
|
849
|
853
|
|
850
|
854
|
result.data = { ssrc: ssrc };
|
851
|
855
|
|
|
856
|
+ //ntv
|
|
857
|
+ that.playmode='realplay';
|
|
858
|
+
|
852
|
859
|
resolve(result);
|
853
|
860
|
}
|
854
|
861
|
break;
|
|
@@ -879,8 +886,10 @@ class NodeSipSession {
|
879
|
886
|
Logger.log(`[${this.id}] StopRealPlay status=${response.status}`);
|
880
|
887
|
|
881
|
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
|
893
|
delete this.dialogs[key];
|
885
|
894
|
}
|
886
|
895
|
});
|