[asterisk-commits] oej: branch oej/bufo-manager-contexts r282968 - /team/oej/bufo-manager-contex...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 20 05:29:22 CDT 2010


Author: oej
Date: Fri Aug 20 05:29:19 2010
New Revision: 282968

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=282968
Log:
Add context filter for redirect and extensionstate as well

Modified:
    team/oej/bufo-manager-contexts/main/manager.c

Modified: team/oej/bufo-manager-contexts/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/bufo-manager-contexts/main/manager.c?view=diff&rev=282968&r1=282967&r2=282968
==============================================================================
--- team/oej/bufo-manager-contexts/main/manager.c (original)
+++ team/oej/bufo-manager-contexts/main/manager.c Fri Aug 20 05:29:19 2010
@@ -1747,6 +1747,12 @@
 			return 0;
 		}
 	}
+
+	/* Check if redirect is to allowed context */
+	if (s->session->contexts && ! apply_context(s->session->contexts, context) ) {
+		astman_send_error(s, m, "Illegal context");
+		return 0;
+	}
 	/* XXX watch out, possible deadlock!!! */
 	chan = ast_get_channel_by_name_locked(name);
 	if (!chan) {
@@ -2215,6 +2221,11 @@
 	}
 	if (ast_strlen_zero(context))
 		context = "default";
+	/* Check if redirect is to allowed context */
+	if (s->session->contexts && ! apply_context(s->session->contexts, context) ) {
+		astman_send_error(s, m, "Illegal context");
+		return 0;
+	}
 	status = ast_extension_state(NULL, context, exten);
 	ast_get_hint(hint, sizeof(hint) - 1, NULL, 0, NULL, context, exten);
         if (!ast_strlen_zero(id)) {




More information about the asterisk-commits mailing list