[asterisk-commits] mvanbaak: branch mvanbaak/privacymanager_check_context r121077 - /team/mvanba...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jun 7 04:54:54 CDT 2008


Author: mvanbaak
Date: Sat Jun  7 04:54:53 2008
New Revision: 121077

URL: http://svn.digium.com/view/asterisk?view=rev&rev=121077
Log:
another redo of the code.
Only one thing left to figure out:
ast_exists_extension _ALWAYS_ returns 0 and I have no idea why

Modified:
    team/mvanbaak/privacymanager_check_context/apps/app_privacy.c

Modified: team/mvanbaak/privacymanager_check_context/apps/app_privacy.c
URL: http://svn.digium.com/view/asterisk/team/mvanbaak/privacymanager_check_context/apps/app_privacy.c?view=diff&rev=121077&r1=121076&r2=121077
==============================================================================
--- team/mvanbaak/privacymanager_check_context/apps/app_privacy.c (original)
+++ team/mvanbaak/privacymanager_check_context/apps/app_privacy.c Sat Jun  7 04:54:53 2008
@@ -73,8 +73,8 @@
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(maxretries);
 		AST_APP_ARG(minlength);
+		AST_APP_ARG(options);
 		AST_APP_ARG(checkcontext);
-		AST_APP_ARG(options);
 	);
 
 	if (!ast_strlen_zero(chan->cid.cid_num)) {
@@ -127,10 +127,18 @@
 
 			/* Make sure we get at least digits */
 			if (strlen(phone) >= minlength ) {
+				/* if we have a checkcontext argument, do pattern matching */
 				if (!ast_strlen_zero(args.checkcontext)) {
+					ast_log(LOG_WARNING, "Going to check context %s for exten %s prio 1\n", args.checkcontext, phone);
 					res = ast_exists_extension(NULL, args.checkcontext, phone, 1, NULL);
-					if (res)
+					if (res) {
 						break;
+					} else {
+						res = ast_streamfile(chan, "privacy-incorrect", chan->language);
+						if (!res) {
+							res = ast_waitstream(chan, "");
+						}
+					}
 				} else {
 					break;
 				}




More information about the asterisk-commits mailing list