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…