sip-lab 1.37.0 → 1.38.0
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 +2 -2
- package/samples/100_calls.js +5 -5
- package/samples/16_audio_streams.js +2 -2
- package/samples/183_session_progress.js +2 -2
- package/samples/custom_call_id.js +5 -5
- package/samples/delayed_media.js +2 -2
- package/samples/four_audio_streams_two_refused.js +2 -2
- package/samples/g729.js +2 -2
- package/samples/media_fields.js +2 -2
- package/samples/mrcp_and_audio.js +3 -3
- package/samples/mrcp_and_audio.simplified_media.js +2 -2
- package/samples/multiple_audio_streams.js +2 -2
- package/samples/options.js +1 -1
- package/samples/opus.narrowband.js +2 -2
- package/samples/pcma.js +2 -2
- package/samples/play_wav_and_speech_recog.bad_transcript.pcmu8000.js +2 -2
- package/samples/refer.js +2 -2
- package/samples/refuse_telephone_event.js +2 -2
- package/samples/register_no_expires.js +1 -1
- package/samples/register_subscribe.js +5 -5
- package/samples/reinvite_and_dtmf.js +2 -2
- package/samples/reinvite_audio_audio.js +2 -2
- package/samples/reinvite_with_hold_unhold.js +2 -2
- package/samples/rtp_and_srtp.js +2 -2
- package/samples/rtp_and_srtp.rtp_refused.js +2 -2
- package/samples/send_and_receive_bfsk.js +2 -2
- package/samples/send_and_receive_fax.js +2 -2
- package/samples/session_expires.update.with_sipjs-lab.js +18 -18
- package/samples/simple.js +2 -2
- package/samples/sip_cancel.js +2 -2
- package/samples/speech_synth_and_recog.speex16000.js +2 -2
- package/samples/srtp.js +2 -2
- package/samples/start_play_wav_with_end_of_file_event.js +2 -2
- package/samples/start_play_wav_with_no_loop.js +2 -2
- package/samples/stop_with_cleanup.js +2 -2
- package/samples/tcp.js +2 -2
- package/samples/text_to_speech.js +2 -2
- package/samples/tls.js +2 -2
- package/samples/two_audio_streams.js +2 -2
- package/samples/two_audio_streams.port_zero.js +2 -2
- package/samples_extra/ws_speech_server.bfsk.js +2 -2
- package/samples_extra/ws_speech_server.dtmf.js +2 -2
- package/samples_extra/ws_speech_server.google.js +2 -2
- package/samples_extra/ws_speech_server.send_bfsk.js +2 -2
- package/samples_extra/ws_speech_server.start_bfsk_detection.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sip-lab",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"engines": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"gypfile": true,
|
|
22
22
|
"homepage": "https://github.com/MayamaTakeshi/sip-lab",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@mayama/zeq": "^4.
|
|
24
|
+
"@mayama/zeq": "^4.23.0",
|
|
25
25
|
"data-matching": "^1.47.1",
|
|
26
26
|
"mrcp": "^1.4.0",
|
|
27
27
|
"mrcp-matching": "^1.3.0",
|
package/samples/100_calls.js
CHANGED
|
@@ -51,7 +51,7 @@ async function test() {
|
|
|
51
51
|
})).value(), 50000)
|
|
52
52
|
|
|
53
53
|
// Now we answer the calls
|
|
54
|
-
z
|
|
54
|
+
z.$ic_ids.forEach(ic_id => {
|
|
55
55
|
sip.call.respond(ic_id, {code: 200, reason: 'OK'})
|
|
56
56
|
})
|
|
57
57
|
|
|
@@ -72,7 +72,7 @@ async function test() {
|
|
|
72
72
|
status: 'ok',
|
|
73
73
|
})).value())
|
|
74
74
|
|
|
75
|
-
events = events.concat(_.chain(z
|
|
75
|
+
events = events.concat(_.chain(z.$ic_ids).map(ic_id => ({
|
|
76
76
|
event: 'media_update',
|
|
77
77
|
call_id: ic_id,
|
|
78
78
|
status: 'ok',
|
|
@@ -89,7 +89,7 @@ async function test() {
|
|
|
89
89
|
sip.call.send_dtmf(oc.id, {digits: '1234', mode: 0})
|
|
90
90
|
})
|
|
91
91
|
|
|
92
|
-
await z.wait(_.chain(z
|
|
92
|
+
await z.wait(_.chain(z.$ic_ids).map(ic_id => ({
|
|
93
93
|
event: 'dtmf',
|
|
94
94
|
call_id: ic_id,
|
|
95
95
|
digits: '1234',
|
|
@@ -98,7 +98,7 @@ async function test() {
|
|
|
98
98
|
})).value(), 50000)
|
|
99
99
|
|
|
100
100
|
// now send inband DTMF digits
|
|
101
|
-
z
|
|
101
|
+
z.$ic_ids.forEach(ic_id => {
|
|
102
102
|
sip.call.send_dtmf(ic_id, {digits: '4321', mode: 1})
|
|
103
103
|
})
|
|
104
104
|
|
|
@@ -131,7 +131,7 @@ async function test() {
|
|
|
131
131
|
call_id: oc.id,
|
|
132
132
|
})).value())
|
|
133
133
|
|
|
134
|
-
events = events.concat(_.chain(z
|
|
134
|
+
events = events.concat(_.chain(z.$ic_ids).map(ic_id => ({
|
|
135
135
|
event: 'call_ended',
|
|
136
136
|
call_id: ic_id,
|
|
137
137
|
})).value())
|
|
@@ -59,8 +59,8 @@ async function test() {
|
|
|
59
59
|
// Here we store data for the incoming call
|
|
60
60
|
// just to organize our code (not really needed)
|
|
61
61
|
const ic = {
|
|
62
|
-
id: z
|
|
63
|
-
sip_call_id: z
|
|
62
|
+
id: z.$call_id,
|
|
63
|
+
sip_call_id: z.$sip_call_id,
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// Now we answer the call at t2 side and accept all 16 streams
|
|
@@ -42,8 +42,8 @@ async function test() {
|
|
|
42
42
|
], 1000)
|
|
43
43
|
|
|
44
44
|
ic = {
|
|
45
|
-
id: z
|
|
46
|
-
sip_call_id: z
|
|
45
|
+
id: z.$call_id,
|
|
46
|
+
sip_call_id: z.$sip_call_id,
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
sip.call.respond(ic.id, {code: 183, reason: 'Session Progress', media: 'audio,audio'})
|
|
@@ -66,8 +66,8 @@ async function test() {
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
var ic = {
|
|
69
|
-
id: z
|
|
70
|
-
sip_call_id: z
|
|
69
|
+
id: z.$call_id,
|
|
70
|
+
sip_call_id: z.$sip_call_id,
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
sip.call.respond(ic.id, {
|
|
@@ -111,7 +111,7 @@ async function test() {
|
|
|
111
111
|
},
|
|
112
112
|
})
|
|
113
113
|
|
|
114
|
-
delete z
|
|
114
|
+
delete z.$call_id
|
|
115
115
|
|
|
116
116
|
await z.wait([
|
|
117
117
|
{
|
|
@@ -141,8 +141,8 @@ async function test() {
|
|
|
141
141
|
], 1000)
|
|
142
142
|
|
|
143
143
|
ic = {
|
|
144
|
-
id: z
|
|
145
|
-
sip_call_id: z
|
|
144
|
+
id: z.$call_id,
|
|
145
|
+
sip_call_id: z.$sip_call_id,
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
sip.call.respond(ic.id, {
|
package/samples/delayed_media.js
CHANGED
package/samples/g729.js
CHANGED
package/samples/media_fields.js
CHANGED
|
@@ -106,8 +106,8 @@ async function test() {
|
|
|
106
106
|
// Here we store data for the incoming call
|
|
107
107
|
// just to organize our code (not really needed)
|
|
108
108
|
const ic = {
|
|
109
|
-
id: z
|
|
110
|
-
sip_call_id: z
|
|
109
|
+
id: z.$call_id,
|
|
110
|
+
sip_call_id: z.$sip_call_id,
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
// Now we answer the call at t2 side sending custom headers.
|
|
@@ -87,8 +87,8 @@ async function test() {
|
|
|
87
87
|
], 1000)
|
|
88
88
|
|
|
89
89
|
ic = {
|
|
90
|
-
id: z
|
|
91
|
-
sip_call_id: z
|
|
90
|
+
id: z.$call_id,
|
|
91
|
+
sip_call_id: z.$sip_call_id,
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
sip.call.respond(ic.id, {
|
|
@@ -163,7 +163,7 @@ async function test() {
|
|
|
163
163
|
},
|
|
164
164
|
], 1000)
|
|
165
165
|
|
|
166
|
-
var mrcp_channel = z
|
|
166
|
+
var mrcp_channel = z.$mrcp_channel
|
|
167
167
|
var request_id = 1;
|
|
168
168
|
var msg = mrcp.builder.build_request('SPEAK', request_id, {'channel-identifier': mrcp_channel, 'content-type': 'application/xml'}, "<root>test</root>")
|
|
169
169
|
|
|
@@ -62,8 +62,8 @@ async function test() {
|
|
|
62
62
|
// Here we store data for the incoming call
|
|
63
63
|
// just to organize our code (not really needed)
|
|
64
64
|
const ic = {
|
|
65
|
-
id: z
|
|
66
|
-
sip_call_id: z
|
|
65
|
+
id: z.$call_id,
|
|
66
|
+
sip_call_id: z.$sip_call_id,
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// Now we answer the call at t2 side and accept all 2 streams
|
package/samples/options.js
CHANGED
|
@@ -53,7 +53,7 @@ async function test() {
|
|
|
53
53
|
},
|
|
54
54
|
], 1000)
|
|
55
55
|
|
|
56
|
-
sip.request.respond(z
|
|
56
|
+
sip.request.respond(z.$uas_req_id, {code: 200, reason: 'OK', headers: {'X-SomeHeader1': 'ccc', 'X-SomeHeader2': 'ddd'}})
|
|
57
57
|
|
|
58
58
|
await z.wait([
|
|
59
59
|
{
|
package/samples/pcma.js
CHANGED
package/samples/refer.js
CHANGED
|
@@ -56,8 +56,8 @@ async function test() {
|
|
|
56
56
|
// Here we store data for the incoming call
|
|
57
57
|
// just to organize our code (not really needed)
|
|
58
58
|
const ic = {
|
|
59
|
-
id: z
|
|
60
|
-
sip_call_id: z
|
|
59
|
+
id: z.$call_id,
|
|
60
|
+
sip_call_id: z.$sip_call_id,
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
// Now we answer the call at t2 side
|
|
@@ -57,7 +57,7 @@ async function test() {
|
|
|
57
57
|
},
|
|
58
58
|
], 1000)
|
|
59
59
|
|
|
60
|
-
sip.request.respond(z
|
|
60
|
+
sip.request.respond(z.$req_id, {code: 200, reason: 'OK', headers: {Expires: '60'}})
|
|
61
61
|
|
|
62
62
|
await z.wait([
|
|
63
63
|
{
|
|
@@ -103,7 +103,7 @@ async function test() {
|
|
|
103
103
|
},
|
|
104
104
|
], 1000)
|
|
105
105
|
|
|
106
|
-
var subscriber_id = z
|
|
106
|
+
var subscriber_id = z.$subscriber_id
|
|
107
107
|
|
|
108
108
|
await z.wait([
|
|
109
109
|
{
|
|
@@ -130,7 +130,7 @@ async function test() {
|
|
|
130
130
|
], 1000)
|
|
131
131
|
|
|
132
132
|
// Subscription-State expires will be computed by pjsip. It might not be the exact value of sub_expires due to latency so we give 2 seconds of tolerance
|
|
133
|
-
assert(z
|
|
133
|
+
assert(z.$sub_expires > (sub_expires - 2))
|
|
134
134
|
|
|
135
135
|
sip.subscriber.notify(subscriber_id, {
|
|
136
136
|
content_type: 'application/dialog-info+xml',
|
|
@@ -155,7 +155,7 @@ async function test() {
|
|
|
155
155
|
|
|
156
156
|
await z.sleep(100)
|
|
157
157
|
|
|
158
|
-
z
|
|
158
|
+
z.$req_id = null
|
|
159
159
|
|
|
160
160
|
sip.account.unregister(a1)
|
|
161
161
|
|
|
@@ -174,7 +174,7 @@ async function test() {
|
|
|
174
174
|
},
|
|
175
175
|
], 1000)
|
|
176
176
|
|
|
177
|
-
sip.request.respond(z
|
|
177
|
+
sip.request.respond(z.$req_id, {code: 200, reason: 'OK', headers: {Expires: '0'}})
|
|
178
178
|
|
|
179
179
|
await z.wait([
|
|
180
180
|
{
|
package/samples/rtp_and_srtp.js
CHANGED
|
@@ -68,8 +68,8 @@ async function test() {
|
|
|
68
68
|
], 1000)
|
|
69
69
|
|
|
70
70
|
dialog.send_reply(
|
|
71
|
-
z
|
|
72
|
-
z
|
|
71
|
+
z.$dialog_id,
|
|
72
|
+
z.$req,
|
|
73
73
|
{
|
|
74
74
|
status: 422,
|
|
75
75
|
reason: 'Session Timer Too Small',
|
|
@@ -97,9 +97,9 @@ async function test() {
|
|
|
97
97
|
}
|
|
98
98
|
], 1000)
|
|
99
99
|
|
|
100
|
-
dialog.destroy(z
|
|
100
|
+
dialog.destroy(z.$dialog_id)
|
|
101
101
|
|
|
102
|
-
delete z
|
|
102
|
+
delete z.$dialog_id
|
|
103
103
|
|
|
104
104
|
oc = sip.call.create(t1.id, {
|
|
105
105
|
from_uri: 'sip:alice@test.com',
|
|
@@ -112,7 +112,7 @@ async function test() {
|
|
|
112
112
|
},
|
|
113
113
|
})
|
|
114
114
|
|
|
115
|
-
delete z
|
|
115
|
+
delete z.$req
|
|
116
116
|
|
|
117
117
|
await z.wait([
|
|
118
118
|
{
|
|
@@ -141,8 +141,8 @@ a=fmtp:101 0-15
|
|
|
141
141
|
a=ptime:20`.replace(/\n/g, "\r\n")
|
|
142
142
|
|
|
143
143
|
dialog.send_reply(
|
|
144
|
-
z
|
|
145
|
-
z
|
|
144
|
+
z.$dialog_id,
|
|
145
|
+
z.$req,
|
|
146
146
|
{
|
|
147
147
|
status: 183,
|
|
148
148
|
reason: 'Session Progress',
|
|
@@ -171,8 +171,8 @@ a=ptime:20`.replace(/\n/g, "\r\n")
|
|
|
171
171
|
], 1000)
|
|
172
172
|
|
|
173
173
|
dialog.send_reply(
|
|
174
|
-
z
|
|
175
|
-
z
|
|
174
|
+
z.$dialog_id,
|
|
175
|
+
z.$req,
|
|
176
176
|
{
|
|
177
177
|
status: 200,
|
|
178
178
|
reason: 'OK',
|
|
@@ -206,12 +206,12 @@ a=ptime:20`.replace(/\n/g, "\r\n")
|
|
|
206
206
|
},
|
|
207
207
|
{
|
|
208
208
|
source: 'sip_endpoint',
|
|
209
|
-
endpoint_id: z
|
|
209
|
+
endpoint_id: z.$endpoint_id,
|
|
210
210
|
req: {
|
|
211
211
|
method: 'ACK',
|
|
212
212
|
},
|
|
213
213
|
event: 'in_dialog_request',
|
|
214
|
-
dialog_id: z
|
|
214
|
+
dialog_id: z.$dialog_id
|
|
215
215
|
},
|
|
216
216
|
], 1000)
|
|
217
217
|
|
|
@@ -228,7 +228,7 @@ a=ptime:20`.replace(/\n/g, "\r\n")
|
|
|
228
228
|
},
|
|
229
229
|
})
|
|
230
230
|
|
|
231
|
-
delete z
|
|
231
|
+
delete z.$req
|
|
232
232
|
|
|
233
233
|
await z.wait([
|
|
234
234
|
{
|
|
@@ -240,13 +240,13 @@ a=ptime:20`.replace(/\n/g, "\r\n")
|
|
|
240
240
|
hdr_session_expires: '300;refresher=uac'
|
|
241
241
|
})),
|
|
242
242
|
event: 'in_dialog_request',
|
|
243
|
-
dialog_id: z
|
|
243
|
+
dialog_id: z.$dialog_id
|
|
244
244
|
},
|
|
245
245
|
], 1000)
|
|
246
246
|
|
|
247
247
|
dialog.send_reply(
|
|
248
|
-
z
|
|
249
|
-
z
|
|
248
|
+
z.$dialog_id,
|
|
249
|
+
z.$req,
|
|
250
250
|
{
|
|
251
251
|
status: 200,
|
|
252
252
|
reason: 'OK',
|
|
@@ -277,7 +277,7 @@ a=ptime:20`.replace(/\n/g, "\r\n")
|
|
|
277
277
|
|
|
278
278
|
sip.call.terminate(oc.id)
|
|
279
279
|
|
|
280
|
-
delete z
|
|
280
|
+
delete z.$req
|
|
281
281
|
|
|
282
282
|
await z.wait([
|
|
283
283
|
{
|
|
@@ -289,8 +289,8 @@ a=ptime:20`.replace(/\n/g, "\r\n")
|
|
|
289
289
|
], 1000)
|
|
290
290
|
|
|
291
291
|
dialog.send_reply(
|
|
292
|
-
z
|
|
293
|
-
z
|
|
292
|
+
z.$dialog_id,
|
|
293
|
+
z.$req,
|
|
294
294
|
{
|
|
295
295
|
status: 200,
|
|
296
296
|
reason: 'OK',
|
package/samples/simple.js
CHANGED
|
@@ -101,8 +101,8 @@ async function test() {
|
|
|
101
101
|
// Here we store data for the incoming call
|
|
102
102
|
// just to organize our code (not really needed)
|
|
103
103
|
const ic = {
|
|
104
|
-
id: z
|
|
105
|
-
sip_call_id: z
|
|
104
|
+
id: z.$call_id,
|
|
105
|
+
sip_call_id: z.$sip_call_id,
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
// Now we answer the call at t2 side sending custom headers.
|
package/samples/sip_cancel.js
CHANGED
package/samples/srtp.js
CHANGED
package/samples/tcp.js
CHANGED
package/samples/tls.js
CHANGED
|
@@ -59,8 +59,8 @@ async function test() {
|
|
|
59
59
|
// Here we store data for the incoming call
|
|
60
60
|
// just to organize our code (not really needed)
|
|
61
61
|
const ic = {
|
|
62
|
-
id: z
|
|
63
|
-
sip_call_id: z
|
|
62
|
+
id: z.$call_id,
|
|
63
|
+
sip_call_id: z.$sip_call_id,
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// Now we answer the call at t2 side
|