Browse code

rtp_media_server: update to mediastreamer 4.4.0

update documentation to simplify usage using docker

(cherry picked from commit 32350bcb48757f2431fe463167a2816a702a8cb7)

Julien Chavanton authored on 09/07/2020 23:24:59 • Daniel-Constantin Mierla committed on 28/07/2020 06:36:23
Showing 6 changed files
... ...
@@ -6,7 +6,7 @@ DEFS+=-I$(LOCALBASE)/lib
6 6
 
7 7
 ORTPLIBS=-lortp
8 8
 BCUNITLIBS=-lbcunit
9
-MS2LIBS=-lmediastreamer_voip -lmediastreamer_base
9
+MS2LIBS=-lmediastreamer
10 10
 
11 11
 LIBS=$(ORTPLIBS) $(BCUNITLIBS) $(MS2LIBS)
12 12
 DEFS+=-DKAMAILIO_MOD_INTERFACE
... ...
@@ -28,6 +28,19 @@
28 28
 	</para>
29 29
 </section>
30 30
 
31
+<section>
32
+	<title>Quick start, how-to build on debian</title>
33
+	<section>
34
+		<title>Building on Debian, Dockerfile and docker image</title>
35
+		<para>
36
+		The module includes Dockerfile that can also be use as a reference on how to build everything
37
+		from source on Debian, the of libmediastreamer on Linux is usually outdated.
38
+		
39
+		A docker image is also available from dockerhub https://hub.docker.com/r/jchavanton/rtp_media_server
40
+		</para>
41
+	</section>
42
+</section>
43
+
31 44
 <section>
32 45
 	<title>Dependencies</title>
33 46
 	<section>
... ...
@@ -1,4 +1,4 @@
1
-FROM debian
1
+FROM debian:buster
2 2
 
3 3
 ENV DEB_PKG_CORES="libevent-dev libjansson-dev libpcre3 libpcre3-dev"
4 4
 
... ...
@@ -10,10 +10,10 @@ ENV KAM_INC_MOD="uac debugger rtp_media_server usrloc registrar siputils"
10 10
 ENV KAM_SKIP_MOD="uid_domain diversion smsops mediaproxy rtpproxy mqueue topoh app_jsdt tsilo drouting kex acc stun usrloc p_usrloc dmq dmq_usrloc sipjson userblacklist path libtrie kex sipdump  uid_uri_db msrp sst imc mohqueue nattraversal pike xhttp rtpengine sca pdt matrix auth_diameter keepalive seas carrierroute ss7ops pipelimit db_cluster secfilter mangler acc_diameter enum app_sqlang pdb mtree sms"
11 11
 
12 12
 ENV COMMIT_KAMAILIO=master
13
-ENV COMMIT_BCUNIT=29c556fa8ac1ab21fba1291231ffa8dea43cf32a
14
-ENV COMMIT_BCTOOLBOX=971953a9fa4058e9c8a40ca4a3fa12d832445255
15
-ENV COMMIT_ORTP=6e13ef49a55cdd19dae395c38cfff7ffa518a089
16
-ENV COMMIT_MEDIASTREAMER2=d935123fc497d19a24019c6e7ae4fe0c5f19d55a
13
+ENV COMMIT_BCUNIT=origin/release/4.4
14
+ENV COMMIT_BCTOOLBOX=origin/release/4.4
15
+ENV COMMIT_ORTP=4.4.0
16
+ENV COMMIT_MEDIASTREAMER2=4.4.0
17 17
 
18 18
 RUN echo "building Kamailio with RTP Media Server" \
19 19
 	&& apt-get update && apt-get -y install ${DEB_PKG} ${DEB_PKG_TMP} \
... ...
@@ -28,12 +28,14 @@ RUN apt-get install -y automake autogen autoconf libtool pkg-config
28 28
 # 	&& ./configure \
29 29
 # 	&& make && make install
30 30
 
31
+RUN apt-get install -y cmake
32
+
31 33
 RUN echo "building bcunit" \
32 34
 	&& mkdir -p /git && cd /git \
33 35
 	&& git clone https://github.com/BelledonneCommunications/bcunit.git \
34 36
 	&& cd bcunit \
35 37
 	&& git checkout ${COMMIT_BCUNIT} \
36
-	&& ./autogen.sh && ./configure \
38
+	&& cmake CMakeLists.txt \
37 39
 	&& make && make install
38 40
 
39 41
 RUN echo "building bctoolbox" \
... ...
@@ -42,15 +44,17 @@ RUN echo "building bctoolbox" \
42 44
 	&& git clone https://github.com/BelledonneCommunications/bctoolbox.git \
43 45
 	&& cd bctoolbox \
44 46
 	&& git checkout ${COMMIT_BCTOOLBOX} \
45
-	&& ./autogen.sh && ./configure \
47
+	&& cmake CMakeLists.txt \
46 48
 	&& make && make install
47 49
 
50
+RUN apt-get install -y libsrtp2-dev
51
+
48 52
 RUN echo "building oRTP" \
49 53
 	&& mkdir -p /git && cd /git \
50 54
 	&& git clone https://github.com/BelledonneCommunications/ortp.git \
51 55
 	&& cd ortp \
52 56
 	&& git checkout ${COMMIT_ORTP} \
53
-	&& ./autogen.sh && ./configure \
57
+	&& cmake CMakeLists.txt \
54 58
 	&& make && make install
55 59
 
56 60
 RUN echo "building mediastreamer2" \
... ...
@@ -59,7 +63,7 @@ RUN echo "building mediastreamer2" \
59 63
 	&& git clone https://github.com/BelledonneCommunications/mediastreamer2.git \
60 64
 	&& cd mediastreamer2 \
61 65
 	&& git checkout ${COMMIT_MEDIASTREAMER2} \
62
-	&& ./autogen.sh && ./configure --disable-sound --disable-video --enable-tools=no --disable-tests \
66
+	&& cmake -DENABLE_SOUND=OFF -DENABLE_VIDEO=OFF -DENABLE_ZRTP=OFF CMakeLists.txt \
63 67
 	&& make && make install \
64 68
 	&& ldconfig
65 69
 
... ...
@@ -68,9 +72,9 @@ RUN echo "download sample voice files" \
68 72
 	&& wget http://www.voiptroubleshooter.com/open_speech/american/OSR_us_000_0010_8k.wav
69 73
 
70 74
 RUN echo "building Kamailio" \
71
- 	&& mkdir -p /git && cd /git \
72
- 	&& git clone https://github.com/kamailio/kamailio.git \
73
- 	&& cd kamailio && git checkout ${COMMIT_KAMAILIO} \
74
- 	&& make include_modules="${KAM_INC_MOD}" skip_modules="\$(mod_list_extra) \$(mod_list_db) ${KAM_SKIP_MOD}" cfg \
75
- 	&& make install
75
+	&& mkdir -p /git && cd /git \
76
+	&& git clone https://github.com/kamailio/kamailio.git \
77
+	&& cd kamailio && git checkout ${COMMIT_KAMAILIO} \
78
+	&& make include_modules="${KAM_INC_MOD}" skip_modules="\$(mod_list_extra) \$(mod_list_db) ${KAM_SKIP_MOD}" cfg \
79
+	&& make install
76 80
 
... ...
@@ -1 +1,10 @@
1 1
 docker build . -t rtp_media_server
2
+
3
+VERSION="0.2"
4
+echo
5
+echo "execute these commands to update the public docker image:"
6
+echo
7
+echo "  docker tag rtp_media_server:latest jchavanton/rtp_media_server:latest"
8
+echo "  docker tag rtp_media_server:latest jchavanton/rtp_media_server:${VERSION}"
9
+echo "  docker push jchavanton/rtp_media_server:latest"
10
+echo "  docker push jchavanton/rtp_media_server:${VERSION}"
2 11
new file mode 100755
... ...
@@ -0,0 +1,11 @@
1
+#!/bin/bash
2
+
3
+if [ "$1" = "" ]; then
4
+	CMD="kamailio -m 64 -D -dd -f /etc/kamailio.cfg"
5
+else
6
+	CMD="$*"
7
+fi
8
+
9
+echo "Running ${CMD}"
10
+exec ${CMD}
11
+
... ...
@@ -6,6 +6,10 @@ docker stop ${CONTAINER}
6 6
 docker rm ${CONTAINER}
7 7
 docker run -d --net=host --name=${CONTAINER} ${IMAGE} /bin/sh -c "tail -f /dev/null"
8 8
 
9
-
10
-echo "docker exec -it rtp_media_server -c kamailio -m 64 -D -dd -f /etc/kamailio.cfg"
11
-
9
+echo ""
10
+echo "manual steps required to start Kamailio in the container:"
11
+echo " cp git/kamailio/src/modules/rtp_media_server/config_example/kamailio.cfg /etc"
12
+echo " set the listen IP in  /etc/kamailio.cfg"
13
+echo " docker exec -it rtp_media_server bash"
14
+echo " kamailio -m 64 -D -dd -f /etc/kamailio.cfg"
15
+echo ""