[sr-dev] git:master: dialog: add wait-for-ack callback before response unref

Daniel-Constantin Mierla miconda at gmail.com
Mon May 19 09:01:40 CEST 2014


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Mon May 19 08:56:38 2014 +0200

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

---

 modules/dialog/dlg_handlers.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c
index eebe30b..aaa1ab79 100644
--- a/modules/dialog/dlg_handlers.c
+++ b/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;
 	}
 




More information about the sr-dev mailing list