[sr-dev] git:master: dialog: backup and restore exiting route type when executing dialog event_route blocks

Daniel-Constantin Mierla miconda at gmail.com
Fri Jun 13 12:01:54 CEST 2014


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Fri Jun 13 12:00:21 2014 +0200

dialog: backup and restore exiting route type when executing dialog event_route blocks

- reported by Nuno Miguel Reis

---

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

diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c
index 8e7b967..f92b1bb 100644
--- a/modules/dialog/dlg_handlers.c
+++ b/modules/dialog/dlg_handlers.c
@@ -1457,6 +1457,7 @@ void dlg_run_event_route(dlg_cell_t *dlg, sip_msg_t *msg, int ostate, int nstate
 {
 	sip_msg_t *fmsg;
 	int rt;
+	int bkroute;
 
 	if(dlg==NULL)
 		return;
@@ -1486,11 +1487,13 @@ void dlg_run_event_route(dlg_cell_t *dlg, sip_msg_t *msg, int ostate, int nstate
 		dlg_ref(dlg, 1);
 		dlg_set_ctx_iuid(dlg);
 		LM_DBG("executing event_route %d on state %d\n", rt, nstate);
+		bkroute = get_route_type();
 		set_route_type(LOCAL_ROUTE);
 		run_top_route(event_rt.rlist[rt], fmsg, 0);
 		dlg_reset_ctx_iuid();
 		exec_post_script_cb(fmsg, LOCAL_CB_TYPE);
 		dlg_unref(dlg, 1);
+		set_route_type(bkroute);
 	}
 }
 




More information about the sr-dev mailing list