Explorar el Código

dialog: add wait-for-ack callback before response unref

- in case of a sipral for ending in a negative response from initial
  state, ack to second iteration can unref prematurely the dialog
- reported by Pawel Sternal, FS#427
Daniel-Constantin Mierla hace 11 años
padre
commit
d81fd1bf06
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      modules/dialog/dlg_handlers.c

+ 2 - 2
modules/dialog/dlg_handlers.c

@@ -544,6 +544,8 @@ static void dlg_onreply(struct cell* t, int type, struct tmcb_params *param)
 		LM_DBG("dialog %p failed (negative reply)\n", dlg);
 		/* dialog setup not completed (3456XX) */
 		run_dlg_callbacks( DLGCB_FAILED, dlg, req, rpl, DLG_DIR_UPSTREAM, 0);
+		if(dlg_wait_ack==1)
+			dlg_set_tm_waitack(t, dlg);
 		/* do unref */
 		if (unref)
 			dlg_unref(dlg, unref);
@@ -552,8 +554,6 @@ static void dlg_onreply(struct cell* t, int type, struct tmcb_params *param)
 
 		if_update_stat(dlg_enable_stats, failed_dlgs, 1);
 
-		if(dlg_wait_ack==1)
-			dlg_set_tm_waitack(t, dlg);
 		goto done;
 	}