dialog(k): Register dlg_tmcb_dummy in dialog_new_dlg() even when kamailio_3.0
authorTimo Reimann <timo.reimann@1und1.de>
Mon, 7 Mar 2011 08:57:33 +0000 (09:57 +0100)
committerTimo Reimann <timo.reimann@1und1.de>
Mon, 7 Mar 2011 10:33:47 +0000 (11:33 +0100)
given transaction t is not available.

- Let tm's registration function deal with creating a transaction
  lazily.
- Facilitates using dialogs (e.g., profiling) created on demand
  with dlg_manage().
(cherry picked from commit 00d2d6b98739327a6eaaeeafa50023cf0c47b0f3)

modules_k/dialog/dlg_handlers.c

index 5e5e3c5..9bedc60 100644 (file)
@@ -629,12 +629,10 @@ int dlg_new_dialog(struct sip_msg *msg, struct cell *t)
        if (_dlg_ctx.to_bye!=0)
                dlg->dflags |= DLG_FLAG_TOBYE;
 
-       if (t) {
-               if ( d_tmb.register_tmcb( msg, t, TMCB_MAX,
-                                       dlg_tmcb_dummy, (void*)dlg, 0)<0 ) {
-                       LM_ERR("failed cache in T the shortcut to dlg\n");
-                       goto error;
-               }
+       if ( d_tmb.register_tmcb( msg, t, TMCB_MAX,
+                               dlg_tmcb_dummy, (void*)dlg, 0)<0 ) {
+               LM_ERR("failed cache in T the shortcut to dlg\n");
+               goto error;
        }
 #if 0
                t->dialog_ctx = (void*) dlg;