From 8b3b2dee4bd4d7d036db6f7a941db2657e359a1f Mon Sep 17 00:00:00 2001 From: Matteo Valentini Date: Fri, 6 Dec 2024 15:06:29 +0100 Subject: [PATCH 1/5] ci: create testing release on PR merge to main --- .github/workflows/create-testing-release.yml | 30 ++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/create-testing-release.yml diff --git a/.github/workflows/create-testing-release.yml b/.github/workflows/create-testing-release.yml new file mode 100644 index 0000000..cf20d4d --- /dev/null +++ b/.github/workflows/create-testing-release.yml @@ -0,0 +1,30 @@ +name: NS8 Release on PR Merge to Main + +on: + pull_request: + types: [closed] + paths-ignore: + - '.github/**' + - 'tests/**' + - 'README.md' + - '.gitignore' + - 'LICENSE' + - 'renovate.json' + - 'test-module.sh' + +env: + GH_TOKEN: ${{ secrets.NS8_MODULE_RELEASES_TOKEN }} + +jobs: + release-module: + if: > + github.event.pull_request.merged == true && + github.event.pull_request.base.ref == 'main' + runs-on: ubuntu-latest + + steps: + - name: Install NS8 Release Module Extension + run: gh extension install NethServer/gh-ns8-release-module + + - name: Create Testing Release + run: gh ns8-release-module create --repo ${{ github.repository }} --testing From ab751af3b299bda2a7d07c095e5555a270182056 Mon Sep 17 00:00:00 2001 From: Matteo Valentini Date: Fri, 6 Dec 2024 15:20:50 +0100 Subject: [PATCH 2/5] ci: add workflow to label PRs from Weblate --- .github/workflows/label-pr-from-weblate.yml | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/label-pr-from-weblate.yml diff --git a/.github/workflows/label-pr-from-weblate.yml b/.github/workflows/label-pr-from-weblate.yml new file mode 100644 index 0000000..76d0975 --- /dev/null +++ b/.github/workflows/label-pr-from-weblate.yml @@ -0,0 +1,25 @@ +name: "Label PR from Weblate" + +on: + pull_request: + types: [opened] + +jobs: + label-pr: + runs-on: ubuntu-latest + steps: + - name: Check if PR is from Weblate + id: check_weblate + run: | + if [[ "${{ github.event.pull_request.user.login }}" == "weblate" ]]; then + echo "from_weblate=true" >> $GITHUB_OUTPUT + else + echo "from_weblate=false" >> $GITHUB_OUTPUT + fi + + - name: Assign label + if: steps.check_weblate.outputs.from_weblate == 'true' + uses: actions/labeler@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + labels: 'translation' From 01e4630c5e02cc05ac03ed98ed85afb05f9deb2c Mon Sep 17 00:00:00 2001 From: Stefano Fancello Date: Thu, 14 Nov 2024 12:59:45 +0100 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20Add=20siptrace=20module=20for=20TLS?= =?UTF-8?q?=20traffic=20debugging=20=F0=9F=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Load siptrace module to enable debugging of TLS traffic. Set it to be disabled by default to avoid unnecessary tracing on startup. This can be toggled at runtime using: - `kamcmd siptrace.status on` to enable - `kamcmd siptrace.status off` to disable This setup provides a flexible debugging option without impacting performance in regular operation. --- modules/kamailio/config/kamailio.cfg | 6 +----- modules/kamailio/config/template.kamailio-local.cfg | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/kamailio/config/kamailio.cfg b/modules/kamailio/config/kamailio.cfg index 1c9b9f6..2572f4c 100644 --- a/modules/kamailio/config/kamailio.cfg +++ b/modules/kamailio/config/kamailio.cfg @@ -99,9 +99,7 @@ loadmodule "http_async_client.so" loadmodule "acc.so" loadmodule "uac.so" loadmodule "sdpops.so" -#!ifdef WITH_SIPTRACE loadmodule "siptrace.so" -#!endif # ----------------------------------------------------------------------------- @@ -167,15 +165,13 @@ modparam("pv", "shvset", "fakeprack=i:0") #!ifdef WITH_TLS modparam("tls", "config", "/etc/kamailio/tls/") #!endif -#!ifdef WITH_SIPTRACE modparam("siptrace", "trace_mode", 1) modparam("siptrace", "trace_to_database", 0) -modparam("siptrace", "trace_on", 1) +modparam("siptrace", "trace_on", 0) modparam("siptrace", "duplicate_uri", "sip:127.0.0.1:5065") modparam("siptrace", "hep_mode_on", 1) modparam("siptrace", "hep_version", 2) modparam("siptrace", "hep_capture_id", 1) -#!endif # ----------------------------------------------------------------------------- # Routing Logic diff --git a/modules/kamailio/config/template.kamailio-local.cfg b/modules/kamailio/config/template.kamailio-local.cfg index ce8e29f..54f60be 100644 --- a/modules/kamailio/config/template.kamailio-local.cfg +++ b/modules/kamailio/config/template.kamailio-local.cfg @@ -49,7 +49,6 @@ #!define WITH_TLS #!define LOCALNETWORKS "${LOCALNETWORKS}" #!define PRIVATE_IP "${PRIVATE_IP}" -##!define WITH_SIPTRACE server_header="Server: ${KML_SERVER_HEADER}" user_agent_header="User-Agent: ${KML_UA_HEADER}" From 1be506b92d34c6c2f9a47f9aac6bc2526f725a61 Mon Sep 17 00:00:00 2001 From: Stefano Fancello Date: Thu, 14 Nov 2024 15:01:57 +0100 Subject: [PATCH 4/5] Enable SIP tracing on support session events Trigger `kamcmd siptrace.status on` in the Kamailio container when the `support-session-started` event is fired by NethServer 8. Conversely, run `kamcmd siptrace.status off` on the `support-session-stopped` event to disable SIP tracing. This change allows dynamic control of Kamailio SIP tracing, specifically for TLS debugging purposes, helping to limit trace data only when support session is activated. --- .../events/support-session-started/10enable_siptrace | 11 +++++++++++ .../events/support-session-stopped/10disable_siptrace | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100755 imageroot/events/support-session-started/10enable_siptrace create mode 100755 imageroot/events/support-session-stopped/10disable_siptrace diff --git a/imageroot/events/support-session-started/10enable_siptrace b/imageroot/events/support-session-started/10enable_siptrace new file mode 100755 index 0000000..595a149 --- /dev/null +++ b/imageroot/events/support-session-started/10enable_siptrace @@ -0,0 +1,11 @@ +#!/bin/bash + +# +# Copyright (C) 2024 Nethesis S.r.l. +# SPDX-License-Identifier: GPL-3.0-or-later +# + +exec 1>&2 +set -e + +podman exec kamailio kamcmd siptrace.status on diff --git a/imageroot/events/support-session-stopped/10disable_siptrace b/imageroot/events/support-session-stopped/10disable_siptrace new file mode 100755 index 0000000..acd0dcd --- /dev/null +++ b/imageroot/events/support-session-stopped/10disable_siptrace @@ -0,0 +1,11 @@ +#!/bin/bash + +# +# Copyright (C) 2024 Nethesis S.r.l. +# SPDX-License-Identifier: GPL-3.0-or-later +# + +exec 1>&2 +set -e + +podman exec kamailio kamcmd siptrace.status off From 140611c93a17a06f2c1b651909c05cfaee006752 Mon Sep 17 00:00:00 2001 From: Stefano Date: Wed, 8 Jan 2025 10:31:23 +0100 Subject: [PATCH 5/5] [OW-455] Implement topos disable when header topos : 0 (#51) NethServer/dev#7183 Co-authored-by: Paolo --- modules/kamailio/config/kamailio.cfg | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/kamailio/config/kamailio.cfg b/modules/kamailio/config/kamailio.cfg index 2572f4c..5da4a0b 100644 --- a/modules/kamailio/config/kamailio.cfg +++ b/modules/kamailio/config/kamailio.cfg @@ -781,6 +781,14 @@ failure_route[MANAGE_FAILURE] { # event_route[topos:msg-sending] # ----------------------------------------------------------------------------- event_route[topos:msg-sending] { + if is_method("INVITE") { + if($hdr(topos) == "0") { + xlog('L_INFO', "(event_route[topos:msg-sending]) $ci $rm-$cs topos: $hdr(topos) ----- will not apply topos\n"); + remove_hf("topos"); + msg_apply_changes(); + drop; + } + } if ($rd!=$null) { if is_method("OPTIONS|NOTIFY|SUBSCRIBE") { drop;