From 026a5d3b1a77506a0e9991cc4260463abfc4cb9c Mon Sep 17 00:00:00 2001 From: Mathias WOLFF Date: Thu, 18 Apr 2024 12:29:38 +0200 Subject: [PATCH 1/3] fix(pks-admin): type of rules : error in enum --- src/sip/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sip/docker-compose.yml b/src/sip/docker-compose.yml index 459b9c3c..639c4adb 100644 --- a/src/sip/docker-compose.yml +++ b/src/sip/docker-compose.yml @@ -132,7 +132,7 @@ services: pks-admin: container_name: pks-admin hostname: admin.pks.local - image: mwolff44w/pks-admin:v1.2.1 + image: mwolff44w/pks-admin:v1.2.2 restart: unless-stopped depends_on: pks-db: From 9c0c9dfc73753f8e0542d8d65af19a37a6797663 Mon Sep 17 00:00:00 2001 From: Mathias WOLFF Date: Thu, 18 Apr 2024 14:03:36 +0200 Subject: [PATCH 2/3] feat(pks-admin): update to 1.3.0 : kamcmd translate added --- src/sip/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sip/docker-compose.yml b/src/sip/docker-compose.yml index 639c4adb..bafb18f6 100644 --- a/src/sip/docker-compose.yml +++ b/src/sip/docker-compose.yml @@ -132,7 +132,7 @@ services: pks-admin: container_name: pks-admin hostname: admin.pks.local - image: mwolff44w/pks-admin:v1.2.2 + image: mwolff44w/pks-admin:v1.3.0 restart: unless-stopped depends_on: pks-db: From 5110fa8ad945954221d3f171b57dcc85c60278cc Mon Sep 17 00:00:00 2001 From: Mathias WOLFF Date: Thu, 18 Apr 2024 14:11:24 +0200 Subject: [PATCH 3/3] fix(pks-sip): bug in external routing --- src/pks | 2 +- src/sip/kamailio.cfg | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/pks b/src/pks index 876a73c0..51ebc688 100755 --- a/src/pks +++ b/src/pks @@ -10,7 +10,7 @@ export PATH+=':/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' # Variables -VERSION="v4.0.3" +VERSION="v4.0.4" readonly PKS_GIT_URL="https://raw.githubusercontent.com/mwolff44/pyfreebilling" readonly DATA_DIR="/srv" ENV_FILE="/srv/pks/.env" diff --git a/src/sip/kamailio.cfg b/src/sip/kamailio.cfg index 134fed55..63f04f9e 100644 --- a/src/sip/kamailio.cfg +++ b/src/sip/kamailio.cfg @@ -715,19 +715,6 @@ route[DISPATCH] { switch ($var(rule3)) { case -2: xinfo("INFO | No internal routing rule found for GW (IP:$si:$sp) associated with '$rU'\n"); - $var(rule2) = dp_match("2", "$rU"); - switch ($var(rule2)) { - case -2: - xwarn("INFO | No external routing rule found for GW (IP:$si:$sp) associated with '$rU'\n"); - $var(rule2) = dp_match("2", "$rU"); - return; - case -1: - xerr("ALERT | Error finding external routing rule for GW (IP:$si:$sp) associated with '$rU'\n"); - exit; - case 1: - xinfo("INFO | The external routing rule for GW (IP:$si:$sp) associated with '$rU' are '$avp(s:dest)'\n"); - return; - } return; case -1: xerr("ALERT | Error finding internal routing rule for GW (IP:$si:$sp) associated with '$rU'\n"); @@ -736,6 +723,20 @@ route[DISPATCH] { xinfo("INFO | The internal routing rule for GW (IP:$si:$sp) associated with '$rU' are '$avp(s:dest)'\n"); return; } + if (!$avp(s:dest)) { + $var(rule2) = dp_match("2", "$rU"); + switch ($var(rule2)) { + case -2: + xwarn("INFO | No external routing rule found for GW (IP:$si:$sp) associated with '$rU'\n"); + return; + case -1: + xerr("ALERT | Error finding external routing rule for GW (IP:$si:$sp) associated with '$rU'\n"); + exit; + case 1: + xinfo("INFO | The external routing rule for GW (IP:$si:$sp) associated with '$rU' are '$avp(s:dest)'\n"); + return; + } + } } else if(isflagset(FLAG_FROM_PROV)) { $fsn = "private"; $var(rule1) = dp_match("1", "$rU");