diff --git a/README.md b/README.md index 5a9c924..17b3b31 100644 --- a/README.md +++ b/README.md @@ -439,5 +439,26 @@ Take note of **auc_id** specified in **Response body** under **Server response** **Replace scscf_peer, scscf and scscf_realm as per your deployment** +### Provisioning of Dialplan when using openSIPS IMS as follows: + +To ensure that the S-CSCF correctly recognizes the dialed numbers, it is necessary to configure the dial plan appropriately. This involves provisioning the dialplan table in MySQL by following these steps: + +1. Login into mysql openSIPS SCSCF database and insert dialplan rule + +``` +docker exec -it mysql mysql opensips_scscf +# Insert the dialplan rule - make sure you adapt the rule according to the MSISDN values configured in previous step +insert into dialplan (dpid, match_op, match_exp, repl_exp) values (1, 0, "9076543210", "USER"); +exit +``` + +More information regarding configuration of dialplan can be found in this link - https://github.com/OpenSIPS/opensips-ims-ce/blob/main/docs/scscf.md#configuration + +2. Once everything is set up, we need to reload OpenSIPS's dialplan cache + +``` +docker exec -it scscf opensips-cli -x mi dp_reload +``` + ## Not supported - IPv6 usage in Docker diff --git a/opensips_ims_pcscf/opensips.cfg b/opensips_ims_pcscf/opensips.cfg index 77bfc85..3761374 100644 --- a/opensips_ims_pcscf/opensips.cfg +++ b/opensips_ims_pcscf/opensips.cfg @@ -125,7 +125,7 @@ modparam("aaa_diameter", "aaa_url", modparam("proto_ipsec", "min_spi", 10000) modparam("proto_ipsec", "max_spi", 10100) -#modparam("proto_ipsec", "allowed_algorithms", "hmac-sha-1-96=null") +modparam("proto_ipsec", "allowed_algorithms", "hmac-sha-1-96=null") #### RTPENGINE module loadmodule "rtpengine.so" diff --git a/opensips_ims_pcscf/pcscf_init.sh b/opensips_ims_pcscf/pcscf_init.sh index 6f7e17c..2f19187 100755 --- a/opensips_ims_pcscf/pcscf_init.sh +++ b/opensips_ims_pcscf/pcscf_init.sh @@ -52,6 +52,7 @@ sed -i 's|PCRF_IP|'$PCRF_IP'|g' /etc/opensips/freeDiameter.conf sed -i 's|PCSCF_IP|'$PCSCF_IP'|g' /etc/opensips/freeDiameter.conf # Add static route to route traffic back to UE as there is not NATing +apt-get update && apt-get install -y iproute2 ip r add ${UE_IPV4_IMS} via ${UPF_IP} # Sync docker time diff --git a/opensips_ims_scscf/entrypoint.sh b/opensips_ims_scscf/entrypoint.sh deleted file mode 100755 index 9b3744b..0000000 --- a/opensips_ims_scscf/entrypoint.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/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. - -while ! mysqladmin ping -h ${MYSQL_IP} --silent; do - sleep 5; -done - -# Sleep until permissions are set -sleep 10; - -# Create SCSCF database, populate tables and grant privileges -if [[ -z "`mysql -u root -h ${MYSQL_IP} -qfsBe "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='scscf'" 2>&1`" ]]; -then - mysql -u root -h ${MYSQL_IP} -e "create database scscf;" - mysql -u root -h ${MYSQL_IP} scscf < /usr/share/opensips/mysql/standard-create.sql - mysql -u root -h ${MYSQL_IP} scscf < /usr/share/opensips/mysql/dialplan-create.sql - SCSCF_USER_EXISTS=`mysql -u root -h ${MYSQL_IP} -s -N -e "SELECT EXISTS(SELECT 1 FROM mysql.user WHERE User = 'scscf' AND Host = '%')"` - if [[ "$SCSCF_USER_EXISTS" == 0 ]] - then - mysql -u root -h ${MYSQL_IP} -e "CREATE USER 'scscf'@'%' IDENTIFIED WITH mysql_native_password BY 'heslo'"; - mysql -u root -h ${MYSQL_IP} -e "CREATE USER 'scscf'@'$SCSCF_IP' IDENTIFIED WITH mysql_native_password BY 'heslo'"; - mysql -u root -h ${MYSQL_IP} -e "GRANT ALL ON scscf.* TO 'scscf'@'%'"; - mysql -u root -h ${MYSQL_IP} -e "GRANT ALL ON scscf.* TO 'scscf'@'$SCSCF_IP'"; - mysql -u root -h ${MYSQL_IP} -e "FLUSH PRIVILEGES;" - fi -fi - -exec /usr/sbin/opensips -F $@ diff --git a/opensips_ims_scscf/opensips.cfg b/opensips_ims_scscf/opensips.cfg index cf5875b..2708c84 100644 --- a/opensips_ims_scscf/opensips.cfg +++ b/opensips_ims_scscf/opensips.cfg @@ -120,7 +120,7 @@ modparam("aka_av_diameter", "aaa_url", #### dialplan module loadmodule "dialplan.so" -modparam("dialplan","db_url", "mysql://scscf:heslo@MYSQL_IP/opensips_scscf") +modparam("dialplan","db_url", "mysql://opensips_scscf:heslo@MYSQL_IP/opensips_scscf") #### auth module diff --git a/opensips_ims_scscf/scscf_init.sh b/opensips_ims_scscf/scscf_init.sh index dcc5846..15f2fc0 100755 --- a/opensips_ims_scscf/scscf_init.sh +++ b/opensips_ims_scscf/scscf_init.sh @@ -44,6 +44,8 @@ sleep 10; if [[ -z "`mysql -u root -h ${MYSQL_IP} -qfsBe "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='opensips_scscf'" 2>&1`" ]]; then mysql -u root -h ${MYSQL_IP} -e "create database opensips_scscf;" + mysql -u root -h ${MYSQL_IP} opensips_scscf < /usr/share/opensips/mysql/standard-create.sql + mysql -u root -h ${MYSQL_IP} opensips_scscf < /usr/share/opensips/mysql/dialplan-create.sql SCSCF_USER_EXISTS=`mysql -u root -h ${MYSQL_IP} -s -N -e "SELECT EXISTS(SELECT 1 FROM mysql.user WHERE User = 'opensips_scscf' AND Host = '%')"` if [[ "$SCSCF_USER_EXISTS" == 0 ]] then diff --git a/srsran/qos.yml b/srsran/qos.yml index 7d839b1..ed6f8ee 100644 --- a/srsran/qos.yml +++ b/srsran/qos.yml @@ -7,17 +7,7 @@ qos: - five_qi: 1 # E.g. Conversational Voice - rlc: - mode: um-bidir - um-bidir: - tx: - sn: 12 - queue-size: 4096 - rx: - sn: 12 - t-reassembly: 50 pdcp: - integrity_required: false tx: sn: 12 discard_timer: -1 @@ -26,28 +16,23 @@ qos: sn: 12 t_reordering: 80 out_of_order_delivery: false - f1u_du: - backoff_timer: 10 f1u_cu_up: backoff_timer: 10 - mac: - lc_priority: 4 - lc_group_id: 1 - bucket_size_duration_ms: 5 - prioritized_bit_rate_kBps: 65537 - - - five_qi: 2 # E.g. Conversational Video + f1u_du: + backoff_timer: 10 rlc: mode: um-bidir um-bidir: tx: sn: 12 - queue-size: 4096 + queue-size: 16384 + queue-bytes: 6172672 rx: sn: 12 t-reassembly: 50 + - + five_qi: 2 # E.g. Conversational Video pdcp: - integrity_required: false tx: sn: 12 discard_timer: -1 @@ -56,15 +41,20 @@ qos: sn: 12 t_reordering: 80 out_of_order_delivery: false - f1u_du: - backoff_timer: 10 f1u_cu_up: backoff_timer: 10 - mac: - lc_priority: 4 - lc_group_id: 1 - bucket_size_duration_ms: 5 - prioritized_bit_rate_kBps: 65537 + 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 - five_qi: 5 # E.g. IMS signaling rlc: @@ -76,7 +66,8 @@ qos: max-retx-threshold: 4 poll-pdu: 64 poll-byte: 125 - queue-size: 4096 + queue-size: 16384 + queue-bytes: 6172672 rx: sn: 12 t-reassembly: 80 @@ -95,22 +86,8 @@ qos: backoff_timer: 10 f1u_cu_up: backoff_timer: 10 - mac: - lc_priority: 5 - lc_group_id: 2 - bucket_size_duration_ms: 5 - prioritized_bit_rate_kBps: 65537 - five_qi: 7 # E.g. Voice, Video (live streaming) - rlc: - mode: um-bidir - um-bidir: - tx: - sn: 12 - queue-size: 4096 - rx: - sn: 12 - t-reassembly: 50 pdcp: integrity_required: false tx: @@ -121,47 +98,47 @@ qos: sn: 12 t_reordering: 80 out_of_order_delivery: false - f1u_du: - backoff_timer: 10 f1u_cu_up: backoff_timer: 10 - mac: - lc_priority: 4 - lc_group_id: 1 - bucket_size_duration_ms: 5 - prioritized_bit_rate_kBps: 65537 - - - five_qi: 9 # E.g. Buffered video streaming, TCP-based traffic + f1u_du: + backoff_timer: 10 rlc: - mode: am - am: + mode: um-bidir + um-bidir: tx: sn: 12 - t-poll-retransmit: 80 - max-retx-threshold: 4 - poll-pdu: 64 - poll-byte: 125 - queue-size: 4096 + queue-size: 16384 + queue-bytes: 6172672 rx: sn: 12 - t-reassembly: 80 - t-status-prohibit: 10 + 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_du: - backoff_timer: 10 f1u_cu_up: backoff_timer: 10 - mac: - lc_priority: 5 - lc_group_id: 2 - bucket_size_duration_ms: 5 - prioritized_bit_rate_kBps: 65537 + f1u_du: + backoff_timer: 10 + rlc: + mode: am + am: + tx: + sn: 18 + t-poll-retransmit: 20 + max-retx-threshold: 32 + poll-pdu: 16 + poll-byte: -1 + queue-size: 16384 + queue-bytes: 6172672 + rx: + sn: 18 + t-reassembly: 20 + t-status-prohibit: 10 diff --git a/srsran/srsran_init.sh b/srsran/srsran_init.sh index 3b6fd05..11db21a 100755 --- a/srsran/srsran_init.sh +++ b/srsran/srsran_init.sh @@ -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