sip-lab 1.34.1 → 1.34.3

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/README.md CHANGED
@@ -2,43 +2,36 @@
2
2
 
3
3
  ### Overview
4
4
 
5
- A nodejs module that helps to write functional tests for SIP systems (including media operations).
5
+ A nodejs module that helps to write functional/integration tests for SIP systems (including media operations).
6
6
  It uses pjproject for SIP and media processing.
7
7
 
8
- It permits to:
9
- - make audio calls using UDP, TCP and TLS transports
10
- - send/receive DTMF inband/RFC2833/INFO.
11
- - send/receive [BFSK](https://en.wikipedia.org/wiki/Frequency-shift_keying) bits.
12
- - play/record audio on a call from/to a wav file
13
- - send/receive fax (T.30 only)
14
- - send/receive MRCPv2 messages (TCP only, no TLS)
15
- - send/receive audio using SRTP
16
- - do speech synth using flite
17
- - do speech recog using pocketsphinx (but only works well with sampling rate of 16000)
18
- - do speech synth/recog using [ws_speech_server](https://github.com/MayamaTakeshi/ws_speech_server) (this permits to use google/amazon/azure/etc speech services)
19
-
20
- TODO:
21
- - add support for video playing/recording from/to file
22
- - add support for T.38 fax
23
- - add support for SIP over WebSocket
24
- - add support for WebRTC
25
- - add support for MSRP
8
+ ### Documentation
9
+
10
+ See [Documentation](https://github.com/MayamaTakeshi/sip-lab/blob/master/DOC.md)
26
11
 
27
12
  ### Installation
28
13
 
29
- This is a node.js addon and it is known to work on Debian 11.
14
+ The npm package is built for Debian 11 and this is the recommended distro.
15
+
16
+ You can use other debian/ubuntu version but they will require a build of dependencies that will take time (something like 7 minutes but this was measured on my slow PC).
30
17
 
31
- It is distributed with prebuild binaries for node.js 15.0.0 and above (but built for Debian 11. For other Debian versions or for Ubuntu a local build of the addon will be executed. Being the case, be patient as the build process will take several minutes to complete (about 6 minutes on a docker container)).
18
+ First install apt packages:
32
19
 
33
- To install it, first install build dependencies:
34
20
  ```
35
21
  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 flite-dev cmake git wget
22
+
36
23
  ```
37
24
 
38
- Then install sip-lab (local build of the addon might be triggered here if this is not Debian 11):
25
+ Then switch to node v19, switch to your node project folder and install sip-lab:
26
+
39
27
  ```
40
- npm install sip-lab
28
+ nvm install 19
29
+ nvm use 19
30
+ cd YOUR_NODE_PROJECT_FOLDER
31
+ npm i sip-lab
41
32
  ```
33
+ Obs: once you install sip-lab, you can switch to other node versions like v20, v21.
34
+
42
35
 
43
36
  Then run some sample script from subfolder samples:
44
37
  ```
@@ -49,12 +42,6 @@ The above script has detailed comments.
49
42
 
50
43
  Please read it to undestand how to write your own test scripts.
51
44
 
52
- Notes:
53
- - It will not work on Debian 10 as cmake version is older than required.
54
- - It will work on Debian 12 but a build process will be required. But you need to build using node v19 or older. Building with node v20 or v21 will fail (https://github.com/MayamaTakeshi/sip-lab/issues/107). But once you have it built, you can switch to a newer version of node.
55
-
56
- So basically, if you stick with Debian 11 and any node version from 15 to 21, istallation should be smooth.
57
-
58
45
  ### Samples
59
46
 
60
47
  See general sample scripts in folder samples.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sip-lab",
3
- "version": "1.34.1",
3
+ "version": "1.34.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "engines": {
package/samples/g729.js CHANGED
@@ -80,8 +80,8 @@ async function test() {
80
80
  sip.call.start_record_wav(oc.id, {file: './oc.wav'})
81
81
  sip.call.start_record_wav(ic.id, {file: './ic.wav'})
82
82
 
83
- sip.call.start_play_wav(oc.id, {file: 'samples/artifacts/yosemitesam.wav', end_of_file_event: true, no_loop: true})
84
- sip.call.start_play_wav(ic.id, {file: 'samples/artifacts/yosemitesam.wav', end_of_file_event: true, no_loop: true})
83
+ sip.call.start_play_wav(oc.id, {file: 'samples/artifacts/hello_good_morning.wav', end_of_file_event: true, no_loop: true})
84
+ sip.call.start_play_wav(ic.id, {file: 'samples/artifacts/hello_good_morning.wav', end_of_file_event: true, no_loop: true})
85
85
 
86
86
  await z.wait([
87
87
  {
@@ -92,7 +92,7 @@ async function test() {
92
92
  event: 'end_of_file',
93
93
  call_id: ic.id,
94
94
  },
95
- ], 3000)
95
+ ], 5000)
96
96
 
97
97
  sip.call.reinvite(oc.id)
98
98
 
@@ -81,8 +81,8 @@ async function test() {
81
81
  sip.call.start_record_wav(oc.id, {file: './oc.wav'})
82
82
  sip.call.start_record_wav(ic.id, {file: './ic.wav'})
83
83
 
84
- sip.call.start_play_wav(oc.id, {file: 'samples/artifacts/yosemitesam.wav', end_of_file_event: true, no_loop: true})
85
- sip.call.start_play_wav(ic.id, {file: 'samples/artifacts/yosemitesam.wav', end_of_file_event: true, no_loop: true})
84
+ sip.call.start_play_wav(oc.id, {file: 'samples/artifacts/hello_good_morning.wav', end_of_file_event: true, no_loop: true})
85
+ sip.call.start_play_wav(ic.id, {file: 'samples/artifacts/hello_good_morning.wav', end_of_file_event: true, no_loop: true})
86
86
 
87
87
  await z.wait([
88
88
  {
@@ -93,7 +93,7 @@ async function test() {
93
93
  event: 'end_of_file',
94
94
  call_id: ic.id,
95
95
  },
96
- ], 3000)
96
+ ], 5000)
97
97
 
98
98
  sip.call.reinvite(oc.id)
99
99
 
@@ -87,8 +87,8 @@ async function test() {
87
87
 
88
88
  await z.sleep(100)
89
89
 
90
- sip.call.start_play_wav(oc.id, {file: 'samples/artifacts/yosemitesam.wav', end_of_file_event: true})
91
- sip.call.start_play_wav(ic.id, {file: 'samples/artifacts/yosemitesam.wav', end_of_file_event: true})
90
+ sip.call.start_play_wav(oc.id, {file: 'samples/artifacts/hello_good_morning.wav', end_of_file_event: true})
91
+ sip.call.start_play_wav(ic.id, {file: 'samples/artifacts/hello_good_morning.wav', end_of_file_event: true})
92
92
 
93
93
  await z.sleep(500)
94
94
 
@@ -143,7 +143,7 @@ async function test() {
143
143
  event: 'end_of_file',
144
144
  call_id: oc.id,
145
145
  },
146
- ], 2000)
146
+ ], 5000)
147
147
 
148
148
 
149
149
  sip.call.reinvite(ic.id)
@@ -87,8 +87,8 @@ async function test() {
87
87
 
88
88
  await z.sleep(100)
89
89
 
90
- sip.call.start_play_wav(oc.id, {file: 'samples/artifacts/yosemitesam.wav', end_of_file_event: true, no_loop: true})
91
- sip.call.start_play_wav(ic.id, {file: 'samples/artifacts/yosemitesam.wav', end_of_file_event: true, no_loop: true})
90
+ sip.call.start_play_wav(oc.id, {file: 'samples/artifacts/hello_good_morning.wav', end_of_file_event: true, no_loop: true})
91
+ sip.call.start_play_wav(ic.id, {file: 'samples/artifacts/hello_good_morning.wav', end_of_file_event: true, no_loop: true})
92
92
 
93
93
  sip.call.reinvite(oc.id)
94
94
 
@@ -183,7 +183,7 @@ async function test() {
183
183
  event: 'end_of_file',
184
184
  call_id: oc.id,
185
185
  },
186
- ], 3000)
186
+ ], 5000)
187
187
 
188
188
  await z.sleep(3000) // we should not receive end_of_file events again
189
189
 
package/samples/tcp.js CHANGED
@@ -312,8 +312,8 @@ async function test() {
312
312
  },
313
313
  ], 2000)
314
314
 
315
- sip.call.start_play_wav(oc.id, {file: 'samples/artifacts/yosemitesam.wav'})
316
- sip.call.start_play_wav(ic.id, {file: 'samples/artifacts/yosemitesam.wav'})
315
+ sip.call.start_play_wav(oc.id, {file: 'samples/artifacts/hello_good_morning.wav'})
316
+ sip.call.start_play_wav(ic.id, {file: 'samples/artifacts/hello_good_morning.wav'})
317
317
 
318
318
  await z.sleep(2000)
319
319
 
Binary file