[asterisk-commits] trunk - r8105 /trunk/apps/app_disa.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Jan 16 11:52:14 MST 2006


Author: jdixon
Date: Mon Jan 16 12:52:13 2006
New Revision: 8105

URL: http://svn.digium.com/view/asterisk?rev=8105&view=rev
Log:
Added NOANSWER support, so that optional the DISA application starts without
answering (used in new version of app_rpt, and potentially other applicaitons).

Modified:
    trunk/apps/app_disa.c

Modified: trunk/apps/app_disa.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_disa.c?rev=8105&r1=8104&r2=8105&view=diff
==============================================================================
--- trunk/apps/app_disa.c (original)
+++ trunk/apps/app_disa.c Mon Jan 16 12:52:13 2006
@@ -93,7 +93,8 @@
 	"If login is successful, the application looks up the dialed number in\n"
 	"the specified (or default) context, and executes it if found.\n"
 	"If the user enters an invalid extension and extension \"i\" (invalid) \n"
-	"exists in the context, it will be used.\n";
+	"exists in the context, it will be used. Also, if you set the 5th argument\n"
+	"to 'NOANSWER', the DISA application will not answer initially.\n";
 
 STANDARD_LOCAL_USER;
 
@@ -114,7 +115,7 @@
 
 static int disa_exec(struct ast_channel *chan, void *data)
 {
-	int i,j,k,x,did_ignore;
+	int i,j,k,x,did_ignore,special_noanswer;
 	int firstdigittimeout = 20000;
 	int digittimeout = 10000;
 	struct localuser *u;
@@ -131,6 +132,7 @@
 		AST_APP_ARG(context);
 		AST_APP_ARG(cid);
 		AST_APP_ARG(mailbox);
+		AST_APP_ARG(noanswer);
 	);
 
 	if (ast_strlen_zero(data)) {
@@ -175,10 +177,15 @@
 
 	ast_log(LOG_DEBUG, "Mailbox: %s\n",args.mailbox);
 	
-	if (chan->_state != AST_STATE_UP) {
-		/* answer */
-		ast_answer(chan);
-	}
+
+	special_noanswer = 0;
+	if ((!args.noanswer) || strcmp(args.noanswer,"NOANSWER"))
+	{
+		if (chan->_state != AST_STATE_UP) {
+			/* answer */
+			ast_answer(chan);
+		}
+	} else special_noanswer = 1;
 	i = k = x = 0; /* k is 0 for pswd entry, 1 for ext entry */
 	did_ignore = 0;
 	exten[0] = 0;
@@ -344,6 +351,7 @@
 			if (!ast_strlen_zero(acctcode))
 				ast_copy_string(chan->accountcode, acctcode, sizeof(chan->accountcode));
 
+			if (special_noanswer) flags.flags = 0;
 			ast_cdr_reset(chan->cdr, &flags);
 			ast_explicit_goto(chan, args.context, exten, 1);
 			LOCAL_USER_REMOVE(u);



More information about the asterisk-commits mailing list