[sr-dev] git:master: dialog: execute internal event_route blocks under local_route type

Daniel-Constantin Mierla miconda at gmail.com
Wed Jun 11 17:14:12 CEST 2014


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Wed Jun 11 17:12:37 2014 +0200

dialog: execute internal event_route blocks under local_route type

- request_route type triggers additional script callbacks that could
  reset the transaction and can cause crashing
- reported by  Nuno Miguel Reis, FS#440

---

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

diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c
index aaa1ab79..8e7b967 100644
--- a/modules/dialog/dlg_handlers.c
+++ b/modules/dialog/dlg_handlers.c
@@ -1481,15 +1481,15 @@ void dlg_run_event_route(dlg_cell_t *dlg, sip_msg_t *msg, int ostate, int nstate
 	else
 		fmsg = msg;
 
-	if (exec_pre_script_cb(fmsg, REQUEST_CB_TYPE)>0)
+	if (exec_pre_script_cb(fmsg, LOCAL_CB_TYPE)>0)
 	{
 		dlg_ref(dlg, 1);
 		dlg_set_ctx_iuid(dlg);
 		LM_DBG("executing event_route %d on state %d\n", rt, nstate);
-		set_route_type(REQUEST_ROUTE);
+		set_route_type(LOCAL_ROUTE);
 		run_top_route(event_rt.rlist[rt], fmsg, 0);
 		dlg_reset_ctx_iuid();
-		exec_post_script_cb(fmsg, REQUEST_CB_TYPE);
+		exec_post_script_cb(fmsg, LOCAL_CB_TYPE);
 		dlg_unref(dlg, 1);
 	}
 }




More information about the sr-dev mailing list