Browse code

dialog: Delete dialog on negative ack, not tm destroy

Do what the comments say, destroy the dialog on reception of a negative ACK
instead of delaying it until the transaction is cleaned up. Keep the old
behaviour as backup for when the ACK is missing.

Alex Hermann authored on 07/08/2014 09:22:53
Showing 1 changed files
... ...
@@ -466,7 +466,7 @@ static void dlg_onreply(struct cell* t, int type, struct tmcb_params *param)
466 466
 		goto done;
467 467
 	}
468 468
 
469
-	if (type==TMCB_DESTROY)
469
+	if (type & (TMCB_DESTROY|TMCB_ACK_NEG_IN))
470 470
 		event = DLG_EVENT_TDEL;
471 471
 	else if (param->code<200)
472 472
 		event = DLG_EVENT_RPL1xx;
... ...
@@ -963,7 +963,7 @@ int dlg_set_tm_waitack(tm_cell_t *t, dlg_cell_t *dlg)
963 963
 	}
964 964
 	dlg_ref(dlg, 1);
965 965
 	if ( d_tmb.register_tmcb( NULL, t,
966
-			TMCB_DESTROY,
966
+			TMCB_DESTROY|TMCB_ACK_NEG_IN,
967 967
 			dlg_ontdestroy, (void*)iuid, dlg_iuid_sfree)<0 ) {
968 968
 		LM_ERR("failed to register TMCB to wait for negative ACK\n");
969 969
 		dlg_unref(dlg, 1);