[Pkg-voip-commits] r10139 - in /kamailio/trunk/debian: ./ patches/ patches/upstream/

maniac-guest at alioth.debian.org maniac-guest at alioth.debian.org
Tue Apr 9 08:49:36 UTC 2013


Author: maniac-guest
Date: Tue Apr  9 08:49:36 2013
New Revision: 10139

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=10139
Log:
upstream fixes

Added:
    kamailio/trunk/debian/patches/upstream/0006-rtpproxy-fix-spelling-error-in-docs-reported-from-Vi.patch
    kamailio/trunk/debian/patches/upstream/0009-modules-outbound-The-flow-token-key-is-now-automatic.patch
    kamailio/trunk/debian/patches/upstream/0010-modules-outbound-Fixed-bug-in-outbound-mod_init.patch
    kamailio/trunk/debian/patches/upstream/0011-modules-outbound-free-shared-memory-for-flow-token-k.patch
    kamailio/trunk/debian/patches/upstream/0012-modules-outbound-Warn-during-mod_init-if-STUN-is-not.patch
    kamailio/trunk/debian/patches/upstream/0013-modules-rr-only-use-flow-token-for-routing-if-it-doe.patch
    kamailio/trunk/debian/patches/upstream/0014-modules-outbound-improved-check-for-outbound.patch
    kamailio/trunk/debian/patches/upstream/0015-modules-rr-copy-the-flow-token-for-incoming-messages.patch
    kamailio/trunk/debian/patches/upstream/0016-modules-outbound-further-improvement-to-the-use_outb.patch
    kamailio/trunk/debian/patches/upstream/0017-modules-outbound-updated-edge-proxy-example-in-READM.patch
    kamailio/trunk/debian/patches/upstream/0018-modules-registrar-changed-instance-related-INFO-to-D.patch
    kamailio/trunk/debian/patches/upstream/0019-modules-outbound-changed-some-INFO-level-output-to-D.patch
    kamailio/trunk/debian/patches/upstream/0021-modules-ndb_redis-b-f-restore-correctly-last-char-in.patch
    kamailio/trunk/debian/patches/upstream/0022-modules-ndb_redis-b-f-redisc_exec-returns-false-if-r.patch
Modified:
    kamailio/trunk/debian/changelog
    kamailio/trunk/debian/patches/series

Modified: kamailio/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/changelog?rev=10139&op=diff
==============================================================================
--- kamailio/trunk/debian/changelog (original)
+++ kamailio/trunk/debian/changelog Tue Apr  9 08:49:36 2013
@@ -1,6 +1,8 @@
 kamailio (4.0.0-1) unstable; urgency=low
 
   * New upstream release (Closes: #704118)
+  * debian/control.tls
+    + refreshed (Closes: #704683)
   * debian/control:
     + added new ims outbound websocket modules
   * debian/rules:
@@ -18,7 +20,7 @@
     + remove call to dpkg-buildflags
     + do not apply hardening_flags.patch
 
- -- Victor Seva <linuxmaniac at torreviejawireless.org>  Thu, 28 Mar 2013 16:47:17 +0100
+ -- Victor Seva <linuxmaniac at torreviejawireless.org>  Tue, 09 Apr 2013 10:48:47 +0200
 
 kamailio (3.3.0-1) unstable; urgency=low
 

Modified: kamailio/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/series?rev=10139&op=diff
==============================================================================
--- kamailio/trunk/debian/patches/series (original)
+++ kamailio/trunk/debian/patches/series Tue Apr  9 08:49:36 2013
@@ -3,6 +3,20 @@
 upstream/0003-modules-sca-fix-Waddress-warnings-caused-by-static-s.patch
 upstream/0004-modules-sca-cast-logging-of-time_t-to-long-int-to-qu.patch
 upstream/0005-modules-sca-seize-appearance-for-SCA-callee-answerin.patch
+upstream/0006-rtpproxy-fix-spelling-error-in-docs-reported-from-Vi.patch
+upstream/0009-modules-outbound-The-flow-token-key-is-now-automatic.patch
+upstream/0010-modules-outbound-Fixed-bug-in-outbound-mod_init.patch
+upstream/0011-modules-outbound-free-shared-memory-for-flow-token-k.patch
+upstream/0012-modules-outbound-Warn-during-mod_init-if-STUN-is-not.patch
+upstream/0013-modules-rr-only-use-flow-token-for-routing-if-it-doe.patch
+upstream/0014-modules-outbound-improved-check-for-outbound.patch
+upstream/0015-modules-rr-copy-the-flow-token-for-incoming-messages.patch
+upstream/0016-modules-outbound-further-improvement-to-the-use_outb.patch
+upstream/0017-modules-outbound-updated-edge-proxy-example-in-READM.patch
+upstream/0018-modules-registrar-changed-instance-related-INFO-to-D.patch
+upstream/0019-modules-outbound-changed-some-INFO-level-output-to-D.patch
+upstream/0021-modules-ndb_redis-b-f-restore-correctly-last-char-in.patch
+upstream/0022-modules-ndb_redis-b-f-redisc_exec-returns-false-if-r.patch
 no_lib64_on_64_bits.patch
 no_INSTALL_file.patch
 fix_export.patch

Added: kamailio/trunk/debian/patches/upstream/0006-rtpproxy-fix-spelling-error-in-docs-reported-from-Vi.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0006-rtpproxy-fix-spelling-error-in-docs-reported-from-Vi.patch?rev=10139&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0006-rtpproxy-fix-spelling-error-in-docs-reported-from-Vi.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0006-rtpproxy-fix-spelling-error-in-docs-reported-from-Vi.patch Tue Apr  9 08:49:36 2013
@@ -1,0 +1,62 @@
+From 9a57697e07824071cdce1b9ae65338771c7e32a2 Mon Sep 17 00:00:00 2001
+From: Henning Westerholt <hw at kamailio.org>
+Date: Tue, 19 Mar 2013 15:32:25 +0100
+Subject: [PATCH] rtpproxy: fix spelling error in docs, reported from Victor
+ V. Kustov, coyote at bks dot tv (cherry picked from commit
+ a0b01f77de163cf7ea9d71d5293a1bfa20d31fa6)
+
+---
+ modules/rtpproxy/README                 |    8 ++++----
+ modules/rtpproxy/doc/rtpproxy_admin.xml |    2 +-
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/modules/rtpproxy/README b/modules/rtpproxy/README
+index 097db16..a8992bc 100644
+--- a/modules/rtpproxy/README
++++ b/modules/rtpproxy/README
+@@ -77,7 +77,7 @@ Carsten Bock
+ 
+         6. Exported Pseudo Variables
+ 
+-              6.1. $rtpstart
++              6.1. $rtpstat
+ 
+         7. MI Commands
+ 
+@@ -145,7 +145,7 @@ Chapter 1. Admin Guide
+ 
+    6. Exported Pseudo Variables
+ 
+-        6.1. $rtpstart
++        6.1. $rtpstat
+ 
+    7. MI Commands
+ 
+@@ -659,9 +659,9 @@ start_recording();
+ 
+ 6. Exported Pseudo Variables
+ 
+-   6.1. $rtpstart
++   6.1. $rtpstat
+ 
+-6.1. $rtpstart
++6.1. $rtpstat
+ 
+    Returns the RTP-Statistics from the RTP-Proxy. The RTP-Statistics from
+    the RTP-Proxy are provided as a string and it does contain several
+diff --git a/modules/rtpproxy/doc/rtpproxy_admin.xml b/modules/rtpproxy/doc/rtpproxy_admin.xml
+index 7b8b260..18e89a5 100644
+--- a/modules/rtpproxy/doc/rtpproxy_admin.xml
++++ b/modules/rtpproxy/doc/rtpproxy_admin.xml
+@@ -761,7 +761,7 @@ start_recording();
+ 	<section>
+ 		<title>Exported Pseudo Variables</title>
+ 		<section>
+-			<title><function moreinfo="none">$rtpstart</function></title>
++			<title><function moreinfo="none">$rtpstat</function></title>
+ 			<para>
+ 			Returns the RTP-Statistics from the RTP-Proxy. The RTP-Statistics from the RTP-Proxy
+ 			are provided as a string and it does contain several packet-counters. The statistics
+-- 
+1.7.10.4
+

Added: kamailio/trunk/debian/patches/upstream/0009-modules-outbound-The-flow-token-key-is-now-automatic.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0009-modules-outbound-The-flow-token-key-is-now-automatic.patch?rev=10139&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0009-modules-outbound-The-flow-token-key-is-now-automatic.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0009-modules-outbound-The-flow-token-key-is-now-automatic.patch Tue Apr  9 08:49:36 2013
@@ -1,0 +1,214 @@
+From 6acbeef9ff574c079aaeeea72924905a0426c922 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Fri, 15 Mar 2013 12:14:31 +0000
+Subject: [PATCH] modules/outbound: The flow-token key is now automatically
+ generated
+
+- Uses OpenSSL RAND_bytes() to select 20 cryptographically strong pseudo-random
+  bytes for the key.
+- Flow-token key can no longer be manually set.
+(cherry picked from commit f474e85616f6f98a6ac193c7425f6c85af8efa20)
+---
+ modules/outbound/README                 |   33 +++++--------------------------
+ modules/outbound/doc/outbound_admin.xml |   21 --------------------
+ modules/outbound/ob_mod.c               |   20 +++++++------------
+ 3 files changed, 12 insertions(+), 62 deletions(-)
+
+diff --git a/modules/outbound/README b/modules/outbound/README
+index 3e6aa97..08c6038 100644
+--- a/modules/outbound/README
++++ b/modules/outbound/README
+@@ -4,7 +4,7 @@ Peter Dunkley
+ 
+    Crocodile RCS Ltd
+ 
+-   Copyright © 2012 Crocodile RCS Ltd
++   Copyright © 2012 Crocodile RCS Ltd
+      __________________________________________________________________
+ 
+    Table of Contents
+@@ -24,7 +24,6 @@ Peter Dunkley
+         3. Parameters
+ 
+               3.1. force_outbound_flag (integer)
+-              3.2. flow_token_key (string)
+ 
+         4. Functions
+         5. MI Commands
+@@ -35,7 +34,6 @@ Peter Dunkley
+    1.2. Edge Proxy Configuration
+    1.3. Registrar Configuration
+    1.4. Set force_outbound_flag parameter
+-   1.5. Set flow_token_key parameter
+ 
+ Chapter 1. Admin Guide
+ 
+@@ -54,7 +52,6 @@ Chapter 1. Admin Guide
+    3. Parameters
+ 
+         3.1. force_outbound_flag (integer)
+-        3.2. flow_token_key (string)
+ 
+    4. Functions
+    5. MI Commands
+@@ -87,9 +84,9 @@ make all
+    responses to REGISTERs.
+ 
+    When using TCP or TLS as the SIP transport care should be taken to set
+-   the "tcp_connection_lifetime" on the Edge Proxy to a value slightly
++   the “tcp_connection_lifetime” on the Edge Proxy to a value slightly
+    larger than the interval the Registrar is using for flow timer. Setting
+-   "tcp_connection_lifetime" to less than the interval could cause
++   “tcp_connection_lifetime” to less than the interval could cause
+    connections to be lost, and setting it to a value much larger than the
+    interval will keep connections open far longer than is required (which
+    is wasteful).
+@@ -97,9 +94,9 @@ make all
+    Application-layer keep-alives are optional when the underlying
+    transport already has a keep-alive mechanism. The WebSocket transport
+    has a transport-layer keep-alive. When using the WebSocket transport
+-   the "keepalive_timeout" should be set to a value a little greater than
++   the “keepalive_timeout” should be set to a value a little greater than
+    the Registrar flow timer interval and a little less than the
+-   "tcp_connection_lifetime".
++   “tcp_connection_lifetime”.
+ 
+    Example 1.2. Edge Proxy Configuration
+ ...
+@@ -114,8 +111,6 @@ loadmodule "path.so"
+ ...
+ modparam("websocket", "keepalive_timeout", FLOW_TIMER+5)
+ ...
+-modparam("outbound", "flow_token_key", "!!!Kamailio rocks!!!")
+-...
+ route {
+         route(REQINIT);
+         ...
+@@ -284,7 +279,6 @@ failure_route[FAIL_OUTBOUND] {
+ 3. Parameters
+ 
+    3.1. force_outbound_flag (integer)
+-   3.2. flow_token_key (string)
+ 
+ 3.1. force_outbound_flag (integer)
+ 
+@@ -299,23 +293,6 @@ failure_route[FAIL_OUTBOUND] {
+ modparam("outbound", "force_outbound_flag", 1)
+ ...
+ 
+-3.2. flow_token_key (string)
+-
+-   The outbound flow token is generated using the algorithm described in
+-   RFC 5626 section 5.2. This algorithm requires a 20 octet crypto random
+-   key that is unique for each Edge Proxy.
+-
+-Note
+-
+-   If this 20 character string is not set Kamailio will not start.
+-
+-   Default value is: "".
+-
+-   Example 1.5. Set flow_token_key parameter
+-...
+-modparam("outbound", "flow_token_key", "!!!Kamailio rocks!!!")
+-...
+-
+ 4. Functions
+ 
+    None
+diff --git a/modules/outbound/doc/outbound_admin.xml b/modules/outbound/doc/outbound_admin.xml
+index 837e0da..2e5d21e 100644
+--- a/modules/outbound/doc/outbound_admin.xml
++++ b/modules/outbound/doc/outbound_admin.xml
+@@ -69,8 +69,6 @@ loadmodule "path.so"
+ ...
+ modparam("websocket", "keepalive_timeout", FLOW_TIMER+5)
+ ...
+-modparam("outbound", "flow_token_key", "!!!Kamailio rocks!!!")
+-...
+ route {
+ 	route(REQINIT);
+ 	...
+@@ -274,25 +272,6 @@ modparam("outbound", "force_outbound_flag", 1)
+ </programlisting>
+ 		</example>
+ 	</section>
+-	<section>
+-		<title><varname>flow_token_key</varname> (string)</title>
+-		<para>The outbound flow token is generated using the algorithm
+-		described in RFC 5626 section 5.2. This algorithm requires a 20
+-		octet crypto random key that is unique for each Edge Proxy.
+-		</para>
+-		<note><para>If this 20 character string is not set &kamailio;
+-		will not start.</para></note>
+-		<para><emphasis>Default value is: "".</emphasis></para>
+-		<example>
+-		<title>Set <varname>flow_token_key</varname> parameter
+-		</title>
+-		<programlisting format="linespecific">
+-...
+-modparam("outbound", "flow_token_key", "!!!Kamailio rocks!!!")
+-...
+-</programlisting>
+-		</example>
+-	</section>
+ 	</section>
+ 
+ 	<section>
+diff --git a/modules/outbound/ob_mod.c b/modules/outbound/ob_mod.c
+index 775d0b6..37b0a60 100644
+--- a/modules/outbound/ob_mod.c
++++ b/modules/outbound/ob_mod.c
+@@ -21,6 +21,7 @@
+  *
+  */
+ #include <openssl/hmac.h>
++#include <openssl/rand.h>
+ 
+ #include "../../basex.h"
+ #include "../../dprint.h"
+@@ -39,6 +40,8 @@
+ 
+ MODULE_VERSION
+ 
++#define OB_KEY_LEN	20
++
+ static int mod_init(void);
+ 
+ static unsigned int ob_force_flag = (unsigned int) -1;
+@@ -55,7 +58,6 @@ static cmd_export_t cmds[]=
+ static param_export_t params[]=
+ {
+ 	{ "force_outbound_flag",	INT_PARAM, &ob_force_flag },
+-	{ "flow_token_key",		STR_PARAM, &ob_key.s},
+ 	{ 0, 0, 0 }
+ };
+ 
+@@ -83,20 +85,12 @@ static int mod_init(void)
+ 		return -1;
+ 	}
+ 
+-	if (ob_key.s == 0)
++	if (RAND_bytes((unsigned char *) ob_key.s, OB_KEY_LEN) == 0)
+ 	{
+-		LM_ERR("flow_token_key not set\n");
+-		return -1;
+-	}
+-	else
+-		ob_key.len = strlen(ob_key.s);
+-
+-	if (ob_key.len != 20)
+-	{
+-		LM_ERR("flow_token_key wrong length. Expected 20 got %d\n",
+-			ob_key.len);
+-		return -1;
++		LM_ERR("unable to get %d cryptographically strong pseudo-"
++		       "random bytes\n", OB_KEY_LEN);
+ 	}
++	ob_key.len = OB_KEY_LEN;
+ 
+ 	return 0;
+ }
+-- 
+1.7.10.4
+

Added: kamailio/trunk/debian/patches/upstream/0010-modules-outbound-Fixed-bug-in-outbound-mod_init.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0010-modules-outbound-Fixed-bug-in-outbound-mod_init.patch?rev=10139&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0010-modules-outbound-Fixed-bug-in-outbound-mod_init.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0010-modules-outbound-Fixed-bug-in-outbound-mod_init.patch Tue Apr  9 08:49:36 2013
@@ -1,0 +1,39 @@
+From ac9f143b3cd2422a3fb2c3ca5e29724ed65ab43d Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Fri, 15 Mar 2013 14:07:04 +0000
+Subject: [PATCH] modules/outbound: Fixed bug in outbound mod_init (cherry
+ picked from commit
+ c924645fcfb706fc20ed715a00531d785f99cbde)
+
+---
+ modules/outbound/ob_mod.c |   11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/modules/outbound/ob_mod.c b/modules/outbound/ob_mod.c
+index 37b0a60..4c4e7ea 100644
+--- a/modules/outbound/ob_mod.c
++++ b/modules/outbound/ob_mod.c
+@@ -85,12 +85,17 @@ static int mod_init(void)
+ 		return -1;
+ 	}
+ 
+-	if (RAND_bytes((unsigned char *) ob_key.s, OB_KEY_LEN) == 0)
++	if ((ob_key.s = shm_malloc(OB_KEY_LEN)) == NULL)
+ 	{
+-		LM_ERR("unable to get %d cryptographically strong pseudo-"
+-		       "random bytes\n", OB_KEY_LEN);
++		LM_ERR("Failed to allocate memory for flow-token key\n");
++		return -1;
+ 	}
+ 	ob_key.len = OB_KEY_LEN;
++	if (RAND_bytes((unsigned char *) ob_key.s, ob_key.len) == 0)
++	{
++		LM_ERR("unable to get %d cryptographically strong pseudo-"
++		       "random bytes\n", ob_key.len);
++	}
+ 
+ 	return 0;
+ }
+-- 
+1.7.10.4
+

Added: kamailio/trunk/debian/patches/upstream/0011-modules-outbound-free-shared-memory-for-flow-token-k.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0011-modules-outbound-free-shared-memory-for-flow-token-k.patch?rev=10139&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0011-modules-outbound-free-shared-memory-for-flow-token-k.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0011-modules-outbound-free-shared-memory-for-flow-token-k.patch Tue Apr  9 08:49:36 2013
@@ -1,0 +1,47 @@
+From 527db661fa3f3bc3899eaf9c264c9080cc757318 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Fri, 15 Mar 2013 14:54:41 +0000
+Subject: [PATCH] modules/outbound: free shared memory for flow-token key
+ during shutdown (cherry picked from commit
+ 9d9d51438acd1d534f14ecbc8eb0030b45333177)
+
+---
+ modules/outbound/ob_mod.c |    8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/modules/outbound/ob_mod.c b/modules/outbound/ob_mod.c
+index 4c4e7ea..7cf0c74 100644
+--- a/modules/outbound/ob_mod.c
++++ b/modules/outbound/ob_mod.c
+@@ -43,6 +43,7 @@ MODULE_VERSION
+ #define OB_KEY_LEN	20
+ 
+ static int mod_init(void);
++static void destroy(void);
+ 
+ static unsigned int ob_force_flag = (unsigned int) -1;
+ static str ob_key = {0, 0};
+@@ -73,7 +74,7 @@ struct module_exports exports=
+ 	0,			/* extra processes */
+ 	mod_init,		/* module initialization function */
+ 	0,			/* response function */
+-	0,			/* destroy function */
++	destroy,		/* destroy function */
+ 	0			/* per-child initialization function */
+ };
+ 
+@@ -100,6 +101,11 @@ static int mod_init(void)
+ 	return 0;
+ }
+ 
++static void destroy(void)
++{
++	shm_free(ob_key.s);
++}
++
+ /* Structure of flow-token
+ 
+    <HMAC-SHA1-80><protocol><dst_ip><dst_port><src_ip><src_port>
+-- 
+1.7.10.4
+

Added: kamailio/trunk/debian/patches/upstream/0012-modules-outbound-Warn-during-mod_init-if-STUN-is-not.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0012-modules-outbound-Warn-during-mod_init-if-STUN-is-not.patch?rev=10139&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0012-modules-outbound-Warn-during-mod_init-if-STUN-is-not.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0012-modules-outbound-Warn-during-mod_init-if-STUN-is-not.patch Tue Apr  9 08:49:36 2013
@@ -1,0 +1,37 @@
+From 00c4469624392cb252d65ecf0e53dd64cfb9bb87 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Fri, 15 Mar 2013 15:04:07 +0000
+Subject: [PATCH] modules/outbound: Warn during mod_init() if STUN is not
+ built or enabled
+
+- STUN is required for outbound with UDP.  Don't want to stop Kamailio starting
+  when the outbound module is loaded and STUN is not available - but a warning
+  seems appropriate.
+(cherry picked from commit 85b26219f9e4c3c8c7c990a4897d40645b4ad6e7)
+---
+ modules/outbound/ob_mod.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/modules/outbound/ob_mod.c b/modules/outbound/ob_mod.c
+index 7cf0c74..fb110d8 100644
+--- a/modules/outbound/ob_mod.c
++++ b/modules/outbound/ob_mod.c
+@@ -98,6 +98,15 @@ static int mod_init(void)
+ 		       "random bytes\n", ob_key.len);
+ 	}
+ 
++#ifndef USE_STUN
++	LM_WARN("STUN support not built-in. UDP keep-alive not supported.\n");
++#else
++	if (stun_allow_stun != 1)
++	{
++		LM_WARN("STUN disabled.  UDP keep-alive not supported.\n");
++	}
++#endif
++
+ 	return 0;
+ }
+ 
+-- 
+1.7.10.4
+

Added: kamailio/trunk/debian/patches/upstream/0013-modules-rr-only-use-flow-token-for-routing-if-it-doe.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0013-modules-rr-only-use-flow-token-for-routing-if-it-doe.patch?rev=10139&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0013-modules-rr-only-use-flow-token-for-routing-if-it-doe.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0013-modules-rr-only-use-flow-token-for-routing-if-it-doe.patch Tue Apr  9 08:49:36 2013
@@ -1,0 +1,48 @@
+From 70217018e5a72c80cee37bc5a722b769890fc64c Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Wed, 27 Mar 2013 15:43:02 +0000
+Subject: [PATCH] modules/rr: only use flow-token for routing if it doesn't
+ point to the source of the request (cherry picked from
+ commit 874669f483e1efba032bd695eb6cee4275673874)
+
+---
+ modules/rr/loose.c |   11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/modules/rr/loose.c b/modules/rr/loose.c
+index b7fa243..268522c 100644
+--- a/modules/rr/loose.c
++++ b/modules/rr/loose.c
+@@ -513,12 +513,15 @@ static inline int process_outbound(struct sip_msg *_m, str flow_token,
+ 	ret = rr_obb.decode_flow_token(&rcv, flow_token);
+ 
+ 	if (ret == -2) {
+-		LM_INFO("no flow token found - outbound not in use\n");
++		LM_DBG("no flow token found - outbound not in use\n");
+ 		return 0;
+ 	} else if (ret == -1) {
+ 		LM_ERR("failed to decode flow token\n");
+ 		return -1;
+-	} else {
++	} else if (!ip_addr_cmp(&rcv.src_ip, &_m->rcv.src_ip)
++			|| rcv.src_port != _m->rcv.src_port) {
++		LM_DBG("\"incoming\" request found. Using flow-token for"
++			"routing\n");
+ 
+ 		/* First, force the local socket */
+ 		si = find_si(&rcv.dst_ip, rcv.dst_port, rcv.proto);
+@@ -546,9 +549,9 @@ static inline int process_outbound(struct sip_msg *_m, str flow_token,
+ 					rcv.src_ip.af == AF_INET6 ? "]" : "",
+ 					rcv.src_port,
+ 					get_proto_name(rcv.proto));
+-
+-		return 1;
+ 	}
++
++	return 1;
+ }
+ 
+ /*!
+-- 
+1.7.10.4
+

Added: kamailio/trunk/debian/patches/upstream/0014-modules-outbound-improved-check-for-outbound.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0014-modules-outbound-improved-check-for-outbound.patch?rev=10139&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0014-modules-outbound-improved-check-for-outbound.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0014-modules-outbound-improved-check-for-outbound.patch Tue Apr  9 08:49:36 2013
@@ -1,0 +1,219 @@
+From 9df1edfb18f1ec0846ca474f510532050b55fc80 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Wed, 27 Mar 2013 16:32:59 +0000
+Subject: [PATCH] modules/outbound: improved check for outbound (cherry picked
+ from commit b2fb355fe5c9c64727d873cbe8d6fd883ebd2537)
+
+---
+ modules/outbound/ob_mod.c |  139 ++++++++++++++++++++++++++++++++-------------
+ 1 file changed, 101 insertions(+), 38 deletions(-)
+
+diff --git a/modules/outbound/ob_mod.c b/modules/outbound/ob_mod.c
+index fb110d8..a58fdff 100644
+--- a/modules/outbound/ob_mod.c
++++ b/modules/outbound/ob_mod.c
+@@ -206,7 +206,7 @@ int decode_flow_token(struct receive_info *rcv, str flow_token)
+ 
+ 	if (flow_token.s == NULL)
+ 	{
+-		LM_INFO("no flow-token provided\n");
++		LM_DBG("no flow-token provided\n");
+ 		return -2;
+ 	}
+ 
+@@ -275,29 +275,10 @@ int decode_flow_token(struct receive_info *rcv, str flow_token)
+ 	return 0;
+ }
+ 
+-int use_outbound(struct sip_msg *msg)
++static int use_outbound_register(struct sip_msg *msg)
+ {
+ 	contact_t *contact;
+-	rr_t *rt;
+-	struct sip_uri puri;
+-	param_hooks_t hooks;
+-	param_t *params;
+-	int ret;
+-
+-	/* If Outbound is forced return success without any further checks */
+-	if (ob_force_flag != -1 && isflagset(msg, ob_force_flag) > 0)
+-	{
+-		LM_INFO("outbound forced\n");
+-		return 1;
+-	}
+-
+-	/* Use Outbound when there is a single Via: header and:
+-	    # It's a REGISTER request with a Contact-URI containing a ;reg-id
+-	      parameter, or
+-	    # The Contact-URI has an ;ob parameter, or
+-	    # The top Route-URI points to use and has an ;ob parameter
+-	*/
+-
++	
+ 	/* Check there is a single Via: */
+ 	if (!(parse_headers(msg, HDR_VIA2_F, 0) == -1 || msg->via2 == 0
+ 		|| msg->via2->error != PARSE_OK))
+@@ -306,8 +287,7 @@ int use_outbound(struct sip_msg *msg)
+ 		return 0;
+ 	}
+ 
+-	/* Look for ;reg-id in REGISTER Contact-URIs and ;ob in any
+-	   Contact-URIs */
++	/* Look for ;reg-id in Contact-URIs */
+ 	if (msg->contact
+ 		|| (parse_headers(msg, HDR_CONTACT_F, 0) != -1 && msg->contact))
+ 	{
+@@ -323,21 +303,29 @@ int use_outbound(struct sip_msg *msg)
+ 			return 0;
+ 		}
+ 		
+-		if (msg->REQ_METHOD == METHOD_REGISTER && contact->reg_id)
++		if (contact->reg_id)
+ 		{
+ 			LM_INFO("found REGISTER with ;reg-id paramter on"
+ 				" Contact-URI - outbound used\n");
+ 			return 1;
+ 		}
+ 
+-		if (hooks.contact.ob)
+-		{
+-			LM_INFO("found ;ob parameter on Contact-URI - outbound"
+-				" used\n");
+-			return 1;
+-		}
+ 	}
+ 
++	LM_INFO("outbound not used\n");
++	return 0;
++}
++
++static int use_outbound_non_reg(struct sip_msg *msg)
++{
++	contact_t *contact;
++	rr_t *rt;
++	struct sip_uri puri;
++	param_hooks_t hooks;
++	param_t *params;
++	int ret;
++	struct receive_info rcv;
++
+ 	/* Check to see if the top Route-URI is me and has a ;ob parameter */
+ 	if (msg->route
+ 		|| (parse_headers(msg, HDR_ROUTE_F, 0) != -1 && msg->route))
+@@ -359,13 +347,6 @@ int use_outbound(struct sip_msg *msg)
+ 			LM_ERR("parsing Route-URI\n");
+ 			return 0;
+ 		}
+-		if (parse_params(&puri.params, CLASS_URI, &hooks,
+-			&params) != 0)
+-		{
+-			LM_ERR("parsing Route-URI parameters\n");
+-			return 0;
+-		}
+-
+ 		ret = check_self(&puri.host,
+ 				puri.port_no ? puri.port_no : SIP_PORT, 0);
+ 		if (ret < 1 || (ret == 1 && puri.gr.s != NULL))
+@@ -377,10 +358,65 @@ int use_outbound(struct sip_msg *msg)
+ 			return 0;
+ 		}
+ 
++		if (parse_params(&puri.params, CLASS_URI, &hooks,
++			&params) != 0)
++		{
++			LM_ERR("parsing Route-URI parameters\n");
++			return 0;
++		}
++
+ 		if (hooks.uri.ob)
+ 		{
+ 			LM_INFO("found ;ob parameter on Route-URI - outbound"
+ 				" used\n");
++
++			if (decode_flow_token(&rcv, puri.user) == 0)
++			{
++				if (!ip_addr_cmp(&rcv.src_ip, &msg->rcv.src_ip)
++					|| rcv.src_port != msg->rcv.src_port)
++				{
++					LM_INFO("\"incoming\" request found\n");
++					return 2;
++				}
++			}
++
++			LM_INFO("\"outgoing\" request found\n");
++			return 1;
++		}
++	}
++
++	/* Look for ;ob in Contact-URIs */
++	if (msg->contact
++		|| (parse_headers(msg, HDR_CONTACT_F, 0) != -1 && msg->contact))
++	{
++		if (parse_contact(msg->contact) < 0)
++		{
++			LM_ERR("parsing Contact: header body\n");
++			return 0;
++		}
++		contact = ((contact_body_t *) msg->contact->parsed)->contacts;
++		if (!contact)
++		{
++			LM_ERR("empty Contact:\n");
++			return 0;
++		}
++	
++		if (parse_uri(contact->uri.s, contact->uri.len, &puri)
++			< 0)
++		{
++			LM_ERR("parsing Contact-URI\n");
++			return 0;
++		}
++		if (parse_params(&puri.params, CLASS_CONTACT, &hooks, &params)
++			!= 0)
++		{
++			LM_ERR("parsing Contact-URI parameters\n");
++			return 0;
++		}
++		if (hooks.contact.ob)
++		{
++			LM_INFO("found ;ob parameter on Contact-URI - outbound"
++				" used\n");
+ 			return 1;
+ 		}
+ 	}
+@@ -389,6 +425,33 @@ int use_outbound(struct sip_msg *msg)
+ 	return 0;
+ }
+ 
++int use_outbound(struct sip_msg *msg)
++{
++	if (msg->first_line.type != SIP_REQUEST)
++	{
++		LM_ERR("use_outbound called for something that isn't a SIP"
++			" request\n");
++		return 0;
++	}
++
++	/* If Outbound is forced return success without any further checks */
++	if (ob_force_flag != -1 && isflagset(msg, ob_force_flag) > 0)
++	{
++		LM_DBG("outbound forced\n");
++		return 1;
++	}
++
++	LM_INFO("Analysing %.*s for outbound markers\n",
++		msg->first_line.u.request.method.len,
++		msg->first_line.u.request.method.s);
++
++	if (msg->REQ_METHOD == METHOD_REGISTER)
++		return use_outbound_register(msg);
++	else
++		return use_outbound_non_reg(msg);
++
++}
++
+ int bind_ob(struct ob_binds *pxb)
+ {
+ 	if (pxb == NULL)
+-- 
+1.7.10.4
+

Added: kamailio/trunk/debian/patches/upstream/0015-modules-rr-copy-the-flow-token-for-incoming-messages.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0015-modules-rr-copy-the-flow-token-for-incoming-messages.patch?rev=10139&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0015-modules-rr-copy-the-flow-token-for-incoming-messages.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0015-modules-rr-copy-the-flow-token-for-incoming-messages.patch Tue Apr  9 08:49:36 2013
@@ -1,0 +1,132 @@
+From 1a8843319ac00020ed291d2904b202698c3bb1c8 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Wed, 27 Mar 2013 16:33:17 +0000
+Subject: [PATCH] modules/rr: copy the flow-token for "incoming" messages when
+ using outbound (cherry picked from commit
+ 0c1725c8ccb08280a9c161e34fa9e43347cae7b0)
+
+---
+ modules/rr/record.c |   67 ++++++++++++++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 64 insertions(+), 3 deletions(-)
+
+diff --git a/modules/rr/record.c b/modules/rr/record.c
+index f4a7810..784ec90 100644
+--- a/modules/rr/record.c
++++ b/modules/rr/record.c
+@@ -37,6 +37,7 @@
+ #include "../../dprint.h"
+ #include "../../parser/parse_uri.h"
+ #include "../../parser/parse_from.h"
++#include "../../parser/parse_rr.h"
+ #include "../../str.h"
+ #include "../../data_lump.h"
+ #include "record.h"
+@@ -294,6 +295,51 @@ lump_err:
+ 	return -4;
+ }
+ 
++/*!
++ * \brief Copy flow-token from top-Route: to a string
++ *
++ * Copy the user part of the top-Route: to a string (allocating private memory
++ * for this).
++ * \param token where the user-part of the top-Route: will be copied to
++ * \param _m the SIP message to extract the top-Route: from
++ * \return 0 on success, negative on failure
++ */
++static int copy_flow_token(str *token, struct sip_msg *_m)
++{
++	rr_t *rt;
++	struct sip_uri puri;
++
++	if (_m->route
++	    || (parse_headers(_m, HDR_ROUTE_F, 0) != -1 && _m->route)) {
++		if (parse_rr(_m->route) < 0) {
++			LM_ERR("parsing Route: header body\n");
++			return -1;
++		}
++		rt = (rr_t *) _m->route->parsed;
++		if (!rt) {
++			LM_ERR("empty Route:\n");
++			return -1;
++		}
++		if (parse_uri(rt->nameaddr.uri.s, rt->nameaddr.uri.len,
++				&puri) < 0) {
++			LM_ERR("parsing Route-URI\n");
++			return -1;
++		}
++
++		token->s = pkg_malloc(puri.user.len * sizeof(char));
++		if (token->s == NULL) {
++			LM_ERR("allocating memory\n");
++			return -1;
++		}
++		memcpy(token->s, puri.user.s, puri.user.len);
++		token->len = puri.user.len;
++		return 0;
++	}
++
++	LM_ERR("no Route: headers found\n");
++	return -1;
++}
++
+ 
+ /*!
+  * \brief Insert a new Record-Route header field with lr parameter
+@@ -322,11 +368,16 @@ int record_route(struct sip_msg* _m, str *params)
+ 				return -1;
+ 			}
+ 		}
+-	} else if (use_ob) {
++	} else if (use_ob == 1) {
+ 		if (rr_obb.encode_flow_token(&user, _m->rcv) != 0) {
+ 			LM_ERR("encoding outbound flow-token\n");
+ 			return -1;
+ 		}
++	} else if (use_ob == 2) {
++		if (copy_flow_token(&user, _m) != 0) {
++			LM_ERR("copying outbound flow-token\n");
++			return -1;
++		}
+ 	}
+ 
+ 	if (append_fromtag) {
+@@ -411,11 +462,16 @@ int record_route_preset(struct sip_msg* _m, str* _data)
+ 			LM_ERR("failed to extract username\n");
+ 			return -1;
+ 		}
+-	} else if (use_ob) {
++	} else if (use_ob == 1) {
+ 		if (rr_obb.encode_flow_token(&user, _m->rcv) != 0) {
+ 			LM_ERR("encoding outbound flow-token\n");
+ 			return -1;
+ 		}
++	} else if (use_ob == 2) {
++		if (copy_flow_token(&user, _m) != 0) {
++			LM_ERR("copying outbound flow-token\n");
++			return -1;
++		}
+ 	}
+ 
+ 	if (append_fromtag) {
+@@ -634,11 +690,16 @@ int record_route_advertised_address(struct sip_msg* _m, str* _data)
+ 			LM_ERR("failed to extract username\n");
+ 			return -1;
+ 		}
+-	} else if (use_ob) {
++	} else if (use_ob == 1) {
+ 		if (rr_obb.encode_flow_token(&user, _m->rcv) != 0) {
+ 			LM_ERR("encoding outbound flow-token\n");
+ 			return -1;
+ 		}
++	} else if (use_ob == 2) {
++		if (copy_flow_token(&user, _m) != 0) {
++			LM_ERR("copying outbound flow-token\n");
++			return -1;
++		}
+ 	}
+ 
+ 	if (append_fromtag) {
+-- 
+1.7.10.4
+

Added: kamailio/trunk/debian/patches/upstream/0016-modules-outbound-further-improvement-to-the-use_outb.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0016-modules-outbound-further-improvement-to-the-use_outb.patch?rev=10139&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0016-modules-outbound-further-improvement-to-the-use_outb.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0016-modules-outbound-further-improvement-to-the-use_outb.patch Tue Apr  9 08:49:36 2013
@@ -1,0 +1,33 @@
+From 291900478f16272222b7c9138685ef871ece0875 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Wed, 27 Mar 2013 16:51:52 +0000
+Subject: [PATCH] modules/outbound: further improvement to the use_outbound()
+ check (cherry picked from commit
+ a5f8f4cd4da60168fd73d7999c09181582ec5943)
+
+---
+ modules/outbound/ob_mod.c |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/modules/outbound/ob_mod.c b/modules/outbound/ob_mod.c
+index a58fdff..3f76433 100644
+--- a/modules/outbound/ob_mod.c
++++ b/modules/outbound/ob_mod.c
+@@ -385,6 +385,14 @@ static int use_outbound_non_reg(struct sip_msg *msg)
+ 		}
+ 	}
+ 
++	/* Check there is a single Via: */
++	if (!(parse_headers(msg, HDR_VIA2_F, 0) == -1 || msg->via2 == 0
++		|| msg->via2->error != PARSE_OK))
++	{
++		LM_INFO("second Via: found - outbound not used\n");
++		return 0;
++	}
++
+ 	/* Look for ;ob in Contact-URIs */
+ 	if (msg->contact
+ 		|| (parse_headers(msg, HDR_CONTACT_F, 0) != -1 && msg->contact))
+-- 
+1.7.10.4
+

Added: kamailio/trunk/debian/patches/upstream/0017-modules-outbound-updated-edge-proxy-example-in-READM.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0017-modules-outbound-updated-edge-proxy-example-in-READM.patch?rev=10139&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0017-modules-outbound-updated-edge-proxy-example-in-READM.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0017-modules-outbound-updated-edge-proxy-example-in-READM.patch Tue Apr  9 08:49:36 2013
@@ -1,0 +1,462 @@
+From c3f2d14337093843a81353aef34c078dc7e53787 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Fri, 29 Mar 2013 01:08:02 +0000
+Subject: [PATCH] modules/outbound: updated edge proxy example in README
+ (cherry picked from commit
+ 60953cd884af7d070ce44844a874f2bd75833998)
+
+---
+ modules/outbound/README                 |  161 ++++++++++++++++++++++---------
+ modules/outbound/doc/outbound_admin.xml |  159 +++++++++++++++++++++---------
+ 2 files changed, 225 insertions(+), 95 deletions(-)
+
+diff --git a/modules/outbound/README b/modules/outbound/README
+index 08c6038..3a8c558 100644
+--- a/modules/outbound/README
++++ b/modules/outbound/README
+@@ -99,61 +99,126 @@ make all
+    “tcp_connection_lifetime”.
+ 
+    Example 1.2. Edge Proxy Configuration
+-...
+-#!define FLOW_TIMER     20
+-...
+-tcp_connection_lifetime=FLOW_TIMER+10
+-...
+-loadmodule "websocket.so"
++#!KAMAILIO
++#
++# Edge proxy configuration
++#
++
++#!subst "/REGISTRAR_IP/192.168.122.3/"
++#!subst "/REGISTRAR_PORT/5060/"
++#!substdef "/FLOW_TIMER/20/"
++
++####### Global Parameters #########
++
++debug=2
++log_stderror=no
++log_facility=LOG_LOCAL0
++fork=yes
++children=4
++alias="example.com"
++mpath="/usr/lib64/kamailio/modules"
++tcp_connection_lifetime=30 # FLOW_TIMER + 10
++
++
++####### Modules Section ########
++
++loadmodule "tm.so"
++loadmodule "sl.so"
+ loadmodule "outbound.so"
+ loadmodule "rr.so"
+ loadmodule "path.so"
+-...
+-modparam("websocket", "keepalive_timeout", FLOW_TIMER+5)
+-...
+-route {
+-        route(REQINIT);
+-        ...
+-        t_check_trans();
++loadmodule "pv.so"
++loadmodule "maxfwd.so"
++loadmodule "xlog.so"
++loadmodule "sanity.so"
++loadmodule "ctl.so"
++loadmodule "mi_rpc.so"
++loadmodule "mi_fifo.so"
++loadmodule "textops.so"
++loadmodule "siputils.so"
+ 
+-        if (is_method("INVITE|SUBSCRIBE")) {
+-                record_route();
++# ----------------- setting module-specific parameters ---------------
+ 
+-                if ($rU==$null) {
+-                        sl_send_reply("484", "Address Incomplete");
+-                        exit;
+-                }
++# ----- mi_fifo params -----
++modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
+ 
+-                if (!loose_route()) {
+-                        switch($rc) {
+-                        case -2:
+-                                # Flow-token has been tampered with
+-                                sl_send_reply("403", "Forbidden");
+-                                exit;
+-                        case -1:
+-                                # Handle -1 here if all dialog forming requests
+-                                # must be outbound routed
+-                        }
++# ----- tm params -----
++modparam("tm", "failure_reply_mode", 3)
++
++# ----- rr params -----
++modparam("rr", "append_fromtag", 0)
++
++
++####### Routing Logic ########
++
++request_route {
++        route(REQINIT);
++
++        if (is_method("CANCEL")) {
++                if (t_check_trans()) {
++                        route(RELAY);
+                 }
++                exit;
++        }
+ 
+-                t_on_failure("FAIL_OUTBOUND");
+-                route(RELAY);
+-        } else if (is_method("REGISTER")) {
++        route(WITHINDLG);
++
++        t_check_trans();
++
++        if (is_method("REGISTER")) {
++                remove_hf("Route");
+                 add_path();
+-                if (!t_relay("### Registrar ###")) {
+-                        sl_reply_error();
++                $du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
++        } else {
++                if (is_method("INVITE|SUBSCRIBE"))
++                        record_route();
++
++                if ($si == "REGISTRAR_IP" && $sp == "REGISTRAR_PORT") {
++                        if (!loose_route()) {
++                                switch($rc) {
++                                case -2:
++                                        sl_send_reply("403", "Forbidden");
++                                        exit;
++                                default:
++                                        sl_reply_error();
++                                        exit;
++                                }
++                        }
++
++                        t_on_failure("FAIL_OUTBOUND");
++                } else {
++                        if ($rU == $null) {
++                                sl_send_reply("484", "Address Incomplete");
++                                exit;
++                        }
++                        remove_hf("Route");
++                        $du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
+                 }
+-                exit;
+         }
++
++        route(RELAY);
+ }
+ 
+ route[RELAY] {
+         if (!t_relay()) {
+-                sl_send_reply("430", "Flow Failed");
++                sl_reply_error();
+         }
+         exit;
+ }
+-...
++
++route[REQINIT] {
++        if (!mf_process_maxfwd_header("10")) {
++                sl_send_reply("483","Too Many Hops");
++                exit;
++        }
++
++        if(!sanity_check("1511", "7"))
++        {
++                xlog("Malformed SIP message from $si:$sp\n");
++                exit;
++        }
++}
++
+ route[WITHINDLG] {
+         if (has_totag()) {
+                 if (!loose_route()) {
+@@ -161,44 +226,44 @@ route[WITHINDLG] {
+                         case -2:
+                                 sl_send_reply("403", "Forbidden");
+                                 exit;
+-                        case -1:
++                        default:
+                                 if (is_method("ACK")) {
+-                                        if (t_check_trans()) {
+-                                                t_relay();
++                                        if ( t_check_trans() ) {
++                                                route(RELAY);
+                                                 exit;
+                                         } else {
+                                                 exit;
+                                         }
+                                 }
+-                                sl_send_reply("404", "Not Found");
++                                sl_send_reply("404","Not Found");
+                         }
+                 } else {
++                        if (is_method("NOTIFY")) {
++                                record_route();
++                        }
+                         route(RELAY);
+                 }
+                 exit;
+         }
+ }
+-...
++
+ onreply_route {
+         if (!t_check_trans()) {
+                 drop;
+         }
+ 
+-        if ($rm == "REGISTER" && $rs >= 200 && $rs <= 299)
+-        {
++        if ($rm == "REGISTER" && $rs >= 200 && $rs <= 299) {
++                remove_hf("Flow-Timer");
+                 if ($(hdr(Require)[*])=~"outbound")
+                         insert_hf("Flow-Timer: FLOW_TIMER\r\n", "Call-ID");
+         }
+-
+-...
+ }
+ 
+-failure_route[FAIL_OUTBOUND] {
++failure_route[FAIL_OUTBOUND]{
+         if (t_branch_timeout() || !t_branch_replied()) {
+                 send_reply("430", "Flow Failed");
+         }
+ }
+-...
+ 
+    Example 1.3. Registrar Configuration
+ ...
+diff --git a/modules/outbound/doc/outbound_admin.xml b/modules/outbound/doc/outbound_admin.xml
+index 2e5d21e..2582caa 100644
+--- a/modules/outbound/doc/outbound_admin.xml
++++ b/modules/outbound/doc/outbound_admin.xml
+@@ -57,61 +57,126 @@ make all
+ 	<example>
+ 	<title>Edge Proxy Configuration</title>
+ 	<programlisting><![CDATA[
+-...
+-#!define FLOW_TIMER	20
+-...
+-tcp_connection_lifetime=FLOW_TIMER+10
+-...
+-loadmodule "websocket.so"
++#!KAMAILIO
++#
++# Edge proxy configuration
++#
++
++#!subst "/REGISTRAR_IP/192.168.122.3/"
++#!subst "/REGISTRAR_PORT/5060/"
++#!substdef "/FLOW_TIMER/20/"
++
++####### Global Parameters #########
++
++debug=2
++log_stderror=no
++log_facility=LOG_LOCAL0
++fork=yes
++children=4
++alias="example.com"
++mpath="/usr/lib64/kamailio/modules"
++tcp_connection_lifetime=30 # FLOW_TIMER + 10
++
++
++####### Modules Section ########
++
++loadmodule "tm.so"
++loadmodule "sl.so"
+ loadmodule "outbound.so"
+ loadmodule "rr.so"
+ loadmodule "path.so"
+-...
+-modparam("websocket", "keepalive_timeout", FLOW_TIMER+5)
+-...
+-route {
++loadmodule "pv.so"
++loadmodule "maxfwd.so"
++loadmodule "xlog.so"
++loadmodule "sanity.so"
++loadmodule "ctl.so"
++loadmodule "mi_rpc.so"
++loadmodule "mi_fifo.so"
++loadmodule "textops.so"
++loadmodule "siputils.so"
++
++# ----------------- setting module-specific parameters ---------------
++
++# ----- mi_fifo params -----
++modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
++
++# ----- tm params -----
++modparam("tm", "failure_reply_mode", 3)
++
++# ----- rr params -----
++modparam("rr", "append_fromtag", 0)
++
++
++####### Routing Logic ########
++
++request_route {
+ 	route(REQINIT);
+-	...
++
++	if (is_method("CANCEL")) {
++		if (t_check_trans()) {
++			route(RELAY);
++		}
++		exit;
++	}
++
++	route(WITHINDLG);
++
+ 	t_check_trans();
+ 
+-	if (is_method("INVITE|SUBSCRIBE")) {
+-		record_route();
++	if (is_method("REGISTER")) {
++		remove_hf("Route");
++		add_path();
++		$du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
++	} else {
++		if (is_method("INVITE|SUBSCRIBE"))
++			record_route();
+ 
+-		if ($rU==$null) {
+-			sl_send_reply("484", "Address Incomplete");
+-			exit;
+-		}
++		if ($si == "REGISTRAR_IP" && $sp == "REGISTRAR_PORT") {
++			if (!loose_route()) {
++				switch($rc) {
++				case -2:
++					sl_send_reply("403", "Forbidden");
++					exit;
++				default:
++					sl_reply_error();
++					exit;
++				}
++			}
+ 
+-		if (!loose_route()) {
+-			switch($rc) {
+-			case -2:
+-				# Flow-token has been tampered with
+-				sl_send_reply("403", "Forbidden");
++			t_on_failure("FAIL_OUTBOUND");
++		} else {
++			if ($rU == $null) {
++				sl_send_reply("484", "Address Incomplete");
+ 				exit;
+-			case -1:
+-				# Handle -1 here if all dialog forming requests
+-				# must be outbound routed
+ 			}
++			remove_hf("Route");
++			$du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
+ 		}
+-
+-		t_on_failure("FAIL_OUTBOUND");
+-		route(RELAY);
+-	} else if (is_method("REGISTER")) {
+-		add_path();
+-		if (!t_relay("### Registrar ###")) {
+-			sl_reply_error();
+-		}
+-		exit;
+ 	}
++
++	route(RELAY);
+ }
+ 
+ route[RELAY] {
+ 	if (!t_relay()) {
+-		sl_send_reply("430", "Flow Failed");
++		sl_reply_error();
+ 	}
+ 	exit;
+ }
+-...
++
++route[REQINIT] {
++	if (!mf_process_maxfwd_header("10")) {
++		sl_send_reply("483","Too Many Hops");
++		exit;
++	}
++
++	if(!sanity_check("1511", "7"))
++	{
++		xlog("Malformed SIP message from $si:$sp\n");
++		exit;
++	}
++}
++
+ route[WITHINDLG] {
+ 	if (has_totag()) {
+ 		if (!loose_route()) {
+@@ -119,44 +184,44 @@ route[WITHINDLG] {
+ 			case -2:
+ 				sl_send_reply("403", "Forbidden");
+ 				exit;
+-			case -1:
++			default:
+ 				if (is_method("ACK")) {
+-					if (t_check_trans()) {
+-						t_relay();
++					if ( t_check_trans() ) {
++						route(RELAY);
+ 						exit;
+ 					} else {
+ 						exit;
+ 					}
+ 				}
+-				sl_send_reply("404", "Not Found");
++				sl_send_reply("404","Not Found");
+ 			}
+ 		} else {
++			if (is_method("NOTIFY")) {
++				record_route();
++			}
+ 			route(RELAY);
+ 		}
+ 		exit;
+ 	}
+ }
+-...
++
+ onreply_route {
+ 	if (!t_check_trans()) {
+ 		drop;
+ 	}
+ 
+-	if ($rm == "REGISTER" && $rs >= 200 && $rs <= 299)
+-	{
++	if ($rm == "REGISTER" && $rs >= 200 && $rs <= 299) {
++		remove_hf("Flow-Timer");
+ 		if ($(hdr(Require)[*])=~"outbound")
+ 			insert_hf("Flow-Timer: FLOW_TIMER\r\n", "Call-ID");
+ 	}
+-
+-...
+ }
+ 
+-failure_route[FAIL_OUTBOUND] {
++failure_route[FAIL_OUTBOUND]{
+ 	if (t_branch_timeout() || !t_branch_replied()) {
+ 		send_reply("430", "Flow Failed");
+ 	}
+ }
+-...
+ ]]></programlisting>
+ 	</example>
+ 	<example>
+-- 
+1.7.10.4
+

Added: kamailio/trunk/debian/patches/upstream/0018-modules-registrar-changed-instance-related-INFO-to-D.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0018-modules-registrar-changed-instance-related-INFO-to-D.patch?rev=10139&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0018-modules-registrar-changed-instance-related-INFO-to-D.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0018-modules-registrar-changed-instance-related-INFO-to-D.patch Tue Apr  9 08:49:36 2013
@@ -1,0 +1,29 @@
+From eedf78559a0f289f695cdff40c581ec37c712502 Mon Sep 17 00:00:00 2001
+From: Juha Heinanen <jh at tutpro.com>
+Date: Fri, 29 Mar 2013 16:30:51 +0200
+Subject: [PATCH] modules/registrar: changed instance related INFO to DBG
+ (cherry picked from commit
+ 33108f4843fdef6d45773849089446b0c408ecf3)
+
+---
+ modules/registrar/lookup.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/modules/registrar/lookup.c b/modules/registrar/lookup.c
+index 91ccb8e..fcb6c26 100644
+--- a/modules/registrar/lookup.c
++++ b/modules/registrar/lookup.c
+@@ -309,8 +309,8 @@ int lookup(struct sip_msg* _m, udomain_t* _d, str* _uri)
+ 
+ 			/* The same as for the first contact applies for branches 
+ 			 * regarding path vs. received. */
+-			LM_INFO("instance is %.*s\n",
+-				ptr->instance.len, ptr->instance.s);
++			LM_DBG("instance is %.*s\n",
++			       ptr->instance.len, ptr->instance.s);
+ 			if (append_branch(_m, &ptr->c,
+ 					  path_dst.len?&path_dst:&ptr->received,
+ 					  &ptr->path, ptr->q, ptr->cflags,
+-- 
+1.7.10.4
+

Added: kamailio/trunk/debian/patches/upstream/0019-modules-outbound-changed-some-INFO-level-output-to-D.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0019-modules-outbound-changed-some-INFO-level-output-to-D.patch?rev=10139&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0019-modules-outbound-changed-some-INFO-level-output-to-D.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0019-modules-outbound-changed-some-INFO-level-output-to-D.patch Tue Apr  9 08:49:36 2013
@@ -1,0 +1,111 @@
+From 71dbcc196db780d5d8ca2960130850ace956ceca Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Fri, 29 Mar 2013 23:35:39 +0000
+Subject: [PATCH] modules/outbound: changed some INFO level output to DBG
+ (cherry picked from commit
+ ce0c420ba30388256e958a0bdf6d8f37138c3f97)
+
+---
+ modules/outbound/ob_mod.c |   22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/modules/outbound/ob_mod.c b/modules/outbound/ob_mod.c
+index 3f76433..3d4d967 100644
+--- a/modules/outbound/ob_mod.c
++++ b/modules/outbound/ob_mod.c
+@@ -283,7 +283,7 @@ static int use_outbound_register(struct sip_msg *msg)
+ 	if (!(parse_headers(msg, HDR_VIA2_F, 0) == -1 || msg->via2 == 0
+ 		|| msg->via2->error != PARSE_OK))
+ 	{
+-		LM_INFO("second Via: found - outbound not used\n");
++		LM_DBG("second Via: found - outbound not used\n");
+ 		return 0;
+ 	}
+ 
+@@ -305,14 +305,14 @@ static int use_outbound_register(struct sip_msg *msg)
+ 		
+ 		if (contact->reg_id)
+ 		{
+-			LM_INFO("found REGISTER with ;reg-id paramter on"
++			LM_DBG("found REGISTER with ;reg-id paramter on"
+ 				" Contact-URI - outbound used\n");
+ 			return 1;
+ 		}
+ 
+ 	}
+ 
+-	LM_INFO("outbound not used\n");
++	LM_DBG("outbound not used\n");
+ 	return 0;
+ }
+ 
+@@ -353,7 +353,7 @@ static int use_outbound_non_reg(struct sip_msg *msg)
+ 		{
+ 			/* If the host:port doesn't match, or does but it's
+ 			   gruu */
+-			LM_INFO("top Route-URI is not me - outbound not"
++			LM_DBG("top Route-URI is not me - outbound not"
+ 				" used\n");
+ 			return 0;
+ 		}
+@@ -367,7 +367,7 @@ static int use_outbound_non_reg(struct sip_msg *msg)
+ 
+ 		if (hooks.uri.ob)
+ 		{
+-			LM_INFO("found ;ob parameter on Route-URI - outbound"
++			LM_DBG("found ;ob parameter on Route-URI - outbound"
+ 				" used\n");
+ 
+ 			if (decode_flow_token(&rcv, puri.user) == 0)
+@@ -375,12 +375,12 @@ static int use_outbound_non_reg(struct sip_msg *msg)
+ 				if (!ip_addr_cmp(&rcv.src_ip, &msg->rcv.src_ip)
+ 					|| rcv.src_port != msg->rcv.src_port)
+ 				{
+-					LM_INFO("\"incoming\" request found\n");
++					LM_DBG("\"incoming\" request found\n");
+ 					return 2;
+ 				}
+ 			}
+ 
+-			LM_INFO("\"outgoing\" request found\n");
++			LM_DBG("\"outgoing\" request found\n");
+ 			return 1;
+ 		}
+ 	}
+@@ -389,7 +389,7 @@ static int use_outbound_non_reg(struct sip_msg *msg)
+ 	if (!(parse_headers(msg, HDR_VIA2_F, 0) == -1 || msg->via2 == 0
+ 		|| msg->via2->error != PARSE_OK))
+ 	{
+-		LM_INFO("second Via: found - outbound not used\n");
++		LM_DBG("second Via: found - outbound not used\n");
+ 		return 0;
+ 	}
+ 
+@@ -423,13 +423,13 @@ static int use_outbound_non_reg(struct sip_msg *msg)
+ 		}
+ 		if (hooks.contact.ob)
+ 		{
+-			LM_INFO("found ;ob parameter on Contact-URI - outbound"
++			LM_DBG("found ;ob parameter on Contact-URI - outbound"
+ 				" used\n");
+ 			return 1;
+ 		}
+ 	}
+ 
+-	LM_INFO("outbound not used\n");
++	LM_DBG("outbound not used\n");
+ 	return 0;
+ }
+ 
+@@ -449,7 +449,7 @@ int use_outbound(struct sip_msg *msg)
+ 		return 1;
+ 	}
+ 
+-	LM_INFO("Analysing %.*s for outbound markers\n",
++	LM_DBG("Analysing %.*s for outbound markers\n",
+ 		msg->first_line.u.request.method.len,
+ 		msg->first_line.u.request.method.s);
+ 
+-- 
+1.7.10.4
+

Added: kamailio/trunk/debian/patches/upstream/0021-modules-ndb_redis-b-f-restore-correctly-last-char-in.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0021-modules-ndb_redis-b-f-restore-correctly-last-char-in.patch?rev=10139&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0021-modules-ndb_redis-b-f-restore-correctly-last-char-in.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0021-modules-ndb_redis-b-f-restore-correctly-last-char-in.patch Tue Apr  9 08:49:36 2013
@@ -1,0 +1,55 @@
+From 0e7d000a9c73b0fd06132e458f838cc78abddbed Mon Sep 17 00:00:00 2001
+From: Vicente Hernando <vhernando at systemonenoc.com>
+Date: Mon, 8 Apr 2013 11:47:51 +0200
+Subject: [PATCH] modules/ndb_redis: b/f restore correctly last char in
+ argument strings.
+
+---
+ modules/ndb_redis/ndb_redis_mod.c |   20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/modules/ndb_redis/ndb_redis_mod.c b/modules/ndb_redis/ndb_redis_mod.c
+index ecce4e9..2cca4dd 100644
+--- a/modules/ndb_redis/ndb_redis_mod.c
++++ b/modules/ndb_redis/ndb_redis_mod.c
+@@ -248,12 +248,12 @@ static int w_redis_cmd5(struct sip_msg* msg, char* ssrv, char* scmd,
+ 	arg1.s[arg1.len] = '\0';
+ 	arg2.s[arg2.len] = '\0';
+ 	if(redisc_exec(&s[0], &s[2], &s[1], arg1.s, arg2.s)<0) {
+-		c1 = arg1.s[arg1.len];
+-		c2 = arg2.s[arg2.len];
++		arg1.s[arg1.len] = c1;
++		arg2.s[arg2.len] = c2;
+ 		return -1;
+ 	}
+-	c1 = arg1.s[arg1.len];
+-	c2 = arg2.s[arg2.len];
++	arg1.s[arg1.len] = c1;
++	arg2.s[arg2.len] = c2;
+ 	return 1;
+ }
+ 
+@@ -305,14 +305,14 @@ static int w_redis_cmd6(struct sip_msg* msg, char* ssrv, char* scmd,
+ 	arg2.s[arg2.len] = '\0';
+ 	arg3.s[arg3.len] = '\0';
+ 	if(redisc_exec(&s[0], &s[2], &s[1], arg1.s, arg2.s, arg3.s)<0) {
+-		c1 = arg1.s[arg1.len];
+-		c2 = arg2.s[arg2.len];
+-		c3 = arg3.s[arg3.len];
++		arg1.s[arg1.len] = c1;
++		arg2.s[arg2.len] = c2;
++		arg3.s[arg3.len] = c3;
+ 		return -1;
+ 	}
+-	c1 = arg1.s[arg1.len];
+-	c2 = arg2.s[arg2.len];
+-	c3 = arg3.s[arg3.len];
++	arg1.s[arg1.len] = c1;
++	arg2.s[arg2.len] = c2;
++	arg3.s[arg3.len] = c3;
+ 	return 1;
+ }
+ 
+-- 
+1.7.10.4
+

Added: kamailio/trunk/debian/patches/upstream/0022-modules-ndb_redis-b-f-redisc_exec-returns-false-if-r.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0022-modules-ndb_redis-b-f-redisc_exec-returns-false-if-r.patch?rev=10139&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0022-modules-ndb_redis-b-f-redisc_exec-returns-false-if-r.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0022-modules-ndb_redis-b-f-redisc_exec-returns-false-if-r.patch Tue Apr  9 08:49:36 2013
@@ -1,0 +1,28 @@
+From c907eff8140bd07022aaf028741392322892b2f4 Mon Sep 17 00:00:00 2001
+From: Vicente Hernando <vhernando at systemonenoc.com>
+Date: Tue, 9 Apr 2013 01:03:49 +0200
+Subject: [PATCH] modules/ndb_redis: b/f redisc_exec returns false if redis
+ server is down.
+
+---
+ modules/ndb_redis/redis_client.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/modules/ndb_redis/redis_client.c b/modules/ndb_redis/redis_client.c
+index 0d8f703..322cabe 100644
+--- a/modules/ndb_redis/redis_client.c
++++ b/modules/ndb_redis/redis_client.c
+@@ -366,6 +366,10 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
+ 		if(redisc_reconnect_server(rsrv)==0)
+ 		{
+ 			rpl->rplRedis = redisvCommand(rsrv->ctxRedis, cmd->s, ap);
++		} else {
++			LM_ERR("unable to reconnect to redis server: %.*s\n", srv->len, srv->s);
++			cmd->s[cmd->len] = c;
++			goto error_exec;
+ 		}
+ 	}
+ 	cmd->s[cmd->len] = c;
+-- 
+1.7.10.4
+




More information about the Pkg-voip-commits mailing list