Bläddra i källkod

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

(cherry picked from commit d81fd1bf067b78b55ad348db2531c4ba9b10dddb)
(cherry picked from commit 642428cf8be1c7355f91b14276e888ec505cd69a)
Daniel-Constantin Mierla 11 år sedan
förälder
incheckning
a436b49a4d
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      modules/dialog/dlg_handlers.c

+ 2 - 2
modules/dialog/dlg_handlers.c

@@ -543,6 +543,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);
@@ -551,8 +553,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;
 	}