Module: sip-router
Branch: 3.1
Commit: 084da0afc666fef6f92c00754bbfb3c192751ff6
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=084da0a…
Author: Timo Reimann <timo.reimann(a)1und1.de>
Committer: Timo Reimann <timo.reimann(a)1und1.de>
Date: Thu Aug 25 13:26:32 2011 +0200
modules_k/dialog: Provide in-code documentation for tricky part in
dlg_new_dialog().
(cherry picked from commit d903b7707d1f9c5ecb4110de9ab9d8a573a6f8cd)
---
modules_k/dialog/dlg_handlers.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/modules_k/dialog/dlg_handlers.c b/modules_k/dialog/dlg_handlers.c
index 3942b44..471f470 100644
--- a/modules_k/dialog/dlg_handlers.c
+++ b/modules_k/dialog/dlg_handlers.c
@@ -796,10 +796,14 @@ finish:
ref_dlg(dlg, 1);
if (t) {
+ // transaction exists ==> keep ref counter large enough to
+ // avoid premature cleanup and ensure proper dialog referencing
store_dlg_in_tm( msg, t, dlg);
}
else
{
+ // no transaction exists ==> postpone work until we see the
+ // request being forwarded statefully
if ( d_tmb.register_tmcb( msg, NULL, TMCB_REQUEST_FWDED,
store_dlg_in_tm_cb, (void*)dlg, NULL)<0 ) {
LM_ERR("failed to store dialog in transaction during dialog creation for later
reference\n");