[Pkg-voip-commits] [kamailio] 06/07: add upstream fixes

Victor Seva Lopez maniac-guest at moszumanska.debian.org
Tue Aug 11 14:52:13 UTC 2015


This is an automated email from the git hooks/post-receive script.

maniac-guest pushed a commit to branch master
in repository kamailio.

commit 33b7028972f83af912c2e37726e00521ef71ee87
Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Date:   Tue Aug 11 13:29:36 2015 +0200

    add upstream fixes
---
 debian/patches/series                              |  25 +-
 ...cycle-through-all-the-uac-while-checking-.patch |  27 ++
 ...race-safety-check-if-db-connection-is-set.patch |  31 ++
 ...heck-if-To-header-is-parsed-and-available.patch |  32 ++
 ...patcher-free-parsed-params-at-reload-time.patch |  25 +
 ...ile.defs-separate-RUNBASEDIR-from-BASEDIR.patch |  30 ++
 ...per-ack-message-struct-for-external-engin.patch |  29 ++
 ...bose-debug-message-when-local-transaction.patch |  28 ++
 ...ngoing-registration-state-if-retry-interv.patch |  38 ++
 ...out-setting-acc-flag-for-ACKs-that-should.patch |  43 ++
 ...-VERSION_NODATE-and-VERSION_DATE-for-repr.patch |  37 ++
 .../0011-core-fix-mips-compilation.patch}          |  30 +-
 ...012-kamcmd-use-NAME-to-build-help-message.patch |  26 ++
 .../0013-rr-fix-detecting-next-strict-router.patch |  73 +++
 ...-safety-check-if-hash-tables-exist-for-rp.patch |  62 +++
 ...-check-if-hash-tables-exist-for-address-c.patch | 156 +++++++
 ...te-in-docs-for-t_set_no_e2e_cancel_reason.patch |  30 ++
 .../0017-pipelimit-regenerated-the-readme.patch    | 158 +++++++
 .../upstream/0018-pv-readme-regenerated.patch      |  88 ++++
 .../upstream/0019-tm-readme-regenerated.patch      | 519 +++++++++++++++++++++
 ...reginfo-use-ul.get_urecord_by_ruid-instea.patch |  55 +++
 ...ar-get-instance-and-ref_id-when-using-msg.patch |  42 ++
 .../0022-rtpengine-fix-typo-in-documentation.patch |  32 ++
 .../0023-rtpengine-regenerate-README.patch         |  39 ++
 24 files changed, 1641 insertions(+), 14 deletions(-)

diff --git a/debian/patches/series b/debian/patches/series
index b657ff2..9de3a45 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,6 +1,27 @@
-upstream/0001-kex-support-VERSION_NODATE-and-VERSION_DATE-for-repr.patch
+upstream/0001-modules-tm-cycle-through-all-the-uac-while-checking-.patch
+upstream/0002-siptrace-safety-check-if-db-connection-is-set.patch
+upstream/0003-siptrace-check-if-To-header-is-parsed-and-available.patch
+upstream/0004-dispatcher-free-parsed-params-at-reload-time.patch
+upstream/0005-Makefile.defs-separate-RUNBASEDIR-from-BASEDIR.patch
+upstream/0006-acc-use-proper-ack-message-struct-for-external-engin.patch
+upstream/0007-tm-more-verbose-debug-message-when-local-transaction.patch
+upstream/0008-uac-reset-ongoing-registration-state-if-retry-interv.patch
+upstream/0009-acc-note-about-setting-acc-flag-for-ACKs-that-should.patch
+upstream/0010-kex-support-VERSION_NODATE-and-VERSION_DATE-for-repr.patch
+upstream/0011-core-fix-mips-compilation.patch
+upstream/0012-kamcmd-use-NAME-to-build-help-message.patch
+upstream/0013-rr-fix-detecting-next-strict-router.patch
+upstream/0014-permissions-safety-check-if-hash-tables-exist-for-rp.patch
+upstream/0015-permissions-check-if-hash-tables-exist-for-address-c.patch
+upstream/0016-tm-added-note-in-docs-for-t_set_no_e2e_cancel_reason.patch
+upstream/0017-pipelimit-regenerated-the-readme.patch
+upstream/0018-pv-readme-regenerated.patch
+upstream/0019-tm-readme-regenerated.patch
+upstream/0020-Revert-pua_reginfo-use-ul.get_urecord_by_ruid-instea.patch
+upstream/0021-registrar-get-instance-and-ref_id-when-using-msg.patch
+upstream/0022-rtpengine-fix-typo-in-documentation.patch
+upstream/0023-rtpengine-regenerate-README.patch
 no_lib64_on_64_bits.patch
 no_INSTALL_file.patch
 fix_export.patch
-fix-mips.patch
 no_tls_certs_generate.patch
diff --git a/debian/patches/upstream/0001-modules-tm-cycle-through-all-the-uac-while-checking-.patch b/debian/patches/upstream/0001-modules-tm-cycle-through-all-the-uac-while-checking-.patch
new file mode 100644
index 0000000..b837431
--- /dev/null
+++ b/debian/patches/upstream/0001-modules-tm-cycle-through-all-the-uac-while-checking-.patch
@@ -0,0 +1,27 @@
+From 5100ba7f3e15456d45b78444c415cefd36485921 Mon Sep 17 00:00:00 2001
+From: Federico Cabiddu <federico.cabiddu at gmail.com>
+Date: Thu, 23 Jul 2015 15:25:44 +0200
+Subject: [PATCH] modules/tm: cycle through all the uac while checking for
+ already existing branches
+
+(cherry picked from commit 96ac163139976e8a9dea0e7252c66294054281b4)
+---
+ modules/tm/t_append_branches.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/tm/t_append_branches.c b/modules/tm/t_append_branches.c
+index b276d9e..8060021 100644
+--- a/modules/tm/t_append_branches.c
++++ b/modules/tm/t_append_branches.c
+@@ -116,7 +116,7 @@ int t_append_branches(void) {
+ 										&bflags, &si, &ruid, &instance, &location_ua))) {
+ 		LM_DBG("Current uri %.*s\n",current_uri.len, current_uri.s);
+ 
+-		for (i=0; i<nr_branches; i++) {
++		for (i=0; i<=nr_branches; i++) {
+ 			if (t->uac[i].ruid.len == ruid.len
+ 					&& !memcmp(t->uac[i].ruid.s, ruid.s, ruid.len)) {
+ 				LM_DBG("branch already added [%.*s]\n", ruid.len, ruid.s);
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0002-siptrace-safety-check-if-db-connection-is-set.patch b/debian/patches/upstream/0002-siptrace-safety-check-if-db-connection-is-set.patch
new file mode 100644
index 0000000..fe4a6b2
--- /dev/null
+++ b/debian/patches/upstream/0002-siptrace-safety-check-if-db-connection-is-set.patch
@@ -0,0 +1,31 @@
+From ba7b0eaba0c14db6ea27190787aea25d30cfb2ca Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Fri, 24 Jul 2015 12:30:58 +0200
+Subject: [PATCH] siptrace: safety check if db connection is set
+
+- reported in GH #262
+
+(cherry picked from commit 740cfa0ebed20ba7b5ae2cab1b25aa2f6cd83899)
+---
+ modules/siptrace/siptrace.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/modules/siptrace/siptrace.c b/modules/siptrace/siptrace.c
+index 07e3a1a..4ee8f00 100644
+--- a/modules/siptrace/siptrace.c
++++ b/modules/siptrace/siptrace.c
+@@ -757,6 +757,11 @@ static int sip_trace_store(struct _siptrace_data *sto, struct dest_info *dst)
+ 
+ static int sip_trace_store_db(struct _siptrace_data *sto)
+ {
++	if(db_con==NULL) {
++		LM_DBG("database connection not initialized\n");
++		return -1;
++	}
++
+ 	if(trace_to_database_flag==NULL || *trace_to_database_flag==0)
+ 		goto done;
+ 
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0003-siptrace-check-if-To-header-is-parsed-and-available.patch b/debian/patches/upstream/0003-siptrace-check-if-To-header-is-parsed-and-available.patch
new file mode 100644
index 0000000..4ae5321
--- /dev/null
+++ b/debian/patches/upstream/0003-siptrace-check-if-To-header-is-parsed-and-available.patch
@@ -0,0 +1,32 @@
+From 8ba3be202f70a90ea88cdaac47fd2a7f9a9ef4f4 Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Fri, 24 Jul 2015 12:43:26 +0200
+Subject: [PATCH] siptrace: check if To header is parsed and available
+
+- it is accessed and can lead to crash if not prepared
+- reported by GH #263
+
+(cherry picked from commit 93b297e16134b0e74cf83e3604da01355a52e700)
+---
+ modules/siptrace/siptrace.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/modules/siptrace/siptrace.c b/modules/siptrace/siptrace.c
+index 4ee8f00..df6ceff 100644
+--- a/modules/siptrace/siptrace.c
++++ b/modules/siptrace/siptrace.c
+@@ -535,6 +535,11 @@ static int sip_trace_prepare(sip_msg_t *msg)
+ 		goto error;
+ 	}
+ 
++	if(parse_to_header(msg)==-1 || msg->to==NULL || get_to(msg)==NULL) {
++		LM_ERR("cannot parse To header\n");
++		goto error;
++	}
++
+ 	if(parse_headers(msg, HDR_CALLID_F, 0)!=0 || msg->callid==NULL
+ 			|| msg->callid->body.s==NULL) {
+ 		LM_ERR("cannot parse call-id\n");
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0004-dispatcher-free-parsed-params-at-reload-time.patch b/debian/patches/upstream/0004-dispatcher-free-parsed-params-at-reload-time.patch
new file mode 100644
index 0000000..6f775ee
--- /dev/null
+++ b/debian/patches/upstream/0004-dispatcher-free-parsed-params-at-reload-time.patch
@@ -0,0 +1,25 @@
+From bfdddc685d95377393a90bd911b333045c7feb38 Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Mon, 27 Jul 2015 10:23:39 +0200
+Subject: [PATCH] dispatcher: free parsed params at reload time
+
+(cherry picked from commit fc53c424f4ab7454bfd1e644291906392fc495fa)
+---
+ modules/dispatcher/dispatch.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c
+index 7491a5f..a5f8a2a 100644
+--- a/modules/dispatcher/dispatch.c
++++ b/modules/dispatcher/dispatch.c
+@@ -219,6 +219,7 @@ int ds_set_attrs(ds_dest_t *dest, str *attrs)
+ 			dest->attrs.socket = pit->body;
+ 		}
+ 	}
++	if(params_list) free_params(params_list);
+ 	return 0;
+ }
+ 
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0005-Makefile.defs-separate-RUNBASEDIR-from-BASEDIR.patch b/debian/patches/upstream/0005-Makefile.defs-separate-RUNBASEDIR-from-BASEDIR.patch
new file mode 100644
index 0000000..d316457
--- /dev/null
+++ b/debian/patches/upstream/0005-Makefile.defs-separate-RUNBASEDIR-from-BASEDIR.patch
@@ -0,0 +1,30 @@
+From 96ffc362f1acdf8ae22f833e3c9fb0e1a675e5d1 Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Mon, 27 Jul 2015 12:07:38 +0200
+Subject: [PATCH] Makefile.defs: separate RUNBASEDIR from BASEDIR
+
+- not sharing same purpose, a common value can still be forced via
+  DESTDIR
+
+(cherry picked from commit 747c3284c6eb31fab3b143c4217c84aa29fb9ca5)
+---
+ Makefile.defs | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.defs b/Makefile.defs
+index c3d51e4..3e7f726 100644
+--- a/Makefile.defs
++++ b/Makefile.defs
+@@ -434,7 +434,8 @@ doxygen_dir=doc/doxygen
+ 
+ BASEDIR ?= $(DESTDIR)
+ basedir = $(BASEDIR)
+-runbasedir = $(BASEDIR)
++RUNBASEDIR ?= $(DESTDIR)
++runbasedir = $(RUNBASEDIR)
+ 
+ # install location
+ PREFIX ?= $(LOCALBASE)
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0006-acc-use-proper-ack-message-struct-for-external-engin.patch b/debian/patches/upstream/0006-acc-use-proper-ack-message-struct-for-external-engin.patch
new file mode 100644
index 0000000..d93eaa8
--- /dev/null
+++ b/debian/patches/upstream/0006-acc-use-proper-ack-message-struct-for-external-engin.patch
@@ -0,0 +1,29 @@
+From a18915e019ebcfa35805d3985383705028fbc00c Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Mon, 27 Jul 2015 13:42:33 +0200
+Subject: [PATCH] acc: use proper ack message struct for external engine
+ accounting of ACK
+
+- reported by Yasin Caner - GH #266
+
+(cherry picked from commit 58acd28f620c4a4e6b9abb1b9a2dfa2d8556708c)
+---
+ modules/acc/acc_logic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/acc/acc_logic.c b/modules/acc/acc_logic.c
+index bd3f1cc..16a97e5 100644
+--- a/modules/acc/acc_logic.c
++++ b/modules/acc/acc_logic.c
+@@ -615,7 +615,7 @@ static inline void acc_onack( struct cell* t, struct sip_msg *req,
+ #endif
+ 
+ 	/* run extra acc engines */
+-	acc_run_engines(req, 0, NULL);
++	acc_run_engines(ack, 0, NULL);
+ 	
+ }
+ 
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0007-tm-more-verbose-debug-message-when-local-transaction.patch b/debian/patches/upstream/0007-tm-more-verbose-debug-message-when-local-transaction.patch
new file mode 100644
index 0000000..fbb942c
--- /dev/null
+++ b/debian/patches/upstream/0007-tm-more-verbose-debug-message-when-local-transaction.patch
@@ -0,0 +1,28 @@
+From aa91d8ba178624c08ffcbb6af55efa777f6ca640 Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Mon, 27 Jul 2015 15:03:21 +0200
+Subject: [PATCH] tm: more verbose debug message when local transaction is
+ completed
+
+(cherry picked from commit 54fea03a078f8258d124a83443617c54bdbc2574)
+---
+ modules/tm/t_reply.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
+index d14ed1c..b2e6e53 100644
+--- a/modules/tm/t_reply.c
++++ b/modules/tm/t_reply.c
+@@ -2050,7 +2050,8 @@ enum rps local_reply( struct cell *t, struct sip_msg *p_msg, int branch,
+ 	}
+ 	
+ 	if (local_winner>=0 && winning_code>=200 ) {
+-		DBG("DEBUG: local transaction completed\n");
++		DBG("DEBUG: local transaction completed %d/%d (totag retr: %d/%d)\n",
++				winning_code, local_winner, totag_retr, t->tmcb_hl.reg_types);
+ 		if (!totag_retr) {
+ 			if (unlikely(has_tran_tmcbs(t,TMCB_LOCAL_COMPLETED) ))
+ 				run_trans_callbacks( TMCB_LOCAL_COMPLETED, t, 0,
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0008-uac-reset-ongoing-registration-state-if-retry-interv.patch b/debian/patches/upstream/0008-uac-reset-ongoing-registration-state-if-retry-interv.patch
new file mode 100644
index 0000000..bc95f6d
--- /dev/null
+++ b/debian/patches/upstream/0008-uac-reset-ongoing-registration-state-if-retry-interv.patch
@@ -0,0 +1,38 @@
+From e5f8d6282eefbe4c8ad0b0309ac06ab468e9b1f2 Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Mon, 27 Jul 2015 15:04:30 +0200
+Subject: [PATCH] uac: reset ongoing registration state if retry interval is
+ exceeded
+
+- cover the case of remote registration process stuck in ongoing state
+  for long time
+- reported by Andy J Robinson, GH #255
+
+(cherry picked from commit cfa6831f9a81988dc1844ba3e4e6048c12841606)
+---
+ modules/uac/uac_reg.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/modules/uac/uac_reg.c b/modules/uac/uac_reg.c
+index 0cff689..7b7d2de 100644
+--- a/modules/uac/uac_reg.c
++++ b/modules/uac/uac_reg.c
+@@ -928,8 +928,13 @@ int uac_reg_update(reg_uac_t *reg, time_t tn)
+ 		return -1;
+ 	if(reg->expires==0)
+ 		return 1;
+-	if(reg->flags&UAC_REG_ONGOING)
+-		return 2;
++	if(reg->flags&UAC_REG_ONGOING) {
++		if (reg->timer_expires > tn - reg_retry_interval)
++			return 2;
++		LM_DBG("record marked as ongoing registration (%d) - resetting\n",
++				(int)reg->flags);
++		reg->flags &= ~(UAC_REG_ONLINE|UAC_REG_AUTHSENT);
++	}
+ 	if(reg->flags&UAC_REG_DISABLED)
+ 		return 4;
+ 	if(reg->timer_expires > tn + reg_timer_interval + 3)
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0009-acc-note-about-setting-acc-flag-for-ACKs-that-should.patch b/debian/patches/upstream/0009-acc-note-about-setting-acc-flag-for-ACKs-that-should.patch
new file mode 100644
index 0000000..c575d00
--- /dev/null
+++ b/debian/patches/upstream/0009-acc-note-about-setting-acc-flag-for-ACKs-that-should.patch
@@ -0,0 +1,43 @@
+From c68a6dcad598130bc6894f1de5ef3b39eb789660 Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Mon, 27 Jul 2015 18:24:09 +0200
+Subject: [PATCH] acc: note about setting acc flag for ACKs that should be
+ recorded
+
+(cherry picked from commit 6656d4459f0c7d4c1b7cb5d2b214201c5a587c5c)
+---
+ modules/acc/README            | 3 ++-
+ modules/acc/doc/acc_admin.xml | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/modules/acc/README b/modules/acc/README
+index 2c742ee..a019b0e 100644
+--- a/modules/acc/README
++++ b/modules/acc/README
+@@ -767,7 +767,8 @@ modparam("acc", "failed_filter", "404,407")
+    Shall acc attempt to account e2e ACKs too ? Note that this is really
+    only an attempt, as e2e ACKs may take a different path (unless RR
+    enabled) and mismatch original INVITE (e2e ACKs are a separate
+-   transaction).
++   transaction). The flag for accounting has to be set for each ACK as
++   well.
+ 
+    Default value is 0 (no).
+ 
+diff --git a/modules/acc/doc/acc_admin.xml b/modules/acc/doc/acc_admin.xml
+index 820f480..fbe7dc3 100644
+--- a/modules/acc/doc/acc_admin.xml
++++ b/modules/acc/doc/acc_admin.xml
+@@ -559,7 +559,8 @@ modparam("acc", "failed_filter", "404,407")
+ 		Shall acc attempt to account e2e ACKs too ? Note that this is really 
+ 		only an attempt, as e2e ACKs may take a different path 
+ 		(unless RR enabled) and mismatch original INVITE (e2e ACKs are 
+-		a separate transaction).
++		a separate transaction). The flag for accounting has to be set
++		for each ACK as well.
+ 		</para>
+ 		<para>
+ 		Default value is 0 (no).
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0010-kex-support-VERSION_NODATE-and-VERSION_DATE-for-repr.patch b/debian/patches/upstream/0010-kex-support-VERSION_NODATE-and-VERSION_DATE-for-repr.patch
new file mode 100644
index 0000000..9ee3945
--- /dev/null
+++ b/debian/patches/upstream/0010-kex-support-VERSION_NODATE-and-VERSION_DATE-for-repr.patch
@@ -0,0 +1,37 @@
+From fb2af6107a9c6cd3552fe0a95c699c30e4edad4c Mon Sep 17 00:00:00 2001
+From: Victor Seva <linuxmaniac at torreviejawireless.org>
+Date: Mon, 20 Jul 2015 19:38:32 +0200
+Subject: [PATCH] kex: support VERSION_NODATE and VERSION_DATE for reproducible
+ builds
+
+support added e03d1279f49709e0d320478fa1ff7c27161c30ed
+
+Related: #60
+(cherry picked from commit 8f1fbd7b17440b1b7d87cbee5793ae9b1adebf90)
+---
+ modules/kex/mi_core.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/modules/kex/mi_core.c b/modules/kex/mi_core.c
+index 9174809..9a1dcc8 100644
+--- a/modules/kex/mi_core.c
++++ b/modules/kex/mi_core.c
+@@ -51,7 +51,15 @@
+ #include "../../cfg/cfg.h"
+ #include "../../cfg/cfg_ctx.h"
+ 
++#ifdef VERSION_NODATE
++#define BUILD_STR __FILE__ " compiled with " COMPILER "\n"
++#else
++#ifdef VERSION_DATE
++#define BUILD_STR __FILE__ " compiled on " VERSION_DATE " with " COMPILER "\n"
++#else
+ #define BUILD_STR __FILE__ " compiled on "__TIME__ " " __DATE__ " with " COMPILER "\n"
++#endif
++#endif
+ #define BUILD_STR_LEN (sizeof(BUILD_STR)-1)
+ 
+ #ifndef SVNREVISION
+-- 
+2.5.0
+
diff --git a/debian/patches/fix-mips.patch b/debian/patches/upstream/0011-core-fix-mips-compilation.patch
similarity index 63%
rename from debian/patches/fix-mips.patch
rename to debian/patches/upstream/0011-core-fix-mips-compilation.patch
index 91bca43..3182913 100644
--- a/debian/patches/fix-mips.patch
+++ b/debian/patches/upstream/0011-core-fix-mips-compilation.patch
@@ -1,19 +1,22 @@
-Date: Thu, 30 Oct 2014 12:46:42 +0000
-From: Dejan Latinovic <Dejan.Latinovic at imgtec.com>
-Subject: fix for kamailio
+From 5a0b8a4550df2de15e40b5d7e664322815a48aea Mon Sep 17 00:00:00 2001
+From: Victor Seva <linuxmaniac at torreviejawireless.org>
+Date: Mon, 20 Jul 2015 20:36:28 +0200
+Subject: [PATCH] core: fix mips compilation
 
-https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=767500
+Patch from
+http://anonscm.debian.org/cgit/pkg-voip/kamailio.git/tree/debian/patches/fix-mips.patch
+by Dejan Latinovic <Dejan.Latinovic at imgtec.com>
 
-package kamailio FTBFS on mipsel with an error:
-> gcc: error: unrecognized command line option '-minline-all-stringops'
-
-https://buildd.debian.org/status/fetch.php?pkg=kamailio&arch=mipsel&ver=4.2.0-1&stamp=1414487406
-
-The patch below fixes this issue.
+(cherry picked from commit ed894111f6f15170f87336bfa73ec4e8fce1c7d1)
+---
+ Makefile.defs | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
 
+diff --git a/Makefile.defs b/Makefile.defs
+index 3e7f726..6d6a04f 100644
 --- a/Makefile.defs
 +++ b/Makefile.defs
-@@ -1309,12 +1309,13 @@
+@@ -1319,12 +1319,13 @@ ifeq		($(CC_NAME), gcc)
  				CFLAGS= -mips2 $(CC_OPT) -funroll-loops $(PROFILE)
  			#if gcc 5.0+, 4.5+ or 4.2+
  ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER))))
@@ -30,7 +33,7 @@ The patch below fixes this issue.
  else
  			#if gcc 3.4+
  ifeq			($(CC_SHORTVER), 3.4)
-@@ -1354,12 +1355,14 @@
+@@ -1364,12 +1365,14 @@ ifeq		($(CC_NAME), gcc)
  				CFLAGS= -mips64 $(CC_OPT) -funroll-loops $(PROFILE)
  			#if gcc 5.0+, 4.5+ or 4.2+
  ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER))))
@@ -48,3 +51,6 @@ The patch below fixes this issue.
  else
  			#if gcc 3.4+
  ifeq			($(CC_SHORTVER), 3.4)
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0012-kamcmd-use-NAME-to-build-help-message.patch b/debian/patches/upstream/0012-kamcmd-use-NAME-to-build-help-message.patch
new file mode 100644
index 0000000..f8b0c47
--- /dev/null
+++ b/debian/patches/upstream/0012-kamcmd-use-NAME-to-build-help-message.patch
@@ -0,0 +1,26 @@
+From ff1d3f06840928aace36780ecbc898cd2e90ce0a Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Mon, 27 Jul 2015 12:01:03 +0200
+Subject: [PATCH] kamcmd: use NAME to build help message
+
+(cherry picked from commit 7038d12dbb9c8db1b46c0874bfd8fce72d6e72ed)
+---
+ utils/kamcmd/kamcmd.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/kamcmd/kamcmd.c b/utils/kamcmd/kamcmd.c
+index 86d8fc4..974127c 100644
+--- a/utils/kamcmd/kamcmd.c
++++ b/utils/kamcmd/kamcmd.c
+@@ -111,7 +111,7 @@ arg:\n\
+      string or number; to force a number to be interpreted as string \n\
+      prefix it by \"s:\", e.g. s:1\n\
+ Examples:\n\
+-        " NAME " -s unixs:/tmp/ser_unix system.listMethods\n\
++        " NAME " -s unixs:/tmp/" NAME "_ctl system.listMethods\n\
+         " NAME " -f \"pid: %v  desc: %v\\n\" -s udp:localhost:2047 core.ps \n\
+         " NAME " ps  # uses default ctl socket \n\
+         " NAME "     # enters interactive mode on the default socket \n\
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0013-rr-fix-detecting-next-strict-router.patch b/debian/patches/upstream/0013-rr-fix-detecting-next-strict-router.patch
new file mode 100644
index 0000000..531398d
--- /dev/null
+++ b/debian/patches/upstream/0013-rr-fix-detecting-next-strict-router.patch
@@ -0,0 +1,73 @@
+From cb4f55b26f51a929b2db08373c1b97a95b8ad6a6 Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Mon, 27 Jul 2015 18:57:53 +0200
+Subject: [PATCH] rr: fix detecting next strict router
+
+- a regression after adding support for sip-outbound
+- more verbose debug messages
+- reported by Antonio Real, GH #267
+
+(cherry picked from commit 0c42a848258d475f57ea25458bc75e55dcee948d)
+---
+ modules/rr/loose.c | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/modules/rr/loose.c b/modules/rr/loose.c
+index de06bb3..76204c9 100644
+--- a/modules/rr/loose.c
++++ b/modules/rr/loose.c
+@@ -757,7 +757,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
+ 	int status = RR_DRIVEN;
+ 	str uri;
+ 	struct socket_info *si;
+-	int uri_is_myself, next_is_strict;
++	int uri_is_myself;
+ 	int use_ob = 0;
+ 
+ 	hdr = _m->route;
+@@ -768,11 +768,11 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
+ 	routed_msg_id = 0;
+ 
+ 	if (parse_uri(uri.s, uri.len, &puri) < 0) {
+-		LM_ERR("failed to parse the first route URI\n");
++		LM_ERR("failed to parse the first route URI (%.*s)\n",
++				uri.len, ZSW(uri.s));
+ 		return RR_ERROR;
+ 	}
+ 
+-	next_is_strict = is_strict(&puri.params);
+ 	routed_params = puri.params;
+ 	uri_is_myself = is_myself(&puri);
+ 
+@@ -815,7 +815,8 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
+ 			/* double route may occure due different IP and port, so force as
+ 			 * send interface the one advertise in second Route */
+ 			if (parse_uri(rt->nameaddr.uri.s,rt->nameaddr.uri.len,&puri)<0) {
+-				LM_ERR("failed to parse the double route URI\n");
++				LM_ERR("failed to parse the double route URI (%.*s)\n",
++						rt->nameaddr.uri.len, ZSW(rt->nameaddr.uri.s));
+ 				return RR_ERROR;
+ 			}
+ 
+@@ -852,7 +853,8 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
+ 		
+ 		uri = rt->nameaddr.uri;
+ 		if (parse_uri(uri.s, uri.len, &puri) < 0) {
+-			LM_ERR("failed to parse the first route URI\n");
++			LM_ERR("failed to parse the next route URI (%.*s)\n",
++					uri.len, ZSW(uri.s));
+ 			return RR_ERROR;
+ 		}
+ 	} else {
+@@ -867,7 +869,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
+ 	}
+ 
+ 	LM_DBG("URI to be processed: '%.*s'\n", uri.len, ZSW(uri.s));
+-	if (next_is_strict) {
++	if (is_strict(&puri.params)) {
+ 		LM_DBG("Next URI is a strict router\n");
+ 		if (handle_sr(_m, hdr, rt) < 0) {
+ 			LM_ERR("failed to handle strict router\n");
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0014-permissions-safety-check-if-hash-tables-exist-for-rp.patch b/debian/patches/upstream/0014-permissions-safety-check-if-hash-tables-exist-for-rp.patch
new file mode 100644
index 0000000..d3443fc
--- /dev/null
+++ b/debian/patches/upstream/0014-permissions-safety-check-if-hash-tables-exist-for-rp.patch
@@ -0,0 +1,62 @@
+From 5db29ed56f2a682861e34a455ae76e0d43b4ff4c Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Tue, 28 Jul 2015 09:47:48 +0200
+Subject: [PATCH] permissions: safety check if hash tables exist for rpc dump
+ commands
+
+- reported by Olle E. Johansson, GH#248
+
+(cherry picked from commit 56e41533cae52cf5f782064ed23393d2d18aff08)
+---
+ modules/permissions/mi.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/modules/permissions/mi.c b/modules/permissions/mi.c
+index 35f2cca..844a86e 100644
+--- a/modules/permissions/mi.c
++++ b/modules/permissions/mi.c
+@@ -92,7 +92,7 @@ struct mi_root* mi_trusted_dump(struct mi_root *cmd_tree, void *param)
+ void rpc_trusted_dump(rpc_t* rpc, void* c) {
+ 
+ 	if (hash_table==NULL) {
+-		rpc->fault(c, 500, "Reload failed. No trusted table");
++		rpc->fault(c, 500, "No trusted table");
+ 		return;
+ 	}
+ 
+@@ -154,6 +154,10 @@ struct mi_root* mi_address_dump(struct mi_root *cmd_tree, void *param)
+  */
+ void rpc_address_dump(rpc_t* rpc, void* c) {
+ 
++	if(addr_hash_table==NULL) {
++		rpc->fault(c, 500, "No address table");
++		return;
++	}
+ 	if(addr_hash_table_rpc_print(*addr_hash_table, rpc, c) < 0 ) {
+ 		LM_DBG("failed to print a subnet_table dump\n");
+ 	}
+@@ -185,6 +189,10 @@ struct mi_root* mi_subnet_dump(struct mi_root *cmd_tree, void *param)
+  * RPC function to dump subnet table
+  */
+ void rpc_subnet_dump(rpc_t* rpc, void* c) {
++	if(subnet_table==NULL) {
++		rpc->fault(c, 500, "No subnet table");
++		return;
++	}
+ 	if(subnet_table_rpc_print(*subnet_table, rpc, c) < 0) {
+ 		LM_DBG("failed to print a subnet_table dump\n");
+ 	}
+@@ -217,6 +225,10 @@ struct mi_root* mi_domain_name_dump(struct mi_root *cmd_tree, void *param)
+  */
+ void rpc_domain_name_dump(rpc_t* rpc, void* c) {
+ 
++	if(domain_list_table==NULL) {
++		rpc->fault(c, 500, "No domain list table");
++		return;
++	}
+ 	if ( domain_name_table_rpc_print(*domain_list_table, rpc, c) < 0 ) {
+ 		LM_DBG("failed to print a subnet_table dump\n");
+ 	}
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0015-permissions-check-if-hash-tables-exist-for-address-c.patch b/debian/patches/upstream/0015-permissions-check-if-hash-tables-exist-for-address-c.patch
new file mode 100644
index 0000000..ea6379c
--- /dev/null
+++ b/debian/patches/upstream/0015-permissions-check-if-hash-tables-exist-for-address-c.patch
@@ -0,0 +1,156 @@
+From 64028d658a788b74f6f9c71f2e2aa3b0b5a1c803 Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Tue, 28 Jul 2015 10:02:03 +0200
+Subject: [PATCH] permissions: check if hash tables exist for address config
+ functions
+
+- reported by Olle E. Johansson, GH#248
+
+(cherry picked from commit 6fcd35ba5bb71df680b89c2bafceccde0439b6f1)
+---
+ modules/permissions/address.c | 83 ++++++++++++++++++++++++++-----------------
+ 1 file changed, 51 insertions(+), 32 deletions(-)
+
+diff --git a/modules/permissions/address.c b/modules/permissions/address.c
+index 7ad0fb5..e037dda 100644
+--- a/modules/permissions/address.c
++++ b/modules/permissions/address.c
+@@ -480,13 +480,21 @@ int allow_address(struct sip_msg* _msg, char* _addr_group, char* _addr_sp,
+ 	}
+ 
+ 	if ( ipa ) {
+-		if (match_addr_hash_table(*addr_hash_table, addr_group, ipa, port) == 1)
++		if (addr_hash_table
++				&& match_addr_hash_table(*addr_hash_table, addr_group,
++					ipa, port) == 1) {
+ 			return 1;
+-		else
+-			return match_subnet_table(*subnet_table, addr_group, ipa, port);
++		} else {
++			if(subnet_table) {
++				return match_subnet_table(*subnet_table, addr_group, ipa, port);
++			}
++		}
+ 	} else {
+-		return match_domain_name_table(*domain_list_table, addr_group, &ips, port);
++		if(domain_list_table) {
++			return match_domain_name_table(*domain_list_table, addr_group, &ips, port);
++		}
+ 	}
++	return -1;
+ }
+ 
+ 
+@@ -507,14 +515,17 @@ int allow_source_address(struct sip_msg* _msg, char* _addr_group, char* _str2)
+ 	LM_DBG("looking for <%u, %x, %u>\n",
+ 			addr_group, _msg->rcv.src_ip.u.addr32[0], _msg->rcv.src_port);
+ 
+-	if (match_addr_hash_table(*addr_hash_table, addr_group,
+-				&_msg->rcv.src_ip,
+-				_msg->rcv.src_port) == 1)
++	if (addr_hash_table && match_addr_hash_table(*addr_hash_table, addr_group,
++				&_msg->rcv.src_ip, _msg->rcv.src_port) == 1) {
+ 		return 1;
+-	else
+-		return match_subnet_table(*subnet_table, addr_group,
++	} else {
++		if(subnet_table) {
++			return match_subnet_table(*subnet_table, addr_group,
+ 				&_msg->rcv.src_ip,
+ 				_msg->rcv.src_port);
++		}
++	}
++	return -1;
+ }
+ 
+ 
+@@ -525,22 +536,24 @@ int allow_source_address(struct sip_msg* _msg, char* _addr_group, char* _str2)
+  */
+ int allow_source_address_group(struct sip_msg* _msg, char* _str1, char* _str2) 
+ {
+-	int group;
++	int group = -1;
+ 
+ 	LM_DBG("looking for <%x, %u> in address table\n",
+ 			_msg->rcv.src_ip.u.addr32[0], _msg->rcv.src_port);
+-	group = find_group_in_addr_hash_table(*addr_hash_table,
+-			&_msg->rcv.src_ip,
+-			_msg->rcv.src_port);
+-	LM_DBG("Found <%d>\n", group);
++	if(addr_hash_table) {
++		group = find_group_in_addr_hash_table(*addr_hash_table,
++					&_msg->rcv.src_ip, _msg->rcv.src_port);
++		LM_DBG("Found <%d>\n", group);
+ 
+-	if (group != -1) return group;
++		if (group != -1) return group;
++	}
+ 
+ 	LM_DBG("looking for <%x, %u> in subnet table\n",
+ 			_msg->rcv.src_ip.u.addr32[0], _msg->rcv.src_port);
+-	group = find_group_in_subnet_table(*subnet_table,
+-			&_msg->rcv.src_ip,
+-			_msg->rcv.src_port);
++	if(subnet_table) {
++		group = find_group_in_subnet_table(*subnet_table,
++				&_msg->rcv.src_ip, _msg->rcv.src_port);
++	}
+ 	LM_DBG("Found <%d>\n", group);
+ 	return group;
+ 
+@@ -553,7 +566,7 @@ int allow_source_address_group(struct sip_msg* _msg, char* _str1, char* _str2)
+  */
+ int allow_address_group(struct sip_msg* _msg, char* _addr, char* _port)
+ {
+-	int group;
++	int group = -1;
+ 
+ 	unsigned int port;
+ 	str ips;
+@@ -575,24 +588,30 @@ int allow_address_group(struct sip_msg* _msg, char* _addr, char* _port)
+ 	if ( ipa ) {
+ 		LM_DBG("looking for <%.*s, %u> in address table\n",
+ 				ips.len, ips.s, port);
+-		group = find_group_in_addr_hash_table(*addr_hash_table,
+-				ipa, port);
+-		LM_DBG("Found address in group <%d>\n", group);
+-
+-		if (group != -1) return group;
++		if(addr_hash_table) {
++			group = find_group_in_addr_hash_table(*addr_hash_table,
++						ipa, port);
++			LM_DBG("Found address in group <%d>\n", group);
+ 
+-		LM_DBG("looking for <%.*s, %u> in subnet table\n",
+-				ips.len, ips.s, port);
+-		group = find_group_in_subnet_table(*subnet_table,
+-				ipa, port);
+-		LM_DBG("Found a match of subnet in group <%d>\n", group);
++			if (group != -1) return group;
++		}
++		if(subnet_table) {
++			LM_DBG("looking for <%.*s, %u> in subnet table\n",
++					ips.len, ips.s, port);
++			group = find_group_in_subnet_table(*subnet_table,
++						ipa, port);
++			LM_DBG("Found a match of subnet in group <%d>\n", group);
++		}
+ 	} else {
+ 		LM_DBG("looking for <%.*s, %u> in domain_name table\n",
+ 				ips.len, ips.s, port);
+-		group = find_group_in_domain_name_table(*domain_list_table,
+-				&ips, port);
+-		LM_DBG("Found a match of domain_name in group <%d>\n", group);
++		if(domain_list_table) {
++			group = find_group_in_domain_name_table(*domain_list_table,
++						&ips, port);
++			LM_DBG("Found a match of domain_name in group <%d>\n", group);
++		}
+ 	}
+ 
++	LM_DBG("Found <%d>\n", group);
+ 	return group;
+ }
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0016-tm-added-note-in-docs-for-t_set_no_e2e_cancel_reason.patch b/debian/patches/upstream/0016-tm-added-note-in-docs-for-t_set_no_e2e_cancel_reason.patch
new file mode 100644
index 0000000..65a0e19
--- /dev/null
+++ b/debian/patches/upstream/0016-tm-added-note-in-docs-for-t_set_no_e2e_cancel_reason.patch
@@ -0,0 +1,30 @@
+From 4c7e676cdec3213c27cc689bdb5e6bbb8a9ec1ea Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Tue, 28 Jul 2015 10:23:28 +0200
+Subject: [PATCH] tm: added note in docs for t_set_no_e2e_cancel_reason()
+
+- it has to be used when processing the INVITE
+
+(cherry picked from commit e5f472ca5d8d2e16adb8b5a5a316521a618c8d9f)
+---
+ modules/tm/doc/functions.xml | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/modules/tm/doc/functions.xml b/modules/tm/doc/functions.xml
+index 5146d40..217a5a2 100644
+--- a/modules/tm/doc/functions.xml
++++ b/modules/tm/doc/functions.xml
+@@ -1665,6 +1665,10 @@ t_relay_to("0x01");
+ 		 parameter) for the current transaction.
+ 	</para>
+ 	<para>
++		Note: the function has to be used when processing the INVITE
++		(not when processing the CANCEL).
++	</para>
++	<para>
+ 		See also: <varname>e2e_cancel_reason</varname>.
+ 	</para>
+ 	<example>
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0017-pipelimit-regenerated-the-readme.patch b/debian/patches/upstream/0017-pipelimit-regenerated-the-readme.patch
new file mode 100644
index 0000000..5d52820
--- /dev/null
+++ b/debian/patches/upstream/0017-pipelimit-regenerated-the-readme.patch
@@ -0,0 +1,158 @@
+From 40a66072179da324859864af8caee654e5c143e5 Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Wed, 29 Jul 2015 12:15:59 +0200
+Subject: [PATCH] pipelimit: regenerated the readme
+
+---
+ modules/pipelimit/README | 77 +++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 70 insertions(+), 7 deletions(-)
+
+diff --git a/modules/pipelimit/README b/modules/pipelimit/README
+index 52d844c..797fedd 100644
+--- a/modules/pipelimit/README
++++ b/modules/pipelimit/README
+@@ -24,6 +24,9 @@ Daniel-Constantin Mierla
+    1. Admin Guide
+ 
+         1. Overview
++
++              1.1. Algorithms
++
+         2. Dependencies
+ 
+               2.1. Kamailio Modules
+@@ -77,7 +80,7 @@ Daniel-Constantin Mierla
+    1.9. Set reply_code parameter at runtime
+    1.10. Set reply_reason parameter
+    1.11. Set reply_reason parameter at runtime
+-   1.12. rl_check usage
++   1.12. pl_check usage
+    1.13. pl_drop usage
+ 
+ Chapter 1. Admin Guide
+@@ -85,6 +88,9 @@ Chapter 1. Admin Guide
+    Table of Contents
+ 
+    1. Overview
++
++        1.1. Algorithms
++
+    2. Dependencies
+ 
+         2.1. Kamailio Modules
+@@ -127,6 +133,8 @@ Chapter 1. Admin Guide
+ 
+ 1. Overview
+ 
++   1.1. Algorithms
++
+    This module implements traffic limiting for SIP requests.
+ 
+    The module defines in an abstract mode the notion of 'pipe', which can
+@@ -138,8 +146,54 @@ Chapter 1. Admin Guide
+    Pipelimit started from ratelimit module, adding support for definition
+    of pipes limits in database and dynamic names. Complexity of keeping
+    everything in a module and make it dual mode functional resulted in a
+-   new module which is focused on just traffic shaping policies. For
+-   description of the algorithms see the README of ratelimit.
++   new module which is focused on just traffic shaping policies.
++
++1.1. Algorithms
++
++   Algorithms are based from the ratelimit module, which describes the
++   algorithms in more detail. The algorithms are used by the pipelimit
++   module to determine if a message should be blocked.
++
++   Tail Drop Algorithm (TAILDROP)
++
++   This is a trivial algorithm that imposes some risks when used in
++   conjunction with long timer intervals. At the start of each interval an
++   internal counter is reset and incremented for each incoming message.
++   Once the counter hits the configured limit pl_check returns an error.
++
++   Random Early Detection Algorithm (RED)
++
++   The Random Early Detection Algorithm tries to circumvent the
++   synchronization problem imposed by the tail drop algorithm by measuring
++   the average load and adapting the drop rate dynamically. When running
++   with the RED algorithm (enabled by default) Kamailio will return errors
++   to the Kamailio routing engine every n'th packet trying to evenly
++   spread the measured load of the last timer interval onto the current
++   interval. As a negative side effect Kamailio might drop messages
++   although the limit might not be reached within the interval. Decrease
++   the timer interval if you encounter this.
++
++   Network Algorithm (NETWORK)
++
++   This algorithm relies on information provided by network interfaces.
++   The total amount of bytes waiting to be consumed on all the network
++   interfaces is retrieved once every timer_interval seconds. If the
++   returned amount exceeds the limit specified in the modparam, pl_check
++   returns an error.
++
++   Feedback Algorithm (FEEDBACK)
++
++   Using the PID Controller model (see Wikipedia page), the drop rate is
++   adjusted dynamically based on the load factor so that the load factor
++   always drifts towards the specified limit (or setpoint, in PID terms).
++
++   As reading the CPU load average is relatively expensive (opening
++   /proc/stat, parsing it, etc), this only happens once every
++   timer_interval seconds and consequently the FEEDBACK value is only at
++   these intervals recomputed. This in turn makes it difficult for the
++   drop rate to adjust quickly. Worst case scenarios are request rates
++   going up/down instantly by thousands - it takes up to 20 seconds for
++   the controller to adapt to the new request rate.
+ 
+ 2. Dependencies
+ 
+@@ -298,7 +352,7 @@ kamcmd cfg.set_now_string pipelimit reply_reason "Limiting"
+ 
+    If algorithm and limit are provided, the function attempts to create a
+    new pipe of one with that name doesn't exit. If it exists, no changes
+-   to algorithm and limit are done.
++   to algorithm and limit are done. Algorithm is case sensitive.
+ 
+    The pipe name can be provided via a pseudo variabile.
+ 
+@@ -311,13 +365,13 @@ kamcmd cfg.set_now_string pipelimit reply_reason "Limiting"
+    Meaning of the parameters is as follows:
+      * name - the string or pseudovariable with the pipe name.
+      * algorithm - the string or pseudovariable with the algorithm. The
+-       values can be: taildrop, red, network or feedback - see readme of
++       values can be: TAILDROP, RED, NETWORK, or FEEDBACK - see readme of
+        ratelimit module for details on each algorithm.
+      * limit - the integer or pseudovariable with the limit value.
+ 
+    This function can be used from REQUEST_ROUTE.
+ 
+-   Example 1.12. rl_check usage
++   Example 1.12. pl_check usage
+ ...
+         # perform pipe match for current method
+         if (!pl_check("one")) {
+@@ -354,11 +408,20 @@ with unexpected retcode=$var(check_result)\n");
+ ...
+         # perform pipe match for authenticated user
+         $var(limit) = 20;
+-        if (!pl_check("$au", "traildrop", "$var(limit)")) {
++        if (!pl_check("$au", "TAILDROP", "$var(limit)")) {
+                 pl_drop();
+                 exit;
+         }
+ ...
++        # perform pipe match for INVITE
++        if (is_method("INVITE")) {
++                $var(invlimit) = 10;
++                if (!pl_check("$si", "TAILDROP", "$var(invlimit)")) {
++                        pl_drop();
++                        exit;
++                }
++        }
++...
+ 
+ 4.2. pl_drop([ [min ], max ])
+ 
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0018-pv-readme-regenerated.patch b/debian/patches/upstream/0018-pv-readme-regenerated.patch
new file mode 100644
index 0000000..afb9613
--- /dev/null
+++ b/debian/patches/upstream/0018-pv-readme-regenerated.patch
@@ -0,0 +1,88 @@
+From 03faa73eff6c341b0f49989a11478ec0b92b611e Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Wed, 29 Jul 2015 12:16:23 +0200
+Subject: [PATCH] pv: readme regenerated
+
+---
+ modules/pv/README | 23 +++++++++++++++++++----
+ 1 file changed, 19 insertions(+), 4 deletions(-)
+
+diff --git a/modules/pv/README b/modules/pv/README
+index 9cab590..ae85063 100644
+--- a/modules/pv/README
++++ b/modules/pv/README
+@@ -45,6 +45,7 @@ Daniel-Constantin Mierla
+               4.7. sbranch_set_ruri()
+               4.8. sbranch_append()
+               4.9. sbranch_reset()
++              4.10. pv_xavp_print()
+ 
+         5. MI Commands
+ 
+@@ -70,8 +71,9 @@ Daniel-Constantin Mierla
+    1.10. sbranch_set_ruri() usage
+    1.11. sbranch_append() usage
+    1.12. sbranch_append() usage
+-   1.13. shv_set usage
+-   1.14. shv_get usage
++   1.13. pv_xavp_print() usage
++   1.14. shv_set usage
++   1.15. shv_get usage
+ 
+ Chapter 1. Admin Guide
+ 
+@@ -100,6 +102,7 @@ Chapter 1. Admin Guide
+         4.7. sbranch_set_ruri()
+         4.8. sbranch_append()
+         4.9. sbranch_reset()
++        4.10. pv_xavp_print()
+ 
+    5. MI Commands
+ 
+@@ -203,6 +206,7 @@ modparam("pv","avp_aliases","email=s:email_addr;tmp=i:100")
+    4.7. sbranch_set_ruri()
+    4.8. sbranch_append()
+    4.9. sbranch_reset()
++   4.10. pv_xavp_print()
+ 
+ 4.1. pv_isset(pvar)
+ 
+@@ -352,6 +356,17 @@ sbranch_append();
+ sbranch_reset();
+ ...
+ 
++4.10. pv_xavp_print()
++
++   Print all XAVPs to the syslog using INFO log level.
++
++   Function can be used from ANY_ROUTE.
++
++   Example 1.13. pv_xavp_print() usage
++...
++pv_xavp_print();
++...
++
+ 5. MI Commands
+ 
+    5.1. shv_set
+@@ -375,7 +390,7 @@ sbranch_reset();
+                 _value_
+                 _empty_line_
+ 
+-   Example 1.13. shv_set usage
++   Example 1.14. shv_set usage
+ ...
+ $ kamctl fifo shv_set debug int 0
+ ...
+@@ -393,7 +408,7 @@ $ kamctl fifo shv_set debug int 0
+                 _name_
+                 _empty_line_
+ 
+-   Example 1.14. shv_get usage
++   Example 1.15. shv_get usage
+ ...
+ $ kamctl fifo shv_get debug
+ $ kamctl fifo shv_get
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0019-tm-readme-regenerated.patch b/debian/patches/upstream/0019-tm-readme-regenerated.patch
new file mode 100644
index 0000000..9e40765
--- /dev/null
+++ b/debian/patches/upstream/0019-tm-readme-regenerated.patch
@@ -0,0 +1,519 @@
+From 4717b5bdf9701bbe39a315cfe9ea6cf57a2f4ebd Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Wed, 29 Jul 2015 12:16:40 +0200
+Subject: [PATCH] tm: readme regenerated
+
+---
+ modules/tm/README | 119 ++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 61 insertions(+), 58 deletions(-)
+
+diff --git a/modules/tm/README b/modules/tm/README
+index 3e1ebec..429ea5a 100644
+--- a/modules/tm/README
++++ b/modules/tm/README
+@@ -1634,7 +1634,7 @@ modparam("tm|usrloc", "xavp_contact", "ulattrs")
+    5.50. t_use_uac_headers()
+    5.51. t_is_retr_async_reply()
+ 
+-5.1.  t_relay([host, port])
++5.1. t_relay([host, port])
+ 
+    Relay a message statefully either to the destination indicated in the
+    current URI (if called without any parameters) or to the specified host
+@@ -1662,7 +1662,7 @@ if (!t_relay())
+ };
+ ...
+ 
+-5.2.  t_relay_to_udp([ip, port])
++5.2. t_relay_to_udp([ip, port])
+ 
+    Relay a message statefully using a fixed protocol either to the
+    specified fixed destination or to a destination derived from the
+@@ -1688,19 +1688,19 @@ else
+         t_relay_to_tcp(); # relay to msg. uri, but over tcp
+ ...
+ 
+-5.3.  t_relay_to_tcp([ip, port])
++5.3. t_relay_to_tcp([ip, port])
+ 
+    See function t_relay_to_udp([ip, port]).
+ 
+-5.4.  t_relay_to_tls([ip, port])
++5.4. t_relay_to_tls([ip, port])
+ 
+    See function t_relay_to_udp([ip, port]).
+ 
+-5.5.  t_relay_to_sctp([ip, port])
++5.5. t_relay_to_sctp([ip, port])
+ 
+    See function t_relay_to_udp([ip, port]).
+ 
+-5.6.  t_on_failure(failure_route)
++5.6. t_on_failure(failure_route)
+ 
+    Sets failure routing block, to which control is passed after a
+    transaction completed with a negative result but before sending a final
+@@ -1737,14 +1737,14 @@ failure_route[1] {
+    See test/onr.cfg for a more complex example of combination of serial
+    with parallel forking.
+ 
+-5.7.  t_on_branch_failure(branch_failure_route)
++5.7. t_on_branch_failure(branch_failure_route)
+ 
+    Sets the branch_failure routing block, to which control is passed on
+    each negative response to a transaction. This route is run before
+    deciding if the transaction is complete. In the referred block, you can
+    start a new branch which is required for failover of multiple outbound
+    flows (RFC 5626). Note that the set of commands which are usable within
+-   a branch_failure route is limited to a subset of the failure_route
++   a branch_failure route is limited to a subset of the failure_rotue
+    commands including logging, rewriting URI and initiating new branches.
+    Any other commands may generate errors or result in unpredictable
+    behavior. Note that whenever failure_route is entered, uri is reset to
+@@ -1770,7 +1770,7 @@ event_route[tm:branch-failure:myroute] {
+ }
+ ...
+ 
+-5.8.  t_on_reply(onreply_route)
++5.8. t_on_reply(onreply_route)
+ 
+    Sets the reply routing block, to which control is passed when a reply
+    for the current transaction is received. Note that the set of commands
+@@ -1800,7 +1800,7 @@ es');
+         }
+ }
+ 
+-5.9.  t_on_branch(branch_route)
++5.9. t_on_branch(branch_route)
+ 
+    Sets the branch routing block, to which control is passed after forking
+    (when a new branch is created). For now branch routes are intended only
+@@ -1824,7 +1824,7 @@ branch_route[1] {
+         }
+ }
+ 
+-5.10.  t_newtran()
++5.10. t_newtran()
+ 
+    Creates a new transaction, returns a negative value on error. This is
+    the only way a script can add a new transaction in an atomic way.
+@@ -1840,7 +1840,7 @@ if (t_newtran()) {
+ 
+    See test/uas.cfg for more examples.
+ 
+-5.11.  t_reply(code, reason_phrase)
++5.11. t_reply(code, reason_phrase)
+ 
+    Sends a stateful reply after a transaction has been established. See
+    t_newtran for usage.
+@@ -1865,7 +1865,7 @@ if (t_newtran()) {
+ t_reply("404", "Not found");
+ ...
+ 
+-5.12.  t_lookup_request()
++5.12. t_lookup_request()
+ 
+    Checks if a transaction exists. Returns a positive value if so,
+    negative otherwise. Most likely you will not want to use it, as a
+@@ -1880,7 +1880,7 @@ if (t_lookup_request()) {
+ };
+ ...
+ 
+-5.13.  t_retransmit_reply()
++5.13. t_retransmit_reply()
+ 
+    Retransmits a reply sent previously by UAS transaction.
+ 
+@@ -1889,7 +1889,7 @@ if (t_lookup_request()) {
+ t_retransmit_reply();
+ ...
+ 
+-5.14.  t_release()
++5.14. t_release()
+ 
+    Remove transaction from memory (it will be first put on a wait timer to
+    absorb delayed messages).
+@@ -1899,7 +1899,7 @@ t_retransmit_reply();
+ t_release();
+ ...
+ 
+-5.15.  t_forward_nonack([ip, port])
++5.15. t_forward_nonack([ip, port])
+ 
+    Mainly for internal usage -- forward a non-ACK request statefully.
+    Variants of this functions can enforce a specific transport protocol.
+@@ -1913,23 +1913,23 @@ t_release();
+ t_forward_nonack("1.2.3.4", "5060");
+ ...
+ 
+-5.16.  t_forward_nonack_udp(ip, port)
++5.16. t_forward_nonack_udp(ip, port)
+ 
+    See function t_forward_nonack([ip, port]).
+ 
+-5.17.  t_forward_nonack_tcp(ip, port)
++5.17. t_forward_nonack_tcp(ip, port)
+ 
+    See function t_forward_nonack([ip, port]).
+ 
+-5.18.  t_forward_nonack_tls(ip, port)
++5.18. t_forward_nonack_tls(ip, port)
+ 
+    See function t_forward_nonack([ip, port]).
+ 
+-5.19.  t_forward_nonack_sctp(ip, port)
++5.19. t_forward_nonack_sctp(ip, port)
+ 
+    See function t_forward_nonack([ip, port]).
+ 
+-5.20.  t_set_fr(fr_inv_timeout [, fr_timeout])
++5.20. t_set_fr(fr_inv_timeout [, fr_timeout])
+ 
+    Sets the fr_inv_timeout and optionally fr_timeout for the current
+    transaction or for transactions created during the same script
+@@ -1963,7 +1963,7 @@ branch_route[1] {
+         }
+ }
+ 
+-5.21.  t_reset_fr()
++5.21. t_reset_fr()
+ 
+    Resets the fr_inv_timer and fr_timer for the current transaction to the
+    default values (set using the tm module parameters fr_inv_timer and
+@@ -1982,7 +1982,7 @@ route {
+ ...
+ }
+ 
+-5.22.  t_set_max_lifetime(inv_lifetime, noninv_lifetime)
++5.22. t_set_max_lifetime(inv_lifetime, noninv_lifetime)
+ 
+    Sets the maximum lifetime for the current INVITE or non-INVITE
+    transaction, or for transactions created during the same script
+@@ -2011,7 +2011,7 @@ route {
+                                           # INVITE and to 15s if not
+ }
+ 
+-5.23.  t_reset_max_lifetime()
++5.23. t_reset_max_lifetime()
+ 
+    Resets the the maximum lifetime for the current INVITE or non-INVITE
+    transaction to the default value (set using the tm module parameter
+@@ -2030,7 +2030,7 @@ route {
+ ...
+ }
+ 
+-5.24.  t_set_retr(retr_t1_interval, retr_t2_interval)
++5.24. t_set_retr(retr_t1_interval, retr_t2_interval)
+ 
+    Sets the retr_t1_interval and retr_t2_interval for the current
+    transaction or for transactions created during the same script
+@@ -2076,7 +2076,7 @@ branch_route[1] {
+         }
+ }
+ 
+-5.25.  t_reset_retr()
++5.25. t_reset_retr()
+ 
+    Resets the retr_timer1 and retr_timer2 for the current transaction to
+    the default values (set using the tm module parameters retr_timer1 and
+@@ -2095,7 +2095,7 @@ route {
+ ...
+ }
+ 
+-5.26.  t_set_auto_inv_100(0|1)
++5.26. t_set_auto_inv_100(0|1)
+ 
+    Switch automatically sending 100 replies to INVITEs on/off on a per
+    transaction basis. It overrides the auto_inv_100 value for the current
+@@ -2112,7 +2112,7 @@ route {
+ ...
+ }
+ 
+-5.27.  t_branch_timeout()
++5.27. t_branch_timeout()
+ 
+    Returns true if the failure route is executed for a branch that did
+    timeout. It can be used from failure_route and branch-failure event
+@@ -2127,7 +2127,7 @@ failure_route[0]{
+         }
+ }
+ 
+-5.28.  t_branch_replied()
++5.28. t_branch_replied()
+ 
+    Returns true if the failure route is executed for a branch that did
+    receive at least one reply in the past (the "current" reply is not
+@@ -2146,7 +2146,7 @@ failure_route[0]{
+         }
+ }
+ 
+-5.29.  t_any_timeout()
++5.29. t_any_timeout()
+ 
+    Returns true if at least one of the current transactions branches did
+    timeout.
+@@ -2162,7 +2162,7 @@ failure_route[0]{
+         }
+ }
+ 
+-5.30.  t_any_replied()
++5.30. t_any_replied()
+ 
+    Returns true if at least one of the current transactions branches did
+    receive some reply in the past. If called from a failure or onreply
+@@ -2177,7 +2177,7 @@ onreply_route[0]{
+         }
+ }
+ 
+-5.31.  t_grep_status("code")
++5.31. t_grep_status("code")
+ 
+    Returns true if "code" is the final reply received (or locally
+    generated) in at least one of the current transactions branches.
+@@ -2191,7 +2191,7 @@ onreply_route[0]{
+         }
+ }
+ 
+-5.32.  t_is_canceled()
++5.32. t_is_canceled()
+ 
+    Returns true if the current transaction was canceled.
+ 
+@@ -2204,7 +2204,7 @@ failure_route[0]{
+         }
+ }
+ 
+-5.33.  t_is_expired()
++5.33. t_is_expired()
+ 
+    Returns true if the current transaction has already been expired, i.e.
+    the max_inv_lifetime/max_noninv_lifetime interval has already elapsed.
+@@ -2218,7 +2218,7 @@ failure_route[0]{
+         }
+ }
+ 
+-5.34.  t_relay_cancel()
++5.34. t_relay_cancel()
+ 
+    Forwards the CANCEL if the corresponding INVITE transaction exists. The
+    function is supposed to be used at the very beginning of the script,
+@@ -2243,7 +2243,7 @@ if (method == CANCEL) {
+         # do the same as for INVITEs
+ }
+ 
+-5.35.  t_lookup_cancel([1])
++5.35. t_lookup_cancel([1])
+ 
+    Returns true if the corresponding INVITE transaction exists for a
+    CANCEL request. The function can be called at the beginning of the
+@@ -2275,7 +2275,7 @@ if (method == CANCEL) {
+         # do the same as for INVITEs
+ }
+ 
+-5.36.  t_drop_replies([mode])
++5.36. t_drop_replies([mode])
+ 
+    Drops all the previously received replies in failure_route block to
+    make sure that none of them is picked up again.
+@@ -2303,7 +2303,7 @@ failure_route[0]{
+         }
+ }
+ 
+-5.37.  t_save_lumps()
++5.37. t_save_lumps()
+ 
+    Forces the modifications of the processed SIP message to be saved in
+    shared memory before t_relay() is called. The new branches which are
+@@ -2343,7 +2343,7 @@ failure_route[1] {
+         t_relay();
+ }
+ 
+-5.38.  t_load_contacts()
++5.38. t_load_contacts()
+ 
+    This is the first of the three functions that can be used to implement
+    serial/parallel forking based on q and +sip.instance values of
+@@ -2385,7 +2385,7 @@ if (!t_load_contacts()) {
+ };
+ ...
+ 
+-5.39.  t_next_contacts()
++5.39. t_next_contacts()
+ 
+    Function t_next_contacts() is the second of the three functions that
+    can be used to implement serial/parallel forking based on the q value
+@@ -2437,7 +2437,7 @@ if (!t_next_contacts()) {
+ };
+ ...
+ 
+-5.40.  t_next_contact_flow()
++5.40. t_next_contact_flow()
+ 
+    Function t_next_contact_flow() is the last of the three functions that
+    can be used to implement serial/parallel forking based on the q value
+@@ -2467,7 +2467,7 @@ event_route[tm:branch-failure:outbound]
+         }
+ ...
+ 
+-5.41.  t_check_status(re)
++5.41. t_check_status(re)
+ 
+    Returns true if the regular expresion "re" match the reply code of the
+    response message as follows:
+@@ -2485,7 +2485,7 @@ if (t_check_status("(487)|(408)")) {
+ }
+ ...
+ 
+-5.42.  t_check_trans()
++5.42. t_check_trans()
+ 
+    t_check_trans() can be used to quickly check if a message belongs or is
+    related to a transaction. It behaves differently for different types of
+@@ -2537,7 +2537,7 @@ if ( method == "CANCEL" && !t_check_trans())
+         sl_reply("403", "cancel out of the blue forbidden");
+ # note: in this example t_check_trans() can be replaced by t_lookup_cancel()
+ 
+-5.43.  t_set_disable_6xx(0|1)
++5.43. t_set_disable_6xx(0|1)
+ 
+    Turn off/on 6xx replies special rfc conformant handling on a per
+    transaction basis. If turned off (t_set_disable_6xx("1")) 6XXs will be
+@@ -2556,7 +2556,7 @@ route {
+ ...
+ }
+ 
+-5.44.  t_set_disable_failover(0|1)
++5.44. t_set_disable_failover(0|1)
+ 
+    Turn off/on dns failover on a per transaction basis.
+ 
+@@ -2571,7 +2571,7 @@ route {
+ ...
+ }
+ 
+-5.45.  t_set_disable_internal_reply(0|1)
++5.45. t_set_disable_internal_reply(0|1)
+ 
+    Turn off/on sending internally a SIP reply in case of relay errors.
+ 
+@@ -2583,7 +2583,7 @@ if(!t_relay()) {
+ }
+ ...
+ 
+-5.46.  t_replicate([params])
++5.46. t_replicate([params])
+ 
+    Replicate the SIP request to a specific address.
+ 
+@@ -2619,7 +2619,7 @@ t_replicate("sip:$var(h);transport=tls");
+ t_replicate_to_udp("1.2.3.4", "5060");
+ ...
+ 
+-5.47.  t_relay_to(proxy, flags)
++5.47. t_relay_to(proxy, flags)
+ 
+    Forward the SIP request to a specific address, controlling internal
+    behavior via flags.
+@@ -2652,7 +2652,7 @@ t_relay_to("tls:1.2.3.4");
+ t_relay_to("0x01");
+ ...
+ 
+-5.48.  t_set_no_e2e_cancel_reason(0|1)
++5.48. t_set_no_e2e_cancel_reason(0|1)
+ 
+    Enables/disables reason header (RFC 3326) copying from the triggering
+    received CANCEL to the generated hop-by-hop CANCEL. 0 enables and 1
+@@ -2661,6 +2661,9 @@ t_relay_to("0x01");
+    It overrides the e2e_cancel_reason setting (module parameter) for the
+    current transaction.
+ 
++   Note: the function has to be used when processing the INVITE (not when
++   processing the CANCEL).
++
+    See also: e2e_cancel_reason.
+ 
+    Example 1.87. t_set_no_e2e_cancel_reason usage
+@@ -2673,7 +2676,7 @@ opying
+ ...
+ }
+ 
+-5.49.  t_is_set(target)
++5.49. t_is_set(target)
+ 
+    Return true if the attribute specified by 'target' is set for
+    transaction.
+@@ -2692,7 +2695,7 @@ if(!t_is_set("failure_route"))
+     LM_DBG("no failure route will be executed for current transaction\n");
+ ...
+ 
+-5.50.  t_use_uac_headers()
++5.50. t_use_uac_headers()
+ 
+    Set internal flags to tell tm to use UAC side for building headers for
+    local generated requests (ACK, CANCEL) - useful when changing From/To
+@@ -2705,7 +2708,7 @@ if(!t_is_set("failure_route"))
+ t_use_uac_headers();
+ ...
+ 
+-5.51.  t_is_retr_async_reply()
++5.51. t_is_retr_async_reply()
+ 
+    Check to see if the reply is a retransmitted reply on a transaction
+    that is currently suspended asynchronously (suspended during reply
+@@ -2808,7 +2811,7 @@ end of body
+ 
+ 6.2. Functions
+ 
+-6.2.1.  register_tmcb(cb_type, cb_func)
++6.2.1. register_tmcb(cb_type, cb_func)
+ 
+    For programmatic use only--register a function to be called back on an
+    event. See t_hooks.h for more details.
+@@ -2817,7 +2820,7 @@ end of body
+      * cb_type - Callback type.
+      * cb_func - Callback function.
+ 
+-6.2.2.  load_tm(*import_structure)
++6.2.2. load_tm(*import_structure)
+ 
+    For programmatic use only--import exported TM functions. See the acc
+    module for an example of use.
+@@ -2825,7 +2828,7 @@ end of body
+    Meaning of the parameters is as follows:
+      * import_structure - Pointer to the import structure.
+ 
+-6.2.3.  int t_suspend(struct sip_msg *msg, unsigned int *hash_index, unsigned
++6.2.3. int t_suspend(struct sip_msg *msg, unsigned int *hash_index, unsigned
+ int *label)
+ 
+    For programmatic use only. This function together with t_continue() can
+@@ -2863,7 +2866,7 @@ int *label)
+    t_suspend() should return 0 to make sure that the script processing
+    does not continue.
+ 
+-6.2.4.  int t_continue(unsigned int hash_index, unsigned int label, struct
++6.2.4. int t_continue(unsigned int hash_index, unsigned int label, struct
+ action *route)
+ 
+    For programmatic use only. This function is the pair of t_suspend(),
+@@ -2879,7 +2882,7 @@ action *route)
+ 
+    Return value: 0 - success, <0 - error.
+ 
+-6.2.5.  int t_cancel_suspend(unsigned int hash_index, unsigned int label)
++6.2.5. int t_cancel_suspend(unsigned int hash_index, unsigned int label)
+ 
+    For programmatic use only. This function is for revoking t_suspend()
+    from the same process as it was executed before. t_cancel_suspend() can
+@@ -2899,7 +2902,7 @@ action *route)
+ 
+    7.1. event_route[tm:branch-failure]
+ 
+-7.1.  event_route[tm:branch-failure]
++7.1. event_route[tm:branch-failure]
+ 
+    Named branch failure routes can be defined to run when when a failure
+    response is received. This allows handling failures on individual
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0020-Revert-pua_reginfo-use-ul.get_urecord_by_ruid-instea.patch b/debian/patches/upstream/0020-Revert-pua_reginfo-use-ul.get_urecord_by_ruid-instea.patch
new file mode 100644
index 0000000..02a160d
--- /dev/null
+++ b/debian/patches/upstream/0020-Revert-pua_reginfo-use-ul.get_urecord_by_ruid-instea.patch
@@ -0,0 +1,55 @@
+From cb644d50f76c80f0f24b34e5adf8723d89aab636 Mon Sep 17 00:00:00 2001
+From: Victor Seva <linuxmaniac at torreviejawireless.org>
+Date: Thu, 6 Aug 2015 15:22:34 +0200
+Subject: [PATCH] Revert "pua_reginfo: use ul.get_urecord_by_ruid instead of
+ ul.get_urecord"
+
+This reverts commit 9a6d8d2bffe13b442ed5e880fb0dd2c6572c29e2.
+---
+ modules/pua_reginfo/usrloc_cb.c | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/modules/pua_reginfo/usrloc_cb.c b/modules/pua_reginfo/usrloc_cb.c
+index 95ec762..7f84788 100644
+--- a/modules/pua_reginfo/usrloc_cb.c
++++ b/modules/pua_reginfo/usrloc_cb.c
+@@ -224,9 +224,9 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) {
+ 	str content_type;
+ 	udomain_t * domain;
+ 	urecord_t * record;
+-	ucontact_t* _c = NULL;
+ 	int res;
+ 	str uri = {NULL, 0};
++	str user = {NULL, 0};
+ 
+ 	char* at = NULL;
+ 	char id_buf[512];
+@@ -251,6 +251,9 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) {
+ 		LM_ERR("Unknown Type %i\n", type);
+ 		return;
+ 	}
++	/* make a local copy of the AOR */
++	user.len = c->aor->len;
++	user.s = c->aor->s;
+ 
+ 	/* Get the UDomain for this account */
+ 	res = ul.get_udomain(c->domain->s, &domain);
+@@ -259,11 +262,10 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) {
+ 		return;
+ 	}
+ 
+-	/* Get the URecord for this ruid */
+-	res = ul.get_urecord_by_ruid(domain, ul.get_aorhash(c->aor), &(c->ruid),
+-		&record, &_c);
+-	if (res < 0) {
+-		LM_ERR("'%.*s (%.*s)' Not found in usrloc\n", c->aor->len, c->aor->s, c->domain->len, c->domain->s);
++	/* Get the URecord for this AOR */
++	res = ul.get_urecord(domain, &user, &record);
++	if (res > 0) {
++		LM_ERR("' %.*s (%.*s)' Not found in usrloc\n", c->aor->len, c->aor->s, c->domain->len, c->domain->s);
+ 		return;
+ 	}
+ 
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0021-registrar-get-instance-and-ref_id-when-using-msg.patch b/debian/patches/upstream/0021-registrar-get-instance-and-ref_id-when-using-msg.patch
new file mode 100644
index 0000000..ee4c5b6
--- /dev/null
+++ b/debian/patches/upstream/0021-registrar-get-instance-and-ref_id-when-using-msg.patch
@@ -0,0 +1,42 @@
+From a2b8efe1c24a213ef6c4221a59af544a3873e9d2 Mon Sep 17 00:00:00 2001
+From: Victor Seva <linuxmaniac at torreviejawireless.org>
+Date: Thu, 6 Aug 2015 20:36:22 +0200
+Subject: [PATCH] registrar: get instance and ref_id when using msg
+
+needed for check max_contacts properly if sip.instance exists
+as contact parameter
+
+See: #278
+(cherry picked from commit 99ce64fc555cc0b6b0189d812c6156cb05fb2e1b)
+---
+ modules/registrar/save.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/modules/registrar/save.c b/modules/registrar/save.c
+index ae311e8..1ebb849 100644
+--- a/modules/registrar/save.c
++++ b/modules/registrar/save.c
+@@ -307,6 +307,20 @@ static inline ucontact_info_t* pack_ci( struct sip_msg* _m, contact_t* _c,
+ 		}
+ 
+ 		ci.server_id = server_id;
++		if(_m->contact) {
++			_c = (((contact_body_t*)_m->contact->parsed)->contacts);
++			if(_c->instance!=NULL && _c->instance->body.len>0) {
++				ci.instance = _c->instance->body;
++				LM_DBG("set instance[%.*s]\n", ci.instance.len, ci.instance.s);
++			}
++			if(_use_regid && _c->instance!=NULL && _c->reg_id!=NULL && _c->reg_id->body.len>0) {
++				if(str2int(&_c->reg_id->body, &ci.reg_id)<0 || ci.reg_id==0)
++				{
++					LM_ERR("invalid reg-id value\n");
++					goto error;
++				}
++			}
++		}
+ 
+ 		allow_parsed = 0; /* not parsed yet */
+ 		received_found = 0; /* not found yet */
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0022-rtpengine-fix-typo-in-documentation.patch b/debian/patches/upstream/0022-rtpengine-fix-typo-in-documentation.patch
new file mode 100644
index 0000000..21ecc03
--- /dev/null
+++ b/debian/patches/upstream/0022-rtpengine-fix-typo-in-documentation.patch
@@ -0,0 +1,32 @@
+From df5761a59bc4da1854b081f0e68e98f6392aee5d Mon Sep 17 00:00:00 2001
+From: Camille Oudot <camille.oudot at orange.com>
+Date: Mon, 10 Aug 2015 15:24:27 +0200
+Subject: [PATCH] rtpengine: fix typo in documentation
+
+(cherry picked from commit e8927be015b4034d252479ba6fede4b749a43eed)
+---
+ modules/rtpengine/doc/rtpengine_admin.xml | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/modules/rtpengine/doc/rtpengine_admin.xml b/modules/rtpengine/doc/rtpengine_admin.xml
+index 6be5386..5a12f61 100644
+--- a/modules/rtpengine/doc/rtpengine_admin.xml
++++ b/modules/rtpengine/doc/rtpengine_admin.xml
+@@ -298,10 +298,12 @@ modparam("rtpengine", "force_send_interface", "2001:8d8:1ff:10c0:9a90:96ff:fea8:
+ 			There is no default value.
+ 		</para>
+ 		<example>
+-		<title>Set <varname>write_sdp_avp</varname> parameter</title>
++		<title>Set <varname>write_sdp_pv</varname> parameter</title>
+ <programlisting format="linespecific">
+ ...
+-modparam("rtpengine", "write_sdp_avp", "$avp(sdp)")
++modparam("rtpengine", "write_sdp_pv", "$avp(sdp)")
++  ...  or
++modparam("rtpengine", "write_sdp_pv", "$pv(sdp)")
+ ...
+ </programlisting>
+ 		</example>
+-- 
+2.5.0
+
diff --git a/debian/patches/upstream/0023-rtpengine-regenerate-README.patch b/debian/patches/upstream/0023-rtpengine-regenerate-README.patch
new file mode 100644
index 0000000..7785ad3
--- /dev/null
+++ b/debian/patches/upstream/0023-rtpengine-regenerate-README.patch
@@ -0,0 +1,39 @@
+From 084fb2db62b133eb528bb8682fc057001e64e91d Mon Sep 17 00:00:00 2001
+From: Camille Oudot <camille.oudot at orange.com>
+Date: Mon, 10 Aug 2015 15:35:09 +0200
+Subject: [PATCH] rtpengine: regenerate README
+
+---
+ modules/rtpengine/README | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/modules/rtpengine/README b/modules/rtpengine/README
+index ae5870f..fe4637b 100644
+--- a/modules/rtpengine/README
++++ b/modules/rtpengine/README
+@@ -101,7 +101,7 @@ Richard Fuchs
+    1.6. Set extra_id_pv parameter
+    1.7. Set setid_avp parameter
+    1.8. Set force_send_interface parameter
+-   1.9. Set write_sdp_avp parameter
++   1.9. Set write_sdp_pv parameter
+    1.10. Set rtp_inst_pvar parameter
+    1.11. set_rtpengine_set usage
+    1.12. rtpengine_offer usage
+@@ -350,9 +350,11 @@ modparam("rtpengine", "force_send_interface", "10.3.7.123")
+ 
+    There is no default value.
+ 
+-   Example 1.9. Set write_sdp_avp parameter
++   Example 1.9. Set write_sdp_pv parameter
+ ...
+-modparam("rtpengine", "write_sdp_avp", "$avp(sdp)")
++modparam("rtpengine", "write_sdp_pv", "$avp(sdp)")
++  ...  or
++modparam("rtpengine", "write_sdp_pv", "$pv(sdp)")
+ ...
+ 
+ 4.10. rtp_inst_pvar (string)
+-- 
+2.5.0
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/kamailio.git



More information about the Pkg-voip-commits mailing list