[asterisk-commits] russell: branch russell/events r103308 - in /team/russell/events: ./ apps/ ch...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 11 06:34:41 CST 2008


Author: russell
Date: Mon Feb 11 06:34:40 2008
New Revision: 103308

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103308
Log:
resolve, reset

Modified:
    team/russell/events/   (props changed)
    team/russell/events/apps/app_amd.c
    team/russell/events/apps/app_authenticate.c
    team/russell/events/apps/app_cdr.c
    team/russell/events/apps/app_chanisavail.c
    team/russell/events/apps/app_channelredirect.c
    team/russell/events/apps/app_chanspy.c
    team/russell/events/apps/app_controlplayback.c
    team/russell/events/apps/app_db.c
    team/russell/events/apps/app_dial.c
    team/russell/events/apps/app_dictate.c
    team/russell/events/apps/app_directed_pickup.c
    team/russell/events/apps/app_directory.c
    team/russell/events/apps/app_disa.c
    team/russell/events/apps/app_dumpchan.c
    team/russell/events/apps/app_echo.c
    team/russell/events/apps/app_exec.c
    team/russell/events/apps/app_externalivr.c
    team/russell/events/apps/app_minivm.c
    team/russell/events/apps/app_playback.c
    team/russell/events/apps/app_queue.c
    team/russell/events/apps/app_rpt.c
    team/russell/events/apps/app_voicemail.c
    team/russell/events/channels/chan_iax2.c
    team/russell/events/channels/chan_mgcp.c
    team/russell/events/channels/chan_sip.c
    team/russell/events/channels/chan_skinny.c
    team/russell/events/channels/chan_usbradio.c
    team/russell/events/funcs/func_devstate.c
    team/russell/events/main/asterisk.c
    team/russell/events/main/cdr.c
    team/russell/events/main/event.c
    team/russell/events/main/pbx.c
    team/russell/events/main/rtp.c
    team/russell/events/main/udptl.c
    team/russell/events/pbx/pbx_ael.c
    team/russell/events/pbx/pbx_dundi.c
    team/russell/events/res/res_agi.c
    team/russell/events/res/res_jabber.c

Propchange: team/russell/events/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/russell/events/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/russell/events/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Feb 11 06:34:40 2008
@@ -1,1 +1,1 @@
-/trunk:1-103165
+/trunk:1-103307

Modified: team/russell/events/apps/app_amd.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_amd.c?view=diff&rev=103308&r1=103307&r2=103308
==============================================================================
--- team/russell/events/apps/app_amd.c (original)
+++ team/russell/events/apps/app_amd.c Mon Feb 11 06:34:40 2008
@@ -28,7 +28,7 @@
 
 
 #include "asterisk.h"
- 
+
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #include "asterisk/module.h"
@@ -126,19 +126,19 @@
 	int betweenWordsSilence  = dfltBetweenWordsSilence;
 	int maximumNumberOfWords = dfltMaximumNumberOfWords;
 	int silenceThreshold     = dfltSilenceThreshold;
-	int maximumWordLength	 = dfltMaximumWordLength;
+	int maximumWordLength    = dfltMaximumWordLength;
 	int maxWaitTimeForFrame  = dfltMaxWaitTimeForFrame;
 
 	AST_DECLARE_APP_ARGS(args,
-			     AST_APP_ARG(argInitialSilence);
-			     AST_APP_ARG(argGreeting);
-			     AST_APP_ARG(argAfterGreetingSilence);
-			     AST_APP_ARG(argTotalAnalysisTime);
-			     AST_APP_ARG(argMinimumWordLength);
-			     AST_APP_ARG(argBetweenWordsSilence);
-			     AST_APP_ARG(argMaximumNumberOfWords);
-			     AST_APP_ARG(argSilenceThreshold);
-			     AST_APP_ARG(argMaximumWordLength);
+		AST_APP_ARG(argInitialSilence);
+		AST_APP_ARG(argGreeting);
+		AST_APP_ARG(argAfterGreetingSilence);
+		AST_APP_ARG(argTotalAnalysisTime);
+		AST_APP_ARG(argMinimumWordLength);
+		AST_APP_ARG(argBetweenWordsSilence);
+		AST_APP_ARG(argMaximumNumberOfWords);
+		AST_APP_ARG(argSilenceThreshold);
+		AST_APP_ARG(argMaximumWordLength);
 	);
 
 	ast_verb(3, "AMD: %s %s %s (Fmt: %d)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, chan->readformat);
@@ -163,8 +163,8 @@
 			maximumNumberOfWords = atoi(args.argMaximumNumberOfWords);
 		if (!ast_strlen_zero(args.argSilenceThreshold))
 			silenceThreshold = atoi(args.argSilenceThreshold);
- 		if (!ast_strlen_zero(args.argMaximumWordLength))
- 			maximumWordLength = atoi(args.argMaximumWordLength);			
+		if (!ast_strlen_zero(args.argMaximumWordLength))
+			maximumWordLength = atoi(args.argMaximumWordLength);
 	} else {
 		ast_debug(1, "AMD using the default parameters.\n");
 	}
@@ -253,16 +253,16 @@
 						ast_verb(3, "AMD: Channel [%s]. Changed state to STATE_IN_SILENCE\n", chan->name);
 					}
 					/* Find words less than word duration */
- 					if (consecutiveVoiceDuration < minimumWordLength && consecutiveVoiceDuration > 0){
- 						ast_verb(3, "AMD: Channel [%s]. Short Word Duration: %d\n", chan->name, consecutiveVoiceDuration);
- 					}					
+					if (consecutiveVoiceDuration < minimumWordLength && consecutiveVoiceDuration > 0){
+						ast_verb(3, "AMD: Channel [%s]. Short Word Duration: %d\n", chan->name, consecutiveVoiceDuration);
+					}
 					currentState  = STATE_IN_SILENCE;
 					consecutiveVoiceDuration = 0;
 				}
-				
+
 				if (inInitialSilence == 1  && silenceDuration >= initialSilence) {
 					ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: silenceDuration:%d initialSilence:%d\n",
-							    chan->name, silenceDuration, initialSilence);
+						chan->name, silenceDuration, initialSilence);
 					ast_frfree(f);
 					strcpy(amdStatus , "MACHINE");
 					sprintf(amdCause , "INITIALSILENCE-%d-%d", silenceDuration, initialSilence);
@@ -272,7 +272,7 @@
 				
 				if (silenceDuration >= afterGreetingSilence  &&  inGreeting == 1) {
 					ast_verb(3, "AMD: Channel [%s]. HUMAN: silenceDuration:%d afterGreetingSilence:%d\n",
-							    chan->name, silenceDuration, afterGreetingSilence);
+						chan->name, silenceDuration, afterGreetingSilence);
 					ast_frfree(f);
 					strcpy(amdStatus , "HUMAN");
 					sprintf(amdCause , "HUMAN-%d-%d", silenceDuration, afterGreetingSilence);
@@ -283,7 +283,7 @@
 			} else {
 				consecutiveVoiceDuration += framelength;
 				voiceDuration += framelength;
-				
+
 				/* If I have enough consecutive voice to say that I am in a Word, I can only increment the
 				   number of words if my previous state was Silence, which means that I moved into a word. */
 				if (consecutiveVoiceDuration >= minimumWordLength && currentState == STATE_IN_SILENCE) {
@@ -292,13 +292,13 @@
 					previousState = currentState;
 					currentState = STATE_IN_WORD;
 				}
- 				if (consecutiveVoiceDuration >= maximumWordLength){
- 					ast_verb(3, "AMD: Channel [%s]. Maximum Word Length detected. [%d]\n", chan->name, consecutiveVoiceDuration);
- 					ast_frfree(f);
- 					strcpy(amdStatus , "MACHINE");
- 					sprintf(amdCause , "MAXWORDLENGTH-%d", consecutiveVoiceDuration);
- 					break;
- 				}				
+				if (consecutiveVoiceDuration >= maximumWordLength){
+					ast_verb(3, "AMD: Channel [%s]. Maximum Word Length detected. [%d]\n", chan->name, consecutiveVoiceDuration);
+					ast_frfree(f);
+					strcpy(amdStatus , "MACHINE");
+					sprintf(amdCause , "MAXWORDLENGTH-%d", consecutiveVoiceDuration);
+					break;
+				}
 				if (iWordsCount >= maximumNumberOfWords) {
 					ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: iWordsCount:%d\n", chan->name, iWordsCount);
 					ast_frfree(f);
@@ -307,7 +307,7 @@
 					res = 1;
 					break;
 				}
-				
+
 				if (inGreeting == 1 && voiceDuration >= greeting) {
 					ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: voiceDuration:%d greeting:%d\n", chan->name, voiceDuration, greeting);
 					ast_frfree(f);
@@ -316,13 +316,13 @@
 					res = 1;
 					break;
 				}
-				
+
 				if (voiceDuration >= minimumWordLength ) {
 					if (silenceDuration > 0)
 						ast_verb(3, "AMD: Channel [%s]. Detected Talk, previous silence duration: %d\n", chan->name, silenceDuration);
 					silenceDuration = 0;
 				}
-				if (consecutiveVoiceDuration >= minimumWordLength && inGreeting == 0){
+				if (consecutiveVoiceDuration >= minimumWordLength && inGreeting == 0) {
 					/* Only go in here once to change the greeting flag when we detect the 1st word */
 					if (silenceDuration > 0)
 						ast_verb(3, "AMD: Channel [%s]. Before Greeting Time:  silenceDuration: %d voiceDuration: %d\n", chan->name, silenceDuration, voiceDuration);
@@ -401,7 +401,7 @@
 					dfltMaximumNumberOfWords = atoi(var->value);
 				} else if (!strcasecmp(var->name, "maximum_word_length")) {
 					dfltMaximumWordLength = atoi(var->value);
-					
+
 				} else {
 					ast_log(LOG_WARNING, "%s: Cat:%s. Unknown keyword %s at line %d of amd.conf\n",
 						app, cat, var->name, var->lineno);
@@ -416,8 +416,8 @@
 
 	ast_verb(3, "AMD defaults: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
 		"totalAnalysisTime [%d] minimumWordLength [%d] betweenWordsSilence [%d] maximumNumberOfWords [%d] silenceThreshold [%d] maximumWordLength [%d]\n",
-				dfltInitialSilence, dfltGreeting, dfltAfterGreetingSilence, dfltTotalAnalysisTime,
-				dfltMinimumWordLength, dfltBetweenWordsSilence, dfltMaximumNumberOfWords, dfltSilenceThreshold, dfltMaximumWordLength);
+		dfltInitialSilence, dfltGreeting, dfltAfterGreetingSilence, dfltTotalAnalysisTime,
+		dfltMinimumWordLength, dfltBetweenWordsSilence, dfltMaximumNumberOfWords, dfltSilenceThreshold, dfltMaximumWordLength);
 
 	return 0;
 }
@@ -447,4 +447,4 @@
 		.load = load_module,
 		.unload = unload_module,
 		.reload = reload,
-	       );
+);

Modified: team/russell/events/apps/app_authenticate.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_authenticate.c?view=diff&rev=103308&r1=103307&r2=103308
==============================================================================
--- team/russell/events/apps/app_authenticate.c (original)
+++ team/russell/events/apps/app_authenticate.c Mon Feb 11 06:34:40 2008
@@ -21,7 +21,7 @@
  * \brief Execute arbitrary authenticate commands
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
@@ -89,7 +89,7 @@
 		AST_APP_ARG(options);
 		AST_APP_ARG(maxdigits);
 	);
-	
+
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Authenticate requires an argument(password)\n");
 		return -1;
@@ -99,11 +99,11 @@
 		if ((res = ast_answer(chan)))
 			return -1;
 	}
-	
+
 	argcopy = ast_strdupa(data);
 
 	AST_STANDARD_APP_ARGS(arglist, argcopy);
-	
+
 	if (!ast_strlen_zero(arglist.options))
 		ast_app_parse_options(auth_app_options, &flags, NULL, arglist.options);
 
@@ -124,7 +124,7 @@
 
 		if (arglist.password[0] != '/') {
 			/* Compare against a fixed password */
-			if (!strcmp(passwd, arglist.password)) 
+			if (!strcmp(passwd, arglist.password))
 				break;
 		}
 
@@ -141,7 +141,7 @@
 			/* Compare against a file */
 			FILE *f;
 			char buf[256] = "", md5passwd[33] = "", *md5secret = NULL;
-				
+
 			if (!(f = fopen(arglist.password, "r"))) {
 				ast_log(LOG_WARNING, "Unable to open file '%s' for authentication: %s\n", arglist.password, strerror(errno));
 				continue;
@@ -198,7 +198,7 @@
 	}
 
 	if ((retries < 3) && !res) {
-		if (ast_test_flag(&flags,OPT_ACCOUNT) && !ast_test_flag(&flags,OPT_MULTIPLE)) 
+		if (ast_test_flag(&flags,OPT_ACCOUNT) && !ast_test_flag(&flags,OPT_MULTIPLE))
 			ast_cdr_setaccount(chan, passwd);
 		if (!(res = ast_streamfile(chan, "auth-thankyou", chan->language)))
 			res = ast_waitstream(chan, "");

Modified: team/russell/events/apps/app_cdr.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_cdr.c?view=diff&rev=103308&r1=103307&r2=103308
==============================================================================
--- team/russell/events/apps/app_cdr.c (original)
+++ team/russell/events/apps/app_cdr.c Mon Feb 11 06:34:40 2008
@@ -17,7 +17,7 @@
  */
 
 /*! \file
- * 
+ *
  * \brief Applications connected with CDR engine
  *
  * \author Martin Pycko <martinp at digium.com>
@@ -32,7 +32,7 @@
 #include "asterisk/channel.h"
 #include "asterisk/module.h"
 
-static char *nocdr_descrip = 
+static char *nocdr_descrip =
 "  NoCDR(): This application will tell Asterisk not to maintain a CDR for the\n"
 "current call.\n";
 

Modified: team/russell/events/apps/app_chanisavail.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_chanisavail.c?view=diff&rev=103308&r1=103307&r2=103308
==============================================================================
--- team/russell/events/apps/app_chanisavail.c (original)
+++ team/russell/events/apps/app_chanisavail.c Mon Feb 11 06:34:40 2008
@@ -18,9 +18,9 @@
 */
 
 /*! \file
- * 
+ *
  * \brief Check if Channel is Available
- * 
+ *
  * \author Mark Spencer <markster at digium.com>
  * \author James Golovich <james at gnuinter.net>
 
@@ -45,7 +45,7 @@
 
 static char *synopsis = "Check channel availability";
 
-static char *descrip = 
+static char *descrip =
 "  ChanIsAvail(Technology/resource[&Technology2/resource2...][,options]): \n"
 "This application will check to see if any of the specified channels are\n"
 "available.\n"
@@ -75,7 +75,7 @@
 		return -1;
 	}
 
-	info = ast_strdupa(data); 
+	info = ast_strdupa(data);
 
 	AST_STANDARD_APP_ARGS(args, info);
 
@@ -105,16 +105,16 @@
 			number++;
 			
 			if (string_compare) {
-				/* ast_parse_device_state checks for "SIP/1234" as a channel name. 
+				/* ast_parse_device_state checks for "SIP/1234" as a channel name.
 				   ast_device_state will ask the SIP driver for the channel state. */
 
 				snprintf(trychan, sizeof(trychan), "%s/%s",cur,number);
 				status = inuse = ast_parse_device_state(trychan);
 			} else if (option_state) {
 				/* If the pbx says in use then don't bother trying further.
-				   This is to permit testing if someone's on a call, even if the 
-	 			   channel can permit more calls (ie callwaiting, sip calls, etc).  */
-                               
+				   This is to permit testing if someone's on a call, even if the
+				   channel can permit more calls (ie callwaiting, sip calls, etc).  */
+
 				snprintf(trychan, sizeof(trychan), "%s/%s",cur,number);
 				status = inuse = ast_device_state(trychan);
 			}

Modified: team/russell/events/apps/app_channelredirect.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_channelredirect.c?view=diff&rev=103308&r1=103307&r2=103308
==============================================================================
--- team/russell/events/apps/app_channelredirect.c (original)
+++ team/russell/events/apps/app_channelredirect.c Mon Feb 11 06:34:40 2008
@@ -37,7 +37,7 @@
 
 static char *app = "ChannelRedirect";
 static char *synopsis = "Redirects given channel to a dialplan target.";
-static char *descrip = 
+static char *descrip =
 "ChannelRedirect(channel,[[context,]extension,]priority)\n"
 "  Sends the specified channel to the specified extension priority\n";
 

Modified: team/russell/events/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_chanspy.c?view=diff&rev=103308&r1=103307&r2=103308
==============================================================================
--- team/russell/events/apps/app_chanspy.c (original)
+++ team/russell/events/apps/app_chanspy.c Mon Feb 11 06:34:40 2008
@@ -33,7 +33,7 @@
 
 #include <ctype.h>
 
-#include "asterisk/paths.h"	/* use ast_config_AST_MONITOR_DIR */
+#include "asterisk/paths.h" /* use ast_config_AST_MONITOR_DIR */
 #include "asterisk/file.h"
 #include "asterisk/channel.h"
 #include "asterisk/audiohook.h"
@@ -50,7 +50,7 @@
 
 static const char *tdesc = "Listen to a channel, and optionally whisper into it";
 static const char *app_chan = "ChanSpy";
-static const char *desc_chan = 
+static const char *desc_chan =
 "  ChanSpy([chanprefix][,options]): This application is used to listen to the\n"
 "audio from an Asterisk channel. This includes the audio coming in and\n"
 "out of the channel being spied on. If the 'chanprefix' parameter is specified,\n"
@@ -94,7 +94,7 @@
 ;
 
 static const char *app_ext = "ExtenSpy";
-static const char *desc_ext = 
+static const char *desc_ext =
 "  ExtenSpy(exten[@context][,options]): This application is used to listen to the\n"
 "audio from an Asterisk channel. This includes the audio coming in and\n"
 "out of the channel being spied on. Only channels created by outgoing calls for the\n"
@@ -131,15 +131,15 @@
 ;
 
 enum {
-	OPTION_QUIET	 = (1 << 0),	/* Quiet, no announcement */
-	OPTION_BRIDGED   = (1 << 1),	/* Only look at bridged calls */
-	OPTION_VOLUME    = (1 << 2),	/* Specify initial volume */
-	OPTION_GROUP     = (1 << 3),	/* Only look at channels in group */
+	OPTION_QUIET     = (1 << 0),    /* Quiet, no announcement */
+	OPTION_BRIDGED   = (1 << 1),    /* Only look at bridged calls */
+	OPTION_VOLUME    = (1 << 2),    /* Specify initial volume */
+	OPTION_GROUP     = (1 << 3),    /* Only look at channels in group */
 	OPTION_RECORD    = (1 << 4),
-	OPTION_WHISPER	 = (1 << 5),
-	OPTION_PRIVATE   = (1 << 6),	/* Private Whisper mode */
-	OPTION_READONLY  = (1 << 7),	/* Don't mix the two channels */
-	OPTION_EXIT      = (1 << 8),	/* Exit to a valid single digit extension */
+	OPTION_WHISPER   = (1 << 5),
+	OPTION_PRIVATE   = (1 << 6),    /* Private Whisper mode */
+	OPTION_READONLY  = (1 << 7),    /* Don't mix the two channels */
+	OPTION_EXIT      = (1 << 8),    /* Exit to a valid single digit extension */
 	OPTION_ENFORCED  = (1 << 9),    /* Enforced mode */
 } chanspy_opt_flags;
 
@@ -184,11 +184,11 @@
 	/* nothing to do */
 }
 
-static int spy_generate(struct ast_channel *chan, void *data, int len, int samples) 
+static int spy_generate(struct ast_channel *chan, void *data, int len, int samples)
 {
 	struct chanspy_translation_helper *csth = data;
 	struct ast_frame *f = NULL;
-		
+
 	ast_audiohook_lock(&csth->spy_audiohook);
 	if (csth->spy_audiohook.status != AST_AUDIOHOOK_STATUS_RUNNING) {
 		/* Channel is already gone more than likely */
@@ -199,10 +199,10 @@
 	f = ast_audiohook_read_frame(&csth->spy_audiohook, samples, AST_AUDIOHOOK_DIRECTION_BOTH, AST_FORMAT_SLINEAR);
 
 	ast_audiohook_unlock(&csth->spy_audiohook);
-		
+
 	if (!f)
 		return 0;
-		
+
 	if (ast_write(chan, f)) {
 		ast_frfree(f);
 		return -1;
@@ -219,10 +219,10 @@
 static struct ast_generator spygen = {
 	.alloc = spy_alloc,
 	.release = spy_release,
-	.generate = spy_generate, 
+	.generate = spy_generate,
 };
 
-static int start_spying(struct ast_channel *chan, struct ast_channel *spychan, struct ast_audiohook *audiohook) 
+static int start_spying(struct ast_channel *chan, struct ast_channel *spychan, struct ast_audiohook *audiohook)
 {
 	int res = 0;
 	struct ast_channel *peer = NULL;
@@ -232,13 +232,13 @@
 	res = ast_audiohook_attach(chan, audiohook);
 
 	if (!res && ast_test_flag(chan, AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(chan)))
-		ast_softhangup(peer, AST_SOFTHANGUP_UNBRIDGE);	
+		ast_softhangup(peer, AST_SOFTHANGUP_UNBRIDGE);
 
 	return res;
 }
 
 static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int *volfactor, int fd,
-		       const struct ast_flags *flags, char *exitcontext) 
+	const struct ast_flags *flags, char *exitcontext)
 {
 	struct chanspy_translation_helper csth;
 	int running = 0, res, x = 0;
@@ -256,7 +256,7 @@
 	memset(&csth, 0, sizeof(csth));
 
 	ast_audiohook_init(&csth.spy_audiohook, AST_AUDIOHOOK_TYPE_SPY, "ChanSpy");
-	
+
 	if (start_spying(spyee, chan, &csth.spy_audiohook)) {
 		ast_audiohook_destroy(&csth.spy_audiohook);
 		return 0;
@@ -321,7 +321,7 @@
 			running = -1;
 			break;
 		}
-		
+
 		if (ast_test_flag(flags, OPTION_EXIT)) {
 			char tmp[2];
 			tmp[0] = res;
@@ -376,15 +376,15 @@
 	ast_audiohook_destroy(&csth.spy_audiohook);
 	
 	ast_verb(2, "Done Spying on channel %s\n", name);
-	
+
 	return running;
 }
 
 static struct ast_channel *next_channel(const struct ast_channel *last, const char *spec,
-					const char *exten, const char *context)
+	const char *exten, const char *context)
 {
 	struct ast_channel *this;
-	
+
 	redo:
 	if (!ast_strlen_zero(spec))
 		this = ast_walk_channel_by_name_prefix_locked(last, spec, strlen(spec));
@@ -404,8 +404,8 @@
 }
 
 static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
-		       int volfactor, const int fd, const char *mygroup, const char *myenforced,
-		       const char *spec, const char *exten, const char *context)
+	int volfactor, const int fd, const char *mygroup, const char *myenforced,
+	const char *spec, const char *exten, const char *context)
 {
 	struct ast_channel *peer, *prev, *next;
 	char nameprefix[AST_NAME_STRLEN];
@@ -420,9 +420,9 @@
 
 	if (ast_test_flag(flags, OPTION_EXIT)) {
 		const char *c;
-		if ((c = pbx_builtin_getvar_helper(chan, "SPY_EXIT_CONTEXT"))) 
+		if ((c = pbx_builtin_getvar_helper(chan, "SPY_EXIT_CONTEXT")))
 			ast_copy_string(exitcontext, c, sizeof(exitcontext));
-		else if (!ast_strlen_zero(chan->macrocontext)) 
+		else if (!ast_strlen_zero(chan->macrocontext))
 			ast_copy_string(exitcontext, chan->macrocontext, sizeof(exitcontext));
 		else
 			ast_copy_string(exitcontext, chan->context, sizeof(exitcontext));
@@ -469,15 +469,15 @@
 			else
 				ast_debug(2, "Exit by single digit did not work in chanspy. Extension %s does not exist in context %s\n", tmp, exitcontext);
 		}
-				
+
 		/* reset for the next loop around, unless overridden later */
 		waitms = 100;
 		peer = prev = next = NULL;
 		num_spyed_upon = 0;
 
 		for (peer = next_channel(peer, spec, exten, context);
-		     peer;
-		     prev = peer, peer = next ? next : next_channel(peer, spec, exten, context), next = NULL) {
+			peer;
+			prev = peer, peer = next ? next : next_channel(peer, spec, exten, context), next = NULL) {
 			const char *group;
 			int igrp = !mygroup;
 			char *groups[25];
@@ -490,7 +490,7 @@
 			char *ext;
 			char *form_enforced;
 			int ienf = !myenforced;
-	
+
 			if (peer == prev)
 				break;
 
@@ -507,9 +507,9 @@
 				if ((group = pbx_builtin_getvar_helper(peer, "SPYGROUP"))) {
 					dup_group = ast_strdupa(group);
 					num_groups = ast_app_separate_args(dup_group, ':', groups,
-									   sizeof(groups) / sizeof(groups[0]));
+						sizeof(groups) / sizeof(groups[0]));
 				}
-				
+
 				for (x = 0; x < num_groups; x++) {
 					if (!strcmp(mygroup, groups[x])) {
 						igrp = 1;
@@ -517,33 +517,33 @@
 					}
 				}
 			}
-			
+
 			if (!igrp)
 				continue;
 
 			if (myenforced) {
- 
+
 				/* We don't need to allocate more space than just the
 				length of (peer->name) for ext as we will cut the
 				channel name's ending before copying into ext */
 
 				ext = alloca(strlen(peer->name));
 
- 				form_enforced = alloca(strlen(myenforced) + 3);
-			
+				form_enforced = alloca(strlen(myenforced) + 3);
+
 				strcpy(form_enforced, ":");
 				strcat(form_enforced, myenforced);
 				strcat(form_enforced, ":");
-				
+
 				buffer = ast_strdupa(peer->name);
 				
 				if ((end = strchr(buffer, '-'))) {
-				    *end++ = ':';
-				    *end = '\0';
+					*end++ = ':';
+					*end = '\0';
 				}
-				
+
 				strcpy(ext, ":");
-				strcat(ext, buffer);				
+				strcat(ext, buffer);
 
 				if (strcasestr(form_enforced, ext))
 					ienf = 1;
@@ -556,10 +556,10 @@
 			strncat(peer_name, peer->name, AST_NAME_STRLEN);
 			ptr = strchr(peer_name, '/');
 			*ptr++ = '\0';
-			
+
 			for (s = peer_name; s < ptr; s++)
 				*s = tolower(*s);
-			
+
 			if (!ast_test_flag(flags, OPTION_QUIET)) {
 				if (ast_fileexists(peer_name, NULL, NULL) != -1) {
 					res = ast_streamfile(chan, peer_name, chan->language);
@@ -569,13 +569,13 @@
 						break;
 				} else
 					res = ast_say_character_str(chan, peer_name, "", chan->language);
-				if ((num = atoi(ptr))) 
+				if ((num = atoi(ptr)))
 					ast_say_digits(chan, atoi(ptr), "", chan->language);
 			}
-			
+
 			waitms = 5000;
 			res = channel_spy(chan, peer, &volfactor, fd, flags, exitcontext);
-			num_spyed_upon++;	
+			num_spyed_upon++;
 
 			if (res == -1) {
 				goto exit;
@@ -631,7 +631,7 @@
 			mygroup = opts[OPT_ARG_GROUP];
 
 		if (ast_test_flag(&flags, OPTION_RECORD) &&
-		    !(recbase = opts[OPT_ARG_RECORD]))
+			!(recbase = opts[OPT_ARG_RECORD]))
 			recbase = "chanspy";
 
 		if (ast_test_flag(&flags, OPTION_VOLUME) && opts[OPT_ARG_VOLUME]) {
@@ -708,13 +708,13 @@
 
 	if (args.options) {
 		char *opts[OPT_ARG_ARRAY_SIZE];
-		
+
 		ast_app_parse_options(spy_opts, &flags, opts, args.options);
 		if (ast_test_flag(&flags, OPTION_GROUP))
 			mygroup = opts[OPT_ARG_GROUP];
 
 		if (ast_test_flag(&flags, OPTION_RECORD) &&
-		    !(recbase = opts[OPT_ARG_RECORD]))
+			!(recbase = opts[OPT_ARG_RECORD]))
 			recbase = "chanspy";
 
 		if (ast_test_flag(&flags, OPTION_VOLUME) && opts[OPT_ARG_VOLUME]) {

Modified: team/russell/events/apps/app_controlplayback.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_controlplayback.c?view=diff&rev=103308&r1=103307&r2=103308
==============================================================================
--- team/russell/events/apps/app_controlplayback.c (original)
+++ team/russell/events/apps/app_controlplayback.c Mon Feb 11 06:34:40 2008
@@ -17,14 +17,14 @@
  */
 
 /*! \file
- * 
+ *
  * \brief Trivial application to control playback of a sound file
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
- 
+
 #include "asterisk.h"
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -37,7 +37,7 @@
 
 static const char *synopsis = "Play a file with fast forward and rewind";
 
-static const char *descrip = 
+static const char *descrip =
 "  ControlPlayback(file[,skipms[,ff[,rew[,stop[,pause[,restart,options]]]]]]]):\n"
 "This application will play back the given filename. By default, the '*' key\n"
 "can be used to rewind, and the '#' key can be used to fast-forward.\n"
@@ -71,7 +71,8 @@
 
 AST_APP_OPTIONS(cpb_opts, BEGIN_OPTIONS
 	AST_APP_OPTION_ARG('o', OPT_OFFSET, OPT_ARG_OFFSET),
-END_OPTIONS );
+	END_OPTIONS
+);
 
 static int is_on_phonepad(char key)
 {
@@ -148,7 +149,7 @@
 		args.restart = NULL;
 
 	if (args.options) {
-		ast_app_parse_options(cpb_opts, &opts, opt_args, args.options);		
+		ast_app_parse_options(cpb_opts, &opts, opt_args, args.options);
 		if (ast_test_flag(&opts, OPT_OFFSET))
 			offsetms = atol(opt_args[OPT_ARG_OFFSET]);
 	}

Modified: team/russell/events/apps/app_db.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_db.c?view=diff&rev=103308&r1=103307&r2=103308
==============================================================================
--- team/russell/events/apps/app_db.c (original)
+++ team/russell/events/apps/app_db.c Mon Feb 11 06:34:40 2008
@@ -59,9 +59,9 @@
 static int deltree_exec(struct ast_channel *chan, void *data)
 {
 	char *argv, *family, *keytree;
-	
+
 	argv = ast_strdupa(data);
-	
+
 	if (strchr(argv, '/')) {
 		family = strsep(&argv, "/");
 		keytree = strsep(&argv, "\0");
@@ -75,12 +75,12 @@
 		family = argv;
 		keytree = 0;
 	}
-	
+
 	if (keytree)
 		ast_verb(3, "DBdeltree: family=%s, keytree=%s\n", family, keytree);
 	else
 		ast_verb(3, "DBdeltree: family=%s\n", family);
-	
+
 	if (ast_db_deltree(family, keytree))
 		ast_verb(3, "DBdeltree: Error deleting key from database.\n");
 
@@ -91,14 +91,14 @@
 {
 	char *argv, *family, *key;
 	static int deprecation_warning = 0;
-	
+
 	if (!deprecation_warning) {
 		deprecation_warning = 1;
 		ast_log(LOG_WARNING, "The DBdel application has been deprecated in favor of the DB_DELETE dialplan function!\n");
 	}
-	
+
 	argv = ast_strdupa(data);
-	
+
 	if (strchr(argv, '/')) {
 		family = strsep(&argv, "/");
 		key = strsep(&argv, "\0");
@@ -112,7 +112,7 @@
 	} else {
 		ast_debug(1, "Ignoring, no parameters\n");
 	}
-	
+
 	return 0;
 }
 
@@ -132,7 +132,7 @@
 
 	retval = ast_register_application(d_app, del_exec, d_synopsis, d_descrip);
 	retval |= ast_register_application(dt_app, deltree_exec, dt_synopsis, dt_descrip);
-	
+
 	return retval;
 }
 

Modified: team/russell/events/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_dial.c?view=diff&rev=103308&r1=103307&r2=103308
==============================================================================
--- team/russell/events/apps/app_dial.c (original)
+++ team/russell/events/apps/app_dial.c Mon Feb 11 06:34:40 2008
@@ -21,7 +21,7 @@
  * \brief dial() & retrydial() - Trivial application to dial a channel and send an URL on answer
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
@@ -39,7 +39,7 @@
 #include <sys/stat.h>
 #include <netinet/in.h>
 
-#include "asterisk/paths.h"	/* use ast_config_AST_DATA_DIR */
+#include "asterisk/paths.h" /* use ast_config_AST_DATA_DIR */
 #include "asterisk/lock.h"
 #include "asterisk/file.h"
 #include "asterisk/channel.h"
@@ -78,10 +78,10 @@
 "continue if no requested channels can be called, or if the timeout expires.\n\n"
 "  This application sets the following channel variables upon completion:\n"
 "    DIALEDTIME   - This is the time from dialing a channel until when it\n"
-"                   is disconnected.\n" 
+"                   is disconnected.\n"
 "    ANSWEREDTIME - This is the amount of time for actual call.\n"
 "    DIALSTATUS   - This is the status of the call:\n"
-"                   CHANUNAVAIL | CONGESTION | NOANSWER | BUSY | ANSWER | CANCEL\n" 
+"                   CHANUNAVAIL | CONGESTION | NOANSWER | BUSY | ANSWER | CANCEL\n"
 "                   DONTCALL | TORTURE | INVALIDARGS\n"
 "  For the Privacy and Screening Modes, the DIALSTATUS variable will be set to\n"
 "DONTCALL if the called party chooses to send the calling party to the 'Go Away'\n"
@@ -121,7 +121,7 @@
 "           the specified priority and the called party to the specified priority+1.\n"
 "           Optionally, an extension, or extension and context may be specified. \n"
 "           Otherwise, the current extension is used. You cannot use any additional\n"
-"           action post answer options in conjunction with this option.\n" 
+"           action post answer options in conjunction with this option.\n"
 "    h    - Allow the called party to hang up by sending the '*' DTMF digit.\n"
 "    H    - Allow the calling party to hang up by hitting the '*' DTMF digit.\n"
 "    i    - Asterisk will ignore any forwarding requests it may receive on this\n"
@@ -147,7 +147,7 @@
 "    M(x[^arg]) - Execute the Macro for the *called* channel before connecting\n"
 "           to the calling channel. Arguments can be specified to the Macro\n"
 "           using '^' as a delimeter. The Macro can set the variable\n"
-"           MACRO_RESULT to specify the following actions after the Macro is\n" 
+"           MACRO_RESULT to specify the following actions after the Macro is\n"
 "           finished executing.\n"
 "           * ABORT        Hangup both legs of the call.\n"
 "           * CONGESTION   Behave as if line congestion was encountered.\n"
@@ -186,7 +186,7 @@
 "    r    - Indicate ringing to the calling party. Pass no audio to the calling\n"
 "           party until the called channel has answered.\n"
 "    S(x) - Hang up the call after 'x' seconds *after* the called party has\n"
-"           answered the call.\n"  	
+"           answered the call.\n"
 "    t    - Allow the called party to transfer the calling party by sending the\n"
 "           DTMF sequence defined in features.conf.\n"
 "    T    - Allow the calling party to transfer the called party by sending the\n"
@@ -194,7 +194,7 @@
 "    U(x[^arg]) - Execute via Gosub the routine 'x' for the *called* channel before connecting\n"
 "           to the calling channel. Arguments can be specified to the Gosub\n"
 "           using '^' as a delimeter. The Gosub routine can set the variable\n"
-"           GOSUB_RESULT to specify the following actions after the Gosub returns.\n" 
+"           GOSUB_RESULT to specify the following actions after the Gosub returns.\n"
 "           * ABORT        Hangup both legs of the call.\n"
 "           * CONGESTION   Behave as if line congestion was encountered.\n"
 "           * BUSY         Behave as if a busy signal was encountered.\n"
@@ -214,7 +214,7 @@
 "           the DTMF sequence defined for one-touch automixmonitor in features.conf\n"
 "    X    - Allow the calling party to enable recording of the call by sending\n"
 "           the DTMF sequence defined for one-touch automixmonitor in features.conf\n";
- 
+
 /* RetryDial App by Anthony Minessale II <anthmct at yahoo.com> Jan/2005 */
 static char *rapp = "RetryDial";
 static char *rsynopsis = "Place a call, retrying on failure allowing optional exit extension.";
@@ -264,10 +264,10 @@
 	OPT_CALLER_MIXMONITOR = (1 << 30),
 };
 
-#define DIAL_STILLGOING			(1 << 31)
-#define DIAL_NOFORWARDHTML		((uint64_t)1 << 32) /* flags are now 64 bits, so keep it up! */
-#define OPT_CANCEL_ELSEWHERE	((uint64_t)1 << 33)
-#define OPT_PEER_H   			((uint64_t)1 << 34)
+#define DIAL_STILLGOING      (1 << 31)
+#define DIAL_NOFORWARDHTML   ((uint64_t)1 << 32) /* flags are now 64 bits, so keep it up! */
+#define OPT_CANCEL_ELSEWHERE ((uint64_t)1 << 33)
+#define OPT_PEER_H           ((uint64_t)1 << 34)
 
 enum {
 	OPT_ARG_ANNOUNCE = 0,
@@ -404,7 +404,7 @@
 		s = (new_val);		\
 	} while (0)
 
-static int onedigit_goto(struct ast_channel *chan, const char *context, char exten, int pri) 
+static int onedigit_goto(struct ast_channel *chan, const char *context, char exten, int pri)
 {
 	char rexten[2] = { exten, '\0' };
 
@@ -433,29 +433,29 @@
 
 static void senddialevent(struct ast_channel *src, struct ast_channel *dst, const char *dialstring)
 {
-	manager_event(EVENT_FLAG_CALL, "Dial", 
-			   "SubEvent: Begin\r\n"
-			   "Channel: %s\r\n"
-			   "Destination: %s\r\n"
-			   "CallerIDNum: %s\r\n"
-			   "CallerIDName: %s\r\n"
-			   "UniqueID: %s\r\n"
-			   "DestUniqueID: %s\r\n"
-			   "Dialstring: %s\r\n",
-			   src->name, dst->name, S_OR(src->cid.cid_num, "<unknown>"),
-			   S_OR(src->cid.cid_name, "<unknown>"), src->uniqueid,
-			   dst->uniqueid, dialstring ? dialstring : "");
+	manager_event(EVENT_FLAG_CALL, "Dial",
+		"SubEvent: Begin\r\n"
+		"Channel: %s\r\n"
+		"Destination: %s\r\n"
+		"CallerIDNum: %s\r\n"
+		"CallerIDName: %s\r\n"
+		"UniqueID: %s\r\n"
+		"DestUniqueID: %s\r\n"
+		"Dialstring: %s\r\n",
+		src->name, dst->name, S_OR(src->cid.cid_num, "<unknown>"),
+		S_OR(src->cid.cid_name, "<unknown>"), src->uniqueid,
+		dst->uniqueid, dialstring ? dialstring : "");
 }
 
 static void senddialendevent(const struct ast_channel *src, const char *dialstatus)
 {
 	manager_event(EVENT_FLAG_CALL, "Dial",
-			   		"SubEvent: End\r\n"
-					"Channel: %s\r\n"
-			   		"UniqueID: %s\r\n"
-					"DialStatus: %s\r\n",
-					src->name, src->uniqueid, dialstatus);
-}	
+		"SubEvent: End\r\n"
+		"Channel: %s\r\n"
+		"UniqueID: %s\r\n"
+		"DialStatus: %s\r\n",
+		src->name, src->uniqueid, dialstatus);
+}
 
 /*!
  * helper function for wait_for_answer()
@@ -503,7 +503,7 @@
 			ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
 	}
 	if (!c) {
-		ast_clear_flag64(o, DIAL_STILLGOING);	
+		ast_clear_flag64(o, DIAL_STILLGOING);
 		handle_cause(cause, num);
 	} else {
 		char *new_cid_num, *new_cid_name;
@@ -513,7 +513,7 @@
 		if (ast_test_flag64(o, OPT_FORCECLID)) {
 			new_cid_num = ast_strdup(S_OR(in->macroexten, in->exten));
 			new_cid_name = NULL; /* XXX no name ? */
-			src = c;	/* XXX possible bug in previous code, which used 'winner' ? it may have changed */
+			src = c; /* XXX possible bug in previous code, which used 'winner' ? it may have changed */
 		} else {
 			new_cid_num = ast_strdup(in->cid.cid_num);
 			new_cid_name = ast_strdup(in->cid.cid_name);
@@ -530,7 +530,7 @@
 		S_REPLACE(c->cid.cid_rdnis, ast_strdup(S_OR(in->macroexten, in->exten)));
 		if (ast_call(c, tmpchan, 0)) {
 			ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan);
-			ast_clear_flag64(o, DIAL_STILLGOING);	
+			ast_clear_flag64(o, DIAL_STILLGOING);
 			ast_hangup(original);
 			c = o->chan = NULL;
 			num->nochan++;
@@ -549,11 +549,11 @@
 
 /* argument used for some functions. */
 struct privacy_args {
-        int sentringing;
-        int privdb_val;
-        char privcid[256];
-        char privintro[1024];
-        char status[256];
+	int sentringing;
+	int privdb_val;
+	char privcid[256];
+	char privintro[1024];
+	char status[256];
 };
 
 static struct ast_channel *wait_for_answer(struct ast_channel *in,
@@ -570,7 +570,7 @@
 #ifdef HAVE_EPOLL
 	struct chanlist *epollo;
 #endif
-	
+
 	if (single) {
 		/* Turn off hold music, etc */
 		ast_deactivate_generator(in);
@@ -581,11 +581,11 @@
 #ifdef HAVE_EPOLL
 	for (epollo = outgoing; epollo; epollo = epollo->next)
 		ast_poll_channel_add(in, epollo->chan);
-#endif	
-	
+#endif
+
 	while (*to && !peer) {
 		struct chanlist *o;
-		int pos = 0;	/* how many channels do we handle */
+		int pos = 0; /* how many channels do we handle */
 		int numlines = prestart;
 		struct ast_channel *winner;
 		struct ast_channel *watchers[AST_MAX_WATCHERS];
@@ -597,11 +597,11 @@
 				watchers[pos++] = o->chan;
 			numlines++;
 		}
-		if (pos == 1) {	/* only the input channel is available */
+		if (pos == 1) { /* only the input channel is available */
 			if (numlines == (num.busy + num.congestion + num.nochan)) {
 				ast_verb(2, "Everyone is busy/congested at this time (%d:%d/%d/%d)\n", numlines, num.busy, num.congestion, num.nochan);
 				if (num.busy)
-					strcpy(pa->status, "BUSY");	
+					strcpy(pa->status, "BUSY");
 				else if (num.congestion)
 					strcpy(pa->status, "CONGESTION");
 				else if (num.nochan)
@@ -624,12 +624,12 @@
 					ast_verb(3, "%s answered %s\n", c->name, in->name);
 					peer = c;
 					ast_copy_flags64(peerflags, o,
-						       OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
-						       OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
-						       OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
-						       OPT_CALLEE_PARK | OPT_CALLER_PARK |
-						       OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
-						       DIAL_NOFORWARDHTML);
+						OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
+						OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
+						OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
+						OPT_CALLEE_PARK | OPT_CALLER_PARK |
+						OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
+						DIAL_NOFORWARDHTML);
 					ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
 					ast_copy_string(c->exten, "", sizeof(c->exten));
 				}
@@ -662,12 +662,12 @@
 						ast_verb(3, "%s answered %s\n", c->name, in->name);
 						peer = c;
 						ast_copy_flags64(peerflags, o,
-							       OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
-							       OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
-							       OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
-							       OPT_CALLEE_PARK | OPT_CALLER_PARK |
-							       OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
-							       DIAL_NOFORWARDHTML);
+							OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
+							OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
+							OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
+							OPT_CALLEE_PARK | OPT_CALLER_PARK |
+							OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
+							DIAL_NOFORWARDHTML);
 						ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
 						ast_copy_string(c->exten, "", sizeof(c->exten));
 						if (CAN_EARLY_BRIDGE(peerflags))
@@ -683,7 +683,7 @@
 					in->hangupcause = c->hangupcause;
 					ast_hangup(c);
 					c = o->chan = NULL;
-					ast_clear_flag64(o, DIAL_STILLGOING);	
+					ast_clear_flag64(o, DIAL_STILLGOING);
 					handle_cause(AST_CAUSE_BUSY, &num);
 					break;
 				case AST_CONTROL_CONGESTION:
@@ -748,7 +748,7 @@
 			} else if (single) {
 				/* XXX are we sure the logic is correct ? or we should just switch on f->frametype ? */
 				if (f->frametype == AST_FRAME_VOICE && !ast_test_flag64(outgoing, OPT_RINGBACK|OPT_MUSICBACK)) {
-					if (ast_write(in, f)) 
+					if (ast_write(in, f))

[... 3481 lines stripped ...]



More information about the asterisk-commits mailing list