sip-lab 1.12.34 → 1.12.35
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 +89 -0
- package/README.md +4 -19
- package/package.json +4 -2
- package/src/Makefile +39 -0
- package/src/addon.cpp +1094 -0
- package/src/event_templates.cpp +62 -0
- package/src/event_templates.hpp +29 -0
- package/src/idmanager.cpp +76 -0
- package/src/idmanager.hpp +26 -0
- package/src/log.cpp +18 -0
- package/src/log.hpp +15 -0
- package/src/packetdumper.cpp +234 -0
- package/src/packetdumper.hpp +67 -0
- package/src/pjmedia/Makefile +39 -0
- package/src/pjmedia/devjournal +26 -0
- package/src/pjmedia/include/chainlink/README +3 -0
- package/src/pjmedia/include/chainlink/chainlink.h +11 -0
- package/src/pjmedia/include/chainlink/chainlink_dtmfdet.h +56 -0
- package/src/pjmedia/include/chainlink/chainlink_fax.h +25 -0
- package/src/pjmedia/include/chainlink/chainlink_tonegen.h +178 -0
- package/src/pjmedia/include/chainlink/chainlink_wav_port.h +231 -0
- package/src/pjmedia/include/chainlink/chainlink_wire_port.h +50 -0
- package/src/pjmedia/include/pjmedia/README +3 -0
- package/src/pjmedia/include/pjmedia/dtmfdet.h +74 -0
- package/src/pjmedia/src/chainlink/chainlink_dtmfdet.c +125 -0
- package/src/pjmedia/src/chainlink/chainlink_fax.c +280 -0
- package/src/pjmedia/src/chainlink/chainlink_tonegen.c +901 -0
- package/src/pjmedia/src/chainlink/chainlink_wav_player.c +688 -0
- package/src/pjmedia/src/chainlink/chainlink_wav_writer.c +442 -0
- package/src/pjmedia/src/chainlink/chainlink_wire_port.c +93 -0
- package/src/pjmedia/src/pjmedia/dtmfdet.c +129 -0
- package/src/pjmedia/src/pjmedia/simpleua_dtmfdet.c +753 -0
- package/src/pjmedia/src/pjmedia/tonegen_dtmfdet.c +263 -0
- package/src/sip.cpp +5988 -0
- package/src/sip.hpp +107 -0
package/DEV.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
### For devs
|
|
2
|
+
|
|
3
|
+
We build and statically link to libs pjproject, spandsp, bgc729 and rapidjson.
|
|
4
|
+
|
|
5
|
+
Basic tasks for development:
|
|
6
|
+
|
|
7
|
+
#### To build
|
|
8
|
+
```
|
|
9
|
+
npm install
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
#### To clean up (for a clean rebuild)
|
|
13
|
+
```
|
|
14
|
+
npx node-gyp clean
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
#### To update pjproject, spandsp, bcg729 or rapidjson
|
|
18
|
+
Just delete the corresponding library subfolder in subfolder 3drParty.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
Then temporarily change install.sh to not checkout a specific version (or checkout a desired commit)
|
|
22
|
+
|
|
23
|
+
Then run
|
|
24
|
+
```
|
|
25
|
+
npm install
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Then perform code changes and tests. When you are satisfied with them, update install.sh with the new commit id.
|
|
29
|
+
|
|
30
|
+
#### prebuild binaries
|
|
31
|
+
```
|
|
32
|
+
nvm use v16.13.1 # if we try with v17 it will fail to build for -t 1.5.0.0
|
|
33
|
+
npx prebuildify --strip -t 15.0.0 -t 16.0.0 -t 17.0.0 -t 18.0.0
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
#### Running tests
|
|
37
|
+
```
|
|
38
|
+
npm test
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
#### publishing to npm registry
|
|
42
|
+
|
|
43
|
+
Do it from within the project folder. First do a dry-run to check which files will be included:
|
|
44
|
+
```
|
|
45
|
+
takeshi:sip-lab$ npm publish --dry-run
|
|
46
|
+
npm notice
|
|
47
|
+
npm notice 📦 sip-lab@1.12.26
|
|
48
|
+
npm notice === Tarball Contents ===
|
|
49
|
+
npm notice 1.8kB README.md
|
|
50
|
+
npm notice 1.5kB build_deps.sh
|
|
51
|
+
npm notice 2.8kB index.js
|
|
52
|
+
npm notice 757B package.json
|
|
53
|
+
npm notice 1.8MB prebuilds/linux-x64/node.abi88.node
|
|
54
|
+
npm notice 1.8MB prebuilds/linux-x64/node.abi93.node
|
|
55
|
+
npm notice 1.9MB prebuilds/linux-x64/node.abi102.node
|
|
56
|
+
npm notice 1.9MB prebuilds/linux-x64/node.abi108.node
|
|
57
|
+
npm notice 173.2kB samples/artifacts/marielle_presente.tiff
|
|
58
|
+
npm notice 18.4kB samples/artifacts/sample.tiff
|
|
59
|
+
npm notice 74.0kB samples/artifacts/this-is-never-ok.tiff
|
|
60
|
+
npm notice 19.8kB samples/artifacts/yosemitesam.wav
|
|
61
|
+
npm notice 6.8kB samples/delayed_media.js
|
|
62
|
+
npm notice 4.6kB samples/g729.js
|
|
63
|
+
npm notice 4.2kB samples/register_subscribe.js
|
|
64
|
+
npm notice 6.8kB samples/reinvite_and_dtmf.js
|
|
65
|
+
npm notice 3.5kB samples/send_and_receive_fax.js
|
|
66
|
+
npm notice 5.0kB samples/simple.js
|
|
67
|
+
npm notice 2.9kB samples/sip_cancel.js
|
|
68
|
+
npm notice 7.9kB samples/tcp_and_extra_headers.js
|
|
69
|
+
npm notice === Tarball Details ===
|
|
70
|
+
npm notice name: sip-lab
|
|
71
|
+
npm notice version: 1.12.26
|
|
72
|
+
npm notice filename: sip-lab-1.12.26.tgz
|
|
73
|
+
npm notice package size: 3.2 MB
|
|
74
|
+
npm notice unpacked size: 7.7 MB
|
|
75
|
+
npm notice shasum: aa225a9a6c704eddbfb945fe1570184d881c12d2
|
|
76
|
+
npm notice integrity: sha512-WtPrIFrFXlSAC[...]tLGc4T5h8y2qw==
|
|
77
|
+
npm notice total files: 20
|
|
78
|
+
npm notice
|
|
79
|
+
npm notice Publishing to https://registry.npmjs.org/ (dry-run)
|
|
80
|
+
+ sip-lab@1.12.26
|
|
81
|
+
takeshi:sip-lab$
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Then do the actual publish:
|
|
85
|
+
```
|
|
86
|
+
npm publish
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
|
package/README.md
CHANGED
|
@@ -19,31 +19,16 @@ TODO:
|
|
|
19
19
|
### Installation
|
|
20
20
|
|
|
21
21
|
This is an node.js addon and it is known to work on Ubuntu 18.04, Ubuntu 20.04, Ubuntu 22.04, Debian 10 and Debian 11 (it is known to not work on Debian 8 unless the app is built locally).
|
|
22
|
-
It is distributed with prebuild binaries for node.js 15.0.0 and above.
|
|
22
|
+
It is distributed with prebuild binaries for node.js 15.0.0 and above (but built for Debian 11).
|
|
23
23
|
|
|
24
|
-
To install it,
|
|
25
|
-
```
|
|
26
|
-
npm install sip-lab
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
If a prebuilt binary is not available, npm will try to build the addon.
|
|
30
|
-
|
|
31
|
-
This might fail if you don't have the required tools and libraries.
|
|
32
|
-
|
|
33
|
-
If this happens try installing them by doing:
|
|
24
|
+
To install it, first install some dependencies:
|
|
34
25
|
```
|
|
35
26
|
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
|
|
36
27
|
```
|
|
37
28
|
|
|
38
|
-
Then
|
|
39
|
-
```
|
|
40
|
-
./build_deps.sh
|
|
29
|
+
Then install sip-lab:
|
|
41
30
|
```
|
|
42
|
-
|
|
43
|
-
and build the node addon by doing:
|
|
44
|
-
```
|
|
45
|
-
npx node-gyp configure
|
|
46
|
-
npx node-gyp build
|
|
31
|
+
npm install sip-lab
|
|
47
32
|
```
|
|
48
33
|
|
|
49
34
|
Then run some sample script from subfolder samples:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sip-lab",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.35",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"engines": {
|
|
@@ -30,9 +30,11 @@
|
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"index.js",
|
|
33
|
-
"install.sh",
|
|
34
33
|
"binding.gyp",
|
|
35
34
|
"build_deps.sh",
|
|
35
|
+
"src",
|
|
36
|
+
"README.md",
|
|
37
|
+
"DEV.md",
|
|
36
38
|
"samples",
|
|
37
39
|
"prebuilds"
|
|
38
40
|
]
|
package/src/Makefile
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#Modify this to point to the PJSIP location.
|
|
2
|
+
PJBASE=/usr/local/src/svn/pjproject
|
|
3
|
+
|
|
4
|
+
include $(PJBASE)/build.mak
|
|
5
|
+
|
|
6
|
+
CC = $(APP_CC)
|
|
7
|
+
LDFLAGS = $(APP_LDFLAGS)
|
|
8
|
+
LDLIBS = -lstdc++ $(APP_LDLIBS)
|
|
9
|
+
CFLAGS = $(APP_CFLAGS)
|
|
10
|
+
|
|
11
|
+
# CFLAGS is APP_CFLAGS that comes from /user/local/src/svn/pjproject. In it, we have -02. So since we want to disable optimization by setting -O0
|
|
12
|
+
# we set -O0 before and after it to ensure -O0 has the final say.
|
|
13
|
+
CPPFLAGS= -g -O0 ${CFLAGS} $(LDFLAGS) -O0 -I /usr/local/src/boost_1_51_0 -I pjmedia/include/chainlink
|
|
14
|
+
|
|
15
|
+
VPATH = pjmedia
|
|
16
|
+
|
|
17
|
+
.PHONY : clean install
|
|
18
|
+
|
|
19
|
+
all: sip.so
|
|
20
|
+
|
|
21
|
+
chainlink:
|
|
22
|
+
make -C pjmedia
|
|
23
|
+
|
|
24
|
+
idmanager.o: idmanager.cpp idmanager.hpp
|
|
25
|
+
$(CC) -fPIC -c -o idmanager.o idmanager.cpp $(CPPFLAGS)
|
|
26
|
+
|
|
27
|
+
event_templates.o: event_templates.cpp event_templates.hpp
|
|
28
|
+
$(CC) -fPIC -c -o event_templates.o event_templates.cpp $(CPPFLAGS)
|
|
29
|
+
|
|
30
|
+
sip.o: sip.cpp sip.hpp
|
|
31
|
+
$(CC) -fPIC -c -o sip.o sip.cpp $(CPPFLAGS)
|
|
32
|
+
|
|
33
|
+
sip.so: sip.o idmanager.o event_templates.o chainlink
|
|
34
|
+
$(CC) -fPIC -shared -o sip.so sip.o idmanager.o event_templates.o pjmedia/libchainlink.a 3rdParty/spandsp/src/.libs/libspandsp.a -Wl,-E -lm -ldl -ltiff $(CPPFLAGS) $(LDFLAGS) $(LDLIBS)
|
|
35
|
+
|
|
36
|
+
clean:
|
|
37
|
+
rm -f *.o *.so
|
|
38
|
+
make -C pjmedia clean
|
|
39
|
+
|