Compare commits
59 Commits
roaming
...
improve_5g
Author | SHA1 | Date | |
---|---|---|---|
|
3abc33afc0 | ||
|
a76f765e5f | ||
|
39446c0f18 | ||
|
c3c907f555 | ||
|
d779b57644 | ||
|
e73e1c32af | ||
|
eb5c8fc687 | ||
|
9d36c45e9d | ||
|
1f8a419635 | ||
|
9560e618b4 | ||
|
6b6cd6f95a | ||
|
12c29605d4 | ||
|
1644fc8554 | ||
|
68c44433c1 | ||
|
b4c9492b39 | ||
|
726dc91b7a | ||
|
36b0191cbe | ||
|
3915449019 | ||
|
ac0252d636 | ||
|
e29d02828d | ||
|
c693732158 | ||
|
2379624b2c | ||
|
6abee093a6 | ||
|
c361c21a03 | ||
|
8991a2e3b2 | ||
|
b11e54131b | ||
|
75617b97c0 | ||
|
bf83a12165 | ||
|
019496f103 | ||
|
3cc94c912d | ||
|
3b2c22dfab | ||
|
f1d55deef0 | ||
|
14911cc6a2 | ||
|
3f4b520acb | ||
|
5c2a2f58af | ||
|
beabeba8a2 | ||
|
086e9dad0a | ||
|
c52d122b6c | ||
|
185ca532eb | ||
|
a6a2cd1ff6 | ||
|
8b2f5c9211 | ||
|
f69523b979 | ||
|
d9c0e3de95 | ||
|
f338aa9efd | ||
|
9c034db839 | ||
|
b1a9901d62 | ||
|
b538301889 | ||
|
d531b57103 | ||
|
ace3e84140 | ||
|
f14980261a | ||
|
f12c344441 | ||
|
6c61015fd5 | ||
|
df1aa8c340 | ||
|
fc51a8819b | ||
|
b14eecb991 | ||
|
0c93f2b083 | ||
|
59b71296ed | ||
|
3e95630201 | ||
|
bf1132f129 |
6
.env
6
.env
@@ -127,8 +127,14 @@ METRICS_IP=172.22.0.36
|
||||
# SRSRAN GNB
|
||||
SRS_GNB_IP=172.22.0.37
|
||||
|
||||
# GRAFANA
|
||||
GRAFANA_IP=172.22.0.39
|
||||
|
||||
# UE IPv4 Subnet Range for APN=internet
|
||||
UE_IPV4_INTERNET=192.168.100.0/24
|
||||
|
||||
# UE IPv4 Subnet Range for APN=ims
|
||||
UE_IPV4_IMS=192.168.101.0/24
|
||||
|
||||
# Maximum Number of UEs
|
||||
MAX_NUM_UE=1024
|
||||
|
@@ -31,9 +31,9 @@ services:
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
expose:
|
||||
- "3000/tcp"
|
||||
- "9999/tcp"
|
||||
ports:
|
||||
- "3000:3000/tcp"
|
||||
- "9999:9999/tcp"
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${WEBUI_IP}
|
||||
@@ -319,11 +319,33 @@ services:
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${METRICS_IP}
|
||||
grafana:
|
||||
build: ./grafana
|
||||
image: docker_grafana
|
||||
container_name: grafana
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- ./grafana:/mnt/grafana
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
expose:
|
||||
- "3000/tcp"
|
||||
ports:
|
||||
- "3000:3000/tcp"
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${GRAFANA_IP}
|
||||
networks:
|
||||
default:
|
||||
name: docker_open5gs_default
|
||||
ipam:
|
||||
config:
|
||||
- subnet: ${TEST_NETWORK}
|
||||
volumes:
|
||||
mongodbdata: {}
|
||||
dbdata: {}
|
||||
grafana_data:
|
||||
name: grafana_data
|
||||
mongodbdata:
|
||||
name: docker_open5gs_mongodbdata
|
||||
dbdata:
|
||||
name: docker_open5gs_dbdata
|
||||
|
@@ -31,9 +31,9 @@ services:
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
expose:
|
||||
- "3000/tcp"
|
||||
- "9999/tcp"
|
||||
ports:
|
||||
- "3000:3000/tcp"
|
||||
- "9999:9999/tcp"
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${WEBUI_IP}
|
||||
@@ -455,11 +455,33 @@ services:
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${METRICS_IP}
|
||||
grafana:
|
||||
build: ./grafana
|
||||
image: docker_grafana
|
||||
container_name: grafana
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- ./grafana:/mnt/grafana
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
expose:
|
||||
- "3000/tcp"
|
||||
ports:
|
||||
- "3000:3000/tcp"
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${GRAFANA_IP}
|
||||
networks:
|
||||
default:
|
||||
name: docker_open5gs_default
|
||||
ipam:
|
||||
config:
|
||||
- subnet: ${TEST_NETWORK}
|
||||
volumes:
|
||||
mongodbdata: {}
|
||||
dbdata: {}
|
||||
grafana_data:
|
||||
name: grafana_data
|
||||
mongodbdata:
|
||||
name: docker_open5gs_mongodbdata
|
||||
dbdata:
|
||||
name: docker_open5gs_dbdata
|
||||
|
12
README.md
12
README.md
@@ -63,6 +63,7 @@ docker build --no-cache --force-rm -t docker_ueransim .
|
||||
cd ..
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
sudo ufw disable
|
||||
sudo sysctl -w net.ipv4.ip_forward=1
|
||||
sudo cpupower frequency-set -g performance
|
||||
@@ -250,7 +251,7 @@ docker compose -f nr-ue.yaml up -d && docker container attach nr_ue
|
||||
|
||||
### Provisioning of SIM information in open5gs HSS as follows:
|
||||
|
||||
Open (http://<DOCKER_HOST_IP>:3000) in a web browser, where <DOCKER_HOST_IP> is the IP of the machine/VM running the open5gs containers. Login with following credentials
|
||||
Open (http://<DOCKER_HOST_IP>:9999) in a web browser, where <DOCKER_HOST_IP> is the IP of the machine/VM running the open5gs containers. Login with following credentials
|
||||
```
|
||||
Username : admin
|
||||
Password : 1423
|
||||
@@ -258,6 +259,13 @@ Password : 1423
|
||||
|
||||
Using Web UI, add a subscriber
|
||||
|
||||
#### or using cli
|
||||
|
||||
```
|
||||
sudo docker exec -it hss misc/db/open5gs-dbctl add 001010123456790 8baf473f2f8fd09487cccbd7097c6862 8E27B6AF0E692E750F32667A3B14605D
|
||||
```
|
||||
|
||||
|
||||
### Provisioning of IMSI and MSISDN with OsmoHLR as follows:
|
||||
|
||||
1. First, login to the osmohlr container
|
||||
@@ -338,7 +346,7 @@ Take note of **auc_id** specified in **Response body** under **Server response**
|
||||
"enabled": true,
|
||||
"auc_id": 1,
|
||||
"default_apn": 1,
|
||||
"apn_list": "0,1",
|
||||
"apn_list": "1,2",
|
||||
"msisdn": "9076543210",
|
||||
"ue_ambr_dl": 0,
|
||||
"ue_ambr_ul": 0
|
||||
|
43
amf/amf.yaml
43
amf/amf.yaml
@@ -1,5 +1,6 @@
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/amf.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/amf.log
|
||||
|
||||
sbi:
|
||||
server:
|
||||
@@ -7,14 +8,23 @@ sbi:
|
||||
client:
|
||||
no_tls: true
|
||||
|
||||
parameter:
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
amf:
|
||||
sbi:
|
||||
- addr: AMF_IP
|
||||
port: 7777
|
||||
server:
|
||||
- address: AMF_IP
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://NRF_IP:7777
|
||||
scp:
|
||||
- uri: http://SCP_IP:7777
|
||||
ngap:
|
||||
- addr: AMF_IP
|
||||
server:
|
||||
- address: AMF_IP
|
||||
guami:
|
||||
- plmn_id:
|
||||
mcc: MCC
|
||||
@@ -40,21 +50,10 @@ amf:
|
||||
full: Open5GS
|
||||
amf_name: open5gs-amf0
|
||||
metrics:
|
||||
- addr: AMF_IP
|
||||
port: 9091
|
||||
server:
|
||||
- address: AMF_IP
|
||||
port: 9091
|
||||
time:
|
||||
t3512:
|
||||
value: 540
|
||||
|
||||
scp:
|
||||
sbi:
|
||||
- addr:
|
||||
- SCP_IP
|
||||
port: 7777
|
||||
|
||||
nrf:
|
||||
sbi:
|
||||
- addr:
|
||||
- NRF_IP
|
||||
port: 7777
|
||||
|
||||
time:
|
||||
t3512:
|
||||
value: 540
|
||||
|
@@ -32,6 +32,7 @@ sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/amf.yaml
|
||||
sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/amf.yaml
|
||||
sed -i 's|MNC|'$MNC'|g' install/etc/open5gs/amf.yaml
|
||||
sed -i 's|MCC|'$MCC'|g' install/etc/open5gs/amf.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/amf.yaml
|
||||
|
||||
# Sync docker time
|
||||
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
@@ -1,5 +1,6 @@
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/ausf.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/ausf.log
|
||||
|
||||
sbi:
|
||||
server:
|
||||
@@ -7,21 +8,17 @@ sbi:
|
||||
client:
|
||||
no_tls: true
|
||||
|
||||
parameter:
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
ausf:
|
||||
sbi:
|
||||
- addr: AUSF_IP
|
||||
port: 7777
|
||||
|
||||
scp:
|
||||
sbi:
|
||||
- addr:
|
||||
- SCP_IP
|
||||
port: 7777
|
||||
|
||||
nrf:
|
||||
sbi:
|
||||
- addr:
|
||||
- NRF_IP
|
||||
port: 7777
|
||||
server:
|
||||
- address: AUSF_IP
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://NRF_IP:7777
|
||||
scp:
|
||||
- uri: http://SCP_IP:7777
|
||||
|
@@ -30,6 +30,7 @@ cp /mnt/ausf/ausf.yaml install/etc/open5gs
|
||||
sed -i 's|AUSF_IP|'$AUSF_IP'|g' install/etc/open5gs/ausf.yaml
|
||||
sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/ausf.yaml
|
||||
sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/ausf.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/ausf.yaml
|
||||
|
||||
# Sync docker time
|
||||
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
@@ -68,7 +68,7 @@ RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg -
|
||||
|
||||
# Get open5gs code and install
|
||||
RUN git clone --recursive https://github.com/open5gs/open5gs && cd open5gs && \
|
||||
git checkout tags/v2.6.6 && meson build --prefix=`pwd`/install && \
|
||||
git checkout 04ec945e1d334ca5917705a885eff80ad30e1e38 && meson build --prefix=`pwd`/install && \
|
||||
ninja -C build && cd build && ninja install && \
|
||||
mkdir -p /open5gs/install/include
|
||||
|
||||
@@ -102,6 +102,7 @@ RUN apt-get update && \
|
||||
python3-pip \
|
||||
iptables \
|
||||
iperf \
|
||||
mongodb-clients \
|
||||
gnupg && \
|
||||
apt-get autoremove -y && apt-get autoclean
|
||||
|
||||
@@ -120,6 +121,7 @@ COPY --from=builder /open5gs/install/etc /open5gs/install/etc
|
||||
COPY --from=builder /open5gs/install/include /open5gs/install/include
|
||||
COPY --from=builder /open5gs/install/lib /open5gs/install/lib
|
||||
COPY --from=builder /open5gs/webui /open5gs/webui
|
||||
COPY --from=builder /open5gs/misc/db /open5gs/misc/db
|
||||
|
||||
# Set the working directory to open5gs
|
||||
WORKDIR open5gs
|
||||
|
29
bsf/bsf.yaml
29
bsf/bsf.yaml
@@ -1,7 +1,8 @@
|
||||
db_uri: mongodb://MONGO_IP/open5gs
|
||||
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/bsf.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/bsf.log
|
||||
|
||||
sbi:
|
||||
server:
|
||||
@@ -9,21 +10,17 @@ sbi:
|
||||
client:
|
||||
no_tls: true
|
||||
|
||||
parameter:
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
bsf:
|
||||
sbi:
|
||||
- addr: BSF_IP
|
||||
port: 7777
|
||||
|
||||
scp:
|
||||
sbi:
|
||||
- addr:
|
||||
- SCP_IP
|
||||
port: 7777
|
||||
|
||||
nrf:
|
||||
sbi:
|
||||
- addr:
|
||||
- NRF_IP
|
||||
port: 7777
|
||||
server:
|
||||
- address: BSF_IP
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://NRF_IP:7777
|
||||
scp:
|
||||
- uri: http://SCP_IP:7777
|
||||
|
@@ -33,6 +33,7 @@ sed -i 's|BSF_IP|'$BSF_IP'|g' install/etc/open5gs/bsf.yaml
|
||||
sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/bsf.yaml
|
||||
sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/bsf.yaml
|
||||
sed -i 's|MONGO_IP|'$MONGO_IP'|g' install/etc/open5gs/bsf.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/bsf.yaml
|
||||
|
||||
# Sync docker time
|
||||
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
@@ -31,9 +31,9 @@ services:
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
expose:
|
||||
- "3000/tcp"
|
||||
- "9999/tcp"
|
||||
ports:
|
||||
- "3000:3000/tcp"
|
||||
- "9999:9999/tcp"
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${WEBUI_IP}
|
||||
@@ -663,11 +663,34 @@ services:
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${METRICS_IP}
|
||||
grafana:
|
||||
build: ./grafana
|
||||
image: docker_grafana
|
||||
container_name: grafana
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- ./grafana:/mnt/grafana
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
expose:
|
||||
- "3000/tcp"
|
||||
ports:
|
||||
- "3000:3000/tcp"
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${GRAFANA_IP}
|
||||
networks:
|
||||
default:
|
||||
name: docker_open5gs_default
|
||||
ipam:
|
||||
config:
|
||||
- subnet: ${TEST_NETWORK}
|
||||
volumes:
|
||||
mongodbdata: {}
|
||||
dbdata: {}
|
||||
grafana_data:
|
||||
name: grafana_data
|
||||
mongodbdata:
|
||||
name: docker_open5gs_mongodbdata
|
||||
dbdata:
|
||||
name: docker_open5gs_dbdata
|
||||
|
||||
|
39
grafana/Dockerfile
Normal file
39
grafana/Dockerfile
Normal file
@@ -0,0 +1,39 @@
|
||||
# BSD 2-Clause License
|
||||
|
||||
# Copyright (c) 2020, Supreeth Herle
|
||||
# All rights reserved.
|
||||
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this
|
||||
# list of conditions and the following disclaimer.
|
||||
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions and the following disclaimer in the documentation
|
||||
# and/or other materials provided with the distribution.
|
||||
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
FROM ubuntu:jammy
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends apt-transport-https software-properties-common wget && \
|
||||
mkdir -p /etc/apt/keyrings/ && \
|
||||
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | tee /etc/apt/keyrings/grafana.gpg && \
|
||||
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | tee -a /etc/apt/sources.list.d/grafana.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends grafana
|
||||
|
||||
CMD /mnt/grafana/grafana_init.sh
|
43
grafana/grafana_init.sh
Executable file
43
grafana/grafana_init.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
# BSD 2-Clause License
|
||||
|
||||
# Copyright (c) 2020, Supreeth Herle
|
||||
# All rights reserved.
|
||||
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this
|
||||
# list of conditions and the following disclaimer.
|
||||
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions and the following disclaimer in the documentation
|
||||
# and/or other materials provided with the distribution.
|
||||
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# Sync docker time
|
||||
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
export GRAFANA_WORK_DIR=/usr/share/grafana
|
||||
|
||||
cd $GRAFANA_WORK_DIR
|
||||
|
||||
cp /mnt/grafana/prometheus_open5gs.yml ./conf/provisioning/datasources
|
||||
cp /mnt/grafana/open5gs_dashboard.yml ./conf/provisioning/dashboards
|
||||
mkdir -p /var/lib/grafana/dashboards
|
||||
cp /mnt/grafana/open5gs_dashboard.json /var/lib/grafana/dashboards
|
||||
|
||||
sed -i 's|METRICS_IP|'$METRICS_IP'|g' ./conf/provisioning/datasources/prometheus_open5gs.yml
|
||||
|
||||
./bin/grafana server -homepath $GRAFANA_WORK_DIR
|
452
grafana/open5gs_dashboard.json
Normal file
452
grafana/open5gs_dashboard.json
Normal file
@@ -0,0 +1,452 @@
|
||||
{
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "-- Grafana --"
|
||||
},
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"editable": true,
|
||||
"fiscalYearStartMonth": 0,
|
||||
"graphTooltip": 0,
|
||||
"links": [],
|
||||
"panels": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "PA240B69645956401"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"id": 5,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "PA240B69645956401"
|
||||
},
|
||||
"disableTextWrap": false,
|
||||
"editorMode": "builder",
|
||||
"expr": "fivegs_ep_n3_gtp_indatapktn3upf",
|
||||
"fullMetaSearch": false,
|
||||
"includeNullMetadata": true,
|
||||
"instant": false,
|
||||
"legendFormat": "__auto",
|
||||
"range": true,
|
||||
"refId": "A",
|
||||
"useBackend": false
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "PA240B69645956401"
|
||||
},
|
||||
"disableTextWrap": false,
|
||||
"editorMode": "builder",
|
||||
"expr": "fivegs_ep_n3_gtp_outdatapktn3upf",
|
||||
"fullMetaSearch": false,
|
||||
"hide": false,
|
||||
"includeNullMetadata": true,
|
||||
"instant": false,
|
||||
"legendFormat": "__auto",
|
||||
"range": true,
|
||||
"refId": "B",
|
||||
"useBackend": false
|
||||
}
|
||||
],
|
||||
"title": "UPF - GTP Packets",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "PA240B69645956401"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 0
|
||||
},
|
||||
"id": 4,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "PA240B69645956401"
|
||||
},
|
||||
"disableTextWrap": false,
|
||||
"editorMode": "builder",
|
||||
"expr": "fivegs_upffunction_upf_sessionnbr",
|
||||
"fullMetaSearch": false,
|
||||
"includeNullMetadata": true,
|
||||
"instant": false,
|
||||
"legendFormat": "__auto",
|
||||
"range": true,
|
||||
"refId": "A",
|
||||
"useBackend": false
|
||||
}
|
||||
],
|
||||
"title": "UPF - Active Sessions",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "PA240B69645956401"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 8
|
||||
},
|
||||
"id": 3,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "PA240B69645956401"
|
||||
},
|
||||
"disableTextWrap": false,
|
||||
"editorMode": "builder",
|
||||
"expr": "enb",
|
||||
"fullMetaSearch": false,
|
||||
"includeNullMetadata": true,
|
||||
"instant": false,
|
||||
"legendFormat": "__auto",
|
||||
"range": true,
|
||||
"refId": "A",
|
||||
"useBackend": false
|
||||
}
|
||||
],
|
||||
"title": "MME - eNBs",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "PA240B69645956401"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 8
|
||||
},
|
||||
"id": 2,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "PA240B69645956401"
|
||||
},
|
||||
"disableTextWrap": false,
|
||||
"editorMode": "builder",
|
||||
"expr": "enb_ue",
|
||||
"fullMetaSearch": false,
|
||||
"includeNullMetadata": true,
|
||||
"instant": false,
|
||||
"legendFormat": "__auto",
|
||||
"range": true,
|
||||
"refId": "A",
|
||||
"useBackend": false
|
||||
}
|
||||
],
|
||||
"title": "MME - Sessions",
|
||||
"type": "timeseries"
|
||||
}
|
||||
],
|
||||
"schemaVersion": 39,
|
||||
"tags": [],
|
||||
"templating": {
|
||||
"list": []
|
||||
},
|
||||
"time": {
|
||||
"from": "now-6h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {},
|
||||
"timezone": "browser",
|
||||
"title": "Open5Gs",
|
||||
"uid": "fdg9t0npkjj7ka",
|
||||
"version": 1,
|
||||
"weekStart": ""
|
||||
}
|
8
grafana/open5gs_dashboard.yml
Normal file
8
grafana/open5gs_dashboard.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
apiVersion: 1
|
||||
|
||||
providers:
|
||||
- name: Open5Gs # A uniquely identifiable name for the provider
|
||||
folder: Services # The folder where to place the dashboards
|
||||
type: file
|
||||
options:
|
||||
path: /var/lib/grafana/dashboards
|
6
grafana/prometheus_open5gs.yml
Normal file
6
grafana/prometheus_open5gs.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: Open5Gs
|
||||
type: prometheus
|
||||
url: http://METRICS_IP:9090
|
@@ -173,7 +173,7 @@ TLS_CA = "/open5gs/install/etc/freeDiameter/cacert.pem";
|
||||
# algorithms. In addition the "0xffffff" application is advertised in CER/CEA
|
||||
# exchanges.
|
||||
# Default: Relaying is enabled.
|
||||
#NoRelay;
|
||||
NoRelay;
|
||||
|
||||
# Number of server threads that can handle incoming messages at the same time.
|
||||
# Default: 4
|
||||
|
@@ -1,9 +1,12 @@
|
||||
db_uri: mongodb://MONGO_IP/open5gs
|
||||
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/hss.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/hss.log
|
||||
|
||||
parameter:
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
hss:
|
||||
freeDiameter: /open5gs/install/etc/freeDiameter/hss.conf
|
||||
|
@@ -32,6 +32,9 @@ export IP_ADDR=$(awk 'END{print $1}' /etc/hosts)
|
||||
|
||||
[ ${#MNC} == 3 ] && EPC_DOMAIN="epc.mnc${MNC}.mcc${MCC}.3gppnetwork.org" || EPC_DOMAIN="epc.mnc0${MNC}.mcc${MCC}.3gppnetwork.org"
|
||||
|
||||
ln -s /usr/bin/mongo /usr/bin/mongosh
|
||||
sed -i "s|localhost|$MONGO_IP|" /open5gs/misc/db/open5gs-dbctl
|
||||
|
||||
cp /mnt/hss/hss.yaml install/etc/open5gs
|
||||
cp /mnt/hss/hss.conf install/etc/freeDiameter
|
||||
cp /mnt/hss/make_certs.sh install/etc/freeDiameter
|
||||
@@ -42,6 +45,7 @@ sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' install/etc/freeDiameter/hss.conf
|
||||
sed -i 's|LD_LIBRARY_PATH|'$LD_LIBRARY_PATH'|g' install/etc/freeDiameter/hss.conf
|
||||
sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' install/etc/freeDiameter/make_certs.sh
|
||||
sed -i 's|MONGO_IP|'$MONGO_IP'|g' install/etc/open5gs/hss.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/hss.yaml
|
||||
|
||||
# Generate TLS certificates
|
||||
./install/etc/freeDiameter/make_certs.sh install/etc/freeDiameter
|
||||
|
@@ -14,6 +14,9 @@ alias=IMS_DOMAIN
|
||||
|
||||
#!define ENUM_SUFFIX "IMS_DOMAIN."
|
||||
|
||||
# Maximum lifetime of a subscription in seconds (same is advertised to UE)
|
||||
#!substdef "/UE_SUBSCRIPTION_EXPIRES/SUBSCRIPTION_EXPIRES_ENV/g"
|
||||
|
||||
# SIP-Address of capturing node, if not set, capturing is disabled.
|
||||
##!define CAPTURE_NODE "sip:127.0.0.1:9060"
|
||||
|
||||
|
@@ -11,8 +11,8 @@
|
||||
QueueLength="32"
|
||||
TransactionTimeout="5"
|
||||
SessionsHashSize="128"
|
||||
DefaultAuthSessionTimeout="3600"
|
||||
MaxAuthSessionTimeout="3600"
|
||||
DefaultAuthSessionTimeout="SUBSCRIPTION_EXPIRES_ENV"
|
||||
MaxAuthSessionTimeout="SUBSCRIPTION_EXPIRES_ENV"
|
||||
>
|
||||
|
||||
<Peer FQDN="hss.IMS_DOMAIN" Realm="IMS_DOMAIN" port="PYHSS_BIND_PORT"/>
|
||||
|
@@ -80,11 +80,15 @@ then
|
||||
mysql -u root -h ${MYSQL_IP} icscf -e "INSERT INTO s_cscf_capabilities (id_s_cscf, capability) VALUES ('$SCSCF_ID', 0),('$SCSCF_ID', 1);"
|
||||
fi
|
||||
|
||||
SUBSCRIPTION_EXPIRES_ENV=3600
|
||||
|
||||
sed -i 's|ICSCF_IP|'$ICSCF_IP'|g' /etc/kamailio_icscf/icscf.cfg
|
||||
sed -i 's|SUBSCRIPTION_EXPIRES_ENV|'$SUBSCRIPTION_EXPIRES_ENV'|g' /etc/kamailio_icscf/icscf.cfg
|
||||
sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/kamailio_icscf/icscf.cfg
|
||||
sed -i 's|MYSQL_IP|'$MYSQL_IP'|g' /etc/kamailio_icscf/icscf.cfg
|
||||
|
||||
sed -i 's|ICSCF_IP|'$ICSCF_IP'|g' /etc/kamailio_icscf/icscf.xml
|
||||
sed -i 's|SUBSCRIPTION_EXPIRES_ENV|'$SUBSCRIPTION_EXPIRES_ENV'|g' /etc/kamailio_icscf/icscf.xml
|
||||
sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/kamailio_icscf/icscf.xml
|
||||
sed -i 's|PYHSS_BIND_PORT|'$PYHSS_BIND_PORT'|g' /etc/kamailio_icscf/icscf.xml
|
||||
sed -i 's|ICSCF_BIND_PORT|'$ICSCF_BIND_PORT'|g' /etc/kamailio_icscf/icscf.xml
|
||||
|
@@ -69,7 +69,7 @@ dns_try_naptr=no
|
||||
#!ifdef WITH_TCP
|
||||
# life time of TCP connection when there is no traffic
|
||||
# - a bit higher than registration expires to cope with UA behind NAT
|
||||
tcp_connection_lifetime=3615
|
||||
tcp_connection_lifetime=UE_SUBSCRIPTION_EXPIRES
|
||||
#!ifdef TCP_PROCESSES
|
||||
tcp_children=TCP_PROCESSES
|
||||
#!endif
|
||||
|
@@ -32,14 +32,14 @@ ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update && \
|
||||
apt-get -y install mysql-server tcpdump screen tmux ntp ntpdate git-core dkms \
|
||||
gcc flex bison libmysqlclient-dev make libssl-dev libcurl4-openssl-dev \
|
||||
libxml2-dev libpcre3-dev bash-completion g++ autoconf libmnl-dev \
|
||||
libxml2-dev libpcre2-dev bash-completion g++ autoconf libmnl-dev \
|
||||
libsctp-dev libradcli-dev libradcli4 libjson-c-dev pkg-config iproute2 net-tools \
|
||||
iputils-ping
|
||||
iputils-ping libgcrypt20-dev libjansson-dev libevent-dev libnghttp2-dev uuid-dev
|
||||
|
||||
# Fetch Kamailio code (branch 5.3)
|
||||
# Fetch Kamailio code
|
||||
RUN mkdir -p /usr/local/src/ && cd /usr/local/src/ && \
|
||||
git clone https://github.com/herlesupreeth/kamailio && \
|
||||
cd kamailio && git checkout 5.3
|
||||
cd kamailio && git checkout fix_notify_on_re_subscribe2
|
||||
|
||||
# Build and Install Kamailio
|
||||
RUN cd /usr/local/src/kamailio && make cfg
|
||||
@@ -50,4 +50,4 @@ RUN cd /usr/local/src/kamailio && \
|
||||
ldconfig
|
||||
|
||||
COPY kamailio_init.sh /
|
||||
CMD /kamailio_init.sh
|
||||
CMD ["/kamailio_init.sh"]
|
||||
|
@@ -7,16 +7,16 @@ modules_dirs:=modules
|
||||
cfg_group_include=
|
||||
|
||||
# the list of extra modules to compile
|
||||
include_modules= cdp cdp_avp db_mysql dialplan enum json http_client ims_auth ims_charging ims_dialog ims_diameter_server ims_icscf ims_ipsec_pcscf ims_isc ims_ocs ims_qos ims_registrar_pcscf ims_registrar_scscf ims_usrloc_pcscf ims_usrloc_scscf outbound presence presence_conference presence_dialoginfo presence_mwi presence_profile presence_reginfo presence_xml pua pua_bla pua_dialoginfo pua_reginfo pua_rpc pua_usrloc pua_xmpp sctp tls utils xcap_client xcap_server xmlops xmlrpc
|
||||
include_modules= cdp cdp_avp db_mysql dialplan enum http_async_client http_client ims_auth ims_charging ims_dialog ims_diameter_server ims_icscf ims_ipsec_pcscf ims_isc ims_ocs ims_qos ims_registrar_pcscf ims_registrar_scscf ims_usrloc_pcscf ims_usrloc_scscf jansson json nghttp2 outbound presence presence_conference presence_dialoginfo presence_mwi presence_profile presence_reginfo presence_xml pua pua_bla pua_dialoginfo pua_reginfo pua_rpc pua_usrloc pua_xmpp sctp tls utils uuid xcap_client xcap_server xmlops xmlrpc
|
||||
|
||||
# the list of static modules
|
||||
static_modules=
|
||||
static_modules=
|
||||
|
||||
# the list of modules to skip from compile list
|
||||
skip_modules=
|
||||
skip_modules=
|
||||
|
||||
# the list of modules to exclude from compile list
|
||||
exclude_modules= acc_json acc_radius app_java app_lua app_lua_sr app_mono app_perl app_python app_python3 app_ruby auth_ephemeral auth_identity auth_radius cnxcc cplc crypto db2_ldap db_berkeley db_cassandra db_mongodb db_oracle db_perlvdb db_postgres db_redis db_sqlite db_unixodbc dnssec erlang evapi geoip geoip2 gzcompress h350 http_async_client jansson janssonrpcc jsonrpcc jwt kafka kazoo lcr ldap log_systemd lost lwsc memcached misc_radius ndb_cassandra mqtt ndb_mongodb ndb_redis nsq osp peering phonenum pua_json rabbitmq regex rls rtp_media_server secsipid secsipid_proc snmpstats stirshaken systemdops topos_redis uuid websocket xhttp_pi xmpp $(skip_modules)
|
||||
exclude_modules= malloc_test app_sqlang acc_json acc_radius app_java app_lua app_lua_sr app_mono app_perl app_python app_python3 app_python3s app_ruby app_ruby_proc auth_ephemeral auth_identity auth_radius cnxcc cplc crypto db2_ldap db_berkeley db_cassandra db_mongodb db_oracle db_perlvdb db_postgres db_redis db_sqlite db_unixodbc dnssec erlang evapi geoip geoip2 gzcompress h350 ims_qos_npn janssonrpcc jsonrpcc jwt kafka kazoo lcr ldap log_systemd lost lwsc memcached microhttpd misc_radius mqtt msrp nats ndb_cassandra ndb_mongodb ndb_redis nsq osp peering phonenum presence_dfks print rabbitmq regex rls rtp_media_server ruxc secsipid secsipid_proc slack snmpstats stirshaken systemdops tls_wolfssl tlsa topos_redis websocket xhttp_pi xmpp $(skip_modules)
|
||||
|
||||
modules_all= $(filter-out modules/CVS,$(wildcard modules/*))
|
||||
modules_noinc= $(filter-out $(addprefix modules/, $(exclude_modules) $(static_modules)), $(modules_all))
|
||||
|
@@ -174,7 +174,7 @@ TLS_CA = "/open5gs/install/etc/freeDiameter/cacert.pem";
|
||||
# algorithms. In addition the "0xffffff" application is advertised in CER/CEA
|
||||
# exchanges.
|
||||
# Default: Relaying is enabled.
|
||||
#NoRelay;
|
||||
NoRelay;
|
||||
|
||||
# Number of server threads that can handle incoming messages at the same time.
|
||||
# Default: 4
|
||||
|
82
mme/mme.yaml
82
mme/mme.yaml
@@ -1,38 +1,49 @@
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/mme.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/mme.log
|
||||
|
||||
parameter:
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
mme:
|
||||
freeDiameter: /open5gs/install/etc/freeDiameter/mme.conf
|
||||
s1ap:
|
||||
dev: MME_IF
|
||||
server:
|
||||
- dev: MME_IF
|
||||
gtpc:
|
||||
dev: MME_IF
|
||||
server:
|
||||
- dev: MME_IF
|
||||
client:
|
||||
sgwc:
|
||||
- address: SGWC_IP
|
||||
smf:
|
||||
- address: SMF_IP
|
||||
sgsap:
|
||||
addr: OSMOMSC_IP
|
||||
map:
|
||||
tai:
|
||||
plmn_id:
|
||||
mcc: MCC
|
||||
mnc: MNC
|
||||
tac: 1
|
||||
lai:
|
||||
plmn_id:
|
||||
mcc: MCC
|
||||
mnc: MNC
|
||||
lac: 1
|
||||
server:
|
||||
- address: OSMOMSC_IP
|
||||
map:
|
||||
tai:
|
||||
plmn_id:
|
||||
mcc: MCC
|
||||
mnc: MNC
|
||||
tac: 1
|
||||
lai:
|
||||
plmn_id:
|
||||
mcc: MCC
|
||||
mnc: MNC
|
||||
lac: 1
|
||||
gummei:
|
||||
plmn_id:
|
||||
mcc: MCC
|
||||
mnc: MNC
|
||||
mme_gid: 2
|
||||
mme_code: 1
|
||||
- plmn_id:
|
||||
mcc: MCC
|
||||
mnc: MNC
|
||||
mme_gid: 2
|
||||
mme_code: 1
|
||||
tai:
|
||||
plmn_id:
|
||||
mcc: MCC
|
||||
mnc: MNC
|
||||
tac: 1
|
||||
- plmn_id:
|
||||
mcc: MCC
|
||||
mnc: MNC
|
||||
tac: 1
|
||||
security:
|
||||
integrity_order : [ EIA2, EIA1, EIA0 ]
|
||||
ciphering_order : [ EEA0, EEA1, EEA2 ]
|
||||
@@ -40,18 +51,9 @@ mme:
|
||||
full: Open5GS
|
||||
mme_name: open5gs-mme0
|
||||
metrics:
|
||||
- addr: MME_IP
|
||||
port: 9091
|
||||
|
||||
sgwc:
|
||||
gtpc:
|
||||
addr: SGWC_IP
|
||||
|
||||
smf:
|
||||
gtpc:
|
||||
- addr:
|
||||
- SMF_IP
|
||||
|
||||
time:
|
||||
t3412:
|
||||
value: 540
|
||||
server:
|
||||
- address: MME_IP
|
||||
port: 9091
|
||||
time:
|
||||
t3412:
|
||||
value: 540
|
||||
|
@@ -42,6 +42,7 @@ sed -i 's|MME_IF|'$IF_NAME'|g' install/etc/open5gs/mme.yaml
|
||||
sed -i 's|OSMOMSC_IP|'$OSMOMSC_IP'|g' install/etc/open5gs/mme.yaml
|
||||
sed -i 's|SGWC_IP|'$SGWC_IP'|g' install/etc/open5gs/mme.yaml
|
||||
sed -i 's|SMF_IP|'$SMF_IP'|g' install/etc/open5gs/mme.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/mme.yaml
|
||||
sed -i 's|MME_IP|'$MME_IP'|g' install/etc/freeDiameter/mme.conf
|
||||
sed -i 's|HSS_IP|'$HSS_IP'|g' install/etc/freeDiameter/mme.conf
|
||||
sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' install/etc/freeDiameter/mme.conf
|
||||
|
23
nrf/nrf.yaml
23
nrf/nrf.yaml
@@ -1,5 +1,6 @@
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/nrf.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/nrf.log
|
||||
|
||||
sbi:
|
||||
server:
|
||||
@@ -7,16 +8,16 @@ sbi:
|
||||
client:
|
||||
no_tls: true
|
||||
|
||||
parameter:
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
nrf:
|
||||
serving: # 5G roaming requires PLMN in NRF
|
||||
- plmn_id:
|
||||
mcc: MCC
|
||||
mnc: MNC
|
||||
sbi:
|
||||
addr:
|
||||
- NRF_IP
|
||||
port: 7777
|
||||
|
||||
scp:
|
||||
sbi:
|
||||
addr:
|
||||
- SCP_IP
|
||||
port: 7777
|
||||
server:
|
||||
- address: NRF_IP
|
||||
port: 7777
|
||||
|
@@ -29,6 +29,9 @@
|
||||
cp /mnt/nrf/nrf.yaml install/etc/open5gs
|
||||
sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/nrf.yaml
|
||||
sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/nrf.yaml
|
||||
sed -i 's|MCC|'$MCC'|g' install/etc/open5gs/nrf.yaml
|
||||
sed -i 's|MNC|'$MNC'|g' install/etc/open5gs/nrf.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/nrf.yaml
|
||||
|
||||
# Sync docker time
|
||||
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
@@ -1,5 +1,6 @@
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/nssf.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/nssf.log
|
||||
|
||||
sbi:
|
||||
server:
|
||||
@@ -7,26 +8,22 @@ sbi:
|
||||
client:
|
||||
no_tls: true
|
||||
|
||||
parameter:
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
nssf:
|
||||
sbi:
|
||||
- addr: NSSF_IP
|
||||
port: 7777
|
||||
nsi:
|
||||
- addr: NRF_IP
|
||||
port: 7777
|
||||
s_nssai:
|
||||
sst: 1
|
||||
server:
|
||||
- address: NSSF_IP
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://NRF_IP:7777
|
||||
scp:
|
||||
- uri: http://SCP_IP:7777
|
||||
nsi:
|
||||
- uri: http://NRF_IP:7777
|
||||
s_nssai:
|
||||
sst: 1
|
||||
|
||||
scp:
|
||||
sbi:
|
||||
- addr:
|
||||
- SCP_IP
|
||||
port: 7777
|
||||
|
||||
nrf:
|
||||
sbi:
|
||||
- addr:
|
||||
- NRF_IP
|
||||
port: 7777
|
||||
|
@@ -31,6 +31,7 @@ sed -i 's|NSSF_IP|'$NSSF_IP'|g' install/etc/open5gs/nssf.yaml
|
||||
sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/nssf.yaml
|
||||
sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/nssf.yaml
|
||||
sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/nssf.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/nssf.yaml
|
||||
|
||||
# Sync docker time
|
||||
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
@@ -39,4 +39,4 @@ RUN wget $OSMOCOM_REPO/Release.key && \
|
||||
apt-get update && apt-get install -f && apt-get --install-suggests -y install osmo-hlr
|
||||
|
||||
CMD /mnt/osmohlr/osmohlr_init.sh && \
|
||||
cd /mnt/osmohlr && /usr/bin/osmo-hlr -c /etc/osmocom/osmo-hlr.cfg
|
||||
cd /mnt/osmohlr && /usr/bin/osmo-hlr -c /etc/osmocom/osmo-hlr.cfg --db-upgrade
|
||||
|
@@ -16,5 +16,6 @@ line vty
|
||||
ctrl
|
||||
bind 127.0.0.1
|
||||
hlr
|
||||
subscriber-create-on-demand 5 cs+ps
|
||||
gsup
|
||||
bind ip OSMOHLR_IP
|
||||
|
@@ -1,11 +1,17 @@
|
||||
!
|
||||
! OsmoMSC configuration saved from vty
|
||||
!
|
||||
log stderr
|
||||
logging filter all 1
|
||||
logging color 1
|
||||
logging print category 1
|
||||
logging timestamp 1
|
||||
logging print extended-timestamp 1
|
||||
logging level all debug
|
||||
logging level linp error
|
||||
!
|
||||
line vty
|
||||
no login
|
||||
bind 127.0.0.1
|
||||
ctrl
|
||||
bind 127.0.0.1
|
||||
!
|
||||
network
|
||||
network country code MCC
|
||||
@@ -15,6 +21,17 @@ network
|
||||
encryption a5 0
|
||||
rrlp mode none
|
||||
mm info 1
|
||||
mgw 0
|
||||
remote-ip 127.0.0.1
|
||||
remote-port 2427
|
||||
local-port 2728
|
||||
cs7 instance 0
|
||||
point-code 0.23.1
|
||||
asp asp-clnt-OsmoMSC-A-Iu 2905 0 m3ua
|
||||
! where to reach the STP:
|
||||
remote-ip 127.0.0.5
|
||||
role asp
|
||||
sctp-role client
|
||||
msc
|
||||
assign-tmsi
|
||||
auth-tuple-max-reuse-count 3
|
||||
|
34
pcf/pcf.yaml
34
pcf/pcf.yaml
@@ -1,7 +1,8 @@
|
||||
db_uri: mongodb://MONGO_IP/open5gs
|
||||
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/pcf.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/pcf.log
|
||||
|
||||
sbi:
|
||||
server:
|
||||
@@ -9,24 +10,21 @@ sbi:
|
||||
client:
|
||||
no_tls: true
|
||||
|
||||
parameter:
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
pcf:
|
||||
sbi:
|
||||
- addr: PCF_IP
|
||||
port: 7777
|
||||
server:
|
||||
- address: PCF_IP
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://NRF_IP:7777
|
||||
scp:
|
||||
- uri: http://SCP_IP:7777
|
||||
metrics:
|
||||
- addr: PCF_IP
|
||||
port: 9091
|
||||
|
||||
scp:
|
||||
sbi:
|
||||
- addr:
|
||||
- SCP_IP
|
||||
port: 7777
|
||||
|
||||
nrf:
|
||||
sbi:
|
||||
- addr:
|
||||
- NRF_IP
|
||||
port: 7777
|
||||
server:
|
||||
- address: PCF_IP
|
||||
port: 9091
|
||||
|
@@ -33,6 +33,7 @@ sed -i 's|PCF_IP|'$PCF_IP'|g' install/etc/open5gs/pcf.yaml
|
||||
sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/pcf.yaml
|
||||
sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/pcf.yaml
|
||||
sed -i 's|MONGO_IP|'$MONGO_IP'|g' install/etc/open5gs/pcf.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/pcf.yaml
|
||||
|
||||
# Sync docker time
|
||||
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
@@ -175,7 +175,7 @@ TLS_CA = "/open5gs/install/etc/freeDiameter/cacert.pem";
|
||||
# algorithms. In addition the "0xffffff" application is advertised in CER/CEA
|
||||
# exchanges.
|
||||
# Default: Relaying is enabled.
|
||||
#NoRelay;
|
||||
NoRelay;
|
||||
|
||||
# Number of server threads that can handle incoming messages at the same time.
|
||||
# Default: 4
|
||||
|
@@ -1,9 +1,12 @@
|
||||
db_uri: mongodb://MONGO_IP/open5gs
|
||||
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/pcrf.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/pcrf.log
|
||||
|
||||
parameter:
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
pcrf:
|
||||
freeDiameter: /open5gs/install/etc/freeDiameter/pcrf.conf
|
||||
|
@@ -37,6 +37,7 @@ cp /mnt/pcrf/pcrf.conf install/etc/freeDiameter
|
||||
cp /mnt/pcrf/make_certs.sh install/etc/freeDiameter
|
||||
|
||||
sed -i 's|MONGO_IP|'$MONGO_IP'|g' install/etc/open5gs/pcrf.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/pcrf.yaml
|
||||
sed -i 's|PCRF_IP|'$PCRF_IP'|g' install/etc/freeDiameter/pcrf.conf
|
||||
sed -i 's|SMF_IP|'$SMF_IP'|g' install/etc/freeDiameter/pcrf.conf
|
||||
sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' install/etc/freeDiameter/pcrf.conf
|
||||
|
@@ -103,7 +103,7 @@ enable_tls=yes
|
||||
#!ifdef WITH_TCP
|
||||
# life time of TCP connection when there is no traffic
|
||||
# - a bit higher than registration expires to cope with UA behind NAT
|
||||
tcp_connection_lifetime=36000
|
||||
tcp_connection_lifetime=UE_SUBSCRIPTION_EXPIRES
|
||||
# If a message received over a tcp connection has "alias" in its via a new tcp
|
||||
# alias port will be created for the connection the message came from (the
|
||||
# alias port will be set to the via one).
|
||||
@@ -228,6 +228,13 @@ loadmodule "cdp_avp"
|
||||
loadmodule "ims_qos"
|
||||
#!endif
|
||||
|
||||
#!ifdef WITH_N5
|
||||
loadmodule "http_client"
|
||||
loadmodule "jansson"
|
||||
loadmodule "nghttp2"
|
||||
loadmodule "uuid"
|
||||
#!endif
|
||||
|
||||
#!ifdef CAPTURE_NODE
|
||||
loadmodule "siptrace"
|
||||
#!endif
|
||||
@@ -283,21 +290,20 @@ modparam("pike", "remove_latency", 4)
|
||||
# ip ban htable with autoexpire after 5 minutes
|
||||
modparam("htable", "htable", "ipban=>size=8;autoexpire=300")
|
||||
modparam("htable", "htable", "failedauth=>size=8;autoexpire=120")
|
||||
modparam("htable", "htable", "natpingfrom=>size=8;autoexpire=600000;")
|
||||
modparam("htable", "htable", "natpingfrom=>size=8;autoexpire=UE_SUBSCRIPTION_EXPIRES;")
|
||||
#!endif
|
||||
|
||||
modparam("htable", "htable", "contact=>size=8;autoexpire=20")
|
||||
modparam("htable", "htable", "a=>size=8;autoexpire=20")
|
||||
|
||||
#!ifdef WITH_IMS_HDR_CACHE
|
||||
modparam("htable", "htable", "serviceroutes=>size=16;autoexpire=14400;")
|
||||
modparam("htable", "htable", "associateduris=>size=16;autoexpire=14400;")
|
||||
modparam("htable", "htable", "serviceroutes=>size=16;autoexpire=UE_SUBSCRIPTION_EXPIRES;")
|
||||
modparam("htable", "htable", "associateduris=>size=16;autoexpire=UE_SUBSCRIPTION_EXPIRES;")
|
||||
#!endif
|
||||
|
||||
#!ifdef WITH_NATPING
|
||||
modparam("htable", "htable", "natping=>size=8;autoexpire=600000;")
|
||||
modparam("htable", "htable", "natpingfail=>size=8;autoexpire=600000;")
|
||||
modparam("htable", "htable", "natpingfrom=>size=8;autoexpire=600000;")
|
||||
modparam("htable", "htable", "natping=>size=8;autoexpire=UE_SUBSCRIPTION_EXPIRES;")
|
||||
modparam("htable", "htable", "natpingfail=>size=8;autoexpire=UE_SUBSCRIPTION_EXPIRES;")
|
||||
modparam("htable", "htable", "natpingfrom=>size=8;autoexpire=UE_SUBSCRIPTION_EXPIRES;")
|
||||
#!ifdef DB_URL2
|
||||
modparam("sqlops","sqlcon","pcscf=>cluster://cluster1")
|
||||
#!else
|
||||
@@ -308,7 +314,7 @@ modparam("uac","restore_mode","none")
|
||||
|
||||
# ----------------- Settings for RTimer ---------------
|
||||
# time interval set to 60 seconds
|
||||
modparam("rtimer", "timer", "name=NATPING;interval=60;mode=1;")
|
||||
modparam("rtimer", "timer", "name=NATPING;interval=5;mode=1;")
|
||||
modparam("rtimer", "exec", "timer=NATPING;route=NATPING")
|
||||
#!endif
|
||||
|
||||
@@ -395,7 +401,8 @@ modparam("ims_registrar_pcscf", "is_registered_fallback2ip", 1)
|
||||
modparam("ims_registrar_pcscf", "ignore_reg_state", 1)
|
||||
modparam("ims_registrar_pcscf", "ignore_contact_rxport_check", 1)
|
||||
modparam("ims_registrar_pcscf", "pending_reg_expires", 30)
|
||||
modparam("ims_registrar_pcscf", "subscription_expires", 36000)
|
||||
modparam("ims_registrar_pcscf", "subscription_expires", UE_SUBSCRIPTION_EXPIRES)
|
||||
modparam("ims_registrar_pcscf", "delete_delay", CONTACT_DELETE_DELAY)
|
||||
modparam("ims_usrloc_pcscf", "expires_grace", 120)
|
||||
|
||||
#!ifdef WITH_REGINFO
|
||||
@@ -413,7 +420,8 @@ modparam("ims_ipsec_pcscf", "ipsec_client_port", IPSEC_CLIENT_PORT)
|
||||
modparam("ims_ipsec_pcscf", "ipsec_server_port", IPSEC_SERVER_PORT)
|
||||
modparam("ims_ipsec_pcscf", "ipsec_spi_id_start", 4096)
|
||||
modparam("ims_ipsec_pcscf", "ipsec_max_connections", IPSEC_MAX_CONN)
|
||||
modparam("htable", "htable", "ipsec_clients=>size=8;autoexpire=600000;")
|
||||
modparam("ims_ipsec_pcscf", "ipsec_preferred_ealg", "null")
|
||||
modparam("htable", "htable", "ipsec_clients=>size=8;autoexpire=UE_SUBSCRIPTION_EXPIRES;")
|
||||
#!endif
|
||||
|
||||
#!ifdef WITH_RX
|
||||
@@ -426,7 +434,38 @@ modparam("ims_qos", "confirmed_qosrelease_headers", "X-Reason: QoS failed\r\n")
|
||||
modparam("ims_qos", "authorize_video_flow", 1)
|
||||
modparam("ims_qos", "af_signaling_ip", RX_AF_SIGNALING_IP)
|
||||
modparam("ims_qos", "include_rtcp_fd", 1)
|
||||
modparam("ims_qos", "rx_auth_expiry", 36000)
|
||||
modparam("ims_qos", "rx_auth_expiry", UE_SUBSCRIPTION_EXPIRES)
|
||||
modparam("ims_qos", "recv_mode", 1)
|
||||
modparam("ims_qos", "dialog_direction", RX_IMS_REG_DIALOG_DIRECTION)
|
||||
#!endif
|
||||
|
||||
#!ifdef WITH_N5
|
||||
|
||||
# Tables to store users and their session details
|
||||
modparam("htable", "htable", "user_data=>size=8;autoexpire=3600;")
|
||||
modparam("htable", "htable", "user_ids=>size=8;autoexpire=3600;")
|
||||
modparam("htable", "htable", "user_sdps_ip=>size=8;autoexpire=3600;")
|
||||
modparam("htable", "htable", "user_sdps_port=>size=8;autoexpire=3600;")
|
||||
modparam("htable", "htable", "user_sdps_rtcp_port=>size=8;autoexpire=3600;")
|
||||
modparam("htable", "htable", "user_sip_ips=>size=8;autoexpire=3600;")
|
||||
modparam("htable", "htable", "user_sip_ports=>size=8;autoexpire=3600;")
|
||||
|
||||
# HTTP2 for 5G -- Modules Parameters
|
||||
modparam("http_client", "httpredirect", 1)
|
||||
modparam("http_client", "useragent", "AF")
|
||||
modparam("http_client", "maxdatasize", 64535)
|
||||
modparam("http_client", "connection_timeout", 2)
|
||||
modparam("http_client", "keep_connections", 1)
|
||||
modparam("http_client", "response_headers", 1)
|
||||
modparam("http_client", "query_result", 1)
|
||||
modparam("nghttp2", "listen_addr", "N5_BIND_IP")
|
||||
modparam("nghttp2", "listen_port", "N5_BIND_PORT")
|
||||
# Replace the following with your own Key and Cert, you can use HAProxy to terminate TLS towards Clients e.g. Open5gs PCF
|
||||
# modparam("nghttp2", "tls_private_key", "/mnt/pcscf/http2_key.pem")
|
||||
# modparam("nghttp2", "tls_public_key", "/mnt/pcscf/http2_tr.pem")
|
||||
|
||||
modparam("rtimer", "timer", "name=NRF_NFM;interval=5;mode=1;")
|
||||
modparam("rtimer", "exec", "timer=NRF_NFM;route=NRF_NFM")
|
||||
#!endif
|
||||
|
||||
# -- pua params --
|
||||
@@ -470,9 +509,6 @@ modparam("statistics", "variable", "register_success")
|
||||
modparam("statistics", "variable", "register_failed")
|
||||
modparam("statistics", "variable", "register_time")
|
||||
|
||||
|
||||
####### Routing Logic ########
|
||||
|
||||
# Main SIP request routing logic
|
||||
# - processing of any incoming SIP request starts with this route
|
||||
route {
|
||||
@@ -490,6 +526,17 @@ route {
|
||||
# per request initial checks
|
||||
route(REQINIT);
|
||||
|
||||
#!ifdef WITH_IPSEC
|
||||
if (is_request() && is_method("REGISTER")) {
|
||||
sht_lock("ipsec_clients=>ipsec_clients_lock");
|
||||
$sht(ipsec_clients=>$si) = $null;
|
||||
if ($hdrc(Security-Client) == 1) {
|
||||
$sht(ipsec_clients=>$si) = 1;
|
||||
}
|
||||
sht_unlock("ipsec_clients=>ipsec_clients_lock");
|
||||
}
|
||||
#!endif
|
||||
|
||||
# CANCEL processing
|
||||
if (is_method("CANCEL")) {
|
||||
if (t_check_trans()) {
|
||||
@@ -624,7 +671,7 @@ route {
|
||||
#!endif
|
||||
} else {
|
||||
force_rport();
|
||||
if(is_method("INVITE|SUBSCRIBE|UPDATE|REGISTER")) {
|
||||
if(is_method("INVITE|REGISTER")) {
|
||||
add_contact_alias();
|
||||
}
|
||||
setflag(FLT_NAT);
|
||||
@@ -795,11 +842,6 @@ route[WITHINDLG] {
|
||||
#}
|
||||
}
|
||||
|
||||
if ( is_method("ACK") && ($sht(contact=>$ci) != $null) ) {
|
||||
xlog("Contact of Reply: $sht(contact=>$ci) ($ci)\n");
|
||||
$ru = $sht(contact=>$ci);
|
||||
}
|
||||
|
||||
if ($route_uri =~ "sip:mt@.*") {
|
||||
route(MT_indialog);
|
||||
} else {
|
||||
@@ -889,7 +931,7 @@ route[NATPING] {
|
||||
sht_lock("natping=>natpinglock");
|
||||
sht_iterator_start("nat_iterator", "natping");
|
||||
while(sht_iterator_next("nat_iterator")) {
|
||||
xlog("OPTIONS to $shtitval(nat_iterator) via $shtitkey(nat_iterator)...\n");
|
||||
xnotice("OPTIONS to $shtitval(nat_iterator) via $shtitkey(nat_iterator)...\n");
|
||||
$uac_req(method) = "OPTIONS";
|
||||
$uac_req(ruri) = $shtitval(nat_iterator);
|
||||
$uac_req(furi) = PCSCF_URL;
|
||||
@@ -905,7 +947,7 @@ route[NATPING] {
|
||||
|
||||
event_route[uac:reply] {
|
||||
##!ifdef WITH_DEBUG
|
||||
xlog("request sent to $uac_req(ruri) completed with code: $uac_req(evcode), Type $uac_req(evtype)\n");
|
||||
xnotice("request sent to $uac_req(ruri) completed with code: $uac_req(evcode), Type $uac_req(evtype)\n");
|
||||
##!endif
|
||||
if (($uac_req(evtype) != 1) || ($uac_req(evcode) != 200)) {
|
||||
if ($sht(natpingfail=>$uac_req(ouri)) == $null) {
|
||||
@@ -914,7 +956,7 @@ event_route[uac:reply] {
|
||||
$sht(natpingfail=>$uac_req(ouri)) = $sht(natpingfail=>$uac_req(ouri)) + 1;
|
||||
}
|
||||
xlog(" request sent to $uac_req(ruri): Fail Counter is $sht(natpingfail=>$uac_req(ouri))\n");
|
||||
if ($sht(natpingfail=>$uac_req(ouri)) > 30) {
|
||||
if ($sht(natpingfail=>$uac_req(ouri)) > 10) {
|
||||
if ($(uac_req(ouri){uri.transport}) == "tcp") {
|
||||
$var(alias) = "alias="+$(uac_req(ouri){uri.host})+"~"+$(uac_req(ouri){uri.port})+"~2";
|
||||
} else if ($(uac_req(ouri){uri.transport}) == "tls") {
|
||||
@@ -957,7 +999,7 @@ route[preload_pcscf] {
|
||||
$shv(preload_pcscf) = 1;
|
||||
|
||||
sql_query("pcscf", "select aor, received, received_port, received_proto from location;", "resultset");
|
||||
xlog("Preloading NAT-PING. Rows: $dbr(resultset=>rows)\n");
|
||||
xlog("L_INFO", "Preloading NAT-PING. Rows: $dbr(resultset=>rows)\n");
|
||||
if($dbr(resultset=>rows)>0) {
|
||||
$var(i) = 0;
|
||||
while($var(i) < $dbr(resultset=>rows)) {
|
||||
@@ -979,6 +1021,177 @@ route[preload_pcscf] {
|
||||
}
|
||||
#!endif
|
||||
|
||||
#!ifdef WITH_N5
|
||||
|
||||
# 5G N5 HTTP2 Server routing script basic code
|
||||
event_route[nghttp2:request] {
|
||||
xinfo("request: $nghttp2(method) - url: $nghttp2(path) - data: [$nghttp2(data)]\n");
|
||||
|
||||
# Check if the requested URL is /nf-status-notify
|
||||
if ($nghttp2(path) == "/nf-status-notify") {
|
||||
nghttp2_reply_header("Content-Type", "text/html");
|
||||
nghttp2_reply_header("Server:", "AF");
|
||||
nghttp2_reply("200", "<html><body>PCF registered at PCSCF</body></html>");
|
||||
} else if ($nghttp2(path) == "/terminate") {
|
||||
nghttp2_reply_header("accept", "application/json");
|
||||
nghttp2_reply_header("accept", "application/problem+json");
|
||||
nghttp2_reply_header("Content-Type", "application/json");
|
||||
nghttp2_reply_header("Server", "AF");
|
||||
nghttp2_reply("204", "No Content");
|
||||
} else {
|
||||
# Optionally handle other URLs or do nothing
|
||||
nghttp2_reply_header("accept", "application/json");
|
||||
nghttp2_reply_header("accept", "application/problem+json");
|
||||
nghttp2_reply_header("Content-Type", "application/json");
|
||||
nghttp2_reply_header("Server", "AF");
|
||||
nghttp2_reply("404", "Not Found");
|
||||
}
|
||||
}
|
||||
|
||||
route[NRF_NFM] {
|
||||
if ($var(n5_hb_fail_count) > 5) {
|
||||
xlog("L_ERR", "PCSCF NF no longer registered at SCP. Re-attempting registration!!\n");
|
||||
$var(n5_initalized) = 0;
|
||||
}
|
||||
|
||||
$var(time_now) = $_s($timef(%a, %d %b %Y %H:%M:%S %Z));
|
||||
|
||||
# TODO: Send at heartbeat intervals received in reponse to NF registration
|
||||
if ($var(n5_initalized) == 1) {
|
||||
# Send Heartbeat
|
||||
$var(nf_hb_headers) = "content-type: application/json-patch+json\r\n";
|
||||
$var(nf_hb_headers) = $var(nf_hb_headers) + "accept: application/json,application/problem+json\r\n";
|
||||
$var(nf_hb_headers) = $var(nf_hb_headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(nf_hb_headers) = $var(nf_hb_headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(nf_hb_headers) = $var(nf_hb_headers) + "3gpp-sbi-discovery-service-names: nnrf-nfm\r\n";
|
||||
$var(nf_hb_headers) = $var(nf_hb_headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
$var(nf_hb_json_body) ='[]';
|
||||
$var(nf_hb_body) = '{
|
||||
"op": "replace",
|
||||
"path": "/nfStatus",
|
||||
"value": "REGISTERED"
|
||||
}';
|
||||
jansson_append("obj", "", $var(nf_hb_body), "$var(nf_hb_json_body)");
|
||||
$var(nf_hb_body) = '{
|
||||
"op": "replace",
|
||||
"path": "/load",
|
||||
"value": 0
|
||||
}';
|
||||
jansson_append("obj", "", $var(nf_hb_body), "$var(nf_hb_json_body)");
|
||||
|
||||
http_client_request_v2pk("PATCH", "http://SCP_BIND_IP:SCP_BIND_PORT/nnrf-nfm/v1/nf-instances/$var(pcscf_uuid)", "$var(nf_hb_json_body)", "$var(nf_hb_headers)", "$var(nf_hb_result)");
|
||||
switch ($rc) {
|
||||
case 204:
|
||||
$var(n5_hb_fail_count) = 0;
|
||||
break;
|
||||
default:
|
||||
$var(n5_hb_fail_count) = $var(n5_hb_fail_count) + 1;
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
# Generate UUID for PCSCF
|
||||
$var(pcscf_uuid) = $uuid(g);
|
||||
|
||||
# Register NF
|
||||
$var(nf_reg_headers) = "content-type: application/json\r\n";
|
||||
$var(nf_reg_headers) = $var(nf_reg_headers) + "accept: application/json,application/problem+json\r\n";
|
||||
$var(nf_reg_headers) = $var(nf_reg_headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(nf_reg_headers) = $var(nf_reg_headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(nf_reg_headers) = $var(nf_reg_headers) + "3gpp-sbi-discovery-service-names: nnrf-nfm\r\n";
|
||||
$var(nf_reg_headers) = $var(nf_reg_headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
$var(nf_reg_body) = '{
|
||||
"nfInstanceId": "PCSCF_UUID",
|
||||
"nfType": "AF",
|
||||
"nfStatus": "REGISTERED",
|
||||
"ipv4Addresses": ["N5_BIND_IP"],
|
||||
"allowedNfTypes": ["SCP", "PCF"],
|
||||
"priority": 0,
|
||||
"capacity": 100,
|
||||
"load": 0,
|
||||
"nfServiceList": {
|
||||
"PCSCF_UUID": {
|
||||
"serviceInstanceId": "PCSCF_UUID",
|
||||
"serviceName": "npcf-policyauthorization",
|
||||
"versions": [
|
||||
{
|
||||
"apiVersionInUri": "v2",
|
||||
"apiFullVersion": "2.0.0"
|
||||
}
|
||||
],
|
||||
"scheme": "http",
|
||||
"nfServiceStatus": "REGISTERED",
|
||||
"ipEndPoints": [
|
||||
{
|
||||
"ipv4Address": "N5_BIND_IP",
|
||||
"port": N5_BIND_PORT
|
||||
}
|
||||
],
|
||||
"allowedNfTypes": [
|
||||
"PCF"
|
||||
],
|
||||
"priority": 0,
|
||||
"capacity": 100,
|
||||
"load": 0
|
||||
}
|
||||
},
|
||||
"nfProfileChangesSupportInd": true
|
||||
}';
|
||||
$var(nf_reg_body) = $(var(nf_reg_body){re.subst,/PCSCF_UUID/$var(pcscf_uuid)/g});
|
||||
jansson_append("obj", "", "$var(nf_reg_body)", "$var(nf_reg_json_body)");
|
||||
|
||||
http_client_request_v2pk("PUT", "http://SCP_BIND_IP:SCP_BIND_PORT/nnrf-nfm/v1/nf-instances/$var(pcscf_uuid)", "$var(nf_reg_json_body)", "$var(nf_reg_headers)", "$var(nf_reg_result)");
|
||||
switch ($rc) {
|
||||
case 201:
|
||||
xlog("L_INFO", "P-CSCF NF registered successfully at SCP\n");
|
||||
$var(n5_initalized) = 1;
|
||||
$var(n5_hb_fail_count) = 0;
|
||||
route(NRF_NFM_SUBSCRIBE_PCF);
|
||||
break;
|
||||
default:
|
||||
xlog("L_ERR", "P-CSCF NF failed to register at SCP with code=$rc\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
route[NRF_NFM_SUBSCRIBE_PCF] {
|
||||
# Subscribe to PCF NF registration notification
|
||||
$var(time_now) = $_s($timef(%a, %d %b %Y %H:%M:%S %Z));
|
||||
$var(pcf_subc_headers) = "content-type: application/json\r\n";
|
||||
$var(pcf_subc_headers) = $var(pcf_subc_headers) + "accept: application/json,application/problem+json\r\n";
|
||||
$var(pcf_subc_headers) = $var(pcf_subc_headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(pcf_subc_headers) = $var(pcf_subc_headers) + "3gpp-sbi-callback: Nnrf_NFManagement_NFStatusNotify\r\n";
|
||||
$var(pcf_subc_headers) = $var(pcf_subc_headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(pcf_subc_headers) = $var(pcf_subc_headers) + "3gpp-sbi-discovery-service-names: nnrf-nfm\r\n";
|
||||
$var(pcf_subc_headers) = $var(pcf_subc_headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
$var(pcf_subc_body) = '{
|
||||
"nfStatusNotificationUri": "http://N5_BIND_IP:N5_BIND_PORT/nnrf-nfm/v1/nf-status-notify",
|
||||
"reqNfInstanceId": "PCSCF_UUID",
|
||||
"subscrCond": {
|
||||
"nfType": "PCF"
|
||||
},
|
||||
"reqNfType": "AF",
|
||||
"requesterFeatures": "1"
|
||||
}';
|
||||
$var(pcf_subc_body) = $(var(pcf_subc_body){re.subst,/PCSCF_UUID/$var(pcscf_uuid)/g});
|
||||
jansson_append("obj", "", "$var(pcf_subc_body)", "$var(pcf_subc_json_body)");
|
||||
|
||||
http_client_request_v2pk("POST", "http://SCP_BIND_IP:SCP_BIND_PORT/nnrf-nfm/v1/subscriptions", "$var(pcf_subc_json_body)", "$var(pcf_subc_headers)", "$var(pcf_subc_result)");
|
||||
switch ($rc) {
|
||||
case 201:
|
||||
xlog("L_INFO", "P-CSCF NF subscribed for PCF NF registration notification\n");
|
||||
break;
|
||||
default:
|
||||
xlog("L_ERR", "P-CSCF NF failed to subscribe for PCF NF registration notification\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
#!endif
|
||||
|
||||
#!ifdef WITH_XMLRPC
|
||||
include_file "route/xmlrpc.cfg"
|
||||
#!endif
|
||||
|
@@ -16,11 +16,35 @@ listen=tcp:PCSCF_IP:5060
|
||||
#!define IPSEC_SERVER_PORT 6100
|
||||
#!define IPSEC_MAX_CONN 10
|
||||
|
||||
# Value: 1 for true and 0 for false
|
||||
#!define IPSEC_DELETE_UNUSED_TUNNELS 1
|
||||
|
||||
# Delay in seconds to delete contact from registrar
|
||||
#!define CONTACT_DELETE_DELAY 10
|
||||
|
||||
# Logical OR of following flags:
|
||||
# - IPSEC_SEND_FORCE_SOCKET 1
|
||||
# - IPSEC_SETDSTURI_FULL 128
|
||||
# - IPSEC_FORWARD_USEVIA 256
|
||||
# - IPSEC_FORWARD_TRYTCP 512
|
||||
#!define IPSEC_FORWARD_FLAGS 897
|
||||
|
||||
#!define RX_IMS_REG_DIALOG_DIRECTION 3
|
||||
|
||||
# IP used in Rx_AAR_Register - IP of this P-CSCF, to be used in the flow for the AF-signaling
|
||||
#!define RX_AF_SIGNALING_IP "PCSCF_IP"
|
||||
# Uncomment the below line only when UE is behind double NAT (e.g. VoIP calling over WiFi/ CN behind a NAT)
|
||||
##!define RX_AF_SIGNALING_IP "PCSCF_PUB_IP"
|
||||
|
||||
|
||||
# IP and Port for incoming requests over N5 from 5G Core
|
||||
#!substdef "/N5_BIND_IP/PCSCF_IP/g"
|
||||
#!substdef "/N5_BIND_PORT/7777/g"
|
||||
|
||||
# SCP IP and Port for NF registration and heartbeat
|
||||
#!substdef "/SCP_BIND_IP/SCP_IP/g"
|
||||
#!substdef "/SCP_BIND_PORT/7777/g"
|
||||
|
||||
alias=pcscf.IMS_DOMAIN
|
||||
|
||||
#!define MY_WS_PORT 80
|
||||
@@ -30,9 +54,12 @@ alias=pcscf.IMS_DOMAIN
|
||||
|
||||
#!define TCP_PROCESSES 8
|
||||
|
||||
#!subst "/NETWORKNAME/IMS_DOMAIN/"
|
||||
#!subst "/HOSTNAME/pcscf.IMS_DOMAIN/"
|
||||
#!subst "/PCRF_REALM/EPC_DOMAIN/"
|
||||
# Maximum lifetime of a subscription in seconds (same is advertised to UE)
|
||||
#!substdef "/UE_SUBSCRIPTION_EXPIRES/SUBSCRIPTION_EXPIRES_ENV/g"
|
||||
|
||||
#!subst "/NETWORKNAME/IMS_DOMAIN/g"
|
||||
#!subst "/HOSTNAME/pcscf.IMS_DOMAIN/g"
|
||||
#!subst "/PCRF_REALM/EPC_DOMAIN/g"
|
||||
|
||||
# SIP-Address of capturing node, if not set, capturing is disabled.
|
||||
##!define CAPTURE_NODE "sip:127.0.0.1:9060"
|
||||
@@ -103,15 +130,14 @@ alias=pcscf.IMS_DOMAIN
|
||||
# Enabled Features for this host:
|
||||
##!define WITH_DEBUG
|
||||
#!define WITH_NAT
|
||||
#!define WITH_NATPING
|
||||
##!define WITH_NATPING
|
||||
#!define FORCE_RTPRELAY
|
||||
##!define WITH_TLS
|
||||
##!define WITH_XMLRPC
|
||||
##!define WITH_IPBLOCK
|
||||
##!define WITH_ANTIFLOOD
|
||||
#!define WITH_RX
|
||||
#!define WITH_RX_REG
|
||||
#!define WITH_RX_CALL
|
||||
##!define WITH_N5
|
||||
#!define WITH_TCP
|
||||
##!define WITH_RTPIPV4
|
||||
##!define WITH_SBC
|
||||
|
@@ -11,8 +11,8 @@
|
||||
QueueLength="8"
|
||||
TransactionTimeout="5"
|
||||
SessionsHashSize="128"
|
||||
DefaultAuthSessionTimeout="3600"
|
||||
MaxAuthSessionTimeout="3600"
|
||||
DefaultAuthSessionTimeout="SUBSCRIPTION_EXPIRES_ENV"
|
||||
MaxAuthSessionTimeout="SUBSCRIPTION_EXPIRES_ENV"
|
||||
>
|
||||
<Peer FQDN="pcrf.EPC_DOMAIN" Realm="EPC_DOMAIN" port="PCRF_BIND_PORT"/>
|
||||
|
||||
|
@@ -70,17 +70,21 @@ fi
|
||||
if [[ ${DEPLOY_MODE} == 5G ]];
|
||||
then
|
||||
sed -i 's|#!define WITH_RX\b|##!define WITH_RX|g' /etc/kamailio_pcscf/pcscf.cfg
|
||||
sed -i 's|#!define WITH_RX_REG\b|##!define WITH_RX_REG|g' /etc/kamailio_pcscf/pcscf.cfg
|
||||
sed -i 's|#!define WITH_RX_CALL\b|##!define WITH_RX_CALL|g' /etc/kamailio_pcscf/pcscf.cfg
|
||||
sed -i 's|##!define WITH_N5\b|#!define WITH_N5|g' /etc/kamailio_pcscf/pcscf.cfg
|
||||
fi
|
||||
|
||||
SUBSCRIPTION_EXPIRES_ENV=3600
|
||||
|
||||
sed -i 's|PCSCF_IP|'$PCSCF_IP'|g' /etc/kamailio_pcscf/pcscf.cfg
|
||||
sed -i 's|SUBSCRIPTION_EXPIRES_ENV|'$SUBSCRIPTION_EXPIRES_ENV'|g' /etc/kamailio_pcscf/pcscf.cfg
|
||||
sed -i 's|SCP_IP|'$SCP_IP'|g' /etc/kamailio_pcscf/pcscf.cfg
|
||||
sed -i 's|PCSCF_PUB_IP|'$PCSCF_PUB_IP'|g' /etc/kamailio_pcscf/pcscf.cfg
|
||||
sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/kamailio_pcscf/pcscf.cfg
|
||||
sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' /etc/kamailio_pcscf/pcscf.cfg
|
||||
sed -i 's|MYSQL_IP|'$MYSQL_IP'|g' /etc/kamailio_pcscf/pcscf.cfg
|
||||
|
||||
sed -i 's|PCSCF_IP|'$PCSCF_IP'|g' /etc/kamailio_pcscf/pcscf.xml
|
||||
sed -i 's|SUBSCRIPTION_EXPIRES_ENV|'$SUBSCRIPTION_EXPIRES_ENV'|g' /etc/kamailio_pcscf/pcscf.xml
|
||||
sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/kamailio_pcscf/pcscf.xml
|
||||
sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' /etc/kamailio_pcscf/pcscf.xml
|
||||
sed -i 's|PCRF_BIND_PORT|'$PCRF_BIND_PORT'|g' /etc/kamailio_pcscf/pcscf.xml
|
||||
|
@@ -6,9 +6,10 @@ route[MO]
|
||||
# Strip Transport from RURI:
|
||||
$ru = $(ru{re.subst,/;transport=[A-Za-z]*//g});
|
||||
xnotice("PCSCF MO: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Next hop domain: ($nh(d))\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
|
||||
# Process route headers, if any:
|
||||
loose_route();
|
||||
@@ -65,27 +66,33 @@ route[MO]
|
||||
|
||||
# Check for "sec-agree" in the Proxy-Require header:
|
||||
if (is_present_hf("Proxy-Require") && $hdr(Proxy-Require) =~ ".*sec-agree.*") {
|
||||
# Remove the old Proxy-Require-Header:
|
||||
# Remove the old Proxy-Require-Header:
|
||||
remove_hf("Proxy-Require");
|
||||
# Replace ", sec-agree" with ""
|
||||
$var(new_hdr) = $(hdr(Proxy-Require){re.subst,/[, ]*sec-agree//gi});
|
||||
if ($(var(new_hdr){s.len}) > 0) {
|
||||
append_hf("Proxy-Require: $var(new_hdr)\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
remove_hf("Security-Verify");
|
||||
|
||||
#!ifdef WITH_N5
|
||||
if(is_method("INVITE")) {
|
||||
route(N5_INIT_REQ);
|
||||
}
|
||||
#!endif
|
||||
|
||||
#!ifdef TRF_FUNCTION
|
||||
$var(trf) = TRF_FUNCTION;
|
||||
# Check for "sec-agree" in the Proxy-Require header:
|
||||
if (is_present_hf("Feature-Caps")) {
|
||||
# Remove the old Proxy-Require-Header:
|
||||
# Remove the old Proxy-Require-Header:
|
||||
remove_hf("Feature-Caps");
|
||||
append_hf("Feature-Caps: $hdr(Feature-Caps);+g.3gpp.trf=\"<sip:$var(trf);lr>\"\r\n");
|
||||
} else {
|
||||
} else {
|
||||
append_hf("Feature-Caps: *;+g.3gpp.trf=\"<sip:$var(trf);lr>\"\r\n");
|
||||
}
|
||||
#!endif
|
||||
#!endif
|
||||
# Add a visited Network-ID-Header:
|
||||
if (is_present_hf("P-Visited-Network-ID")) {
|
||||
$var(new_hdr) = "NETWORKNAME, "+$hdr(P-Visited-Network-ID);
|
||||
@@ -97,75 +104,362 @@ route[MO]
|
||||
t_on_reply("MO_reply");
|
||||
}
|
||||
|
||||
#!ifdef WITH_N5
|
||||
|
||||
# Route Logic for N5 Requests
|
||||
route[N5_INIT_REQ] {
|
||||
|
||||
# Storing IDs and IPs of UE into variables to use them later in the N5 Request
|
||||
$var(orig_ue_ip) = $si;
|
||||
$var(orig_ue_port) = $sp;
|
||||
$var(pcscf_ip) = $Ri;
|
||||
$var(pcscf_port) = $Rp;
|
||||
|
||||
xlog("L_INFO", "Connection Info for UE $var(orig_ue_ip) $var(orig_ue_port)\n");
|
||||
xlog("L_INFO", "Connection Info for P-CSCF is: $var(pcscf_ip) $var(pcscf_port)\n");
|
||||
|
||||
$var(user_id_req_ip) = $fU;
|
||||
# Store the IP in the hash table associated with the UE
|
||||
$sht(user_sip_ips=>$var(user_id_req_ip)) = $var(orig_ue_ip);
|
||||
xlog("L_INFO", "IP Info for UE MSISDN $var(user_id_req_ip): $var(orig_ue_ip)\n");
|
||||
|
||||
$var(user_id_req_port) = $fU;
|
||||
# Store the Port in the hash table associated with the UE
|
||||
$sht(user_sip_ports=>$var(user_id_req_port)) = $var(orig_ue_port);
|
||||
xlog("L_INFO", "Port Info for UE MSISDN $var(user_id_req_port): $var(orig_ue_port)\n");
|
||||
|
||||
# Storing SDP Info of UE to variables to use them later in the N5 Flow Fdecs
|
||||
$var(sdp_src_ip) = $sdp(c:ip);
|
||||
$var(sdp_src_port) = $sdp(m0:rtp:port);
|
||||
$var(sdp_src_rtcp_port) = $sdp(m0:rtcp:port);
|
||||
$var(sdp_mline_raw) = $sdp(m0:raw);
|
||||
|
||||
xlog("L_INFO", "SDP Info : Connection IP is $var(sdp_src_ip) Port is $var(sdp_src_port) Mline dump $var(sdp_mline_raw) \n");
|
||||
|
||||
$var(user_id_sdp_ip) = $fU;
|
||||
# Store the SDP source IP in the hash table associated with the UE
|
||||
$sht(user_sdps_ip=>$var(user_id_sdp_ip)) = $var(sdp_src_ip);
|
||||
xlog("L_INFO", "SDP source IP of Orig UE $var(user_id_sdp_ip): $var(sdp_src_ip)\n");
|
||||
|
||||
$var(user_id_sdp_port) = $fU;
|
||||
# Store the SDP Media_Port in the hash table associated with the UE
|
||||
$sht(user_sdps_port=>$var(user_id_sdp_port)) = $var(sdp_src_port);
|
||||
xlog("L_INFO", "SDP Media Port of Orig UE $var(user_id_sdp_port): $var(sdp_src_port)\n");
|
||||
|
||||
$var(user_id_sdp_rtcp_port) = $fU;
|
||||
# Store the RTCP Media Port in the hash table associated with the UE
|
||||
$sht(user_sdps_rtcp_port=>$var(user_id_sdp_rtcp_port)) = $var(sdp_src_rtcp_port);
|
||||
xlog("L_INFO", "SDP RTCP Media Port of Orig UE $var(user_id_sdp_rtcp_port): $var(sdp_src_rtcp_port)\n");
|
||||
|
||||
# 5G VoNR N5 NPCF Authorization request
|
||||
xlog("L_DBG", "IMS: INVITE ORIG TO $tU\n");
|
||||
|
||||
# Retrieve the IP/Port of UE
|
||||
$var(orig_ue_ip) = $fU;
|
||||
$var(ue_ip_addr) = $sht(user_sip_ips=>$var(orig_ue_ip));
|
||||
xlog("L_INFO", "IP for UE $var(orig_ue_ip) is: $var(ue_ip_addr)\n");
|
||||
|
||||
$var(orig_ue_port) = $fU;
|
||||
$var(ue_port_sip) = $sht(user_sip_ports=>$var(orig_ue_port));
|
||||
xlog("L_INFO", "IP for UE $var(orig_ue_port) is: $var(ue_port_sip)\n");
|
||||
|
||||
# Retrieving SDP Connection Info and Media Port for UE
|
||||
$var(sdp_id_ue) = $fU;
|
||||
$var(ue_sdp_ip) = $sht(user_sdps_ip=>$var(sdp_id_ue));
|
||||
xlog("L_INFO", "SDP IP for UE with MSISDN $var(sdp_id_ue) is: $var(ue_sdp_ip)\n");
|
||||
|
||||
$var(sdp_id_ue_port) = $fU;
|
||||
$var(ue_sdp_port) = $sht(user_sdps_port=>$var(sdp_id_ue_port));
|
||||
xlog("L_INFO", "SDP Port for UE with MSISDN $var(sdp_id_ue_port) is: $var(ue_sdp_port)\n");
|
||||
|
||||
|
||||
$var(sdp_id_ue_rtcp_port) = $fU;
|
||||
$var(ue_sdp_rtcp_port) = $sht(user_sdps_rtcp_port=>$var(sdp_id_ue_rtcp_port));
|
||||
xlog("L_INFO", "SDP Port for UE with MSISDN $var(sdp_id_ue_rtcp_port) is: $var(ue_sdp_rtcp_port)\n");
|
||||
|
||||
# Build the N5 Request
|
||||
xlog("L_INFO","Preparing QoS N5 Message to PCF for the INVITE\n");
|
||||
|
||||
$var(events) = '[]';
|
||||
$var(medComponents) = '{}';
|
||||
$var(medSubComps) = '{}';
|
||||
$var(evSubsc) = '{}';
|
||||
$var(payload) = '{}';
|
||||
|
||||
# Set afAppId and dnn in payload
|
||||
jansson_set("string", "afAppId", "+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"", "$var(payload)"); # adding a note that this could be improved in future to get the value SIP Header
|
||||
jansson_set("string", "dnn", "ims", "$var(payload)");
|
||||
|
||||
# Set medComponents
|
||||
jansson_set("integer", "medCompN", 1, "$var(medComp)");
|
||||
jansson_set("string", "qosReference", "qosVoNR", "$var(medComp)");
|
||||
jansson_set("string", "medType", "AUDIO", "$var(medComp)");
|
||||
jansson_set("array", "codecs", "[\"downlink\\noffer\\n\", \"uplink\\nanswer\\n\"]", "$var(medComp)");
|
||||
|
||||
# RTP
|
||||
jansson_set("integer", "fNum", 1, "$var(medSubComp1)");
|
||||
jansson_set("array", "fDescs", "[\"permit out 17 from any to $var(ue_sdp_ip) $var(ue_sdp_port)\", \"permit in 17 from $var(ue_sdp_ip) $var(ue_sdp_port) to any\"]", "$var(medSubComp1)");
|
||||
jansson_set("string", "fStatus", "ENABLED", "$var(medSubComp1)");
|
||||
jansson_set("string", "marBwDl", "5000 Kbps", "$var(medSubComp1)");
|
||||
jansson_set("string", "marBwUl", "3000 Kbps", "$var(medSubComp1)");
|
||||
jansson_set("string", "flowUsage", "NO_INFO", "$var(medSubComp1)");
|
||||
|
||||
|
||||
# RTCP
|
||||
jansson_set("integer", "fNum", 2, "$var(medSubComp2)");
|
||||
jansson_set("array", "fDescs", "[\"permit out 17 from any to $var(ue_sdp_ip) $var(ue_sdp_rtcp_port)\", \"permit in 17 from $var(ue_sdp_ip) $var(ue_sdp_rtcp_port) to any\"]", "$var(medSubComp2)");
|
||||
jansson_set("string", "fStatus", "ENABLED", "$var(medSubComp2)");
|
||||
jansson_set("string", "marBwDl", "5000 Kbps", "$var(medSubComp2)");
|
||||
jansson_set("string", "marBwUl", "3000 Kbps", "$var(medSubComp2)");
|
||||
jansson_set("string", "flowUsage", "RTCP", "$var(medSubComp2)");
|
||||
|
||||
# Merging the flows under MediaSubComponent
|
||||
jansson_set("obj", "0", "$var(medSubComp1)", "$var(medSubComps)");
|
||||
jansson_set("obj", "1", "$var(medSubComp2)", "$var(medSubComps)");
|
||||
jansson_set("obj", "medSubComps", "$var(medSubComps)", "$var(medComp)");
|
||||
|
||||
jansson_set("obj", "0", "$var(medComp)", "$var(medComponents)");
|
||||
jansson_set("obj", "medComponents", "$var(medComponents)", "$var(payload)");
|
||||
|
||||
xlog("L_INFO","Set evSubsc\n");
|
||||
|
||||
# Set evSubsc
|
||||
jansson_set("string", "event", "QOS_NOTIF", "$var(event1)");
|
||||
jansson_set("string", "notifMethod", "PERIODIC", "$var(event1)");
|
||||
jansson_append("obj", "", "$var(event1)", "$var(events)");
|
||||
jansson_set("string", "event", "ANI_REPORT", "$var(event2)");
|
||||
jansson_set("string", "notifMethod", "ONE_TIME", "$var(event2)");
|
||||
jansson_append("obj", "", "$var(event2)", "$var(events)");
|
||||
jansson_set("array", "events", "$var(events)", "$var(evSubsc)");
|
||||
|
||||
jansson_set("obj", "evSubsc", "$var(evSubsc)", "$var(payload)");
|
||||
|
||||
# Set other parameters in payload
|
||||
jansson_set("string", "notifUri", "http://172.22.0.21:7777", "$var(payload)");
|
||||
jansson_set("string", "sponStatus", "SPONSOR_DISABLED", "$var(payload)");
|
||||
jansson_set("string", "gpsi", "msisdn-$fU", "$var(payload)");
|
||||
jansson_set("string", "suppFeat", "4", "$var(payload)");
|
||||
jansson_set("string", "ueIpv4", "$var(ue_ip_addr)", "$var(payload)");
|
||||
|
||||
# Assemble the final JSON request
|
||||
jansson_set("obj", "ascReqData", "$var(payload)", "$var(json_request)");
|
||||
|
||||
xlog("L_INFO", "Set headers for the HTTP2 Request\n");
|
||||
# Set headers
|
||||
$var(time_now)=$_s($timef(%a, %d %b %Y %H:%M:%S %Z));
|
||||
xlog("L_INFO", "Today is $var(time_now)\n");
|
||||
|
||||
$var(headers) = "Content-Type: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/problem+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
xlog("L_INFO","Sending the request to PCF\n");
|
||||
# Send the request to PCF
|
||||
http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions", "$var(json_request)", "$var(headers)", "$var(result)");
|
||||
|
||||
switch ($rc) {
|
||||
# Success case
|
||||
case 201:
|
||||
xlog("L_INFO", "N5 QoS Session successfully Created $rc\n");
|
||||
xlog("L_INFO", "HTTP results: $var(result)\n");
|
||||
xlog("L_INFO", "HTTP response: $rc\n");
|
||||
xlog("L_INFO", "Location Header: $httprhdr(location)\n");
|
||||
|
||||
# Retrieve the AppSession Id out of the location header in response
|
||||
# Example URL: "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/(someSessionID)"
|
||||
|
||||
# Store the url of the lcoation Header in var
|
||||
$var(url) = $httprhdr(location);
|
||||
# Get the length of the URL
|
||||
$var(len) = $(var(url){s.len});
|
||||
# Initialize the position variable to the length of the URL
|
||||
$var(pos) = $var(len);
|
||||
|
||||
# Find the position of the last slash by iterating backwards
|
||||
while ($var(pos) > 0) {
|
||||
$var(pos) = $var(pos) - 1;
|
||||
if ($(var(url){s.substr,$var(pos),1}) == "/") {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
# Extract the substring after the last slash
|
||||
# Set the starting position after the last slash
|
||||
$var(start_pos) = $var(pos) + 1;
|
||||
# Calculate the length of the substring after the last slash
|
||||
$var(substring_length) = $var(len) - $var(start_pos);
|
||||
# Extract the substring after the last slash
|
||||
$var(app_session) = $(var(url){s.substr,$var(start_pos),$var(substring_length)});
|
||||
|
||||
xlog("L_INFO", "AppSession Id for user $fU is: $var(app_session)\n");
|
||||
|
||||
$var(user_id) = $fU;
|
||||
# Store the AppSession Id in the hash table associated with the UE
|
||||
$sht(user_data=>$var(user_id)) = $var(app_session);
|
||||
xlog("L_INFO", "Stored AppSession Id for user $var(user_id): $var(app_session)\n");
|
||||
break;
|
||||
# Failure case
|
||||
default:
|
||||
xlog("L_ERR", "N5 QoS authorization failed - Reason code: $rc\n");
|
||||
send_reply("412", "Register N5 QoS authorization failed");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
#!endif
|
||||
|
||||
######################################################################
|
||||
# Replies to Originating Initial Requests
|
||||
######################################################################
|
||||
onreply_route[MO_reply] {
|
||||
|
||||
xnotice("PCSCF MO_reply: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Next hop domain: ($nh(d))\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
if (is_present_hf("C-Params")) {
|
||||
remove_hf("Contact");
|
||||
remove_hf("C-Params");
|
||||
remove_hf("C-Params");
|
||||
append_hf("Contact: $ct;$hdr(C-Params)\r\n");
|
||||
}
|
||||
|
||||
#!ifdef WITH_N5
|
||||
# N5 PATCH Request for updating AppSession context
|
||||
if (t_check_status("180|183|200") && has_body("application/sdp")) {
|
||||
xlog("L_INFO", "Received early answer in 18x. Patching N5 session in PCF\n");
|
||||
if (t_is_retr_async_reply()) {
|
||||
xlog("L_INFO", "Dropping retransmitted reply which is still currently suspended\n");
|
||||
drop();
|
||||
}
|
||||
route(N5_PATCH_REQ);
|
||||
}
|
||||
|
||||
|
||||
# Terminating N5 AppSession after BYE
|
||||
if (is_method("BYE|CANCEL") || status=~"[45][0-9][0-9]") {
|
||||
xlog("L_ALERT", "Terminating AppSession for Call fom User $fU due to call END or Call Failed\n");
|
||||
# Retrieve the AppSession Id from the hash table
|
||||
$var(user_id_midcall_rel) = $fU;
|
||||
$var(user_appsess_midcall_rel) = $sht(user_data=>$var(user_id_midcall_rel));
|
||||
xlog("L_INFO", "Terminating stored AppSession for user $var(user_id_midcall_rel): $var(user_appsess_midcall_rel)\n");
|
||||
|
||||
$var(headers) = "X-SIP-Status: De-Registration\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/problem+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/$var(user_appsess_midcall_rel)/delete", "$var(json_request)", "$var(headers)", "$var(result)" );
|
||||
xlog("L_INFO", "Termination resuts: $var(result)\n");
|
||||
xlog("L_INFO", "response header: $curlerror(error)\n");
|
||||
xlog("L_INFO", "response header: $var(response_code)\n");
|
||||
xlog("L_INFO", "response header: $httprhdr(location)\n");
|
||||
xlog("L_INFO", "response header: $rc\n");
|
||||
}
|
||||
#!endif
|
||||
|
||||
#!ifdef WITH_IPSEC
|
||||
ipsec_forward("location");
|
||||
sht_lock("ipsec_clients=>ipsec_clients_lock");
|
||||
if ($nh(d) != $null && $sht(ipsec_clients=>$nh(d)) != $null) {
|
||||
# IPSec forward only if its an IPsec client
|
||||
ipsec_forward("location", IPSEC_FORWARD_FLAGS);
|
||||
}
|
||||
sht_unlock("ipsec_clients=>ipsec_clients_lock");
|
||||
#!endif
|
||||
# In case of 1xx and 2xx do NAT
|
||||
if(status=~"[12][0-9][0-9]")
|
||||
route(NATMANAGE);
|
||||
|
||||
#!ifdef WITH_RX
|
||||
if (t_check_status("183|200") && has_body("application/sdp")){
|
||||
if (t_check_status("183|200") && has_body("application/sdp")) {
|
||||
xlog("L_DBG", "IMS: Received 183/200 inside orig_initial_reply\n");
|
||||
|
||||
if (t_is_retr_async_reply()) {
|
||||
xlog("L_DBG", "Dropping retransmitted reply which is still currently suspended\n");
|
||||
drop();
|
||||
}
|
||||
xlog("L_DBG", "Dropping retransmitted reply which is still currently suspended\n");
|
||||
drop();
|
||||
}
|
||||
|
||||
xlog("L_DBG","Diameter: Orig authorizing media via Rx\n");
|
||||
xlog("L_DBG","Diameter: Orig authorizing media via Rx\n");
|
||||
$avp(FTAG_CUSTOM_AVP)=$ft;
|
||||
$avp(TTAG_CUSTOM_AVP)=$tt;
|
||||
$avp(CALLID_CUSTOM_AVP)=$ci;
|
||||
|
||||
if (Rx_AAR("MO_aar_reply","orig","",-1) == 0) {
|
||||
exit;
|
||||
}
|
||||
if (Rx_AAR("MO_aar_reply","orig","",-1) == 0) {
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
route[MO_aar_reply]
|
||||
{
|
||||
#this is async so to know status we have to check the reply avp
|
||||
# Check reply AVP since the operation is async
|
||||
switch ($avp(s:aar_return_code)) {
|
||||
case 1:
|
||||
xlog("L_DBG", "Diameter: Orig AAR success on media authorization\n");
|
||||
xlog("L_DBG", "Diameter: Orig AAR success on media authorization\n");
|
||||
break;
|
||||
default:
|
||||
xlog("L_ERR", "IMS: AAR failed Orig\n");
|
||||
xlog("L_ERR", "IMS: ttag: "+ "$avp(TTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: ftag: "+ "$avp(FTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: callid: "+ "$avp(CALLID_CUSTOM_AVP)");
|
||||
#comment this if you want to allow even if Rx fails
|
||||
if(dlg_get("$avp(CALLID_CUSTOM_AVP)","$avp(FTAG_CUSTOM_AVP)","$avp(TTAG_CUSTOM_AVP)")){
|
||||
dlg_terminate("all", "Sorry no QoS available");
|
||||
exit;
|
||||
}
|
||||
xlog("L_ERR", "IMS: ttag: "+ "$avp(TTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: ftag: "+ "$avp(FTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: callid: "+ "$avp(CALLID_CUSTOM_AVP)");
|
||||
# Comment this if you want to allow even if Rx fails
|
||||
if(dlg_get("$avp(CALLID_CUSTOM_AVP)","$avp(FTAG_CUSTOM_AVP)","$avp(TTAG_CUSTOM_AVP)")){
|
||||
dlg_terminate("all", "Sorry no QoS available");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
#!endif
|
||||
}
|
||||
|
||||
|
||||
######################################################################
|
||||
# In-Dialog-Mo-Requests
|
||||
######################################################################
|
||||
route[MO_indialog] {
|
||||
|
||||
#!ifdef WITH_N5
|
||||
# N5 PATCH Request for updating AppSession context
|
||||
if (is_method("INVITE")) {
|
||||
xlog("L_INFO"," InDialog SDP Answer N5 Request for reINVITE\n");
|
||||
route(N5_PATCH_REQ);
|
||||
}
|
||||
|
||||
# Terminating N5 AppSession after BYE
|
||||
if (is_method("BYE|CANCEL")) {
|
||||
xlog("L_ALERT","Terminating AppSession for Call from User $fU due to call END or Call Failed\n");
|
||||
# Retrieve the AppSession Id from the hash table
|
||||
$var(user_id_call_rel) = $fU;
|
||||
$var(user_appsess_call_rel) = $sht(user_data=>$var(user_id_call_rel));
|
||||
xlog("L_INFO", "Terminating stored AppSession for user $var(user_id_call_rel): $var(user_id_call_rel)\n");
|
||||
|
||||
$var(headers) = "X-SIP-Status: De-Registration\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/problem+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/$var(user_appsess_call_rel)/delete", "$var(json_request)", "$var(headers)", "$var(result)" );
|
||||
xlog("L_INFO", "Termination resuls: $var(result)\n");
|
||||
xlog("L_INFO", "response header: $curlerror(error)\n");
|
||||
xlog("L_INFO", "response header: $var(response_code)\n");
|
||||
xlog("L_INFO", "response header: $httprhdr(location)\n");
|
||||
xlog("L_INFO", "response header: $rc\n");
|
||||
}
|
||||
#!endif
|
||||
|
||||
xnotice("PCSCF MO_indialog: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Next hop domain: ($nh(d))\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
setflag(FLT_MOBILE_ORIG);
|
||||
t_on_reply("MO_indialog_reply");
|
||||
|
||||
@@ -175,20 +469,42 @@ route[MO_indialog] {
|
||||
}
|
||||
|
||||
#!ifdef WITH_IPSEC
|
||||
if ($dd != "" && $rd != "" && $fs != "") {
|
||||
if ($rd =~ ".*" + $dd + ".*") {
|
||||
ipsec_forward("location");
|
||||
}
|
||||
sht_lock("ipsec_clients=>ipsec_clients_lock");
|
||||
if ($nh(d) != $null && $sht(ipsec_clients=>$nh(d)) != $null) {
|
||||
# IPSec forward only if its an IPsec client
|
||||
ipsec_forward("location", IPSEC_FORWARD_FLAGS);
|
||||
}
|
||||
sht_unlock("ipsec_clients=>ipsec_clients_lock");
|
||||
#!endif
|
||||
}
|
||||
|
||||
onreply_route[MO_indialog_reply] {
|
||||
xnotice("PCSCF MO_indialog_reply: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Next hop domain: ($nh(d))\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
|
||||
#!ifdef WITH_N5
|
||||
# N5 PATCH Request for updating AppSession context
|
||||
if (t_check_status("180|183|200") && has_body("application/sdp")) {
|
||||
xlog("L_DBG", "Received early answer in 18x. Patching N5 session in PCF\n");
|
||||
if (t_is_retr_async_reply()) {
|
||||
xlog("L_DBG", "Dropping retransmitted reply which is still currently suspended\n");
|
||||
drop();
|
||||
}
|
||||
route(N5_PATCH_REQ);
|
||||
}
|
||||
#!endif
|
||||
|
||||
#!ifdef WITH_IPSEC
|
||||
sht_lock("ipsec_clients=>ipsec_clients_lock");
|
||||
if ($nh(d) != $null && $sht(ipsec_clients=>$nh(d)) != $null) {
|
||||
# IPSec forward only if its an IPsec client
|
||||
ipsec_forward("location", IPSEC_FORWARD_FLAGS);
|
||||
}
|
||||
sht_unlock("ipsec_clients=>ipsec_clients_lock");
|
||||
#!endif
|
||||
# In case of 1xx and 2xx do NAT
|
||||
if(status=~"[12][0-9][0-9]")
|
||||
route(NATMANAGE);
|
||||
@@ -196,39 +512,178 @@ onreply_route[MO_indialog_reply] {
|
||||
#!ifdef WITH_RX
|
||||
if (t_check_status("183|200") && has_body("application/sdp") && !is_method("PRACK")) {
|
||||
if (t_is_retr_async_reply()) {
|
||||
xlog("L_DBG", "Dropping retransmitted reply which is still currently suspended\n");
|
||||
drop();
|
||||
}
|
||||
xlog("L_DBG", "Dropping retransmitted reply which is still currently suspended\n");
|
||||
drop();
|
||||
}
|
||||
|
||||
xlog("L_DBG", "IMS: ORIG_SUBSEQUENT reply. This is a 200 OK to a re-INVITE\n");
|
||||
xlog("L_DBG","Diameter: Orig authorizing media via Rx\n");
|
||||
xlog("L_DBG", "IMS: ORIG_SUBSEQUENT reply. This is a 200 OK to a re-INVITE\n");
|
||||
xlog("L_DBG","Diameter: Orig authorizing media via Rx\n");
|
||||
$avp(FTAG_CUSTOM_AVP)=$ft;
|
||||
$avp(TTAG_CUSTOM_AVP)=$tt;
|
||||
$avp(CALLID_CUSTOM_AVP)=$ci;
|
||||
|
||||
if (Rx_AAR("MO_indialog_aar_reply","orig","",-1) == 0) {
|
||||
exit;
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
route[MO_indialog_aar_reply]
|
||||
{
|
||||
#this is async so to know status we have to check the reply avp
|
||||
# Check reply AVP since the operation is async
|
||||
switch ($avp(s:aar_return_code)) {
|
||||
case 1:
|
||||
xlog("L_DBG", "Diameter: Orig AAR success on media authorization\n");
|
||||
break;
|
||||
default:
|
||||
xlog("L_ERR", "IMS: AAR failed Orig\n");
|
||||
xlog("L_ERR", "IMS: ttag: "+ "$avp(TTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: ftag: "+ "$avp(FTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: callid: "+ "$avp(CALLID_CUSTOM_AVP)");
|
||||
#comment this if you want to allow even if Rx fails
|
||||
if(dlg_get("$avp(CALLID_CUSTOM_AVP)","$avp(FTAG_CUSTOM_AVP)","$avp(TTAG_CUSTOM_AVP)")){
|
||||
dlg_terminate("all", "Sorry no QoS available");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
case 1:
|
||||
xlog("L_DBG", "Diameter: Orig AAR success on media authorization\n");
|
||||
break;
|
||||
default:
|
||||
xlog("L_ERR", "IMS: AAR failed Orig\n");
|
||||
xlog("L_ERR", "IMS: ttag: "+ "$avp(TTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: ftag: "+ "$avp(FTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: callid: "+ "$avp(CALLID_CUSTOM_AVP)");
|
||||
# Comment this if you want to allow even if Rx fails
|
||||
if(dlg_get("$avp(CALLID_CUSTOM_AVP)","$avp(FTAG_CUSTOM_AVP)","$avp(TTAG_CUSTOM_AVP)")){
|
||||
dlg_terminate("all", "Sorry no QoS available");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
#!endif
|
||||
}
|
||||
|
||||
#!ifdef WITH_N5
|
||||
|
||||
# 5G VoNR N5 Policy Authorization PATCH request
|
||||
route[N5_PATCH_REQ] {
|
||||
xlog("L_INFO", "IMS: Received 183/200 inside orig_initial_reply\n");
|
||||
|
||||
# Retrieve the IP/Port of UE
|
||||
$var(orig_id_ue_ip) = $fU;
|
||||
$var(ue_sip_ip_addr) = $sht(user_sip_ips=>$var(orig_id_ue_ip));
|
||||
xlog("L_INFO", "IP for UE $var(orig_id_ue_ip) is: $var(ue_sip_ip_addr)\n");
|
||||
|
||||
$var(orig_ue_port) = $fU;
|
||||
$var(ue_port_sip) = $sht(user_sip_ports=>$var(orig_ue_port));
|
||||
xlog("L_INFO", "IP for UE $var(orig_ue_port) is: $var(ue_port_sip)\n");
|
||||
|
||||
# Retrieve SDP Connection Info and Media Port for UE
|
||||
$var(sdp_id_ue) = $fU;
|
||||
$var(ue_sdp_ip) = $sht(user_sdps_ip=>$var(sdp_id_ue));
|
||||
xlog("L_INFO", "SDP IP for UE with MSISDN $var(sdp_id_ue) is: $var(ue_sdp_ip)\n");
|
||||
|
||||
$var(sdp_id_ue_port) = $fU;
|
||||
$var(ue_sdp_port) = $sht(user_sdps_port=>$var(sdp_id_ue_port));
|
||||
xlog("L_INFO", "SDP Port for UE with MSISDN $var(sdp_id_ue_port) is: $var(ue_sdp_port)\n");
|
||||
|
||||
$var(sdp_id_ue_rtcp_port) = $fU;
|
||||
$var(ue_sdp_rtcp_port) = $sht(user_sdps_rtcp_port=>$var(sdp_id_ue_rtcp_port));
|
||||
xlog("L_INFO", "SDP Port for UE with MSISDN $var(sdp_id_ue_rtcp_port) is: $var(ue_sdp_rtcp_port)\n");
|
||||
|
||||
# Retrieve SDP Connection Info from SDP Answer
|
||||
$var(sdp_answ_ip) = $sdp(c:ip);
|
||||
$var(sdp_answ_port) = $sdp(m0:rtp:port);
|
||||
$var(sdp_answ_rtcp_port) = $sdp(m0:rtcp:port);
|
||||
$var(sdp_answ_codec) = $(rb{line.sw,a=rtpmap}{s.select,1, });
|
||||
xlog("L_INFO", "SDP Answer connection Info is: $var(sdp_answ_ip), RTP port $var(sdp_answ_port), RTCP Port $var(sdp_answ_rtcp_port) and codec is $var(sdp_answ_codec)\n");
|
||||
|
||||
# Retrieve AppSession Id
|
||||
$var(user_id_inv_rep) = $fU;
|
||||
$var(user_appsess_inv_rep) = $sht(user_data=>$var(user_id_inv_rep));
|
||||
xlog("L_INFO", "Stored AppSession Id for user $var(user_id_inv_rep): $var(user_appsess_inv_rep)\n");
|
||||
|
||||
xlog("L_INFO","Preparing PATCH N5 Message for SDP Answer\n");
|
||||
|
||||
$var(events) = '[]';
|
||||
$var(medComponents) = '{}';
|
||||
$var(medSubComps) = '{}';
|
||||
$var(evSubsc) = '{}';
|
||||
$var(payload) = '{}';
|
||||
|
||||
# Set afAppId and dnn in payload
|
||||
jansson_set("string", "afAppId", "+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"", "$var(payload)");
|
||||
jansson_set("string", "dnn", "ims", "$var(payload)");
|
||||
|
||||
# Set media components
|
||||
jansson_set("integer", "medCompN", 1, "$var(medComp)");
|
||||
jansson_set("string", "qosReference", "qosVoNR", "$var(medComp)");
|
||||
jansson_set("string", "medType", "AUDIO", "$var(medComp)");
|
||||
jansson_set("array", "codecs", "[\"downlink\\n$var(sdp_answ_codec)\\n\", \"uplink\\n$var(sdp_answ_codec)\\n\"]", "$var(medComp)");
|
||||
|
||||
# RTP
|
||||
jansson_set("integer", "fNum", 1, "$var(medSubComp1)");
|
||||
jansson_set("array", "fDescs", "[\"permit out 17 from $var(sdp_answ_ip) $var(sdp_answ_port) to $var(ue_sdp_ip) $var(ue_sdp_port)\", \"permit in 17 from $var(ue_sdp_ip) $var(ue_sdp_port) to $var(sdp_answ_ip) $var(sdp_answ_port)\"]", "$var(medSubComp1)");
|
||||
jansson_set("string", "fStatus", "ENABLED", "$var(medSubComp1)");
|
||||
jansson_set("string", "marBwDl", "5000 Kbps", "$var(medSubComp1)");
|
||||
jansson_set("string", "marBwUl", "3000 Kbps", "$var(medSubComp1)");
|
||||
jansson_set("string", "flowUsage", "NO_INFO", "$var(medSubComp1)");
|
||||
|
||||
|
||||
# RTCP
|
||||
jansson_set("integer", "fNum", 2, "$var(medSubComp2)");
|
||||
jansson_set("array", "fDescs", "[\"permit out 17 from $var(sdp_answ_ip) $var(sdp_answ_rtcp_port) to $var(ue_sdp_ip) $var(ue_sdp_rtcp_port)\", \"permit in 17 from $var(ue_sdp_ip) $var(ue_sdp_rtcp_port) to $var(sdp_answ_ip) $var(sdp_answ_rtcp_port)\"]", "$var(medSubComp2)");
|
||||
jansson_set("string", "fStatus", "ENABLED", "$var(medSubComp2)");
|
||||
jansson_set("string", "marBwDl", "5000 Kbps", "$var(medSubComp2)");
|
||||
jansson_set("string", "marBwUl", "3000 Kbps", "$var(medSubComp2)");
|
||||
jansson_set("string", "flowUsage", "RTCP", "$var(medSubComp2)");
|
||||
|
||||
# Merging the flows under MediaSubComponent
|
||||
jansson_set("obj", "0", "$var(medSubComp1)", "$var(medSubComps)");
|
||||
jansson_set("obj", "1", "$var(medSubComp2)", "$var(medSubComps)");
|
||||
jansson_set("obj", "medSubComps", "$var(medSubComps)", "$var(medComp)");
|
||||
|
||||
jansson_set("obj", "0", "$var(medComp)", "$var(medComponents)");
|
||||
jansson_set("obj", "medComponents", "$var(medComponents)", "$var(payload)");
|
||||
|
||||
xlog("L_INFO","DEBUG: Set evSubsc\n");
|
||||
|
||||
# Set evSubsc
|
||||
jansson_set("string", "event", "QOS_NOTIF", "$var(event1)");
|
||||
jansson_set("string", "notifMethod", "PERIODIC", "$var(event1)");
|
||||
jansson_append("obj", "", "$var(event1)", "$var(events)");
|
||||
jansson_set("string", "event", "ANI_REPORT", "$var(event2)");
|
||||
jansson_set("string", "notifMethod", "ONE_TIME", "$var(event2)");
|
||||
jansson_append("obj", "", "$var(event2)", "$var(events)");
|
||||
jansson_set("array", "events", "$var(events)", "$var(evSubsc)");
|
||||
|
||||
jansson_set("obj", "evSubsc", "$var(evSubsc)", "$var(payload)");
|
||||
|
||||
# Set other parameters in payload
|
||||
jansson_set("string", "notifUri", "http://172.22.0.21:7777", "$var(payload)");
|
||||
jansson_set("string", "sponStatus", "SPONSOR_DISABLED", "$var(payload)");
|
||||
jansson_set("string", "gpsi", "msisdn-$fU", "$var(payload)");
|
||||
jansson_set("string", "suppFeat", "4", "$var(payload)");
|
||||
jansson_set("string", "ueIpv4", "$var(ue_sip_ip_addr)", "$var(payload)");
|
||||
|
||||
# Assemble the final JSON request
|
||||
jansson_set("obj", "ascReqData", "$var(payload)", "$var(json_request)");
|
||||
|
||||
xlog("L_INFO","Set headers for the HTTP2 Request\n");
|
||||
# Set headers
|
||||
$var(time_now)=$_s($timef(%a, %d %b %Y %H:%M:%S %Z));
|
||||
xlog("L_INFO", "Today is $var(time_now)\n");
|
||||
|
||||
# Set Content-type to application/merge-patch+json for compatibility with RFC7386 for JSON PATCH/Merge
|
||||
$var(headers) = "Content-Type: application/merge-patch+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/problem+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
xlog("L_INFO","Sending the request to PCF\n");
|
||||
# Send the request to PCF
|
||||
http_client_request_v2pk("PATCH", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/$var(user_appsess_inv_rep)", "$var(json_request)", "$var(headers)", "$var(result)" );
|
||||
switch ($rc) {
|
||||
case 200:
|
||||
xlog("L_INFO", "N5 QoS Session modification success - reason code: $rc\n");
|
||||
xlog("L_INFO", "HTTP results: $var(result)\n");
|
||||
xlog("L_INFO", "HTTP response: $rc\n");
|
||||
xlog("L_INFO", "cURL Response: $curlerror(error)\n");
|
||||
xlog("L_INFO", "Location Header header: $httprhdr(location)\n");
|
||||
break;
|
||||
default:
|
||||
xlog("L_ERR", "N5 QoS Session modification faild - reason code: $rc\n");
|
||||
send_reply("412", "MOC N5 QoS Session modify faild");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
#!endif
|
||||
|
@@ -2,13 +2,28 @@
|
||||
# Terminating, Initial requests
|
||||
######################################################################
|
||||
route[MT] {
|
||||
xnotice("PCSCF MT: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
set_dlg_profile("term");
|
||||
xnotice("PCSCF MT: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Next hop domain: ($nh(d))\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
xnotice("Term UE connection information : IP is $dd and Port is $rp \n");
|
||||
xnotice("Term P-CSCF connection information : IP is $RAi and Port is $RAp \n");
|
||||
set_dlg_profile("term");
|
||||
|
||||
#!ifdef WITH_N5
|
||||
if(is_method("INVITE")) {
|
||||
route(N5_INIT_MT_REQ);
|
||||
}
|
||||
#!endif
|
||||
|
||||
#!ifdef WITH_IPSEC
|
||||
ipsec_forward("location");
|
||||
sht_lock("ipsec_clients=>ipsec_clients_lock");
|
||||
if ($nh(d) != $null && $sht(ipsec_clients=>$nh(d)) != $null) {
|
||||
# IPSec forward only if its an IPsec client
|
||||
ipsec_forward("location", IPSEC_FORWARD_FLAGS);
|
||||
}
|
||||
sht_unlock("ipsec_clients=>ipsec_clients_lock");
|
||||
#!endif
|
||||
t_on_reply("MT_reply");
|
||||
}
|
||||
@@ -17,10 +32,11 @@ route[MT] {
|
||||
# Replies to Originating Initial Requests
|
||||
######################################################################
|
||||
onreply_route[MT_reply] {
|
||||
xnotice("PCSCF MT_reply: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
xnotice("PCSCF MT_reply: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Next hop domain: ($nh(d))\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
if (!strempty($(ct{tobody.params}))) {
|
||||
append_hf("C-Params: $(ct{tobody.params})\r\n");
|
||||
}
|
||||
@@ -28,51 +44,69 @@ onreply_route[MT_reply] {
|
||||
# In case of 1xx and 2xx do NAT
|
||||
if(status=~"[12][0-9][0-9]")
|
||||
route(NATMANAGE);
|
||||
#!ifdef WITH_RX
|
||||
if (t_check_status("183|200") && has_body("application/sdp")){
|
||||
xnotice("PCSCF MT_reply: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
xlog("L_DBG", "IMS: Received 183 inside term_initial_reply\n");
|
||||
|
||||
xlog("L_DBG", "About to test if this is a retransmitted reply which is still currently suspended\n");
|
||||
#!ifdef WITH_N5
|
||||
# N5 PATCH Request for updating AppSession context
|
||||
if (t_check_status("180|183|200") && has_body("application/sdp")) {
|
||||
xlog("L_INFO", "Received early answer in 18x. Patching N5 session in PCF\n");
|
||||
if (t_is_retr_async_reply()) {
|
||||
xlog("L_DBG", "Dropping retransmitted reply which is still currently suspended\n");
|
||||
drop();
|
||||
}
|
||||
xlog("L_INFO", "Dropping retransmitted reply which is still currently suspended\n");
|
||||
drop();
|
||||
}
|
||||
route(N5_PATCH_MT_REQ);
|
||||
}
|
||||
|
||||
xlog("L_DBG","Diameter: Term authorizing media via Rx\n");
|
||||
# Terminating N5 AppSession after error response
|
||||
if (status=~"[45][0-9][0-9]") {
|
||||
xnotice("Received Error response for the Call. Going to terminate N5 Session\n");
|
||||
route(N5_MTC_TERM);
|
||||
}
|
||||
#!endif
|
||||
|
||||
#!ifdef WITH_RX
|
||||
if (t_check_status("183|200") && has_body("application/sdp")){
|
||||
xnotice("PCSCF MT_reply: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
xlog("L_DBG", "IMS: Received 183 inside term_initial_reply\n");
|
||||
|
||||
if (t_is_retr_async_reply()) {
|
||||
xlog("L_DBG", "Dropping retransmitted reply which is still currently suspended\n");
|
||||
drop();
|
||||
}
|
||||
|
||||
xlog("L_DBG","Diameter: Term authorizing media via Rx\n");
|
||||
$avp(FTAG_CUSTOM_AVP)=$ft;
|
||||
$avp(TTAG_CUSTOM_AVP)=$tt;
|
||||
$avp(CALLID_CUSTOM_AVP)=$ci;
|
||||
|
||||
if (Rx_AAR("MT_aar_reply","term","",-1) == 0) {
|
||||
exit;
|
||||
}
|
||||
if (Rx_AAR("MT_aar_reply","term","",-1) == 0) {
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
route[MT_aar_reply]
|
||||
{
|
||||
xlog("L_DBG", "IMS: TERM_SESSION_AAR_REPLY\n");
|
||||
xlog("L_DBG", "IMS: TERM_SESSION_AAR_REPLY\n");
|
||||
|
||||
#this is async so to know status we have to check the reply avp
|
||||
# Check reply AVP since the operation is async
|
||||
switch ($avp(s:aar_return_code)) {
|
||||
case 1:
|
||||
xlog("L_DBG", "Diameter: Orig AAR success on media authorization\n");
|
||||
break;
|
||||
default:
|
||||
xlog("L_ERR", "IMS: AAR failed Orig\n");
|
||||
xlog("L_ERR", "IMS: ttag: "+ "$avp(TTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: ftag: "+ "$avp(FTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: callid: "+ "$avp(CALLID_CUSTOM_AVP)");
|
||||
#comment this if you want to allow even if Rx fails
|
||||
if(dlg_get("$avp(CALLID_CUSTOM_AVP)","$avp(FTAG_CUSTOM_AVP)","$avp(TTAG_CUSTOM_AVP)")){
|
||||
dlg_terminate("all", "Sorry no QoS available");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
case 1:
|
||||
xlog("L_DBG", "Diameter: Orig AAR success on media authorization\n");
|
||||
break;
|
||||
default:
|
||||
xlog("L_ERR", "IMS: AAR failed Orig\n");
|
||||
xlog("L_ERR", "IMS: ttag: "+ "$avp(TTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: ftag: "+ "$avp(FTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: callid: "+ "$avp(CALLID_CUSTOM_AVP)");
|
||||
# Comment this if you want to allow even if Rx fails
|
||||
if(dlg_get("$avp(CALLID_CUSTOM_AVP)","$avp(FTAG_CUSTOM_AVP)","$avp(TTAG_CUSTOM_AVP)")){
|
||||
dlg_terminate("all", "Sorry no QoS available");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
#!endif
|
||||
}
|
||||
|
||||
@@ -81,32 +115,71 @@ route[MT_aar_reply]
|
||||
# In-Dialog-MT-Requests
|
||||
######################################################################
|
||||
route[MT_indialog] {
|
||||
xnotice("PCSCF MT_indialog: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
#resetflag(FLT_MOBILE_ORIG);
|
||||
|
||||
#!ifdef WITH_N5
|
||||
# N5 PATCH Request for updating AppSession context
|
||||
if (is_method("INVITE")) {
|
||||
xlog("L_INFO"," InDialog SDP Change. Sending N5 Request to update appSession context\n");
|
||||
route(N5_PATCH_REQ);
|
||||
}
|
||||
|
||||
# Terminating N5 AppSession after BYE
|
||||
if (is_method("BYE|CANCEL")) {
|
||||
xlog("L_INFO"," InDialog Call End/Cancel/Error. Terminating N5 QoS Session\n");
|
||||
route(N5_MTC_TERM);
|
||||
}
|
||||
#!endif
|
||||
|
||||
xnotice("PCSCF MT_indialog: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Next hop domain: ($nh(d))\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
#resetflag(FLT_MOBILE_ORIG);
|
||||
t_on_reply("MT_indialog_reply");
|
||||
|
||||
# Append rport only if its a request coming from UE
|
||||
# Append rport only if its a request coming from UE
|
||||
if (is_request() && ($hdrc(Via) == 1)) {
|
||||
force_rport();
|
||||
}
|
||||
|
||||
#!ifdef WITH_IPSEC
|
||||
if ($dd != "" && $rd != "" && $fs != "") {
|
||||
if ($rd =~ ".*" + $dd + ".*") {
|
||||
ipsec_forward("location");
|
||||
}
|
||||
}
|
||||
sht_lock("ipsec_clients=>ipsec_clients_lock");
|
||||
if ($nh(d) != $null && $sht(ipsec_clients=>$nh(d)) != $null) {
|
||||
# IPSec forward only if its an IPsec client
|
||||
ipsec_forward("location", IPSEC_FORWARD_FLAGS);
|
||||
}
|
||||
sht_unlock("ipsec_clients=>ipsec_clients_lock");
|
||||
#!endif
|
||||
}
|
||||
|
||||
onreply_route[MT_indialog_reply] {
|
||||
xnotice("PCSCF MT_indialog_reply: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
xnotice("PCSCF MT_indialog_reply: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
xnotice("Next hop domain: ($nh(d))\n");
|
||||
xnotice("Contact header: $ct\n");
|
||||
|
||||
#!ifdef WITH_N5
|
||||
# N5 PATCH Request for updating AppSession context for Indialog reply
|
||||
if (t_check_status("180|183|200") && has_body("application/sdp")){
|
||||
xlog("L_INFO", "Received MT_indialog_reply. Patching N5 session in PCF\n");
|
||||
if (t_is_retr_async_reply()) {
|
||||
xlog("L_INFO", "Dropping retransmitted reply which is still currently suspended\n");
|
||||
drop();
|
||||
}
|
||||
route(N5_PATCH_MT_REQ);
|
||||
}
|
||||
#!endif
|
||||
|
||||
#!ifdef WITH_IPSEC
|
||||
sht_lock("ipsec_clients=>ipsec_clients_lock");
|
||||
if ($nh(d) != $null && $sht(ipsec_clients=>$nh(d)) != $null) {
|
||||
# IPSec forward only if its an IPsec client
|
||||
ipsec_forward("location", IPSEC_FORWARD_FLAGS);
|
||||
}
|
||||
sht_unlock("ipsec_clients=>ipsec_clients_lock");
|
||||
#!endif
|
||||
# In case of 1xx and 2xx do NAT
|
||||
if(status=~"[12][0-9][0-9]")
|
||||
route(NATMANAGE);
|
||||
@@ -119,34 +192,377 @@ onreply_route[MT_indialog_reply] {
|
||||
}
|
||||
|
||||
xlog("L_DBG", "IMS: TERM_SUBSEQUENT reply. This is a 200 OK to a re-INVITE\n");
|
||||
xlog("L_DBG","Diameter: Term authorizing media via Rx\n");
|
||||
xlog("L_DBG","Diameter: Term authorizing media via Rx\n");
|
||||
$avp(FTAG_CUSTOM_AVP)=$ft;
|
||||
$avp(TTAG_CUSTOM_AVP)=$tt;
|
||||
$avp(CALLID_CUSTOM_AVP)=$ci;
|
||||
|
||||
if (Rx_AAR("MT_indialog_aar_reply","term","",-1) == 0) {
|
||||
exit;
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
route[MT_indialog_aar_reply]
|
||||
{
|
||||
#this is async so to know status we have to check the reply avp
|
||||
# Check reply AVP since the operation is async
|
||||
switch ($avp(s:aar_return_code)) {
|
||||
case 1:
|
||||
xlog("L_DBG", "Diameter: Orig AAR success on media authorization\n");
|
||||
break;
|
||||
default:
|
||||
xlog("L_ERR", "IMS: AAR failed Orig\n");
|
||||
xlog("L_ERR", "IMS: ttag: "+ "$avp(TTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: ftag: "+ "$avp(FTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: callid: "+ "$avp(CALLID_CUSTOM_AVP)");
|
||||
#comment this if you want to allow even if Rx fails
|
||||
if(dlg_get("$avp(CALLID_CUSTOM_AVP)","$avp(FTAG_CUSTOM_AVP)","$avp(TTAG_CUSTOM_AVP)")){
|
||||
dlg_terminate("all", "Sorry no QoS available");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
case 1:
|
||||
xlog("L_DBG", "Diameter: Orig AAR success on media authorization\n");
|
||||
break;
|
||||
default:
|
||||
xlog("L_ERR", "IMS: AAR failed Orig\n");
|
||||
xlog("L_ERR", "IMS: ttag: "+ "$avp(TTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: ftag: "+ "$avp(FTAG_CUSTOM_AVP)");
|
||||
xlog("L_ERR", "IMS: callid: "+ "$avp(CALLID_CUSTOM_AVP)");
|
||||
# Comment this if you want to allow even if Rx fails
|
||||
if(dlg_get("$avp(CALLID_CUSTOM_AVP)","$avp(FTAG_CUSTOM_AVP)","$avp(TTAG_CUSTOM_AVP)")){
|
||||
dlg_terminate("all", "Sorry no QoS available");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
#!endif
|
||||
}
|
||||
|
||||
#!ifdef WITH_N5
|
||||
|
||||
# Route Logic for N5 Requests
|
||||
route[N5_INIT_MT_REQ] {
|
||||
|
||||
# Storing IDs and IPs from UE into variables to use them later in the N5 Request
|
||||
$var(term_ue_ip) = $dd;
|
||||
$var(term_sip_ue_port) = $rp;
|
||||
$var(pcscf_sip_ip) = $Ri;
|
||||
$var(pcscf_sip_port) = $Rp;
|
||||
|
||||
xlog("L_INFO", "SIP Connection Info for Term UE $var(term_ue_ip) $var(term_sip_ue_port)\n");
|
||||
xlog("L_INFO", "SIP Connection Info for P-CSCF is: $var(pcscf_sip_ip) $var(pcscf_sip_port)\n");
|
||||
|
||||
$var(term_user_id_req_ip) = $tU;
|
||||
# Store the IP in the hash table associated with the UE
|
||||
$sht(user_sip_ips=>$var(term_user_id_req_ip)) = $var(term_ue_ip);
|
||||
xlog("L_INFO", "SIP/SDP IP Info for Term UE MSISDN $var(term_user_id_req_ip): $var(term_ue_ip)\n");
|
||||
|
||||
$var(term_user_id_req_port) = $tU;
|
||||
# Store the Port in the hash table associated with the UE
|
||||
$sht(user_sip_ports=>$var(term_user_id_req_port)) = $var(term_sip_ue_port);
|
||||
xlog("L_INFO", "SIP Port Info for UE MSISDN $var(term_user_id_req_port): $var(term_sip_ue_port)\n");
|
||||
|
||||
xlog("L_INFO", "IMS: MTC INVITE TO $tU\n");
|
||||
# Retrieving SDP Connection Info and Media Port for UE
|
||||
$var(sdp_src_ip) = $sdp(c:ip);
|
||||
$var(sdp_src_port) = $sdp(m0:rtp:port);
|
||||
$var(orig_ue_sdp_rtcp_port) = $sdp(m0:rtcp:port);
|
||||
$var(sdp_mline_raw) = $sdp(m0:raw);
|
||||
|
||||
xlog("L_INFO", "SDP Info From INVITE: $sdp(c:ip) -- $sdp(m0:rtp:port) -- $sdp(m0:rtcp:port)\n");
|
||||
|
||||
$var(call_id_sdp_ip) = $ci;
|
||||
# Store the SDP IP in the hash table associated with the Call-Id
|
||||
$sht(user_sdps_ip=>$var(call_id_sdp_ip)) = $var(sdp_src_ip);
|
||||
|
||||
$var(ret_call_id_sdp_ip) = $ci;
|
||||
$var(sdp_src_ip) = $sht(user_sdps_ip=>$var(ret_call_id_sdp_ip));
|
||||
xlog("L_INFO", "SDP IP of orig UE $fU Call-ID $var(call_id_sdp_ip): $var(sdp_src_ip)\n");
|
||||
|
||||
$var(sdp_call_id_port) = $ci;
|
||||
# Store SDP Media Port in the hash table associated with the Call-Id
|
||||
$sht(user_sdps_port=>$var(sdp_call_id_port)) = $var(sdp_src_port);
|
||||
xlog("L_INFO", "SDP Port for MTC Call-ID $var(sdp_call_id_port) is: $var(sdp_src_port)\n");
|
||||
|
||||
$var(sdp_call_id_rtcp_port) = $ci;
|
||||
#Store SDP RTCP Port in the hash table associated with the Call-Id
|
||||
$sht(user_sdps_rtcp_port=>$var(sdp_call_id_rtcp_port)) = $var(orig_ue_sdp_rtcp_port);
|
||||
|
||||
$var(sdp_call_id_rtcp_port) = $ci;
|
||||
$var(orig_ue_sdp_rtcp_port) = $sht(user_sdps_rtcp_port=>$var(sdp_call_id_rtcp_port));
|
||||
xlog("L_INFO", "SDP RTCP Port for UE with MSISDN $fU is: $var(orig_ue_sdp_rtcp_port)\n");
|
||||
|
||||
xlog("L_INFO", "Preparing QoS N5 Message to PCF for INVITE To term UE\n");
|
||||
|
||||
$var(events) = '[]';
|
||||
$var(medComponents) = '{}';
|
||||
$var(medSubComps) = '{}';
|
||||
$var(evSubsc) = '{}';
|
||||
$var(payload) = '{}';
|
||||
|
||||
# Set afAppId and dnn in payload
|
||||
# TODO: Get the value from SIP Header
|
||||
jansson_set("string", "afAppId", "+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"", "$var(payload)");
|
||||
jansson_set("string", "dnn", "ims", "$var(payload)");
|
||||
|
||||
# Set medComponents
|
||||
jansson_set("integer", "medCompN", 1, "$var(medComp)");
|
||||
jansson_set("string", "qosReference", "qosVoNR", "$var(medComp)");
|
||||
jansson_set("string", "medType", "AUDIO", "$var(medComp)");
|
||||
jansson_set("array", "codecs", "[\"downlink\\noffer\\n\", \"uplink\\nanswer\\n\"]", "$var(medComp)");
|
||||
|
||||
# RTP
|
||||
jansson_set("integer", "fNum", 1, "$var(medSubComp1)");
|
||||
jansson_set("array", "fDescs", "[\"permit out 17 from $var(sdp_src_ip) $var(sdp_src_port) to $dd 49000-51000\", \"permit in 17 from $dd 49000-51000 to $var(sdp_src_ip) $var(sdp_src_port)\"]", "$var(medSubComp1)");
|
||||
jansson_set("string", "fStatus", "ENABLED", "$var(medSubComp1)");
|
||||
jansson_set("string", "marBwDl", "5000 Kbps", "$var(medSubComp1)");
|
||||
jansson_set("string", "marBwUl", "3000 Kbps", "$var(medSubComp1)");
|
||||
jansson_set("string", "flowUsage", "NO_INFO", "$var(medSubComp1)");
|
||||
|
||||
# RTCP
|
||||
jansson_set("integer", "fNum", 2, "$var(medSubComp2)");
|
||||
jansson_set("array", "fDescs", "[\"permit out 17 from $var(sdp_src_ip) $var(orig_ue_sdp_rtcp_port) to $dd 49000-51000\", \"permit in 17 from $dd 49000-51000 to $var(sdp_src_ip) $var(orig_ue_sdp_rtcp_port)\"]", "$var(medSubComp2)");
|
||||
jansson_set("string", "fStatus", "ENABLED", "$var(medSubComp2)");
|
||||
jansson_set("string", "marBwDl", "5000 Kbps", "$var(medSubComp2)");
|
||||
jansson_set("string", "marBwUl", "3000 Kbps", "$var(medSubComp2)");
|
||||
jansson_set("string", "flowUsage", "RTCP", "$var(medSubComp2)");
|
||||
|
||||
# Merging the flows under MediaSubComponent
|
||||
jansson_set("obj", "0", "$var(medSubComp1)", "$var(medSubComps)");
|
||||
jansson_set("obj", "1", "$var(medSubComp2)", "$var(medSubComps)");
|
||||
jansson_set("obj", "medSubComps", "$var(medSubComps)", "$var(medComp)");
|
||||
|
||||
jansson_set("obj", "0", "$var(medComp)", "$var(medComponents)");
|
||||
jansson_set("obj", "medComponents", "$var(medComponents)", "$var(payload)");
|
||||
|
||||
xlog("L_INFO","DEBUG: Set evSubsc\n");
|
||||
|
||||
# Set evSubsc
|
||||
jansson_set("string", "event", "QOS_NOTIF", "$var(event1)");
|
||||
jansson_set("string", "notifMethod", "PERIODIC", "$var(event1)");
|
||||
jansson_append("obj", "", "$var(event1)", "$var(events)");
|
||||
jansson_set("string", "event", "ANI_REPORT", "$var(event2)");
|
||||
jansson_set("string", "notifMethod", "ONE_TIME", "$var(event2)");
|
||||
jansson_append("obj", "", "$var(event2)", "$var(events)");
|
||||
jansson_set("array", "events", "$var(events)", "$var(evSubsc)");
|
||||
|
||||
jansson_set("obj", "evSubsc", "$var(evSubsc)", "$var(payload)");
|
||||
|
||||
# Set other parameters in payload
|
||||
jansson_set("string", "notifUri", "http://172.22.0.21:7777", "$var(payload)");
|
||||
jansson_set("string", "sponStatus", "SPONSOR_DISABLED", "$var(payload)");
|
||||
jansson_set("string", "gpsi", "msisdn-$tU", "$var(payload)");
|
||||
jansson_set("string", "suppFeat", "2", "$var(payload)");
|
||||
jansson_set("string", "ueIpv4", "$dd", "$var(payload)");
|
||||
|
||||
# Assemble the final JSON request
|
||||
jansson_set("obj", "ascReqData", "$var(payload)", "$var(json_request)");
|
||||
|
||||
xlog("L_INFO","DEBUG: Set headers for the HTTP2 Request\n");
|
||||
# Set headers
|
||||
$var(time_now)=$_s($timef(%a, %d %b %Y %H:%M:%S %Z));
|
||||
xlog("L_INFO", "Today is $var(time_now)\n");
|
||||
|
||||
$var(headers) = "Content-Type: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/problem+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
xlog("L_INFO","Sending the request to PCF\n");
|
||||
# Send the request to PCF
|
||||
http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions", "$var(json_request)", "$var(headers)", "$var(result)" );
|
||||
|
||||
switch ($rc) {
|
||||
# Success case
|
||||
case 201:
|
||||
xlog("L_INFO", "N5 QoS Session successfully Created $rc\n");
|
||||
xlog("L_INFO", "HTTP results: $var(result)\n");
|
||||
xlog("L_INFO", "HTTP response: $rc\n");
|
||||
xlog("L_INFO", "Location Header: $httprhdr(location)\n");
|
||||
|
||||
# Retrieve the AppSession Id out of the location header in response
|
||||
# Example URL: "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/(someSessionID)"
|
||||
|
||||
# Store the url of the lcoation Header in var
|
||||
$var(url) = $httprhdr(location);
|
||||
# Get the length of the URL
|
||||
$var(len) = $(var(url){s.len});
|
||||
# Initialize the position variable to the length of the URL
|
||||
$var(pos) = $var(len);
|
||||
|
||||
# Find the position of the last slash by iterating backwards
|
||||
while ($var(pos) > 0) {
|
||||
$var(pos) = $var(pos) - 1;
|
||||
if ($(var(url){s.substr,$var(pos),1}) == "/") {
|
||||
# We've found the last slash
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
# Extract the substring after the last slash
|
||||
# Set the starting position after the last slash
|
||||
$var(start_pos) = $var(pos) + 1;
|
||||
# Calculate the length of the substring after the last slash
|
||||
$var(substring_length) = $var(len) - $var(start_pos);
|
||||
# Extract the substring after the last slash
|
||||
$var(mtc_app_session) = $(var(url){s.substr,$var(start_pos),$var(substring_length)});
|
||||
|
||||
xlog("L_INFO", "AppSession Id for user $tU is: $var(mtc_app_session)\n");
|
||||
|
||||
$var(term_user_id) = $tU;
|
||||
|
||||
# Store the AppSession Id in the hash table associated with the UE
|
||||
$sht(user_data=>$var(term_user_id)) = $var(mtc_app_session);
|
||||
xlog("L_INFO", "Stored AppSession for user $var(term_user_id): $var(mtc_app_session)\n");
|
||||
break;
|
||||
default:
|
||||
xlog("L_ERR", "N5 QoS Session faild - Reason code: $rc\n");
|
||||
send_reply("412", "MTC N5 QoS Session Creation faild");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
# 5G VoNR N5 Policy Authorization PATCH request
|
||||
route[N5_PATCH_MT_REQ] {
|
||||
xlog("L_INFO", "N5_PATCH_MT_REQ, building N5 PATCH Request\n");
|
||||
|
||||
# Retrieve SDP Connection Info and Media Port for UE
|
||||
$var(sdp_call_id) = $ci;
|
||||
$var(orig_ue_sdp_ip) = $sht(user_sdps_ip=>$var(sdp_call_id));
|
||||
xlog("L_INFO", "SDP IP for UE with MSISDN $fU Call-ID $var(sdp_call_id) is: $var(orig_ue_sdp_ip)\n");
|
||||
|
||||
$var(sdp_call_id_port) = $ci;
|
||||
$var(orig_ue_sdp_port) = $sht(user_sdps_port=>$var(sdp_call_id_port));
|
||||
xlog("L_INFO", "SDP RTP Port for UE with MSISDN $fU Call-ID $var(sdp_call_id_port) is: $var(orig_ue_sdp_port)\n");
|
||||
|
||||
$var(sdp_call_id_rtcp_port) = $ci;
|
||||
$var(orig_ue_sdp_rtcp_port) = $sht(user_sdps_rtcp_port=>$var(sdp_call_id_rtcp_port));
|
||||
xlog("L_INFO", "SDP RTCP Port for UE with MSISDN $fU Call-ID $var(sdp_call_id_rtcp_port) is: $var(orig_ue_sdp_rtcp_port)\n");
|
||||
|
||||
# Retrieve SDP Connection Info from SDP Answer
|
||||
$var(sdp_answ_ip) = $sdp(c:ip);
|
||||
$var(sdp_answ_port) = $sdp(m0:rtp:port);
|
||||
$var(sdp_answ_rtcp_port) = $sdp(m0:rtcp:port);
|
||||
$var(sdp_answ_codec) = $(rb{line.sw,a=rtpmap}{s.select,1, });
|
||||
xlog("L_INFO", "SDP Answer connection Info is: $var(sdp_answ_ip), RTP port $var(sdp_answ_port), RTCP Port $var(sdp_answ_rtcp_port) and codec is $var(sdp_answ_codec)\n");
|
||||
|
||||
# Retrieve AppSession
|
||||
$var(mtc_resp_app_id) = $tU;
|
||||
$var(user_appsess_mtc_rep) = $sht(user_data=>$var(mtc_resp_app_id));
|
||||
xlog("L_INFO", "Stored MTC AppSession for user $var(mtc_resp_app_id): $var(user_appsess_mtc_rep)\n");
|
||||
|
||||
xlog("L_INFO","Preparing PATCH N5 Message for SDP Answer\n");
|
||||
|
||||
$var(events) = '[]';
|
||||
$var(medComponents) = '{}';
|
||||
$var(medSubComps) = '{}';
|
||||
$var(evSubsc) = '{}';
|
||||
$var(payload) = '{}';
|
||||
|
||||
# Set afAppId and dnn in payload
|
||||
jansson_set("string", "afAppId", "+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"", "$var(payload)");
|
||||
jansson_set("string", "dnn", "ims", "$var(payload)");
|
||||
|
||||
# Set medComponents
|
||||
jansson_set("integer", "medCompN", 1, "$var(medComp)");
|
||||
jansson_set("string", "qosReference", "qosVoNR", "$var(medComp)");
|
||||
jansson_set("string", "medType", "AUDIO", "$var(medComp)");
|
||||
jansson_set("array", "codecs", "[\"downlink\\n$var(sdp_answ_codec)\\n\", \"uplink\\n$var(sdp_answ_codec)\\n\"]", "$var(medComp)");
|
||||
|
||||
# RTP
|
||||
jansson_set("integer", "fNum", 1, "$var(medSubComp1)");
|
||||
jansson_set("array", "fDescs", "[\"permit out 17 from $var(orig_ue_sdp_ip) $var(orig_ue_sdp_port) to $var(sdp_answ_ip) $var(sdp_answ_port)\", \"permit in 17 from $var(sdp_answ_ip) $var(sdp_answ_port) to $var(orig_ue_sdp_ip) $var(orig_ue_sdp_port)\"]", "$var(medSubComp1)");
|
||||
jansson_set("string", "fStatus", "ENABLED", "$var(medSubComp1)");
|
||||
jansson_set("string", "marBwDl", "5000 Kbps", "$var(medSubComp1)");
|
||||
jansson_set("string", "marBwUl", "3000 Kbps", "$var(medSubComp1)");
|
||||
jansson_set("string", "flowUsage", "NO_INFO", "$var(medSubComp1)");
|
||||
|
||||
# RTCP
|
||||
jansson_set("integer", "fNum", 2, "$var(medSubComp2)");
|
||||
jansson_set("array", "fDescs", "[\"permit out 17 from $var(orig_ue_sdp_ip) $var(orig_ue_sdp_rtcp_port) to $var(sdp_answ_ip) $var(sdp_answ_rtcp_port)\", \"permit in 17 from $var(sdp_answ_ip) $var(sdp_answ_rtcp_port) to $var(orig_ue_sdp_ip) $var(orig_ue_sdp_rtcp_port)\"]", "$var(medSubComp2)");
|
||||
jansson_set("string", "fStatus", "ENABLED", "$var(medSubComp2)");
|
||||
jansson_set("string", "marBwDl", "6000 Kbps", "$var(medSubComp2)");
|
||||
jansson_set("string", "marBwUl", "5000 Kbps", "$var(medSubComp2)");
|
||||
jansson_set("string", "flowUsage", "RTCP", "$var(medSubComp2)");
|
||||
|
||||
# Merging the flows under MediaSubComponent
|
||||
jansson_set("obj", "0", "$var(medSubComp1)", "$var(medSubComps)");
|
||||
jansson_set("obj", "1", "$var(medSubComp2)", "$var(medSubComps)");
|
||||
jansson_set("obj", "medSubComps", "$var(medSubComps)", "$var(medComp)");
|
||||
|
||||
jansson_set("obj", "0", "$var(medComp)", "$var(medComponents)");
|
||||
jansson_set("obj", "medComponents", "$var(medComponents)", "$var(payload)");
|
||||
|
||||
xlog("L_INFO","DEBUG: Set evSubsc\n");
|
||||
|
||||
# Set evSubsc
|
||||
jansson_set("string", "event", "QOS_NOTIF", "$var(event1)");
|
||||
jansson_set("string", "notifMethod", "PERIODIC", "$var(event1)");
|
||||
jansson_append("obj", "", "$var(event1)", "$var(events)");
|
||||
jansson_set("string", "event", "ANI_REPORT", "$var(event2)");
|
||||
jansson_set("string", "notifMethod", "ONE_TIME", "$var(event2)");
|
||||
jansson_append("obj", "", "$var(event2)", "$var(events)");
|
||||
jansson_set("array", "events", "$var(events)", "$var(evSubsc)");
|
||||
|
||||
jansson_set("obj", "evSubsc", "$var(evSubsc)", "$var(payload)");
|
||||
|
||||
# Set other parameters in payload
|
||||
jansson_set("string", "notifUri", "http://172.22.0.21:7777", "$var(payload)");
|
||||
jansson_set("string", "sponStatus", "SPONSOR_DISABLED", "$var(payload)");
|
||||
jansson_set("string", "gpsi", "msisdn-$tU", "$var(payload)");
|
||||
jansson_set("string", "suppFeat", "2", "$var(payload)");
|
||||
jansson_set("string", "ueIpv4", "$si", "$var(payload)");
|
||||
|
||||
# Assemble the final JSON request
|
||||
jansson_set("obj", "ascReqData", "$var(payload)", "$var(json_request)");
|
||||
|
||||
xlog("L_INFO","DEBUG: Set headers for the HTTP2 Request\n");
|
||||
# Set headers
|
||||
$var(time_now)=$_s($timef(%a, %d %b %Y %H:%M:%S %Z));
|
||||
xlog("L_INFO", "Today is $var(time_now)\n");
|
||||
|
||||
# Set Content-type to application/merge-patch+json for compatibility with RFC7386 for JSON PATCH/Merge
|
||||
$var(headers) = "Content-Type: application/merge-patch+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/problem+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
xlog("L_INFO","Sending the request to PCF\n");
|
||||
# Send the request to PCF
|
||||
http_client_request_v2pk("PATCH", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/$var(user_appsess_mtc_rep)", "$var(json_request)", "$var(headers)", "$var(result)" );
|
||||
switch ($rc) {
|
||||
case 200:
|
||||
xlog("L_INFO", "N5 QoS Session modification success - reason code: $rc\n");
|
||||
xlog("L_INFO", "HTTP results: $var(result)\n");
|
||||
xlog("L_INFO", "HTTP response: $rc\n");
|
||||
xlog("L_INFO", "cURL Response: $curlerror(error)\n");
|
||||
xlog("L_INFO", "Location Header header: $httprhdr(location)\n");
|
||||
break;
|
||||
default:
|
||||
xlog("L_ERR", "N5 QoS Session modification faild - reason code: $rc\n");
|
||||
send_reply("412", "MTC N5 QoS Session modify faild");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
route[N5_MTC_TERM] {
|
||||
xlog("L_ALERT","Terminating AppSession For Call for User $tU due to call END\n");
|
||||
# Retrieve appSession based on To URI
|
||||
$var(mtc_resp_app_id) = $tU;
|
||||
$var(user_appsess_mtc_rep) = $sht(user_data=>$var(mtc_resp_app_id));
|
||||
if $var(user_appsess_mtc_rep) == 0 {
|
||||
xlog("L_INFO", "No AppSession Id found to terminate. Trying using From URI\n");
|
||||
|
||||
# Retrieve appSession based on From URI
|
||||
$var(mtc_resp_app_id) = $fU;
|
||||
$var(user_appsess_mtc_rep) = $sht(user_data=>$var(mtc_resp_app_id));
|
||||
xlog("L_INFO", "Alt-Method : Terminating Stored AppSession for user $var(mtc_resp_app_id): $var(user_appsess_mtc_rep)\n");
|
||||
} else {
|
||||
xlog("L_INFO", "Normal Method : MTC AppSession for user $var(mtc_resp_app_id): $var(user_appsess_mtc_rep)\n");
|
||||
}
|
||||
|
||||
$var(headers) = "X-SIP-Status: De-Registration\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/problem+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/$var(user_appsess_mtc_rep)/delete", "$var(json_request)", "$var(headers)", "$var(result)" );
|
||||
xlog("L_INFO", "cURL header: $curlerror(error)\n");
|
||||
xlog("L_INFO", "HTTP response: $rc\n");
|
||||
}
|
||||
#!endif
|
||||
|
@@ -3,9 +3,9 @@
|
||||
######################################################################
|
||||
route[REGISTER] {
|
||||
# Provide some statistics
|
||||
if ($sht(a=>$ci::start_time) == $null || $sht(a=>$ci::start_time) == 0) {
|
||||
$sht(a=>$ci::start_time) = $TV(Sn);
|
||||
}
|
||||
if ($sht(a=>$ci::start_time) == $null || $sht(a=>$ci::start_time) == 0) {
|
||||
$sht(a=>$ci::start_time) = $TV(Sn);
|
||||
}
|
||||
xnotice("PCSCF REGISTER: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
@@ -21,10 +21,18 @@ route[REGISTER] {
|
||||
exit;
|
||||
}
|
||||
|
||||
#!ifdef WITH_IPSEC
|
||||
$sht(ipsec_clients=>$(ct{nameaddr.uri})) = $null;
|
||||
if ($hdr(Security-Client) =~ ".*ipsec-3gpp.*") {
|
||||
$sht(ipsec_clients=>$(ct{nameaddr.uri})) = 1;
|
||||
#!ifdef WITH_N5
|
||||
$var(reg_exp) = $expires(min);
|
||||
xlog("L_INFO","Expire for $fu is :$var(reg_exp)\n");
|
||||
|
||||
# Trying a dirty workaround to make it only excute after IPSec tunnel to prevent double excution
|
||||
if ($expires(min) != 0 && is_present_hf("Security-Verify")) {
|
||||
route(REGISTER_N5_REQ);
|
||||
}
|
||||
|
||||
if ($expires(min) == 0) {
|
||||
xlog("L_ALERT","Delete N5 Session for $fu due to de-register\n");
|
||||
route(REG_N5_TERMINATE);
|
||||
}
|
||||
#!endif
|
||||
|
||||
@@ -257,14 +265,20 @@ onreply_route[REGISTER_reply]
|
||||
update_stat("register_success", "+1");
|
||||
update_stat("register_time", "$var(stat_add)");
|
||||
#!ifdef WITH_IPSEC
|
||||
ipsec_forward("location");
|
||||
}
|
||||
sht_lock("ipsec_clients=>ipsec_clients_lock");
|
||||
if ($sht(ipsec_clients=>$T_req($si)) != $null) {
|
||||
# IPSec forward only if its an IPsec client
|
||||
ipsec_forward("location", IPSEC_FORWARD_FLAGS);
|
||||
}
|
||||
sht_unlock("ipsec_clients=>ipsec_clients_lock");
|
||||
}
|
||||
else {
|
||||
if (t_check_status("401")) {
|
||||
if($(T_req($hdr(Security-Client))) != $null && ipsec_create("location")!=1) {
|
||||
if($(T_req($hdr(Security-Client))) != $null && ipsec_create("location", IPSEC_DELETE_UNUSED_TUNNELS)!=1) {
|
||||
send_reply("503", "Service Unavailable (Create ipsec failed)");
|
||||
}
|
||||
if ($sht(ipsec_clients=>$(T_req($ct){nameaddr.uri})) != $null) {
|
||||
sht_lock("ipsec_clients=>ipsec_clients_lock");
|
||||
if ($sht(ipsec_clients=>$T_req($si)) != $null) {
|
||||
$var(sec_client) = $(T_req($hdr(Security-Client)));
|
||||
xnotice("Security-Client=$var(sec_client)\n");
|
||||
$var(sc_port_c) = $(var(sec_client){re.subst,/.*port-c=([0-9]*).*$/\1/s});
|
||||
@@ -272,6 +286,7 @@ onreply_route[REGISTER_reply]
|
||||
$var(sc_port_s) = $(var(sec_client){re.subst,/.*port-s=([0-9]*).*$/\1/s});
|
||||
xnotice("port-s=$var(sc_port_s)\n");
|
||||
}
|
||||
sht_unlock("ipsec_clients=>ipsec_clients_lock");
|
||||
xnotice("Expires=$(T_req($expires(min)))\n");
|
||||
if (is_present_hf("WWW-Authenticate")) {
|
||||
# Remove ck and ik:
|
||||
@@ -284,9 +299,9 @@ onreply_route[REGISTER_reply]
|
||||
}
|
||||
xnotice("New header - WWW-Authenticate=$var(new_hdr)\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
#!endif
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -294,6 +309,14 @@ onreply_route[REGISTER_reply]
|
||||
######################################################################
|
||||
failure_route[REGISTER_failure]
|
||||
{
|
||||
|
||||
#!ifdef WITH_N5
|
||||
# Terminate N5 Session on Reg Failure
|
||||
if (t_check_status("403|408|[5-6][0-9][0-9]")) {
|
||||
route(REG_N5_TERMINATE);
|
||||
}
|
||||
#!endif
|
||||
|
||||
#!ifdef WITH_IPBLOCK
|
||||
if (t_check_status("403|[5-6][0-9][0-9]")) {
|
||||
if ($sht(failedauth=>$si) != $null)
|
||||
@@ -305,12 +328,161 @@ failure_route[REGISTER_failure]
|
||||
xlog("Blocking traffic from $si\n");
|
||||
$sht(ipban=>$si) = 1;
|
||||
}
|
||||
update_stat("register_failed", "+1");
|
||||
update_stat("register_failed", "+1");
|
||||
}
|
||||
#!endif
|
||||
if (t_check_status("408")) {
|
||||
send_reply("504","Server Time-Out");
|
||||
update_stat("register_failed", "+1");
|
||||
update_stat("register_failed", "+1");
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#!ifdef WITH_N5
|
||||
|
||||
# N5 Policy Authorization - Create Application session context for SIP Registration
|
||||
route[REGISTER_N5_REQ]
|
||||
{
|
||||
xlog("L_INFO","SIP Registration - Starting N5 QoS Auth for $fu\n");
|
||||
|
||||
$var(events) = '[]';
|
||||
$var(medComponents) = '{}';
|
||||
$var(medSubComps) = '{}';
|
||||
$var(evSubsc) = '{}';
|
||||
$var(payload) = '{}';
|
||||
|
||||
# Set afAppId and dnn in payload
|
||||
jansson_set("string", "afAppId", "+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"", "$var(payload)"); # adding a note that this could be improved in future to get the value SIP Header
|
||||
jansson_set("string", "dnn", "ims", "$var(payload)");
|
||||
|
||||
# Set media components in payload
|
||||
jansson_set("integer", "medCompN", 0, "$var(medComp)");
|
||||
jansson_set("string", "qosReference", "qosVoNR", "$var(medComp)");
|
||||
jansson_set("string", "medType", "CONTROL", "$var(medComp)");
|
||||
|
||||
jansson_set("integer", "fNum", 0, "$var(medSubComp)");
|
||||
jansson_set("array", "fDescs", "[\"permit out ip from $RAi $RAp to $si $sp\", \"permit in ip from $si $sp to $RAi $RAp\"]", "$var(medSubComp)");
|
||||
jansson_set("string", "fStatus", "ENABLED", "$var(medSubComp)");
|
||||
jansson_set("string", "flowUsage", "AF_SIGNALLING", "$var(medSubComp)");
|
||||
# jansson_set("string", "marBwDl", "5000 Kbps", "$var(medSubComp)");
|
||||
# jansson_set("string", "marBwUl", "3000 Kbps", "$var(medSubComp)");
|
||||
jansson_set("obj", "0", "$var(medSubComp)", "$var(medSubComps)");
|
||||
jansson_set("obj", "medSubComps", "$var(medSubComps)", "$var(medComp)");
|
||||
|
||||
jansson_set("obj", "0", "$var(medComp)", "$var(medComponents)");
|
||||
jansson_set("obj", "medComponents", "$var(medComponents)", "$var(payload)");
|
||||
|
||||
# Set evSubsc
|
||||
jansson_set("string", "event", "QOS_NOTIF", "$var(event1)");
|
||||
jansson_set("string", "notifMethod", "PERIODIC", "$var(event1)");
|
||||
jansson_append("obj", "", "$var(event1)", "$var(events)");
|
||||
jansson_set("string", "event", "ANI_REPORT", "$var(event2)");
|
||||
jansson_set("string", "notifMethod", "ONE_TIME", "$var(event2)");
|
||||
jansson_append("obj", "", "$var(event2)", "$var(events)");
|
||||
jansson_set("array", "events", "$var(events)", "$var(evSubsc)");
|
||||
|
||||
jansson_set("obj", "evSubsc", "$var(evSubsc)", "$var(payload)");
|
||||
|
||||
# Set other parameters in payload
|
||||
jansson_set("string", "notifUri", "http://172.22.0.21:7777", "$var(payload)");
|
||||
jansson_set("string", "sponStatus", "SPONSOR_DISABLED", "$var(payload)");
|
||||
jansson_set("string", "supi", "imsi-$au", "$var(payload)");
|
||||
jansson_set("string", "suppFeat", "2", "$var(payload)");
|
||||
jansson_set("string", "ueIpv4", "$si", "$var(payload)");
|
||||
|
||||
# Assemble the final JSON request
|
||||
jansson_set("obj", "ascReqData", "$var(payload)", "$var(json_request)");
|
||||
|
||||
# Set HTTP2 request headers
|
||||
$var(time_now)=$_s($timef(%a, %d %b %Y %H:%M:%S %Z));
|
||||
$var(headers) = "Content-Type: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/problem+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
xlog("L_INFO","SIP Registration. Sending N5 QoS Auth for $fu to PCF\n");
|
||||
# Send the request to PCF
|
||||
http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions", "$var(json_request)", "$var(headers)", "$var(result)" );
|
||||
|
||||
switch ($rc) {
|
||||
# Success case
|
||||
case 201:
|
||||
xlog("L_INFO", "N5 QoS Session successfully Created $rc\n");
|
||||
xlog("L_INFO", "HTTP results: $var(result)\n");
|
||||
xlog("L_INFO", "HTTP response: $rc\n");
|
||||
xlog("L_INFO", "Location Header: $httprhdr(location)\n");
|
||||
|
||||
# Retrieve the AppSession Id out of the location Header if the resopnse is 201.
|
||||
# Example URL: "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/(someSessionID)"
|
||||
|
||||
# Store the url of the location header
|
||||
$var(url) = $httprhdr(location);
|
||||
# Get the length of the URL
|
||||
$var(len) = $(var(url){s.len});
|
||||
# Initialize the position variable to the length of the URL
|
||||
$var(pos) = $var(len);
|
||||
|
||||
# Find the position of the last slash by iterating backwards
|
||||
while ($var(pos) > 0) {
|
||||
$var(pos) = $var(pos) - 1;
|
||||
if ($(var(url){s.substr,$var(pos),1}) == "/") {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
# Extract the substring after the last slash
|
||||
$var(start_pos) = $var(pos) + 1;
|
||||
$var(end_pos) = $var(len) - $var(start_pos);
|
||||
$var(app_session) = $(var(url){s.substr,$var(start_pos),$var(end_pos)});
|
||||
|
||||
xlog("L_INFO", "AppSession Id for user $au is: $var(app_session)\n");
|
||||
|
||||
$var(user_id) = $au;
|
||||
# Store the AppSession Id in the hash table associated with the UE
|
||||
$sht(user_data=>$var(user_id)) = $var(app_session);
|
||||
xlog("L_INFO", "Stored AppSession Id for user $var(user_id): $var(app_session)\n");
|
||||
|
||||
$var(ue_imsi) = $au;
|
||||
$var(ue_imsi_reg_ip) = $si;
|
||||
# Store the AppSession in the hash table associated with the UE
|
||||
$sht(user_ids=>$var(ue_imsi_reg_ip)) = $var(ue_imsi);
|
||||
xlog("L_INFO", "Stored IMSI for IP $var(ue_imsi_reg_ip) is: $var(ue_imsi)\n");
|
||||
break;
|
||||
# Failure case
|
||||
default:
|
||||
xlog("L_ERR", "N5 QoS Session authorization failed - Reason code: $rc\n");
|
||||
send_reply("412", "Register N5 QoS authorization failed");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
# N5 Policy Authorization - Application session termination for SIP De-registration
|
||||
route[REG_N5_TERMINATE]
|
||||
{
|
||||
xlog("L_ALERT","SIP De-Registration for $fu - Terminating N5 AppSession\n");
|
||||
# Retrieve the AppSession Id from the hash table
|
||||
$var(user_id_dereg) = $fU;
|
||||
$var(user_appsess_dereg) = $sht(user_data=>$var(user_id_dereg));
|
||||
xlog("L_INFO", "Terminating stored AppSession for user $var(user_id_dereg): $var(user_appsess_dereg)\n");
|
||||
|
||||
$var(headers) = "X-SIP-Status: De-Registration\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/problem+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/$var(user_appsess_dereg)/delete", "$var(json_request)", "$var(headers)", "$var(result)" );
|
||||
xlog("Termination resuls: $var(result)\n");
|
||||
xlog("L_ALERT", "cURL response: $curlerror(error)\n");
|
||||
xlog("L_INFO", "HTTP results: $var(result)\n");
|
||||
xlog("L_INFO", "HTTP response: $rc\n");
|
||||
xlog("L_INFO", "Location Header: $httprhdr(location)\n");
|
||||
}
|
||||
|
||||
#!endif
|
||||
|
@@ -130,6 +130,14 @@ route[NATMANAGE] {
|
||||
return;
|
||||
#!endif
|
||||
|
||||
# Fix for calling between UEs not supporting preconditioning
|
||||
if(sdp_get_line_startswith("$avp(mline)", "a=inactive")) {
|
||||
xlog("m-line: $avp(mline)\n");
|
||||
sdp_remove_line_by_prefix("a=inactive");
|
||||
$sdp(body) = $sdp(body) + "a=sendrecv\r\n";
|
||||
msg_apply_changes();
|
||||
}
|
||||
|
||||
if ((is_reply() && ($T_req($tt) != $null)) || (is_request() && has_totag())) {
|
||||
if (($fU != $null && is_in_profile("caller", "$fU")) ||
|
||||
($tU != $null && is_in_profile("callee", "$tU"))) {
|
||||
|
@@ -39,13 +39,22 @@ RUN apt-get update && \
|
||||
pkg-config \
|
||||
libsystemd-dev \
|
||||
libmysqlclient-dev \
|
||||
libsctp-dev \
|
||||
gcc \
|
||||
mysql-server
|
||||
|
||||
mysql-server \
|
||||
lsb-release \
|
||||
curl \
|
||||
gpg
|
||||
|
||||
|
||||
RUN curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg && \
|
||||
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends redis
|
||||
|
||||
# Get pyhss code and install
|
||||
RUN git clone https://github.com/nickvsnetworking/pyhss && \
|
||||
cd pyhss && git checkout fa059d56330f6e565a9b546d5a9ed4071c2c9ab6
|
||||
cd pyhss && git checkout tags/1.0.2
|
||||
RUN cd pyhss && pip3 install -r requirements.txt
|
||||
|
||||
RUN mkdir -p /pyhss/log/
|
||||
|
@@ -1,5 +1,7 @@
|
||||
## HSS Parameters
|
||||
hss:
|
||||
# Transport Type. "TCP" and "SCTP" are valid options.
|
||||
# Note: SCTP works but is still experimental. TCP has been load-tested and performs in a production environment.
|
||||
transport: "TCP"
|
||||
#IP Addresses to bind on (List) - For TCP only the first IP is used, for SCTP all used for Transport (Multihomed).
|
||||
bind_ip: ["PYHSS_IP"]
|
||||
@@ -30,17 +32,14 @@ hss:
|
||||
#IMSI of Test Subscriber for Unit Checks (Optional)
|
||||
test_sub_imsi: '001021234567890'
|
||||
|
||||
#Device Watchdog Request Interval (In Seconds - If set to 0 disabled)
|
||||
device_watchdog_request_interval: 5
|
||||
|
||||
#Async Queue Check Interval (In Seconds - If set to 0 disabled)
|
||||
async_check_interval: 0
|
||||
|
||||
#The maximum time to wait, in seconds, before disconnecting a client when no data is received.
|
||||
client_socket_timeout: 120
|
||||
|
||||
#The maximum amount of times a failed diameter response/query should be resent before considering the peer offline and terminating their connection
|
||||
diameter_max_retries: 1
|
||||
#The maximum time to wait, in seconds, before discarding a diameter request.
|
||||
diameter_request_timeout: 3
|
||||
|
||||
#The amount of time, in seconds, before purging a disconnected client from the Active Diameter Peers key in redis.
|
||||
active_diameter_peers_timeout: 10
|
||||
|
||||
#Prevent updates from being performed without a valid 'Provisioning-Key' in the header
|
||||
lock_provisioning: False
|
||||
@@ -56,34 +55,50 @@ hss:
|
||||
|
||||
#Default Initial Filter Criteria for IMS Subscribers
|
||||
#Jinja Formatted Template, see the example for variables passed to it.
|
||||
Default_iFC: 'default_ifc.xml'
|
||||
Default_iFC: 'INSTALL_PREFIX/default_ifc.xml'
|
||||
|
||||
#Default Sh User Data
|
||||
Default_Sh_UserData: 'default_sh_user_data.xml'
|
||||
Default_Sh_UserData: 'INSTALL_PREFIX/default_sh_user_data.xml'
|
||||
|
||||
#S-CSCF Pool
|
||||
scscf_pool:
|
||||
- 'sip:scscf.IMS_DOMAIN:6060'
|
||||
|
||||
roaming:
|
||||
outbound:
|
||||
# Whether or not to a subscriber to connect to an undefined network when outbound roaming.
|
||||
allow_undefined_networks: True
|
||||
|
||||
# SCTP Socket Parameters
|
||||
sctp:
|
||||
rtoMax: 5000
|
||||
rtoMin: 500
|
||||
rtoInitial: 1000
|
||||
|
||||
api:
|
||||
page_size: 200
|
||||
# Whether or not to return key-based data when querying the AUC. Disable in production systems.
|
||||
enable_insecure_auc: True
|
||||
|
||||
external:
|
||||
external_webhook_notification_enabled: False
|
||||
external_webhook_notification_url: https://api.example.com/webhook
|
||||
benchmarking:
|
||||
# Whether to enable benchmark logging
|
||||
enabled: True
|
||||
# How often to report, in seconds. Not all benchmarking supports interval reporting.
|
||||
reporting_interval: 3600
|
||||
|
||||
eir:
|
||||
imsi_imei_logging: True #Store current IMEI / IMSI pair in backend
|
||||
sim_swap_notify_webhook: http://PYHSS_IP:5000/webhooks/sim_swap_notify/
|
||||
no_match_response: 2 #Greylist
|
||||
tac_database_csv: '/etc/pyhss/tac_database_Nov2022.csv'
|
||||
store_offnet_imsi: False # Whether or not to store an IMEI / IMSI pair that doesn't exist in the AUC
|
||||
simSwapNotification: False # If the IMEI for a stored IMSI/IMEI combo changes, notify the webhook endpoint
|
||||
|
||||
logging:
|
||||
level: WARNING
|
||||
level: INFO
|
||||
logfiles:
|
||||
hss_logging_file: log/hss.log
|
||||
diameter_logging_file: log/diameter.log
|
||||
database_logging_file: log/db.log
|
||||
hss_logging_file: INSTALL_PREFIX/log/hss.log
|
||||
diameter_logging_file: INSTALL_PREFIX/log/diameter.log
|
||||
geored_logging_file: INSTALL_PREFIX/log/geored.log
|
||||
metric_logging_file: INSTALL_PREFIX/log/metrics.log
|
||||
log_to_terminal: True
|
||||
sqlalchemy_sql_echo: True
|
||||
sqlalchemy_pool_recycle: 15
|
||||
@@ -97,6 +112,14 @@ database:
|
||||
username: pyhss
|
||||
password: ims_db_pass
|
||||
database: ims_hss_db
|
||||
readCacheEnabled: True
|
||||
readCacheInterval: 60
|
||||
|
||||
## External Webhook Notifications
|
||||
webhooks:
|
||||
enabled: False
|
||||
endpoints:
|
||||
- 'http://127.0.0.1:8181'
|
||||
|
||||
## Geographic Redundancy Parameters
|
||||
geored:
|
||||
@@ -106,17 +129,22 @@ geored:
|
||||
- 'http://hss01.mnc001.mcc001.3gppnetwork.org:8080'
|
||||
- 'http://hss02.mnc001.mcc001.3gppnetwork.org:8080'
|
||||
|
||||
## Stats Parameters
|
||||
#Redis is required to run PyHSS. An instance running on a local network is recommended for production.
|
||||
redis:
|
||||
enabled: False
|
||||
clear_stats_on_boot: True
|
||||
host: PYHSS_IP
|
||||
# Which connection type to attempt. Valid options are: tcp, unix, sentinel
|
||||
# tcp - Connection via a standard TCP socket to a given host and port.
|
||||
# unix - Connect to redis via a unix socket, provided by unixSocketPath.
|
||||
# sentinel - Connect to one or more redis sentinel hosts.
|
||||
connectionType: "tcp"
|
||||
unixSocketPath: '/var/run/redis/redis-server.sock'
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
|
||||
prometheus:
|
||||
enabled: False
|
||||
port: 8081 #If the API is run the API runs on the next port number up from this
|
||||
async_subscriber_count: False #If enabled the subscriber count will be updated asynchronously for Prometheus
|
||||
|
||||
snmp:
|
||||
port: 1161
|
||||
listen_address: PYHSS_IP
|
||||
listen_address: 127.0.0.1
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--This is the default iFC template used by PyHSS, variables come from the Jinja2 template passed inside diameter.py where you can additional variables if required -->
|
||||
<Sh-Data>
|
||||
<IMSPrivateUserIdentity>{{ Sh_template_vars['imsi'] }}@ims.mnc{{ Sh_template_vars['mnc'] }}.mcc{{ Sh_template_vars['mcc'] }}.3gppnetwork.org</IMSPrivateUserIdentity>
|
||||
<!-- This provides the Public Identifiers to the Application Server -->
|
||||
<PublicIdentifiers>
|
||||
<IMSPublicIdentity>sip:{{ Sh_template_vars['msisdn'] }}@ims.mnc{{ Sh_template_vars['mnc'] }}.mcc{{ Sh_template_vars['mcc'] }}.3gppnetwork.org</IMSPublicIdentity>
|
||||
@@ -20,9 +21,9 @@
|
||||
</EPSLocationInformation>
|
||||
</Extension>
|
||||
|
||||
<!-- This container for the XCAP Data for the Subscriber -->
|
||||
<Sh-IMS-Data>
|
||||
<S-CSCFName>{{ Sh_template_vars['scscf'] }}</S-CSCFName>
|
||||
<IMSUserState>{{ Sh_template_vars['imsUserState'] }}</IMSUserState>
|
||||
</Sh-IMS-Data>
|
||||
|
||||
<!-- XCAP data from Database -->
|
||||
{{ Sh_template_vars['sh_profile'] }}
|
||||
|
||||
</Sh-Data>
|
||||
</Sh-Data>
|
||||
|
@@ -51,17 +51,26 @@ cp /mnt/pyhss/config.yaml ./
|
||||
cp /mnt/pyhss/default_ifc.xml ./
|
||||
cp /mnt/pyhss/default_sh_user_data.xml ./
|
||||
|
||||
INSTALL_PREFIX="/pyhss"
|
||||
|
||||
sed -i 's|PYHSS_IP|'$PYHSS_IP'|g' ./config.yaml
|
||||
sed -i 's|PYHSS_BIND_PORT|'$PYHSS_BIND_PORT'|g' ./config.yaml
|
||||
sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' ./config.yaml
|
||||
sed -i 's|OP_MCC|'$MCC'|g' ./config.yaml
|
||||
sed -i 's|OP_MNC|'$MNC'|g' ./config.yaml
|
||||
sed -i 's|MYSQL_IP|'$MYSQL_IP'|g' ./config.yaml
|
||||
sed -i 's|INSTALL_PREFIX|'$INSTALL_PREFIX'|g' ./config.yaml
|
||||
|
||||
# Sync docker time
|
||||
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
export FLASK_APP=PyHSS_API.py
|
||||
flask run --host=$PYHSS_IP --port=8080 &
|
||||
redis-server --daemonize yes
|
||||
|
||||
python3 hss.py
|
||||
cd services
|
||||
python3 apiService.py --host=$PYHSS_IP --port=8080 &
|
||||
# Sleep is needed to let db be populated in a non-overlapping fashion
|
||||
sleep 5
|
||||
python3 diameterService.py &
|
||||
# Sleep is needed to let db be populated in a non-overlapping fashion
|
||||
sleep 5
|
||||
python3 hssService.py
|
||||
|
@@ -31,9 +31,9 @@ services:
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
expose:
|
||||
- "3000/tcp"
|
||||
- "9999/tcp"
|
||||
ports:
|
||||
- "3000:3000/tcp"
|
||||
- "9999:9999/tcp"
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${WEBUI_IP}
|
||||
@@ -304,10 +304,31 @@ services:
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${METRICS_IP}
|
||||
grafana:
|
||||
build: ./grafana
|
||||
image: docker_grafana
|
||||
container_name: grafana
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- ./grafana:/mnt/grafana
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
expose:
|
||||
- "3000/tcp"
|
||||
ports:
|
||||
- "3000:3000/tcp"
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${GRAFANA_IP}
|
||||
networks:
|
||||
default:
|
||||
name: docker_open5gs_default
|
||||
ipam:
|
||||
config:
|
||||
- subnet: ${TEST_NETWORK}
|
||||
volumes:
|
||||
mongodbdata: {}
|
||||
grafana_data:
|
||||
name: grafana_data
|
||||
mongodbdata:
|
||||
name: docker_open5gs_mongodbdata
|
||||
|
@@ -31,9 +31,9 @@ services:
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
expose:
|
||||
- "3000/tcp"
|
||||
- "9999/tcp"
|
||||
ports:
|
||||
- "3000:3000/tcp"
|
||||
- "9999:9999/tcp"
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${WEBUI_IP}
|
||||
@@ -489,11 +489,33 @@ services:
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${SMSC_IP}
|
||||
grafana:
|
||||
build: ./grafana
|
||||
image: docker_grafana
|
||||
container_name: grafana
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- ./grafana:/mnt/grafana
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
expose:
|
||||
- "3000/tcp"
|
||||
ports:
|
||||
- "3000:3000/tcp"
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: ${GRAFANA_IP}
|
||||
networks:
|
||||
default:
|
||||
name: docker_open5gs_default
|
||||
ipam:
|
||||
config:
|
||||
- subnet: ${TEST_NETWORK}
|
||||
volumes:
|
||||
mongodbdata: {}
|
||||
dbdata: {}
|
||||
grafana_data:
|
||||
name: grafana_data
|
||||
mongodbdata:
|
||||
name: docker_open5gs_mongodbdata
|
||||
dbdata:
|
||||
name: docker_open5gs_dbdata
|
||||
|
22
scp/scp.yaml
22
scp/scp.yaml
@@ -1,5 +1,6 @@
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/scp.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/scp.log
|
||||
|
||||
sbi:
|
||||
server:
|
||||
@@ -7,16 +8,15 @@ sbi:
|
||||
client:
|
||||
no_tls: true
|
||||
|
||||
parameter:
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
scp:
|
||||
sbi:
|
||||
addr:
|
||||
- SCP_IP
|
||||
port: 7777
|
||||
|
||||
nrf:
|
||||
sbi:
|
||||
- addr:
|
||||
- NRF_IP
|
||||
port: 7777
|
||||
server:
|
||||
- address: SCP_IP
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://NRF_IP:7777
|
||||
|
@@ -29,6 +29,7 @@
|
||||
cp /mnt/scp/scp.yaml install/etc/open5gs
|
||||
sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/scp.yaml
|
||||
sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/scp.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/scp.yaml
|
||||
|
||||
# Sync docker time
|
||||
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
@@ -87,7 +87,7 @@ use_dns_cache=off
|
||||
#!ifdef WITH_TCP
|
||||
# life time of TCP connection when there is no traffic
|
||||
# - a bit higher than registration expires to cope with UA behind NAT
|
||||
tcp_connection_lifetime=3615
|
||||
tcp_connection_lifetime=UE_SUBSCRIPTION_EXPIRES
|
||||
#!ifdef TCP_PROCESSES
|
||||
tcp_children=TCP_PROCESSES
|
||||
#!endif
|
||||
@@ -222,10 +222,10 @@ modparam("rr", "custom_user_avp", "$avp(RR_CUSTOM_USER_AVP)")
|
||||
# -- usrloc params --
|
||||
modparam("ims_usrloc_scscf", "enable_debug_file", 0)
|
||||
modparam("ims_usrloc_scscf", "matching_mode", 0)
|
||||
modparam("ims_usrloc_scscf", "maxcontact", 5)
|
||||
modparam("ims_usrloc_scscf", "maxcontact_3gpp", 5)
|
||||
modparam("ims_usrloc_scscf", "maxcontact", 2)
|
||||
modparam("ims_usrloc_scscf", "maxcontact_3gpp", 2)
|
||||
modparam("ims_registrar_scscf", "max_contacts", 5)
|
||||
modparam("ims_usrloc_scscf", "maxcontact_behaviour", 2) #overwrite
|
||||
modparam("ims_usrloc_scscf", "maxcontact_behaviour", 2)
|
||||
#!ifdef DB_URL
|
||||
#!ifdef DB_URL2
|
||||
modparam("ims_usrloc_scscf", "db_url", "cluster://cluster1")
|
||||
@@ -234,9 +234,9 @@ modparam("ims_usrloc_scscf", "db_url", DB_URL)
|
||||
#!endif
|
||||
modparam("ims_usrloc_scscf", "db_mode", 0)
|
||||
#!endif
|
||||
modparam("ims_registrar_scscf", "subscription_default_expires", 654800)
|
||||
modparam("ims_registrar_scscf", "subscription_min_expires", 3700)
|
||||
modparam("ims_registrar_scscf", "subscription_max_expires", 605800)
|
||||
modparam("ims_registrar_scscf", "subscription_default_expires", UE_SUBSCRIPTION_EXPIRES)
|
||||
modparam("ims_registrar_scscf", "subscription_min_expires", UE_SUBSCRIPTION_EXPIRES)
|
||||
modparam("ims_registrar_scscf", "subscription_max_expires", UE_SUBSCRIPTION_EXPIRES)
|
||||
|
||||
# -- CDP params --
|
||||
modparam("cdp","config_file","/etc/kamailio_scscf/scscf.xml")
|
||||
@@ -287,10 +287,11 @@ modparam("ims_auth", "av_check_only_impu", 1)
|
||||
|
||||
modparam("ims_auth", "max_nonce_reuse", 20)
|
||||
modparam("ims_auth", "auth_vector_timeout", 60)
|
||||
modparam("ims_auth", "auth_data_timeout", 600000)
|
||||
modparam("ims_auth", "auth_used_vector_timeout", 600000)
|
||||
modparam("ims_auth", "auth_data_timeout", UE_SUBSCRIPTION_EXPIRES)
|
||||
modparam("ims_auth", "auth_used_vector_timeout", UE_SUBSCRIPTION_EXPIRES)
|
||||
modparam("ims_auth", "av_request_at_once", 1)
|
||||
modparam("ims_auth", "av_request_at_sync", 1)
|
||||
modparam("ims_auth", "registration_qop", "auth")
|
||||
|
||||
# -- ims_registrar_scscf params --
|
||||
#!ifdef WITH_DEBUG
|
||||
@@ -298,9 +299,9 @@ modparam("ims_registrar_scscf", "default_expires", 60)
|
||||
modparam("ims_registrar_scscf", "min_expires", 60)
|
||||
modparam("ims_registrar_scscf", "max_expires", 60)
|
||||
#!else
|
||||
modparam("ims_registrar_scscf", "default_expires", 604800)
|
||||
modparam("ims_registrar_scscf", "min_expires", 60)
|
||||
modparam("ims_registrar_scscf", "max_expires", 604800)
|
||||
modparam("ims_registrar_scscf", "default_expires", UE_SUBSCRIPTION_EXPIRES)
|
||||
modparam("ims_registrar_scscf", "min_expires", UE_SUBSCRIPTION_EXPIRES)
|
||||
modparam("ims_registrar_scscf", "max_expires", UE_SUBSCRIPTION_EXPIRES)
|
||||
#!endif
|
||||
modparam("ims_registrar_scscf", "use_path", 1)
|
||||
modparam("ims_registrar_scscf", "support_wildcardPSI",1)
|
||||
@@ -347,6 +348,7 @@ modparam("ims_charging", "ro_forced_peer", RO_FORCED_PEER);
|
||||
#!endif
|
||||
modparam("ims_charging", "destination_host", RO_DESTINATION);
|
||||
modparam("ims_charging", "destination_realm", NETWORKNAME);
|
||||
modparam("ims_charging", "ro_auth_expiry", UE_SUBSCRIPTION_EXPIRES)
|
||||
|
||||
modparam("ims_charging","service_context_id_root", RO_ROOT);
|
||||
modparam("ims_charging","service_context_id_ext", RO_EXT);
|
||||
@@ -454,10 +456,12 @@ route {
|
||||
if (!is_method("REGISTER|SUBSCRIBE")) {
|
||||
# sip:xxx;phone-context=xxxx@xxx format is not desired
|
||||
if (($ru =~ ".*phone-context.*") && ($ru =~ "sip:.*")) {
|
||||
$var(old_ruri) = $ru;
|
||||
$ru = $(ru{re.subst,/sip:/tel:/g});
|
||||
$ru = $(ru{re.subst,/;phone-context=[A-Za-z.0-9+-@]*;user=phone//g});
|
||||
$ru = $ru + ";phone-context=" + NETWORKNAME;
|
||||
msg_apply_changes();
|
||||
xnotice("SCSCF: Changed R-URI from $var(old_ruri) to $ru\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -723,7 +727,7 @@ route[XMLRPC] {
|
||||
# Route for handling Registrations:
|
||||
######################################################################
|
||||
route[REGISTER] {
|
||||
xlog("ALGORITHM IS [$aa] and User-Agent is [$ua]\n");
|
||||
xnotice("ALGORITHM IS [$aa] and User-Agent is [$ua]\n");
|
||||
$var(alg) = $aa;
|
||||
if ($aa == $null) {
|
||||
$var(alg) = "MD5"; #force to MD5 for zoiper.... non-ims
|
||||
@@ -1168,7 +1172,7 @@ route[PSTN_handling]
|
||||
# $ru: tel:+(34)-999-888-777
|
||||
# $fu: sip:test@foo.com
|
||||
# becomes $ru: sip:+34999888777@foo.com;user=phone
|
||||
if (tel2sip("$ru", "$fd", "$ru") < 0)
|
||||
if (tel2sip2("$ru", "$fd", "$ru") < 0)
|
||||
xlog("L_WARN","Failed to convert $ru to a sip:-URI - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n\n");
|
||||
|
||||
if ($rU =~ "\+[0-9]+") {
|
||||
|
@@ -42,6 +42,9 @@ alias=scscf.IMS_DOMAIN
|
||||
# Number of TCP Processes
|
||||
#!define TCP_PROCESSES 3
|
||||
|
||||
# Maximum lifetime of a subscription in seconds (same is advertised to UE)
|
||||
#!substdef "/UE_SUBSCRIPTION_EXPIRES/SUBSCRIPTION_EXPIRES_ENV/g"
|
||||
|
||||
##!define RO_FORCED_PEER "32260@3gpp.org"
|
||||
#!define RO_DESTINATION "hssocs.voiceblue.com"
|
||||
#!define RO_ROOT "32260@3gpp.org"
|
||||
|
@@ -11,8 +11,8 @@
|
||||
QueueLength="32"
|
||||
TransactionTimeout="5"
|
||||
SessionsHashSize="128"
|
||||
DefaultAuthSessionTimeout="3600"
|
||||
MaxAuthSessionTimeout="3600"
|
||||
DefaultAuthSessionTimeout="SUBSCRIPTION_EXPIRES_ENV"
|
||||
MaxAuthSessionTimeout="SUBSCRIPTION_EXPIRES_ENV"
|
||||
>
|
||||
<Peer FQDN="hss.IMS_DOMAIN" Realm="IMS_DOMAIN" port="PYHSS_BIND_PORT"/>
|
||||
|
||||
|
@@ -66,12 +66,16 @@ fi
|
||||
|
||||
export IMS_SLASH_DOMAIN=`echo $IMS_DOMAIN | sed 's/\./\\\./g'`
|
||||
|
||||
SUBSCRIPTION_EXPIRES_ENV=3600
|
||||
|
||||
sed -i 's|SCSCF_IP|'$SCSCF_IP'|g' /etc/kamailio_scscf/scscf.cfg
|
||||
sed -i 's|SUBSCRIPTION_EXPIRES_ENV|'$SUBSCRIPTION_EXPIRES_ENV'|g' /etc/kamailio_scscf/scscf.cfg
|
||||
sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/kamailio_scscf/scscf.cfg
|
||||
sed -i 's|IMS_SLASH_DOMAIN|'$IMS_SLASH_DOMAIN'|g' /etc/kamailio_scscf/scscf.cfg
|
||||
sed -i 's|MYSQL_IP|'$MYSQL_IP'|g' /etc/kamailio_scscf/scscf.cfg
|
||||
|
||||
sed -i 's|SCSCF_IP|'$SCSCF_IP'|g' /etc/kamailio_scscf/scscf.xml
|
||||
sed -i 's|SUBSCRIPTION_EXPIRES_ENV|'$SUBSCRIPTION_EXPIRES_ENV'|g' /etc/kamailio_scscf/scscf.xml
|
||||
sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/kamailio_scscf/scscf.xml
|
||||
sed -i 's|PYHSS_BIND_PORT|'$PYHSS_BIND_PORT'|g' /etc/kamailio_scscf/scscf.xml
|
||||
sed -i 's|SCSCF_BIND_PORT|'$SCSCF_BIND_PORT'|g' /etc/kamailio_scscf/scscf.xml
|
||||
|
@@ -1,14 +1,18 @@
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/sgwc.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/sgwc.log
|
||||
|
||||
parameter:
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
sgwc:
|
||||
gtpc:
|
||||
- addr: SGWC_IP
|
||||
server:
|
||||
- address: SGWC_IP
|
||||
pfcp:
|
||||
- addr: SGWC_IP
|
||||
|
||||
sgwu:
|
||||
pfcp:
|
||||
- addr: SGWU_IP
|
||||
server:
|
||||
- address: SGWC_IP
|
||||
client:
|
||||
sgwu:
|
||||
- address: SGWU_IP
|
||||
|
@@ -31,6 +31,7 @@ export IF_NAME=$(ip r | awk '/default/ { print $5 }')
|
||||
cp /mnt/sgwc/sgwc.yaml install/etc/open5gs
|
||||
sed -i 's|SGWC_IP|'$SGWC_IP'|g' install/etc/open5gs/sgwc.yaml
|
||||
sed -i 's|SGWU_IP|'$SGWU_IP'|g' install/etc/open5gs/sgwc.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/sgwc.yaml
|
||||
|
||||
# Sync docker time
|
||||
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
@@ -1,15 +1,20 @@
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/sgwu.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/sgwu.log
|
||||
|
||||
parameter:
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
sgwu:
|
||||
gtpu:
|
||||
- addr: SGWU_IP
|
||||
advertise: SGWU_ADVERTISE_IP
|
||||
server:
|
||||
- address: SGWU_IP
|
||||
advertise: SGWU_ADVERTISE_IP
|
||||
pfcp:
|
||||
- addr: SGWU_IP
|
||||
server:
|
||||
- address: SGWU_IP
|
||||
client:
|
||||
sgwc:
|
||||
- address: SGWC_IP
|
||||
|
||||
sgwc:
|
||||
pfcp:
|
||||
- addr: SGWC_IP
|
||||
|
@@ -32,6 +32,7 @@ cp /mnt/sgwu/sgwu.yaml install/etc/open5gs
|
||||
sed -i 's|SGWU_IP|'$SGWU_IP'|g' install/etc/open5gs/sgwu.yaml
|
||||
sed -i 's|SGWC_IP|'$SGWC_IP'|g' install/etc/open5gs/sgwu.yaml
|
||||
sed -i 's|SGWU_ADVERTISE_IP|'$SGWU_ADVERTISE_IP'|g' install/etc/open5gs/sgwu.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/sgwu.yaml
|
||||
|
||||
# Sync docker time
|
||||
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
@@ -60,8 +60,7 @@ def start(ip_range):
|
||||
raise ValueError('Invalid UE IPv4 range. Only one IP given')
|
||||
else:
|
||||
first_ip_addr = first_ip_addr.exploded
|
||||
ip_netmask_prefix = ip_range.prefixlen
|
||||
print(str(first_ip_addr) + '/' + str(ip_netmask_prefix))
|
||||
print(str(first_ip_addr))
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
|
@@ -174,7 +174,7 @@ TLS_CA = "/open5gs/install/etc/freeDiameter/cacert.pem";
|
||||
# algorithms. In addition the "0xffffff" application is advertised in CER/CEA
|
||||
# exchanges.
|
||||
# Default: Relaying is enabled.
|
||||
#NoRelay;
|
||||
NoRelay;
|
||||
|
||||
# Number of server threads that can handle incoming messages at the same time.
|
||||
# Default: 4
|
||||
|
71
smf/smf.yaml
71
smf/smf.yaml
@@ -1,5 +1,6 @@
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/smf.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/smf.log
|
||||
|
||||
sbi:
|
||||
server:
|
||||
@@ -7,33 +8,48 @@ sbi:
|
||||
client:
|
||||
no_tls: true
|
||||
|
||||
parameter:
|
||||
no_ipv4v6_local_addr_in_packet_filter: true
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
parameter:
|
||||
no_ipv4v6_local_addr_in_packet_filter: true
|
||||
|
||||
smf:
|
||||
freeDiameter: /open5gs/install/etc/freeDiameter/smf.conf
|
||||
sbi:
|
||||
- addr: SMF_IP
|
||||
port: 7777
|
||||
server:
|
||||
- address: SMF_IP
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://NRF_IP:7777
|
||||
scp:
|
||||
- uri: http://SCP_IP:7777
|
||||
gtpc:
|
||||
- addr: SMF_IP
|
||||
server:
|
||||
- address: SMF_IP
|
||||
gtpu:
|
||||
- addr: SMF_IP
|
||||
server:
|
||||
- address: SMF_IP
|
||||
pfcp:
|
||||
- addr: SMF_IP
|
||||
subnet:
|
||||
- addr: UE_IPV4_INTERNET_TUN_IP
|
||||
server:
|
||||
- address: SMF_IP
|
||||
client:
|
||||
upf:
|
||||
- address: UPF_IP
|
||||
session:
|
||||
- subnet: UE_IPV4_INTERNET_SUBNET
|
||||
gateway: UE_IPV4_INTERNET_TUN_IP
|
||||
dnn: internet
|
||||
dev: ogstun
|
||||
- addr: 2001:230:cafe::1/48
|
||||
dev: ogstun
|
||||
- subnet: 2001:230:cafe::/48
|
||||
gateway: 2001:230:cafe::1
|
||||
dnn: internet
|
||||
- addr: UE_IPV4_IMS_TUN_IP
|
||||
- subnet: UE_IPV4_IMS_SUBNET
|
||||
gateway: UE_IPV4_IMS_TUN_IP
|
||||
dnn: ims
|
||||
dev: ogstun2
|
||||
- addr: 2001:230:babe::1/48
|
||||
- subnet: 2001:230:babe::/48
|
||||
gateway: 2001:230:babe::1
|
||||
dnn: ims
|
||||
dev: ogstun2
|
||||
dns:
|
||||
- SMF_DNS1
|
||||
- SMF_DNS2
|
||||
@@ -43,21 +59,6 @@ smf:
|
||||
- PCSCF_IP
|
||||
mtu: 1450
|
||||
metrics:
|
||||
- addr: SMF_IP
|
||||
port: 9091
|
||||
|
||||
scp:
|
||||
sbi:
|
||||
- addr:
|
||||
- SCP_IP
|
||||
port: 7777
|
||||
|
||||
nrf:
|
||||
sbi:
|
||||
- addr:
|
||||
- NRF_IP
|
||||
port: 7777
|
||||
|
||||
upf:
|
||||
pfcp:
|
||||
- addr: UPF_IP
|
||||
server:
|
||||
- address: SMF_IP
|
||||
port: 9091
|
||||
|
@@ -1,5 +1,6 @@
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/smf.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/smf.log
|
||||
|
||||
sbi:
|
||||
server:
|
||||
@@ -7,30 +8,39 @@ sbi:
|
||||
client:
|
||||
no_tls: true
|
||||
|
||||
parameter:
|
||||
no_ipv4v6_local_addr_in_packet_filter: true
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
parameter:
|
||||
no_ipv4v6_local_addr_in_packet_filter: true
|
||||
|
||||
smf:
|
||||
freeDiameter: /open5gs/install/etc/freeDiameter/smf.conf
|
||||
gtpc:
|
||||
- addr: SMF_IP
|
||||
server:
|
||||
- address: SMF_IP
|
||||
gtpu:
|
||||
- addr: SMF_IP
|
||||
server:
|
||||
- address: SMF_IP
|
||||
pfcp:
|
||||
- addr: SMF_IP
|
||||
subnet:
|
||||
- addr: UE_IPV4_INTERNET_TUN_IP
|
||||
server:
|
||||
- address: SMF_IP
|
||||
client:
|
||||
upf:
|
||||
- address: UPF_IP
|
||||
session:
|
||||
- subnet: UE_IPV4_INTERNET_SUBNET
|
||||
gateway: UE_IPV4_INTERNET_TUN_IP
|
||||
dnn: internet
|
||||
dev: ogstun
|
||||
- addr: 2001:230:cafe::1/48
|
||||
dev: ogstun
|
||||
- subnet: 2001:230:cafe::/48
|
||||
gateway: 2001:230:cafe::1
|
||||
dnn: internet
|
||||
- addr: UE_IPV4_IMS_TUN_IP
|
||||
- subnet: UE_IPV4_IMS_SUBNET
|
||||
gateway: UE_IPV4_IMS_TUN_IP
|
||||
dnn: ims
|
||||
dev: ogstun2
|
||||
- addr: 2001:230:babe::1/48
|
||||
- subnet: 2001:230:babe::/48
|
||||
gateway: 2001:230:babe::1
|
||||
dnn: ims
|
||||
dev: ogstun2
|
||||
dns:
|
||||
- SMF_DNS1
|
||||
- SMF_DNS2
|
||||
@@ -40,9 +50,7 @@ smf:
|
||||
- PCSCF_IP
|
||||
mtu: 1450
|
||||
metrics:
|
||||
- addr: SMF_IP
|
||||
port: 9091
|
||||
server:
|
||||
- address: SMF_IP
|
||||
port: 9091
|
||||
|
||||
upf:
|
||||
pfcp:
|
||||
- addr: UPF_IP
|
||||
|
@@ -51,8 +51,11 @@ sed -i 's|UPF_IP|'$UPF_IP'|g' install/etc/open5gs/smf.yaml
|
||||
sed -i 's|SMF_DNS1|'$SMF_DNS1'|g' install/etc/open5gs/smf.yaml
|
||||
sed -i 's|SMF_DNS2|'$SMF_DNS2'|g' install/etc/open5gs/smf.yaml
|
||||
sed -i 's|UE_IPV4_INTERNET_TUN_IP|'$UE_IPV4_INTERNET_TUN_IP'|g' install/etc/open5gs/smf.yaml
|
||||
sed -i 's|UE_IPV4_INTERNET_SUBNET|'$UE_IPV4_INTERNET'|g' install/etc/open5gs/smf.yaml
|
||||
sed -i 's|UE_IPV4_IMS_TUN_IP|'$UE_IPV4_IMS_TUN_IP'|g' install/etc/open5gs/smf.yaml
|
||||
sed -i 's|UE_IPV4_IMS_SUBNET|'$UE_IPV4_IMS'|g' install/etc/open5gs/smf.yaml
|
||||
sed -i 's|PCSCF_IP|'$PCSCF_IP'|g' install/etc/open5gs/smf.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/smf.yaml
|
||||
sed -i 's|SMF_IP|'$SMF_IP'|g' install/etc/freeDiameter/smf.conf
|
||||
sed -i 's|PCRF_IP|'$PCRF_IP'|g' install/etc/freeDiameter/smf.conf
|
||||
sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' install/etc/freeDiameter/smf.conf
|
||||
|
@@ -69,7 +69,7 @@ loadmodule "pua"
|
||||
loadmodule "pua_reginfo"
|
||||
|
||||
modparam("sqlops", "sqlcon", SMS_DB_URL)
|
||||
modparam("dialplan|pua", "db_url", DIALPLAN_PUA_DB_URL)
|
||||
modparam("dialplan", "db_url", DIALPLAN_PUA_DB_URL)
|
||||
modparam("uac", "restore_mode", "none")
|
||||
|
||||
modparam("htable", "htable", "publish_sent=>size=8;autoexpire=SUBSCRIBE_EXPIRE")
|
||||
@@ -81,6 +81,7 @@ modparam("rtimer", "exec", "timer=sms;route=SMS_WORKER")
|
||||
|
||||
modparam("pua_reginfo", "server_address", "sip:SMSC_SERVER")
|
||||
modparam("pua_reginfo", "publish_reginfo", 0)
|
||||
modparam("pua", "db_url", DIALPLAN_PUA_DB_URL)
|
||||
|
||||
####### Routing Logic ########
|
||||
# Main SIP request routing logic
|
||||
|
@@ -12,6 +12,6 @@ listen=tcp:SMSC_IP:7090
|
||||
|
||||
#!subst "/NEXMO_APIKEY/abcdef/"
|
||||
#!subst "/NEXMO_APISECRET/xyz/"
|
||||
#!subst "/SUBSCRIBE_EXPIRE/7200/"
|
||||
#!subst "/SUBSCRIBE_EXPIRE/3600/"
|
||||
|
||||
#!define WITH_DEBUG
|
||||
|
@@ -34,7 +34,7 @@ RUN apt-get update && \
|
||||
libzmq3-dev libboost-system-dev libboost-test-dev libboost-thread-dev libqwt-qt5-dev qtbase5-dev \
|
||||
software-properties-common g++ make pkg-config libpython2-dev python-numpy swig libi2c-dev \
|
||||
libboost-program-options-dev libconfig++-dev net-tools iputils-ping libusb-1.0-0-dev libpython3-dev python3-numpy swig \
|
||||
python3-distutils iproute2
|
||||
python3-distutils iproute2 wget
|
||||
|
||||
# Get SoapySDR, compile and install
|
||||
RUN git clone https://github.com/pothosware/SoapySDR.git && \
|
||||
@@ -52,6 +52,22 @@ RUN git clone https://github.com/myriadrf/LimeSuite.git && \
|
||||
cmake ../ && make && make install && \
|
||||
ldconfig
|
||||
|
||||
# Get BladeRF, compile and install
|
||||
RUN git clone https://github.com/Nuand/bladeRF.git && \
|
||||
cd bladeRF/host/ && git checkout tags/2024.05 && \
|
||||
mkdir build && cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DINSTALL_UDEV_RULES=ON -DBLADERF_GROUP=plugdev ../ && make && make install && \
|
||||
ldconfig && \
|
||||
mkdir -p /etc/Nuand/bladeRF/ && \
|
||||
wget https://www.nuand.com/fpga/hostedxA4-latest.rbf --output-document /etc/Nuand/bladeRF/hostedxA4-latest.rbf
|
||||
|
||||
# Get SoapySDR for BladeRF, compile and install
|
||||
RUN git clone https://github.com/pothosware/SoapyBladeRF.git && \
|
||||
cd SoapyBladeRF && \
|
||||
mkdir build && cd build && \
|
||||
cmake ../ && make && make install && \
|
||||
ldconfig
|
||||
|
||||
# UHD drivers for USRP
|
||||
RUN add-apt-repository ppa:ettusresearch/uhd && \
|
||||
apt update && apt -y install libuhd-dev uhd-host && \
|
||||
@@ -68,7 +84,7 @@ RUN git clone https://github.com/srsran/srsGUI && \
|
||||
# Get srsLTE, compile and install
|
||||
RUN git clone https://github.com/srsran/srsRAN_4G.git && \
|
||||
cd srsRAN_4G && \
|
||||
git checkout release_23_04_1 && \
|
||||
git checkout ec29b0c1ff79cebcbe66caa6d6b90778261c42b8 && \
|
||||
mkdir build && cd build && \
|
||||
cmake ../ && make -j`nproc` && make install && \
|
||||
ldconfig
|
||||
|
426
srslte/gnb_zmq.conf
Normal file
426
srslte/gnb_zmq.conf
Normal file
@@ -0,0 +1,426 @@
|
||||
#####################################################################
|
||||
# srsENB configuration file
|
||||
#####################################################################
|
||||
|
||||
#####################################################################
|
||||
# eNB configuration
|
||||
#
|
||||
# enb_id: 20-bit eNB identifier.
|
||||
# mcc: Mobile Country Code
|
||||
# mnc: Mobile Network Code
|
||||
# mme_addr: IP address of MME for S1 connnection
|
||||
# gtp_bind_addr: Local IP address to bind for GTP connection
|
||||
# gtp_advertise_addr: IP address of eNB to advertise for DL GTP-U Traffic
|
||||
# s1c_bind_addr: Local IP address to bind for S1AP connection
|
||||
# s1c_bind_port: Source port for S1AP connection (0 means any)
|
||||
# n_prb: Number of Physical Resource Blocks (6,15,25,50,75,100)
|
||||
# tm: Transmission mode 1-4 (TM1 default)
|
||||
# nof_ports: Number of Tx ports (1 port default, set to 2 for TM2/3/4)
|
||||
#
|
||||
#####################################################################
|
||||
[enb]
|
||||
enb_id = 0x19B
|
||||
mcc = MCC
|
||||
mnc = MNC
|
||||
mme_addr = MME_IP
|
||||
gtp_bind_addr = SRS_ENB_IP
|
||||
s1c_bind_addr = SRS_ENB_IP
|
||||
s1c_bind_port = 0
|
||||
n_prb = 100
|
||||
#tm = 4
|
||||
#nof_ports = 2
|
||||
|
||||
#####################################################################
|
||||
# eNB configuration files
|
||||
#
|
||||
# sib_config: SIB1, SIB2 and SIB3 configuration file
|
||||
# note: When enabling MBMS, use the sib.conf.mbsfn configuration file which includes SIB13
|
||||
# rr_config: Radio Resources configuration file
|
||||
# rb_config: SRB/DRB configuration file
|
||||
#####################################################################
|
||||
[enb_files]
|
||||
sib_config = /etc/srsran/sib.conf
|
||||
rr_config = /etc/srsran/rr.conf
|
||||
rb_config = /etc/srsran/rb.conf
|
||||
|
||||
#####################################################################
|
||||
# RF configuration
|
||||
#
|
||||
# dl_earfcn: EARFCN code for DL (only valid if a single cell is configured in rr.conf)
|
||||
# tx_gain: Transmit gain (dB).
|
||||
# rx_gain: Optional receive gain (dB). If disabled, AGC if enabled
|
||||
#
|
||||
# Optional parameters:
|
||||
# dl_freq: Override DL frequency corresponding to dl_earfcn
|
||||
# ul_freq: Override UL frequency corresponding to dl_earfcn (must be set if dl_freq is set)
|
||||
# device_name: Device driver family
|
||||
# Supported options: "auto" (uses first driver found), "UHD", "bladeRF", "soapy", "zmq" or "Sidekiq"
|
||||
# device_args: Arguments for the device driver. Options are "auto" or any string.
|
||||
# Default for UHD: "recv_frame_size=9232,send_frame_size=9232"
|
||||
# Default for bladeRF: ""
|
||||
# time_adv_nsamples: Transmission time advance (in number of samples) to compensate for RF delay
|
||||
# from antenna to timestamp insertion.
|
||||
# Default "auto". B210 USRP: 100 samples, bladeRF: 27
|
||||
#####################################################################
|
||||
[rf]
|
||||
#dl_earfcn = 3150
|
||||
tx_gain = 80
|
||||
rx_gain = 40
|
||||
|
||||
#device_name = auto
|
||||
|
||||
# For best performance in 2x2 MIMO and >= 15 MHz use the following device_args settings:
|
||||
# USRP B210: num_recv_frames=64,num_send_frames=64
|
||||
# And for 75 PRBs, also append ",master_clock_rate=15.36e6" to the device args
|
||||
|
||||
# For best performance when BW<5 MHz (25 PRB), use the following device_args settings:
|
||||
# USRP B210: send_frame_size=512,recv_frame_size=512
|
||||
|
||||
#device_args = auto
|
||||
#time_adv_nsamples = auto
|
||||
|
||||
# Example for ZMQ-based operation with TCP transport for I/Q samples
|
||||
device_name = zmq
|
||||
device_args = fail_on_disconnect=true,tx_port=tcp://SRS_ENB_IP:2000,rx_port=tcp://SRS_UE_IP:2001,id=enb,base_srate=23.04e6
|
||||
|
||||
#####################################################################
|
||||
# Packet capture configuration
|
||||
#
|
||||
# MAC-layer packets are captured to a file in the compact format which can
|
||||
# be decoded by Wireshark. For decoding, use the UDP dissector and the UDP
|
||||
# heuristic dissection. Edit the preferences (Edit > Preferences >
|
||||
# Protocols > DLT_USER) for DLT_USER to add an entry for DLT=149 with
|
||||
# Protocol=udp. Further, enable the heuristic dissection in UDP under:
|
||||
# Analyze > Enabled Protocols > MAC-LTE > mac_lte_udp and MAC-NR > mac_nr_udp
|
||||
# For more information see: https://wiki.wireshark.org/MAC-LTE
|
||||
# Configuring this Wireshark preferences is needed for decoding the MAC PCAP
|
||||
# files as well as for the live network capture option.
|
||||
#
|
||||
# Please note that this setting will by default only capture MAC
|
||||
# frames on dedicated channels, and not SIB. You have to build with
|
||||
# WRITE_SIB_PCAP enabled in srsenb/src/stack/mac/mac.cc if you want
|
||||
# SIB to be part of the MAC pcap file.
|
||||
#
|
||||
# S1AP Packets are captured to a file in the compact format which can
|
||||
# be decoded by the Wireshark s1ap dissector with DLT 150.
|
||||
# To use the dissector, edit the preferences for DLT_USER to
|
||||
# add an entry with DLT=150, Payload Protocol=s1ap.
|
||||
#
|
||||
# mac_enable: Enable MAC layer packet captures (true/false)
|
||||
# filename: File path to use for LTE MAC packet captures
|
||||
# nr_filename: File path to use for NR MAC packet captures
|
||||
# s1ap_enable: Enable or disable the PCAP.
|
||||
# s1ap_filename: File name where to save the PCAP.
|
||||
#
|
||||
# mac_net_enable: Enable MAC layer packet captures sent over the network (true/false default: false)
|
||||
# bind_ip: Bind IP address for MAC network trace (default: "0.0.0.0")
|
||||
# bind_port: Bind port for MAC network trace (default: 5687)
|
||||
# client_ip: Client IP address for MAC network trace (default: "127.0.0.1")
|
||||
# client_port Client IP address for MAC network trace (default: 5847)
|
||||
#####################################################################
|
||||
[pcap]
|
||||
#enable = false
|
||||
#filename = /mnt/srslte/enb_mac.pcap
|
||||
#nr_filename = /mnt/srslte/enb_mac_nr.pcap
|
||||
#s1ap_enable = false
|
||||
#s1ap_filename = /mnt/srslte/enb_s1ap.pcap
|
||||
|
||||
#mac_net_enable = false
|
||||
#bind_ip = 0.0.0.0
|
||||
#bind_port = 5687
|
||||
#client_ip = 127.0.0.1
|
||||
#client_port = 5847
|
||||
|
||||
#####################################################################
|
||||
# Log configuration
|
||||
#
|
||||
# Log levels can be set for individual layers. "all_level" sets log
|
||||
# level for all layers unless otherwise configured.
|
||||
# Format: e.g. phy_level = info
|
||||
#
|
||||
# In the same way, packet hex dumps can be limited for each level.
|
||||
# "all_hex_limit" sets the hex limit for all layers unless otherwise
|
||||
# configured.
|
||||
# Format: e.g. phy_hex_limit = 32
|
||||
#
|
||||
# Logging layers: rf, phy, phy_lib, mac, rlc, pdcp, rrc, gtpu, s1ap, stack, all
|
||||
# Logging levels: debug, info, warning, error, none
|
||||
#
|
||||
# filename: File path to use for log output. Can be set to stdout
|
||||
# to print logs to standard output
|
||||
# file_max_size: Maximum file size (in kilobytes). When passed, multiple files are created.
|
||||
# If set to negative, a single log file will be created.
|
||||
#####################################################################
|
||||
[log]
|
||||
all_level = warning
|
||||
all_hex_limit = 32
|
||||
filename = /mnt/srslte/enb.log
|
||||
file_max_size = -1
|
||||
|
||||
[gui]
|
||||
enable = false
|
||||
|
||||
#####################################################################
|
||||
# Scheduler configuration options
|
||||
#
|
||||
# sched_policy: User MAC scheduling policy (E.g. time_rr, time_pf)
|
||||
# min_aggr_level: Optional minimum aggregation level index (l=log2(L) can be 0, 1, 2 or 3)
|
||||
# max_aggr_level: Optional maximum aggregation level index (l=log2(L) can be 0, 1, 2 or 3)
|
||||
# adaptive_aggr_level: Boolean flag to enable/disable adaptive aggregation level based on target BLER
|
||||
# pdsch_mcs: Optional fixed PDSCH MCS (ignores reported CQIs if specified)
|
||||
# pdsch_max_mcs: Optional PDSCH MCS limit
|
||||
# pusch_mcs: Optional fixed PUSCH MCS (ignores reported CQIs if specified)
|
||||
# pusch_max_mcs: Optional PUSCH MCS limit
|
||||
# min_nof_ctrl_symbols: Minimum number of control symbols
|
||||
# max_nof_ctrl_symbols: Maximum number of control symbols
|
||||
# pucch_multiplex_enable: Allow PUCCH HARQ to collide with PUSCH and other PUCCH
|
||||
# pucch_harq_max_rb: Maximum number of RB to be used for PUCCH on the edges of the grid.
|
||||
# If defined and greater than 0, the scheduler will avoid DL PDCCH allocations if
|
||||
# PUCCH HARQ falls outside this region
|
||||
# target_bler: Target BLER (in decimal) to achieve via adaptive link
|
||||
# max_delta_dl_cqi: Maximum shift in CQI for adaptive DL link
|
||||
# max_delta_ul_snr: Maximum shift in UL SNR for adaptive UL link
|
||||
# adaptive_dl_mcs_step_size: Step size or learning rate used in adaptive DL MCS link
|
||||
# adaptive_ul_mcs_step_size: Step size or learning rate used in adaptive UL MCS link
|
||||
# min_tpc_tti_interval: Minimum TTI interval between TPCs different than 1
|
||||
# ul_snr_avg_alpha: Exponential Average alpha coefficient used in estimation of UL SNR
|
||||
# init_ul_snr_value: Initial UL SNR value used for computing MCS in the first UL grant
|
||||
# init_dl_cqi: DL CQI value used before any CQI report is available to the eNB
|
||||
# max_sib_coderate: Upper bound on SIB and RAR grants coderate
|
||||
# pdcch_cqi_offset: CQI offset in derivation of PDCCH aggregation level
|
||||
# nr_pdsch_mcs: Optional fixed NR PDSCH MCS (ignores reported CQIs if specified)
|
||||
# nr_pusch_mcs: Optional fixed NR PUSCH MCS (ignores reported CQIs if specified)
|
||||
#
|
||||
#####################################################################
|
||||
[scheduler]
|
||||
#policy = time_pf
|
||||
#policy_args = 2
|
||||
#min_aggr_level = 0
|
||||
#max_aggr_level = 3
|
||||
#adaptive_aggr_level = false
|
||||
#pdsch_mcs = -1
|
||||
#pdsch_max_mcs = -1
|
||||
#pusch_mcs = -1
|
||||
#pusch_max_mcs = 16
|
||||
#min_nof_ctrl_symbols = 1
|
||||
#max_nof_ctrl_symbols = 3
|
||||
#pucch_multiplex_enable = false
|
||||
#pucch_harq_max_rb = 0
|
||||
#target_bler = 0.05
|
||||
#max_delta_dl_cqi = 5
|
||||
#max_delta_ul_snr = 5
|
||||
#adaptive_dl_mcs_step_size = 0.001
|
||||
#adaptive_ul_mcs_step_size = 0.001
|
||||
#min_tpc_tti_interval = 1
|
||||
#ul_snr_avg_alpha=0.05
|
||||
#init_ul_snr_value=5
|
||||
#init_dl_cqi=5
|
||||
#max_sib_coderate=0.3
|
||||
#pdcch_cqi_offset=0
|
||||
nr_pdsch_mcs=28
|
||||
#nr_pusch_mcs=28
|
||||
|
||||
#####################################################################
|
||||
# eMBMS configuration options
|
||||
#
|
||||
# enable: Enable MBMS transmission in the eNB
|
||||
# m1u_multiaddr: Multicast address the M1-U socket will register to
|
||||
# m1u_if_addr: Address of the interface the M1-U interface will listen to for multicast packets
|
||||
# mcs: Modulation and Coding scheme for MBMS traffic
|
||||
#
|
||||
#####################################################################
|
||||
[embms]
|
||||
#enable = false
|
||||
#m1u_multiaddr = 239.255.0.1
|
||||
#m1u_if_addr = 127.0.1.201
|
||||
#mcs = 20
|
||||
|
||||
|
||||
|
||||
#####################################################################
|
||||
# Channel emulator options:
|
||||
# enable: Enable/disable internal Downlink/Uplink channel emulator
|
||||
#
|
||||
# -- AWGN Generator
|
||||
# awgn.enable: Enable/disable AWGN generator
|
||||
# awgn.snr: Target SNR in dB
|
||||
#
|
||||
# -- Fading emulator
|
||||
# fading.enable: Enable/disable fading simulator
|
||||
# fading.model: Fading model + maximum doppler (E.g. none, epa5, eva70, etu300, etc)
|
||||
#
|
||||
# -- Delay Emulator delay(t) = delay_min + (delay_max - delay_min) * (1 + sin(2pi*t/period)) / 2
|
||||
# Maximum speed [m/s]: (delay_max - delay_min) * pi * 300 / period
|
||||
# delay.enable: Enable/disable delay simulator
|
||||
# delay.period_s: Delay period in seconds
|
||||
# delay.init_time_s: Delay initial time in seconds
|
||||
# delay.maximum_us: Maximum delay in microseconds
|
||||
# delay.minumum_us: Minimum delay in microseconds
|
||||
#
|
||||
# -- Radio-Link Failure (RLF) Emulator
|
||||
# rlf.enable: Enable/disable RLF simulator
|
||||
# rlf.t_on_ms: Time for On state of the channel (ms)
|
||||
# rlf.t_off_ms: Time for Off state of the channel (ms)
|
||||
#
|
||||
# -- High Speed Train Doppler model simulator
|
||||
# hst.enable: Enable/disable HST simulator
|
||||
# hst.period_s: HST simulation period in seconds
|
||||
# hst.fd_hz: Doppler frequency in Hz
|
||||
# hst.init_time_s: Initial time in seconds
|
||||
#####################################################################
|
||||
[channel.dl]
|
||||
#enable = false
|
||||
|
||||
[channel.dl.awgn]
|
||||
#enable = false
|
||||
#snr = 30
|
||||
|
||||
[channel.dl.fading]
|
||||
#enable = false
|
||||
#model = none
|
||||
|
||||
[channel.dl.delay]
|
||||
#enable = false
|
||||
#period_s = 3600
|
||||
#init_time_s = 0
|
||||
#maximum_us = 100
|
||||
#minimum_us = 10
|
||||
|
||||
[channel.dl.rlf]
|
||||
#enable = false
|
||||
#t_on_ms = 10000
|
||||
#t_off_ms = 2000
|
||||
|
||||
[channel.dl.hst]
|
||||
#enable = false
|
||||
#period_s = 7.2
|
||||
#fd_hz = 750.0
|
||||
#init_time_s = 0.0
|
||||
|
||||
[channel.ul]
|
||||
#enable = false
|
||||
|
||||
[channel.ul.awgn]
|
||||
#enable = false
|
||||
#n0 = -30
|
||||
|
||||
[channel.ul.fading]
|
||||
#enable = false
|
||||
#model = none
|
||||
|
||||
[channel.ul.delay]
|
||||
#enable = false
|
||||
#period_s = 3600
|
||||
#init_time_s = 0
|
||||
#maximum_us = 100
|
||||
#minimum_us = 10
|
||||
|
||||
[channel.ul.rlf]
|
||||
#enable = false
|
||||
#t_on_ms = 10000
|
||||
#t_off_ms = 2000
|
||||
|
||||
[channel.ul.hst]
|
||||
#enable = false
|
||||
#period_s = 7.2
|
||||
#fd_hz = -750.0
|
||||
#init_time_s = 0.0
|
||||
|
||||
#####################################################################
|
||||
# CFR configuration options
|
||||
#
|
||||
# The CFR module provides crest factor reduction for the transmitted signal.
|
||||
#
|
||||
# enable: Enable or disable the CFR. Default: disabled
|
||||
#
|
||||
# mode: manual: CFR threshold is set by cfr_manual_thres (default).
|
||||
# auto_ema: CFR threshold is adaptive based on the signal PAPR. Power avg. with Exponential Moving Average.
|
||||
# The time constant of the averaging can be tweaked with the ema_alpha parameter.
|
||||
# auto_cma: CFR threshold is adaptive based on the signal PAPR. Power avg. with Cumulative Moving Average.
|
||||
# Use with care, as CMA's increasingly slow response may be unsuitable for most use cases.
|
||||
#
|
||||
# strength: Ratio between amplitude-limited vs unprocessed signal (0 to 1). Default: 1
|
||||
# manual_thres: Fixed manual clipping threshold for CFR manual mode. Default: 0.5
|
||||
# auto_target_papr: Signal PAPR target (in dB) in CFR auto modes. output PAPR can be higher due to peak smoothing. Default: 8
|
||||
# ema_alpha: Alpha coefficient for the power average in auto_ema mode. Default: 1/7
|
||||
#
|
||||
#####################################################################
|
||||
[cfr]
|
||||
#enable = false
|
||||
#mode = manual
|
||||
#manual_thres = 0.5
|
||||
#strength = 1
|
||||
#auto_target_papr = 8
|
||||
#ema_alpha = 0.0143
|
||||
|
||||
#####################################################################
|
||||
# Expert configuration options
|
||||
#
|
||||
# pusch_max_its: Maximum number of turbo decoder iterations (default: 4)
|
||||
# nr_pusch_max_its: Maximum number of LDPC iterations for NR (Default 10)
|
||||
# pusch_8bit_decoder: Use 8-bit for LLR representation and turbo decoder trellis computation (experimental)
|
||||
# nof_phy_threads: Selects the number of PHY threads (maximum: 4, minimum: 1, default: 3)
|
||||
# metrics_period_secs: Sets the period at which metrics are requested from the eNB
|
||||
# metrics_csv_enable: Write eNB metrics to CSV file.
|
||||
# metrics_csv_filename: File path to use for CSV metrics
|
||||
# report_json_enable: Write eNB report to JSON file (default: disabled)
|
||||
# report_json_filename: Report JSON filename (default: /mnt/srslte/enb_report.json)
|
||||
# report_json_asn1_oct: Prints ASN1 messages encoded as an octet string instead of plain text in the JSON report file
|
||||
# alarms_log_enable: Enable Alarms logging (default: disabled)
|
||||
# alarms_filename: Alarms logging filename (default: /mnt/srslte/alarms.log)
|
||||
# tracing_enable: Write source code tracing information to a file
|
||||
# tracing_filename: File path to use for tracing information
|
||||
# tracing_buffcapacity: Maximum capacity in bytes the tracing framework can store
|
||||
# stdout_ts_enable: Prints once per second the timestamp into stdout
|
||||
# tx_amplitude: Transmit amplitude factor (set 0-1 to reduce PAPR)
|
||||
# rrc_inactivity_timer Inactivity timeout used to remove UE context from RRC (in milliseconds)
|
||||
# max_mac_dl_kos: Maximum number of consecutive KOs in DL before triggering the UE's release (default: 100)
|
||||
# max_mac_ul_kos: Maximum number of consecutive KOs in UL before triggering the UE's release (default: 100)
|
||||
# max_prach_offset_us: Maximum allowed RACH offset (in us)
|
||||
# nof_prealloc_ues: Number of UE memory resources to preallocate during eNB initialization for faster UE creation (default: 8)
|
||||
# rlf_release_timer_ms: Time taken by eNB to release UE context after it detects an RLF
|
||||
# eea_pref_list: Ordered preference list for the selection of encryption algorithm (EEA) (default: EEA0, EEA2, EEA1)
|
||||
# eia_pref_list: Ordered preference list for the selection of integrity algorithm (EIA) (default: EIA2, EIA1, EIA0)
|
||||
# gtpu_tunnel_timeout: Time that GTPU takes to release indirect forwarding tunnel since the last received GTPU PDU (0 for no timer)
|
||||
# ts1_reloc_prep_timeout: S1AP TS 36.413 TS1RelocPrep Expiry Timeout value in milliseconds
|
||||
# ts1_reloc_overall_timeout: S1AP TS 36.413 TS1RelocOverall Expiry Timeout value in milliseconds
|
||||
# rlf_release_timer_ms: Time taken by eNB to release UE context after it detects a RLF
|
||||
# rlf_min_ul_snr_estim: SNR threshold in dB below which the enb is notified with RLF ko
|
||||
# s1_setup_max_retries: Maximum amount of retries to setup the S1AP connection. If this value is exceeded, an alarm is written to the log. -1 means infinity.
|
||||
# rx_gain_offset: RX Gain offset to add to rx_gain to calibrate RSRP readings
|
||||
#####################################################################
|
||||
[expert]
|
||||
#pusch_max_its = 8 # These are half iterations
|
||||
#nr_pusch_max_its = 10
|
||||
#pusch_8bit_decoder = false
|
||||
#nof_phy_threads = 3
|
||||
#metrics_period_secs = 1
|
||||
#metrics_csv_enable = false
|
||||
#metrics_csv_filename = /mnt/srslte/enb_metrics.csv
|
||||
#report_json_enable = true
|
||||
#report_json_filename = /mnt/srslte/enb_report.json
|
||||
#report_json_asn1_oct = false
|
||||
#alarms_log_enable = true
|
||||
#alarms_filename = /mnt/srslte/enb_alarms.log
|
||||
#tracing_enable = true
|
||||
#tracing_filename = /mnt/srslte/enb_tracing.log
|
||||
#tracing_buffcapacity = 1000000
|
||||
#stdout_ts_enable = false
|
||||
#tx_amplitude = 0.6
|
||||
#rrc_inactivity_timer = 30000
|
||||
#max_mac_dl_kos = 100
|
||||
#max_mac_ul_kos = 100
|
||||
#max_prach_offset_us = 30
|
||||
#nof_prealloc_ues = 8
|
||||
#rlf_release_timer_ms = 4000
|
||||
#lcid_padding = 3
|
||||
#eea_pref_list = EEA0, EEA2, EEA1
|
||||
#eia_pref_list = EIA2, EIA1, EIA0
|
||||
#gtpu_tunnel_timeout = 0
|
||||
#extended_cp = false
|
||||
#ts1_reloc_prep_timeout = 10000
|
||||
#ts1_reloc_overall_timeout = 10000
|
||||
#rlf_release_timer_ms = 4000
|
||||
#rlf_min_ul_snr_estim = -2
|
||||
#s1_setup_max_retries = -1
|
||||
#rx_gain_offset = 62
|
70
srslte/rr_gnb_zmq.conf
Normal file
70
srslte/rr_gnb_zmq.conf
Normal file
@@ -0,0 +1,70 @@
|
||||
mac_cnfg =
|
||||
{
|
||||
phr_cnfg =
|
||||
{
|
||||
dl_pathloss_change = "dB3"; // Valid: 1, 3, 6 or INFINITY
|
||||
periodic_phr_timer = 50;
|
||||
prohibit_phr_timer = 0;
|
||||
};
|
||||
ulsch_cnfg =
|
||||
{
|
||||
max_harq_tx = 4;
|
||||
periodic_bsr_timer = 20; // in ms
|
||||
retx_bsr_timer = 320; // in ms
|
||||
};
|
||||
|
||||
time_alignment_timer = -1; // -1 is infinity
|
||||
};
|
||||
|
||||
phy_cnfg =
|
||||
{
|
||||
phich_cnfg =
|
||||
{
|
||||
duration = "Normal";
|
||||
resources = "1/6";
|
||||
};
|
||||
|
||||
pusch_cnfg_ded =
|
||||
{
|
||||
beta_offset_ack_idx = 6;
|
||||
beta_offset_ri_idx = 6;
|
||||
beta_offset_cqi_idx = 6;
|
||||
};
|
||||
|
||||
// PUCCH-SR resources are scheduled on time-frequeny domain first, then multiplexed in the same resource.
|
||||
sched_request_cnfg =
|
||||
{
|
||||
dsr_trans_max = 64;
|
||||
period = 20; // in ms
|
||||
//subframe = [1, 11]; // Optional vector of subframe indices allowed for SR transmissions (default uses all)
|
||||
nof_prb = 1; // number of PRBs on each extreme used for SR (total prb is twice this number)
|
||||
};
|
||||
cqi_report_cnfg =
|
||||
{
|
||||
mode = "periodic";
|
||||
simultaneousAckCQI = true;
|
||||
period = 40; // in ms
|
||||
//subframe = [0, 10, 20, 30]; // Optional vector of subframe indices every period where CQI resources will be allocated (default uses all)
|
||||
m_ri = 8; // RI period in CQI period
|
||||
//subband_k = 1; // If enabled and > 0, configures sub-band CQI reporting and defines K (see 36.213 7.2.2). If disabled, configures wideband CQI
|
||||
};
|
||||
};
|
||||
|
||||
cell_list =
|
||||
(
|
||||
|
||||
);
|
||||
|
||||
nr_cell_list =
|
||||
(
|
||||
{
|
||||
rf_port = 0;
|
||||
cell_id = 1;
|
||||
root_seq_idx = 1;
|
||||
tac = 1;
|
||||
pci = 500;
|
||||
dl_arfcn = 368500;
|
||||
coreset0_idx = 12;
|
||||
band = 3;
|
||||
}
|
||||
);
|
@@ -52,8 +52,8 @@ elif [[ "$COMPONENT_NAME" =~ ^(enb_zmq$) ]]; then
|
||||
sed -i 's|MME_IP|'$MME_IP'|g' /etc/srsran/enb.conf
|
||||
elif [[ "$COMPONENT_NAME" =~ ^(gnb_zmq$) ]]; then
|
||||
echo "Configuring component: '$COMPONENT_NAME'"
|
||||
cp /mnt/srslte/rr_gnb.conf /etc/srsran/rr.conf
|
||||
cp /mnt/srslte/enb_zmq.conf /etc/srsran/enb.conf
|
||||
cp /mnt/srslte/rr_gnb_zmq.conf /etc/srsran/rr.conf
|
||||
cp /mnt/srslte/gnb_zmq.conf /etc/srsran/enb.conf
|
||||
sed -i 's|MME_IP|'$AMF_IP'|g' /etc/srsran/enb.conf
|
||||
elif [[ "$COMPONENT_NAME" =~ ^(ue_zmq$) ]]; then
|
||||
echo "Configuring component: '$COMPONENT_NAME'"
|
||||
|
@@ -27,7 +27,7 @@
|
||||
freq_offset = 0
|
||||
tx_gain = 80
|
||||
#rx_gain = 40
|
||||
srate = 11.52e6
|
||||
srate = 23.04e6
|
||||
|
||||
#nof_antennas = 1
|
||||
|
||||
@@ -43,7 +43,7 @@ srate = 11.52e6
|
||||
|
||||
# Example for ZMQ-based operation with TCP transport for I/Q samples
|
||||
device_name = zmq
|
||||
device_args = tx_port=tcp://SRS_UE_IP:2001,rx_port=tcp://SRS_GNB_IP:2000,id=ue,base_srate=11.52e6
|
||||
device_args = tx_port=tcp://SRS_UE_IP:2001,rx_port=tcp://SRS_GNB_IP:2000,id=ue,base_srate=23.04e6
|
||||
|
||||
#####################################################################
|
||||
# EUTRA RAT configuration
|
||||
@@ -69,6 +69,10 @@ nof_carriers = 0
|
||||
[rat.nr]
|
||||
bands = 3
|
||||
nof_carriers = 1
|
||||
dl_nr_arfcn = 368500
|
||||
ssb_nr_arfcn = 368410
|
||||
max_nof_prb = 106
|
||||
nof_prb = 106
|
||||
|
||||
#####################################################################
|
||||
# Packet capture configuration
|
||||
|
@@ -40,7 +40,7 @@ RUN add-apt-repository ppa:ettusresearch/uhd && \
|
||||
|
||||
# Get srsRAN_Project, compile and install
|
||||
RUN git clone https://github.com/srsran/srsRAN_Project.git && \
|
||||
cd srsRAN_Project && git checkout tags/release_23_10 && \
|
||||
cd srsRAN_Project && git checkout e5d5b44b92cf18d1bd1736da0148e5f9cce3721d && \
|
||||
mkdir build && cd build && \
|
||||
cmake ../ -DENABLE_EXPORT=ON -DENABLE_ZEROMQ=ON && make -j`nproc` && make install && \
|
||||
ldconfig
|
||||
|
@@ -1,6 +1,13 @@
|
||||
amf:
|
||||
addr: AMF_IP # The address or hostname of the AMF.
|
||||
bind_addr: SRS_GNB_IP # A local IP that the gNB binds to for traffic from the AMF.
|
||||
cu_cp:
|
||||
amf:
|
||||
addr: AMF_IP # The address or hostname of the AMF.
|
||||
bind_addr: SRS_GNB_IP # A local IP that the gNB binds to for traffic from the AMF.
|
||||
supported_tracking_areas: # Sets the list of tracking areas supported by this AMF.
|
||||
- tac: 1 # Tracking area code (needs to match the core configuration).
|
||||
plmn_list: # The list of PLMN items supported for this Tracking Area.
|
||||
- plmn: "PLMN" # PLMN broadcasted by the gNB.
|
||||
tai_slice_support_list: # The list of TAI slices for this PLMN item.
|
||||
- sst: 1 # Sets the Slice Service Type.
|
||||
|
||||
ru_sdr:
|
||||
device_driver: uhd # The RF driver name.
|
||||
@@ -35,6 +42,8 @@ pcap:
|
||||
e1ap_enable: false # Set to true to enable E1AP PCAPs.
|
||||
e1ap_filename: /mnt/srsran/gnb_e1ap.pcap # Path where the E1AP PCAP is stored.
|
||||
e2ap_enable: false # Set to true to enable E2AP PCAPs.
|
||||
e2ap_filename: /mnt/srsran/gnb_e2ap.pcap # Path where the E2AP PCAP is stored.
|
||||
gtpu_enable: false # Set to true to enable GTP-U PCAPs.
|
||||
gtpu_filename: /mnt/srsran/gnb_gtpu.pcap # Path where the GTP-U PCAP is stored.
|
||||
e2ap_cu_cp_filename: /mnt/srsran/cu_cp_e2ap.pcap # Path where E2AP CU-CP PCAP is stored.
|
||||
e2ap_cu_up_filename: /mnt/srsran/cu_up_e2ap.pcap # Path where E2AP CU-UP PCAP is stored.
|
||||
e2ap_du_filename: /mnt/srsran/du_e2ap.pcap # Path where E2AP CU PCAP is stored.
|
||||
n3_enable: false # Set to true to enable N3 PCAPs.
|
||||
n3_filename: /mnt/srsran/gnb_n3.pcap # Path where the N3 PCAP is stored.
|
||||
|
@@ -1,18 +1,25 @@
|
||||
amf:
|
||||
addr: AMF_IP # The address or hostname of the AMF.
|
||||
bind_addr: SRS_GNB_IP # A local IP that the gNB binds to for traffic from the AMF.
|
||||
cu_cp:
|
||||
amf:
|
||||
addr: AMF_IP # The address or hostname of the AMF.
|
||||
bind_addr: SRS_GNB_IP # A local IP that the gNB binds to for traffic from the AMF.
|
||||
supported_tracking_areas: # Sets the list of tracking areas supported by this AMF.
|
||||
- tac: 1 # Tracking area code (needs to match the core configuration).
|
||||
plmn_list: # The list of PLMN items supported for this Tracking Area.
|
||||
- plmn: "PLMN" # PLMN broadcasted by the gNB.
|
||||
tai_slice_support_list: # The list of TAI slices for this PLMN item.
|
||||
- sst: 1 # Sets the Slice Service Type.
|
||||
|
||||
ru_sdr:
|
||||
device_driver: zmq # The RF driver name.
|
||||
device_args: tx_port=tcp://SRS_GNB_IP:2000,rx_port=tcp://SRS_UE_IP:2001,base_srate=11.52e6 # Optionally pass arguments to the selected RF driver.
|
||||
srate: 11.52 # RF sample rate might need to be adjusted according to selected bandwidth.
|
||||
device_args: tx_port=tcp://SRS_GNB_IP:2000,rx_port=tcp://SRS_UE_IP:2001,base_srate=23.04e6 # Optionally pass arguments to the selected RF driver.
|
||||
srate: 23.04 # RF sample rate might need to be adjusted according to selected bandwidth.
|
||||
tx_gain: 75 # Transmit gain of the RF might need to adjusted to the given situation.
|
||||
rx_gain: 75 # Receive gain of the RF might need to adjusted to the given situation.
|
||||
|
||||
cell_cfg:
|
||||
dl_arfcn: 368500 # ARFCN of the downlink carrier (center frequency).
|
||||
band: 3 # The NR band.
|
||||
channel_bandwidth_MHz: 10 # Bandwith in MHz. Number of PRBs will be automatically derived.
|
||||
channel_bandwidth_MHz: 20 # Bandwith in MHz. Number of PRBs will be automatically derived.
|
||||
common_scs: 15 # Subcarrier spacing in kHz used for data.
|
||||
plmn: "PLMN" # PLMN broadcasted by the gNB.
|
||||
tac: 1 # Tracking area code (needs to match the core configuration).
|
||||
@@ -21,6 +28,9 @@ cell_cfg:
|
||||
dedicated:
|
||||
ss2_type: common # Search Space type, has to be set to common
|
||||
dci_format_0_1_and_1_1: false # Set correct DCI format (fallback)
|
||||
common:
|
||||
ss0_index: 0
|
||||
coreset0_index: 13
|
||||
prach:
|
||||
prach_config_index: 1
|
||||
|
||||
@@ -38,6 +48,8 @@ pcap:
|
||||
e1ap_enable: false # Set to true to enable E1AP PCAPs.
|
||||
e1ap_filename: /mnt/srsran/gnb_e1ap.pcap # Path where the E1AP PCAP is stored.
|
||||
e2ap_enable: false # Set to true to enable E2AP PCAPs.
|
||||
e2ap_filename: /mnt/srsran/gnb_e2ap.pcap # Path where the E2AP PCAP is stored.
|
||||
gtpu_enable: false # Set to true to enable GTP-U PCAPs.
|
||||
gtpu_filename: /mnt/srsran/gnb_gtpu.pcap # Path where the GTP-U PCAP is stored.
|
||||
e2ap_cu_cp_filename: /mnt/srsran/cu_cp_e2ap.pcap # Path where E2AP CU-CP PCAP is stored.
|
||||
e2ap_cu_up_filename: /mnt/srsran/cu_up_e2ap.pcap # Path where E2AP CU-UP PCAP is stored.
|
||||
e2ap_du_filename: /mnt/srsran/du_e2ap.pcap # Path where E2AP CU PCAP is stored.
|
||||
n3_enable: false # Set to true to enable N3 PCAPs.
|
||||
n3_filename: /mnt/srsran/gnb_n3.pcap # Path where the N3 PCAP is stored.
|
||||
|
117
srsran/qos.yml
117
srsran/qos.yml
@@ -2,23 +2,12 @@
|
||||
# Based on 5QI characteristics in TS 23.501 table 5.7.4-1
|
||||
|
||||
# This is a supplementary configuration to modify the RLC and PDCP radio bearers on
|
||||
# a per 5QI basis. This file will be passed to the gNB along with the base configuration
|
||||
# at start-up. The following command may be used to run the gNB with this configuration file:
|
||||
# sudo ./gnb -c gnb_ru_ran550_tdd_n78_100mhz_2x2.yml -c qos.yml
|
||||
# a per 5QI basis.
|
||||
|
||||
qos:
|
||||
-
|
||||
five_qi: 1 # E.g. Conversational Voice
|
||||
rlc:
|
||||
mode: um-bidir
|
||||
um-bidir:
|
||||
tx:
|
||||
sn: 12
|
||||
rx:
|
||||
sn: 12
|
||||
t-reassembly: 50
|
||||
pdcp:
|
||||
integrity_required: false
|
||||
tx:
|
||||
sn: 12
|
||||
discard_timer: -1
|
||||
@@ -27,22 +16,23 @@ qos:
|
||||
sn: 12
|
||||
t_reordering: 80
|
||||
out_of_order_delivery: false
|
||||
f1u_cu_up:
|
||||
backoff_timer: 10
|
||||
f1u_du:
|
||||
backoff_timer: 10
|
||||
f1u_cu_up:
|
||||
backoff_timer: 10
|
||||
rlc:
|
||||
mode: um-bidir
|
||||
um-bidir:
|
||||
tx:
|
||||
sn: 12
|
||||
queue-size: 16384
|
||||
queue-bytes: 6172672
|
||||
rx:
|
||||
sn: 12
|
||||
t-reassembly: 50
|
||||
-
|
||||
five_qi: 2 # E.g. Conversational Video
|
||||
rlc:
|
||||
mode: um-bidir
|
||||
um-bidir:
|
||||
tx:
|
||||
sn: 12
|
||||
rx:
|
||||
sn: 12
|
||||
t-reassembly: 50
|
||||
pdcp:
|
||||
integrity_required: false
|
||||
tx:
|
||||
sn: 12
|
||||
discard_timer: -1
|
||||
@@ -51,10 +41,20 @@ qos:
|
||||
sn: 12
|
||||
t_reordering: 80
|
||||
out_of_order_delivery: false
|
||||
f1u_cu_up:
|
||||
backoff_timer: 10
|
||||
f1u_du:
|
||||
backoff_timer: 10
|
||||
f1u_cu_up:
|
||||
backoff_timer: 10
|
||||
rlc:
|
||||
mode: um-bidir
|
||||
um-bidir:
|
||||
tx:
|
||||
sn: 12
|
||||
queue-size: 16384
|
||||
queue-bytes: 6172672
|
||||
rx:
|
||||
sn: 12
|
||||
t-reassembly: 50
|
||||
-
|
||||
five_qi: 5 # E.g. IMS signaling
|
||||
rlc:
|
||||
@@ -66,6 +66,8 @@ qos:
|
||||
max-retx-threshold: 4
|
||||
poll-pdu: 64
|
||||
poll-byte: 125
|
||||
queue-size: 16384
|
||||
queue-bytes: 6172672
|
||||
rx:
|
||||
sn: 12
|
||||
t-reassembly: 80
|
||||
@@ -83,57 +85,60 @@ qos:
|
||||
f1u_du:
|
||||
backoff_timer: 10
|
||||
f1u_cu_up:
|
||||
backoff_timer: 10
|
||||
backoff_timer: 10
|
||||
-
|
||||
five_qi: 7 # E.g. Voice, Video (live streaming)
|
||||
pdcp:
|
||||
integrity_required: false
|
||||
tx:
|
||||
sn: 12
|
||||
discard_timer: -1
|
||||
status_report_required: false
|
||||
rx:
|
||||
sn: 12
|
||||
t_reordering: 80
|
||||
out_of_order_delivery: false
|
||||
f1u_cu_up:
|
||||
backoff_timer: 10
|
||||
f1u_du:
|
||||
backoff_timer: 10
|
||||
rlc:
|
||||
mode: um-bidir
|
||||
um-bidir:
|
||||
tx:
|
||||
sn: 12
|
||||
queue-size: 16384
|
||||
queue-bytes: 6172672
|
||||
rx:
|
||||
sn: 12
|
||||
t-reassembly: 50
|
||||
t-reassembly: 100
|
||||
-
|
||||
five_qi: 9 # E.g. Buffered video streaming, TCP-based traffic
|
||||
pdcp:
|
||||
integrity_required: false
|
||||
tx:
|
||||
sn: 12
|
||||
sn: 18
|
||||
discard_timer: -1
|
||||
status_report_required: false
|
||||
rx:
|
||||
sn: 12
|
||||
t_reordering: 80
|
||||
sn: 18
|
||||
t_reordering: 220
|
||||
out_of_order_delivery: false
|
||||
f1u_cu_up:
|
||||
backoff_timer: 10
|
||||
f1u_du:
|
||||
backoff_timer: 10
|
||||
f1u_cu_up:
|
||||
backoff_timer: 10
|
||||
-
|
||||
five_qi: 9 # E.g. Buffered video streaming, TCP-based traffic
|
||||
rlc:
|
||||
mode: am
|
||||
am:
|
||||
tx:
|
||||
sn: 12
|
||||
t-poll-retransmit: 80
|
||||
max-retx-threshold: 4
|
||||
poll-pdu: 64
|
||||
poll-byte: 125
|
||||
sn: 18
|
||||
t-poll-retransmit: 20
|
||||
max-retx-threshold: 32
|
||||
poll-pdu: 16
|
||||
poll-byte: -1
|
||||
queue-size: 16384
|
||||
queue-bytes: 6172672
|
||||
rx:
|
||||
sn: 12
|
||||
t-reassembly: 80
|
||||
sn: 18
|
||||
t-reassembly: 20
|
||||
t-status-prohibit: 10
|
||||
pdcp:
|
||||
integrity_required: false
|
||||
tx:
|
||||
sn: 12
|
||||
discard_timer: -1
|
||||
status_report_required: false
|
||||
rx:
|
||||
sn: 12
|
||||
t_reordering: 80
|
||||
out_of_order_delivery: false
|
||||
f1u_du:
|
||||
backoff_timer: 10
|
||||
f1u_cu_up:
|
||||
backoff_timer: 10
|
||||
|
@@ -52,7 +52,7 @@ sed -i 's|SRS_UE_IP|'$SRS_UE_IP'|g' /etc/srsran/gnb.yml
|
||||
# For dbus not started issue when host machine is running Ubuntu 22.04
|
||||
service dbus start && service avahi-daemon start
|
||||
|
||||
gnb -c /etc/srsran/gnb.yml -c /etc/srsran/qos.yml
|
||||
exec gnb -c /etc/srsran/gnb.yml -c /etc/srsran/qos.yml $@
|
||||
|
||||
# Sync docker time
|
||||
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
29
udm/udm.yaml
29
udm/udm.yaml
@@ -1,5 +1,6 @@
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/udm.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/udm.log
|
||||
|
||||
sbi:
|
||||
server:
|
||||
@@ -7,7 +8,9 @@ sbi:
|
||||
client:
|
||||
no_tls: true
|
||||
|
||||
parameter:
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
udm:
|
||||
hnet:
|
||||
@@ -18,17 +21,11 @@ udm:
|
||||
scheme: 2
|
||||
key: /open5gs/install/etc/open5gs/hnet/secp256r1-2.key
|
||||
sbi:
|
||||
- addr: UDM_IP
|
||||
port: 7777
|
||||
|
||||
scp:
|
||||
sbi:
|
||||
- addr:
|
||||
- SCP_IP
|
||||
port: 7777
|
||||
|
||||
nrf:
|
||||
sbi:
|
||||
- addr:
|
||||
- NRF_IP
|
||||
port: 7777
|
||||
server:
|
||||
- address: UDM_IP
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://NRF_IP:7777
|
||||
scp:
|
||||
- uri: http://SCP_IP:7777
|
||||
|
@@ -30,6 +30,7 @@ cp /mnt/udm/udm.yaml install/etc/open5gs
|
||||
sed -i 's|UDM_IP|'$UDM_IP'|g' install/etc/open5gs/udm.yaml
|
||||
sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/udm.yaml
|
||||
sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/udm.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/udm.yaml
|
||||
|
||||
cp /mnt/udm/curve25519-1.key install/etc/open5gs/hnet
|
||||
cp /mnt/udm/secp256r1-2.key install/etc/open5gs/hnet
|
||||
|
31
udr/udr.yaml
31
udr/udr.yaml
@@ -6,24 +6,21 @@ sbi:
|
||||
client:
|
||||
no_tls: true
|
||||
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/udr.log
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
parameter:
|
||||
logger:
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/udr.log
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: UDR_IP
|
||||
port: 7777
|
||||
|
||||
scp:
|
||||
sbi:
|
||||
- addr:
|
||||
- SCP_IP
|
||||
port: 7777
|
||||
|
||||
nrf:
|
||||
sbi:
|
||||
- addr:
|
||||
- NRF_IP
|
||||
port: 7777
|
||||
server:
|
||||
- address: UDR_IP
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://NRF_IP:7777
|
||||
scp:
|
||||
- uri: http://SCP_IP:7777
|
||||
|
@@ -33,6 +33,7 @@ sed -i 's|UDR_IP|'$UDR_IP'|g' install/etc/open5gs/udr.yaml
|
||||
sed -i 's|SCP_IP|'$SCP_IP'|g' install/etc/open5gs/udr.yaml
|
||||
sed -i 's|NRF_IP|'$NRF_IP'|g' install/etc/open5gs/udr.yaml
|
||||
sed -i 's|MONGO_IP|'$MONGO_IP'|g' install/etc/open5gs/udr.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/udr.yaml
|
||||
|
||||
# Sync docker time
|
||||
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
@@ -24,7 +24,7 @@
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
FROM ubuntu:focal as builder
|
||||
FROM ubuntu:jammy as builder
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
@@ -43,19 +43,8 @@ RUN apt-get update && \
|
||||
ifupdown \
|
||||
iputils-ping \
|
||||
wget \
|
||||
libssl-dev
|
||||
|
||||
RUN version=3.20 && \
|
||||
build=0 && \
|
||||
mkdir ~/temp && \
|
||||
cd ~/temp && \
|
||||
wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz && \
|
||||
tar -xzvf cmake-$version.$build.tar.gz && \
|
||||
cd cmake-$version.$build/ && \
|
||||
./bootstrap && \
|
||||
make -j`nproc` && \
|
||||
make install && ldconfig && \
|
||||
cmake --version
|
||||
libssl-dev \
|
||||
cmake
|
||||
|
||||
# Clone and build UERANSIM
|
||||
RUN git clone https://github.com/aligungr/UERANSIM && \
|
||||
@@ -63,7 +52,7 @@ RUN git clone https://github.com/aligungr/UERANSIM && \
|
||||
make -j`nproc`
|
||||
|
||||
# Build final image
|
||||
FROM ubuntu:focal
|
||||
FROM ubuntu:jammy
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
|
@@ -60,8 +60,7 @@ def start(ip_range):
|
||||
raise ValueError('Invalid UE IPv4 range. Only one IP given')
|
||||
else:
|
||||
first_ip_addr = first_ip_addr.exploded
|
||||
ip_netmask_prefix = ip_range.prefixlen
|
||||
print(str(first_ip_addr) + '/' + str(ip_netmask_prefix))
|
||||
print(str(first_ip_addr))
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
|
43
upf/upf.yaml
43
upf/upf.yaml
@@ -1,31 +1,40 @@
|
||||
logger:
|
||||
file: /open5gs/install/var/log/open5gs/upf.log
|
||||
file:
|
||||
path: /open5gs/install/var/log/open5gs/upf.log
|
||||
|
||||
parameter:
|
||||
global:
|
||||
max:
|
||||
ue: MAX_NUM_UE
|
||||
|
||||
upf:
|
||||
pfcp:
|
||||
- addr: UPF_IP
|
||||
server:
|
||||
- address: UPF_IP
|
||||
client:
|
||||
smf:
|
||||
- address: SMF_IP
|
||||
gtpu:
|
||||
- addr: UPF_IP
|
||||
advertise: UPF_ADVERTISE_IP
|
||||
subnet:
|
||||
- addr: UE_IPV4_INTERNET_TUN_IP
|
||||
dev: ogstun
|
||||
server:
|
||||
- address: UPF_IP
|
||||
advertise: UPF_ADVERTISE_IP
|
||||
session:
|
||||
- subnet: UE_IPV4_INTERNET_SUBNET
|
||||
gateway: UE_IPV4_INTERNET_TUN_IP
|
||||
dnn: internet
|
||||
- addr: 2001:230:cafe::1/48
|
||||
dev: ogstun
|
||||
- subnet: 2001:230:cafe::/48
|
||||
gateway: 2001:230:cafe::1
|
||||
dnn: internet
|
||||
- addr: UE_IPV4_IMS_TUN_IP
|
||||
dev: ogstun
|
||||
- subnet: UE_IPV4_IMS_SUBNET
|
||||
gateway: UE_IPV4_IMS_TUN_IP
|
||||
dnn: ims
|
||||
dev: ogstun2
|
||||
- addr: 2001:230:babe::1/48
|
||||
- subnet: 2001:230:babe::/48
|
||||
gateway: 2001:230:babe::1
|
||||
dnn: ims
|
||||
dev: ogstun2
|
||||
metrics:
|
||||
- addr: UPF_IP
|
||||
port: 9091
|
||||
|
||||
smf:
|
||||
pfcp:
|
||||
- addr: SMF_IP
|
||||
server:
|
||||
- address: UPF_IP
|
||||
port: 9091
|
||||
|
@@ -41,8 +41,11 @@ cp /mnt/upf/upf.yaml install/etc/open5gs
|
||||
sed -i 's|UPF_IP|'$UPF_IP'|g' install/etc/open5gs/upf.yaml
|
||||
sed -i 's|SMF_IP|'$SMF_IP'|g' install/etc/open5gs/upf.yaml
|
||||
sed -i 's|UE_IPV4_INTERNET_TUN_IP|'$UE_IPV4_INTERNET_TUN_IP'|g' install/etc/open5gs/upf.yaml
|
||||
sed -i 's|UE_IPV4_INTERNET_SUBNET|'$UE_IPV4_INTERNET'|g' install/etc/open5gs/upf.yaml
|
||||
sed -i 's|UE_IPV4_IMS_TUN_IP|'$UE_IPV4_IMS_TUN_IP'|g' install/etc/open5gs/upf.yaml
|
||||
sed -i 's|UE_IPV4_IMS_SUBNET|'$UE_IPV4_IMS'|g' install/etc/open5gs/upf.yaml
|
||||
sed -i 's|UPF_ADVERTISE_IP|'$UPF_ADVERTISE_IP'|g' install/etc/open5gs/upf.yaml
|
||||
sed -i 's|MAX_NUM_UE|'$MAX_NUM_UE'|g' install/etc/open5gs/upf.yaml
|
||||
|
||||
# Sync docker time
|
||||
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
Reference in New Issue
Block a user