[Asterisk-cvs] asterisk pbx.c,1.149,1.150

citats at lists.digium.com citats at lists.digium.com
Tue Sep 7 10:48:40 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/home/citats/cvs/asterisk

Modified Files:
	pbx.c 
Log Message:
Formatting cleanups

Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -d -r1.149 -r1.150
--- pbx.c	7 Sep 2004 14:37:35 -0000	1.149
+++ pbx.c	7 Sep 2004 14:51:20 -0000	1.150
@@ -4508,55 +4508,55 @@
 
 static int pbx_builtin_background(struct ast_channel *chan, void *data)
 {
-        int res = 0;
-        int option_skip = 0;
-        int option_noanswer = 0;
-        char filename[256] = "";
-        char* stringp;
-        char* options;
-		char *lang = NULL;
+	int res = 0;
+	int option_skip = 0;
+	int option_noanswer = 0;
+	char filename[256] = "";
+	char* stringp;
+	char* options;
+	char *lang = NULL;
 
-        if (!data || ast_strlen_zero(data)) {
-                ast_log(LOG_WARNING, "Background requires an argument(filename)\n");
-                return -1;
-        }
+	if (!data || ast_strlen_zero(data)) {
+		ast_log(LOG_WARNING, "Background requires an argument(filename)\n");
+		return -1;
+	}
 
-        strncpy(filename, (char*)data, sizeof(filename) - 1);
-        stringp = filename;
-        strsep(&stringp, "|");
-        options = strsep(&stringp, "|");
-		if (options)
-	        lang = strsep(&stringp, "|");
-		if (!lang)
-			lang = chan->language;
+	strncpy(filename, (char*)data, sizeof(filename) - 1);
+	stringp = filename;
+	strsep(&stringp, "|");
+	options = strsep(&stringp, "|");
+	if (options)
+		lang = strsep(&stringp, "|");
+	if (!lang)
+		lang = chan->language;
 
-        if (options && !strcasecmp(options, "skip"))
-                option_skip = 1;
-        if (options && !strcasecmp(options, "noanswer"))
-                option_noanswer = 1;
+	if (options && !strcasecmp(options, "skip"))
+		option_skip = 1;
+	if (options && !strcasecmp(options, "noanswer"))
+		option_noanswer = 1;
 
-        /* Answer if need be */
-        if (chan->_state != AST_STATE_UP) {
-                if (option_skip) {
-                        return 0;
-                } else if (!option_noanswer) {
-                        res = ast_answer(chan);
-                }
-        }
+	/* Answer if need be */
+	if (chan->_state != AST_STATE_UP) {
+		if (option_skip) {
+			return 0;
+		} else if (!option_noanswer) {
+			res = ast_answer(chan);
+		}
+	}
 
-        if (!res) {
-                /* Stop anything playing */
-                ast_stopstream(chan);
-                /* Stream a file */
-                res = ast_streamfile(chan, filename, lang);
-                if (!res) {
-                        res = ast_waitstream(chan, AST_DIGIT_ANY);
-                        ast_stopstream(chan);
-                } else {
-                        ast_log(LOG_WARNING, "ast_streamfile failed on %s fro %s\n", chan->name, (char*)data);
-                        res = 0;
-                }
-        }
+	if (!res) {
+		/* Stop anything playing */
+		ast_stopstream(chan);
+		/* Stream a file */
+		res = ast_streamfile(chan, filename, lang);
+		if (!res) {
+			res = ast_waitstream(chan, AST_DIGIT_ANY);
+			ast_stopstream(chan);
+		} else {
+			ast_log(LOG_WARNING, "ast_streamfile failed on %s fro %s\n", chan->name, (char*)data);
+			res = 0;
+		}
+	}
 
 	return res;
 }




More information about the svn-commits mailing list