Ver código fonte

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

- remove unnecessary reset of current dialog pointer added previously,
  spotted by Timo Reimann
Daniel-Constantin Mierla 14 anos atrás
pai
commit
f4b7f30172

+ 1 - 1
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) {

+ 1 - 5
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);

+ 2 - 2
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 */