Skip to content

Commit f66378c

Browse files
committed
Add files to facilitate building of openSIP IMS from source
1 parent cc75e8b commit f66378c

19 files changed

Lines changed: 292 additions & 57 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ jobs:
5959
- image: docker_eupf
6060
context: eupf
6161
file: Dockerfile
62+
- image: docker_opensips
63+
context: opensips_ims_base
64+
file: Dockerfile
6265

6366
runs-on: ubuntu-latest
6467
permissions:

4g-volte-opensips-ims-deploy.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ services:
298298
default:
299299
ipv4_address: ${PYHSS_IP}
300300
icscf:
301-
image: opensips/opensips:ims-ce
301+
image: docker_opensips
302302
container_name: icscf
303303
dns: ${DNS_IP}
304304
volumes:
@@ -309,7 +309,6 @@ services:
309309
- .env
310310
environment:
311311
- COMPONENT_NAME=icscf
312-
entrypoint: /mnt/icscf/icscf_init.sh
313312
depends_on:
314313
- dns
315314
- mysql
@@ -323,7 +322,7 @@ services:
323322
default:
324323
ipv4_address: ${ICSCF_IP}
325324
scscf:
326-
image: opensips/opensips:ims-ce
325+
image: docker_opensips
327326
container_name: scscf
328327
dns: ${DNS_IP}
329328
volumes:
@@ -334,7 +333,6 @@ services:
334333
- .env
335334
environment:
336335
- COMPONENT_NAME=scscf
337-
entrypoint: /mnt/scscf/scscf_init.sh
338336
depends_on:
339337
- dns
340338
- mysql
@@ -348,7 +346,7 @@ services:
348346
default:
349347
ipv4_address: ${SCSCF_IP}
350348
pcscf:
351-
image: opensips/opensips:ims-ce
349+
image: docker_opensips
352350
container_name: pcscf
353351
dns: ${DNS_IP}
354352
privileged: true
@@ -363,7 +361,6 @@ services:
363361
environment:
364362
- COMPONENT_NAME=pcscf
365363
- DEPLOY_MODE=4G
366-
entrypoint: /mnt/pcscf/pcscf_init.sh
367364
depends_on:
368365
- dns
369366
- mysql

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Quite contrary to the name of the repository, this repository contains docker fi
1010
- srsRAN_Project (5G gNB) - https://github.com/srsran/srsRAN_Project
1111
- UERANSIM (5G gNB + 5G UE) - https://github.com/aligungr/UERANSIM
1212
- eUPF (5G UPF) - https://github.com/edgecomllc/eupf
13+
- OpenSIPS IMS - https://github.com/OpenSIPS/opensips
1314

1415
## Tested Setup
1516

@@ -69,6 +70,9 @@ docker tag ghcr.io/herlesupreeth/docker_kamailio:master docker_kamailio
6970
7071
docker pull ghcr.io/herlesupreeth/docker_mysql:master
7172
docker tag ghcr.io/herlesupreeth/docker_mysql:master docker_mysql
73+
74+
docker pull ghcr.io/herlesupreeth/docker_opensips:master
75+
docker tag ghcr.io/herlesupreeth/docker_opensips:master docker_opensips
7276
```
7377

7478
For srsRAN components:
@@ -91,8 +95,14 @@ For OAI components:
9195
docker pull ghcr.io/herlesupreeth/docker_oai_enb:master
9296
docker tag ghcr.io/herlesupreeth/docker_oai_enb:master docker_oai_enb
9397
94-
docker pull ghcr.io/herlesupreeth/docker_oai_ue:master
95-
docker tag ghcr.io/herlesupreeth/docker_oai_ue:master docker_oai_ue
98+
docker pull ghcr.io/herlesupreeth/docker_oai_gnb:master
99+
docker tag ghcr.io/herlesupreeth/docker_oai_gnb:master docker_oai_gnb
100+
```
101+
102+
For EUPF component:
103+
```
104+
docker pull ghcr.io/herlesupreeth/docker_eupf:master
105+
docker tag ghcr.io/herlesupreeth/docker_eupf:master docker_eupf
96106
```
97107

98108
### Build Docker images from source
@@ -119,6 +129,14 @@ docker build --no-cache --force-rm -t docker_srsran .
119129
# Build docker images for UERANSIM (gNB + UE)
120130
cd ../ueransim
121131
docker build --no-cache --force-rm -t docker_ueransim .
132+
133+
# Build docker images for EUPF
134+
cd ../eupf
135+
docker build --no-cache --force-rm -t docker_eupf .
136+
137+
# Build docker images for OpenSIPS IMS
138+
cd ../opensips_ims_base
139+
docker build --no-cache --force-rm -t docker_opensips .
122140
```
123141

124142
#### Build docker images for additional components

custom_deployments/open5gs_hss_cx/4g-volte-opensips-ims-deploy.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ services:
272272
default:
273273
ipv4_address: ${MYSQL_IP}
274274
icscf:
275-
image: opensips/opensips:ims-ce
275+
image: docker_opensips
276276
container_name: icscf
277277
dns: ${DNS_IP}
278278
volumes:
@@ -283,7 +283,6 @@ services:
283283
- .custom_env
284284
environment:
285285
- COMPONENT_NAME=icscf
286-
entrypoint: /mnt/icscf/icscf_init.sh
287286
depends_on:
288287
- dns
289288
- mysql
@@ -297,7 +296,7 @@ services:
297296
default:
298297
ipv4_address: ${ICSCF_IP}
299298
scscf:
300-
image: opensips/opensips:ims-ce
299+
image: docker_opensips
301300
container_name: scscf
302301
dns: ${DNS_IP}
303302
volumes:
@@ -308,7 +307,6 @@ services:
308307
- .custom_env
309308
environment:
310309
- COMPONENT_NAME=scscf
311-
entrypoint: /mnt/scscf/scscf_init.sh
312310
depends_on:
313311
- dns
314312
- mysql
@@ -322,7 +320,7 @@ services:
322320
default:
323321
ipv4_address: ${SCSCF_IP}
324322
pcscf:
325-
image: opensips/opensips:ims-ce
323+
image: docker_opensips
326324
container_name: pcscf
327325
dns: ${DNS_IP}
328326
privileged: true
@@ -337,7 +335,6 @@ services:
337335
environment:
338336
- COMPONENT_NAME=pcscf
339337
- DEPLOY_MODE=4G
340-
entrypoint: /mnt/pcscf/pcscf_init.sh
341338
depends_on:
342339
- dns
343340
- mysql

custom_deployments/open5gs_hss_cx/opensips_ims_icscf/icscf_init.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ cp /mnt/icscf/freeDiameter.conf /etc/opensips
3434
cp /mnt/icscf/icscf.dictionary /etc/opensips
3535
cp /mnt/icscf/opensips.cfg /etc/opensips
3636

37+
# For mi_fifo module.
38+
mkdir -p /var/run/opensips
39+
3740
sed -i 's|ICSCF_IP|'$ICSCF_IP'|g' /etc/opensips/freeDiameter.conf
3841
sed -i 's|HSS_IP|'$HSS_IP'|g' /etc/opensips/freeDiameter.conf
3942
sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/opensips/freeDiameter.conf
@@ -48,4 +51,4 @@ sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' /etc/opensips/opensips.cfg
4851
# Sync docker time
4952
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
5053

51-
exec /usr/sbin/opensips -F $@
54+
exec opensips -f /etc/opensips/opensips.cfg -F $@

custom_deployments/open5gs_hss_cx/opensips_ims_icscf/opensips.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ socket=tcp:ICSCF_IP:4060
4141
alias="icscf.IMS_DOMAIN"
4242

4343
#set module path
44-
mpath="/usr/lib/x86_64-linux-gnu/opensips/modules"
44+
mpath="/usr/local/opensips/modules"
4545

4646
####### Modules Section ########
4747
####### http module ######
@@ -77,7 +77,7 @@ loadmodule "sipmsgops.so"
7777

7878
#### FIFO Management Interface
7979
loadmodule "mi_fifo.so"
80-
modparam("mi_fifo", "fifo_name", "/run/opensips/opensips_fifo")
80+
modparam("mi_fifo", "fifo_name", "/var/run/opensips/opensips_fifo")
8181
modparam("mi_fifo", "fifo_mode", 0666)
8282

8383
#### USeR LOCation module

custom_deployments/open5gs_hss_cx/opensips_ims_scscf/opensips.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ socket=tcp:SCSCF_IP:6060
4242
alias="scscf.IMS_DOMAIN"
4343

4444
#set module path
45-
mpath="/usr/lib/x86_64-linux-gnu/opensips/modules"
45+
mpath="/usr/local/opensips/modules"
4646

4747
####### Modules Section ########
4848

@@ -75,7 +75,7 @@ loadmodule "sipmsgops.so"
7575

7676
#### FIFO Management Interface
7777
loadmodule "mi_fifo.so"
78-
modparam("mi_fifo", "fifo_name", "/run/opensips/opensips_fifo")
78+
modparam("mi_fifo", "fifo_name", "/var/run/opensips/opensips_fifo")
7979
modparam("mi_fifo", "fifo_mode", 0666)
8080

8181
#### USeR LOCation module
@@ -112,7 +112,7 @@ modparam("aaa_diameter", "aaa_url",
112112
"diameter:/etc/opensips/freeDiameter.conf;extra-avps-file:/etc/opensips/scscf.dictionary")
113113
loadmodule "auth_aka.so"
114114
modparam("auth_aka", "default_av_mgm", "diameter")
115-
modparam("auth_aka", "default_qop", "auth,auth-int")
115+
modparam("auth_aka", "default_qop", "auth")
116116
loadmodule "aka_av_diameter.so"
117117
modparam("aka_av_diameter", "realm",
118118
"scscf.IMS_DOMAIN")

custom_deployments/open5gs_hss_cx/opensips_ims_scscf/scscf_init.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ cp /mnt/scscf/freeDiameter.conf /etc/opensips
3434
cp /mnt/scscf/scscf.dictionary /etc/opensips
3535
cp /mnt/scscf/opensips.cfg /etc/opensips
3636

37+
# For mi_fifo module.
38+
mkdir -p /var/run/opensips
39+
3740
while ! mysqladmin ping -h ${MYSQL_IP} --silent; do
3841
sleep 5;
3942
done
@@ -73,4 +76,4 @@ sed -i 's|MYSQL_IP|'$MYSQL_IP'|g' /etc/opensips/opensips.cfg
7376
# Sync docker time
7477
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
7578

76-
exec /usr/sbin/opensips -F $@
79+
exec opensips -f /etc/opensips/opensips.cfg -F $@

opensips_ims_base/Dockerfile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# BSD 2-Clause License
2+
3+
# Copyright (c) 2020, Supreeth Herle
4+
# All rights reserved.
5+
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions are met:
8+
9+
# 1. Redistributions of source code must retain the above copyright notice, this
10+
# list of conditions and the following disclaimer.
11+
12+
# 2. Redistributions in binary form must reproduce the above copyright notice,
13+
# this list of conditions and the following disclaimer in the documentation
14+
# and/or other materials provided with the distribution.
15+
16+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
27+
FROM debian:bullseye
28+
29+
ENV DEBIAN_FRONTEND=noninteractive
30+
31+
# Install updates and dependencies
32+
RUN apt-get update && \
33+
apt-get -y install tcpdump git gcc flex bison make pkg-config iproute2 net-tools iputils-ping \
34+
libssl-dev libcurl4-openssl-dev libxml2-dev libpcre2-dev bash-completion g++ autoconf \
35+
libmnl-dev libsctp-dev libradcli-dev libradcli4 libjson-c-dev libevent-dev libnghttp2-dev uuid-dev \
36+
libfreediameter-dev default-libmysqlclient-dev libpcre3-dev libmicrohttpd-dev librabbitmq-dev \
37+
libncurses-dev mariadb-client
38+
39+
# Fetch OpenSIPS code
40+
RUN mkdir -p /usr/local && cd /usr/local && \
41+
git clone https://github.com/OpenSIPS/opensips && \
42+
cd opensips && git checkout tags/3.5.5
43+
44+
# Build and Install OpenSIPS
45+
COPY Makefile.conf /usr/local/opensips
46+
RUN cd /usr/local/opensips && \
47+
make -j`nproc` all | tee make_all.txt && \
48+
make install | tee make_install.txt && \
49+
ldconfig
50+
51+
COPY opensips_init.sh /
52+
CMD ["/opensips_init.sh"]

0 commit comments

Comments
 (0)