浏览代码

dialog(k): Register dlg_tmcb_dummy in dialog_new_dlg() even when
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().

Timo Reimann 14 年之前
父节点
当前提交
00d2d6b987
共有 1 个文件被更改,包括 4 次插入6 次删除
  1. 4 6
      modules_k/dialog/dlg_handlers.c

+ 4 - 6
modules_k/dialog/dlg_handlers.c

@@ -716,12 +716,10 @@ int dlg_new_dialog(struct sip_msg *msg, struct cell *t)
 	if (_dlg_ctx.to_bye!=0)
 	if (_dlg_ctx.to_bye!=0)
 		dlg->dflags |= DLG_FLAG_TOBYE;
 		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
 #if 0
 		t->dialog_ctx = (void*) dlg;
 		t->dialog_ctx = (void*) dlg;