sip-lab 1.37.0 → 1.39.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/DEV.md +2 -2
- package/package.json +2 -2
- package/prebuilds/linux-x64/node.abi102.node +0 -0
- package/prebuilds/linux-x64/node.abi108.node +0 -0
- package/prebuilds/linux-x64/node.abi111.node +0 -0
- package/prebuilds/linux-x64/node.abi115.node +0 -0
- package/prebuilds/linux-x64/node.abi120.node +0 -0
- package/prebuilds/linux-x64/node.abi88.node +0 -0
- package/prebuilds/linux-x64/node.abi93.node +0 -0
- 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.no_rest_between_msgs.js +254 -0
- 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/src/sip.cpp +55 -46
- package/samples/ic.wav +0 -0
- package/samples/oc.wav +0 -0
- package/src/sip.cpp.old +0 -9236
package/DEV.md
CHANGED
|
@@ -6,7 +6,7 @@ Basic tasks for development:
|
|
|
6
6
|
|
|
7
7
|
#### To build
|
|
8
8
|
```
|
|
9
|
-
sudo apt install build-essential automake autoconf libtool libspeex-dev libopus-dev libsdl2-dev libavdevice-dev libswscale-dev libv4l-dev libopencore-amrnb-dev libopencore-amrwb-dev libvo-amrwbenc-dev libvo-amrwbenc-dev libboost-dev libtiff-dev libpcap-dev libssl-dev uuid-dev cmake
|
|
9
|
+
sudo apt install build-essential automake autoconf libtool libspeex-dev libopus-dev libsdl2-dev libavdevice-dev libswscale-dev libv4l-dev libopencore-amrnb-dev libopencore-amrwb-dev libvo-amrwbenc-dev libvo-amrwbenc-dev libboost-dev libtiff-dev libpcap-dev libssl-dev uuid-dev cmake flite-dev
|
|
10
10
|
|
|
11
11
|
npm install
|
|
12
12
|
```
|
|
@@ -73,7 +73,7 @@ If it fails due to proxy problems, check if you have proxy configured in ~/.dock
|
|
|
73
73
|
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
After the
|
|
76
|
+
After the image is built you can pass them to prebuildify-cross:
|
|
77
77
|
```
|
|
78
78
|
nvm use v16.13.1
|
|
79
79
|
npx prebuildify-cross -i mayamatakeshi/sip-lab-debian11:latest -t 15.0.0 -t 16.0.0 -t 17.0.0 -t 18.0.0 -t 19.0.0 -t 20.0.0 -t 21.0.0 --strip
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sip-lab",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.39.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",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
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
|
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
var sip = require ('../index.js')
|
|
2
|
+
var Zeq = require('@mayama/zeq')
|
|
3
|
+
var z = new Zeq()
|
|
4
|
+
var m = require('data-matching')
|
|
5
|
+
var sip_msg = require('sip-matching')
|
|
6
|
+
var sdp = require('sdp-matching')
|
|
7
|
+
var mrcp = require('mrcp')
|
|
8
|
+
var mrcp_msg = require('mrcp-matching')
|
|
9
|
+
|
|
10
|
+
async function test() {
|
|
11
|
+
sip.set_log_level(9)
|
|
12
|
+
|
|
13
|
+
//sip.set_log_level(6)
|
|
14
|
+
sip.dtmf_aggregation_on(500)
|
|
15
|
+
|
|
16
|
+
z.trap_events(sip.event_source, 'event', (evt) => {
|
|
17
|
+
var e = evt.args[0]
|
|
18
|
+
return e
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
console.log(sip.start((data) => { console.log(data)} ))
|
|
22
|
+
|
|
23
|
+
var t1 = sip.transport.create({address: "127.0.0.1", type: 'udp'})
|
|
24
|
+
var t2 = sip.transport.create({address: "127.0.0.1", type: 'udp'})
|
|
25
|
+
|
|
26
|
+
console.log("t1", t1)
|
|
27
|
+
console.log("t2", t2)
|
|
28
|
+
|
|
29
|
+
var client_media = [
|
|
30
|
+
{
|
|
31
|
+
type: 'mrcp',
|
|
32
|
+
fields: [
|
|
33
|
+
'a=setup:active',
|
|
34
|
+
'a=connection:new',
|
|
35
|
+
'a=resource:speechsynth',
|
|
36
|
+
'a=cmid:1',
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
type: 'audio',
|
|
41
|
+
fields: [
|
|
42
|
+
'a=recvonly',
|
|
43
|
+
'a=mid:1',
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
var server_media = [
|
|
49
|
+
{
|
|
50
|
+
type: 'mrcp',
|
|
51
|
+
fields: [
|
|
52
|
+
'a=setup:passive',
|
|
53
|
+
'a=connection:new',
|
|
54
|
+
'a=channel:32AECB234338@speechsynth',
|
|
55
|
+
'a=cmid:1',
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: 'audio',
|
|
60
|
+
fields: [
|
|
61
|
+
'a=sendonly',
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
oc = sip.call.create(t1.id, {
|
|
67
|
+
from_uri: 'sip:alice@test.com',
|
|
68
|
+
to_uri: `sip:bob@${t2.address}:${t2.port}`,
|
|
69
|
+
media: client_media,
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
await z.wait([
|
|
73
|
+
{
|
|
74
|
+
event: "incoming_call",
|
|
75
|
+
call_id: m.collect("call_id"),
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
event: 'response',
|
|
79
|
+
call_id: oc.id,
|
|
80
|
+
method: 'INVITE',
|
|
81
|
+
msg: sip_msg({
|
|
82
|
+
$rs: '100',
|
|
83
|
+
$rr: 'Trying',
|
|
84
|
+
'$hdr(call-id)': m.collect('sip_call_id'),
|
|
85
|
+
}),
|
|
86
|
+
},
|
|
87
|
+
], 1000)
|
|
88
|
+
|
|
89
|
+
ic = {
|
|
90
|
+
id: z.$call_id,
|
|
91
|
+
sip_call_id: z.$sip_call_id,
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
sip.call.respond(ic.id, {
|
|
95
|
+
code: 200,
|
|
96
|
+
reason: 'OK',
|
|
97
|
+
media: server_media,
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
await z.wait([
|
|
101
|
+
{
|
|
102
|
+
event: 'response',
|
|
103
|
+
call_id: oc.id,
|
|
104
|
+
method: 'INVITE',
|
|
105
|
+
msg: sip_msg({
|
|
106
|
+
$rs: '200',
|
|
107
|
+
$rr: 'OK',
|
|
108
|
+
'$hdr(content-type)': 'application/sdp',
|
|
109
|
+
$rb: sdp.jsonpath_matcher({
|
|
110
|
+
'$.media[?(@.desc.type=="application")].val_attrs.channel': [m.collect('mrcp_channel')],
|
|
111
|
+
}),
|
|
112
|
+
}),
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
event: 'media_update',
|
|
116
|
+
call_id: oc.id,
|
|
117
|
+
status: 'ok',
|
|
118
|
+
media: [
|
|
119
|
+
{
|
|
120
|
+
type: 'mrcp',
|
|
121
|
+
local: {
|
|
122
|
+
port: 9
|
|
123
|
+
},
|
|
124
|
+
remote: {
|
|
125
|
+
port: m.collect('mrcp_server_port'),
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
type: 'audio',
|
|
130
|
+
local: {
|
|
131
|
+
mode: 'recvonly'
|
|
132
|
+
},
|
|
133
|
+
remote: {
|
|
134
|
+
mode: 'sendonly'
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
event: 'media_update',
|
|
141
|
+
call_id: ic.id,
|
|
142
|
+
status: 'ok',
|
|
143
|
+
media: [
|
|
144
|
+
{
|
|
145
|
+
type: 'mrcp',
|
|
146
|
+
local: {
|
|
147
|
+
port: m.collect('mrcp_server_port'),
|
|
148
|
+
},
|
|
149
|
+
remote: {
|
|
150
|
+
port: 9
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
type: 'audio',
|
|
155
|
+
local: {
|
|
156
|
+
mode: 'sendonly'
|
|
157
|
+
},
|
|
158
|
+
remote: {
|
|
159
|
+
mode: 'recvonly'
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
},
|
|
164
|
+
], 1000)
|
|
165
|
+
|
|
166
|
+
var mrcp_channel = z.$mrcp_channel
|
|
167
|
+
var request_id = 1;
|
|
168
|
+
var msg = mrcp.builder.build_request('SPEAK', request_id, {'channel-identifier': mrcp_channel, 'content-type': 'application/xml'}, "<root>test</root>")
|
|
169
|
+
|
|
170
|
+
sip.call.send_mrcp_msg(oc.id, {msg})
|
|
171
|
+
|
|
172
|
+
await z.wait([
|
|
173
|
+
{
|
|
174
|
+
event: 'mrcp_msg',
|
|
175
|
+
call_id: ic.id,
|
|
176
|
+
msg: mrcp_msg({
|
|
177
|
+
type: 'request',
|
|
178
|
+
version: '2.0',
|
|
179
|
+
method: 'SPEAK',
|
|
180
|
+
request_id: 1,
|
|
181
|
+
headers: {
|
|
182
|
+
'content-type': 'application/xml',
|
|
183
|
+
},
|
|
184
|
+
body: '<root>test</root>',
|
|
185
|
+
}),
|
|
186
|
+
},
|
|
187
|
+
], 1000)
|
|
188
|
+
|
|
189
|
+
msg = mrcp.builder.build_response(request_id, 200, 'IN-PROGRESS', {'channel-identifier': mrcp_channel})
|
|
190
|
+
sip.call.send_mrcp_msg(ic.id, {msg})
|
|
191
|
+
|
|
192
|
+
msg = mrcp.builder.build_event('SPEAK-COMPLETE', request_id, 'COMPLETE', {'channel-identifier': mrcp_channel})
|
|
193
|
+
sip.call.send_mrcp_msg(ic.id, {msg})
|
|
194
|
+
|
|
195
|
+
await z.wait([
|
|
196
|
+
{
|
|
197
|
+
event: 'mrcp_msg',
|
|
198
|
+
call_id: oc.id,
|
|
199
|
+
msg: mrcp_msg({
|
|
200
|
+
type: 'response',
|
|
201
|
+
version: '2.0',
|
|
202
|
+
request_id: 1,
|
|
203
|
+
status_code: 200,
|
|
204
|
+
request_state: 'IN-PROGRESS',
|
|
205
|
+
}),
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
event: 'mrcp_msg',
|
|
209
|
+
call_id: oc.id,
|
|
210
|
+
msg: mrcp_msg({
|
|
211
|
+
type: 'event',
|
|
212
|
+
version: '2.0',
|
|
213
|
+
request_id: 1,
|
|
214
|
+
event_name: 'SPEAK-COMPLETE',
|
|
215
|
+
request_state: 'COMPLETE',
|
|
216
|
+
}),
|
|
217
|
+
},
|
|
218
|
+
], 1000)
|
|
219
|
+
|
|
220
|
+
sip.call.terminate(oc.id)
|
|
221
|
+
|
|
222
|
+
await z.wait([
|
|
223
|
+
{
|
|
224
|
+
event: 'call_ended',
|
|
225
|
+
call_id: oc.id,
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
event: 'call_ended',
|
|
229
|
+
call_id: ic.id,
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
event: 'response',
|
|
233
|
+
call_id: oc.id,
|
|
234
|
+
method: 'BYE',
|
|
235
|
+
msg: sip_msg({
|
|
236
|
+
$rs: '200',
|
|
237
|
+
$rr: 'OK',
|
|
238
|
+
}),
|
|
239
|
+
},
|
|
240
|
+
], 1000)
|
|
241
|
+
|
|
242
|
+
console.log("Success")
|
|
243
|
+
|
|
244
|
+
sip.stop()
|
|
245
|
+
process.exit(0)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
test()
|
|
250
|
+
.catch(e => {
|
|
251
|
+
console.error(e)
|
|
252
|
+
process.exit(1)
|
|
253
|
+
})
|
|
254
|
+
|
|
@@ -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