[sr-dev] git:master: dialog(k): new dialogs can be created only by INVITE

Daniel-Constantin Mierla miconda at gmail.com
Sun Oct 9 12:04:06 CEST 2011


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Sun Oct  9 12:01:22 2011 +0200

dialog(k): new dialogs can be created only by INVITE

- remove unnecessary reset of current dialog pointer added previously,
  spotted by Timo Reimann

---

 modules_k/dialog/dlg_handlers.c |    2 +-
 modules_k/dialog/dlg_hash.c     |    6 +-----
 modules_k/dialog/dlg_hash.h     |    4 ++--
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/modules_k/dialog/dlg_handlers.c b/modules_k/dialog/dlg_handlers.c
index 7bfdbab..ccc95f1 100644
--- a/modules_k/dialog/dlg_handlers.c
+++ b/modules_k/dialog/dlg_handlers.c
@@ -750,7 +750,7 @@ int dlg_new_dialog(struct sip_msg *req, struct cell *t, const int run_initial_cb
     if(current_dlg_pointer != NULL)
         return -1;
 
-	if(req->first_line.u.request.method_value == METHOD_CANCEL)
+	if(req->first_line.u.request.method_value != METHOD_INVITE)
 		return -1;
 
     if(pre_match_parse( req, &callid, &ftag, &ttag, 0)<0) {
diff --git a/modules_k/dialog/dlg_hash.c b/modules_k/dialog/dlg_hash.c
index aa94b7e..a09e78f 100644
--- a/modules_k/dialog/dlg_hash.c
+++ b/modules_k/dialog/dlg_hash.c
@@ -178,7 +178,7 @@ inline void destroy_dlg(struct dlg_cell *dlg)
 	int ret = 0;
 	struct dlg_var *var;
 
-	LM_DBG("destroying dialog %p\n",dlg);
+	LM_DBG("destroying dialog %p (ref %d)\n", dlg, dlg->ref);
 
 	ret = remove_dialog_timer(&dlg->tl);
 	if (ret < 0) {
@@ -200,10 +200,6 @@ inline void destroy_dlg(struct dlg_cell *dlg)
 	run_dlg_callbacks( DLGCB_DESTROY , dlg, NULL, NULL, DLG_DIR_NONE, 0);
 
 
-	/* reset the global shortcut, if it is the case */
-	if(current_dlg_pointer == dlg)
-		current_dlg_pointer = NULL;
-
 	/* delete the dialog from DB*/
 	if (dlg_db_mode)
 		remove_dialog_from_db(dlg);
diff --git a/modules_k/dialog/dlg_hash.h b/modules_k/dialog/dlg_hash.h
index ed90d23..ecb6526 100644
--- a/modules_k/dialog/dlg_hash.h
+++ b/modules_k/dialog/dlg_hash.h
@@ -88,7 +88,7 @@
 
 
 /*! entries in the dialog list */
-struct dlg_cell
+typedef struct dlg_cell
 {
 	volatile int         ref;		/*!< reference counter */
 	struct dlg_cell      *next;		/*!< next entry in the list */
@@ -116,7 +116,7 @@ struct dlg_cell
 	struct dlg_head_cbl  cbs;		/*!< dialog callbacks */
 	struct dlg_profile_link *profile_links; /*!< dialog profiles */
 	struct dlg_var       *vars;		/*!< dialog variables */
-};
+} dlg_cell_t;
 
 
 /*! entries in the main dialog table */




More information about the sr-dev mailing list