Hi all,
I have a situation where subscriptions do not get notified and have tracked
it down to a problem with the polled notify processing. Can you advise if
this is a bug or correct my understanding of the code.
I am using kamailio 3.3.3 and have 1 notify process. I have enhanced
the support for the ua-profile event (rfc 6080) , although I don't believe
I have made any changes that directly impact the problem I am seeing.
When a new subscription arrives it is added to the active_watchers table,
the 'updated' column is assigned a number in the range 0 - N-1, where N is
effectively the total number of polled update tasks that are called in a
round-robin fashion, distributed across the notify processes. In this case
updated = 7.
In subscribe.c:
int update_subscription_notifier(struct sip_msg* msg, subs_t* subs, int
to_tag_gen, int* sent_reply)
{
...
/* Set the notifier/update fields for the subscription */
subs->updated = core_hash(&subs->callid, &subs->from_tag, 0) %
(pres_waitn_time * pres_notifier_poll_rate
* pres_notifier_processes);
The notify process periodically calls pres_timer_send_notify(), which
calculates the round (the update task number) and does the notify update by
checking the active_watchers table for entries with updated = round. The
update is done twice, first for the event then for event.winfo.
In notify.c:
void pres_timer_send_notify(unsigned int ticks, void *param)
{
int process_num = *((int *) param);
int round = subset + (pres_waitn_time * pres_notifier_poll_rate
* process_num);
if (process_dialogs(round, 0) < 0)
{
LM_ERR("Handling non presence.winfo dialogs\n");
return;
}
if (process_dialogs(round, 1) < 0)
{
LM_ERR("Handling presence.winfo dialogs\n");
return;
}
}
In this instance process_num = 0, so round = subset. However subset is
incremented in process_dialogs() in notify.c:
if (++subset > (pres_waitn_time * pres_notifier_poll_rate) -1)
subset = 0;
This means that round is incremented twice between calls to
process_dialogs(round, 0), in my case round is always even, hence not
detecting the subscription with updated = 7.
It seems that the subset increment should be done in
pres_timer_send_notify() rather than in process_dialogs(). Is this correct?
Additionally, is there a need for the second call that only handles
presence.winfo subscriptions? The code could be simplified by only making
one call and processing all subscriptions for the round.
Kind regards
Shane Harrison
--
Imagination NZ Ltd
Level 6
92 Queens Drive
P0 Box 30449
Lower Hutt 5040
+64 4 5703870 Extn 875
+64 21 608919 (mobile)
Module: sip-router
Branch: master
Commit: ebe16f75b38c76dab141ca9583b10b67e4f45f57
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ebe16f7…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)speakup.nl>
Date: Mon Jan 28 13:06:08 2013 +0100
lib/srdb1: Fix compilation warning on 32-bit architectures
On "bits-challenged" architectures, long != 64 bits.
Use long long instead, seems to work on 64-bit archs too.
---
lib/srdb1/db_ut.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/srdb1/db_ut.c b/lib/srdb1/db_ut.c
index 9942cdc..c57ef4d 100644
--- a/lib/srdb1/db_ut.c
+++ b/lib/srdb1/db_ut.c
@@ -465,7 +465,7 @@ int db_val2pv_spec(struct sip_msg* msg, db_val_t *dbval, pv_spec_t *pvs)
db_longlong2str(dbval->val.ll_val, ll_buf, &pv.rs.len);
pv.rs.s = ll_buf;
/* if it fits, also store as 32 bit integer*/
- if (! ((unsigned long)dbval->val.ll_val & 0xffffffff00000000)) {
+ if (! ((unsigned long long)dbval->val.ll_val & 0xffffffff00000000ULL)) {
pv.flags |= PV_VAL_INT | PV_TYPE_INT;
pv.ri = (int)dbval->val.ll_val;
}
Module: sip-router
Branch: master
Commit: a21750ff6fcf87d8e3f54597bdd3f1171846e6cb
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a21750f…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)speakup.nl>
Date: Mon Jan 28 13:08:02 2013 +0100
modules/sqlops: Check if pv_spec is available before trying to use it.
Instead of segfaulting when the script writer has not specified enough PV
specs to hold all the query's result columns, bail out with an error message.
---
modules/sqlops/sql_api.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/modules/sqlops/sql_api.c b/modules/sqlops/sql_api.c
index 06bd35a..b5ce758 100644
--- a/modules/sqlops/sql_api.c
+++ b/modules/sqlops/sql_api.c
@@ -569,6 +569,10 @@ int sql_do_pvquery(struct sip_msg *msg, sql_con_t *con, pv_elem_t *query,
pv = res;
for(j=0; j<RES_COL_N(db_res); j++)
{
+ if (pv == NULL) {
+ LM_ERR("Missing pv spec for column %d\n", j+1);
+ goto error;
+ }
if (db_val2pv_spec(msg, &RES_ROWS(db_res)[0].values[j], &pv->sname) != 0) {
LM_ERR("Failed to convert value for column %.*s\n",
RES_NAMES(db_res)[j]->len, RES_NAMES(db_res)[j]->s);
i got this on linux i386 architecture:
db_ut.c: In function ‘db_val2pv_spec’:
db_ut.c:468: warning: integer constant is too large for ‘long’ type
please fix.
-- juha
Module: sip-router
Branch: master
Commit: e59acd4d006e5048610e75f2cfc2df30b2f7c968
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e59acd4…
Author: Olle E. Johansson <oej(a)edvina.net>
Committer: Olle E. Johansson <oej(a)edvina.net>
Date: Sun Jan 27 14:33:13 2013 +0100
tls Update README with RPC commands
The selects are still missing.
---
modules/tls/README | 52 ++++++++++++++++++++++++++-----
modules/tls/doc/functions.xml | 4 +--
modules/tls/doc/rpc.xml | 68 +++++++++++++++++++++++++++++++++++++++++
modules/tls/doc/tls.xml | 6 +--
4 files changed, 115 insertions(+), 15 deletions(-)
diff --git a/modules/tls/README b/modules/tls/README
index 2c71e71..a0c5d68 100644
--- a/modules/tls/README
+++ b/modules/tls/README
@@ -52,7 +52,14 @@ Andrei Pelinescu-Onciul
1.10.1. is_peer_verified()
- 1.11. History
+ 1.11. RPC Commands
+
+ 1.11.1. tls.info
+ 1.11.2. tls.list
+ 1.11.3. tls.options
+ 1.11.4. tls.reload
+
+ 1.12. History
1.1. Overview
@@ -197,12 +204,9 @@ make -C modules/tls extra_defs="-DTLS_WR_DEBUG -DTLS_RD_DEBUG"
TLS specific config reloading is not safe, so for now better don't use
it, especially under heavy traffic.
- This documentation is incomplete. The RPCs are not documented here, but
- in doc/rpc_list/rpc_tls.txt or
- http://sip-router.org/docbook/sip-router/branch/master/rpc_list/rpc_lis
- t.html#rpc_exports.tls. The provided selects are not documented. A list
- with all the ones implemented by the tls module can be seen under
- doc/select_list/select_tls.txt or or
+ This documentation is incomplete. The provided selects are not
+ documented. A list with all the ones implemented by the TLS module can
+ be seen under doc/select_list/select_tls.txt or or
http://sip-router.org/docbook/sip-router/branch/master/select_list/sele
ct_list.html#select_list.tls.
@@ -1017,7 +1021,39 @@ modparam("tls", "config", "/usr/local/etc/ser/tls.cfg")
drop;
}
-1.11. History
+1.11. RPC Commands
+
+1.11.1. tls.info
+
+ List internal information related to the TLS module in a short list -
+ max connections, opened connections and the write queue size.
+
+ Parameters:
+ * None.
+
+1.11.2. tls.list
+
+ List details about all active TLS connections.
+
+ Parameters:
+ * None.
+
+1.11.3. tls.options
+
+ List the current TLS configuration.
+
+ Parameters:
+ * None.
+
+1.11.4. tls.reload
+
+ Reload the external TLS configuration file. (Does not reload modparam()
+ parameters)
+
+ Parameters:
+ * None.
+
+1.12. History
This module was put together by Jan Janak <jan(a)iptel.org> from code
from the experimental tls core addon
diff --git a/modules/tls/doc/functions.xml b/modules/tls/doc/functions.xml
index 7e8b1c7..fc0369e 100644
--- a/modules/tls/doc/functions.xml
+++ b/modules/tls/doc/functions.xml
@@ -8,7 +8,7 @@
]>
-<section id="textops.functions">
+<section id="tls.functions">
<sectioninfo>
</sectioninfo>
@@ -32,6 +32,4 @@
</programlisting>
</example>
</section>
-
-
</section>
diff --git a/modules/tls/doc/rpc.xml b/modules/tls/doc/rpc.xml
new file mode 100644
index 0000000..940dbbf
--- /dev/null
+++ b/modules/tls/doc/rpc.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+
+<!-- Include general documentation entities -->
+<!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
+%docentities;
+
+]>
+
+<section id="tls.rpc">
+ <sectioninfo>
+ </sectioninfo>
+ <title>RPC Commands</title>
+ <section id="tls.info">
+ <title><function>tls.info</function></title>
+ <para>
+ List internal information related to the TLS module in
+ a short list - max connections, opened connections and the
+ write queue size.
+ </para>
+ <para>Parameters: </para>
+ <itemizedlist>
+ <listitem><para>
+ None.
+ </para></listitem>
+ </itemizedlist>
+ </section>
+ <section id="tls.list">
+ <title><function>tls.list</function></title>
+ <para>
+ List details about all active TLS connections.
+ </para>
+ <para>Parameters: </para>
+ <itemizedlist>
+ <listitem><para>
+ None.
+ </para></listitem>
+ </itemizedlist>
+ </section>
+ <section id="tls.options">
+ <title><function>tls.options</function></title>
+ <para>
+ List the current TLS configuration.
+ </para>
+ <para>Parameters: </para>
+ <itemizedlist>
+ <listitem><para>
+ None.
+ </para></listitem>
+ </itemizedlist>
+ </section>
+ <section id="tls.reload">
+ <title><function>tls.reload</function></title>
+ <para>
+ Reload the external TLS configuration file. (Does not reload
+ modparam() parameters)
+ </para>
+ <para>Parameters: </para>
+ <itemizedlist>
+ <listitem><para>
+ None.
+ </para></listitem>
+ </itemizedlist>
+ </section>
+
+
+</section>
diff --git a/modules/tls/doc/tls.xml b/modules/tls/doc/tls.xml
index 4b5cc8d..2157369 100644
--- a/modules/tls/doc/tls.xml
+++ b/modules/tls/doc/tls.xml
@@ -168,11 +168,8 @@ make -C modules/tls extra_defs="-DTLS_WR_DEBUG -DTLS_RD_DEBUG"
</para>
<para>
This documentation is incomplete.
- The RPCs are not documented here, but in doc/rpc_list/rpc_tls.txt
- or <ulink url="http://sip-router.org/docbook/sip-router/branch/master/rpc_list/rpc_list.ht…">
- http://sip-router.org/docbook/sip-router/branch/master/rpc_list/rpc_list.ht…</ulink>.
The provided selects are not documented. A list with all the
- ones implemented by the tls module can be seen under
+ ones implemented by the TLS module can be seen under
doc/select_list/select_tls.txt or
or <ulink url="http://sip-router.org/docbook/sip-router/branch/master/select_list/select_l…">
http://sip-router.org/docbook/sip-router/branch/master/select_list/select_l…</ulink>.
@@ -182,6 +179,7 @@ make -C modules/tls extra_defs="-DTLS_WR_DEBUG -DTLS_RD_DEBUG"
<xi:include href="certs_howto.xml"/>
<xi:include href="params.xml"/>
<xi:include href="functions.xml"/>
+ <xi:include href="rpc.xml"/>
<xi:include href="history.xml"/>
</section>
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Paul Belanger (pabelanger)
Attached to Project - sip-router
Summary - Add your GPG key to a public key server
Task Type - Improvement
Category - Core
Status - Unconfirmed
Assigned To -
Operating System - All
Severity - Low
Priority - Normal
Reported Version - Development
Due in Version - Undecided
Due Date - Undecided
Details - Please add your GPG key[1] for Debian packages, to a public key server[2].
[1] wget http://deb.kamailio.org/kamailiodebkey.gpg
[2] pgp.mit.edu
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=266
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.