sip-lab 1.28.2 → 1.28.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/prebuilds/linux-x64/sip-lab.node +0 -0
- package/samples/100_calls.js +0 -6
- package/samples/16_audio_streams.js +0 -31
- package/samples/183_session_progress.js +0 -12
- package/samples/artifacts/tls/cacert.pem +32 -0
- package/samples/artifacts/tls/cakey.pem +52 -0
- package/samples/delayed_media.js +0 -7
- package/samples/four_audio_streams_two_refused.js +0 -6
- package/samples/g729.js +0 -10
- package/samples/ic.wav +0 -0
- package/samples/mrcp_and_audio.js +0 -9
- package/samples/mrcp_and_audio.simplified_media.js +0 -9
- package/samples/multiple_audio_streams.js +0 -30
- package/samples/oc.wav +0 -0
- package/samples/pcma.js +0 -11
- package/samples/play_wav_and_speech_recog.bad_transcript.pcmu8000.js +0 -23
- package/samples/refer.js +0 -30
- package/samples/refuse_telephone_event.js +0 -11
- package/samples/reinvite_and_dtmf.js +0 -11
- package/samples/reinvite_audio_audio.js +0 -11
- package/samples/reinvite_with_hold_unhold.js +0 -11
- package/samples/rtp_and_srtp.js +0 -6
- package/samples/rtp_and_srtp.rtp_refused.js +0 -6
- package/samples/send_and_receive_fax.js +0 -11
- package/samples/simple.js +32 -8
- package/samples/sip_cancel.js +0 -9
- package/samples/speech_synth_and_recog.speex16000.js +2 -23
- package/samples/srtp.js +0 -6
- package/samples/start_play_wav_with_end_of_file_event.js +0 -23
- package/samples/start_play_wav_with_no_loop.js +0 -23
- package/samples/{tcp_and_extra_headers.js → tcp.js} +0 -23
- package/samples/text_to_speech.js +0 -23
- package/samples/tls.js +128 -0
- package/samples/two_audio_streams.js +0 -5
- package/samples/two_audio_streams.port_zero.js +0 -5
- package/samples_extra/ws_speech_server.dtmf.js +0 -24
- package/samples_extra/ws_speech_server.google.js +0 -24
- package/src/addon.cpp +35 -0
- package/src/sip.cpp +26 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sip-lab",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"engines": {
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"node-addon-api": "^5.0.0",
|
|
28
28
|
"node-gyp": "^9.3.0",
|
|
29
29
|
"node-gyp-build": "^4.5.0",
|
|
30
|
-
"sip-matching": "^1.5.2"
|
|
30
|
+
"sip-matching": "^1.5.2",
|
|
31
|
+
"sdp-matching": "^1.3.2",
|
|
32
|
+
"sipjs-lab": "^1.3.10"
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
33
35
|
"prebuildify": "^6.0.0",
|
|
34
|
-
"prebuildify-cross": "github:MayamaTakeshi/prebuildify-cross#use_existing_images"
|
|
35
|
-
"sdp-matching": "^1.3.2",
|
|
36
|
-
"sipjs-lab": "^1.3.10"
|
|
36
|
+
"prebuildify-cross": "github:MayamaTakeshi/prebuildify-cross#use_existing_images"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"index.js",
|
|
Binary file
|
package/samples/100_calls.js
CHANGED
|
@@ -52,34 +52,9 @@ async function test() {
|
|
|
52
52
|
msg: sip_msg({
|
|
53
53
|
$rs: '100',
|
|
54
54
|
$rr: 'Trying',
|
|
55
|
-
'$(hdrcnt(via))': 1,
|
|
56
|
-
'$hdr(call-id)': m.collect('sip_call_id'),
|
|
57
|
-
$fU: 'alice',
|
|
58
|
-
$fd: 'test.com',
|
|
59
|
-
$tU: 'bob',
|
|
60
|
-
'$hdr(l)': '0',
|
|
61
55
|
}),
|
|
62
56
|
},
|
|
63
57
|
], 1000)
|
|
64
|
-
// Details about zeq wait(list_of_events_to_wait_for, timeout_in_ms):
|
|
65
|
-
// The order of events in the list is irrelevant.
|
|
66
|
-
// What matters is that all events arrive within the specified timeout.
|
|
67
|
-
// When specifying events, you can be as detailed or succinct as you need.
|
|
68
|
-
// For example, the above event 'response' is waiting for a SIP '100 Trying' to arrive,
|
|
69
|
-
// but we are specifying things to match just to show that we can be very detailed when performing a match.
|
|
70
|
-
// But it could have been just like this:
|
|
71
|
-
//
|
|
72
|
-
// {
|
|
73
|
-
// event: 'response',
|
|
74
|
-
// call_id: oc.id,
|
|
75
|
-
// method: 'INVITE',
|
|
76
|
-
// msg: sip_msg({
|
|
77
|
-
// $rs: '100',
|
|
78
|
-
// }),
|
|
79
|
-
// }
|
|
80
|
-
// Regarding the function sip_msg() this is a special matching function provided by https://github.com/MayamaTakeshi/sip-matching that makes it
|
|
81
|
-
// easy to match a SIP message using openser/kamailio/opensips pseudo-variables syntax.
|
|
82
|
-
|
|
83
58
|
|
|
84
59
|
// Here we store data for the incoming call
|
|
85
60
|
// just to organize our code (not really needed)
|
|
@@ -101,12 +76,6 @@ async function test() {
|
|
|
101
76
|
msg: sip_msg({
|
|
102
77
|
$rs: '200',
|
|
103
78
|
$rr: 'OK',
|
|
104
|
-
'$(hdrcnt(VIA))': 1,
|
|
105
|
-
$fU: 'alice',
|
|
106
|
-
$fd: 'test.com',
|
|
107
|
-
$tU: 'bob',
|
|
108
|
-
'$hdr(content-type)': 'application/sdp',
|
|
109
|
-
$rb: '!{_}a=sendrecv',
|
|
110
79
|
}),
|
|
111
80
|
},
|
|
112
81
|
{
|
|
@@ -56,12 +56,6 @@ async function test() {
|
|
|
56
56
|
msg: sip_msg({
|
|
57
57
|
$rs: '183',
|
|
58
58
|
$rr: 'Session Progress',
|
|
59
|
-
'$(hdrcnt(VIA))': 1,
|
|
60
|
-
$fU: 'alice',
|
|
61
|
-
$fd: 'test.com',
|
|
62
|
-
$tU: 'bob',
|
|
63
|
-
'$hdr(content-type)': 'application/sdp',
|
|
64
|
-
$rb: '!{_}a=sendrecv',
|
|
65
59
|
}),
|
|
66
60
|
},
|
|
67
61
|
{
|
|
@@ -138,12 +132,6 @@ async function test() {
|
|
|
138
132
|
msg: sip_msg({
|
|
139
133
|
$rs: '200',
|
|
140
134
|
$rr: 'OK',
|
|
141
|
-
'$(hdrcnt(VIA))': 1,
|
|
142
|
-
$fU: 'alice',
|
|
143
|
-
$fd: 'test.com',
|
|
144
|
-
$tU: 'bob',
|
|
145
|
-
'$hdr(content-type)': 'application/sdp',
|
|
146
|
-
$rb: '!{_}a=sendrecv',
|
|
147
135
|
}),
|
|
148
136
|
},
|
|
149
137
|
], 1000)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
|
2
|
+
MIIFbTCCA1WgAwIBAgIUJF/pHq/aXsPrT51zyGRwCENiIYowDQYJKoZIhvcNAQEL
|
|
3
|
+
BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
|
|
4
|
+
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAgFw0yNDA2MDYyMjQ3NDhaGA8zMDIz
|
|
5
|
+
MTAwODIyNDc0OFowRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUx
|
|
6
|
+
ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDCCAiIwDQYJKoZIhvcN
|
|
7
|
+
AQEBBQADggIPADCCAgoCggIBALduAzZH48JgXWt8vWgVCfKoqGGmn2xQEvBynK1d
|
|
8
|
+
w4noRKTbP6OPTWmnR75xEDVOyyrtXrdb0T56zy3RIe/DRpVwC50WGAVlXxRlAO1W
|
|
9
|
+
pjLyMfEMmLocgGhv30ftikdebCd0qy6ti4UBVfQDEXJuqbRTWWxgqpzqdG6OvkT0
|
|
10
|
+
paztFhXmLs929caFwxO0ewP895GUZRY5JsaB4W8ekggO2pWDGdenjDtjToVp+AKd
|
|
11
|
+
Y8KuP6fqUYf5NGKxwcZ9eAY9dh58On6wk1f/r9tfmzs25O8Pd0VdGfWfiRZVZh6H
|
|
12
|
+
XVvmDWTJ90vHhVqG3Ocei9JZKOH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Wv2
|
|
39
|
+
kLqmkNyBOCCkIUG6k8oLJj/P36DXPYJeD+IyTz7Yqfm8qPVy3zaUk+STOHF7kM1W
|
|
40
|
+
PadkEB7TgC9BR8BrQYppY334/1lGqanfwLLTMCECggEAHwgYJine7favEwnqN8oX
|
|
41
|
+
N5JLpp8hB/HMbyf2Yta7Sd6tmfuZGwWNyiM6xYKkTKFCVqVFF88LDg8l6EJAdPIw
|
|
42
|
+
3YlS3avfRUAiVpJsHIB+ItY+sSvYE11x6cdhz2HZIzG/mKcAKpb6iVRii6nMH+Nq
|
|
43
|
+
8XfYoMiDcEodfz0P2negWLohdh98OMaLcqjEBBwVKZNQ02/L0aHxxe+ufozkD8RF
|
|
44
|
+
oPX0lJL3pDUR4rwFDkZd6zjSm30SXcS8e5rM2Of8RzGdrgK8ViHoF6fNwEu/4fZE
|
|
45
|
+
DfL6W4FD4QKjmSzl4HJ885YDSKiEc3LyIYfwMugTHeVFo7N1sJ4BQdH44RDc/tM2
|
|
46
|
+
0QKCAQBMB00co1l38phHKoJaepBw+qWw3dv5EuiDO3qqJmE3rTFh45+tdHjX57bF
|
|
47
|
+
GF5HnCfx1jZs+e309WHqkPh55Yn3/iCQIMjJxi7Wzm9fYZpOcB8j9cQUu9qIPAH1
|
|
48
|
+
BXm1N8H2oJTBlAFStBI//ZkE0zpiCXBV8NFbLbufjy5TlM/h1Z8dOa0J2OdHeeKh
|
|
49
|
+
VtBy5UkRxd1pQ8+BqDQBp/xQMIsO8DdPkARAXodFvG4ewW0WtsB4rB7yDxSOjfNg
|
|
50
|
+
0QFGEthOrTKVBJlgQZRxXU1/ucH+jsuFRqgO7lVUvo6nHtEwWEwfDuXH6Zcvy1vu
|
|
51
|
+
w9o35K/WltqUr7rYymdTaXUGgazR
|
|
52
|
+
-----END PRIVATE KEY-----
|
package/samples/delayed_media.js
CHANGED
|
@@ -36,12 +36,6 @@ async function test() {
|
|
|
36
36
|
msg: sip_msg({
|
|
37
37
|
$rs: '100',
|
|
38
38
|
$rr: 'Trying',
|
|
39
|
-
'$(hdrcnt(via))': 1,
|
|
40
|
-
'$hdr(call-id)': m.collect('sip_call_id'),
|
|
41
|
-
$fU: 'alice',
|
|
42
|
-
$fd: 'test.com',
|
|
43
|
-
$tU: 'bob',
|
|
44
|
-
'$hdr(l)': '0',
|
|
45
39
|
}),
|
|
46
40
|
},
|
|
47
41
|
], 1000)
|
|
@@ -61,7 +55,6 @@ async function test() {
|
|
|
61
55
|
msg: sip_msg({
|
|
62
56
|
$rs: '200',
|
|
63
57
|
$rr: 'OK',
|
|
64
|
-
'$(hdrcnt(VIA))': 1,
|
|
65
58
|
$fU: 'alice',
|
|
66
59
|
$fd: 'test.com',
|
|
67
60
|
$tU: 'bob',
|
package/samples/g729.js
CHANGED
|
@@ -42,12 +42,6 @@ async function test() {
|
|
|
42
42
|
msg: sip_msg({
|
|
43
43
|
$rs: '100',
|
|
44
44
|
$rr: 'Trying',
|
|
45
|
-
'$(hdrcnt(via))': 1,
|
|
46
|
-
'hdr_call_id': m.collect('sip_call_id'),
|
|
47
|
-
$fU: 'alice',
|
|
48
|
-
$fd: 'test.com',
|
|
49
|
-
$tU: 'bob',
|
|
50
|
-
'hdr_l': '0',
|
|
51
45
|
}),
|
|
52
46
|
},
|
|
53
47
|
], 1000)
|
|
@@ -77,10 +71,6 @@ async function test() {
|
|
|
77
71
|
msg: sip_msg({
|
|
78
72
|
$rs: '200',
|
|
79
73
|
$rr: 'OK',
|
|
80
|
-
'$(hdrcnt(VIA))': 1,
|
|
81
|
-
$fU: 'alice',
|
|
82
|
-
$fd: 'test.com',
|
|
83
|
-
$tU: 'bob',
|
|
84
74
|
'hdr_content_type': 'application/sdp',
|
|
85
75
|
$rb: '!{_}a=sendrecv',
|
|
86
76
|
}),
|
package/samples/ic.wav
ADDED
|
Binary file
|
|
@@ -81,12 +81,7 @@ async function test() {
|
|
|
81
81
|
msg: sip_msg({
|
|
82
82
|
$rs: '100',
|
|
83
83
|
$rr: 'Trying',
|
|
84
|
-
'$(hdrcnt(via))': 1,
|
|
85
84
|
'$hdr(call-id)': m.collect('sip_call_id'),
|
|
86
|
-
$fU: 'alice',
|
|
87
|
-
$fd: 'test.com',
|
|
88
|
-
$tU: 'bob',
|
|
89
|
-
'$hdr(l)': '0',
|
|
90
85
|
}),
|
|
91
86
|
},
|
|
92
87
|
], 1000)
|
|
@@ -110,10 +105,6 @@ async function test() {
|
|
|
110
105
|
msg: sip_msg({
|
|
111
106
|
$rs: '200',
|
|
112
107
|
$rr: 'OK',
|
|
113
|
-
'$(hdrcnt(VIA))': 1,
|
|
114
|
-
$fU: 'alice',
|
|
115
|
-
$fd: 'test.com',
|
|
116
|
-
$tU: 'bob',
|
|
117
108
|
'$hdr(content-type)': 'application/sdp',
|
|
118
109
|
$rb: sdp.jsonpath_matcher({
|
|
119
110
|
'$.media[?(@.desc.type=="application")].val_attrs.channel': [m.collect('mrcp_channel')],
|
|
@@ -38,12 +38,7 @@ async function test() {
|
|
|
38
38
|
msg: sip_msg({
|
|
39
39
|
$rs: '100',
|
|
40
40
|
$rr: 'Trying',
|
|
41
|
-
'$(hdrcnt(via))': 1,
|
|
42
41
|
'$hdr(call-id)': m.collect('sip_call_id'),
|
|
43
|
-
$fU: 'alice',
|
|
44
|
-
$fd: 'test.com',
|
|
45
|
-
$tU: 'bob',
|
|
46
|
-
'$hdr(l)': '0',
|
|
47
42
|
}),
|
|
48
43
|
},
|
|
49
44
|
], 1000)
|
|
@@ -63,10 +58,6 @@ async function test() {
|
|
|
63
58
|
msg: sip_msg({
|
|
64
59
|
$rs: '200',
|
|
65
60
|
$rr: 'OK',
|
|
66
|
-
'$(hdrcnt(VIA))': 1,
|
|
67
|
-
$fU: 'alice',
|
|
68
|
-
$fd: 'test.com',
|
|
69
|
-
$tU: 'bob',
|
|
70
61
|
'$hdr(content-type)': 'application/sdp',
|
|
71
62
|
$rb: '!{_}a=sendrecv',
|
|
72
63
|
}),
|
|
@@ -54,34 +54,10 @@ async function test() {
|
|
|
54
54
|
msg: sip_msg({
|
|
55
55
|
$rs: '100',
|
|
56
56
|
$rr: 'Trying',
|
|
57
|
-
'$(hdrcnt(via))': 1,
|
|
58
57
|
'$hdr(call-id)': m.collect('sip_call_id'),
|
|
59
|
-
$fU: 'alice',
|
|
60
|
-
$fd: 'test.com',
|
|
61
|
-
$tU: 'bob',
|
|
62
|
-
'$hdr(l)': '0',
|
|
63
58
|
}),
|
|
64
59
|
},
|
|
65
60
|
], 1000)
|
|
66
|
-
// Details about zeq wait(list_of_events_to_wait_for, timeout_in_ms):
|
|
67
|
-
// The order of events in the list is irrelevant.
|
|
68
|
-
// What matters is that all events arrive within the specified timeout.
|
|
69
|
-
// When specifying events, you can be as detailed or succinct as you need.
|
|
70
|
-
// For example, the above event 'response' is waiting for a SIP '100 Trying' to arrive,
|
|
71
|
-
// but we are specifying things to match just to show that we can be very detailed when performing a match.
|
|
72
|
-
// But it could have been just like this:
|
|
73
|
-
//
|
|
74
|
-
// {
|
|
75
|
-
// event: 'response',
|
|
76
|
-
// call_id: oc.id,
|
|
77
|
-
// method: 'INVITE',
|
|
78
|
-
// msg: sip_msg({
|
|
79
|
-
// $rs: '100',
|
|
80
|
-
// }),
|
|
81
|
-
// }
|
|
82
|
-
// Regarding the function sip_msg() this is a special matching function provided by https://github.com/MayamaTakeshi/sip-matching that makes it
|
|
83
|
-
// easy to match a SIP message using openser/kamailio/opensips pseudo-variables syntax.
|
|
84
|
-
|
|
85
61
|
|
|
86
62
|
// Here we store data for the incoming call
|
|
87
63
|
// just to organize our code (not really needed)
|
|
@@ -103,12 +79,6 @@ async function test() {
|
|
|
103
79
|
msg: sip_msg({
|
|
104
80
|
$rs: '200',
|
|
105
81
|
$rr: 'OK',
|
|
106
|
-
'$(hdrcnt(VIA))': 1,
|
|
107
|
-
$fU: 'alice',
|
|
108
|
-
$fd: 'test.com',
|
|
109
|
-
$tU: 'bob',
|
|
110
|
-
'$hdr(content-type)': 'application/sdp',
|
|
111
|
-
$rb: '!{_}a=sendrecv',
|
|
112
82
|
}),
|
|
113
83
|
},
|
|
114
84
|
{
|
package/samples/oc.wav
ADDED
|
Binary file
|
package/samples/pcma.js
CHANGED
|
@@ -42,12 +42,7 @@ async function test() {
|
|
|
42
42
|
msg: sip_msg({
|
|
43
43
|
$rs: '100',
|
|
44
44
|
$rr: 'Trying',
|
|
45
|
-
'$(hdrcnt(via))': 1,
|
|
46
45
|
'hdr_call_id': m.collect('sip_call_id'),
|
|
47
|
-
$fU: 'alice',
|
|
48
|
-
$fd: 'test.com',
|
|
49
|
-
$tU: 'bob',
|
|
50
|
-
'hdr_l': '0',
|
|
51
46
|
}),
|
|
52
47
|
},
|
|
53
48
|
], 1000)
|
|
@@ -77,12 +72,6 @@ async function test() {
|
|
|
77
72
|
msg: sip_msg({
|
|
78
73
|
$rs: '200',
|
|
79
74
|
$rr: 'OK',
|
|
80
|
-
'$(hdrcnt(VIA))': 1,
|
|
81
|
-
$fU: 'alice',
|
|
82
|
-
$fd: 'test.com',
|
|
83
|
-
$tU: 'bob',
|
|
84
|
-
'hdr_content_type': 'application/sdp',
|
|
85
|
-
$rb: '!{_}a=sendrecv',
|
|
86
75
|
}),
|
|
87
76
|
},
|
|
88
77
|
], 1000)
|
|
@@ -27,10 +27,6 @@ async function test() {
|
|
|
27
27
|
oc = sip.call.create(t1.id, {
|
|
28
28
|
from_uri: '"abc"<sip:alice@test.com>',
|
|
29
29
|
to_uri: `sip:bob@${t2.address}:${t2.port}`,
|
|
30
|
-
headers: {
|
|
31
|
-
'X-MyHeader1': 'abc',
|
|
32
|
-
'X-MyHeader2': 'def',
|
|
33
|
-
},
|
|
34
30
|
})
|
|
35
31
|
|
|
36
32
|
await z.wait([
|
|
@@ -42,8 +38,6 @@ async function test() {
|
|
|
42
38
|
$fU: 'alice',
|
|
43
39
|
$fd: 'test.com',
|
|
44
40
|
$tU: 'bob',
|
|
45
|
-
'$hdr(X-MyHeader1)': 'abc',
|
|
46
|
-
'hdr_x_myheader2': 'def',
|
|
47
41
|
}),
|
|
48
42
|
},
|
|
49
43
|
{
|
|
@@ -53,12 +47,7 @@ async function test() {
|
|
|
53
47
|
msg: sip_msg({
|
|
54
48
|
$rs: '100',
|
|
55
49
|
$rr: 'Trying',
|
|
56
|
-
'$(hdrcnt(via))': 1,
|
|
57
50
|
'hdr_call_id': m.collect('sip_call_id'),
|
|
58
|
-
$fU: 'alice',
|
|
59
|
-
$fd: 'test.com',
|
|
60
|
-
$tU: 'bob',
|
|
61
|
-
'$hdr(l)': '0',
|
|
62
51
|
}),
|
|
63
52
|
},
|
|
64
53
|
], 1000)
|
|
@@ -71,10 +60,6 @@ async function test() {
|
|
|
71
60
|
sip.call.respond(ic.id, {
|
|
72
61
|
code: 200,
|
|
73
62
|
reason:'OK',
|
|
74
|
-
headers: {
|
|
75
|
-
'X-MyHeader3': 'ghi',
|
|
76
|
-
'X-MyHeader4': 'jkl',
|
|
77
|
-
},
|
|
78
63
|
})
|
|
79
64
|
|
|
80
65
|
await z.wait([
|
|
@@ -95,14 +80,6 @@ async function test() {
|
|
|
95
80
|
msg: sip_msg({
|
|
96
81
|
$rs: '200',
|
|
97
82
|
$rr: 'OK',
|
|
98
|
-
'$(hdrcnt(v))': 1,
|
|
99
|
-
$fU: 'alice',
|
|
100
|
-
$fd: 'test.com',
|
|
101
|
-
$tU: 'bob',
|
|
102
|
-
'$hdr(content-type)': 'application/sdp',
|
|
103
|
-
$rb: '!{_}a=sendrecv',
|
|
104
|
-
'$hdr(X-MyHeader3)': 'ghi',
|
|
105
|
-
'$hdr(X-MyHeader4)': 'jkl',
|
|
106
83
|
}),
|
|
107
84
|
},
|
|
108
85
|
], 1000)
|
package/samples/refer.js
CHANGED
|
@@ -48,34 +48,10 @@ async function test() {
|
|
|
48
48
|
msg: sip_msg({
|
|
49
49
|
$rs: '100',
|
|
50
50
|
$rr: 'Trying',
|
|
51
|
-
'$(hdrcnt(via))': 1,
|
|
52
51
|
'$hdr(call-id)': m.collect('sip_call_id'),
|
|
53
|
-
$fU: 'alice',
|
|
54
|
-
$fd: 'test.com',
|
|
55
|
-
$tU: 'bob',
|
|
56
|
-
'$hdr(l)': '0',
|
|
57
52
|
}),
|
|
58
53
|
},
|
|
59
54
|
], 1000)
|
|
60
|
-
// Details about zeq wait(list_of_events_to_wait_for, timeout_in_ms):
|
|
61
|
-
// The order of events in the list is irrelevant.
|
|
62
|
-
// What matters is that all events arrive within the specified timeout.
|
|
63
|
-
// When specifying events, you can be as detailed or succinct as you need.
|
|
64
|
-
// For example, the above event 'response' is waiting for a SIP '100 Trying' to arrive,
|
|
65
|
-
// but we are specifying things to match just to show that we can be very detailed when performing a match.
|
|
66
|
-
// But it could have been just like this:
|
|
67
|
-
//
|
|
68
|
-
// {
|
|
69
|
-
// event: 'response',
|
|
70
|
-
// call_id: oc.id,
|
|
71
|
-
// method: 'INVITE',
|
|
72
|
-
// msg: sip_msg({
|
|
73
|
-
// $rs: '100',
|
|
74
|
-
// }),
|
|
75
|
-
// }
|
|
76
|
-
// Regarding the function sip_msg() this is a special matching function provided by https://github.com/MayamaTakeshi/sip-matching that makes it
|
|
77
|
-
// easy to match a SIP message using openser/kamailio/opensips pseudo-variables syntax.
|
|
78
|
-
|
|
79
55
|
|
|
80
56
|
// Here we store data for the incoming call
|
|
81
57
|
// just to organize our code (not really needed)
|
|
@@ -97,12 +73,6 @@ async function test() {
|
|
|
97
73
|
msg: sip_msg({
|
|
98
74
|
$rs: '200',
|
|
99
75
|
$rr: 'OK',
|
|
100
|
-
'$(hdrcnt(VIA))': 1,
|
|
101
|
-
$fU: 'alice',
|
|
102
|
-
$fd: 'test.com',
|
|
103
|
-
$tU: 'bob',
|
|
104
|
-
'$hdr(content-type)': 'application/sdp',
|
|
105
|
-
$rb: '!{_}a=sendrecv',
|
|
106
76
|
}),
|
|
107
77
|
},
|
|
108
78
|
{
|
|
@@ -40,12 +40,7 @@ async function test() {
|
|
|
40
40
|
msg: sip_msg({
|
|
41
41
|
$rs: '100',
|
|
42
42
|
$rr: 'Trying',
|
|
43
|
-
'$(hdrcnt(via))': 1,
|
|
44
43
|
'$hdr(call-id)': m.collect('sip_call_id'),
|
|
45
|
-
$fU: 'alice',
|
|
46
|
-
$fd: 'test.com',
|
|
47
|
-
$tU: 'bob',
|
|
48
|
-
'$hdr(l)': '0',
|
|
49
44
|
}),
|
|
50
45
|
},
|
|
51
46
|
], 1000)
|
|
@@ -65,12 +60,6 @@ async function test() {
|
|
|
65
60
|
msg: sip_msg({
|
|
66
61
|
$rs: '200',
|
|
67
62
|
$rr: 'OK',
|
|
68
|
-
'$(hdrcnt(VIA))': 1,
|
|
69
|
-
$fU: 'alice',
|
|
70
|
-
$fd: 'test.com',
|
|
71
|
-
$tU: 'bob',
|
|
72
|
-
'$hdr(content-type)': 'application/sdp',
|
|
73
|
-
$rb: '!{_}a=sendrecv',
|
|
74
63
|
}),
|
|
75
64
|
},
|
|
76
65
|
{
|
|
@@ -40,12 +40,7 @@ async function test() {
|
|
|
40
40
|
msg: sip_msg({
|
|
41
41
|
$rs: '100',
|
|
42
42
|
$rr: 'Trying',
|
|
43
|
-
'$(hdrcnt(via))': 1,
|
|
44
43
|
'$hdr(call-id)': m.collect('sip_call_id'),
|
|
45
|
-
$fU: 'alice',
|
|
46
|
-
$fd: 'test.com',
|
|
47
|
-
$tU: 'bob',
|
|
48
|
-
'$hdr(l)': '0',
|
|
49
44
|
}),
|
|
50
45
|
},
|
|
51
46
|
], 1000)
|
|
@@ -68,12 +63,6 @@ async function test() {
|
|
|
68
63
|
msg: sip_msg({
|
|
69
64
|
$rs: '200',
|
|
70
65
|
$rr: 'OK',
|
|
71
|
-
'$(hdrcnt(VIA))': 1,
|
|
72
|
-
$fU: 'alice',
|
|
73
|
-
$fd: 'test.com',
|
|
74
|
-
$tU: 'bob',
|
|
75
|
-
'$hdr(content-type)': 'application/sdp',
|
|
76
|
-
$rb: '!{_}a=sendrecv',
|
|
77
66
|
}),
|
|
78
67
|
},
|
|
79
68
|
{
|
|
@@ -38,12 +38,7 @@ async function test() {
|
|
|
38
38
|
msg: sip_msg({
|
|
39
39
|
$rs: '100',
|
|
40
40
|
$rr: 'Trying',
|
|
41
|
-
'$(hdrcnt(via))': 1,
|
|
42
41
|
'$hdr(call-id)': m.collect('sip_call_id'),
|
|
43
|
-
$fU: 'alice',
|
|
44
|
-
$fd: 'test.com',
|
|
45
|
-
$tU: 'bob',
|
|
46
|
-
'$hdr(l)': '0',
|
|
47
42
|
}),
|
|
48
43
|
},
|
|
49
44
|
], 1000)
|
|
@@ -63,12 +58,6 @@ async function test() {
|
|
|
63
58
|
msg: sip_msg({
|
|
64
59
|
$rs: '200',
|
|
65
60
|
$rr: 'OK',
|
|
66
|
-
'$(hdrcnt(VIA))': 1,
|
|
67
|
-
$fU: 'alice',
|
|
68
|
-
$fd: 'test.com',
|
|
69
|
-
$tU: 'bob',
|
|
70
|
-
'$hdr(content-type)': 'application/sdp',
|
|
71
|
-
$rb: '!{_}a=sendrecv',
|
|
72
61
|
}),
|
|
73
62
|
},
|
|
74
63
|
{
|
|
@@ -38,12 +38,7 @@ async function test() {
|
|
|
38
38
|
msg: sip_msg({
|
|
39
39
|
$rs: '100',
|
|
40
40
|
$rr: 'Trying',
|
|
41
|
-
'$(hdrcnt(via))': 1,
|
|
42
41
|
'$hdr(call-id)': m.collect('sip_call_id'),
|
|
43
|
-
$fU: 'alice',
|
|
44
|
-
$fd: 'test.com',
|
|
45
|
-
$tU: 'bob',
|
|
46
|
-
'$hdr(l)': '0',
|
|
47
42
|
}),
|
|
48
43
|
},
|
|
49
44
|
], 1000)
|
|
@@ -63,12 +58,6 @@ async function test() {
|
|
|
63
58
|
msg: sip_msg({
|
|
64
59
|
$rs: '200',
|
|
65
60
|
$rr: 'OK',
|
|
66
|
-
'$(hdrcnt(VIA))': 1,
|
|
67
|
-
$fU: 'alice',
|
|
68
|
-
$fd: 'test.com',
|
|
69
|
-
$tU: 'bob',
|
|
70
|
-
'$hdr(content-type)': 'application/sdp',
|
|
71
|
-
$rb: '!{_}a=sendrecv',
|
|
72
61
|
}),
|
|
73
62
|
},
|
|
74
63
|
{
|
package/samples/rtp_and_srtp.js
CHANGED
|
@@ -36,12 +36,7 @@ async function test() {
|
|
|
36
36
|
msg: sip_msg({
|
|
37
37
|
$rs: '100',
|
|
38
38
|
$rr: 'Trying',
|
|
39
|
-
'$(hdrcnt(via))': 1,
|
|
40
39
|
'$hdr(call-id)': m.collect('sip_call_id'),
|
|
41
|
-
$fU: 'alice',
|
|
42
|
-
$fd: 'test.com',
|
|
43
|
-
$tU: 'bob',
|
|
44
|
-
'$hdr(l)': '0',
|
|
45
40
|
}),
|
|
46
41
|
},
|
|
47
42
|
], 1000)
|
|
@@ -71,12 +66,6 @@ async function test() {
|
|
|
71
66
|
msg: sip_msg({
|
|
72
67
|
$rs: '200',
|
|
73
68
|
$rr: 'OK',
|
|
74
|
-
'$(hdrcnt(VIA))': 1,
|
|
75
|
-
$fU: 'alice',
|
|
76
|
-
$fd: 'test.com',
|
|
77
|
-
$tU: 'bob',
|
|
78
|
-
'$hdr(content-type)': 'application/sdp',
|
|
79
|
-
$rb: '!{_}a=sendrecv',
|
|
80
69
|
}),
|
|
81
70
|
},
|
|
82
71
|
], 1000)
|