Module: sip-router
Branch: pd/pua_fix
Commit: b93149c756d3e983c70608938f1142ed43ee1834
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b93149c…
Author: pd <peter.dunkley(a)crocodile-rcs.com>
Committer: pd <peter.dunkley(a)crocodile-rcs.com>
Date: Thu Aug 11 17:28:19 2011 +0100
modules/tm, modules_k/pua: Fix for concurrency issue in PUA module
- It is quite possible for the mandatory NOTIFY request sent by a
presence server on establishment of a SUBSCRIBE dialog to
over-take (either on the wire or within Kamailio) the 2xx response
to the SUBSCRIBE. When this happens Kamailio outputs an error
message and does not update the rls_presentity table.
- The change to the tm module is to make t_request_outside take the
same arguments (and exhibit mostly the same behaviour) as t_request.
This is safe to do as a search of the code-base has shown that
t_request_outside was not actually used anywhere. The difference
between t_request and t_request_outside is that t_request frees the
dialog structure it creates, whereas t_request_outside leaves the
dialog structure so that the caller can use it to find things like
the Call-ID and local tag generated for the request.
The hash table implementation in pua has been modified to enable
temporary dialogs to be found (new function
get_temporary_dialog()). A temporary dialog contains the minimal
information that was available when the SUBSCRIBE request was sent.
Temporary dialogs are replaced with proper ones when a 2xx response
is received. The delete_htable() function has been updated so that
it can delete both full and temporary dialogs.
pua.c has been modified to fix a bug in db_update() - n_query_cols
was being incorrectly decremented in a certain case within a double
loop. db_update() has also been changed to cope with needing to
insert temporary (and therefore not fully filled in) dialogs into
the database.
send_subscribe.c has been modified to create temporary dialogs
whenever an initial SUBSCRIBE is sent. The SUBSCRIBE callback
function searches for and removes any temporary dialogs relating
to the transaction before it returns. In normal (non error
handling behaviour) temporary dialogs are not removed until after
a full dialog has been created and added to the hash table.
---
modules/tm/uac.c | 11 +++++-
modules/tm/uac.h | 4 +-
modules_k/pua/hash.c | 75 +++++++++++++++++++++++++++++++---------
modules_k/pua/hash.h | 1 +
modules_k/pua/pua.c | 62 +++++++++++++++++++++++++--------
modules_k/pua/send_subscribe.c | 75 ++++++++++++++++++++++++++++++++++++++-
6 files changed, 191 insertions(+), 37 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=b93…
Module: sip-router
Branch: pd/puafix
Commit: a92001d430b897e79139580d21995ec7e5d7b417
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a92001d…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Thu Aug 11 16:58:12 2011 +0200
tm: keep internal retr. intervals in ms
When using ticks to keep the retransmission intervals, any
rounding error (when converting from ms to ticks) is increased
with each doubling of the retransmission interval. In the standard
configuration this means that the last retransmission before t2
kicks in, has an error up to 4 times bigger then the initial one
(the rounding error is max. 1 tick/62.5ms for the initial interval
=> up to 250 ms for the last retransmission before t2).
By keeping the retransmission intervals in ms instead of ticks,
this problem is avoided, and the timing error is always < 1 tick
(62.5 ms) + system timer error (< 10 ms usually).
---
modules/tm/config.c | 8 ++--
modules/tm/config.h | 4 +-
modules/tm/h_table.h | 9 ++---
modules/tm/t_funcs.h | 10 +++--
modules/tm/t_lookup.c | 55 +++++++++++++++++---------------
modules/tm/timer.c | 85 ++++++++++++++++++++++++++++---------------------
modules/tm/timer.h | 60 ++++++++++++++++++----------------
modules/tm/tm.c | 4 +-
modules/tm/uac.c | 4 +-
9 files changed, 130 insertions(+), 109 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=a92…