[asterisk-commits] branch murf/bug_6264-trunk - r8260 in /team/murf/bug_6264-trunk: ./ apps/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jan 19 07:37:09 MST 2006


Author: murf
Date: Thu Jan 19 08:37:07 2006
New Revision: 8260

URL: http://svn.digium.com/view/asterisk?rev=8260&view=rev
Log:
removed the svnmerge-integrated, added the changes to app_dial.c


Modified:
    team/murf/bug_6264-trunk/   (props changed)
    team/murf/bug_6264-trunk/apps/app_dial.c

Propchange: team/murf/bug_6264-trunk/
            ('svnmerge-integrated' removed)

Modified: team/murf/bug_6264-trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_6264-trunk/apps/app_dial.c?rev=8260&r1=8259&r2=8260&view=diff
==============================================================================
--- team/murf/bug_6264-trunk/apps/app_dial.c (original)
+++ team/murf/bug_6264-trunk/apps/app_dial.c Thu Jan 19 08:37:07 2006
@@ -885,7 +885,7 @@
 		l = chan->cid.cid_num;
 		if (!ast_strlen_zero(l)) {
 			ast_shrink_phone_number(l);
-			if( ast_test_flag(&opts, OPT_PRIVACY) ) {
+			if ( ast_test_flag(&opts, OPT_PRIVACY) ) {
 				if (option_verbose > 2)
 					ast_verbose(VERBOSE_PREFIX_3  "Privacy DB is '%s', clid is '%s'\n",
 						     opt_args[OPT_ARG_PRIVACY], l);
@@ -902,7 +902,7 @@
 			tnam = ast_strdupa(chan->name);
 			/* clean the channel name so slashes don't try to end up in disk file name */
 			for(tn2 = tnam; *tn2; tn2++) {
-				if( *tn2=='/')
+				if ( *tn2=='/')
 					*tn2 = '=';  /* any other chars to be afraid of? */
 			}
 			if (option_verbose > 2)
@@ -915,34 +915,40 @@
 		
 		ast_copy_string(privcid,l,sizeof(privcid));
 
-		if( strncmp(privcid,"NOCALLERID",10) != 0 && ast_test_flag(&opts, OPT_SCREEN_NOCLID) ) { /* if callerid is set, and ast_test_flag(&opts, OPT_SCREEN_NOCLID) is set also */  
+		if ( strncmp(privcid,"NOCALLERID",10) != 0 && ast_test_flag(&opts, OPT_SCREEN_NOCLID) ) { /* if callerid is set, and ast_test_flag(&opts, OPT_SCREEN_NOCLID) is set also */  
 			if (option_verbose > 2)
 				ast_verbose( VERBOSE_PREFIX_3  "CallerID set (%s); N option set; Screening should be off\n", privcid);
 			privdb_val = AST_PRIVACY_ALLOW;
 		}
-		else if(ast_test_flag(&opts, OPT_SCREEN_NOCLID) && strncmp(privcid,"NOCALLERID",10) == 0 ) {
+		else if (ast_test_flag(&opts, OPT_SCREEN_NOCLID) && strncmp(privcid,"NOCALLERID",10) == 0 ) {
 			if (option_verbose > 2)
 				ast_verbose( VERBOSE_PREFIX_3  "CallerID blank; N option set; Screening should happen; dbval is %d\n", privdb_val);
 		}
 		
-		if(privdb_val == AST_PRIVACY_DENY ) {
+		if (privdb_val == AST_PRIVACY_DENY ) {
+			ast_copy_string(status, "NOANSWER", sizeof(status));
 			if (option_verbose > 2)
 				ast_verbose( VERBOSE_PREFIX_3  "Privacy DB reports PRIVACY_DENY for this callerid. Dial reports unavailable\n");
 			res=0;
 			goto out;
 		}
-		else if(privdb_val == AST_PRIVACY_KILL ) {
-			ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 201);
+		else if (privdb_val == AST_PRIVACY_KILL ) {
+			ast_copy_string(status, "DONTCALL", sizeof(status));
+			if (ast_opt_priority_jumping || ast_test_flag(&opts, OPT_PRIORITY_JUMP)) {
+				ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 201);
+			}
 			res = 0;
 			goto out; /* Is this right? */
 		}
-		else if(privdb_val == AST_PRIVACY_TORTURE ) {
-			ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 301);
+		else if (privdb_val == AST_PRIVACY_TORTURE ) {
+			ast_copy_string(status, "TORTURE", sizeof(status));
+			if (ast_opt_priority_jumping || ast_test_flag(&opts, OPT_PRIORITY_JUMP)) {
+				ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 301);
+			}
 			res = 0;
 			goto out; /* is this right??? */
-
-		}
-		else if(privdb_val == AST_PRIVACY_UNKNOWN ) {
+		}
+		else if (privdb_val == AST_PRIVACY_UNKNOWN ) {
 			/* Get the user's intro, store it in priv-callerintros/$CID, 
 			   unless it is already there-- this should be done before the 
 			   call is actually dialed  */
@@ -950,7 +956,7 @@
 			/* make sure the priv-callerintros dir exists? */
 
 			snprintf(privintro,sizeof(privintro), "priv-callerintros/%s", privcid);
-			if( ast_fileexists(privintro,NULL,NULL ) > 0 && strncmp(privcid,"NOCALLERID",10) != 0) {
+			if ( ast_fileexists(privintro,NULL,NULL ) > 0 && strncmp(privcid,"NOCALLERID",10) != 0) {
 				/* the DELUX version of this code would allow this caller the
 				   option to hear and retape their previously recorded intro.
 				*/
@@ -1214,7 +1220,7 @@
 		if (ast_test_flag(&opts, OPT_PRIVACY) || ast_test_flag(&opts, OPT_SCREENING)) {
 			int res2;
 			int loopcount = 0;
-			if( privdb_val == AST_PRIVACY_UNKNOWN ) {
+			if ( privdb_val == AST_PRIVACY_UNKNOWN ) {
 
 				/* Get the user's intro, store it in priv-callerintros/$CID, 
 				   unless it is already there-- this should be done before the 
@@ -1239,7 +1245,7 @@
 					do {
 						if (!res2)
 							res2 = ast_play_and_wait(peer,"priv-callpending");
-						if( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
+						if ( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
 							res2 = 0;
 						
 						/* priv-callpending script: 
@@ -1247,13 +1253,13 @@
 						*/
 						if (!res2)
 							res2 = ast_play_and_wait(peer,privintro);
-						if( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
+						if ( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
 							res2 = 0;
 						/* now get input from the called party, as to their choice */
-						if( !res2 ) {
-							if( ast_test_flag(&opts, OPT_PRIVACY) )
+						if ( !res2 ) {
+							if ( ast_test_flag(&opts, OPT_PRIVACY) )
 								res2 = ast_play_and_wait(peer,"priv-callee-options");
-							if( ast_test_flag(&opts, OPT_SCREENING) )
+							if ( ast_test_flag(&opts, OPT_SCREENING) )
 								res2 = ast_play_and_wait(peer,"screen-callee-options");
 						}
 						/*! \page DialPrivacy Dial Privacy scripts
@@ -1272,7 +1278,7 @@
 							 Dial 3 to send this callerr to the torture menus.
 							 Dial 4 to send this caller to a simple "go away" menu.
 						*/
-						if(!res2 || res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2 > '5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) {
+						if (!res2 || res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2 > '5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) {
 							/* invalid option */
 							res2 = ast_play_and_wait(peer, "vm-sorry");
 						}
@@ -1282,7 +1288,7 @@
 
 				switch(res2) {
 				case '1':
-					if( ast_test_flag(&opts, OPT_PRIVACY) ) {
+					if ( ast_test_flag(&opts, OPT_PRIVACY) ) {
 						if (option_verbose > 2)
 							ast_verbose(VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to ALLOW\n",
 								     opt_args[OPT_ARG_PRIVACY], privcid);
@@ -1290,12 +1296,14 @@
 					}
 					break;
 				case '2':
-					if( ast_test_flag(&opts, OPT_PRIVACY) ) {
+					if ( ast_test_flag(&opts, OPT_PRIVACY) ) {
 						if (option_verbose > 2)
 							ast_verbose(VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to DENY\n",
 								     opt_args[OPT_ARG_PRIVACY], privcid);
 						ast_privacy_set(opt_args[OPT_ARG_PRIVACY], privcid, AST_PRIVACY_DENY);
 					}
+					ast_copy_string(status, "NOANSWER", sizeof(status));
+
 					if (ast_test_flag(&opts, OPT_MUSICBACK)) {
 						ast_moh_stop(chan);
 					} else if (ast_test_flag(&opts, OPT_RINGBACK)) {
@@ -1307,7 +1315,7 @@
 					res=0;
 					goto out;
 				case '3':
-					if( ast_test_flag(&opts, OPT_PRIVACY) ) {
+					if ( ast_test_flag(&opts, OPT_PRIVACY) ) {
 						if (option_verbose > 2)
 							ast_verbose(VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to TORTURE\n",
 								     opt_args[OPT_ARG_PRIVACY], privcid);
@@ -1326,7 +1334,7 @@
 					ast_hangup(peer); /* hang up on the caller -- he didn't want to talk anyway! */
 					goto out; /* Is this right? */
 				case '4':
-					if( ast_test_flag(&opts, OPT_PRIVACY) ) {
+					if ( ast_test_flag(&opts, OPT_PRIVACY) ) {
 						if (option_verbose > 2)
 							ast_verbose(VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to KILL\n",
 								     opt_args[OPT_ARG_PRIVACY], privcid);
@@ -1345,7 +1353,7 @@
 					ast_hangup(peer); /* hang up on the caller -- he didn't want to talk anyway! */
 					goto out; /* Is this right? */
 				case '5':
-					if( ast_test_flag(&opts, OPT_PRIVACY) ) {
+					if ( ast_test_flag(&opts, OPT_PRIVACY) ) {
 						if (option_verbose > 2)
 							ast_verbose(VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to ALLOW\n",
 								     opt_args[OPT_ARG_PRIVACY], privcid);
@@ -1387,9 +1395,9 @@
 				res2 = ast_autoservice_stop(chan);
 				/* if the intro is NOCALLERID, then there's no reason to leave it on disk, it'll 
 				   just clog things up, and it's not useful information, not being tied to a CID */
-				if( strncmp(privcid,"NOCALLERID",10) == 0 || ast_test_flag(&opts, OPT_SCREEN_NOINTRO) ) {
+				if ( strncmp(privcid,"NOCALLERID",10) == 0 || ast_test_flag(&opts, OPT_SCREEN_NOINTRO) ) {
 					ast_filedelete(privintro, NULL);
-					if( ast_fileexists(privintro, NULL, NULL ) > 0 )
+					if ( ast_fileexists(privintro, NULL, NULL ) > 0 )
 						ast_log(LOG_NOTICE, "privacy: ast_filedelete didn't do its job on %s\n", privintro);
 					else if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "Successfully deleted %s intro file\n", privintro);



More information about the asterisk-commits mailing list