Hello,
I have discovered that calling rtpproxy_manage for a failure response
will cause a segfault if certain flags are passed.
E.g. A "488 Not Acceptable Here" response that calls
"rtpproxy_manage("fco+SP") during a failure_route will crash.
This is because the OP_DELETE operation does not initialise the flags
variable. See rtpproxy.c:1119 (rtpp_function_call(...))
I've attached a patch that will only add items to initialised lists. I
assume that no flags are required for a DELETE operation, but please
confirm this and review!
Regards,
Hugh
--
Hugh Waite
Principal Design Engineer
Crocodile RCS Ltd.
Module: sip-router
Branch: master
Commit: 727aa357d9ee8abcb8471733e22886d2cff386db
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=727aa35…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Aug 27 14:00:17 2013 +0200
kamdbctl: new command add-tables
- creates only tables that are groupped under same id, thus have the sql
script in a file
- syntax: kamdbctl add-tables <gid>
- there has to be a <gid>-create.sql script
- eg: kamdbctl add-tables lcr
---
utils/kamctl/kamdbctl | 17 +++++++++++++++++
utils/kamctl/kamdbctl.base | 1 +
utils/kamctl/kamdbctl.mysql | 22 ++++++++++++++++++++++
3 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/utils/kamctl/kamdbctl b/utils/kamctl/kamdbctl
index 935e106..e9249d8 100755
--- a/utils/kamctl/kamdbctl
+++ b/utils/kamctl/kamdbctl
@@ -444,6 +444,23 @@ case $1 in
kamailio_db_revoke $DBNAME
exit $?
;;
+ add-tables)
+ if [ "$USED_DBENGINE" != "mysql" ] ; then
+ merr "$USED_DBENGINE don't support add-tables operation"
+ exit 1
+ fi
+ if [ $# -ne 2 ] ; then
+ merr "add-tables requires 1 parameter: group id of tables"
+ exit 1
+ fi
+ if [ -z "$DBNAME" ] ; then
+ merr "DBNAME is not set"
+ exit 1
+ fi
+
+ kamailio_add_tables $DBNAME $2
+ exit $?
+ ;;
bdb|db_berkeley)
shift
kamailio_berkeley "$@"
diff --git a/utils/kamctl/kamdbctl.base b/utils/kamctl/kamdbctl.base
index ab4dc87..364e4c2 100644
--- a/utils/kamctl/kamdbctl.base
+++ b/utils/kamctl/kamdbctl.base
@@ -107,6 +107,7 @@ usage: $COMMAND create <db name or db_path, optional> ...(creates a new database
$COMMAND dbonly ..................................(creates empty database)
$COMMAND grant ...................................(grant privileges to database)
$COMMAND revoke ..................................(revoke privileges to database)
+ $COMMAND add-tables <gid> ........................(creates only tables groupped in gid)
if you want to manipulate database as other database user than
root, want to change database name from default value "$DBNAME",
diff --git a/utils/kamctl/kamdbctl.mysql b/utils/kamctl/kamdbctl.mysql
index e4825ab..0c6d5d3 100644
--- a/utils/kamctl/kamdbctl.mysql
+++ b/utils/kamctl/kamdbctl.mysql
@@ -345,6 +345,28 @@ dbuid_create () # pars: <database name>
} # end uid_create
+kamailio_add_tables () # params: <database name> <tables group name>
+{
+ if [ $# -ne 2 ] ; then
+ merr "kamailio_add_tables function takes two params"
+ exit 1
+ fi
+
+ minfo "creating group of tables [$2] into database [$1] ..."
+
+ if [ -e $DB_SCHEMA/$2-create.sql ]
+ then
+ sql_query $1 < $DB_SCHEMA/$2-create.sql
+ if [ $? -ne 0 ] ; then
+ merr "Creating group of tables [$2] failed"
+ exit 1
+ fi
+ else
+ merr "Script for creating group of tables [$2] not found"
+ exit 1
+ fi
+} # end kamailio_add_tables
+
migrate_table () # 4 paremeters (dst_table, dst_cols, src_table, src_cols)
{
if [ $# -ne 4 ] ; then
Module: sip-router
Branch: master
Commit: a075383454c92bed225b7904920090f515a938d5
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a075383…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Aug 27 11:16:52 2013 +0200
kamctl: use FIFOPATH instead of OSER_FIFO in kamctlrc
- no longer relation to former project name, however OSER_FIFO can still
be set to keep the compatibility with older deployemnts, but will be
used only when FIFOPATH is not explicitely set
---
utils/kamctl/kamctl.fifo | 34 +++++++++++++++++++---------------
utils/kamctl/kamctlrc | 2 +-
2 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/utils/kamctl/kamctl.fifo b/utils/kamctl/kamctl.fifo
index fead9de..50c8e92 100644
--- a/utils/kamctl/kamctl.fifo
+++ b/utils/kamctl/kamctl.fifo
@@ -23,8 +23,12 @@ fi
##### ----------------------------------------------- #####
### parameters
#
-if [ -z "$OSER_FIFO" ]; then
- OSER_FIFO=/tmp/kamailio_fifo
+if [ -z "$FIFOPATH" ]; then
+ if [ -z "$OSER_FIFO" ]; then
+ FIFOPATH=/tmp/kamailio_fifo
+ else
+ FIFOPATH=$OSER_FIFO
+ fi
fi
#
@@ -53,12 +57,12 @@ fifo_cmd()
fi
name=kamailio_receiver_$$
path=$CHROOT_DIR/tmp/$name
- if [ ! -w $OSER_FIFO ]; then
- merr "Error opening Kamailio's FIFO $OSER_FIFO"
- merr "Make sure you have the line 'modparam(\"mi_fifo\", \"fifo_name\", \"$OSER_FIFO\")' in your config"
+ if [ ! -w $FIFOPATH ]; then
+ merr "Error opening Kamailio's FIFO $FIFOPATH"
+ merr "Make sure you have the line 'modparam(\"mi_fifo\", \"fifo_name\", \"$FIFOPATH\")' in your config"
merr "and also have loaded the mi_fifo module."
if [ ! -z $CHROOT_DIR ]; then
- merr "[chrooted environment] Check that $OSER_FIFO is symlinked to ${CHROOT_DIR}${OSER_FIFO}"
+ merr "[chrooted environment] Check that $FIFOPATH is symlinked to ${CHROOT_DIR}${FIFOPATH}"
fi
exit 2
fi
@@ -87,7 +91,7 @@ fifo_cmd()
cat < $path | filter_fl &
# issue FIFO request (printf taken to deal with \n)
- printf "$CMD" > $OSER_FIFO
+ printf "$CMD" > $FIFOPATH
# wait for the reader to complete
wait
@@ -102,9 +106,9 @@ CTLCMD=fifo_cmd
fifo_kamailio_monitor() {
name=kamailio_receiver_$$
path=$CHROOT_DIR/tmp/$name
- if [ ! -w $OSER_FIFO ]; then
- merr "Error opening Kamailio's FIFO $OSER_FIFO"
- merr "Make sure you have the line 'modparam(\"mi_fifo\", \"fifo_name\", \"$OSER_FIFO\")' in your config"
+ if [ ! -w $FIFOPATH ]; then
+ merr "Error opening Kamailio's FIFO $FIFOPATH"
+ merr "Make sure you have the line 'modparam(\"mi_fifo\", \"fifo_name\", \"$FIFOPATH\")' in your config"
merr "and also have loaded the mi_fifo module."
exit 1
fi
@@ -133,14 +137,14 @@ fifo_kamailio_monitor() {
mecho "[cycle #: $attempt; if constant make sure server lives]"
cat < $path | filter_fl &
- cat > $OSER_FIFO <<EOF
+ cat > $FIFOPATH <<EOF
:version:$name
EOF
wait
cat < $path | filter_fl &
- cat > $OSER_FIFO << EOF
+ cat > $FIFOPATH << EOF
:uptime:$name
EOF
@@ -149,7 +153,7 @@ EOF
mecho "Transaction Statistics: "
cat < $path | filter_fl &
- cat > $OSER_FIFO <<EOF
+ cat > $FIFOPATH <<EOF
:get_statistics:$name
UAS_transactions
UAC_transactions
@@ -161,7 +165,7 @@ EOF
mecho "Stateless Server Statistics: "
cat < $path | filter_fl &
- cat > $OSER_FIFO <<EOF
+ cat > $FIFOPATH <<EOF
:get_statistics:$name
sent_replies
sent_err_replies
@@ -173,7 +177,7 @@ EOF
mecho "UsrLoc Stats: "
cat < $path | filter_fl &
- cat > $OSER_FIFO <<EOF
+ cat > $FIFOPATH <<EOF
:get_statistics:$name
usrloc:
diff --git a/utils/kamctl/kamctlrc b/utils/kamctl/kamctlrc
index e5d8311..472d991 100644
--- a/utils/kamctl/kamctlrc
+++ b/utils/kamctl/kamctlrc
@@ -122,7 +122,7 @@
# CTLENGINE="FIFO"
## path to FIFO file
-# OSER_FIFO="FIFO"
+# FIFOPATH="/tmp/kamailio_fifo"
## check ACL names; default on (1); off (0)
# VERIFY_ACL=1
Hi,
In modules/permissions/trusted.c in function allow_trusted_2() there is
if(proto.len!=3 && proto.len!=4)
goto error;
but later it checks for "ws" which is never reached due to len=2. Also
the docs don't seem to be up to date in regards to support for WS and WSS.
Unfortunately I'm travelling the next 3 days, maybe someone can quickly
pick it up?
Thanks,
Andreas