[Pkg-voip-commits] r9950 - in /kamailio/trunk/debian: ./ patches/ patches/upstream/
maniac-guest at alioth.debian.org
maniac-guest at alioth.debian.org
Wed Sep 12 06:35:42 UTC 2012
Author: maniac-guest
Date: Wed Sep 12 06:35:41 2012
New Revision: 9950
URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=9950
Log:
upstream fixes
Added:
kamailio/trunk/debian/patches/upstream/0034-parser-sdp-prevent-manipulation-with-freed-structure.patch
kamailio/trunk/debian/patches/upstream/0035-dialog-k-fixed-the-name-of-event-route.patch
kamailio/trunk/debian/patches/upstream/0036-sdpops-Fix-memory-leakage-in-w_get_sdp-function.patch
kamailio/trunk/debian/patches/upstream/0037-db-schema-removed-unique-requirement-from-pua-expire.patch
kamailio/trunk/debian/patches/upstream/0038-modules_k-presence-Fixed-level-of-a-diagnostic-messa.patch
kamailio/trunk/debian/patches/upstream/0039-modules_k-presence-Fixed-inconsistencies-in-use-of-e.patch
kamailio/trunk/debian/patches/upstream/0040-modules_k-presence-core_hash-not-used-correctly-to-d.patch
kamailio/trunk/debian/patches/upstream/0041-modules_k-presence-Improved-check-for-expired-dialog.patch
kamailio/trunk/debian/patches/upstream/0042-modules_k-presence-Fixed-some-problems-with-for-loop.patch
kamailio/trunk/debian/patches/upstream/0043-modules_k-rls-Fixed-issues-to-do-with-expiry-and-rls.patch
kamailio/trunk/debian/patches/upstream/0044-modules_k-pua-Fixed-incorrect-check-use-of-update_pe.patch
kamailio/trunk/debian/patches/upstream/0045-modules_k-rls-Added-missing-lock_release.patch
kamailio/trunk/debian/patches/upstream/0046-modules_k-pua_db-If-PUA-finds-more-than-one-matching.patch
kamailio/trunk/debian/patches/upstream/0047-modules_k-rls-core_hash-not-used-correctly-to-distri.patch
kamailio/trunk/debian/patches/upstream/0048-modules_k-rls-Fixed-issues-with-for-loops-in-DB-only.patch
kamailio/trunk/debian/patches/upstream/0049-modules_k-rls-Improved-check-for-expired-subscriptio.patch
kamailio/trunk/debian/patches/upstream/0050-modules_k-rls-Fixed-segmentation-fault-when-uploadin.patch
kamailio/trunk/debian/patches/upstream/0051-modules_k-pua-Adjusted-locking-for-dialog-insertion..patch
Modified:
kamailio/trunk/debian/changelog
kamailio/trunk/debian/patches/series
kamailio/trunk/debian/patches/upstream/0016-modules-db_postgres-libpq-requires-null-terminated-s.patch
kamailio/trunk/debian/patches/upstream/0017-modules_k-pua-transaction-not-ended-before-calling-s.patch
kamailio/trunk/debian/patches/upstream/0018-modules_k-rls-Some-incorrect-pkg_free-calls-in-DB-on.patch
Modified: kamailio/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/changelog?rev=9950&op=diff
==============================================================================
--- kamailio/trunk/debian/changelog (original)
+++ kamailio/trunk/debian/changelog Wed Sep 12 06:35:41 2012
@@ -12,7 +12,7 @@
+ remove call to dpkg-buildflags
+ do not apply hardening_flags.patch
- -- Victor Seva <linuxmaniac at torreviejawireless.org> Tue, 04 Sep 2012 08:30:15 +0200
+ -- Victor Seva <linuxmaniac at torreviejawireless.org> Wed, 12 Sep 2012 08:34:08 +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=9950&op=diff
==============================================================================
--- kamailio/trunk/debian/patches/series (original)
+++ kamailio/trunk/debian/patches/series Wed Sep 12 06:35:41 2012
@@ -21,6 +21,24 @@
upstream/0031-core-Use-Colin-Plumb-s-MD5-implementation.patch
upstream/0032-core-added-md5-wrapper-functions-to-build-with-Colin.patch
upstream/0033-b-f-In-case-of-IPv6-Option-in-the-RTP-Command-the-po.patch
+upstream/0034-parser-sdp-prevent-manipulation-with-freed-structure.patch
+upstream/0035-dialog-k-fixed-the-name-of-event-route.patch
+upstream/0036-sdpops-Fix-memory-leakage-in-w_get_sdp-function.patch
+upstream/0037-db-schema-removed-unique-requirement-from-pua-expire.patch
+upstream/0038-modules_k-presence-Fixed-level-of-a-diagnostic-messa.patch
+upstream/0039-modules_k-presence-Fixed-inconsistencies-in-use-of-e.patch
+upstream/0040-modules_k-presence-core_hash-not-used-correctly-to-d.patch
+upstream/0041-modules_k-presence-Improved-check-for-expired-dialog.patch
+upstream/0042-modules_k-presence-Fixed-some-problems-with-for-loop.patch
+upstream/0043-modules_k-rls-Fixed-issues-to-do-with-expiry-and-rls.patch
+upstream/0044-modules_k-pua-Fixed-incorrect-check-use-of-update_pe.patch
+upstream/0045-modules_k-rls-Added-missing-lock_release.patch
+upstream/0046-modules_k-pua_db-If-PUA-finds-more-than-one-matching.patch
+upstream/0047-modules_k-rls-core_hash-not-used-correctly-to-distri.patch
+upstream/0048-modules_k-rls-Fixed-issues-with-for-loops-in-DB-only.patch
+upstream/0049-modules_k-rls-Improved-check-for-expired-subscriptio.patch
+upstream/0050-modules_k-rls-Fixed-segmentation-fault-when-uploadin.patch
+upstream/0051-modules_k-pua-Adjusted-locking-for-dialog-insertion..patch
no_lib64_on_64_bits.patch
no_INSTALL_file.patch
fix_export.patch
Modified: kamailio/trunk/debian/patches/upstream/0016-modules-db_postgres-libpq-requires-null-terminated-s.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0016-modules-db_postgres-libpq-requires-null-terminated-s.patch?rev=9950&op=diff
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0016-modules-db_postgres-libpq-requires-null-terminated-s.patch (original)
+++ kamailio/trunk/debian/patches/upstream/0016-modules-db_postgres-libpq-requires-null-terminated-s.patch Wed Sep 12 06:35:41 2012
@@ -63,5 +63,5 @@
}
--
-1.7.10.4
+1.7.9.5
Modified: kamailio/trunk/debian/patches/upstream/0017-modules_k-pua-transaction-not-ended-before-calling-s.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0017-modules_k-pua-transaction-not-ended-before-calling-s.patch?rev=9950&op=diff
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0017-modules_k-pua-transaction-not-ended-before-calling-s.patch (original)
+++ kamailio/trunk/debian/patches/upstream/0017-modules_k-pua-transaction-not-ended-before-calling-s.patch Wed Sep 12 06:35:41 2012
@@ -51,5 +51,5 @@
if (pua_dbf.end_transaction(pua_db) < 0)
{
--
-1.7.10.4
+1.7.9.5
Modified: kamailio/trunk/debian/patches/upstream/0018-modules_k-rls-Some-incorrect-pkg_free-calls-in-DB-on.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0018-modules_k-rls-Some-incorrect-pkg_free-calls-in-DB-on.patch?rev=9950&op=diff
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0018-modules_k-rls-Some-incorrect-pkg_free-calls-in-DB-on.patch (original)
+++ kamailio/trunk/debian/patches/upstream/0018-modules_k-rls-Some-incorrect-pkg_free-calls-in-DB-on.patch Wed Sep 12 06:35:41 2012
@@ -59,5 +59,5 @@
return(-1);
}
--
-1.7.10.4
+1.7.9.5
Added: kamailio/trunk/debian/patches/upstream/0034-parser-sdp-prevent-manipulation-with-freed-structure.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0034-parser-sdp-prevent-manipulation-with-freed-structure.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0034-parser-sdp-prevent-manipulation-with-freed-structure.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0034-parser-sdp-prevent-manipulation-with-freed-structure.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,25 @@
+From 5771e1ed6c7b92ebab9e2da0251315498a5190e1 Mon Sep 17 00:00:00 2001
+From: Michal Karas <largon at largon.net>
+Date: Thu, 12 Jul 2012 17:38:15 +0200
+Subject: [PATCH] parser/sdp: prevent manipulation with freed structure
+
+- FS#244
+---
+ parser/sdp/sdp.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/parser/sdp/sdp.c b/parser/sdp/sdp.c
+index db9003a..5521aec 100644
+--- a/parser/sdp/sdp.c
++++ b/parser/sdp/sdp.c
+@@ -721,6 +721,7 @@ int parse_sdp(struct sip_msg* _m)
+ if (res != 0) {
+ LM_DBG("free_sdp\n");
+ free_sdp((sdp_info_t**)(void*)&_m->body);
++ return res;
+ }
+ /* The whole body is SDP */
+ ((sdp_info_t*)_m->body)->raw_sdp.s = body.s;
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0035-dialog-k-fixed-the-name-of-event-route.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0035-dialog-k-fixed-the-name-of-event-route.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0035-dialog-k-fixed-the-name-of-event-route.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0035-dialog-k-fixed-the-name-of-event-route.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,69 @@
+From e663ddd6e3ff55cd43f1a21561f7c60a94420d36 Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Wed, 5 Sep 2012 08:58:18 +0200
+Subject: [PATCH] dialog(k): fixed the name of event route
+
+- it is 'dialog:failed' instead of 'dialog:failure'
+- reported by Uri Shacked
+(cherry picked from commit 163f860ef7c0ed9a720207499d054e7f68b139df)
+---
+ modules_k/dialog/README | 8 ++++----
+ modules_k/dialog/doc/dialog_admin.xml | 2 +-
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/modules_k/dialog/README b/modules_k/dialog/README
+index 5aa0b76..46997f7 100644
+--- a/modules_k/dialog/README
++++ b/modules_k/dialog/README
+@@ -149,7 +149,7 @@ Alex Balashov
+
+ 11.1. event_route[dialog:start]
+ 11.2. event_route[dialog:end]
+- 11.3. event_route[dialog:failure]
++ 11.3. event_route[dialog:failed]
+
+ 2. Developer Guide
+
+@@ -348,7 +348,7 @@ Chapter 1. Admin Guide
+
+ 11.1. event_route[dialog:start]
+ 11.2. event_route[dialog:end]
+- 11.3. event_route[dialog:failure]
++ 11.3. event_route[dialog:failed]
+
+ 1. Overview
+
+@@ -1783,7 +1783,7 @@ dlg_set_property("ka-dst");
+
+ 11.1. event_route[dialog:start]
+ 11.2. event_route[dialog:end]
+- 11.3. event_route[dialog:failure]
++ 11.3. event_route[dialog:failed]
+
+ 11.1. event_route[dialog:start]
+
+@@ -1793,7 +1793,7 @@ dlg_set_property("ka-dst");
+
+ Executed when BYE is processed or dialog timed out.
+
+-11.3. event_route[dialog:failure]
++11.3. event_route[dialog:failed]
+
+ Executed when dialog is not completed (+300 reply to INVITE).
+
+diff --git a/modules_k/dialog/doc/dialog_admin.xml b/modules_k/dialog/doc/dialog_admin.xml
+index 760ba4c..a31d5b5 100644
+--- a/modules_k/dialog/doc/dialog_admin.xml
++++ b/modules_k/dialog/doc/dialog_admin.xml
+@@ -2316,7 +2316,7 @@ dlg_set_property("ka-dst");
+ </para>
+ </section>
+ <section>
+- <title><varname>event_route[dialog:failure]</varname></title>
++ <title><varname>event_route[dialog:failed]</varname></title>
+ <para>
+ Executed when dialog is not completed (+300 reply to INVITE).
+ </para>
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0036-sdpops-Fix-memory-leakage-in-w_get_sdp-function.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0036-sdpops-Fix-memory-leakage-in-w_get_sdp-function.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0036-sdpops-Fix-memory-leakage-in-w_get_sdp-function.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0036-sdpops-Fix-memory-leakage-in-w_get_sdp-function.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,34 @@
+From 4f34d95ebc689702376bfdeb63be65d1e774455a Mon Sep 17 00:00:00 2001
+From: Vicente Hernando <vhernando at systemonenoc.com>
+Date: Wed, 5 Sep 2012 06:44:39 -0400
+Subject: [PATCH] sdpops: Fix memory leakage in w_get_sdp function. (cherry
+ picked from commit
+ d1d2494c966d65828d1920296056da840a11efd9)
+
+---
+ modules/sdpops/sdpops_mod.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/modules/sdpops/sdpops_mod.c b/modules/sdpops/sdpops_mod.c
+index df7d6e6..b70b553 100644
+--- a/modules/sdpops/sdpops_mod.c
++++ b/modules/sdpops/sdpops_mod.c
+@@ -974,14 +974,8 @@ static int w_get_sdp(sip_msg_t* msg, char *avp)
+ LM_DBG("No SDP\n");
+ return -2;
+ } else {
+- avp_val.s.s = pkg_malloc(sdp->raw_sdp.len);
++ avp_val.s.s = sdp->raw_sdp.s;
+ avp_val.s.len = sdp->raw_sdp.len;
+- if (avp_val.s.s == NULL)
+- {
+- LM_ERR("Failed to alloc memory for SDP");
+- return -1;
+- }
+- memcpy(avp_val.s.s, sdp->raw_sdp.s, avp_val.s.len);
+ LM_DBG("Found SDP %.*s\n", sdp->raw_sdp.len, sdp->raw_sdp.s);
+ }
+ if (add_avp(AVP_VAL_STR | avp_type, avp_name, avp_val) != 0)
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0037-db-schema-removed-unique-requirement-from-pua-expire.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0037-db-schema-removed-unique-requirement-from-pua-expire.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0037-db-schema-removed-unique-requirement-from-pua-expire.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0037-db-schema-removed-unique-requirement-from-pua-expire.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,45 @@
+From 82ca28c8a523c015b69a3c56d02983356faefc54 Mon Sep 17 00:00:00 2001
+From: Juha Heinanen <jh at tutpro.com>
+Date: Fri, 7 Sep 2012 19:16:37 +0300
+Subject: [PATCH] db schema: removed unique requirement from pua expires_idx
+
+- TODO: change also other than mysql table structures
+(cherry picked from commit bedb7fdc6d02e92fbf52ad4acb6dfcbb49f0bc49)
+---
+ lib/srdb1/schema/pr_pua.xml | 1 -
+ utils/kamctl/mysql/presence-create.sql | 3 +--
+ 2 files changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/lib/srdb1/schema/pr_pua.xml b/lib/srdb1/schema/pr_pua.xml
+index 5bd690b..0351768 100644
+--- a/lib/srdb1/schema/pr_pua.xml
++++ b/lib/srdb1/schema/pr_pua.xml
+@@ -163,7 +163,6 @@
+ <index>
+ <name>expires_idx</name>
+ <colref linkend="expires"/>
+- <unique/>
+ </index>
+
+ <index>
+diff --git a/utils/kamctl/mysql/presence-create.sql b/utils/kamctl/mysql/presence-create.sql
+index 5584f8e..7f68249 100644
+--- a/utils/kamctl/mysql/presence-create.sql
++++ b/utils/kamctl/mysql/presence-create.sql
+@@ -103,7 +103,6 @@ CREATE TABLE pua (
+ version INT(11) NOT NULL,
+ extra_headers TEXT NOT NULL,
+ CONSTRAINT pua_idx UNIQUE (etag, tuple_id, call_id, from_tag),
+- CONSTRAINT expires_idx UNIQUE (expires)
+ ) ENGINE=MyISAM;
+
+ CREATE INDEX dialog1_idx ON pua (call_id, from_tag, to_tag);
+@@ -112,4 +111,4 @@ CREATE INDEX tmp_dlg1_idx ON pua (call_id, from_tag);
+ CREATE INDEX tmp_dlg2_idx ON pua (pres_id, pres_uri, call_id, from_tag);
+ CREATE INDEX tmp_record1_idx ON pua (pres_id);
+ CREATE INDEX tmp_record2_idx ON pua (pres_id, etag);
+-
++CREATE INDEX expires_idx ON pua (expires);
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0038-modules_k-presence-Fixed-level-of-a-diagnostic-messa.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0038-modules_k-presence-Fixed-level-of-a-diagnostic-messa.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0038-modules_k-presence-Fixed-level-of-a-diagnostic-messa.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0038-modules_k-presence-Fixed-level-of-a-diagnostic-messa.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,27 @@
+From ed672fdde6d6adbe7066162a6b1cbae8cc3948a8 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Tue, 11 Sep 2012 12:54:51 +0100
+Subject: [PATCH] modules_k/presence: Fixed level of a diagnostic message
+ (cherry picked from commit
+ 3635a0d920f0d03e85b8b97a44d878f0f8d13931)
+
+---
+ modules_k/presence/notify.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules_k/presence/notify.c b/modules_k/presence/notify.c
+index d6bea37..dd15bab 100644
+--- a/modules_k/presence/notify.c
++++ b/modules_k/presence/notify.c
+@@ -2810,7 +2810,7 @@ int process_dialogs(int round, int presence_winfo)
+
+ if (dialog->n <= 0)
+ {
+- LM_WARN("record not found\n");
++ LM_INFO("record not found - this may be observed in multi-server systems\n");
+ if (cleanup_missing_dialog(&sub) < 0)
+ LM_ERR("cleaning up after missing record\n");
+ goto next_dialog;
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0039-modules_k-presence-Fixed-inconsistencies-in-use-of-e.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0039-modules_k-presence-Fixed-inconsistencies-in-use-of-e.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0039-modules_k-presence-Fixed-inconsistencies-in-use-of-e.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0039-modules_k-presence-Fixed-inconsistencies-in-use-of-e.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,124 @@
+From b4c70bca1cb3f0dc722bd89933fa566e790837a1 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Tue, 11 Sep 2012 12:51:33 +0100
+Subject: [PATCH] modules_k/presence: Fixed inconsistencies in use of
+ expires_offset for removing subcriptions
+
+- These caused particular problems on mulit-server, DB only, systems
+- Found and fixed by Hugh Waite @ Crocodile RCS Ltd.
+(cherry picked from commit a29a2a81bc541af020955dbda0d352445fef5788)
+---
+ modules_k/presence/notify.c | 26 +++++++++-----------------
+ modules_k/presence/presence.c | 6 +++---
+ 2 files changed, 12 insertions(+), 20 deletions(-)
+
+diff --git a/modules_k/presence/notify.c b/modules_k/presence/notify.c
+index dd15bab..4f5396d 100644
+--- a/modules_k/presence/notify.c
++++ b/modules_k/presence/notify.c
+@@ -246,7 +246,7 @@ int get_wi_subs_db(subs_t* subs, watcher_t* watchers)
+ int n_result_cols = 0;
+ int n_query_cols = 0;
+ int i;
+- int status_col, expires_col, watcher_user_col, watcher_domain_col, callid_col;
++ int status_col, watcher_user_col, watcher_domain_col, callid_col;
+
+ query_cols[n_query_cols] = &str_presentity_uri_col;
+ query_ops[n_query_cols] = OP_EQ;
+@@ -266,11 +266,10 @@ int get_wi_subs_db(subs_t* subs, watcher_t* watchers)
+ query_ops[n_query_cols] = OP_GT;
+ query_vals[n_query_cols].type = DB1_INT;
+ query_vals[n_query_cols].nul = 0;
+- query_vals[n_query_cols].val.int_val = (int)time(NULL) - expires_offset;
++ query_vals[n_query_cols].val.int_val = (int)time(NULL) + expires_offset;
+ n_query_cols++;
+
+ result_cols[status_col=n_result_cols++] = &str_status_col;
+- result_cols[expires_col=n_result_cols++] = &str_expires_col;
+ result_cols[watcher_user_col=n_result_cols++] = &str_watcher_username_col;
+ result_cols[watcher_domain_col=n_result_cols++] = &str_watcher_domain_col;
+ result_cols[callid_col=n_result_cols++] = &str_callid_col;
+@@ -581,11 +580,11 @@ error:
+ str* get_p_notify_body(str pres_uri, pres_ev_t* event, str* etag,
+ str* contact)
+ {
+- db_key_t query_cols[6];
+- db_val_t query_vals[6];
+- db_key_t result_cols[6];
++ db_key_t query_cols[3];
++ db_val_t query_vals[3];
++ db_key_t result_cols[3];
+ db1_res_t *result = NULL;
+- int body_col, expires_col, etag_col= 0, sender_col;
++ int body_col, etag_col= 0, sender_col;
+ str** body_array= NULL;
+ str* notify_body= NULL;
+ db_row_t *row= NULL ;
+@@ -646,7 +645,6 @@ str* get_p_notify_body(str pres_uri, pres_ev_t* event, str* etag,
+ n_query_cols++;
+
+ result_cols[body_col=n_result_cols++] = &str_body_col;
+- result_cols[expires_col=n_result_cols++] = &str_expires_col;
+ result_cols[etag_col=n_result_cols++] = &str_etag_col;
+ result_cols[sender_col=n_result_cols++] = &str_sender_col;
+
+@@ -1087,9 +1085,6 @@ int get_subs_db(str* pres_uri, pres_ev_t* event, str* sender,
+ row = &result->rows[i];
+ row_vals = ROW_VALUES(row);
+
+- // if(row_vals[expires_col].val.int_val< (int)time(NULL))
+- // continue;
+-
+ if(row_vals[reason_col].val.string_val) {
+ if(strlen(row_vals[reason_col].val.string_val) != 0)
+ continue;
+@@ -1145,11 +1140,10 @@ int get_subs_db(str* pres_uri, pres_ev_t* event, str* sender,
+
+ s.event= event;
+ s.local_cseq = row_vals[cseq_col].val.int_val +1;
+- if(row_vals[expires_col].val.int_val < (int)time(NULL))
++ if(row_vals[expires_col].val.int_val < (int)time(NULL) + expires_offset)
+ s.expires = 0;
+ else
+- s.expires = row_vals[expires_col].val.int_val -
+- (int)time(NULL);
++ s.expires = row_vals[expires_col].val.int_val - (int)time(NULL);
+ s.version = row_vals[version_col].val.int_val +1;
+
+ s_new= mem_copy_subs(&s, PKG_MEM_TYPE);
+@@ -2845,13 +2839,11 @@ int process_dialogs(int round, int presence_winfo)
+ cached_updated_winfo = sub.updated_winfo
+ = VAL_INT(&dvalues[updated_winfo_col]);
+
+- if (VAL_INT(&dvalues[expires_col]) > now)
++ if (VAL_INT(&dvalues[expires_col]) > now + expires_offset)
+ sub.expires = VAL_INT(&dvalues[expires_col]) - now;
+ else
+ sub.expires = 0;
+
+- if (sub.expires < expires_offset) sub.expires = 0;
+-
+ sub.updated = round;
+
+ if ((notify_sent = notifier_notify(&sub, &updated, &end_transaction)) < 0)
+diff --git a/modules_k/presence/presence.c b/modules_k/presence/presence.c
+index 29470bc..118b4d2 100644
+--- a/modules_k/presence/presence.c
++++ b/modules_k/presence/presence.c
+@@ -1348,10 +1348,10 @@ static int update_pw_dialogs_dbonlymode(subs_t* subs, subs_t** subs_array)
+
+ s.expires = row_vals[r_expires_col].val.int_val;
+
+- if( s.expires < (int)time(NULL) )
+- s.expires = 0;
+- else
++ if( s.expires > (int)time(NULL) + expires_offset)
+ s.expires -= (int)time(NULL);
++ else
++ s.expires = 0;
+
+ s.version = row_vals[r_version_col].val.int_val;
+
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0040-modules_k-presence-core_hash-not-used-correctly-to-d.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0040-modules_k-presence-core_hash-not-used-correctly-to-d.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0040-modules_k-presence-core_hash-not-used-correctly-to-d.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0040-modules_k-presence-core_hash-not-used-correctly-to-d.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,80 @@
+From 262982b13c887c15e4c5a4d667530aad3fb8801c Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Tue, 11 Sep 2012 12:53:58 +0100
+Subject: [PATCH] modules_k/presence: core_hash not used correctly to
+ distribute notifier traffic
+
+- Found and fixed by Hugh Waite @ Crocodile RCS Ltd
+(cherry picked from commit 4b9aa7f144b8cf3e6da775563528913ed79e0553)
+---
+ modules_k/presence/notify.c | 13 +++++++------
+ modules_k/presence/presence.c | 4 ++--
+ modules_k/presence/subscribe.c | 4 ++--
+ 3 files changed, 11 insertions(+), 10 deletions(-)
+
+diff --git a/modules_k/presence/notify.c b/modules_k/presence/notify.c
+index 4f5396d..d601acc 100644
+--- a/modules_k/presence/notify.c
++++ b/modules_k/presence/notify.c
+@@ -2223,9 +2223,9 @@ int set_wipeer_subs_updated(str *pres_uri, pres_ev_t *event, int full)
+ update_cols[n_update_cols] = &str_updated_col;
+ update_vals[n_update_cols].type = DB1_INT;
+ update_vals[n_update_cols].nul = 0;
+- update_vals[n_update_cols].val.int_val = core_hash(&callid,
+- &from_tag, (pres_waitn_time * pres_notifier_poll_rate
+- * pres_notifier_processes) - 1);
++ update_vals[n_update_cols].val.int_val =
++ core_hash(&callid, &from_tag, 0) % (pres_waitn_time *
++ pres_notifier_poll_rate * pres_notifier_processes);
+ n_update_cols++;
+
+ if (full)
+@@ -2283,9 +2283,10 @@ int set_updated(subs_t *sub)
+ update_cols[0] = &str_updated_col;
+ update_vals[0].type = DB1_INT;
+ update_vals[0].nul = 0;
+- update_vals[0].val.int_val = core_hash(&sub->callid, &sub->from_tag,
+- (pres_waitn_time * pres_notifier_poll_rate
+- * pres_notifier_processes) - 1);
++ update_vals[0].val.int_val =
++ core_hash(&sub->callid, &sub->from_tag, 0) %
++ (pres_waitn_time * pres_notifier_poll_rate
++ * pres_notifier_processes);
+
+ if (pa_dbf.use_table(pa_db, &active_watchers_table) < 0)
+ {
+diff --git a/modules_k/presence/presence.c b/modules_k/presence/presence.c
+index 118b4d2..0adec43 100644
+--- a/modules_k/presence/presence.c
++++ b/modules_k/presence/presence.c
+@@ -1407,9 +1407,9 @@ static int update_pw_dialogs_dbonlymode(subs_t* subs, subs_t** subs_array)
+ * pres_notifier_processes));
+ } else {
+ db_vals[n_update_cols].val.int_val =
+- core_hash(&subs->callid, &subs->from_tag,
++ core_hash(&subs->callid, &subs->from_tag, 0) %
+ (pres_waitn_time * pres_notifier_poll_rate
+- * pres_notifier_processes) - 1);
++ * pres_notifier_processes);
+ }
+ n_update_cols++;
+
+diff --git a/modules_k/presence/subscribe.c b/modules_k/presence/subscribe.c
+index c8e9960..deeef3e 100644
+--- a/modules_k/presence/subscribe.c
++++ b/modules_k/presence/subscribe.c
+@@ -470,9 +470,9 @@ int update_subscription_notifier(struct sip_msg* msg, subs_t* subs,
+ *sent_reply= 0;
+
+ /* Set the notifier/update fields for the subscription */
+- subs->updated = core_hash(&subs->callid, &subs->from_tag,
++ subs->updated = core_hash(&subs->callid, &subs->from_tag, 0) %
+ (pres_waitn_time * pres_notifier_poll_rate
+- * pres_notifier_processes) - 1);
++ * pres_notifier_processes);
+ if (subs->event->type & WINFO_TYPE)
+ subs->updated_winfo = UPDATED_TYPE;
+ else if (subs->event->wipeer)
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0041-modules_k-presence-Improved-check-for-expired-dialog.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0041-modules_k-presence-Improved-check-for-expired-dialog.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0041-modules_k-presence-Improved-check-for-expired-dialog.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0041-modules_k-presence-Improved-check-for-expired-dialog.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,45 @@
+From 42a123c416d5906bfefd7eaae8ef81cacda80a41 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Tue, 11 Sep 2012 12:56:52 +0100
+Subject: [PATCH] modules_k/presence: Improved check for expired dialogs in DB
+ only mode with notifier tasks (cherry picked from commit
+ d9087dbbf411f71486a4ce765aa5d6dfeb531f9c)
+
+---
+ modules_k/presence/subscribe.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/modules_k/presence/subscribe.c b/modules_k/presence/subscribe.c
+index deeef3e..7e90cce 100644
+--- a/modules_k/presence/subscribe.c
++++ b/modules_k/presence/subscribe.c
+@@ -1581,9 +1581,9 @@ int handle_expired_subs(subs_t* s)
+
+ void update_db_subs_timer_notifier(void)
+ {
+- db_key_t query_cols[1], result_cols[3];
+- db_val_t query_vals[1], *values;
+- db_op_t query_ops[1];
++ db_key_t query_cols[2], result_cols[3];
++ db_val_t query_vals[2], *values;
++ db_op_t query_ops[2];
+ db_row_t *rows;
+ db1_res_t *result = NULL;
+ int n_query_cols = 0, n_result_cols = 0;
+@@ -1610,6 +1610,13 @@ void update_db_subs_timer_notifier(void)
+ query_ops[n_query_cols]= OP_LT;
+ n_query_cols++;
+
++ query_cols[n_query_cols]= &str_updated_col;
++ query_vals[n_query_cols].type = DB1_INT;
++ query_vals[n_query_cols].nul = 0;
++ query_vals[n_query_cols].val.int_val= NO_UPDATE_TYPE;
++ query_ops[n_query_cols]= OP_EQ;
++ n_query_cols++;
++
+ result_cols[r_callid_col=n_result_cols++] = &str_callid_col;
+ result_cols[r_to_tag_col=n_result_cols++] = &str_to_tag_col;
+ result_cols[r_from_tag_col=n_result_cols++] = &str_from_tag_col;
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0042-modules_k-presence-Fixed-some-problems-with-for-loop.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0042-modules_k-presence-Fixed-some-problems-with-for-loop.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0042-modules_k-presence-Fixed-some-problems-with-for-loop.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0042-modules_k-presence-Fixed-some-problems-with-for-loop.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,46 @@
+From c2616fb78a9828203fbc9e885d96f07364df5000 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Tue, 11 Sep 2012 12:55:49 +0100
+Subject: [PATCH] modules_k/presence: Fixed some problems with for() loops in
+ DB only mode
+
+- Found and fixed by Hugh Waite @ Crocodile RCS Ltd
+(cherry picked from commit cd6415240ff243842b4e11b095103f00fd64d0d9)
+---
+ modules_k/presence/presence.c | 4 ++--
+ modules_k/presence/subscribe.c | 1 +
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/modules_k/presence/presence.c b/modules_k/presence/presence.c
+index 0adec43..ed7f4d1 100644
+--- a/modules_k/presence/presence.c
++++ b/modules_k/presence/presence.c
+@@ -1277,11 +1277,11 @@ static int update_pw_dialogs_dbonlymode(subs_t* subs, subs_t** subs_array)
+ return 0;
+ }
+
++ rows = RES_ROWS(result);
+ /* get the results and fill in return data structure */
+ for (loop=0; loop <nr_rows; loop++)
+ {
+- rows = RES_ROWS(result);
+- row_vals = ROW_VALUES(rows);
++ row_vals = ROW_VALUES(&rows[loop]);
+
+ memset(&s, 0, sizeof(subs_t));
+ s.status= subs->status;
+diff --git a/modules_k/presence/subscribe.c b/modules_k/presence/subscribe.c
+index 7e90cce..ad43f7b 100644
+--- a/modules_k/presence/subscribe.c
++++ b/modules_k/presence/subscribe.c
+@@ -1641,6 +1641,7 @@ void update_db_subs_timer_notifier(void)
+ for (i = 0; i <RES_ROW_N(result); i++)
+ {
+ values = ROW_VALUES(&rows[i]);
++ memset(&subs, 0, sizeof(subs_t));
+
+ subs.callid.s = (char *) VAL_STRING(&values[r_callid_col]);
+ subs.callid.len = strlen(subs.callid.s);
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0043-modules_k-rls-Fixed-issues-to-do-with-expiry-and-rls.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0043-modules_k-rls-Fixed-issues-to-do-with-expiry-and-rls.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0043-modules_k-rls-Fixed-issues-to-do-with-expiry-and-rls.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0043-modules_k-rls-Fixed-issues-to-do-with-expiry-and-rls.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,98 @@
+From 2778f4126fdd48f4573f008726b3a3868c3d69c1 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Tue, 11 Sep 2012 13:05:15 +0100
+Subject: [PATCH] modules_k/rls: Fixed issues to do with expiry and
+ rls_expires_offset
+
+- These cause particular problems on multi-server systems.
+- Found and fixed by Hugh Waite @ Crocodile RCS Ltd
+(cherry picked from commit 6eccc8b61e848977012d6efa1fb5aae61f8d441e)
+---
+ modules_k/rls/resource_notify.c | 21 ++++++++-------------
+ modules_k/rls/subscribe.c | 5 ++++-
+ 2 files changed, 12 insertions(+), 14 deletions(-)
+
+diff --git a/modules_k/rls/resource_notify.c b/modules_k/rls/resource_notify.c
+index 8937131..1285925 100644
+--- a/modules_k/rls/resource_notify.c
++++ b/modules_k/rls/resource_notify.c
+@@ -129,15 +129,14 @@ void get_dialog_from_did(char* did, subs_t **dialog, unsigned int *hash_code)
+ *dialog= pres_copy_subs(s, PKG_MEM_TYPE);
+ }
+
+- if(*dialog== NULL)
+- {
+- LM_ERR("while copying subs_t structure\n");
+- }
++ if ((*dialog)->expires < (int)time(NULL))
++ (*dialog)->expires = 0;
++ else
++ (*dialog)->expires -= (int)time(NULL);
+
+ if (dbmode != RLS_DB_ONLY)
+ lock_release(&rls_table[*hash_code].lock);
+
+- (*dialog)->expires -= (int)time(NULL);
+ }
+
+ int send_notify(xmlDocPtr * rlmi_doc, char * buf, int buf_len,
+@@ -994,15 +993,10 @@ static void timer_send_full_state_notifies(int round)
+ sub.remote_cseq = VAL_INT(&values[rcseq_col]);
+ sub.status = VAL_INT(&values[status_col]);
+ sub.version = VAL_INT(&values[version_col]);
+- if (VAL_INT(&values[expires_col]) > now)
++ if (VAL_INT(&values[expires_col]) > now + rls_expires_offset)
++ {
+ sub.expires = VAL_INT(&values[expires_col]) - now;
+- else
+- sub.expires = 0;
+-
+- if (sub.expires < rls_expires_offset) sub.expires = 0;
+
+- if (sub.expires != 0)
+- {
+ if (rls_get_service_list(&sub.pres_uri, &sub.watcher_user,
+ &sub.watcher_domain, &service_node, &doc) < 0)
+ {
+@@ -1026,6 +1020,7 @@ static void timer_send_full_state_notifies(int round)
+ }
+ else
+ {
++ sub.expires = 0;
+ rls_send_notify(&sub, NULL, NULL, NULL);
+ delete_rlsdb(&sub.callid, &sub.to_tag, &sub.from_tag);
+ }
+@@ -1153,7 +1148,7 @@ void rls_presentity_clean(unsigned int ticks,void *param)
+ query_ops[0]= OP_LT;
+ query_vals[0].nul= 0;
+ query_vals[0].type= DB1_INT;
+- query_vals[0].val.int_val= (int)time(NULL) - 10;
++ query_vals[0].val.int_val= (int)time(NULL) - rls_expires_offset;
+
+ if (rlpres_dbf.use_table(rlpres_db, &rlpres_table) < 0)
+ {
+diff --git a/modules_k/rls/subscribe.c b/modules_k/rls/subscribe.c
+index f719754..c9577de 100644
+--- a/modules_k/rls/subscribe.c
++++ b/modules_k/rls/subscribe.c
+@@ -1111,13 +1111,16 @@ void update_a_sub(subs_t *subs_copy)
+ {
+ xmlDocPtr doc = NULL;
+ xmlNodePtr service_node = NULL;
++ int now = (int)time(NULL);
+
+- if ((subs_copy->expires -= (int)time(NULL)) <= 0)
++ if (subs_copy->expires < now)
+ {
++ subs_copy->expires = 0;
+ LM_WARN("found expired subscription for: %.*s\n",
+ subs_copy->pres_uri.len, subs_copy->pres_uri.s);
+ goto done;
+ }
++ subs_copy->expires -= now;
+
+ if(rls_get_service_list(&subs_copy->pres_uri, &subs_copy->watcher_user,
+ &subs_copy->watcher_domain, &service_node, &doc)<0)
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0044-modules_k-pua-Fixed-incorrect-check-use-of-update_pe.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0044-modules_k-pua-Fixed-incorrect-check-use-of-update_pe.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0044-modules_k-pua-Fixed-incorrect-check-use-of-update_pe.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0044-modules_k-pua-Fixed-incorrect-check-use-of-update_pe.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,33 @@
+From 64f64efb49782bb74080193863ac2d4775816add Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Tue, 11 Sep 2012 12:58:13 +0100
+Subject: [PATCH] modules_k/pua: Fixed incorrect check/use of update_period
+ modparam (cherry picked from commit
+ ef7d43fc614276b75c560660c7e4368fd18d574d)
+
+---
+ modules_k/pua/pua.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/modules_k/pua/pua.c b/modules_k/pua/pua.c
+index b72f9e1..2297219 100644
+--- a/modules_k/pua/pua.c
++++ b/modules_k/pua/pua.c
+@@ -268,8 +268,13 @@ static int mod_init(void)
+
+ startup_time = (int) time(NULL);
+
+- if (update_period > 0) /* probably should check > 5 here!! -croc */
++ if (update_period > 5)
+ register_timer(hashT_clean, 0, update_period- 5);
++ else if (update_period != 0)
++ {
++ LM_ERR("update_period must be 0 or > 5\n");
++ return -1;
++ }
+
+ if (dbmode != PUA_DB_ONLY)
+ {
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0045-modules_k-rls-Added-missing-lock_release.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0045-modules_k-rls-Added-missing-lock_release.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0045-modules_k-rls-Added-missing-lock_release.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0045-modules_k-rls-Added-missing-lock_release.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,31 @@
+From 831b80f9aecabfdfa37bcb806bc1192e46681869 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Tue, 11 Sep 2012 13:03:32 +0100
+Subject: [PATCH] modules_k/rls: Added missing lock_release()
+
+- Found and fixed by Hugh Waite @ Crocodile RCS Ltd
+(cherry picked from commit 725020f91493d33c5fa86828a421ed465731658e)
+---
+ modules_k/rls/resource_notify.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/modules_k/rls/resource_notify.c b/modules_k/rls/resource_notify.c
+index 1285925..9c757ad 100644
+--- a/modules_k/rls/resource_notify.c
++++ b/modules_k/rls/resource_notify.c
+@@ -127,6 +127,12 @@ void get_dialog_from_did(char* did, subs_t **dialog, unsigned int *hash_code)
+
+ /* save dialog info */
+ *dialog= pres_copy_subs(s, PKG_MEM_TYPE);
++ if(*dialog== NULL)
++ {
++ LM_ERR("while copying subs_t structure\n");
++ lock_release(&rls_table[*hash_code].lock);
++ return;
++ }
+ }
+
+ if ((*dialog)->expires < (int)time(NULL))
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0046-modules_k-pua_db-If-PUA-finds-more-than-one-matching.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0046-modules_k-pua_db-If-PUA-finds-more-than-one-matching.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0046-modules_k-pua_db-If-PUA-finds-more-than-one-matching.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0046-modules_k-pua_db-If-PUA-finds-more-than-one-matching.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,49 @@
+From 0d1af7d98cd4053b839556cfa07c9f71874fd02e Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Tue, 11 Sep 2012 12:59:08 +0100
+Subject: [PATCH] modules_k/pua_db: If PUA finds more than one matching dialog
+ (when there should only be one) delete them all
+
+- A timing difference on multiple-servers can sometimes cause this,
+ and (if it happens, it doesn't when the clocks are synced) you can
+ end up with the same error coming out lots because the DB is not
+ cleaned up.
+(cherry picked from commit 20475258957cbf3183e5e771e9fd41dc69336096)
+---
+ modules_k/pua/pua_db.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/modules_k/pua/pua_db.c b/modules_k/pua/pua_db.c
+index 05dd1e3..f42b480 100644
+--- a/modules_k/pua/pua_db.c
++++ b/modules_k/pua/pua_db.c
+@@ -614,6 +614,8 @@ int convert_temporary_dialog_puadb(ua_pres_t *pres)
+ query_vals[n_query_cols].val.str_val.len = 0;
+ n_query_cols++;
+
++
++
+ if (pua_dbf.replace != NULL)
+ {
+ if (pua_dbf.replace(pua_db, query_cols, query_vals, n_query_cols,
+@@ -1210,11 +1212,14 @@ ua_pres_t *get_dialog_puadb(str pres_id, str *pres_uri, ua_pres_t *result, db1_r
+ pua_dbf.free_result(pua_db, res);
+ return(NULL);
+ }
+-
+- if (nr_rows != 1)
++ else if (nr_rows > 1)
+ {
+- LM_ERR("Too many rows found (%d)\n", nr_rows);
++ LM_ERR("Too many rows found (%d)... deleting\n", nr_rows);
+ pua_dbf.free_result(pua_db, res);
++
++ if (pua_dbf.delete(pua_db, q_cols, 0, q_vals, n_query_cols) < 0)
++ LM_ERR("deleting record(s)\n");
++
+ return(NULL);
+ }
+
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0047-modules_k-rls-core_hash-not-used-correctly-to-distri.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0047-modules_k-rls-core_hash-not-used-correctly-to-distri.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0047-modules_k-rls-core_hash-not-used-correctly-to-distri.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0047-modules_k-rls-core_hash-not-used-correctly-to-distri.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,63 @@
+From 1fe1770aa372b6d22554428fb7172215e502b20c Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Tue, 11 Sep 2012 13:06:54 +0100
+Subject: [PATCH] modules_k/rls: core_hash() not used correctly to distribute
+ notifier traffic
+
+- Found and fixed by Hugh Waite @ Crocodile RCS Ltd
+(cherry picked from commit 5235a1d6218e0bb16f6c9998789864635f54d03e)
+---
+ modules_k/rls/resource_notify.c | 4 ++--
+ modules_k/rls/rls_db.c | 4 ++--
+ modules_k/rls/subscribe.c | 4 ++--
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/modules_k/rls/resource_notify.c b/modules_k/rls/resource_notify.c
+index 9c757ad..89f4e4f 100644
+--- a/modules_k/rls/resource_notify.c
++++ b/modules_k/rls/resource_notify.c
+@@ -720,9 +720,9 @@ int rls_handle_notify(struct sip_msg* msg, char* c1, char* c2)
+ query_vals[n_query_cols].nul = 0;
+ if (dbmode == RLS_DB_ONLY)
+ query_vals[n_query_cols].val.int_val=
+- core_hash(res_id, NULL,
++ core_hash(res_id, NULL, 0) %
+ (waitn_time * rls_notifier_poll_rate
+- * rls_notifier_processes) - 1);
++ * rls_notifier_processes);
+ else
+ query_vals[n_query_cols].val.int_val = UPDATED_TYPE;
+ n_query_cols++;
+diff --git a/modules_k/rls/rls_db.c b/modules_k/rls/rls_db.c
+index 97ac7d6..5728a2f 100644
+--- a/modules_k/rls/rls_db.c
++++ b/modules_k/rls/rls_db.c
+@@ -174,8 +174,8 @@ int delete_expired_subs_rlsdb( void )
+ LM_ERR("cannot build rls subs did\n");
+ goto error;
+ }
+- subs.updated = core_hash(&rlsubs_did, NULL,
+- (waitn_time * rls_notifier_poll_rate * rls_notifier_processes) - 1);
++ subs.updated = core_hash(&rlsubs_did, NULL, 0) %
++ (waitn_time * rls_notifier_poll_rate * rls_notifier_processes);
+
+ n_query_cols = 0;
+
+diff --git a/modules_k/rls/subscribe.c b/modules_k/rls/subscribe.c
+index c9577de..1126762 100644
+--- a/modules_k/rls/subscribe.c
++++ b/modules_k/rls/subscribe.c
+@@ -586,8 +586,8 @@ int rls_handle_subscribe(struct sip_msg* msg, str watcher_user, str watcher_doma
+ LM_ERR("cannot build rls subs did\n");
+ goto error;
+ }
+- subs.updated = core_hash(&rlsubs_did, NULL,
+- (waitn_time * rls_notifier_poll_rate * rls_notifier_processes) - 1);
++ subs.updated = core_hash(&rlsubs_did, NULL, 0) %
++ (waitn_time * rls_notifier_poll_rate * rls_notifier_processes);
+
+ if(get_to(msg)->tag_value.s==NULL || get_to(msg)->tag_value.len==0)
+ { /* initial Subscribe */
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0048-modules_k-rls-Fixed-issues-with-for-loops-in-DB-only.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0048-modules_k-rls-Fixed-issues-with-for-loops-in-DB-only.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0048-modules_k-rls-Fixed-issues-with-for-loops-in-DB-only.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0048-modules_k-rls-Fixed-issues-with-for-loops-in-DB-only.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,72 @@
+From 0c5d596371712e98b2b59fe6b3b0911f2252fcd0 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Tue, 11 Sep 2012 13:08:38 +0100
+Subject: [PATCH] modules_k/rls: Fixed issues with for() loops in DB only mode
+
+- Found and fixed by Hugh Waite @ Crocodile RCS Ltd
+(cherry picked from commit 7b64e538b350ebd520b80f668045b9f3c7d68fb9)
+---
+ modules_k/rls/rls_db.c | 15 +++++++++------
+ modules_k/rls/subscribe.c | 2 +-
+ 2 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/modules_k/rls/rls_db.c b/modules_k/rls/rls_db.c
+index 5728a2f..938f3b7 100644
+--- a/modules_k/rls/rls_db.c
++++ b/modules_k/rls/rls_db.c
+@@ -121,7 +121,7 @@ int delete_expired_subs_rlsdb( void )
+ db1_res_t *result = NULL;
+ int n_query_cols = 0, n_result_cols = 0;
+ int r_callid_col = 0, r_to_tag_col = 0, r_from_tag_col = 0;
+- int i;
++ int i, nr_rows;
+ subs_t subs;
+ str rlsubs_did = {0, 0};
+
+@@ -157,10 +157,13 @@ int delete_expired_subs_rlsdb( void )
+
+ if(result == NULL) goto error;
+
+- for (i = 0; i <RES_ROW_N(result); i++)
++ rows = RES_ROWS(result);
++ nr_rows = RES_ROW_N(result);
++
++ for (i = 0; i < nr_rows; i++)
+ {
+- rows = RES_ROWS(result);
+- values = ROW_VALUES(rows);
++ memset(&subs, 0, sizeof(subs_t));
++ values = ROW_VALUES(&rows[i]);
+
+ subs.callid.s = (char *) VAL_STRING(&values[r_callid_col]);
+ subs.callid.len = strlen(subs.callid.s);
+@@ -415,11 +418,11 @@ int update_all_subs_rlsdb(str *watcher_user, str *watcher_domain, str *evt)
+
+ nr_rows = RES_ROW_N(result);
+
++ rows = RES_ROWS(result);
+ /* get the results and fill in return data structure */
+ for (loop=0; loop <nr_rows; loop++)
+ {
+- rows = RES_ROWS(result);
+- values = ROW_VALUES(rows);
++ values = ROW_VALUES(&rows[loop]);
+
+ size= sizeof(subs_t) +
+ ( strlen(VAL_STRING(values+r_pres_uri_col))
+diff --git a/modules_k/rls/subscribe.c b/modules_k/rls/subscribe.c
+index 1126762..9b7f31d 100644
+--- a/modules_k/rls/subscribe.c
++++ b/modules_k/rls/subscribe.c
+@@ -327,7 +327,7 @@ int reply_200(struct sip_msg* msg, str* contact, int expires)
+ LM_ERR("no more pkg memory\n");
+ return -1;
+ }
+- hdr_append.len = sprintf(hdr_append.s, "Expires: %d\r\n", expires);
++ hdr_append.len = sprintf(hdr_append.s, "Expires: %d\r\n", expires);
+ if(hdr_append.len< 0)
+ {
+ LM_ERR("unsuccessful sprintf\n");
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0049-modules_k-rls-Improved-check-for-expired-subscriptio.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0049-modules_k-rls-Improved-check-for-expired-subscriptio.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0049-modules_k-rls-Improved-check-for-expired-subscriptio.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0049-modules_k-rls-Improved-check-for-expired-subscriptio.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,41 @@
+From 3f540459b566641200e129c0c03ab26e6944fbdf Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Tue, 11 Sep 2012 13:09:22 +0100
+Subject: [PATCH] modules_k/rls: Improved check for expired subscriptions in
+ DB only mode (cherry picked from commit
+ af8230b1ac6a88dfb10d567e784a3c39a8f1b863)
+
+---
+ modules_k/rls/rls_db.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/modules_k/rls/rls_db.c b/modules_k/rls/rls_db.c
+index 938f3b7..0e72991 100644
+--- a/modules_k/rls/rls_db.c
++++ b/modules_k/rls/rls_db.c
+@@ -116,7 +116,7 @@ int delete_expired_subs_rlsdb( void )
+ {
+ db_key_t query_cols[3], result_cols[3], update_cols[1];
+ db_val_t query_vals[3], update_vals[1], *values;
+- db_op_t query_ops[1];
++ db_op_t query_ops[2];
+ db_row_t *rows;
+ db1_res_t *result = NULL;
+ int n_query_cols = 0, n_result_cols = 0;
+@@ -144,6 +144,13 @@ int delete_expired_subs_rlsdb( void )
+ query_ops[n_query_cols]= OP_LT;
+ n_query_cols++;
+
++ query_cols[n_query_cols]= &str_updated_col;
++ query_vals[n_query_cols].type = DB1_INT;
++ query_vals[n_query_cols].nul = 0;
++ query_vals[n_query_cols].val.int_val= NO_UPDATE_TYPE;
++ query_ops[n_query_cols]= OP_EQ;
++ n_query_cols++;
++
+ result_cols[r_callid_col=n_result_cols++] = &str_callid_col;
+ result_cols[r_to_tag_col=n_result_cols++] = &str_to_tag_col;
+ result_cols[r_from_tag_col=n_result_cols++] = &str_from_tag_col;
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0050-modules_k-rls-Fixed-segmentation-fault-when-uploadin.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0050-modules_k-rls-Fixed-segmentation-fault-when-uploadin.patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0050-modules_k-rls-Fixed-segmentation-fault-when-uploadin.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0050-modules_k-rls-Fixed-segmentation-fault-when-uploadin.patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,86 @@
+From 28aec07bcf81ab83d9b7af03de792cb66cf0ca3f Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Tue, 11 Sep 2012 13:10:08 +0100
+Subject: [PATCH] modules_k/rls: Fixed segmentation fault when uploading new
+ contact lists for a logged in subscriber
+
+- Found and fixed by Hugh Waite @ Crocodile RCS Ltd
+(cherry picked from commit 6924912be955b9f7ba47fd57b22ffe0c01eb68b2)
+---
+ modules_k/rls/subscribe.c | 29 ++++++++---------------------
+ 1 file changed, 8 insertions(+), 21 deletions(-)
+
+diff --git a/modules_k/rls/subscribe.c b/modules_k/rls/subscribe.c
+index 9b7f31d..8422f78 100644
+--- a/modules_k/rls/subscribe.c
++++ b/modules_k/rls/subscribe.c
+@@ -69,9 +69,6 @@ int resource_subscriptions(subs_t* subs, xmlNodePtr rl_node);
+ int update_rlsubs( subs_t* subs,unsigned int hash_code);
+ int remove_expired_rlsubs( subs_t* subs,unsigned int hash_code);
+
+-list_entry_t *rls_contact_list = NULL;
+-list_entry_t *rls_subs_list = NULL;
+-
+ /**
+ * return the XML node for rls-services matching uri
+ */
+@@ -920,7 +917,9 @@ int send_resource_subs(char* uri, void* param)
+ str pres_uri, *tmp_str;
+ struct sip_uri parsed_pres_uri;
+ int duplicate = 0;
+- subs_info_t *s = (subs_info_t *) param;
++
++ subs_info_t *s = (subs_info_t *) ((void**)param)[0];
++ list_entry_t **rls_contact_list = (list_entry_t **) ((void**)param)[1];
+
+ pres_uri.s = uri;
+ pres_uri.len = strlen(uri);
+@@ -962,7 +961,7 @@ int send_resource_subs(char* uri, void* param)
+ }
+ memcpy(tmp_str->s, pres_uri.s, pres_uri.len);
+ tmp_str->len = pres_uri.len;
+- rls_contact_list = list_insert(tmp_str, rls_contact_list, &duplicate);
++ *rls_contact_list = list_insert(tmp_str, *rls_contact_list, &duplicate);
+ if (duplicate != 0)
+ {
+ LM_WARN("%.*s has %.*s multiple times in the same resource list\n",
+@@ -984,6 +983,9 @@ int resource_subscriptions(subs_t* subs, xmlNodePtr xmlnode)
+ str extra_headers;
+ str did_str= {0, 0};
+ str *tmp_str;
++ list_entry_t *rls_contact_list = NULL;
++ list_entry_t *rls_subs_list = NULL;
++ void* params[2] = {&s, &rls_contact_list};
+
+ /* if is initial send an initial Subscribe
+ * else search in hash table for a previous subscription */
+@@ -1024,25 +1026,10 @@ int resource_subscriptions(subs_t* subs, xmlNodePtr xmlnode)
+
+ s.internal_update_flag = subs->internal_update_flag;
+
+- if (rls_contact_list != NULL)
+- {
+- LM_WARN("contact list is not empty\n");
+- list_free(&rls_contact_list);
+- }
+-
+- if (subs->internal_update_flag == INTERNAL_UPDATE_TRUE)
+- {
+- if (rls_subs_list != NULL)
+- {
+- LM_WARN("subscriber list is not empty\n");
+- list_free(&rls_subs_list);
+- }
+- }
+-
+ counter = 0;
+
+ if(process_list_and_exec(xmlnode, subs->watcher_user, subs->watcher_domain,
+- send_resource_subs, (void*)(&s))<0)
++ send_resource_subs, params)<0)
+ {
+ LM_ERR("while processing list\n");
+ goto error;
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0051-modules_k-pua-Adjusted-locking-for-dialog-insertion..patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0051-modules_k-pua-Adjusted-locking-for-dialog-insertion..patch?rev=9950&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0051-modules_k-pua-Adjusted-locking-for-dialog-insertion..patch (added)
+++ kamailio/trunk/debian/patches/upstream/0051-modules_k-pua-Adjusted-locking-for-dialog-insertion..patch Wed Sep 12 06:35:41 2012
@@ -1,0 +1,145 @@
+From 91e8cb4bf7456eeebefa96269887f6aae46626d3 Mon Sep 17 00:00:00 2001
+From: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
+Date: Tue, 11 Sep 2012 13:23:23 +0100
+Subject: [PATCH] modules_k/pua: Adjusted locking for dialog insertion.
+ Candidate fix for "temporary dialog" error reported by Juha
+ (cherry picked from commit
+ b0d642016cca83c519ea9aa0e04aa9bf353e07e4)
+
+---
+ modules_k/pua/hash.c | 18 +++---------------
+ modules_k/pua/hash.h | 3 ++-
+ modules_k/pua/pua.c | 7 ++++++-
+ modules_k/pua/send_publish.c | 4 +++-
+ modules_k/pua/send_subscribe.c | 6 ++----
+ 5 files changed, 16 insertions(+), 22 deletions(-)
+
+diff --git a/modules_k/pua/hash.c b/modules_k/pua/hash.c
+index 1fa6149..9ad169b 100644
+--- a/modules_k/pua/hash.c
++++ b/modules_k/pua/hash.c
+@@ -235,7 +235,7 @@ void update_htable(ua_pres_t* p, time_t desired_expires, int expires,
+ }
+ }
+ /* insert in front; so when searching the most recent result is returned*/
+-void _insert_htable(ua_pres_t* presentity, unsigned int hash_code)
++void insert_htable(ua_pres_t* presentity, unsigned int hash_code)
+ {
+ ua_pres_t* p= NULL;
+
+@@ -253,18 +253,6 @@ void _insert_htable(ua_pres_t* presentity, unsigned int hash_code)
+ p->next= presentity;
+ }
+
+-void insert_htable(ua_pres_t* presentity)
+-{
+- unsigned int hash_code;
+-
+- hash_code= core_hash(presentity->pres_uri,presentity->watcher_uri, HASH_SIZE);
+- lock_get(&HashT->p_records[hash_code].lock);
+-
+- _insert_htable(presentity, hash_code);
+-
+- lock_release(&HashT->p_records[hash_code].lock);
+-}
+-
+ /* This function used to perform a search to find the hash table
+ entry that matches the presentity it is passed. However,
+ everywhere it is used it is passed a pointer to the correct
+@@ -349,7 +337,7 @@ int convert_temporary_dialog(ua_pres_t *dialog)
+ else
+ return -1;
+
+- _insert_htable(dialog, hash_code);
++ insert_htable(dialog, hash_code);
+
+ lock_release(&HashT->p_records[hash_code].lock);
+
+@@ -695,4 +683,4 @@ list_entry_t *get_subs_list(str *did)
+ }
+ done:
+ return list;
+-}
+\ No newline at end of file
++}
+diff --git a/modules_k/pua/hash.h b/modules_k/pua/hash.h
+index 61ccd54..9912eba 100644
+--- a/modules_k/pua/hash.h
++++ b/modules_k/pua/hash.h
+@@ -116,7 +116,8 @@ htable_t* new_htable(void);
+
+ ua_pres_t* search_htable(ua_pres_t* pres, unsigned int hash_code);
+
+-void insert_htable(ua_pres_t* presentity );
++void insert_htable(ua_pres_t* presentity, unsigned int hash_code);
++
+
+ void update_htable(ua_pres_t* presentity,time_t desired_expires,
+ int expires, str* etag, unsigned int hash_code, str* contact);
+diff --git a/modules_k/pua/pua.c b/modules_k/pua/pua.c
+index 2297219..8734d35 100644
+--- a/modules_k/pua/pua.c
++++ b/modules_k/pua/pua.c
+@@ -391,6 +391,7 @@ static int db_restore(void)
+ int watcher_col,callid_col,totag_col,fromtag_col,cseq_col,remote_contact_col;
+ int event_col,contact_col,tuple_col,record_route_col, extra_headers_col;
+ int version_col;
++ unsigned int hash_code;
+
+ if (dbmode==PUA_DB_ONLY)
+ {
+@@ -643,7 +644,11 @@ static int db_restore(void)
+ }
+
+ print_ua_pres(p);
+- insert_htable(p);
++
++ hash_code= core_hash(p->pres_uri, p->watcher_uri, HASH_SIZE);
++ lock_get(&HashT->p_records[hash_code].lock);
++ insert_htable(p, hash_code);
++ lock_release(&HashT->p_records[hash_code].lock);
+ }
+
+ } while((db_fetch_next(&pua_dbf, pua_fetch_rows, pua_db, &res)==1)
+diff --git a/modules_k/pua/send_publish.c b/modules_k/pua/send_publish.c
+index 97935c1..4273495 100644
+--- a/modules_k/pua/send_publish.c
++++ b/modules_k/pua/send_publish.c
+@@ -422,7 +422,9 @@ void publ_cback_func(struct cell *t, int type, struct tmcb_params *ps)
+ }
+ else
+ {
+- insert_htable(presentity);
++ lock_get(&HashT->p_records[hash_code].lock);
++ insert_htable(presentity, hash_code);
++ lock_release(&HashT->p_records[hash_code].lock);
+ }
+ LM_DBG("***Inserted in hash table\n");
+
+diff --git a/modules_k/pua/send_subscribe.c b/modules_k/pua/send_subscribe.c
+index 89a8141..c1476cd 100644
+--- a/modules_k/pua/send_subscribe.c
++++ b/modules_k/pua/send_subscribe.c
+@@ -1011,9 +1011,6 @@ int send_subscribe(subs_info_t* subs)
+ int size;
+ insert:
+
+- if (dbmode!=PUA_DB_ONLY)
+- lock_release(&HashT->p_records[hash_code].lock);
+-
+ if (subs->expires == 0)
+ /* Don't create a new dialog when expires == 0 */
+ goto done;
+@@ -1123,7 +1120,8 @@ insert:
+ }
+ else
+ {
+- insert_htable(presentity);
++ insert_htable(presentity, hash_code);
++ lock_release(&HashT->p_records[hash_code].lock);
+ }
+
+ uac_r.dialog->rem_target.s = 0;
+--
+1.7.9.5
+
More information about the Pkg-voip-commits
mailing list