[sr-dev] git:3.1: dialog(k): Set dialog parameters (timeout, etc.) before create callback

Timo Reimann sr at foo-lounge.de
Thu Nov 3 23:18:15 CET 2011


Module: sip-router
Branch: 3.1
Commit: 2bb8bbfa4054523a6cdf55ac59ceb2b1a515c74f
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2bb8bbfa4054523a6cdf55ac59ceb2b1a515c74f

Author: Timo Reimann <timo.reimann at 1und1.de>
Committer: Timo Reimann <sr at foo-lounge.de>
Date:   Sat Oct 22 10:55:08 2011 +0200

dialog(k): Set dialog parameters (timeout, etc.) before create callback
is executed to provide these parameters to registered functions.
(cherry picked from commit 987c8a5fbfa0f23e1211e4253e7113f4ea79b22b)

---

 modules_k/dialog/dlg_handlers.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/modules_k/dialog/dlg_handlers.c b/modules_k/dialog/dlg_handlers.c
index 89fb0b3..bc79f7b 100644
--- a/modules_k/dialog/dlg_handlers.c
+++ b/modules_k/dialog/dlg_handlers.c
@@ -730,6 +730,15 @@ int dlg_new_dialog(struct sip_msg *msg, struct cell *t)
 
 	link_dlg(dlg,0);
 
+	dlg->lifetime = get_dlg_timeout(msg);
+	s.s   = _dlg_ctx.to_route_name;
+	s.len = strlen(s.s);
+	dlg_set_toroute(dlg, &s);
+	dlg->sflags |= _dlg_ctx.flags;
+
+	if (_dlg_ctx.to_bye!=0)
+		dlg->dflags |= DLG_FLAG_TOBYE;
+
 	run_create_callbacks(dlg, msg);
 
 	/* first INVITE seen (dialog created, unconfirmed) */
@@ -748,15 +757,6 @@ int dlg_new_dialog(struct sip_msg *msg, struct cell *t)
 	// increase reference counter because of registered callback
 	ref_dlg(dlg, 1);
 
-	dlg->lifetime = get_dlg_timeout(msg);
-	s.s   = _dlg_ctx.to_route_name;
-	s.len = strlen(s.s);
-	dlg_set_toroute(dlg, &s);
-	dlg->sflags |= _dlg_ctx.flags;
-
-	if (_dlg_ctx.to_bye!=0)
-		dlg->dflags |= DLG_FLAG_TOBYE;
-
 	if_update_stat( dlg_enable_stats, processed_dlgs, 1);
 
 finish:




More information about the sr-dev mailing list