Is it possible to backport Async module to kamailio 3.1? or does it
depend on heavy changes in the core?
Thanks.
--
Iñaki Baz Castillo
<ibc(a)aliax.net>
Module: sip-router
Branch: master
Commit: 0d91623616c2459ef8330a7ecb943d7b4f942787
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0d91623…
Author: Iñaki Baz Castillo <ibc(a)aliax.net>
Committer: Iñaki Baz Castillo <ibc(a)aliax.net>
Date: Thu Aug 4 10:33:36 2011 +0200
debian: /etc/default/kamailio now includes SHM_MEMORY and PKG_MEMORY variables (rather than just MEMORY).
The init script takes those values for -m (shared memory) and -M (private memory) command options.
check_kamailio_config() function within the init script also uses "-M $PKG_MEMORY" (so very long
configuration files can be parsed by increasing PKG_MEMORY).
---
pkg/kamailio/deb/debian/kamailio.default | 7 +++++--
pkg/kamailio/deb/debian/kamailio.init | 12 +++++++-----
pkg/kamailio/deb/lenny/kamailio.default | 13 +++++++++++--
pkg/kamailio/deb/lenny/kamailio.init | 12 +++++++-----
pkg/kamailio/deb/lucid/kamailio.default | 13 +++++++++++--
pkg/kamailio/deb/lucid/kamailio.init | 12 +++++++-----
pkg/kamailio/deb/squeeze/kamailio.default | 13 +++++++++++--
pkg/kamailio/deb/squeeze/kamailio.init | 12 +++++++-----
8 files changed, 66 insertions(+), 28 deletions(-)
diff --git a/pkg/kamailio/deb/debian/kamailio.default b/pkg/kamailio/deb/debian/kamailio.default
index 4d51e42..3221104 100644
--- a/pkg/kamailio/deb/debian/kamailio.default
+++ b/pkg/kamailio/deb/debian/kamailio.default
@@ -11,8 +11,11 @@ USER=kamailio
# Group to run as
GROUP=kamailio
-# Amount of memory to allocate for the running Kamailio server (in Mb)
-MEMORY=64
+# Amount of shared memory to allocate for the running Kamailio server (in Mb)
+SHM_MEMORY=64
+
+# Amount of private memory for each Kamailio process (in Mb)
+PKG_MEMORY=4
# Switch to USER and GROUP by start-stop-daemon or by kamailio itself
# - with recent kernels, changing user ID inside applicaton prevents
diff --git a/pkg/kamailio/deb/debian/kamailio.init b/pkg/kamailio/deb/debian/kamailio.init
index 0df2b84..4c9a4a5 100644
--- a/pkg/kamailio/deb/debian/kamailio.init
+++ b/pkg/kamailio/deb/debian/kamailio.init
@@ -39,7 +39,7 @@ check_kamailio_config ()
{
# Check if kamailio configuration is valid before starting the server.
set +e
- out=$($DAEMON -c 2>&1 > /dev/null)
+ out=$($DAEMON -M $PKG_MEMORY -c 2>&1 > /dev/null)
retcode=$?
set -e
if [ "$retcode" != '0' ]; then
@@ -114,10 +114,12 @@ fi
set -e
-MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
+SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`))
+PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`))
+[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64
+[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4
[ -z "$USER" ] && USER=kamailio
[ -z "$GROUP" ] && GROUP=kamailio
-[ $MEMORY -le 0 ] && MEMORY=32
if test "$DUMP_CORE" = "yes" ; then
@@ -133,10 +135,10 @@ fi
if [ "$SSD_SUID" != "yes" ]; then
- OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -u $USER -g $GROUP"
+ OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP"
SSDOPTS=""
else
- OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY"
+ OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -M $PKG_MEMORY"
SSDOPTS="--chuid $USER:$GROUP"
fi
diff --git a/pkg/kamailio/deb/lenny/kamailio.default b/pkg/kamailio/deb/lenny/kamailio.default
index 4317664..3221104 100644
--- a/pkg/kamailio/deb/lenny/kamailio.default
+++ b/pkg/kamailio/deb/lenny/kamailio.default
@@ -11,8 +11,17 @@ USER=kamailio
# Group to run as
GROUP=kamailio
-# Amount of memory to allocate for the running Kamailio server (in Mb)
-MEMORY=64
+# Amount of shared memory to allocate for the running Kamailio server (in Mb)
+SHM_MEMORY=64
+
+# Amount of private memory for each Kamailio process (in Mb)
+PKG_MEMORY=4
+
+# Switch to USER and GROUP by start-stop-daemon or by kamailio itself
+# - with recent kernels, changing user ID inside applicaton prevents
+# dumping core files. If the value is 'yes', the suid is done by
+# start-stop-daemon, otherwise it is done by kamailio itself
+SSD_SUID=no
# Enable the server to leave a core file when it crashes.
# Set this to 'yes' to enable Kamailio to leave a core file when it crashes
diff --git a/pkg/kamailio/deb/lenny/kamailio.init b/pkg/kamailio/deb/lenny/kamailio.init
index 0df2b84..4c9a4a5 100644
--- a/pkg/kamailio/deb/lenny/kamailio.init
+++ b/pkg/kamailio/deb/lenny/kamailio.init
@@ -39,7 +39,7 @@ check_kamailio_config ()
{
# Check if kamailio configuration is valid before starting the server.
set +e
- out=$($DAEMON -c 2>&1 > /dev/null)
+ out=$($DAEMON -M $PKG_MEMORY -c 2>&1 > /dev/null)
retcode=$?
set -e
if [ "$retcode" != '0' ]; then
@@ -114,10 +114,12 @@ fi
set -e
-MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
+SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`))
+PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`))
+[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64
+[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4
[ -z "$USER" ] && USER=kamailio
[ -z "$GROUP" ] && GROUP=kamailio
-[ $MEMORY -le 0 ] && MEMORY=32
if test "$DUMP_CORE" = "yes" ; then
@@ -133,10 +135,10 @@ fi
if [ "$SSD_SUID" != "yes" ]; then
- OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -u $USER -g $GROUP"
+ OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP"
SSDOPTS=""
else
- OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY"
+ OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -M $PKG_MEMORY"
SSDOPTS="--chuid $USER:$GROUP"
fi
diff --git a/pkg/kamailio/deb/lucid/kamailio.default b/pkg/kamailio/deb/lucid/kamailio.default
index 4317664..3221104 100644
--- a/pkg/kamailio/deb/lucid/kamailio.default
+++ b/pkg/kamailio/deb/lucid/kamailio.default
@@ -11,8 +11,17 @@ USER=kamailio
# Group to run as
GROUP=kamailio
-# Amount of memory to allocate for the running Kamailio server (in Mb)
-MEMORY=64
+# Amount of shared memory to allocate for the running Kamailio server (in Mb)
+SHM_MEMORY=64
+
+# Amount of private memory for each Kamailio process (in Mb)
+PKG_MEMORY=4
+
+# Switch to USER and GROUP by start-stop-daemon or by kamailio itself
+# - with recent kernels, changing user ID inside applicaton prevents
+# dumping core files. If the value is 'yes', the suid is done by
+# start-stop-daemon, otherwise it is done by kamailio itself
+SSD_SUID=no
# Enable the server to leave a core file when it crashes.
# Set this to 'yes' to enable Kamailio to leave a core file when it crashes
diff --git a/pkg/kamailio/deb/lucid/kamailio.init b/pkg/kamailio/deb/lucid/kamailio.init
index 0df2b84..4c9a4a5 100644
--- a/pkg/kamailio/deb/lucid/kamailio.init
+++ b/pkg/kamailio/deb/lucid/kamailio.init
@@ -39,7 +39,7 @@ check_kamailio_config ()
{
# Check if kamailio configuration is valid before starting the server.
set +e
- out=$($DAEMON -c 2>&1 > /dev/null)
+ out=$($DAEMON -M $PKG_MEMORY -c 2>&1 > /dev/null)
retcode=$?
set -e
if [ "$retcode" != '0' ]; then
@@ -114,10 +114,12 @@ fi
set -e
-MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
+SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`))
+PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`))
+[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64
+[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4
[ -z "$USER" ] && USER=kamailio
[ -z "$GROUP" ] && GROUP=kamailio
-[ $MEMORY -le 0 ] && MEMORY=32
if test "$DUMP_CORE" = "yes" ; then
@@ -133,10 +135,10 @@ fi
if [ "$SSD_SUID" != "yes" ]; then
- OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -u $USER -g $GROUP"
+ OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP"
SSDOPTS=""
else
- OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY"
+ OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -M $PKG_MEMORY"
SSDOPTS="--chuid $USER:$GROUP"
fi
diff --git a/pkg/kamailio/deb/squeeze/kamailio.default b/pkg/kamailio/deb/squeeze/kamailio.default
index 4317664..3221104 100644
--- a/pkg/kamailio/deb/squeeze/kamailio.default
+++ b/pkg/kamailio/deb/squeeze/kamailio.default
@@ -11,8 +11,17 @@ USER=kamailio
# Group to run as
GROUP=kamailio
-# Amount of memory to allocate for the running Kamailio server (in Mb)
-MEMORY=64
+# Amount of shared memory to allocate for the running Kamailio server (in Mb)
+SHM_MEMORY=64
+
+# Amount of private memory for each Kamailio process (in Mb)
+PKG_MEMORY=4
+
+# Switch to USER and GROUP by start-stop-daemon or by kamailio itself
+# - with recent kernels, changing user ID inside applicaton prevents
+# dumping core files. If the value is 'yes', the suid is done by
+# start-stop-daemon, otherwise it is done by kamailio itself
+SSD_SUID=no
# Enable the server to leave a core file when it crashes.
# Set this to 'yes' to enable Kamailio to leave a core file when it crashes
diff --git a/pkg/kamailio/deb/squeeze/kamailio.init b/pkg/kamailio/deb/squeeze/kamailio.init
index 0df2b84..4c9a4a5 100644
--- a/pkg/kamailio/deb/squeeze/kamailio.init
+++ b/pkg/kamailio/deb/squeeze/kamailio.init
@@ -39,7 +39,7 @@ check_kamailio_config ()
{
# Check if kamailio configuration is valid before starting the server.
set +e
- out=$($DAEMON -c 2>&1 > /dev/null)
+ out=$($DAEMON -M $PKG_MEMORY -c 2>&1 > /dev/null)
retcode=$?
set -e
if [ "$retcode" != '0' ]; then
@@ -114,10 +114,12 @@ fi
set -e
-MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
+SHM_MEMORY=$((`echo $SHM_MEMORY | sed -e 's/[^0-9]//g'`))
+PKG_MEMORY=$((`echo $PKG_MEMORY | sed -e 's/[^0-9]//g'`))
+[ $SHM_MEMORY -le 0 ] && SHM_MEMORY=64
+[ $PKG_MEMORY -le 0 ] && PKG_MEMORY=4
[ -z "$USER" ] && USER=kamailio
[ -z "$GROUP" ] && GROUP=kamailio
-[ $MEMORY -le 0 ] && MEMORY=32
if test "$DUMP_CORE" = "yes" ; then
@@ -133,10 +135,10 @@ fi
if [ "$SSD_SUID" != "yes" ]; then
- OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -u $USER -g $GROUP"
+ OPTIONS="-f $CFGFILE -P $PIDFILE -m $SHM_MEMORY -M $PKG_MEMORY -u $USER -g $GROUP"
SSDOPTS=""
else
- OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY"
+ OPTIONS="-f $CFGFILE -P $PIDFILE -m $MEMORY -M $PKG_MEMORY"
SSDOPTS="--chuid $USER:$GROUP"
fi
Module: sip-router
Branch: master
Commit: 5a99a114e6608cbe2ec8c452d837ff3223748f1d
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5a99a11…
Author: Iñaki Baz Castillo <ibc(a)aliax.net>
Committer: Iñaki Baz Castillo <ibc(a)aliax.net>
Date: Thu Aug 4 00:23:05 2011 +0200
lcr: fixed README for from_gw() arguments.
---
modules/lcr/README | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules/lcr/README b/modules/lcr/README
index 9b50e80..ebbdb63 100644
--- a/modules/lcr/README
+++ b/modules/lcr/README
@@ -865,7 +865,7 @@ defunct_gw(60);
lcr_id can be an integer constant or a pseudo variable holding an
integer value. ip_addr can be a string or a pseudo variable holding a
- string value. proto can be an integer constant (0 = 1 = UDP, 2 = TCP, 3
+ string value. proto can be an integer constant (0 = ANY, 1 = UDP, 2 = TCP, 3
= TLS, 4 = SCTP) or a pseudo variable holding such an integer value.
If request comes from a gateway, gateway's tag and flags are stored as
Module: sip-router
Branch: master
Commit: fb4ecbf986f4af366e5be9cbad26ceba924c77fd
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fb4ecbf…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Aug 3 23:03:54 2011 +0200
tm: don't set dst_uri to next hop for branch_route
- added flag to skip setting dst_uri to next hop for branch_route if the
dst_uri was not set before
- there is already a select and a pseudo-variable to access next hop value,
in case it is needed in branch route
- reported by Alex Hermann
---
modules/tm/t_fwd.c | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/modules/tm/t_fwd.c b/modules/tm/t_fwd.c
index 6385812..30558ab 100644
--- a/modules/tm/t_fwd.c
+++ b/modules/tm/t_fwd.c
@@ -151,6 +151,8 @@ unsigned int get_on_branch(void)
/* prepare_new_uac flags */
#define UAC_DNS_FAILOVER_F 1 /**< new branch due to dns failover */
+#define UAC_SKIP_BR_DST_F 2 /**< don't set next hop as dst_uri for
+ branch_route */
/** prepares a new branch "buffer".
@@ -176,7 +178,7 @@ unsigned int get_on_branch(void)
* @param fsocket - forced send socket for forwarding.
* @param send_flags - special flags for sending (see SND_F_* / snd_flags_t).
* @param fproto - forced proto for forwarding. Used only if next_hop!=0.
- * @param flags - 0 or UAC_DNS_FAILOVER_F for now.
+ * @param flags - 0, UAC_DNS_FAILOVER_F or UAC_SKIP_BR_DST_F for now.
*
* @return 0 on success, < 0 (ser_errror E***) on failure.
*/
@@ -302,10 +304,12 @@ static int prepare_new_uac( struct cell *t, struct sip_msg *i_req,
i_req->dst_uri.s=0;
i_req->dst_uri.len=0;
if (likely(next_hop)){
- /* set dst uri to next_hop for the on_branch route */
- if (unlikely(set_dst_uri(i_req, next_hop)<0)){
- ret=E_OUT_OF_MEM;
- goto error03;
+ if(unlikely((flags & UAC_SKIP_BR_DST_F)==0)){
+ /* set dst uri to next_hop for the on_branch route */
+ if (unlikely(set_dst_uri(i_req, next_hop)<0)){
+ ret=E_OUT_OF_MEM;
+ goto error03;
+ }
}
}
@@ -1475,7 +1479,8 @@ int t_forward_nonack( struct cell *t, struct sip_msg* p_msg ,
try_new=1;
branch_ret=add_uac( t, p_msg, GET_RURI(p_msg), GET_NEXT_HOP(p_msg),
&p_msg->path_vec, proxy, p_msg->force_send_socket,
- p_msg->fwd_send_flags, proto, 0);
+ p_msg->fwd_send_flags, proto,
+ (p_msg->dst_uri.len)?0:UAC_SKIP_BR_DST_F);
if (branch_ret>=0)
added_branches |= 1<<branch_ret;
else
@@ -1491,7 +1496,7 @@ int t_forward_nonack( struct cell *t, struct sip_msg* p_msg ,
branch_ret=add_uac( t, p_msg, ¤t_uri,
(dst_uri.len) ? (&dst_uri) : ¤t_uri,
&path, proxy, si, p_msg->fwd_send_flags,
- proto, 0);
+ proto, (dst_uri.len)?0:UAC_SKIP_BR_DST_F);
/* pick some of the errors in case things go wrong;
note that picking lowest error is just as good as
any other algorithm which picks any other negative
Module: sip-router
Branch: master
Commit: 9b553a5c25da040569d385039c6f24a9e0622d9f
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9b553a5…
Author: Iñaki Baz Castillo <ibc(a)aliax.net>
Committer: Iñaki Baz Castillo <ibc(a)aliax.net>
Date: Wed Aug 3 18:29:55 2011 +0200
debian: If RUN=no in /etc/default/kamailio then return 0 isntead of LSB compliant error codes (if not, dpkg returns error in the instalation as kamailio init script is called automatically to start when installed).
---
pkg/kamailio/deb/debian/kamailio.init | 11 +----------
pkg/kamailio/deb/lenny/kamailio.init | 11 +----------
pkg/kamailio/deb/lucid/kamailio.init | 11 +----------
pkg/kamailio/deb/squeeze/kamailio.init | 11 +----------
4 files changed, 4 insertions(+), 40 deletions(-)
diff --git a/pkg/kamailio/deb/debian/kamailio.init b/pkg/kamailio/deb/debian/kamailio.init
index 0490282..0df2b84 100644
--- a/pkg/kamailio/deb/debian/kamailio.init
+++ b/pkg/kamailio/deb/debian/kamailio.init
@@ -107,16 +107,7 @@ fi
if [ "$RUN_KAMAILIO" != "yes" ]; then
echo "$DESC not yet configured. Edit $DEFAULTS first."
- case "$1" in
- status)
- # LSB - 4: program or service status is unknown.
- exit 4
- ;;
- *)
- # LSB - 6: program is not configured.
- exit 6
- ;;
- esac
+ exit 0
fi
diff --git a/pkg/kamailio/deb/lenny/kamailio.init b/pkg/kamailio/deb/lenny/kamailio.init
index 0490282..0df2b84 100644
--- a/pkg/kamailio/deb/lenny/kamailio.init
+++ b/pkg/kamailio/deb/lenny/kamailio.init
@@ -107,16 +107,7 @@ fi
if [ "$RUN_KAMAILIO" != "yes" ]; then
echo "$DESC not yet configured. Edit $DEFAULTS first."
- case "$1" in
- status)
- # LSB - 4: program or service status is unknown.
- exit 4
- ;;
- *)
- # LSB - 6: program is not configured.
- exit 6
- ;;
- esac
+ exit 0
fi
diff --git a/pkg/kamailio/deb/lucid/kamailio.init b/pkg/kamailio/deb/lucid/kamailio.init
index 0490282..0df2b84 100644
--- a/pkg/kamailio/deb/lucid/kamailio.init
+++ b/pkg/kamailio/deb/lucid/kamailio.init
@@ -107,16 +107,7 @@ fi
if [ "$RUN_KAMAILIO" != "yes" ]; then
echo "$DESC not yet configured. Edit $DEFAULTS first."
- case "$1" in
- status)
- # LSB - 4: program or service status is unknown.
- exit 4
- ;;
- *)
- # LSB - 6: program is not configured.
- exit 6
- ;;
- esac
+ exit 0
fi
diff --git a/pkg/kamailio/deb/squeeze/kamailio.init b/pkg/kamailio/deb/squeeze/kamailio.init
index 0490282..0df2b84 100644
--- a/pkg/kamailio/deb/squeeze/kamailio.init
+++ b/pkg/kamailio/deb/squeeze/kamailio.init
@@ -107,16 +107,7 @@ fi
if [ "$RUN_KAMAILIO" != "yes" ]; then
echo "$DESC not yet configured. Edit $DEFAULTS first."
- case "$1" in
- status)
- # LSB - 4: program or service status is unknown.
- exit 4
- ;;
- *)
- # LSB - 6: program is not configured.
- exit 6
- ;;
- esac
+ exit 0
fi