Module: kamailio
Branch: master
Commit: d6a374d707f23afddfc007edfeae40b01836b3c0
URL:
https://github.com/kamailio/kamailio/commit/d6a374d707f23afddfc007edfeae40b…
Author: Alex Hermann <alex(a)hexla.nl>
Committer: Alex Hermann <alex(a)hexla.nl>
Date: 2017-09-22T11:56:53+02:00
cfgutils: Properly handle 'exit' when from route_if_exists()
exit is supposed to exit the routing script. route_if_exists() wasn't
handling the exit, so script would continue to run after 'exit'.
---
Modified: src/modules/cfgutils/cfgutils.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d6a374d707f23afddfc007edfeae40b…
Patch:
https://github.com/kamailio/kamailio/commit/d6a374d707f23afddfc007edfeae40b…
---
diff --git a/src/modules/cfgutils/cfgutils.c b/src/modules/cfgutils/cfgutils.c
index d8828ce574..c2fc404c56 100644
--- a/src/modules/cfgutils/cfgutils.c
+++ b/src/modules/cfgutils/cfgutils.c
@@ -818,9 +818,13 @@ static int w_route_exists(struct sip_msg *msg, char *route)
}
backup_rt = get_route_type();
set_route_type(REQUEST_ROUTE);
+
init_run_actions_ctx(&ctx);
ret = run_top_route(main_rt.rlist[newroute], msg, &ctx);
set_route_type(backup_rt);
+ if (ctx.run_flags & EXIT_R_F) {
+ return 0;
+ }
return ret;
}