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

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


Module: sip-router
Branch: master
Commit: 987c8a5fbfa0f23e1211e4253e7113f4ea79b22b
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=987c8a5fbfa0f23e1211e4253e7113f4ea79b22b

Author: Timo Reimann <timo.reimann at 1und1.de>
Committer: Timo Reimann <timo.reimann at 1und1.de>
Date:   Thu Nov  3 23:10:38 2011 +0100

dialog(k): Set dialog parameters (timeout, etc.) before create callback
is executed to provide these parameters to registered functions.

---

 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 701d80c..490501b 100644
--- a/modules_k/dialog/dlg_handlers.c
+++ b/modules_k/dialog/dlg_handlers.c
@@ -828,6 +828,15 @@ int dlg_new_dialog(struct sip_msg *req, struct cell *t, const int run_initial_cb
 
 	link_dlg(dlg,0);
 
+	dlg->lifetime = get_dlg_timeout(req);
+	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 (run_initial_cbs)  run_create_callbacks( dlg, req);
 
 	/* first INVITE seen (dialog created, unconfirmed) */
@@ -840,15 +849,6 @@ int dlg_new_dialog(struct sip_msg *req, struct cell *t, const int run_initial_cb
 	/* reference it once for current_dialog_pointer */
     ref_dlg(dlg, 1);
 
-	dlg->lifetime = get_dlg_timeout(req);
-	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