### Description
When kamailio need to pass call from carrier to customer VoIP PBX in docker container on swarm cluster then it not possible.
Network interconnection.
In docker environment eth1 NIC of kamailio and VoIP PBX connected to internet via iptables masquerading. eth1 NIC of kamailio and VoIP PBX have random IP address and generally no way to pass message between kamailio and VoIP PBX via eth1 NIC.
Also both containers have eth0 NIC in same network with static IP. But network on eth0 NIC not connected to Internet.
SIP signaling is passed like
eth1-Kamailio-eth0 <-> eth0-VoIP PBX
In this network kamailio add/removes two Record-Route. For ACK message with two `Route` headers this rule does not work. Each `Route` headers for same kamailio instance and must be translated by one loose_route call
```
The proxy will inspect the URI in the topmost Route header
field value. If it indicates this proxy, the proxy removes it
from the Route header field (this route node has been
reached).
```
Really `Route` headers translated separately and second `loose_route` cannot be completed. Details in `details.txt`
[details.txt](https://github.com/kamailio/kamailio/files/1220872/details.txt)
Wireshark pcap file and kamailio log with enabled debug attached of similar calls is attached.
[full-call.zip](https://github.com/kamailio/kamailio/files/1220875/full-call…
#### Reproduction
Create config when kamailio add two `Record-Route` headers and send ACK with two `Route` headers
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1215
Module: kamailio
Branch: master
Commit: f5ea35bc424f34c64ee71a745db93326f597c4a1
URL: https://github.com/kamailio/kamailio/commit/f5ea35bc424f34c64ee71a745db9332…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-12-01T11:07:07+01:00
test/unit: 3.sh - updates for using db root password with kamdbctl
---
Modified: test/unit/3.sh
---
Diff: https://github.com/kamailio/kamailio/commit/f5ea35bc424f34c64ee71a745db9332…
Patch: https://github.com/kamailio/kamailio/commit/f5ea35bc424f34c64ee71a745db9332…
---
diff --git a/test/unit/3.sh b/test/unit/3.sh
index 03c98b04fb..4b039ba9b0 100755
--- a/test/unit/3.sh
+++ b/test/unit/3.sh
@@ -20,10 +20,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Needs a mysql database, the root user password must be assigned to
-# the 'PW' variable in the file 'dbrootpw' in the test directory, e.g.:
-# PW=sql_root_passwd
+# the 'DBROOTPW' variable in the file 'dbrootpw' in the test directory, e.g.:
+# DBROOTPW=sql_root_passwd
# If MySQL root password is empty, add in the file the line:
-# PWSKIP=yes
+# DBROOTPWSKIP=yes
. include/common
@@ -50,13 +50,13 @@ sed -i '' -e "s/TEST=\"false\"/TEST=\"true\"/g" $DBCTL
# set the mysql root password
cp $DBCTL.mysql $DBCTL.mysql.bak
-sed -i '' -e "s/#PW=\"\"/PW=\"$PW\"/g" $DBCTL.mysql
+sed -i '' -e "s/#DBROOTPW=\"\"/DBROOTPW=\"$DBROOTPW\"/g" $DBCTL.mysql
-PWSKIP="$PWSKIP" CHARSET="latin1" ./$DBCTL create $tmp_name > /dev/null
+DBROOTPWSKIP="$DBROOTPWSKIP" CHARSET="latin1" ./$DBCTL create $tmp_name > /dev/null
ret=$?
if [ "$ret" -eq 0 ] ; then
- PWSKIP="$PWSKIP" ./$DBCTL drop $tmp_name > /dev/null
+ DBROOTPWSKIP="$DBROOTPWSKIP" ./$DBCTL drop $tmp_name > /dev/null
ret=$?
fi ;
Module: kamailio
Branch: master
Commit: 313805136d22ed79d1c4900753247032240d5a5b
URL: https://github.com/kamailio/kamailio/commit/313805136d22ed79d1c490075324703…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-12-01T11:05:21+01:00
kamctl: expose db root password variable used by kamdbctl.mysql in kamctlrc
- DBROOTPW can be now set in kamctlrc
- targeting use for automatic testing
---
Modified: utils/kamctl/kamctlrc
Modified: utils/kamctl/kamdbctl.mysql
---
Diff: https://github.com/kamailio/kamailio/commit/313805136d22ed79d1c490075324703…
Patch: https://github.com/kamailio/kamailio/commit/313805136d22ed79d1c490075324703…
---
diff --git a/utils/kamctl/kamctlrc b/utils/kamctl/kamctlrc
index 6ac3cd4c2e..46fcdf5664 100644
--- a/utils/kamctl/kamctlrc
+++ b/utils/kamctl/kamctlrc
@@ -47,6 +47,11 @@
## database super user (for ORACLE this is 'scheme-creator' user)
# DBROOTUSER="root"
+## password for database super user
+## - important: this is insecure, targeting the use only for automatic testing
+## - known to work for: mysql
+# DBROOTPW="dbrootpw"
+
## database character set (used by MySQL when creating database)
#CHARSET="latin1"
diff --git a/utils/kamctl/kamdbctl.mysql b/utils/kamctl/kamdbctl.mysql
index 8d090fc7fe..422eed8beb 100644
--- a/utils/kamctl/kamdbctl.mysql
+++ b/utils/kamctl/kamdbctl.mysql
@@ -32,10 +32,10 @@ if [ -z "$DBROOTUSER" ]; then
DBROOTUSER="root"
fi
-# Uncomment this to set the database root password if you want to run this
-# script without any user prompt. This is unsafe, but useful e.g. for
-# automatic testing.
-#PW=""
+# Set DBROOTPW in kamctlrc or via next line to set the database
+# root password if you want to run this script without any user prompt.
+# This is unsafe, but useful e.g. for automatic testing.
+#DBROOTPW=""
if [ -z "$DBPORT" ] ; then
@@ -55,13 +55,13 @@ prompt_pw()
savetty=`stty -g`
echo -n "MySQL password for $DBROOTUSER: "
stty -echo
- read PW
+ read DBROOTPW
stty $savetty
echo
- export PW
+ export DBROOTPW
}
-# execute sql command with optional db name
+# execute sql command with optional db name
# and password parameters given
sql_query()
{
@@ -72,14 +72,14 @@ sql_query()
DB=""
fi
shift
- if [ -n "$PW" ]; then
- $CMD "-p$PW" $DB -e "$@"
+ if [ -n "$DBROOTPW" ]; then
+ $CMD "-p$DBROOTPW" $DB -e "$@"
else
$CMD $DB -e "$@"
fi
else
- if [ -n "$PW" ]; then
- $CMD "-p$PW" "$@"
+ if [ -n "$DBROOTPW" ]; then
+ $CMD "-p$DBROOTPW" "$@"
else
$CMD "$@"
fi
@@ -106,9 +106,9 @@ kamailio_drop() # pars: <database name>
db_charset_test()
{
- if [ -n "$PW" ]; then
- CURRCHARSET=`echo "show variables like '%character_set_server%'" | $CMD "-p$PW" | $AWK '{print $2}' | $SED -e 1d`
- ALLCHARSETS=`echo "show character set" | $CMD "-p$PW" | $AWK '{print $1}' | $SED -e 1d | $GREP -iv -e "utf8\|ucs2"`
+ if [ -n "$DBROOTPW" ]; then
+ CURRCHARSET=`echo "show variables like '%character_set_server%'" | $CMD "-p$DBROOTPW" | $AWK '{print $2}' | $SED -e 1d`
+ ALLCHARSETS=`echo "show character set" | $CMD "-p$DBROOTPW" | $AWK '{print $1}' | $SED -e 1d | $GREP -iv -e "utf8\|ucs2"`
else
CURRCHARSET=`echo "show variables like '%character_set_server%'" | $CMD | $AWK '{print $2}' | $SED -e 1d`
ALLCHARSETS=`echo "show character set" | $CMD | $AWK '{print $1}' | $SED -e 1d | $GREP -iv -e "utf8\|ucs2"`
@@ -386,7 +386,7 @@ migrate_table () # 4 paremeters (dst_table, dst_cols, src_table, src_cols)
if [ $? -ne 0 ] ; then
echo $X | $GREP "ERROR 1146" > /dev/null
- if [ $? -eq 0 ] ; then
+ if [ $? -eq 0 ] ; then
echo " -- Migrating $3 to $1.....SKIPPED (no source)"
return 0
fi
@@ -540,9 +540,9 @@ fi
} #end migrate_db()
-export PW
-if [ "$#" -ne 0 ] && [ "$PW" = "" ]; then
- if [ "$PWSKIP" = "" ]; then
+export DBROOTPW
+if [ "$#" -ne 0 ] && [ "$DBROOTPW" = "" ]; then
+ if [ "$DBROOTPWSKIP" = "" ]; then
prompt_pw
fi
fi
Module: kamailio
Branch: master
Commit: ebe117cae681c373a3e9f32e3fb392e31605039f
URL: https://github.com/kamailio/kamailio/commit/ebe117cae681c373a3e9f32e3fb392e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-12-01T10:47:41+01:00
test/unit: 24.sh - removed invalid comment about mysql
---
Modified: test/unit/24.sh
---
Diff: https://github.com/kamailio/kamailio/commit/ebe117cae681c373a3e9f32e3fb392e…
Patch: https://github.com/kamailio/kamailio/commit/ebe117cae681c373a3e9f32e3fb392e…
---
diff --git a/test/unit/24.sh b/test/unit/24.sh
index 196bb9df2a..cc85017493 100755
--- a/test/unit/24.sh
+++ b/test/unit/24.sh
@@ -19,9 +19,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-# Needs a mysql database, the root user password must be given
-# in the file 'dbrootpw' in the test directory
-
. include/common
if [ ! -f ~/.pgpass ] ; then