[Asterisk-code-review] cel, cdr, apps: Remove whitespace ...the battle continues. (asterisk[master])

Rodrigo Ramirez Norambuena asteriskteam at digium.com
Tue Jun 2 15:34:13 CDT 2015


Rodrigo Ramirez Norambuena has uploaded a new change for review.

  https://gerrit.asterisk.org/571

Change subject: cel, cdr, apps: Remove whitespace ...the battle continues.
......................................................................

cel, cdr, apps: Remove whitespace ...the battle continues.

Change-Id: Id7cf800f66e1b83903af75f432da420c16c115d6
---
M apps/app_adsiprog.c
M apps/app_amd.c
M apps/app_authenticate.c
M apps/app_chanspy.c
M apps/app_controlplayback.c
M apps/app_dahdiras.c
M apps/app_dial.c
M apps/app_dictate.c
M apps/app_directory.c
M apps/app_echo.c
M apps/app_externalivr.c
M apps/app_fax.c
M apps/app_festival.c
M apps/app_flash.c
M apps/app_followme.c
M apps/app_forkcdr.c
M apps/app_getcpeid.c
M apps/app_ices.c
M apps/app_image.c
M apps/app_ivrdemo.c
M apps/app_macro.c
M apps/app_meetme.c
M apps/app_milliwatt.c
M apps/app_minivm.c
M apps/app_morsecode.c
M apps/app_mp3.c
M apps/app_nbscat.c
M apps/app_playback.c
M apps/app_read.c
M apps/app_readexten.c
M apps/app_record.c
M apps/app_sayunixtime.c
M apps/app_senddtmf.c
M apps/app_sendtext.c
M apps/app_setcallerid.c
M apps/app_skel.c
M apps/app_sms.c
M apps/app_softhangup.c
M apps/app_speech_utils.c
M apps/app_stack.c
M apps/app_talkdetect.c
M apps/app_test.c
M apps/app_transfer.c
M apps/app_url.c
M apps/app_userevent.c
M apps/app_voicemail.c
M apps/app_waitforring.c
M apps/app_waitforsilence.c
M apps/app_while.c
M apps/app_zapateller.c
M cdr/cdr_radius.c
M cel/cel_odbc.c
52 files changed, 702 insertions(+), 702 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/71/571/1

diff --git a/apps/app_adsiprog.c b/apps/app_adsiprog.c
index 3f3d11c..566157f 100644
--- a/apps/app_adsiprog.c
+++ b/apps/app_adsiprog.c
@@ -29,7 +29,7 @@
  * \addtogroup configuration_file Configuration Files
  */
 
-/*! 
+/*!
  * \page adsi.conf adsi.conf
  * \verbinclude adsi.conf.sample
  */
@@ -935,7 +935,7 @@
 };
 
 static const struct adsi_key_cmd opcmds[] = {
-	
+
 	/* 1 - Branch on event -- handled specially */
 	{ "SHOWKEYS", 2, showkeys },
 	/* Display Control */
@@ -1575,7 +1575,7 @@
 static int adsi_exec(struct ast_channel *chan, const char *data)
 {
 	int res = 0;
-	
+
 	if (ast_strlen_zero(data))
 		data = "asterisk.adsi";
 
@@ -1600,8 +1600,8 @@
  * Module loading including tests for configuration or dependencies.
  * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE,
  * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails
- * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the 
- * configuration file or other non-critical problem return 
+ * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the
+ * configuration file or other non-critical problem return
  * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
  */
 static int load_module(void)
diff --git a/apps/app_amd.c b/apps/app_amd.c
index ee421b6..05aacc5 100644
--- a/apps/app_amd.c
+++ b/apps/app_amd.c
@@ -32,7 +32,7 @@
  * \addtogroup configuration_file Configuration Files
  */
 
-/*! 
+/*!
  * \page amd.conf amd.conf
  * \verbinclude amd.conf.sample
  */
@@ -130,7 +130,7 @@
 					</value>
 					<value name="MAXWORDS">
 						Word Count - maximum number of words.
-					</value>	
+					</value>
 				</variable>
 			</variablelist>
 		</description>
@@ -316,7 +316,7 @@
 
 			if (dspsilence > 0) {
 				silenceDuration = dspsilence;
-				
+
 				if (silenceDuration >= betweenWordsSilence) {
 					if (currentState != STATE_IN_SILENCE ) {
 						ast_verb(3, "AMD: Channel [%s]. Changed state to STATE_IN_SILENCE\n", ast_channel_name(chan));
@@ -338,7 +338,7 @@
 					res = 1;
 					break;
 				}
-				
+
 				if (silenceDuration >= afterGreetingSilence  &&  inGreeting == 1) {
 					ast_verb(3, "AMD: Channel [%s]. HUMAN: silenceDuration:%d afterGreetingSilence:%d\n",
 						ast_channel_name(chan), silenceDuration, afterGreetingSilence);
@@ -348,7 +348,7 @@
 					res = 1;
 					break;
 				}
-				
+
 			} else {
 				consecutiveVoiceDuration += framelength;
 				voiceDuration += framelength;
@@ -397,12 +397,12 @@
 					inInitialSilence = 0;
 					inGreeting = 1;
 				}
-				
+
 			}
 		}
 		ast_frfree(f);
 	}
-	
+
 	if (!res) {
 		/* It took too long to get a frame back. Giving up. */
 		ast_verb(3, "AMD: Channel [%s]. Too long...\n", ast_channel_name(chan));
@@ -507,8 +507,8 @@
  * Module loading including tests for configuration or dependencies.
  * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE,
  * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails
- * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the 
- * configuration file or other non-critical problem return 
+ * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the
+ * configuration file or other non-critical problem return
  * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
  */
 static int load_module(void)
diff --git a/apps/app_authenticate.c b/apps/app_authenticate.c
index f47db45..8dfb3d4 100644
--- a/apps/app_authenticate.c
+++ b/apps/app_authenticate.c
@@ -103,7 +103,7 @@
 		</syntax>
 		<description>
 			<para>This application asks the caller to enter a given password in order to continue dialplan execution.</para>
-			<para>If the password begins with the <literal>/</literal> character, 
+			<para>If the password begins with the <literal>/</literal> character,
 			it is interpreted as a file which contains a list of valid passwords, listed 1 password per line in the file.</para>
 			<para>When using a database key, the value associated with the key can be anything.</para>
 			<para>Users have three attempts to authenticate before the channel is hung up.</para>
@@ -158,7 +158,7 @@
 	} else {
 		prompt = "agent-pass";
 	}
-   
+
 	/* Start asking for password */
 	for (retries = 0; retries < 3; retries++) {
 		if ((res = ast_app_getdata(chan, prompt, passwd, maxdigits, 0)) < 0)
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 3c7a917..e2a3a91 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -101,7 +101,7 @@
 					<option name="e">
 						<argument name="ext" required="true" />
 						<para>Enable <emphasis>enforced</emphasis> mode, so the spying channel can
-						only monitor extensions whose name is in the <replaceable>ext</replaceable> : delimited 
+						only monitor extensions whose name is in the <replaceable>ext</replaceable> : delimited
 						list.</para>
 					</option>
 					<option name="E">
@@ -113,7 +113,7 @@
 							listed in <replaceable>grp</replaceable> matches one or more groups from the
 							<variable>SPYGROUP</variable> variable set on the channel to be spied upon.</para>
 						</argument>
-						<note><para>both <replaceable>grp</replaceable> and <variable>SPYGROUP</variable> can contain 
+						<note><para>both <replaceable>grp</replaceable> and <variable>SPYGROUP</variable> can contain
 						either a single group or a colon-delimited list of groups, such
 						as <literal>sales:support:accounting</literal>.</para></note>
 					</option>
@@ -135,7 +135,7 @@
 						selected channel name.</para>
 					</option>
 					<option name="r">
-						<para>Record the session to the monitor spool directory. An optional base for the filename 
+						<para>Record the session to the monitor spool directory. An optional base for the filename
 						may be specified. The default is <literal>chanspy</literal>.</para>
 						<argument name="basename" />
 					</option>
@@ -152,7 +152,7 @@
 					</option>
 					<option name="v">
 						<argument name="value" />
-						<para>Adjust the initial volume in the range from <literal>-4</literal> 
+						<para>Adjust the initial volume in the range from <literal>-4</literal>
 						to <literal>4</literal>. A negative value refers to a quieter setting.</para>
 					</option>
 					<option name="w">
@@ -177,11 +177,11 @@
 						name of the last channel that was spied on will be stored
 						in the <variable>SPY_CHANNEL</variable> variable.</para>
 					</option>
-				</optionlist>		
+				</optionlist>
 			</parameter>
 		</syntax>
 		<description>
-			<para>This application is used to listen to the audio from an Asterisk channel. This includes the audio 
+			<para>This application is used to listen to the audio from an Asterisk channel. This includes the audio
 			coming in and out of the channel being spied on. If the <literal>chanprefix</literal> parameter is specified,
 			only channels beginning with this string will be spied upon.</para>
 			<para>While spying, the following actions may be performed:</para>
@@ -246,7 +246,7 @@
 					<option name="e">
 						<argument name="ext" required="true" />
 						<para>Enable <emphasis>enforced</emphasis> mode, so the spying channel can
-						only monitor extensions whose name is in the <replaceable>ext</replaceable> : delimited 
+						only monitor extensions whose name is in the <replaceable>ext</replaceable> : delimited
 						list.</para>
 					</option>
 					<option name="E">
@@ -258,7 +258,7 @@
 							listed in <replaceable>grp</replaceable> matches one or more groups from the
 							<variable>SPYGROUP</variable> variable set on the channel to be spied upon.</para>
 						</argument>
-						<note><para>both <replaceable>grp</replaceable> and <variable>SPYGROUP</variable> can contain 
+						<note><para>both <replaceable>grp</replaceable> and <variable>SPYGROUP</variable> can contain
 						either a single group or a colon-delimited list of groups, such
 						as <literal>sales:support:accounting</literal>.</para></note>
 					</option>
@@ -280,7 +280,7 @@
 						selected channel name.</para>
 					</option>
 					<option name="r">
-						<para>Record the session to the monitor spool directory. An optional base for the filename 
+						<para>Record the session to the monitor spool directory. An optional base for the filename
 						may be specified. The default is <literal>chanspy</literal>.</para>
 						<argument name="basename" />
 					</option>
@@ -293,7 +293,7 @@
 					</option>
 					<option name="v">
 						<argument name="value" />
-						<para>Adjust the initial volume in the range from <literal>-4</literal> 
+						<para>Adjust the initial volume in the range from <literal>-4</literal>
 						to <literal>4</literal>. A negative value refers to a quieter setting.</para>
 					</option>
 					<option name="w">
@@ -318,13 +318,13 @@
 						name of the last channel that was spied on will be stored
 						in the <variable>SPY_CHANNEL</variable> variable.</para>
 					</option>
-				</optionlist>	
+				</optionlist>
 			</parameter>
 		</syntax>
 		<description>
-			<para>This application is used to listen to the audio from an Asterisk channel. This includes 
+			<para>This application is used to listen to the audio from an Asterisk channel. This includes
 			the audio coming in and out of the channel being spied on. Only channels created by outgoing calls for the
-			specified extension will be selected for spying. If the optional context is not supplied, 
+			specified extension will be selected for spying. If the optional context is not supplied,
 			the current channel's context will be used.</para>
 			<para>While spying, the following actions may be performed:</para>
 			<para> - Dialing <literal>#</literal> cycles the volume level.</para>
@@ -969,7 +969,7 @@
 		for (autochan = next_channel(iter, autochan, chan);
 		     autochan;
 			 prev = autochan->chan, ast_autochan_destroy(autochan),
-		     autochan = next_autochan ? next_autochan : 
+		     autochan = next_autochan ? next_autochan :
 				next_channel(iter, autochan, chan), next_autochan = NULL) {
 			int igrp = !mygroup;
 			int ienf = !myenforced;
@@ -1006,7 +1006,7 @@
 				num_mygroups = ast_app_separate_args(dup_mygroup, ':', mygroups,
 					ARRAY_LEN(mygroups));
 
-				/* Before dahdi scan was part of chanspy, it would use the "GROUP" variable 
+				/* Before dahdi scan was part of chanspy, it would use the "GROUP" variable
 				 * rather than "SPYGROUP", this check is done to preserve expected behavior */
 				if (ast_test_flag(flags, OPTION_DAHDI_SCAN)) {
 					group = pbx_builtin_getvar_helper(autochan->chan, "GROUP");
diff --git a/apps/app_controlplayback.c b/apps/app_controlplayback.c
index 45580e4..1fa194a 100644
--- a/apps/app_controlplayback.c
+++ b/apps/app_controlplayback.c
@@ -221,7 +221,7 @@
 		ast_log(LOG_WARNING, "ControlPlayback requires an argument (filename)\n");
 		return -1;
 	}
-	
+
 	tmp = ast_strdupa(data);
 	AST_STANDARD_APP_ARGS(args, tmp);
 
diff --git a/apps/app_dahdiras.c b/apps/app_dahdiras.c
index e8bdad0..756fc67 100644
--- a/apps/app_dahdiras.c
+++ b/apps/app_dahdiras.c
@@ -21,7 +21,7 @@
  * \brief Execute an ISDN RAS
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
@@ -138,7 +138,7 @@
 	int signalled = 0;
 	struct dahdi_bufferinfo savebi;
 	int x;
-	
+
 	res = ioctl(ast_channel_fd(chan, 0), DAHDI_GET_BUFINFO, &savebi);
 	if(res) {
 		ast_log(LOG_WARNING, "Unable to check buffer policy on channel %s\n", ast_channel_name(chan));
@@ -168,7 +168,7 @@
 			if (WIFEXITED(status)) {
 				ast_verb(3, "RAS on %s terminated with status %d\n", ast_channel_name(chan), WEXITSTATUS(status));
 			} else if (WIFSIGNALED(status)) {
-				ast_verb(3, "RAS on %s terminated with signal %d\n", 
+				ast_verb(3, "RAS on %s terminated with signal %d\n",
 					 ast_channel_name(chan), WTERMSIG(status));
 			} else {
 				ast_verb(3, "RAS on %s terminated weirdly.\n", ast_channel_name(chan));
@@ -194,11 +194,11 @@
 	char *args;
 	struct dahdi_params dahdip;
 
-	if (!data) 
+	if (!data)
 		data = "";
 
 	args = ast_strdupa(data);
-	
+
 	/* Answer the channel if it's not up */
 	if (ast_channel_state(chan) != AST_STATE_UP)
 		ast_answer(chan);
@@ -223,7 +223,7 @@
 	return res;
 }
 
-static int unload_module(void) 
+static int unload_module(void)
 {
 	return ast_unregister_application(app);
 }
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 895d4b8..2c2dac9 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -381,7 +381,7 @@
 					</argument>
 				</option>
                                 <option name="R">
-                                        <para>Default: Indicate ringing to the calling party, even if the called party isn't actually ringing. 
+                                        <para>Default: Indicate ringing to the calling party, even if the called party isn't actually ringing.
 					Allow interruption of the ringback if early media is received on the channel.</para>
                                 </option>
 				<option name="S">
diff --git a/apps/app_dictate.c b/apps/app_dictate.c
index 0e4ef8d..ee571bb 100644
--- a/apps/app_dictate.c
+++ b/apps/app_dictate.c
@@ -202,7 +202,7 @@
 						samples += ffactor;
 						ast_seekstream(fs, samples, SEEK_SET);
 						break;
-						
+
 					default:
 						got = 0;
 					}
@@ -258,7 +258,7 @@
 						break;
 					}
 				}
-				
+
 			} else if (f->frametype == AST_FRAME_VOICE) {
 				switch(mode) {
 					struct ast_frame *fr;
@@ -330,7 +330,7 @@
 					}
 					break;
 				}
-				
+
 			}
 
 			ast_frfree(f);
diff --git a/apps/app_directory.c b/apps/app_directory.c
index c872886..60bace8 100644
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -49,9 +49,9 @@
 		</synopsis>
 		<syntax>
 			<parameter name="vm-context">
-				<para>This is the context within voicemail.conf to use for the Directory. If not 
-				specified and <literal>searchcontexts=no</literal> in 
-				<filename>voicemail.conf</filename>, then <literal>default</literal> 
+				<para>This is the context within voicemail.conf to use for the Directory. If not
+				specified and <literal>searchcontexts=no</literal> in
+				<filename>voicemail.conf</filename>, then <literal>default</literal>
 				will be assumed.</para>
 			</parameter>
 			<parameter name="dial-context" required="false">
@@ -107,7 +107,7 @@
 					</option>
 				</optionlist>
 				<note><para>Only one of the <replaceable>f</replaceable>, <replaceable>l</replaceable>, or <replaceable>b</replaceable>
-				options may be specified. <emphasis>If more than one is specified</emphasis>, then Directory will act as 
+				options may be specified. <emphasis>If more than one is specified</emphasis>, then Directory will act as
 				if <replaceable>b</replaceable> was specified.  The number
 				of characters for the user to type defaults to <literal>3</literal>.</para></note>
 
@@ -366,7 +366,7 @@
 			if (!res)
 				res = ast_waitfordigit(chan, 3000);
 			ast_stopstream(chan);
-	
+
 			if (res == '0') { /* operator selected */
 				goto_exten(chan, dialcontext, "o");
 				pbx_builtin_setvar_helper(chan, "DIRECTORY_RESULT", "OPERATOR");
@@ -921,7 +921,7 @@
 				res = ast_stream_and_wait(chan, digits, AST_DIGIT_ANY);
 			}
 			if (!res) {
-				res = ast_stream_and_wait(chan, 
+				res = ast_stream_and_wait(chan,
 					which == FIRST ? "dir-first" :
 					which == LAST ? "dir-last" :
 					"dir-firstlast", AST_DIGIT_ANY);
diff --git a/apps/app_echo.c b/apps/app_echo.c
index 2ec9d70..02836ee 100644
--- a/apps/app_echo.c
+++ b/apps/app_echo.c
@@ -44,7 +44,7 @@
 		</synopsis>
 		<syntax />
 		<description>
-			<para>Echos back any media or DTMF frames read from the calling 
+			<para>Echos back any media or DTMF frames read from the calling
 			channel back to itself. This will not echo CONTROL, MODEM, or NULL
 			frames. Note: If '#' detected application exits.</para>
 			<para>This application does not automatically answer and should be
diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c
index 2bb1d8b..123750a 100644
--- a/apps/app_externalivr.c
+++ b/apps/app_externalivr.c
@@ -151,8 +151,8 @@
 	int sample_queue;
 };
 
-static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u, 
-	int *eivr_events_fd, int *eivr_commands_fd, int *eivr_errors_fd, 
+static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u,
+	int *eivr_events_fd, int *eivr_commands_fd, int *eivr_errors_fd,
 	const struct ast_str *args, const struct ast_flags flags);
 
 static void send_eivr_event(FILE *handle, const char event, const char *data,
@@ -307,7 +307,7 @@
 	char *inbuf, *variable;
 	const char *value;
 	int j;
-	struct ast_str *newstring = ast_str_alloca(outbuflen); 
+	struct ast_str *newstring = ast_str_alloca(outbuflen);
 
 	outbuf[0] = '\0';
 
@@ -320,7 +320,7 @@
 			}
 			break;
 		}
-		
+
 		ast_channel_lock(chan);
 		if (!(value = pbx_builtin_getvar_helper(chan, variable))) {
 			value = "";
@@ -410,7 +410,7 @@
 
 	char *buf;
 	int j;
-	char *s, **app_args, *e; 
+	char *s, **app_args, *e;
 	struct ast_str *comma_delim_args = ast_str_alloca(100);
 
 	AST_DECLARE_APP_ARGS(eivr_args,
@@ -472,7 +472,7 @@
 	if (ast_test_flag(&flags, run_dead)) {
 		ast_verb(4, "run_dead is set\n");
 	}
-	
+
 	if (!(ast_test_flag(&flags, noanswer))) {
 		ast_verb(3, "Answering channel and starting generator\n");
 		if (ast_channel_state(chan) != AST_STATE_UP) {
@@ -541,18 +541,18 @@
 			ast_chan_log(LOG_ERROR, chan, "Could not create pipe for child errors: %s\n", strerror(errno));
 			goto exit;
 		}
-	
+
 		pid = ast_safe_fork(0);
 		if (pid < 0) {
 			ast_log(LOG_ERROR, "Failed to fork(): %s\n", strerror(errno));
 			goto exit;
 		}
-	
+
 		if (!pid) {
 			/* child process */
 			if (ast_opt_high_priority)
 				ast_set_priority(0);
-	
+
 			dup2(child_stdin[0], STDIN_FILENO);
 			dup2(child_stdout[1], STDOUT_FILENO);
 			dup2(child_stderr[1], STDERR_FILENO);
@@ -603,8 +603,8 @@
 	return res;
 }
 
-static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u, 
- 				int *eivr_events_fd, int *eivr_commands_fd, int *eivr_errors_fd, 
+static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u,
+ 				int *eivr_events_fd, int *eivr_commands_fd, int *eivr_errors_fd,
  				const struct ast_str *args, const struct ast_flags flags)
 {
 	struct playlist_entry *entry;
@@ -617,7 +617,7 @@
  	int res = -1;
 	int test_available_fd = -1;
 	int hangup_info_sent = 0;
-  
+
  	FILE *eivr_commands = NULL;
  	FILE *eivr_errors = NULL;
  	FILE *eivr_events = NULL;
@@ -638,7 +638,7 @@
 	}
 
 	test_available_fd = open("/dev/null", O_RDONLY);
- 
+
  	setvbuf(eivr_events, NULL, _IONBF, 0);
  	setvbuf(eivr_commands, NULL, _IONBF, 0);
  	if (eivr_errors) {
@@ -661,14 +661,14 @@
 	 			break;
 			}
  		}
- 
+
  		ready_fd = 0;
  		ms = 100;
  		errno = 0;
  		exception = 0;
- 
+
  		rchan = ast_waitfor_nandfds(&chan, 1, waitfds, (eivr_errors_fd) ? 2 : 1, &exception, &ready_fd, &ms);
- 
+
  		if (ast_channel_state(chan) == AST_STATE_UP && !AST_LIST_EMPTY(&u->finishlist)) {
  			AST_LIST_LOCK(&u->finishlist);
  			while ((entry = AST_LIST_REMOVE_HEAD(&u->finishlist, list))) {
@@ -677,7 +677,7 @@
  			}
  			AST_LIST_UNLOCK(&u->finishlist);
  		}
- 
+
  		if (ast_channel_state(chan) == AST_STATE_UP && !(ast_check_hangup(chan)) && rchan) {
  			/* the channel has something */
  			f = ast_read(chan);
@@ -717,12 +717,12 @@
  			ast_frfree(f);
  		} else if (ready_fd == *eivr_commands_fd) {
  			char input[1024];
- 
+
  			if (exception || (dup2(*eivr_commands_fd, test_available_fd) == -1) || feof(eivr_commands)) {
  				ast_chan_log(LOG_ERROR, chan, "Child process went away\n");
   				break;
   			}
-  
+
 			if (!fgets(input, sizeof(input), eivr_commands)) {
 				continue;
 			}
@@ -871,7 +871,7 @@
  			}
  		} else if (eivr_errors_fd && (ready_fd == *eivr_errors_fd)) {
  			char input[1024];
-  
+
  			if (exception || feof(eivr_errors)) {
  				ast_chan_log(LOG_ERROR, chan, "Child process went away\n");
  				break;
@@ -879,15 +879,15 @@
  			if (fgets(input, sizeof(input), eivr_errors)) {
  				ast_chan_log(LOG_NOTICE, chan, "stderr: %s\n", ast_strip(input));
  			}
- 		} else if ((ready_fd < 0) && ms) { 
+ 		} else if ((ready_fd < 0) && ms) {
  			if (errno == 0 || errno == EINTR)
  				continue;
- 
+
  			ast_chan_log(LOG_ERROR, chan, "Wait failed (%s)\n", strerror(errno));
  			break;
  		}
  	}
- 
+
 	exit:
 	if (test_available_fd > -1) {
 		close(test_available_fd);
diff --git a/apps/app_fax.c b/apps/app_fax.c
index d6e9b4d..afbbba5 100644
--- a/apps/app_fax.c
+++ b/apps/app_fax.c
@@ -2,7 +2,7 @@
  * Asterisk -- An open source telephony toolkit.
  *
  * Simple fax applications
- * 
+ *
  * 2007-2008, Dmitry Andrianov <asterisk at dima.spb.ru>
  *
  * Code based on original implementation by Steve Underwood <steveu at coppice.org>
@@ -102,12 +102,12 @@
 				<para>Filename of TIFF file save incoming fax</para>
 			</parameter>
 			<parameter name="c" required="false">
-				<para>Makes the application behave as the calling machine</para> 
+				<para>Makes the application behave as the calling machine</para>
 				<para>(Default behavior is as answering machine)</para>
 			</parameter>
 		</syntax>
 		<description>
-			<para>Receives a FAX from the channel into the given filename 
+			<para>Receives a FAX from the channel into the given filename
 			overwriting the file if it already exists.</para>
 			<para>File created will be in TIFF format.</para>
 
@@ -284,7 +284,7 @@
 	int level = SPAN_LOG_WARNING + option_debug;
 
 	span_log_set_message_handler(state, span_message);
-	span_log_set_level(state, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | level); 
+	span_log_set_level(state, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | level);
 
 	return 0;
 }
@@ -330,7 +330,7 @@
 	fax_state_t *fax = (fax_state_t*) data;
 	uint8_t buffer[AST_FRIENDLY_OFFSET + MAX_SAMPLES * sizeof(uint16_t)];
 	int16_t *buf = (int16_t *) (buffer + AST_FRIENDLY_OFFSET);
-    
+
 	struct ast_frame outf = {
 		.frametype = AST_FRAME_VOICE,
 		.subclass.format = ast_format_slin,
@@ -341,7 +341,7 @@
 		ast_log(LOG_WARNING, "Only generating %d samples, where %d requested\n", MAX_SAMPLES, samples);
 		samples = MAX_SAMPLES;
 	}
-	
+
 	if ((len = fax_tx(fax, buf, samples)) > 0) {
 		outf.samples = len;
 		AST_FRAME_SET_BUFFER(&outf, buffer, AST_FRIENDLY_OFFSET, len * sizeof(int16_t));
@@ -781,14 +781,14 @@
 
 	/* Clear all channel variables which to be set by the application.
 	   Pre-set status to error so in case of any problems we can just leave */
-	pbx_builtin_setvar_helper(s->chan, "FAXSTATUS", "FAILED"); 
-	pbx_builtin_setvar_helper(s->chan, "FAXERROR", "Channel problems"); 
+	pbx_builtin_setvar_helper(s->chan, "FAXSTATUS", "FAILED");
+	pbx_builtin_setvar_helper(s->chan, "FAXERROR", "Channel problems");
 
 	pbx_builtin_setvar_helper(s->chan, "FAXMODE", NULL);
 	pbx_builtin_setvar_helper(s->chan, "REMOTESTATIONID", NULL);
 	pbx_builtin_setvar_helper(s->chan, "FAXPAGES", "0");
 	pbx_builtin_setvar_helper(s->chan, "FAXRESOLUTION", NULL);
-	pbx_builtin_setvar_helper(s->chan, "FAXBITRATE", NULL); 
+	pbx_builtin_setvar_helper(s->chan, "FAXBITRATE", NULL);
 
 	if (ast_channel_state(s->chan) != AST_STATE_UP) {
 		/* Shouldn't need this, but checking to see if channel is already answered
@@ -802,8 +802,8 @@
 
 	s->t38state = ast_channel_get_t38_state(s->chan);
 	if (s->t38state != T38_STATE_NEGOTIATED) {
-		/* T38 is not negotiated on the channel yet. First start regular transmission. If it switches to T38, follow */	
-		pbx_builtin_setvar_helper(s->chan, "FAXMODE", "audio"); 
+		/* T38 is not negotiated on the channel yet. First start regular transmission. If it switches to T38, follow */
+		pbx_builtin_setvar_helper(s->chan, "FAXMODE", "audio");
 		res = transmit_audio(s);
 		if (res > 0) {
 			/* transmit_audio reports switchover to T38. Update t38state */
@@ -815,7 +815,7 @@
 	}
 
 	if (s->t38state == T38_STATE_NEGOTIATED) {
-		pbx_builtin_setvar_helper(s->chan, "FAXMODE", "T38"); 
+		pbx_builtin_setvar_helper(s->chan, "FAXMODE", "T38");
 		res = transmit_t38(s);
 	}
 
@@ -859,7 +859,7 @@
 
 	parse = ast_strdupa(data);
 	AST_STANDARD_APP_ARGS(args, parse);
-	
+
 	session.caller_mode = TRUE;
 
 	if (args.options) {
@@ -928,7 +928,7 @@
 
 	parse = ast_strdupa(data);
 	AST_STANDARD_APP_ARGS(args, parse);
-	
+
 	session.caller_mode = FALSE;
 
 	if (args.options) {
@@ -975,8 +975,8 @@
 {
 	int res;
 
-	res = ast_unregister_application(app_sndfax_name);	
-	res |= ast_unregister_application(app_rcvfax_name);	
+	res = ast_unregister_application(app_sndfax_name);
+	res |= ast_unregister_application(app_rcvfax_name);
 
 	return res;
 }
diff --git a/apps/app_festival.c b/apps/app_festival.c
index 19c9f33..46a7031 100644
--- a/apps/app_festival.c
+++ b/apps/app_festival.c
@@ -23,7 +23,7 @@
  * \author Christos Ricudis <ricudis at itc.auth.gr>
  *
  * \extref  The Festival Speech Synthesis System - http://www.cstr.ed.ac.uk/projects/festival/
- * 
+ *
  * \ingroup applications
  */
 
@@ -31,7 +31,7 @@
  * \addtogroup configuration_file Configuration Files
  */
 
-/*! 
+/*!
  * \page festival.conf festival.conf
  * \verbinclude festival.conf.sample
  */
@@ -198,7 +198,7 @@
 		ast_answer(chan);
 	ast_stopstream(chan);
 	ast_indicate(chan, -1);
-	
+
 	owriteformat = ao2_bump(ast_channel_writeformat(chan));
 	res = ast_set_write_format(chan, ast_format_slin);
 	if (res < 0) {
@@ -212,7 +212,7 @@
 	myf.f.offset = AST_FRIENDLY_OFFSET;
 	myf.f.src = __PRETTY_FUNCTION__;
 	myf.f.data.ptr = myf.frdata;
-	
+
 	res = send_waveform_to_fd(waveform, length, fds[1]);
 	if (res >= 0) {
 		/* Order is important -- there's almost always going to be mp3...  we want to prioritize the
@@ -308,8 +308,8 @@
 	int strln;
 	int fdesc = -1;
 	char buffer[16384];
-	int seekpos = 0;	
-	char *data;	
+	int seekpos = 0;
+	char *data;
 	struct ast_config *cfg;
 	char *newfestivalcommand;
 	struct ast_flags config_flags = { 0 };
@@ -381,13 +381,13 @@
 		newfestivalcommand[j] = '\0';
 		festivalcommand = newfestivalcommand;
 	}
-	
+
 	if (args.interrupt && !strcasecmp(args.interrupt, "any"))
 		args.interrupt = AST_DIGIT_ANY;
 
 	ast_debug(1, "Text passed to festival server : %s\n", args.text);
 	/* Connect to local festival server */
-	
+
 	fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
 
 	if (fd < 0) {
@@ -425,7 +425,7 @@
 	MD5Final(MD5Res, &md5ctx);
 	MD5Hex[0] = '\0';
 
-	/* Convert to HEX and look if there is any matching file in the cache 
+	/* Convert to HEX and look if there is any matching file in the cache
 		directory */
 	for (i = 0; i < 16; i++) {
 		snprintf(koko, sizeof(koko), "%X", (unsigned)MD5Res[i]);
@@ -462,7 +462,7 @@
 					ast_log(LOG_WARNING, "read() failed: %s\n", strerror(errno));
 				}
 				bigstring[strln] = 0;
-				if (strcmp(bigstring, args.text) == 0) { 
+				if (strcmp(bigstring, args.text) == 0) {
 					readcache = 1;
 				} else {
 					ast_log(LOG_WARNING, "Strings do not match\n");
@@ -485,7 +485,7 @@
 		fflush(fs);
 		fclose(fs);
 	}
-	
+
 	/* Write to cache and then pass it down */
 	if (writecache == 1) {
 		ast_debug(1, "Writing result to cache...\n");
@@ -499,7 +499,7 @@
 		fd = open(cachefile, O_RDWR);
 		lseek(fd, seekpos, SEEK_SET);
 	}
-	
+
 	ast_debug(1, "Passing data to channel...\n");
 
 	/* Read back info from server */
@@ -556,8 +556,8 @@
  * Module loading including tests for configuration or dependencies.
  * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE,
  * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails
- * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the 
- * configuration file or other non-critical problem return 
+ * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the
+ * configuration file or other non-critical problem return
  * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
  */
 static int load_module(void)
diff --git a/apps/app_flash.c b/apps/app_flash.c
index 79ce0d0..30ecf31 100644
--- a/apps/app_flash.c
+++ b/apps/app_flash.c
@@ -21,10 +21,10 @@
  * \brief App to flash a DAHDI trunk
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
- 
+
 /*** MODULEINFO
 	<depend>dahdi</depend>
 	<support_level>core</support_level>
@@ -83,7 +83,7 @@
 		ast_log(LOG_WARNING, "%s is not a DAHDI channel\n", ast_channel_name(chan));
 		return -1;
 	}
-	
+
 	memset(&dahdip, 0, sizeof(dahdip));
 	res = ioctl(ast_channel_fd(chan, 0), DAHDI_GET_PARAMS, &dahdip);
 	if (!res) {
diff --git a/apps/app_followme.c b/apps/app_followme.c
index d2000fd..0e65cde 100644
--- a/apps/app_followme.c
+++ b/apps/app_followme.c
@@ -2,7 +2,7 @@
  * Asterisk -- An open source telephony toolkit.
  *
  * A full-featured Find-Me/Follow-Me Application
- * 
+ *
  * Copyright (C) 2005-2006, BJ Weschke All Rights Reserved.
  *
  * BJ Weschke <bweschke at btwtech.com>
@@ -30,7 +30,7 @@
  * \addtogroup configuration_file Configuration Files
  */
 
-/*! 
+/*!
  * \page followme.conf followme.conf
  * \verbinclude followme.conf.sample
  */
@@ -331,15 +331,15 @@
 	ast_copy_string(f->moh, defaultmoh, sizeof(f->moh));
 }
 
-   
-   
+
+
 /*! \brief Set parameter in profile from configuration file */
 static void profile_set_param(struct call_followme *f, const char *param, const char *val, int linenum, int failunknown)
 {
 
-	if (!strcasecmp(param, "musicclass") || !strcasecmp(param, "musiconhold") || !strcasecmp(param, "music")) 
+	if (!strcasecmp(param, "musicclass") || !strcasecmp(param, "musiconhold") || !strcasecmp(param, "music"))
 		ast_copy_string(f->moh, val, sizeof(f->moh));
-	else if (!strcasecmp(param, "context")) 
+	else if (!strcasecmp(param, "context"))
 		ast_copy_string(f->context, val, sizeof(f->context));
 	else if (!strcasecmp(param, "takecall"))
 		ast_copy_string(f->takecall, val, sizeof(f->takecall));
@@ -347,15 +347,15 @@
 		ast_copy_string(f->nextindp, val, sizeof(f->nextindp));
 	else if (!strcasecmp(param, "call-from-prompt") || !strcasecmp(param, "call_from_prompt"))
 		ast_copy_string(f->callfromprompt, val, sizeof(f->callfromprompt));
-	else if (!strcasecmp(param, "followme-norecording-prompt") || !strcasecmp(param, "norecording_prompt")) 
+	else if (!strcasecmp(param, "followme-norecording-prompt") || !strcasecmp(param, "norecording_prompt"))
 		ast_copy_string(f->norecordingprompt, val, sizeof(f->norecordingprompt));
-	else if (!strcasecmp(param, "followme-options-prompt") || !strcasecmp(param, "options_prompt")) 
+	else if (!strcasecmp(param, "followme-options-prompt") || !strcasecmp(param, "options_prompt"))
 		ast_copy_string(f->optionsprompt, val, sizeof(f->optionsprompt));
 	else if (!strcasecmp(param, "followme-pls-hold-prompt") || !strcasecmp(param, "pls_hold_prompt"))
 		ast_copy_string(f->plsholdprompt, val, sizeof(f->plsholdprompt));
-	else if (!strcasecmp(param, "followme-status-prompt") || !strcasecmp(param, "status_prompt")) 
+	else if (!strcasecmp(param, "followme-status-prompt") || !strcasecmp(param, "status_prompt"))
 		ast_copy_string(f->statusprompt, val, sizeof(f->statusprompt));
-	else if (!strcasecmp(param, "followme-sorry-prompt") || !strcasecmp(param, "sorry_prompt")) 
+	else if (!strcasecmp(param, "followme-sorry-prompt") || !strcasecmp(param, "sorry_prompt"))
 		ast_copy_string(f->sorryprompt, val, sizeof(f->sorryprompt));
 	else if (failunknown) {
 		if (linenum >= 0)
@@ -521,7 +521,7 @@
 						numorder = atoi(tmp);
 						if (numorder < 0)
 							numorder = 0;
-					} else 
+					} else
 						numorder = 0;
 				} else {
 					timeout = 25;
@@ -530,7 +530,7 @@
 
 				if (!numorder) {
 					idx = 1;
-					AST_LIST_TRAVERSE(&f->numbers, nm, entry) 
+					AST_LIST_TRAVERSE(&f->numbers, nm, entry)
 						idx++;
 					numorder = idx;
 				}
@@ -545,7 +545,7 @@
 			var = var->next;
 		} /* End while(var) loop */
 
-		if (!new) 
+		if (!new)
 			ast_mutex_unlock(&f->lock);
 		else
 			AST_RWLIST_INSERT_HEAD(&followmes, f, entry);
@@ -583,7 +583,7 @@
 	tmpuser->ochan = NULL;
 }
 
-static void clear_unanswered_calls(struct findme_user_listptr *findme_user_list) 
+static void clear_unanswered_calls(struct findme_user_listptr *findme_user_list)
 {
 	struct findme_user *tmpuser;
 
@@ -625,7 +625,7 @@
 	char *callfromname;
 	char *pressbuttonname;
 
-	/* ------------ wait_for_winner_channel start --------------- */ 
+	/* ------------ wait_for_winner_channel start --------------- */
 
 	callfromname = ast_strdupa(tpargs->callfromprompt);
 	pressbuttonname = ast_strdupa(tpargs->optionsprompt);
@@ -634,7 +634,7 @@
 
 	for (;;) {
 		to = 1000;
-		pos = 1; 
+		pos = 1;
 		livechannels = 0;
 		watchers[0] = caller;
 
@@ -782,7 +782,7 @@
 						ast_channel_publish_dial(caller, winner, NULL, "ANSWER");
 						publish_dial_end_event(caller, findme_user_list, winner, "CANCEL");
 						tmpuser->answered = 1;
-						/* If call has been answered, then the eventual hangup is likely to be normal hangup */ 
+						/* If call has been answered, then the eventual hangup is likely to be normal hangup */
 						ast_channel_hangupcause_set(winner, AST_CAUSE_NORMAL_CLEARING);
 						ast_channel_hangupcause_set(caller, AST_CAUSE_NORMAL_CLEARING);
 						ast_verb(3, "Starting playback of %s\n", callfromname);
@@ -924,7 +924,7 @@
 							f->subclass.integer, ast_channel_name(winner));
 						break;
 					}
-				} 
+				}
 				if (tmpuser && tmpuser->state == 3 && f->frametype == AST_FRAME_DTMF) {
 					int cmp_len;
 
@@ -1373,7 +1373,7 @@
 	ast_copy_string(targs->plsholdprompt, f->plsholdprompt, sizeof(targs->plsholdprompt));
 	ast_copy_string(targs->statusprompt, f->statusprompt, sizeof(targs->statusprompt));
 	ast_copy_string(targs->sorryprompt, f->sorryprompt, sizeof(targs->sorryprompt));
-	/* Copy the numbers we're going to use into another list in case the master list should get modified 
+	/* Copy the numbers we're going to use into another list in case the master list should get modified
 	   (and locked) while we're trying to do a follow-me */
 	AST_LIST_HEAD_INIT_NOLOCK(&targs->cnumbers);
 	AST_LIST_TRAVERSE(&f->numbers, nm, entry) {
@@ -1562,8 +1562,8 @@
  * Module loading including tests for configuration or dependencies.
  * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE,
  * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails
- * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the 
- * configuration file or other non-critical problem return 
+ * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the
+ * configuration file or other non-critical problem return
  * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
  */
 static int load_module(void)
diff --git a/apps/app_forkcdr.c b/apps/app_forkcdr.c
index 4ff5cd6..5790f25 100644
--- a/apps/app_forkcdr.c
+++ b/apps/app_forkcdr.c
@@ -22,7 +22,7 @@
  * \author Anthony Minessale anthmct at yahoo.com
  *
  * \note Development of this app Sponsored/Funded by TAAN Softworks Corp
- * 
+ *
  * \ingroup applications
  */
 
diff --git a/apps/app_getcpeid.c b/apps/app_getcpeid.c
index c896f9e..33f4ef7 100644
--- a/apps/app_getcpeid.c
+++ b/apps/app_getcpeid.c
@@ -21,7 +21,7 @@
  * \brief Get ADSI CPE ID
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
@@ -106,7 +106,7 @@
 					cpeid[0], cpeid[1], cpeid[2], cpeid[3]);
 			else
 				strcpy(data[1], "CPEID Unknown");
-			if (gotgeometry) 
+			if (gotgeometry)
 				snprintf(data[2], 80, "Geom: %dx%d, %d buttons", width, height, buttons);
 			else
 				strcpy(data[2], "Geometry unknown");
diff --git a/apps/app_ices.c b/apps/app_ices.c
index 58201c4..da5f356 100644
--- a/apps/app_ices.c
+++ b/apps/app_ices.c
@@ -21,7 +21,7 @@
  * \brief Stream to an icecast server via ICES (see contrib/asterisk-ices.xml)
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * ICES - http://www.icecast.org/ices.php
  *
  * \ingroup applications
@@ -30,7 +30,7 @@
 /*** MODULEINFO
 	<support_level>extended</support_level>
  ***/
- 
+
 #include "asterisk.h"
 
 ASTERISK_REGISTER_FILE()
@@ -79,7 +79,7 @@
 	int res;
 
 	res = ast_safe_fork(0);
-	if (res < 0) 
+	if (res < 0)
 		ast_log(LOG_WARNING, "Fork failed\n");
 	if (res) {
 		return res;
@@ -90,8 +90,8 @@
 	dup2(fd, STDIN_FILENO);
 	ast_close_fds_above_n(STDERR_FILENO);
 
-	/* Most commonly installed in /usr/local/bin 
-	 * But many places has it in /usr/bin 
+	/* Most commonly installed in /usr/local/bin
+	 * But many places has it in /usr/bin
 	 * As a last-ditch effort, try to use PATH
 	 */
 	execl(path_LOCAL "ices2", "ices", filename, SENTINEL);
@@ -125,19 +125,19 @@
 		ast_log(LOG_WARNING, "ICES requires an argument (configfile.xml)\n");
 		return -1;
 	}
-	
+
 	if (pipe(fds)) {
 		ast_log(LOG_WARNING, "Unable to create pipe\n");
 		return -1;
 	}
 	flags = fcntl(fds[1], F_GETFL);
 	fcntl(fds[1], F_SETFL, flags | O_NONBLOCK);
-	
+
 	ast_stopstream(chan);
 
 	if (ast_channel_state(chan) != AST_STATE_UP)
 		res = ast_answer(chan);
-		
+
 	if (res) {
 		close(fds[0]);
 		close(fds[1]);
@@ -158,10 +158,10 @@
 		ast_copy_string(filename, (char *) data, sizeof(filename));
 	else
 		snprintf(filename, sizeof(filename), "%s/%s", ast_config_AST_CONFIG_DIR, (char *)data);
-	/* Placeholder for options */		
+	/* Placeholder for options */
 	c = strchr(filename, '|');
 	if (c)
-		*c = '\0';	
+		*c = '\0';
 	res = icesencode(filename, fds[0]);
 	if (res >= 0) {
 		pid = res;
diff --git a/apps/app_image.c b/apps/app_image.c
index 66751f5..8323ca7 100644
--- a/apps/app_image.c
+++ b/apps/app_image.c
@@ -21,14 +21,14 @@
  * \brief App to transmit an image
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
 /*** MODULEINFO
 	<support_level>extended</support_level>
  ***/
- 
+
 #include "asterisk.h"
 
 ASTERISK_REGISTER_FILE()
@@ -92,7 +92,7 @@
 	} else {
 		pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "FAILURE");
 	}
-	
+
 	return 0;
 }
 
diff --git a/apps/app_ivrdemo.c b/apps/app_ivrdemo.c
index 2ec28b1..5b2cb5d 100644
--- a/apps/app_ivrdemo.c
+++ b/apps/app_ivrdemo.c
@@ -21,7 +21,7 @@
  * \brief IVR Demo application
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
@@ -64,7 +64,7 @@
 	return 0;
 }
 
-AST_IVR_DECLARE_MENU(ivr_submenu, "IVR Demo Sub Menu", 0, 
+AST_IVR_DECLARE_MENU(ivr_submenu, "IVR Demo Sub Menu", 0,
 {
 	{ "s", AST_ACTION_BACKGROUND, "demo-abouttotry" },
 	{ "s", AST_ACTION_WAITOPTION },
@@ -79,7 +79,7 @@
 	{ NULL }
 });
 
-AST_IVR_DECLARE_MENU(ivr_demo, "IVR Demo Main Menu", 0, 
+AST_IVR_DECLARE_MENU(ivr_demo, "IVR Demo Main Menu", 0,
 {
 	{ "s", AST_ACTION_BACKGROUND, "demo-congrats" },
 	{ "g", AST_ACTION_BACKGROUND, "demo-instruct" },
@@ -98,12 +98,12 @@
 {
 	int res=0;
 	char *tmp;
-	
+
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "skel requires an argument (filename)\n");
 		return -1;
 	}
-	
+
 	tmp = ast_strdupa(data);
 
 	/* Do our thing here */
@@ -112,7 +112,7 @@
 		res = ast_answer(chan);
 	if (!res)
 		res = ast_ivr_menu_run(chan, &ivr_demo, tmp);
-	
+
 	return res;
 }
 
diff --git a/apps/app_macro.c b/apps/app_macro.c
index d2da165..1006c04 100644
--- a/apps/app_macro.c
+++ b/apps/app_macro.c
@@ -21,7 +21,7 @@
  * \brief Dial plan macro Implementation
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
@@ -243,7 +243,7 @@
 	int setmacrocontext=0;
 	int autoloopflag, inhangup = 0;
 	struct ast_str *tmp_subst = NULL;
-  
+
 	char *save_macro_exten;
 	char *save_macro_context;
 	char *save_macro_priority;
@@ -274,16 +274,16 @@
 	if ((s = pbx_builtin_getvar_helper(chan, "MACRO_RECURSION"))) {
 		sscanf(s, "%30d", &maxdepth);
 	}
-	
+
 	/* Count how many levels deep the rabbit hole goes */
 	if ((s = pbx_builtin_getvar_helper(chan, "MACRO_DEPTH"))) {
 		sscanf(s, "%30d", &depth);
 	}
-	
+
 	/* Used for detecting whether to return when a Macro is called from another Macro after hangup */
 	if (strcmp(ast_channel_exten(chan), "h") == 0)
 		pbx_builtin_setvar_helper(chan, "MACRO_IN_HANGUP", "1");
-	
+
 	if ((inhangupc = pbx_builtin_getvar_helper(chan, "MACRO_IN_HANGUP"))) {
 		sscanf(inhangupc, "%30d", &inhangup);
 	}
@@ -306,7 +306,7 @@
 	snprintf(fullmacro, sizeof(fullmacro), "macro-%s", macro);
 	if (!ast_exists_extension(chan, fullmacro, "s", 1,
 		S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {
-		if (!ast_context_find(fullmacro)) 
+		if (!ast_context_find(fullmacro))
 			ast_log(LOG_WARNING, "No such context '%s' for macro '%s'. Was called by %s@%s\n", fullmacro, macro, ast_channel_exten(chan), ast_channel_context(chan));
 		else
 			ast_log(LOG_WARNING, "Context '%s' for macro '%s' lacks 's' extension, priority 1\n", fullmacro, macro);
@@ -351,7 +351,7 @@
 	save_macro_priority = ast_strdup(pbx_builtin_getvar_helper(chan, "MACRO_PRIORITY"));
 	snprintf(pc, sizeof(pc), "%d", oldpriority);
 	pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", pc);
-  
+
 	save_macro_offset = ast_strdup(pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"));
 	pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", NULL);
 
@@ -592,7 +592,7 @@
 	return _macro_exec(chan, data, 1);
 }
 
-static int macroif_exec(struct ast_channel *chan, const char *data) 
+static int macroif_exec(struct ast_channel *chan, const char *data)
 {
 	char *expr = NULL, *label_a = NULL, *label_b = NULL;
 	int res = 0;
@@ -608,14 +608,14 @@
 		}
 		if (pbx_checkcondition(expr))
 			res = macro_exec(chan, label_a);
-		else if (label_b) 
+		else if (label_b)
 			res = macro_exec(chan, label_b);
 	} else
 		ast_log(LOG_WARNING, "Invalid Syntax.\n");
 
 	return res;
 }
-			
+
 static int macro_exit_exec(struct ast_channel *chan, const char *data)
 {
 	return MACRO_EXIT_RESULT;
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index e74ad75..9387909 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -25,7 +25,7 @@
  *
  * \author Mark Spencer <markster at digium.com>
  * \author (SLA) Russell Bryant <russell at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
@@ -33,7 +33,7 @@
  * \addtogroup configuration_file Configuration Files
  */
 
-/*! 
+/*!
  * \page meetme.conf meetme.conf
  * \verbinclude meetme.conf.sample
  */
@@ -698,7 +698,7 @@
 	CONFFLAG_TALKER = (1 << 4),
 	/*! If set there will be no enter or leave sounds */
 	CONFFLAG_QUIET = (1 << 5),
-	/*! If set, when user joins the conference, they will be told the number 
+	/*! If set, when user joins the conference, they will be told the number
 	 *  of users that are already in */
 	CONFFLAG_ANNOUNCEUSERCOUNT = (1 << 6),
 	/*! Set to run AGI Script in Background */
@@ -726,10 +726,10 @@
 	CONFFLAG_ALWAYSPROMPT = (1 << 20),
 	/*! If set, treat talking users as muted users */
 	CONFFLAG_OPTIMIZETALKER = (1 << 21),
-	/*! If set, won't speak the extra prompt when the first person 
+	/*! If set, won't speak the extra prompt when the first person
 	 *  enters the conference */
 	CONFFLAG_NOONLYPERSON = (1 << 22),
-	/*! If set, user will be asked to record name on entry of conference 
+	/*! If set, user will be asked to record name on entry of conference
 	 *  without review */
 	CONFFLAG_INTROUSERNOREVIEW = (1 << 23),
 	/*! If set, the user will be initially self-muted */
@@ -744,7 +744,7 @@
 	CONFFLAG_DURATION_LIMIT = (1 << 30),
 };
 
-/* These flags are defined separately because we ran out of bits that an enum can be used to represent. 
+/* These flags are defined separately because we ran out of bits that an enum can be used to represent.
    If you add new flags, be sure to do it in the same way that these are. */
 /*! Do not write any audio to this channel until the state is up. */
 #define CONFFLAG_NO_AUDIO_UNTIL_UP  (1ULL << 31)
@@ -945,9 +945,9 @@
 struct sla_station {
 	AST_RWLIST_ENTRY(sla_station) entry;
 	AST_DECLARE_STRING_FIELDS(
-		AST_STRING_FIELD(name);	
-		AST_STRING_FIELD(device);	
-		AST_STRING_FIELD(autocontext);	
+		AST_STRING_FIELD(name);
+		AST_STRING_FIELD(device);
+		AST_STRING_FIELD(autocontext);
 	);
 	AST_LIST_HEAD_NOLOCK(, sla_trunk_ref) trunks;
 	struct ast_dial *dial;
@@ -985,7 +985,7 @@
 	AST_DECLARE_STRING_FIELDS(
 		AST_STRING_FIELD(name);
 		AST_STRING_FIELD(device);
-		AST_STRING_FIELD(autocontext);	
+		AST_STRING_FIELD(autocontext);
 	);
 	AST_LIST_HEAD_NOLOCK(, sla_station_ref) stations;
 	/*! Number of stations that use this trunk */
@@ -1054,7 +1054,7 @@
 	AST_LIST_ENTRY(sla_event) entry;
 };
 
-/*! \brief A station that failed to be dialed 
+/*! \brief A station that failed to be dialed
  * \note Only used by the SLA thread. */
 struct sla_failed_station {
 	struct sla_station *station;
@@ -1108,7 +1108,7 @@
  *  when in a conference */
 static int audio_buffers;
 
-/*! \brief Map 'volume' levels from -5 through +5 into decibel (dB) 
+/*! \brief Map 'volume' levels from -5 through +5 into decibel (dB)
  *    settings for channel drivers.
  *
  *  \note these are not a straight linear-to-dB
@@ -1404,7 +1404,7 @@
 		return "(talking)";
 	else if (x < 0)
 		return "(unmonitored)";
-	else 
+	else
 		return "(not talking)";
 }
 
@@ -1463,7 +1463,7 @@
 {
 	switch (action) {
 	case VOL_UP:
-		switch (vol->desired) { 
+		switch (vol->desired) {
 		case 5:
 			break;
 		case 0:
@@ -1563,7 +1563,7 @@
 
 	AST_LIST_UNLOCK(&confs);
 
-	if (!res) 
+	if (!res)
 		ast_autoservice_stop(chan);
 }
 
@@ -1618,7 +1618,7 @@
 	AST_LIST_LOCK(&confs);
 
 	AST_LIST_TRAVERSE(&confs, cnf, list) {
-		if (!strcmp(confno, cnf->confno)) 
+		if (!strcmp(confno, cnf->confno))
 			break;
 	}
 
@@ -1708,7 +1708,7 @@
 	/* Reserve conference number in map */
 	if ((sscanf(cnf->confno, "%30d", &confno_int) == 1) && (confno_int >= 0 && confno_int < 1024))
 		conf_map[confno_int] = 1;
-	
+
 cnfout:
 	ao2_cleanup(cap_slin);
 	if (cnf)
@@ -1964,7 +1964,7 @@
 					ast_test_flag64(&user->userflags, CONFFLAG_MONITOR) ? "(Listen only)" : "",
 					user->adminflags & ADMINFLAG_MUTED ? "(Admin Muted)" : user->adminflags & ADMINFLAG_SELFMUTED ? "(Muted)" : "",
 					user->adminflags & ADMINFLAG_T_REQUEST ? "(Request to Talk)" : "",
-					istalking(user->talking), hr, min, sec); 
+					istalking(user->talking), hr, min, sec);
 			} else {
 				ast_cli(a->fd, "%d!%s!%s!%s!%s!%s!%s!%s!%d!%02d:%02d:%02d\n",
 					user->user_no,
@@ -2009,13 +2009,13 @@
 			/* Unlock */
 			ast_str_append(&cmdline, 0, ",l");
 		}
-	} else if (strcasestr(a->argv[1], "mute")) { 
+	} else if (strcasestr(a->argv[1], "mute")) {
 		if (strcasecmp(a->argv[1], "mute") == 0) {
 			/* Mute */
 			if (strcasecmp(a->argv[3], "all") == 0) {
 				ast_str_append(&cmdline, 0, ",N");
 			} else {
-				ast_str_append(&cmdline, 0, ",M,%s", a->argv[3]);	
+				ast_str_append(&cmdline, 0, ",M,%s", a->argv[3]);
 			}
 		} else {
 			/* Unmute */
@@ -2167,8 +2167,8 @@
 		            "=== ==> BargeAllowed: %s\n"
 		            "=== ==> HoldAccess:   %s\n"
 		            "=== ==> Stations ...\n",
-		            trunk->name, trunk->device, 
-		            S_OR(trunk->autocontext, "(none)"), 
+		            trunk->name, trunk->device,
+		            S_OR(trunk->autocontext, "(none)"),
 		            ring_timeout,
 		            trunk->barge_disabled ? "No" : "Yes",
 		            sla_hold_str(trunk->hold_access));
@@ -2217,7 +2217,7 @@
 		return NULL;
 	}
 
-	ast_cli(a->fd, "\n" 
+	ast_cli(a->fd, "\n"
 	            "=============================================================\n"
 	            "=== Configured SLA Stations =================================\n"
 	            "=============================================================\n"
@@ -2231,11 +2231,11 @@
 		ao2_lock(station);
 
 		if (station->ring_timeout) {
-			snprintf(ring_timeout, sizeof(ring_timeout), 
+			snprintf(ring_timeout, sizeof(ring_timeout),
 				"%u", station->ring_timeout);
 		}
 		if (station->ring_delay) {
-			snprintf(ring_delay, sizeof(ring_delay), 
+			snprintf(ring_delay, sizeof(ring_delay),
 				"%u", station->ring_delay);
 		}
 		ast_cli(a->fd, "=== ---------------------------------------------------------\n"
@@ -2247,7 +2247,7 @@
 		            "=== ==> HoldAccess:  %s\n"
 		            "=== ==> Trunks ...\n",
 		            station->name, station->device,
-		            S_OR(station->autocontext, "(none)"), 
+		            S_OR(station->autocontext, "(none)"),
 		            ring_timeout, ring_delay,
 		            sla_hold_str(station->hold_access));
 		AST_LIST_TRAVERSE(&station->trunks, trunk_ref, entry) {
@@ -2356,7 +2356,7 @@
 		ast_cond_signal(&conf->announcelist_addition);
 		ast_mutex_unlock(&conf->announcelistlock);
 		pthread_join(conf->announcethread, NULL);
-	
+
 		while ((item = AST_LIST_REMOVE_HEAD(&conf->announcelist, entry))) {
 			/* If it's a voicemail greeting file we don't want to remove it */
 			if (!item->vmrec){
@@ -2410,7 +2410,7 @@
 	ao2_iterator_destroy(&user_iter);
 }
 
-static void sla_queue_event_full(enum sla_event_type type, 
+static void sla_queue_event_full(enum sla_event_type type,
 	struct sla_trunk_ref *trunk_ref, struct sla_station *station, int lock)
 {
 	struct sla_event *event;
@@ -3323,7 +3323,7 @@
 		else
 			exitkeys = ast_strdupa("#"); /* Default */
 	}
-	
+
 	if (ast_test_flag64(confflags, CONFFLAG_RECORDCONF)) {
 		if (!conf->recordingfilename) {
 			const char *var;
@@ -3375,29 +3375,29 @@
 	ast_mutex_unlock(&conf->announcethreadlock);
 
 	time(&user->jointime);
-	
+
 	user->timelimit = timelimit;
 	user->play_warning = play_warning;
 	user->warning_freq = warning_freq;
 	user->warning_sound = warning_sound;
-	user->end_sound = end_sound;	
-	
+	user->end_sound = end_sound;
+
 	if (calldurationlimit > 0) {
 		time(&user->kicktime);
 		user->kicktime = user->kicktime + calldurationlimit;
 	}
-	
+
 	if (ast_tvzero(user->start_time))
 		user->start_time = ast_tvnow();
 	time_left_ms = user->timelimit;
-	
+
 	if (user->timelimit) {
 		nexteventts = ast_tvadd(user->start_time, ast_samp2tv(user->timelimit, 1000));
 		nexteventts = ast_tvsub(nexteventts, ast_samp2tv(user->play_warning, 1000));
 	}
 
 	if (conf->locked && (!ast_test_flag64(confflags, CONFFLAG_ADMIN))) {
-		/* Sorry, but this conference is locked! */	
+		/* Sorry, but this conference is locked! */
 		if (!ast_streamfile(chan, "conf-locked", ast_channel_language(chan)))
 			ast_waitstream(chan, "");
 		goto outrun;
@@ -3407,7 +3407,7 @@
 
 	if (rt_schedule && conf->maxusers) {
 		if (conf->users >= conf->maxusers) {
-			/* Sorry, but this confernce has reached the participant limit! */	
+			/* Sorry, but this confernce has reached the participant limit! */
 			ast_mutex_unlock(&conf->playlock);
 			if (!ast_streamfile(chan, "conf-full", ast_channel_language(chan)))
 				ast_waitstream(chan, "");
@@ -3536,7 +3536,7 @@
 	if (ast_test_flag64(confflags, CONFFLAG_ANNOUNCEUSERCOUNT) && conf->users > 1) {
 		int keepplaying = 1;
 
-		if (conf->users == 2) { 
+		if (conf->users == 2) {
 			if (!ast_streamfile(chan, "conf-onlyone", ast_channel_language(chan))) {
 				res = ast_waitstream(chan, AST_DIGIT_ANY);
 				ast_stopstream(chan);
@@ -3545,7 +3545,7 @@
 				else if (res == -1)
 					goto outrun;
 			}
-		} else { 
+		} else {
 			if (!ast_streamfile(chan, "conf-thereare", ast_channel_language(chan))) {
 				res = ast_waitstream(chan, AST_DIGIT_ANY);
 				ast_stopstream(chan);
@@ -3566,7 +3566,7 @@
 				ast_stopstream(chan);
 				if (res > 0)
 					keepplaying = 0;
-				else if (res == -1) 
+				else if (res == -1)
 					goto outrun;
 			}
 		}
@@ -3729,7 +3729,7 @@
 			agifile = ast_strdupa(agifiledefault);
 		}
 		ast_channel_unlock(chan);
-		
+
 		if (user->dahdichannel) {
 			/*  Set CONFMUTE mode on DAHDI channel to mute DTMF tones */
 			x = 1;
@@ -3834,11 +3834,11 @@
 				}
 				break;
 			}
-  
+
  			to = -1;
  			if (user->timelimit) {
 				int minutes = 0, seconds = 0, remain = 0;
- 
+
  				to = ast_tvdiff_ms(nexteventts, now);
  				if (to < 0) {
  					to = 0;
@@ -3847,9 +3847,9 @@
  				if (time_left_ms < to) {
  					to = time_left_ms;
 				}
- 	
+
  				if (time_left_ms <= 0) {
- 					if (user->end_sound) {						
+ 					if (user->end_sound) {
  						res = ast_streamfile(chan, user->end_sound, ast_channel_language(chan));
  						res = ast_waitstream(chan, "");
  					}
@@ -3860,10 +3860,10 @@
 					}
  					break;
  				}
- 				
+
  				if (!to) {
- 					if (time_left_ms >= 5000) {						
- 						
+ 					if (time_left_ms >= 5000) {
+
  						remain = (time_left_ms + 500) / 1000;
  						if (remain / 60 >= 1) {
  							minutes = remain / 60;
@@ -3871,11 +3871,11 @@
  						} else {
  							seconds = remain;
  						}
- 						
+
  						/* force the time left to round up if appropriate */
  						if (user->warning_sound && user->play_warning) {
  							if (!strcmp(user->warning_sound, "timeleft")) {
- 								
+
  								res = ast_streamfile(chan, "vm-youhave", ast_channel_language(chan));
  								res = ast_waitstream(chan, "");
  								if (minutes) {
@@ -3996,7 +3996,7 @@
 						ast_moh_stop(chan);
 						musiconhold = 0;
 					}
-					if (!ast_test_flag64(confflags, CONFFLAG_QUIET) && 
+					if (!ast_test_flag64(confflags, CONFFLAG_QUIET) &&
 						!ast_test_flag64(confflags, CONFFLAG_MARKEDUSER)) {
 						if (!ast_streamfile(chan, "conf-placeintoconf", ast_channel_language(chan))) {
 							ast_waitstream(chan, "");
@@ -4012,7 +4012,7 @@
 					if (!musiconhold) {
 						conf_start_moh(chan, optargs[OPT_ARG_MOH_CLASS]);
 						musiconhold = 1;
-					} 
+					}
 				} else {
 					if (musiconhold) {
 						ast_moh_stop(chan);
@@ -4020,7 +4020,7 @@
 					}
 				}
 			}
-			
+
 			/* Leave if the last marked user left */
 			if (currentmarked == 0 && lastmarked != 0 && ast_test_flag64(confflags, CONFFLAG_MARKEDEXIT)) {
 				if (ast_test_flag64(confflags, CONFFLAG_KICK_CONTINUE)) {
@@ -4070,7 +4070,7 @@
 				meetme_stasis_generate_msg(conf, chan, user, meetme_mute_type(), status_blob);
 			}
 
-			if ((user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && 
+			if ((user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) &&
 				(user->adminflags & ADMINFLAG_T_REQUEST) && !(talkreq_manager)) {
 
 				RAII_VAR(struct ast_json *, status_blob, status_to_json(1), ast_json_unref);
@@ -4078,7 +4078,7 @@
 				meetme_stasis_generate_msg(conf, chan, user, meetme_talk_request_type(), status_blob);
 			}
 
-			if (!(user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && 
+			if (!(user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) &&
 				!(user->adminflags & ADMINFLAG_T_REQUEST) && (talkreq_manager)) {
 				RAII_VAR(struct ast_json *, status_blob, status_to_json(0), ast_json_unref);
 				talkreq_manager = 0;
@@ -4094,7 +4094,7 @@
 			/* If I have been kicked, exit the conference */
 			if (user->adminflags & ADMINFLAG_KICKME) {
 				/* You have been kicked. */
-				if (!ast_test_flag64(confflags, CONFFLAG_QUIET) && 
+				if (!ast_test_flag64(confflags, CONFFLAG_QUIET) &&
 					!ast_streamfile(chan, "conf-kicked", ast_channel_language(chan))) {
 					ast_waitstream(chan, "");
 				}
@@ -4388,12 +4388,12 @@
 	if (musiconhold) {
 		ast_moh_stop(chan);
 	}
-	
+
 	if (using_pseudo) {
 		close(fd);
 	} else {
 		/* Take out of conference */
-		dahdic.chan = 0;	
+		dahdic.chan = 0;
 		dahdic.confno = 0;
 		dahdic.confmode = 0;
 		if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
@@ -4435,7 +4435,7 @@
 	if (dsp) {
 		ast_dsp_free(dsp);
 	}
-	
+
 	if (user->user_no) {
 		/* Only cleanup users who really joined! */
 		now = ast_tvnow();
@@ -4460,7 +4460,7 @@
 			}
 		}
 		/* Remove ourselves from the container */
-		ao2_unlink(conf->usercontainer, user); 
+		ao2_unlink(conf->usercontainer, user);
 
 		/* Change any states */
 		if (!conf->users) {
@@ -4771,7 +4771,7 @@
 			ast_log(LOG_WARNING, "No DAHDI channel available for conference, user introduction disabled (is chan_dahdi loaded?)\n");
 			ast_clear_flag64(confflags, CONFFLAG_INTROUSER | CONFFLAG_INTROUSERNOREVIEW | CONFFLAG_INTROUSER_VMREC);
 		}
-		
+
 		if (confflags && !cnf->chan &&
 		    ast_test_flag64(confflags, CONFFLAG_RECORDCONF)) {
 			ast_log(LOG_WARNING, "No DAHDI channel available for conference, conference recording disabled (is chan_dahdi loaded?)\n");
@@ -4789,7 +4789,7 @@
 	struct ast_conference *conf;
 	int count;
 	char *localdata;
-	char val[80] = "0"; 
+	char val[80] = "0";
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(confno);
 		AST_APP_ARG(varname);
@@ -4799,11 +4799,11 @@
 		ast_log(LOG_WARNING, "MeetMeCount requires an argument (conference number)\n");
 		return -1;
 	}
-	
+
 	localdata = ast_strdupa(data);
 
 	AST_STANDARD_APP_ARGS(args, localdata);
-	
+
 	conf = find_conf(chan, args.confno, 0, 0, NULL, 0, 1, NULL);
 
 	if (conf) {
@@ -4855,13 +4855,13 @@
 	} else {
 		notdata = data;
 	}
-	
+
 	if (ast_channel_state(chan) != AST_STATE_UP)
 		ast_answer(chan);
 
 	info = ast_strdupa(notdata);
 
-	AST_STANDARD_APP_ARGS(args, info);	
+	AST_STANDARD_APP_ARGS(args, info);
 
 	if (args.confno) {
 		ast_copy_string(confno, args.confno, sizeof(confno));
@@ -4869,7 +4869,7 @@
 			allowretry = 1;
 		}
 	}
-	
+
 	if (args.pin)
 		ast_copy_string(the_pin, args.pin, sizeof(the_pin));
 
@@ -5017,12 +5017,12 @@
 		}
 		if (!ast_strlen_zero(confno)) {
 			/* Check the validity of the conference */
-			cnf = find_conf(chan, confno, 1, dynamic, the_pin, 
+			cnf = find_conf(chan, confno, 1, dynamic, the_pin,
 				sizeof(the_pin), 1, &confflags);
 			if (!cnf) {
 				int too_early = 0;
 
-				cnf = find_conf_realtime(chan, confno, 1, dynamic, 
+				cnf = find_conf_realtime(chan, confno, 1, dynamic,
 					the_pin, sizeof(the_pin), 1, &confflags, &too_early, optargs);
 				if (rt_schedule && too_early)
 					allowretry = 0;
@@ -5130,7 +5130,7 @@
 					/* No pin required */
 					allowretry = 0;
 
-					/* For RealTime conferences without a pin 
+					/* For RealTime conferences without a pin
 					 * should still support loading options
 					 */
 					if (!ast_strlen_zero(cnf->useropts)) {
@@ -5149,7 +5149,7 @@
 
 	if (cnf)
 		dispose_conf(cnf);
-	
+
 	return res;
 }
 
@@ -5213,7 +5213,7 @@
 	return 0;
 }
 
-/*! \brief The MeetMeadmin application 
+/*! \brief The MeetMeadmin application
 
   MeetMeAdmin(confno, command, caller) */
 static int admin_exec(struct ast_channel *chan, const char *data) {
@@ -5284,10 +5284,10 @@
 	}
 
 	switch (*args.command) {
-	case 76: /* L: Lock */ 
+	case 76: /* L: Lock */
 		cnf->locked = 1;
 		break;
-	case 108: /* l: Unlock */ 
+	case 108: /* l: Unlock */
 		cnf->locked = 0;
 		break;
 	case 75: /* K: kick all users */
@@ -5314,19 +5314,19 @@
 		}
 		break;
 	}
-	case 77: /* M: Mute */ 
+	case 77: /* M: Mute */
 		user->adminflags |= ADMINFLAG_MUTED;
 		break;
 	case 78: /* N: Mute all (non-admin) users */
 		ao2_callback(cnf->usercontainer, OBJ_NODATA, user_set_muted_cb, &cnf);
-		break;					
-	case 109: /* m: Unmute */ 
+		break;
+	case 109: /* m: Unmute */
 		user->adminflags &= ~(ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED | ADMINFLAG_T_REQUEST);
 		break;
 	case 110: /* n: Unmute all users */
 		ao2_callback(cnf->usercontainer, OBJ_NODATA, user_set_unmuted_cb, NULL);
 		break;
-	case 107: /* k: Kick user */ 
+	case 107: /* k: Kick user */
 		user->adminflags |= ADMINFLAG_KICKME;
 		break;
 	case 118: /* v: Lower all users listen volume */
@@ -5379,7 +5379,7 @@
 	return 0;
 }
 
-/*! \brief The MeetMeChannelAdmin application 
+/*! \brief The MeetMeChannelAdmin application
 	MeetMeChannelAdmin(channel, command) */
 static int channel_admin_exec(struct ast_channel *chan, const char *data) {
 	char *params;
@@ -5394,7 +5394,7 @@
 		ast_log(LOG_WARNING, "MeetMeChannelAdmin requires two arguments!\n");
 		return -1;
 	}
-	
+
 	params = ast_strdupa(data);
 	AST_STANDARD_APP_ARGS(args, params);
 
@@ -5414,22 +5414,22 @@
 			break;
 		}
 	}
-	
+
 	if (!user) {
 		ast_log(LOG_NOTICE, "Specified user (%s) not found\n", args.channel);
 		AST_LIST_UNLOCK(&confs);
 		return 0;
 	}
-	
+
 	/* perform the specified action */
 	switch (*args.command) {
-		case 77: /* M: Mute */ 
+		case 77: /* M: Mute */
 			user->adminflags |= ADMINFLAG_MUTED;
 			break;
-		case 109: /* m: Unmute */ 
+		case 109: /* m: Unmute */
 			user->adminflags &= ~ADMINFLAG_MUTED;
 			break;
-		case 107: /* k: Kick user */ 
+		case 107: /* k: Kick user */
 			user->adminflags |= ADMINFLAG_KICKME;
 			break;
 		default: /* unknown command */
@@ -5438,7 +5438,7 @@
 	}
 	ao2_ref(user, -1);
 	AST_LIST_UNLOCK(&confs);
-	
+
 	return 0;
 }
 
@@ -5637,7 +5637,7 @@
 		markedusers,
 		hr,  min, sec,
 		cnf->isdynamic ? "Dynamic" : "Static",
-		cnf->locked ? "Yes" : "No"); 
+		cnf->locked ? "Yes" : "No");
 	}
 	AST_LIST_UNLOCK(&confs);
 
@@ -5705,7 +5705,7 @@
 			s = ast_writefile(filename_buffer, cnf->recordingformat, NULL, flags, 0, AST_FILE_MODE);
 			oldrecordingfilename = filename_buffer;
 		}
-		
+
 		f = ast_read(cnf->lchan);
 		if (!f) {
 			res = -1;
@@ -5736,7 +5736,7 @@
 	cnf->recording = MEETME_RECORD_OFF;
 	if (s)
 		ast_closestream(s);
-	
+
 	pthread_exit(0);
 }
 
@@ -5818,25 +5818,25 @@
 		if ((sscanf(val, "%30d", &fuzzystart) != 1)) {
 			ast_log(LOG_WARNING, "fuzzystart must be a number, not '%s'\n", val);
 			fuzzystart = 0;
-		} 
+		}
 	}
 	if ((val = ast_variable_retrieve(cfg, "general", "earlyalert"))) {
 		if ((sscanf(val, "%30d", &earlyalert) != 1)) {
 			ast_log(LOG_WARNING, "earlyalert must be a number, not '%s'\n", val);
 			earlyalert = 0;
-		} 
+		}
 	}
 	if ((val = ast_variable_retrieve(cfg, "general", "endalert"))) {
 		if ((sscanf(val, "%30d", &endalert) != 1)) {
 			ast_log(LOG_WARNING, "endalert must be a number, not '%s'\n", val);
 			endalert = 0;
-		} 
+		}
 	}
 	if ((val = ast_variable_retrieve(cfg, "general", "extendby"))) {
 		if ((sscanf(val, "%30d", &extendby) != 1)) {
 			ast_log(LOG_WARNING, "extendby must be a number, not '%s'\n", val);
 			extendby = 0;
-		} 
+		}
 	}
 
 	ast_config_destroy(cfg);
@@ -5907,12 +5907,12 @@
 		if (strcasecmp(trunk_ref->trunk->name, name))
 			continue;
 
-		if ( (trunk_ref->trunk->barge_disabled 
+		if ( (trunk_ref->trunk->barge_disabled
 			&& trunk_ref->state == SLA_TRUNK_STATE_UP) ||
-			(trunk_ref->trunk->hold_stations 
+			(trunk_ref->trunk->hold_stations
 			&& trunk_ref->trunk->hold_access == SLA_HOLD_PRIVATE
 			&& trunk_ref->state != SLA_TRUNK_STATE_ONHOLD_BYME) ||
-			sla_check_station_hold_access(trunk_ref->trunk, station) ) 
+			sla_check_station_hold_access(trunk_ref->trunk, station) )
 		{
 			trunk_ref = NULL;
 		}
@@ -6017,7 +6017,7 @@
 	return AST_DEVICE_UNKNOWN;
 }
 
-static void sla_change_trunk_state(const struct sla_trunk *trunk, enum sla_trunk_state state, 
+static void sla_change_trunk_state(const struct sla_trunk *trunk, enum sla_trunk_state state,
 	enum sla_which_trunk_refs inactive_only, const struct sla_trunk_ref *exclude)
 {
 	struct sla_station *station;
@@ -6076,7 +6076,7 @@
 
 	ast_atomic_fetchadd_int((int *) &trunk_ref->trunk->active_stations, 1);
 	ast_str_set(&conf_name, 0, "SLA_%s", trunk_ref->trunk->name);
-	ast_set_flag64(&conf_flags, 
+	ast_set_flag64(&conf_flags,
 		CONFFLAG_QUIET | CONFFLAG_MARKEDEXIT | CONFFLAG_PASS_DTMF | CONFFLAG_SLA_STATION);
 	answer_trunk_chan(trunk_ref->chan);
 	conf = build_conf(ast_str_buffer(conf_name), "", "", 0, 0, 1, trunk_ref->chan, NULL);
@@ -6184,7 +6184,7 @@
  * \return a pointer to the selected ringing trunk, or NULL if none found
  * \note Assumes that sla.lock is locked
  */
-static struct sla_ringing_trunk *sla_choose_ringing_trunk(struct sla_station *station, 
+static struct sla_ringing_trunk *sla_choose_ringing_trunk(struct sla_station *station,
 	struct sla_trunk_ref **trunk_ref, int rm)
 {
 	struct sla_trunk_ref *s_trunk_ref;
@@ -6212,7 +6212,7 @@
 			break;
 		}
 		AST_LIST_TRAVERSE_SAFE_END;
-	
+
 		if (ringing_trunk)
 			break;
 	}
@@ -6302,8 +6302,8 @@
 	AST_LIST_TRAVERSE_SAFE_END;
 }
 
-/*! \brief Check to see if this station is already ringing 
- * \note Assumes sla.lock is locked 
+/*! \brief Check to see if this station is already ringing
+ * \note Assumes sla.lock is locked
  */
 static int sla_check_ringing_station(const struct sla_station *station)
 {
@@ -6373,13 +6373,13 @@
 	}
 
 	res = ast_dial_run(dial, ringing_trunk->trunk->chan, 1);
-	
+
 	/* Restore saved caller ID */
 	if (caller_is_saved) {
 		ast_party_caller_free(ast_channel_caller(ringing_trunk->trunk->chan));
 		ast_channel_caller_set(ringing_trunk->trunk->chan, &caller);
 	}
-	
+
 	if (res != AST_DIAL_RESULT_TRYING) {
 		struct sla_failed_station *failed_station;
 		ast_dial_destroy(dial);
@@ -6435,7 +6435,7 @@
  * \param ringing_trunk the trunk.  If NULL, the highest priority ringing trunk will be used
  * \return the number of ms left before the delay is complete, or INT_MAX if there is no delay
  */
-static int sla_check_station_delay(struct sla_station *station, 
+static int sla_check_station_delay(struct sla_station *station,
 	struct sla_ringing_trunk *ringing_trunk)
 {
 	RAII_VAR(struct sla_trunk_ref *, trunk_ref, NULL, ao2_cleanup);
@@ -6553,7 +6553,7 @@
 	event->trunk_ref->state = SLA_TRUNK_STATE_ONHOLD_BYME;
 	ast_devstate_changed(AST_DEVICE_ONHOLD, AST_DEVSTATE_CACHABLE, "SLA:%s_%s",
 			     event->station->name, event->trunk_ref->trunk->name);
-	sla_change_trunk_state(event->trunk_ref->trunk, SLA_TRUNK_STATE_ONHOLD, 
+	sla_change_trunk_state(event->trunk_ref->trunk, SLA_TRUNK_STATE_ONHOLD,
 		INACTIVE_TRUNK_REFS, event->trunk_ref);
 
 	if (event->trunk_ref->trunk->active_stations == 1) {
@@ -6711,7 +6711,7 @@
 			continue;
 
 		/* If there is no time left, then the station needs to start ringing.
-		 * Return non-zero so that an event will be queued up an event to 
+		 * Return non-zero so that an event will be queued up an event to
 		 * make that happen. */
 		if (time_left <= 0) {
 			res = 1;
@@ -6949,8 +6949,8 @@
 	}
 
 	snprintf(conf_name, sizeof(conf_name), "SLA_%s", trunk_ref->trunk->name);
-	ast_set_flag64(&conf_flags, 
-		CONFFLAG_QUIET | CONFFLAG_MARKEDEXIT | CONFFLAG_MARKEDUSER | 
+	ast_set_flag64(&conf_flags,
+		CONFFLAG_QUIET | CONFFLAG_MARKEDEXIT | CONFFLAG_MARKEDUSER |
 		CONFFLAG_PASS_DTMF | CONFFLAG_SLA_TRUNK);
 	conf = build_conf(conf_name, "", "", 1, 1, 1, trunk_ref->trunk->chan, NULL);
 
@@ -7140,7 +7140,7 @@
 		trunk_ref->trunk->hold_stations = 0;
 		sla_change_trunk_state(trunk_ref->trunk, SLA_TRUNK_STATE_IDLE, ALL_TRUNK_REFS, NULL);
 	}
-	
+
 	pbx_builtin_setvar_helper(chan, "SLASTATION_STATUS", "SUCCESS");
 
 	return 0;
@@ -7273,7 +7273,7 @@
 		pbx_builtin_setvar_helper(chan, "SLATRUNK_STATUS", "FAILURE");
 		return 0;
 	}
-	ast_set_flag64(&conf_flags, 
+	ast_set_flag64(&conf_flags,
 		CONFFLAG_QUIET | CONFFLAG_MARKEDEXIT | CONFFLAG_MARKEDUSER | CONFFLAG_PASS_DTMF | CONFFLAG_NO_AUDIO_UNTIL_UP);
 
 	if (ast_test_flag(&opt_flags, SLA_TRUNK_OPT_MOH)) {
@@ -7382,9 +7382,9 @@
 			char hint[AST_MAX_APP];
 			snprintf(exten, sizeof(exten), "%s_%s", station->name, trunk_ref->trunk->name);
 			snprintf(hint, sizeof(hint), "SLA:%s", exten);
-			ast_context_remove_extension(station->autocontext, exten, 
+			ast_context_remove_extension(station->autocontext, exten,
 				1, sla_registrar);
-			ast_context_remove_extension(station->autocontext, hint, 
+			ast_context_remove_extension(station->autocontext, hint,
 				PRIORITY_HINT, sla_registrar);
 		}
 	}
@@ -7736,7 +7736,7 @@
 			char hint[AST_MAX_APP];
 			snprintf(exten, sizeof(exten), "%s_%s", station->name, trunk_ref->trunk->name);
 			snprintf(hint, sizeof(hint), "SLA:%s", exten);
-			/* Extension for this line button 
+			/* Extension for this line button
 			 * exten => station1_line1,1,SLAStation(station1_line1) */
 			if (ast_add_extension2(context, 0 /* don't replace */, exten, 1,
 				NULL, NULL, slastation_app, ast_strdup(exten), ast_free_ptr, sla_registrar)) {
@@ -7744,7 +7744,7 @@
 					"for trunk '%s'!\n", station->name);
 				return -1;
 			}
-			/* Hint for this line button 
+			/* Hint for this line button
 			 * exten => station1_line1,hint,SLA:station1_line1 */
 			if (ast_add_extension2(context, 0 /* don't replace */, exten, PRIORITY_HINT,
 				NULL, NULL, hint, NULL, NULL, sla_registrar)) {
@@ -7986,7 +7986,7 @@
 		ast_log(LOG_NOTICE, "Error: invalid keyword: '%s'\n", args.keyword);
 		snprintf(buf, len, "0");
 	} else if (result == -2) {
-		ast_log(LOG_NOTICE, "Error: conference (%s) not found\n", args.confno); 
+		ast_log(LOG_NOTICE, "Error: conference (%s) not found\n", args.confno);
 		snprintf(buf, len, "0");
 	}
 
@@ -8103,7 +8103,7 @@
 				continue;
 			}
 
-			ao2_callback(cnf->usercontainer, OBJ_NODATA, user_add_provider_cb, data_meetme_users); 
+			ao2_callback(cnf->usercontainer, OBJ_NODATA, user_add_provider_cb, data_meetme_users);
 		}
 
 		if (!ast_data_search_match(search, data_meetme)) {
@@ -8189,7 +8189,7 @@
 static int unload_module(void)
 {
 	int res = 0;
-	
+
 	ast_cli_unregister_multiple(cli_meetme, ARRAY_LEN(cli_meetme));
 	res = ast_manager_unregister("MeetmeMute");
 	res |= ast_manager_unregister("MeetmeUnmute");
@@ -8209,9 +8209,9 @@
 
 	ast_devstate_prov_del("Meetme");
 	ast_devstate_prov_del("SLA");
-	
+
 	sla_destroy();
-	
+
 	res |= ast_custom_function_unregister(&meetme_info_acf);
 	ast_unload_realtime("meetme");
 
@@ -8226,8 +8226,8 @@
  * Module loading including tests for configuration or dependencies.
  * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE,
  * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails
- * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the 
- * configuration file or other non-critical problem return 
+ * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the
+ * configuration file or other non-critical problem return
  * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
  */
 static int load_module(void)
diff --git a/apps/app_milliwatt.c b/apps/app_milliwatt.c
index a736fd4..f725b54 100644
--- a/apps/app_milliwatt.c
+++ b/apps/app_milliwatt.c
@@ -21,7 +21,7 @@
  * \brief Digital Milliwatt Test
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
diff --git a/apps/app_minivm.c b/apps/app_minivm.c
index 4b1c4b5..1510296 100644
--- a/apps/app_minivm.c
+++ b/apps/app_minivm.c
@@ -24,7 +24,7 @@
  *
  * A voicemail system in small building blocks, working together
  * based on the Comedian Mail voicemail system (app_voicemail.c).
- * 
+ *
  * \par See also
  * \arg \ref Config_minivm_examples
  * \arg \ref App_minivm
@@ -32,10 +32,10 @@
  * \ingroup applications
  *
  * \page App_minivm	Asterisk Mini-voicemail - A minimal voicemail system
- *	
+ *
  *	This is a minimal voicemail system, building blocks for something
  *	else. It is built for multi-language systems.
- *	The current version is focused on accounts where voicemail is 
+ *	The current version is focused on accounts where voicemail is
  *	forwarded to users in e-mail. It's work in progress, with loosed ends hanging
  *	around from the old voicemail system and it's configuration.
  *
@@ -64,19 +64,19 @@
  *	- General configuration in minivm.conf
  *	- Users in realtime or configuration file
  *	- Or configured on the command line with just the e-mail address
- *		
+ *
  *	Voicemail accounts are identified by userid and domain
  *
  *	Language codes are like setlocale - langcode_countrycode
  *	\note Don't use language codes like the rest of Asterisk, two letter countrycode. Use
- *	language_country like setlocale(). 
- *	
+ *	language_country like setlocale().
+ *
  *	Examples:
  *		- Swedish, Sweden	sv_se
  *		- Swedish, Finland	sv_fi
  *		- English, USA		en_us
  *		- English, GB		en_gb
- *	
+ *
  * \par See also
  * \arg \ref Config_minivm
  * \arg \ref Config_minivm_examples
@@ -779,7 +779,7 @@
 		} else if (!strcasecmp(var->name, "charset")) {
 			ast_copy_string(template->charset, var->value, sizeof(template->charset));
 		} else if (!strcasecmp(var->name, "templatefile")) {
-			if (template->body) 
+			if (template->body)
 				ast_free(template->body);
 			template->body = message_template_parse_filebody(var->value);
 			if (!template->body) {
@@ -787,7 +787,7 @@
 				error++;
 			}
 		} else if (!strcasecmp(var->name, "messagebody")) {
-			if (template->body) 
+			if (template->body)
 				ast_free(template->body);
 			template->body = message_template_parse_emailbody(var->value);
 			if (!template->body) {
@@ -1004,7 +1004,7 @@
 {
 	char callerid[256];
 	struct ast_variable *var;
-	
+
 	if (!channel) {
 		ast_log(LOG_ERROR, "No allocated channel, giving up...\n");
 		return;
@@ -1031,7 +1031,7 @@
  * \brief Set default values for Mini-Voicemail users */
 static void populate_defaults(struct minivm_account *vmu)
 {
-	ast_copy_flags(vmu, (&globalflags), AST_FLAGS_ALL);	
+	ast_copy_flags(vmu, (&globalflags), AST_FLAGS_ALL);
 	ast_copy_string(vmu->attachfmt, default_vmformat, sizeof(vmu->attachfmt));
 	vmu->volgain = global_volgain;
 }
@@ -1057,7 +1057,7 @@
 {
 	struct minivm_account *this;
 	AST_LIST_LOCK(&minivm_accounts);
-	while ((this = AST_LIST_REMOVE_HEAD(&minivm_accounts, list))) 
+	while ((this = AST_LIST_REMOVE_HEAD(&minivm_accounts, list)))
 		ast_free(this);
 	AST_LIST_UNLOCK(&minivm_accounts);
 }
@@ -1094,7 +1094,7 @@
 	if (createtemp && !vmu) {
 		/* Create a temporary user, send e-mail and be gone */
 		vmu = mvm_user_alloc();
-		ast_set2_flag(vmu, TRUE, MVM_ALLOCED);	
+		ast_set2_flag(vmu, TRUE, MVM_ALLOCED);
 		if (vmu) {
 			ast_copy_string(vmu->username, username, sizeof(vmu->username));
 			ast_copy_string(vmu->domain, domain, sizeof(vmu->domain));
@@ -1119,7 +1119,7 @@
 	if (!retval)
 		return NULL;
 
-	if (username) 
+	if (username)
 		ast_copy_string(retval->username, username, sizeof(retval->username));
 
 	populate_defaults(retval);
@@ -1262,7 +1262,7 @@
 
 	if (type == MVM_MESSAGE_EMAIL) {
 		if (vmu && !ast_strlen_zero(vmu->email)) {
-			ast_copy_string(email, vmu->email, sizeof(email));	
+			ast_copy_string(email, vmu->email, sizeof(email));
 		} else if (!ast_strlen_zero(vmu->username) && !ast_strlen_zero(vmu->domain))
 			snprintf(email, sizeof(email), "%s@%s", vmu->username, vmu->domain);
 	} else if (type == MVM_MESSAGE_PAGE) {
@@ -1273,7 +1273,7 @@
 		ast_log(LOG_WARNING, "No address to send message to.\n");
 		ast_free(str1);
 		ast_free(str2);
-		return -1;	
+		return -1;
 	}
 
 	ast_debug(3, "Sending mail to %s@%s - Using template %s\n", vmu->username, vmu->domain, template->name);
@@ -1344,7 +1344,7 @@
 		struct minivm_zone *z;
 		AST_LIST_LOCK(&minivm_zones);
 		AST_LIST_TRAVERSE(&minivm_zones, z, list) {
-			if (strcmp(z->name, vmu->zonetag)) 
+			if (strcmp(z->name, vmu->zonetag))
 				continue;
 			the_zone = z;
 		}
@@ -1404,7 +1404,7 @@
 		} else {
 			fprintf(p, "From: %s <%s>\n", ast_str_quote(&str2, 0, ast_str_buffer(str1)), who);
 		}
-	} 
+	}
 
 	fprintf(p, "Message-ID: <Asterisk-%u-%s-%d-%s>\n", (unsigned int)ast_random(), vmu->username, (int)getpid(), who);
 
@@ -1470,7 +1470,7 @@
 	} else {
 		fprintf(p, "Dear %s:\n\n\tJust wanted to let you know you were just left a %s long message \n"
 			"in mailbox %s from %s, on %s so you might\n"
-			"want to check it when you get a chance.  Thanks!\n\n\t\t\t\t--Asterisk\n\n", vmu->fullname, 
+			"want to check it when you get a chance.  Thanks!\n\n\t\t\t\t--Asterisk\n\n", vmu->fullname,
 			dur,  vmu->username, (cidname ? cidname : (cidnum ? cidnum : "an unknown caller")), date);
 		ast_debug(3, "Using default message body (no template)\n-----\n");
 	}
@@ -1513,7 +1513,7 @@
  * \param dest    String. base directory.
  * \param len    Int. Length base directory string.
  * \param domain String. Ignored if is null or empty string.
- * \param username String. Ignored if is null or empty string. 
+ * \param username String. Ignored if is null or empty string.
  * \param folder  String. Ignored if is null or empty string.
  * \return 0 on failure, 1 on success.
  */
@@ -1563,10 +1563,10 @@
 
 	if (ast_fileexists(fn, NULL, NULL) > 0) {
 		res = ast_streamfile(chan, fn, ast_channel_language(chan));
-		if (res) 
+		if (res)
 			return -1;
 		res = ast_waitstream(chan, ecodes);
-		if (res) 
+		if (res)
 			return res;
 	} else {
 		int numericusername = 1;
@@ -1662,11 +1662,11 @@
 		case '3':
 			message_exists = 0;
 			/* Record */
-			if (recorded == 1) 
+			if (recorded == 1)
 				ast_verb(3, "Re-recording the message\n");
 			else
 				ast_verb(3, "Recording the message\n");
-			if (recorded && outsidecaller) 
+			if (recorded && outsidecaller)
 				cmd = ast_play_and_wait(chan, "beep");
 			recorded = 1;
 			/* After an attempt has been made to record message, we have to take care of INTRO and beep for incoming messages, but not for greetings */
@@ -1762,8 +1762,8 @@
 	if (ast_strlen_zero(vmu->externnotify) && ast_strlen_zero(global_externnotify))
 		return;
 
-	snprintf(arguments, sizeof(arguments), "%s %s@%s %s %s&", 
-		ast_strlen_zero(vmu->externnotify) ? global_externnotify : vmu->externnotify, 
+	snprintf(arguments, sizeof(arguments), "%s %s@%s %s %s&",
+		ast_strlen_zero(vmu->externnotify) ? global_externnotify : vmu->externnotify,
 		vmu->username, vmu->domain,
 		(ast_channel_caller(chan)->id.name.valid && ast_channel_caller(chan)->id.name.str)
 			? ast_channel_caller(chan)->id.name.str : "",
@@ -1874,7 +1874,7 @@
 	return res;
 }
 
- 
+
 /*!\internal
  * \brief Record voicemail message, store into file prepared for sending e-mail */
 static int leave_voicemail(struct ast_channel *chan, char *username, struct leave_vm_options *options)
@@ -1983,17 +1983,17 @@
 			"%s:%s:%s:%s:%d:%s:%s:%s:%s:%d:%s:%s\n",
 			username,
 			ast_channel_context(chan),
-			ast_channel_macrocontext(chan), 
+			ast_channel_macrocontext(chan),
 			ast_channel_exten(chan),
 			ast_channel_priority(chan),
 			ast_channel_name(chan),
 			callerid,
-			date, 
+			date,
 			timebuf,
 			duration,
 			duration < global_vmminmessage ? "IGNORED" : "OK",
 			vmu->accountcode
-		); 
+		);
 		fprintf(txt, "%s", logbuf);
 		if (minivmlogfile) {
 			ast_mutex_lock(&minivmloglock);
@@ -2008,7 +2008,7 @@
 			unlink(tmptxtfile);
 			pbx_builtin_setvar_helper(chan, "MVM_RECORD_STATUS", "FAILED");
 			return 0;
-		} 
+		}
 		fclose(txt); /* Close log file */
 		if (ast_fileexists(tmptxtfile, NULL, NULL) <= 0) {
 			ast_debug(1, "The recorded media file is gone, so we should remove the .txt file too!\n");
@@ -2132,7 +2132,7 @@
 	if (domain) {
 		*domain = '\0';
 		domain++;
-	} 
+	}
 	if (ast_strlen_zero(domain) || ast_strlen_zero(username)) {
 		ast_log(LOG_ERROR, "Need username at domain as argument. Sorry. Argument 0 %s\n", argv[0]);
 		return -1;
@@ -2152,7 +2152,7 @@
 	ast_channel_unlock(chan);
 	/* Notify of new message to e-mail and pager */
 	if (!ast_strlen_zero(filename)) {
-		ast_channel_lock(chan);	
+		ast_channel_lock(chan);
 		if ((format = pbx_builtin_getvar_helper(chan, "MVM_FORMAT"))) {
 			format = ast_strdupa(format);
 		}
@@ -2213,10 +2213,10 @@
 			if (sscanf(opts[OPT_ARG_RECORDGAIN], "%30d", &gain) != 1) {
 				ast_log(LOG_WARNING, "Invalid value '%s' provided for record gain option\n", opts[OPT_ARG_RECORDGAIN]);
 				return -1;
-			} else 
+			} else
 				leave_options.record_gain = (signed char) gain;
 		}
-	} 
+	}
 
 	/* Now run the appliation and good luck to you! */
 	res = leave_voicemail(chan, argv[0], &leave_options);
@@ -2274,7 +2274,7 @@
 	if (domain) {
 		*domain = '\0';
 		domain++;
-	} 
+	}
 	if (ast_strlen_zero(domain) || ast_strlen_zero(username)) {
 		ast_log(LOG_ERROR, "Need username at domain as argument. Sorry. Argument:  %s\n", argv[0]);
 		return -1;
@@ -2352,7 +2352,7 @@
 	res = 0;	/* Reset */
 	/* Play the beginning intro if desired */
 	if (!ast_strlen_zero(prefile)) {
-		if (ast_streamfile(chan, prefile, ast_channel_language(chan)) > -1) 
+		if (ast_streamfile(chan, prefile, ast_channel_language(chan)) > -1)
 			res = ast_waitstream(chan, ecodes);
 	} else {
 		ast_debug(2, "%s doesn't exist, doing what we can\n", prefile);
@@ -2439,7 +2439,7 @@
 	if (ast_strlen_zero(filename)) {
 		ast_log(LOG_ERROR, "No filename given in application arguments or channel variable MVM_FILENAME\n");
 		return res;
-	} 
+	}
 
 	/* Go ahead and delete audio files from system, they're not needed any more */
 	/* We should look for both audio and text files here */
@@ -2511,7 +2511,7 @@
 	if (domain) {
 		*domain = '\0';
 		domain++;
-	} 
+	}
 	if (ast_strlen_zero(domain) || ast_strlen_zero(username)) {
 		ast_log(LOG_ERROR, "Need username at domain as argument. Sorry. Argument 0 %s\n", argv[0]);
 		pbx_builtin_setvar_helper(chan, "MVM_ACCMESS_STATUS", "FAILED");
@@ -2528,7 +2528,7 @@
 	/* Answer channel if it's not already answered */
 	if (ast_channel_state(chan) != AST_STATE_UP)
 		ast_answer(chan);
-	
+
 	/* Here's where the action is */
 	if (ast_test_flag(&flags, OPT_BUSY_GREETING)) {
 		message = "busy";
@@ -2586,7 +2586,7 @@
 	vmu = ast_calloc(1, sizeof(*vmu));
 	if (!vmu)
 		return 0;
-	
+
 	ast_copy_string(vmu->domain, domain, sizeof(vmu->domain));
 	ast_copy_string(vmu->username, username, sizeof(vmu->username));
 
@@ -2641,7 +2641,7 @@
 		var = var->next;
 	}
 	ast_debug(3, "...Linking account %s\n", name);
-	
+
 	AST_LIST_LOCK(&minivm_accounts);
 	AST_LIST_INSERT_TAIL(&minivm_accounts, vmu, list);
 	AST_LIST_UNLOCK(&minivm_accounts);
@@ -2664,9 +2664,9 @@
 	struct minivm_zone *this;
 
 	AST_LIST_LOCK(&minivm_zones);
-	while ((this = AST_LIST_REMOVE_HEAD(&minivm_zones, list))) 
+	while ((this = AST_LIST_REMOVE_HEAD(&minivm_zones, list)))
 		free_zone(this);
-		
+
 	AST_LIST_UNLOCK(&minivm_zones);
 }
 
@@ -2688,7 +2688,7 @@
 		ast_free(newzone);
 		return 0;
 	}
-			
+
 	ast_copy_string(newzone->name, zonename, sizeof(newzone->name));
 	ast_copy_string(newzone->timezone, timezone_str, sizeof(newzone->timezone));
 	ast_copy_string(newzone->msg_format, msg_format, sizeof(newzone->msg_format));
@@ -2714,9 +2714,9 @@
 
 	if (ast_strlen_zero(filename))
 		return NULL;
-	if (*filename == '/') 
+	if (*filename == '/')
 		ast_copy_string(filenamebuf, filename, sizeof(filenamebuf));
-	else 
+	else
 		snprintf(filenamebuf, sizeof(filenamebuf), "%s/%s", ast_config_AST_CONFIG_DIR, filename);
 
 	if (!(fi = fopen(filenamebuf, "r"))) {
@@ -2766,7 +2766,7 @@
 	       }
 	       tmpread = tmpwrite + len;
 	}
-	return emailbody;	
+	return emailbody;
 }
 
 /*! \brief Apply general configuration options */
@@ -2818,9 +2818,9 @@
 		} else if (!strcmp(var->name, "format")) {
 			ast_copy_string(default_vmformat, var->value, sizeof(default_vmformat));
 		} else if (!strcmp(var->name, "review")) {
-			ast_set2_flag((&globalflags), ast_true(var->value), MVM_REVIEW);	
+			ast_set2_flag((&globalflags), ast_true(var->value), MVM_REVIEW);
 		} else if (!strcmp(var->name, "operator")) {
-			ast_set2_flag((&globalflags), ast_true(var->value), MVM_OPERATOR);	
+			ast_set2_flag((&globalflags), ast_true(var->value), MVM_OPERATOR);
 		}
 		var = var->next;
 	}
@@ -2864,8 +2864,8 @@
 	global_maxsilence = 0;
 	global_saydurationminfo = 2;
 	ast_copy_string(default_vmformat, "wav", sizeof(default_vmformat));
-	ast_set2_flag((&globalflags), FALSE, MVM_REVIEW);	
-	ast_set2_flag((&globalflags), FALSE, MVM_OPERATOR);	
+	ast_set2_flag((&globalflags), FALSE, MVM_REVIEW);
+	ast_set2_flag((&globalflags), FALSE, MVM_OPERATOR);
 	/* Reset statistics */
 	memset(&global_stats, 0, sizeof(global_stats));
 	global_stats.reset = ast_tvnow();
@@ -2917,7 +2917,7 @@
 	template = message_template_find("email-default");
 
 	/* Load date format config for voicemail mail */
-	if ((chanvar = ast_variable_retrieve(cfg, "general", "emaildateformat"))) 
+	if ((chanvar = ast_variable_retrieve(cfg, "general", "emaildateformat")))
 		ast_copy_string(template->dateformat, chanvar, sizeof(template->dateformat));
 	if ((chanvar = ast_variable_retrieve(cfg, "general", "emailfromstring")))
 		ast_copy_string(template->fromaddress, chanvar, sizeof(template->fromaddress));
@@ -2925,9 +2925,9 @@
 		ast_copy_string(template->serveremail, chanvar, sizeof(template->serveremail));
 	if ((chanvar = ast_variable_retrieve(cfg, "general", "emailcharset")))
 		ast_copy_string(template->charset, chanvar, sizeof(template->charset));
-	if ((chanvar = ast_variable_retrieve(cfg, "general", "emailsubject"))) 
+	if ((chanvar = ast_variable_retrieve(cfg, "general", "emailsubject")))
 		ast_copy_string(template->subject, chanvar, sizeof(template->subject));
-	if ((chanvar = ast_variable_retrieve(cfg, "general", "emailbody"))) 
+	if ((chanvar = ast_variable_retrieve(cfg, "general", "emailbody")))
 		template->body = message_template_parse_emailbody(chanvar);
 	template->attachment = TRUE;
 
@@ -2941,7 +2941,7 @@
 		ast_copy_string(template->charset, chanvar, sizeof(template->charset));
 	if ((chanvar = ast_variable_retrieve(cfg, "general", "pagersubject")))
 		ast_copy_string(template->subject, chanvar,sizeof(template->subject));
-	if ((chanvar = ast_variable_retrieve(cfg, "general", "pagerbody"))) 
+	if ((chanvar = ast_variable_retrieve(cfg, "general", "pagerbody")))
 		template->body = message_template_parse_emailbody(chanvar);
 	template->attachment = FALSE;
 
@@ -2997,8 +2997,8 @@
 	ast_cli(a->fd, HVLT_OUTPUT_FORMAT, "Template name", "Charset", "Locale", "Attach media", "Subject");
 	ast_cli(a->fd, HVLT_OUTPUT_FORMAT, "-------------", "-------", "------", "------------", "-------");
 	AST_LIST_TRAVERSE(&message_templates, this, list) {
-		ast_cli(a->fd, HVLT_OUTPUT_FORMAT, this->name, 
-			this->charset ? this->charset : "-", 
+		ast_cli(a->fd, HVLT_OUTPUT_FORMAT, this->name,
+			this->charset ? this->charset : "-",
 			this->locale ? this->locale : "-",
 			this->attachment ? "Yes" : "No",
 			this->subject ? this->subject : "-");
@@ -3069,9 +3069,9 @@
 		if ((a->argc == 3) || ((a->argc == 5) && !strcmp(a->argv[4], vmu->domain))) {
 			count++;
 			snprintf(tmp, sizeof(tmp), "%s@%s", vmu->username, vmu->domain);
-			ast_cli(a->fd, HMSU_OUTPUT_FORMAT, tmp, vmu->etemplate ? vmu->etemplate : "-", 
+			ast_cli(a->fd, HMSU_OUTPUT_FORMAT, tmp, vmu->etemplate ? vmu->etemplate : "-",
 				vmu->ptemplate ? vmu->ptemplate : "-",
-				vmu->zonetag ? vmu->zonetag : "-", 
+				vmu->zonetag ? vmu->zonetag : "-",
 				vmu->attachfmt ? vmu->attachfmt : "-",
 				vmu->fullname);
 		}
@@ -3157,7 +3157,7 @@
 	char buf[BUFSIZ];
 
 	switch (cmd) {
-	
+
 	case CLI_INIT:
 		e->command = "minivm show stats";
 		e->usage =
@@ -3218,25 +3218,25 @@
 
 	if (!strcasecmp(colname, "hasaccount")) {
 		ast_copy_string(buf, (ast_test_flag(vmu, MVM_ALLOCED) ? "0" : "1"), len);
-	} else  if (!strcasecmp(colname, "fullname")) { 
+	} else  if (!strcasecmp(colname, "fullname")) {
 		ast_copy_string(buf, vmu->fullname, len);
-	} else  if (!strcasecmp(colname, "email")) { 
+	} else  if (!strcasecmp(colname, "email")) {
 		if (!ast_strlen_zero(vmu->email))
 			ast_copy_string(buf, vmu->email, len);
 		else
 			snprintf(buf, len, "%s@%s", vmu->username, vmu->domain);
-	} else  if (!strcasecmp(colname, "pager")) { 
+	} else  if (!strcasecmp(colname, "pager")) {
 		ast_copy_string(buf, vmu->pager, len);
-	} else  if (!strcasecmp(colname, "etemplate")) { 
+	} else  if (!strcasecmp(colname, "etemplate")) {
 		if (!ast_strlen_zero(vmu->etemplate))
 			ast_copy_string(buf, vmu->etemplate, len);
 		else
 			ast_copy_string(buf, "email-default", len);
-	} else  if (!strcasecmp(colname, "language")) { 
+	} else  if (!strcasecmp(colname, "language")) {
 		ast_copy_string(buf, vmu->language, len);
-	} else  if (!strcasecmp(colname, "timezone")) { 
+	} else  if (!strcasecmp(colname, "timezone")) {
 		ast_copy_string(buf, vmu->zonetag, len);
-	} else  if (!strcasecmp(colname, "ptemplate")) { 
+	} else  if (!strcasecmp(colname, "ptemplate")) {
 		if (!ast_strlen_zero(vmu->ptemplate))
 			ast_copy_string(buf, vmu->ptemplate, len);
 		else
@@ -3278,11 +3278,11 @@
 	}
 }
 
-/*! \brief Access counter file, lock directory, read and possibly write it again changed 
+/*! \brief Access counter file, lock directory, read and possibly write it again changed
 	\param directory	Directory to crate file in
-	\param countername	filename 
+	\param countername	filename
 	\param value		If set to zero, we only read the variable
-	\param operand		0 to read, 1 to set new value, 2 to change 
+	\param operand		0 to read, 1 to set new value, 2 to change
 	\return -1 on error, otherwise counter value
 */
 static int access_counter_file(char *directory, char *countername, int value, int operand)
@@ -3322,7 +3322,7 @@
 			counter = 0;
 		break;
 	}
-	
+
 	/* Now, write the new value to the file */
 	counterfile = fopen(filename, "w");
 	if (!counterfile) {
@@ -3351,7 +3351,7 @@
 	if ((countername = strchr(username, ':'))) {
 		*countername = '\0';
 		countername++;
-	} 
+	}
 
 	if ((domain = strchr(username, '@'))) {
 		*domain = '\0';
@@ -3407,11 +3407,11 @@
 	if ((countername = strchr(username, ':'))) {
 		*countername = '\0';
 		countername++;
-	} 
+	}
 	if ((operand = strchr(countername, ':'))) {
 		*operand = '\0';
 		operand++;
-	} 
+	}
 
 	if ((domain = strchr(username, '@'))) {
 		*domain = '\0';
@@ -3465,7 +3465,7 @@
 static struct ast_cli_entry cli_minivm[] = {
 	AST_CLI_DEFINE(handle_minivm_show_users, "List defined mini-voicemail boxes"),
 	AST_CLI_DEFINE(handle_minivm_show_zones, "List zone message formats"),
-	AST_CLI_DEFINE(handle_minivm_list_templates, "List message templates"),	
+	AST_CLI_DEFINE(handle_minivm_list_templates, "List message templates"),
 	AST_CLI_DEFINE(handle_minivm_reload, "Reload Mini-voicemail configuration"),
 	AST_CLI_DEFINE(handle_minivm_show_stats, "Show some mini-voicemail statistics"),
 	AST_CLI_DEFINE(handle_minivm_show_settings, "Show mini-voicemail general settings"),
@@ -3519,7 +3519,7 @@
 /*! \brief Reload cofiguration */
 static char *handle_minivm_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
-	
+
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "minivm reload";
@@ -3530,7 +3530,7 @@
 	case CLI_GENERATE:
 		return NULL;
 	}
-	
+
 	reload();
 	ast_cli(a->fd, "\n-- Mini voicemail re-configured \n");
 	return CLI_SUCCESS;
@@ -3540,7 +3540,7 @@
 static int unload_module(void)
 {
 	int res;
-	
+
 	res = ast_unregister_application(app_minivm_record);
 	res |= ast_unregister_application(app_minivm_greet);
 	res |= ast_unregister_application(app_minivm_notify);
diff --git a/apps/app_morsecode.c b/apps/app_morsecode.c
index 8d06ac4..9259e5b 100644
--- a/apps/app_morsecode.c
+++ b/apps/app_morsecode.c
@@ -67,7 +67,7 @@
 			<ref type="application">SayPhonetic</ref>
 		</see-also>
 	</application>
- ***/	
+ ***/
 static const char app_morsecode[] = "Morsecode";
 
 static const char * const morsecode[] = {
diff --git a/apps/app_mp3.c b/apps/app_mp3.c
index 5712cfe..1218b77 100644
--- a/apps/app_mp3.c
+++ b/apps/app_mp3.c
@@ -24,14 +24,14 @@
  *
  * \note Add feature to play local M3U playlist file
  * Vincent Li <mchun.li at gmail.com>
- * 
+ *
  * \ingroup applications
  */
 
 /*** MODULEINFO
 	<support_level>extended</support_level>
  ***/
- 
+
 #include "asterisk.h"
 
 ASTERISK_REGISTER_FILE()
@@ -82,7 +82,7 @@
 	int res;
 
 	res = ast_safe_fork(0);
-	if (res < 0) 
+	if (res < 0)
 		ast_log(LOG_WARNING, "Fork failed\n");
 	if (res) {
 		return res;
@@ -135,7 +135,7 @@
 		return -1;
 	}
 	return read(fd, data, datalen);
-	
+
 }
 
 static int mp3_exec(struct ast_channel *chan, const char *data)
@@ -165,7 +165,7 @@
 		ast_log(LOG_WARNING, "Unable to create pipe\n");
 		return -1;
 	}
-	
+
 	ast_stopstream(chan);
 
 	owriteformat = ao2_bump(ast_channel_writeformat(chan));
@@ -183,7 +183,7 @@
 	myf.f.delivery.tv_sec = 0;
 	myf.f.delivery.tv_usec = 0;
 	myf.f.data.ptr = myf.frdata;
-	
+
 	res = mp3play(data, fds[1]);
 	if (!strncasecmp(data, "http://", 7)) {
 		timeout = 10000;
@@ -233,20 +233,20 @@
 						break;
 					}
 					ast_frfree(f);
-				} 
+				}
 			}
 		}
 	}
 	close(fds[0]);
 	close(fds[1]);
-	
+
 	if (pid > -1)
 		kill(pid, SIGKILL);
 	if (!res && owriteformat)
 		ast_set_write_format(chan, owriteformat);
 
 	ast_frfree(&myf.f);
-	
+
 	return res;
 }
 
diff --git a/apps/app_nbscat.c b/apps/app_nbscat.c
index 8175fc8..16f5750 100644
--- a/apps/app_nbscat.c
+++ b/apps/app_nbscat.c
@@ -21,14 +21,14 @@
  * \brief Silly application to play an NBScat file -- uses nbscat8k
  *
  * \author Mark Spencer <markster at digium.com>
- *  
+ *
  * \ingroup applications
  */
 
 /*** MODULEINFO
 	<support_level>extended</support_level>
  ***/
- 
+
 #include "asterisk.h"
 
 ASTERISK_REGISTER_FILE()
@@ -107,7 +107,7 @@
 		return -1;
 	}
 	return read(fd, data, datalen);
-	
+
 }
 
 static int NBScat_exec(struct ast_channel *chan, const char *data)
@@ -129,7 +129,7 @@
 		ast_log(LOG_WARNING, "Unable to create socketpair\n");
 		return -1;
 	}
-	
+
 	ast_stopstream(chan);
 
 	owriteformat = ao2_bump(ast_channel_writeformat(chan));
@@ -148,7 +148,7 @@
 	myf.f.delivery.tv_sec = 0;
 	myf.f.delivery.tv_usec = 0;
 	myf.f.data.ptr = myf.frdata;
-	
+
 	res = NBScatplay(fds[1]);
 	/* Wait 1000 ms first */
 	next = ast_tvnow();
@@ -195,14 +195,14 @@
 						break;
 					}
 					ast_frfree(f);
-				} 
+				}
 			}
 		}
 	}
 	close(fds[0]);
 	close(fds[1]);
 	ast_frfree(&myf.f);
-	
+
 	if (pid > -1)
 		kill(pid, SIGKILL);
 	if (!res && owriteformat)
diff --git a/apps/app_playback.c b/apps/app_playback.c
index 2875ec2..2abc2f4 100644
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -21,7 +21,7 @@
  * \brief Trivial application to playback a sound file
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
@@ -165,7 +165,7 @@
 	ast_waitstream_full(a->chan, a->ints, a->audiofd, a->ctrlfd) :
 	ast_waitstream(a->chan, a->ints);
 	ast_stopstream(a->chan);
-	return res;  
+	return res;
 }
 
 /*! \brief
@@ -176,7 +176,7 @@
 {
 	struct ast_variable *v;
 	char *lang, *x, *rule = NULL;
-	int ret = 0;   
+	int ret = 0;
 	struct varshead head = { .first = NULL, .last = NULL };
 	struct ast_var_t *n;
 
@@ -276,7 +276,7 @@
 				strcpy(fn2 + l, data);
 				ret = do_say(a, fn2, options, depth);
 			}
-			
+
 			if (ret) {
 				break;
 			}
@@ -374,9 +374,9 @@
 
 		ast_say_enumeration_full = say_enumeration_full;
 #if 0
-		/*! \todo XXX 
+		/*! \todo XXX
 		   These functions doesn't exist.
-		   say.conf.sample indicates this is working... 
+		   say.conf.sample indicates this is working...
 		*/
 		ast_say_digits_full = say_digits_full;
 		ast_say_digit_str_full = say_digit_str_full;
@@ -394,7 +394,7 @@
 		ast_log(LOG_WARNING, "unrecognized mode %s\n", mode);
 		return -1;
 	}
-	
+
 	return 0;
 }
 
@@ -405,7 +405,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "say load [new|old]";
-		e->usage = 
+		e->usage =
 			"Usage: say load [new|old]\n"
 			"       say load\n"
 			"           Report status of current say mode\n"
@@ -449,7 +449,7 @@
 		AST_APP_ARG(filenames);
 		AST_APP_ARG(options);
 	);
-	
+
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Playback requires an argument (filename)\n");
 		return -1;
@@ -465,7 +465,7 @@
 			option_say = 1;
 		if (strcasestr(args.options, "noanswer"))
 			option_noanswer = 1;
-	} 
+	}
 	if (ast_channel_state(chan) != AST_STATE_UP) {
 		if (option_skip) {
 			/* At the user's option, skip if the line is not up */
@@ -530,7 +530,7 @@
 			}
 		}
 	}
-	
+
 	/*! \todo
 	 * XXX here we should sort rules according to the same order
 	 * we have in pbx.c so we have the same matching behaviour.
@@ -549,7 +549,7 @@
 	if (say_cfg)
 		ast_config_destroy(say_cfg);
 
-	return res;	
+	return res;
 }
 
 static int load_module(void)
diff --git a/apps/app_read.c b/apps/app_read.c
index 1f586cb..701b809 100644
--- a/apps/app_read.c
+++ b/apps/app_read.c
@@ -21,14 +21,14 @@
  * \brief Trivial application to read a variable
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
 /*** MODULEINFO
 	<support_level>core</support_level>
  ***/
- 
+
 #include "asterisk.h"
 
 ASTERISK_REGISTER_FILE()
@@ -146,13 +146,13 @@
 		AST_APP_ARG(attempts);
 		AST_APP_ARG(timeout);
 	);
-	
+
 	pbx_builtin_setvar_helper(chan, "READSTATUS", status);
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Read requires an argument (variable)\n");
 		return 0;
 	}
-	
+
 	argcopy = ast_strdupa(data);
 
 	AST_STANDARD_APP_ARGS(arglist, argcopy);
@@ -160,7 +160,7 @@
 	if (!ast_strlen_zero(arglist.options)) {
 		ast_app_parse_options(read_app_options, &flags, NULL, arglist.options);
 	}
-	
+
 	if (!ast_strlen_zero(arglist.attempts)) {
 		tries = atoi(arglist.attempts);
 		if (tries <= 0)
diff --git a/apps/app_readexten.c b/apps/app_readexten.c
index a0a3c55..37c2b13 100644
--- a/apps/app_readexten.c
+++ b/apps/app_readexten.c
@@ -20,14 +20,14 @@
  * \brief Trivial application to read an extension into a variable
  *
  * \author David Chappell <David.Chappell at trincoll.edu>
- * 
+ *
  * \ingroup applications
  */
 
 /*** MODULEINFO
 	<support_level>core</support_level>
  ***/
- 
+
 #include "asterisk.h"
 
 ASTERISK_REGISTER_FILE()
diff --git a/apps/app_record.c b/apps/app_record.c
index ed54a77..5b8aa8d 100644
--- a/apps/app_record.c
+++ b/apps/app_record.c
@@ -28,7 +28,7 @@
 /*** MODULEINFO
 	<support_level>core</support_level>
  ***/
- 
+
 #include "asterisk.h"
 
 ASTERISK_REGISTER_FILE()
@@ -188,7 +188,7 @@
 
 	struct ast_filestream *s = NULL;
 	struct ast_frame *f = NULL;
-	
+
 	struct ast_dsp *sildet = NULL;   	/* silence detector dsp */
 	int totalsilence = 0;
 	int dspsilence = 0;
@@ -245,7 +245,7 @@
 			ast_log(LOG_WARNING, "'%s' is not a valid silence duration\n", args.silence);
 		}
 	}
-	
+
 	if (args.maxduration) {
 		if ((sscanf(args.maxduration, "%30d", &i) == 1) && (i > -1))
 			/* Convert duration to milliseconds */
@@ -344,7 +344,7 @@
 			return -1;
 		}
 		ast_dsp_set_threshold(sildet, ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE));
-	} 
+	}
 
 	/* Create the directory if it does not exist. */
 	dir = ast_strdupa(tmp);
diff --git a/apps/app_sayunixtime.c b/apps/app_sayunixtime.c
index c4efaf3..faa0309 100644
--- a/apps/app_sayunixtime.c
+++ b/apps/app_sayunixtime.c
@@ -21,7 +21,7 @@
  * \brief SayUnixTime application
  *
  * \author Tilghman Lesher <app_sayunixtime__200309 at the-tilghman.com>
- * 
+ *
  * \ingroup applications
  */
 
@@ -68,7 +68,7 @@
 			</parameter>
 		</syntax>
 		<description>
-			<para>Uses some of the sound files stored in <directory>/var/lib/asterisk/sounds</directory> to construct a phrase 
+			<para>Uses some of the sound files stored in <directory>/var/lib/asterisk/sounds</directory> to construct a phrase
 			saying the specified date and/or time in the specified format. </para>
 		</description>
 		<see-also>
@@ -175,20 +175,20 @@
 static int unload_module(void)
 {
 	int res;
-	
+
 	res = ast_unregister_application(app_sayunixtime);
 	res |= ast_unregister_application(app_datetime);
-	
+
 	return res;
 }
 
 static int load_module(void)
 {
 	int res;
-	
+
 	res = ast_register_application_xml(app_sayunixtime, sayunixtime_exec);
 	res |= ast_register_application_xml(app_datetime, sayunixtime_exec);
-	
+
 	return res;
 }
 
diff --git a/apps/app_senddtmf.c b/apps/app_senddtmf.c
index bca4630..c4ae1f4 100644
--- a/apps/app_senddtmf.c
+++ b/apps/app_senddtmf.c
@@ -162,7 +162,7 @@
 		chan = ast_channel_unref(chan);
 		return 0;
 	}
-	
+
 	if (!ast_strlen_zero(duration) && (sscanf(duration, "%30u", &duration_ms) != 1)) {
 		astman_send_error(s, m, "Could not convert Duration parameter");
 		chan = ast_channel_unref(chan);
diff --git a/apps/app_sendtext.c b/apps/app_sendtext.c
index 3b7f0ca..601d774 100644
--- a/apps/app_sendtext.c
+++ b/apps/app_sendtext.c
@@ -21,7 +21,7 @@
  * \brief App to transmit a text message
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \note Requires support of sending text messages from channel driver
  *
  * \ingroup applications
@@ -30,7 +30,7 @@
 /*** MODULEINFO
 	<support_level>core</support_level>
  ***/
- 
+
 #include "asterisk.h"
 
 ASTERISK_REGISTER_FILE()
diff --git a/apps/app_setcallerid.c b/apps/app_setcallerid.c
index 36d554e..982f298 100644
--- a/apps/app_setcallerid.c
+++ b/apps/app_setcallerid.c
@@ -21,7 +21,7 @@
  * \brief App to set callerid presentation
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
@@ -110,7 +110,7 @@
 			(char *) data);
 		return 0;
 	}
-	
+
 	/* Set the combined caller id presentation. */
 	ast_channel_caller(chan)->id.name.presentation = pres;
 	ast_channel_caller(chan)->id.number.presentation = pres;
diff --git a/apps/app_skel.c b/apps/app_skel.c
index 54ecbe1..80c3fb5 100644
--- a/apps/app_skel.c
+++ b/apps/app_skel.c
@@ -33,7 +33,7 @@
  * \addtogroup configuration_file Configuration Files
  */
 
-/*! 
+/*!
  * \page app_skel.conf app_skel.conf
  * \verbinclude app_skel.conf.sample
  */
@@ -712,8 +712,8 @@
  * Module loading including tests for configuration or dependencies.
  * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE,
  * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails
- * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the 
- * configuration file or other non-critical problem return 
+ * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the
+ * configuration file or other non-critical problem return
  * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
  */
 static int load_module(void)
diff --git a/apps/app_sms.c b/apps/app_sms.c
index a748c3b..09866a2 100644
--- a/apps/app_sms.c
+++ b/apps/app_sms.c
@@ -17,7 +17,7 @@
 /*! \file
  *
  * \brief SMS application - ETSI ES 201 912 protocol 1 implementation
- * 
+ *
  * \par Development notes
  * \note The ETSI standards are available free of charge from ETSI at
  *	http://pda.etsi.org/pda/queryform.asp
@@ -26,7 +26,7 @@
  *	ES 201 912	SMS for PSTN/ISDN
  *	TS 123 040	Technical realization of SMS
  *
- * 
+ *
  * \ingroup applications
  *
  * \author Adrian Kennard (for the original protocol 1 code)
@@ -413,7 +413,7 @@
 			for (v = 0; v < 128 && escapes[v] != u; v++);
 			if (v < 128) {	/* escaped sequence, esc + v */
 				/* store the low (8-b) bits in o[p], the remaining bits in o[p+1] */
-				o[p] |= (27 << b);          /* the low bits go into o[p] */ 
+				o[p] |= (27 << b);          /* the low bits go into o[p] */
 				b += 7;
 				if (b >= 8) {
 					b -= 8;
@@ -476,13 +476,13 @@
 	return p;
 }
 
-/*! \brief takes a binary header (udhl bytes at udh) and UCS-2 
-	message (udl characters at ud) and packs in to o using 16 bit 
-	UCS-2 character codes 
-	The return value is the number of bytes packed in to o, which is 
-	internally limited to 140 
-	o can be null, in which case this is used to validate or count 
-	only if the input contains invalid characters then 
+/*! \brief takes a binary header (udhl bytes at udh) and UCS-2
+	message (udl characters at ud) and packs in to o using 16 bit
+	UCS-2 character codes
+	The return value is the number of bytes packed in to o, which is
+	internally limited to 140
+	o can be null, in which case this is used to validate or count
+	only if the input contains invalid characters then
 	the return value is -1 */
 static int packsms16(unsigned char *o, int udhl, unsigned char *udh, int udl, unsigned short *ud)
 {
@@ -517,7 +517,7 @@
 	return p;
 }
 
-/*! \brief general pack, with length and data, 
+/*! \brief general pack, with length and data,
 	returns number of bytes of target used */
 static int packsms(unsigned char dcs, unsigned char *base, unsigned int udhl, unsigned char *udh, int udl, unsigned short *ud)
 {
@@ -525,7 +525,7 @@
 	if (udl == 0) {
 		*p++ = 0;                           /* no user data */
 	} else {
-		
+
 		int l = 0;
 		if (is7bit(dcs)) {                  /* 7 bit */
 			if ((l = packsms7(p + 1, udhl, udh, udl, ud)) < 0) {
@@ -598,8 +598,8 @@
 	return ast_mktime(&t, NULL);
 }
 
-/*! \brief unpacks bytes (7 bit encoding) at i, len l septets, 
-	and places in udh and ud setting udhl and udl. udh not used 
+/*! \brief unpacks bytes (7 bit encoding) at i, len l septets,
+	and places in udh and ud setting udhl and udl. udh not used
 	if udhi not set */
 static void unpacksms7(unsigned char *i, unsigned char l, unsigned char *udh, int *udhl, unsigned short *ud, int *udl, char udhi)
 {
@@ -653,8 +653,8 @@
 	*udl = (o - ud);
 }
 
-/*! \brief unpacks bytes (8 bit encoding) at i, len l septets, 
- *  and places in udh and ud setting udhl and udl. udh not used 
+/*! \brief unpacks bytes (8 bit encoding) at i, len l septets,
+ *  and places in udh and ud setting udhl and udl. udh not used
  *  if udhi not set.
  */
 static void unpacksms8(unsigned char *i, unsigned char l, unsigned char *udh, int *udhl, unsigned short *ud, int *udl, char udhi)
@@ -681,7 +681,7 @@
 }
 
 /*! \brief unpacks bytes (16 bit encoding) at i, len l septets,
-	 and places in udh and ud setting udhl and udl. 
+	 and places in udh and ud setting udhl and udl.
 	udh not used if udhi not set */
 static void unpacksms16(unsigned char *i, unsigned char l, unsigned char *udh, int *udhl, unsigned short *ud, int *udl, char udhi)
 {
@@ -1442,7 +1442,7 @@
 
 /*! \brief find and fill in next message, or send a REL if none waiting */
 static void sms_nextoutgoing (sms_t * h)
-{	  
+{
 	char fn[100 + NAME_MAX] = "";
 	DIR *d;
 	char more = 0;
@@ -1954,7 +1954,7 @@
 	if (ast_test_flag(&flags, OPTION_DCS)) {
 		h.dcs = 1;
 	}
-#if 0	
+#if 0
 		case '1':
 		case '2':
 		case '3':
@@ -2009,7 +2009,7 @@
 		res = h.err;
 		goto done;
 	}
-	
+
 	if (ast_channel_state(chan) != AST_STATE_UP) {		/* make sure channel is answered before any TX */
 		ast_answer(chan);
 	}
@@ -2066,7 +2066,7 @@
 	}
 	res = h.err;                            /* XXX */
 
-	/* 
+	/*
 	 * The SMS generator data is on the stack.  We _MUST_ make sure the generator
 	 * is stopped before returning from this function.
 	 */
diff --git a/apps/app_softhangup.c b/apps/app_softhangup.c
index 9660b4f..3465cc7 100644
--- a/apps/app_softhangup.c
+++ b/apps/app_softhangup.c
@@ -21,7 +21,7 @@
  * \brief SoftHangup application
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
@@ -54,9 +54,9 @@
 					</option>
 				</optionlist>
 			</parameter>
-		</syntax>	
+		</syntax>
 		<description>
-			<para>Hangs up the requested channel.  If there are no channels to 
+			<para>Hangs up the requested channel.  If there are no channels to
 			hangup, the application will report it.</para>
 		</description>
 	</application>
@@ -85,7 +85,7 @@
 		AST_APP_ARG(options);
 	);
 	struct ast_channel_iterator *iter;
-	
+
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "SoftHangup requires an argument (Technology/resource)\n");
 		return 0;
@@ -106,7 +106,7 @@
 		ast_channel_lock(c);
 		ast_copy_string(name, ast_channel_name(c), sizeof(name));
 		if (ast_test_flag(&flags, OPTION_ALL)) {
-			/* CAPI is set up like CAPI[foo/bar]/clcnt */ 
+			/* CAPI is set up like CAPI[foo/bar]/clcnt */
 			if (!strcmp(ast_channel_tech(c)->type, "CAPI")) {
 				cut = strrchr(name, '/');
 			/* Basically everything else is Foo/Bar-Z */
diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c
index 7c34dca..d3a2fe7 100644
--- a/apps/app_speech_utils.c
+++ b/apps/app_speech_utils.c
@@ -109,7 +109,7 @@
 			and ${SPEECH_SCORE(1)}.</para>
 			<para>The first argument is the sound file and the second is the timeout integer in seconds.</para>
 			<para>Hangs up the channel on failure. If this is not desired, use TryExec.</para>
-			
+
 		</description>
 	</application>
 	<application name="SpeechDeactivateGrammar" language="en_US">
@@ -371,9 +371,9 @@
 	if (data == NULL || speech == NULL || !(result = find_result(speech->results, data))) {
 		return -1;
 	}
-	
+
 	snprintf(tmp, sizeof(tmp), "%d", result->score);
-	
+
 	ast_copy_string(buf, tmp, len);
 
 	return 0;
@@ -681,10 +681,10 @@
 
 	if (!(fs = ast_openstream(chan, filename, preflang)))
 		return -1;
-	
+
 	if (ast_applystream(chan, fs))
 		return -1;
-	
+
 	ast_playstream(fs);
 
 	return 0;
@@ -756,7 +756,7 @@
 	if ((tmp2 = pbx_builtin_getvar_helper(chan, "SPEECH_DTMF_MAXLEN")) && !ast_strlen_zero(tmp2)) {
 		max_dtmf_len = atoi(tmp2);
 	}
-	
+
 	/* See if a terminator is specified */
 	if ((tmp2 = pbx_builtin_getvar_helper(chan, "SPEECH_DTMF_TERMINATOR"))) {
 		if (ast_strlen_zero(tmp2))
@@ -975,7 +975,7 @@
 	res |= ast_custom_function_unregister(&speech_engine_function);
 	res |= ast_custom_function_unregister(&speech_results_type_function);
 
-	return res;	
+	return res;
 }
 
 static int load_module(void)
diff --git a/apps/app_stack.c b/apps/app_stack.c
index be8abbf..229e056 100644
--- a/apps/app_stack.c
+++ b/apps/app_stack.c
@@ -21,7 +21,7 @@
  * \brief Stack applications Gosub, Return, etc.
  *
  * \author Tilghman Lesher <app_stack_v003 at the-tilghman.com>
- * 
+ *
  * \ingroup applications
  */
 
@@ -31,7 +31,7 @@
  ***/
 
 #include "asterisk.h"
- 
+
 ASTERISK_REGISTER_FILE()
 
 #include "asterisk/pbx.h"
@@ -305,7 +305,7 @@
 	 */
 	while ((vardata = AST_LIST_REMOVE_HEAD(&frame->varshead, entries))) {
 		if (chan)
-			pbx_builtin_setvar_helper(chan, ast_var_name(vardata), NULL);	
+			pbx_builtin_setvar_helper(chan, ast_var_name(vardata), NULL);
 		ast_var_delete(vardata);
 	}
 
diff --git a/apps/app_talkdetect.c b/apps/app_talkdetect.c
index 5cb10ad..b62b538 100644
--- a/apps/app_talkdetect.c
+++ b/apps/app_talkdetect.c
@@ -21,7 +21,7 @@
  * \brief Playback a file with audio detect
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
@@ -173,7 +173,7 @@
 						ast_verb(3, "BackgroundDetect: Talk analysis time complete on %s.\n", ast_channel_name(chan));
 					}
 				}
-				
+
 				if (!fr) {
 					res = -1;
 					break;
@@ -205,8 +205,8 @@
 								char ms_str[12];
 								ast_debug(1, "Found qualified token of %d ms\n", ms);
 
-								/* Save detected talk time (in milliseconds) */ 
-								snprintf(ms_str, sizeof(ms_str), "%d", ms);	
+								/* Save detected talk time (in milliseconds) */
+								snprintf(ms_str, sizeof(ms_str), "%d", ms);
 								pbx_builtin_setvar_helper(chan, "TALK_DETECTED", ms_str);
 
 								ast_goto_if_exists(chan, ast_channel_context(chan), "talk", 1);
@@ -236,7 +236,7 @@
 
 	if (res > -1) {
 		if (origrformat && ast_set_read_format(chan, origrformat)) {
-			ast_log(LOG_WARNING, "Failed to restore read format for %s to %s\n", 
+			ast_log(LOG_WARNING, "Failed to restore read format for %s to %s\n",
 				ast_channel_name(chan), ast_format_get_name(origrformat));
 		}
 	}
diff --git a/apps/app_test.c b/apps/app_test.c
index 94f746b..d64bbbd 100644
--- a/apps/app_test.c
+++ b/apps/app_test.c
@@ -23,7 +23,7 @@
  *
  * \author Mark Spencer <markster at digium.com>
  * \author Russell Bryant <russelb at clemson.edu>
- * 
+ *
  * \ingroup applications
  */
 
diff --git a/apps/app_transfer.c b/apps/app_transfer.c
index d4cb6b6..e202721 100644
--- a/apps/app_transfer.c
+++ b/apps/app_transfer.c
@@ -21,7 +21,7 @@
  * \brief Transfer a caller
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * Requires transfer support from channel driver
  *
  * \ingroup applications
diff --git a/apps/app_url.c b/apps/app_url.c
index 863fa09..211feb9 100644
--- a/apps/app_url.c
+++ b/apps/app_url.c
@@ -21,14 +21,14 @@
  * \brief App to transmit a URL
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
 /*** MODULEINFO
 	<support_level>extended</support_level>
  ***/
- 
+
 #include "asterisk.h"
 
 ASTERISK_REGISTER_FILE()
@@ -106,7 +106,7 @@
 		AST_APP_ARG(url);
 		AST_APP_ARG(options);
 	);
-	
+
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "SendURL requires an argument (URL)\n");
 		pbx_builtin_setvar_helper(chan, "SENDURLSTATUS", status);
@@ -118,7 +118,7 @@
 	AST_STANDARD_APP_ARGS(args, tmp);
 	if (args.argc == 2)
 		ast_app_parse_options(app_opts, &flags, opts, args.options);
-	
+
 	if (!ast_channel_supports_html(chan)) {
 		/* Does not support transport */
 		pbx_builtin_setvar_helper(chan, "SENDURLSTATUS", "UNSUPPORTED");
@@ -134,7 +134,7 @@
 		for(;;) {
 			/* Wait for an event */
 			res = ast_waitfor(chan, -1);
-			if (res < 0) 
+			if (res < 0)
 				break;
 			f = ast_read(chan);
 			if (!f) {
@@ -163,8 +163,8 @@
 			}
 			ast_frfree(f);
 		}
-	} 
-out:	
+	}
+out:
 	pbx_builtin_setvar_helper(chan, "SENDURLSTATUS", status);
 	return res;
 }
diff --git a/apps/app_userevent.c b/apps/app_userevent.c
index c4f985f..4dd56b5 100644
--- a/apps/app_userevent.c
+++ b/apps/app_userevent.c
@@ -17,7 +17,7 @@
 /*! \file
  *
  * \brief UserEvent application -- send manager event
- * 
+ *
  * \ingroup applications
  */
 
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index f2f7bad..5c8e9c3 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -41,7 +41,7 @@
  * \addtogroup configuration_file Configuration Files
  */
 
-/*! 
+/*!
  * \page voicemail.conf voicemail.conf
  * \verbinclude voicemail.conf.sample
  */
@@ -792,7 +792,7 @@
 	unsigned char iobuf[BASEMAXINLINE];
 };
 
-/*! Structure for linked list of users 
+/*! Structure for linked list of users
  * Use ast_vm_user_destroy() to free one of these structures. */
 struct ast_vm_user {
 	char context[AST_MAX_CONTEXT];   /*!< Voicemail context */
@@ -812,7 +812,7 @@
 	char uniqueid[80];               /*!< Unique integer identifier */
 	char exit[80];
 	char attachfmt[20];              /*!< Attachment format */
-	unsigned int flags;              /*!< VM_ flags */	
+	unsigned int flags;              /*!< VM_ flags */
 	int saydurationm;
 	int minsecs;                     /*!< Minimum number of seconds per message for this mailbox */
 	int maxmsg;                      /*!< Maximum number of msgs per folder for this mailbox */
@@ -910,7 +910,7 @@
 #define STORE(a,b,c,d,e,f,g,h,i,j,k)
 #define EXISTS(a,b,c,d) (ast_fileexists(c,NULL,d) > 0)
 #define RENAME(a,b,c,d,e,f,g,h) (rename_file(g,h));
-#define COPY(a,b,c,d,e,f,g,h) (copy_plain_file(g,h)); 
+#define COPY(a,b,c,d,e,f,g,h) (copy_plain_file(g,h));
 #define DELETE(a,b,c,d) (vm_delete(c))
 #define UPDATE_MSG_ID(a, b, c, d, e, f)
 #endif
@@ -964,7 +964,7 @@
 static int silencethreshold = 128;
 static char serveremail[80];
 static char mailcmd[160];	/* Configurable mail cmd */
-static char externnotify[160]; 
+static char externnotify[160];
 static struct ast_smdi_interface *smdi_iface = NULL;
 static char vmfmts[80];
 static double volgain;
@@ -1295,7 +1295,7 @@
  * \param vmu The voicemail user object to work with.
  * \param var The name of the property to be set.
  * \param value The value to be set to the property.
- * 
+ *
  * The property name must be one of the understood properties. See the source for details.
  */
 static void apply_option(struct ast_vm_user *vmu, const char *var, const char *value)
@@ -1343,25 +1343,25 @@
 		vmu->imapversion = imapversion;
 #endif
 	} else if (!strcasecmp(var, "delete") || !strcasecmp(var, "deletevoicemail")) {
-		ast_set2_flag(vmu, ast_true(value), VM_DELETE);	
+		ast_set2_flag(vmu, ast_true(value), VM_DELETE);
 	} else if (!strcasecmp(var, "saycid")){
-		ast_set2_flag(vmu, ast_true(value), VM_SAYCID);	
+		ast_set2_flag(vmu, ast_true(value), VM_SAYCID);
 	} else if (!strcasecmp(var, "sendvoicemail")){
-		ast_set2_flag(vmu, ast_true(value), VM_SVMAIL);	
+		ast_set2_flag(vmu, ast_true(value), VM_SVMAIL);
 	} else if (!strcasecmp(var, "review")){
 		ast_set2_flag(vmu, ast_true(value), VM_REVIEW);
 	} else if (!strcasecmp(var, "tempgreetwarn")){
-		ast_set2_flag(vmu, ast_true(value), VM_TEMPGREETWARN);	
+		ast_set2_flag(vmu, ast_true(value), VM_TEMPGREETWARN);
 	} else if (!strcasecmp(var, "messagewrap")){
-		ast_set2_flag(vmu, ast_true(value), VM_MESSAGEWRAP);	
+		ast_set2_flag(vmu, ast_true(value), VM_MESSAGEWRAP);
 	} else if (!strcasecmp(var, "operator")) {
-		ast_set2_flag(vmu, ast_true(value), VM_OPERATOR);	
+		ast_set2_flag(vmu, ast_true(value), VM_OPERATOR);
 	} else if (!strcasecmp(var, "envelope")){
-		ast_set2_flag(vmu, ast_true(value), VM_ENVELOPE);	
+		ast_set2_flag(vmu, ast_true(value), VM_ENVELOPE);
 	} else if (!strcasecmp(var, "moveheard")){
 		ast_set2_flag(vmu, ast_true(value), VM_MOVEHEARD);
 	} else if (!strcasecmp(var, "sayduration")){
-		ast_set2_flag(vmu, ast_true(value), VM_SAYDURATION);	
+		ast_set2_flag(vmu, ast_true(value), VM_SAYDURATION);
 	} else if (!strcasecmp(var, "saydurationm")){
 		if (sscanf(value, "%30d", &x) == 1) {
 			vmu->saydurationm = x;
@@ -1369,9 +1369,9 @@
 			ast_log(AST_LOG_WARNING, "Invalid min duration for say duration\n");
 		}
 	} else if (!strcasecmp(var, "forcename")){
-		ast_set2_flag(vmu, ast_true(value), VM_FORCENAME);	
+		ast_set2_flag(vmu, ast_true(value), VM_FORCENAME);
 	} else if (!strcasecmp(var, "forcegreetings")){
-		ast_set2_flag(vmu, ast_true(value), VM_FORCEGREET);	
+		ast_set2_flag(vmu, ast_true(value), VM_FORCEGREET);
 	} else if (!strcasecmp(var, "callback")) {
 		ast_copy_string(vmu->callback, value, sizeof(vmu->callback));
 	} else if (!strcasecmp(var, "dialout")) {
@@ -1435,7 +1435,7 @@
 	}
 }
 
-static char *vm_check_password_shell(char *command, char *buf, size_t len) 
+static char *vm_check_password_shell(char *command, char *buf, size_t len)
 {
 	int fds[2], pid = 0;
 
@@ -1473,7 +1473,7 @@
 
 			AST_NONSTANDARD_APP_ARGS(arg, mycmd, ' ');
 
-			execv(arg.v[0], arg.v); 
+			execv(arg.v[0], arg.v);
 			printf("FAILURE: %s", strerror(errno));
 			_exit(0);
 		}
@@ -1519,11 +1519,11 @@
 	return 0;
 }
 
-/*! 
+/*!
  * \brief Performs a change of the voicemail passowrd in the realtime engine.
  * \param vmu The voicemail user to change the password for.
  * \param password The new value to be set to the password for this user.
- * 
+ *
  * This only works if there is a realtime engine configured.
  * This is called from the (top level) vm_change_password.
  *
@@ -1552,7 +1552,7 @@
  * \brief Destructively Parse options and apply.
  */
 static void apply_options(struct ast_vm_user *vmu, const char *options)
-{	
+{
 	char *stringp;
 	char *s;
 	char *var, *value;
@@ -1562,12 +1562,12 @@
 		if ((var = strsep(&value, "=")) && value) {
 			apply_option(vmu, var, value);
 		}
-	}	
+	}
 }
 
 /*!
  * \brief Loads the options specific to a voicemail user.
- * 
+ *
  * This is called when a vm_user structure is being set up, such as from load_options.
  */
 static void apply_options_full(struct ast_vm_user *retval, struct ast_variable *var)
@@ -1633,7 +1633,7 @@
  * \brief Determines if a DTMF key entered is valid.
  * \param key The character to be compared. expects a single character. Though is capable of handling a string, this is internally copies using ast_strdupa.
  *
- * Tests the character entered against the set of valid DTMF characters. 
+ * Tests the character entered against the set of valid DTMF characters.
  * \return 1 if the character entered is a valid DTMF digit, 0 if the character is invalid.
  */
 static int is_valid_dtmf(const char *key)
@@ -1685,12 +1685,12 @@
 		if (var) {
 			apply_options_full(retval, var);
 			ast_variables_destroy(var);
-		} else { 
-			if (!ivm) 
+		} else {
+			if (!ivm)
 				ast_free(retval);
 			retval = NULL;
-		}	
-	} 
+		}
+	}
 	return retval;
 }
 
@@ -1699,7 +1699,7 @@
  * \param ivm
  * \param context
  * \param mailbox
- * 
+ *
  * \return The ast_vm_user structure for the user that was found.
  */
 static struct ast_vm_user *find_user(struct ast_vm_user *ivm, const char *context, const char *mailbox)
@@ -1777,7 +1777,7 @@
 	return cfg && cfg != CONFIG_STATUS_FILEINVALID;
 }
 
-/*! 
+/*!
  * \brief The handler for the change password option.
  * \param vmu The voicemail user to work with.
  * \param newpassword The new password (that has been gathered from the appropriate prompting).
@@ -1905,15 +1905,15 @@
 	}
 }
 
-/*! 
+/*!
  * \brief Creates a file system path expression for a folder within the voicemail data folder and the appropriate context.
  * \param dest The variable to hold the output generated path expression. This buffer should be of size PATH_MAX.
  * \param len The length of the path string that was written out.
  * \param context
- * \param ext 
- * \param folder 
- * 
- * The path is constructed as 
+ * \param ext
+ * \param folder
+ *
+ * The path is constructed as
  * 	VM_SPOOL_DIRcontext/ext/folder
  *
  * \return zero on success, -1 on error.
@@ -1923,14 +1923,14 @@
 	return snprintf(dest, len, "%s%s/%s/%s", VM_SPOOL_DIR, context, ext, folder);
 }
 
-/*! 
+/*!
  * \brief Creates a file system path expression for a folder within the voicemail data folder and the appropriate context.
  * \param dest The variable to hold the output generated path expression. This buffer should be of size PATH_MAX.
  * \param len The length of the path string that was written out.
- * \param dir 
- * \param num 
- * 
- * The path is constructed as 
+ * \param dir
+ * \param num
+ *
+ * The path is constructed as
  * 	VM_SPOOL_DIRcontext/ext/folder
  *
  * \return zero on success, -1 on error.
@@ -1961,7 +1961,7 @@
  * \param len     Length of dest.
  * \param context String. Ignored if is null or empty string.
  * \param ext     String. Ignored if is null or empty string.
- * \param folder  String. Ignored if is null or empty string. 
+ * \param folder  String. Ignored if is null or empty string.
  * \return -1 on failure, 0 on success.
  */
 static int create_dirpath(char *dest, int len, const char *context, const char *ext, const char *folder)
@@ -2193,9 +2193,9 @@
 	}
 
 	/* check if someone is accessing this box right now... */
-	if (!(vms_p = get_vm_state_by_mailbox(vmu->mailbox, vmu->context, 1)) && 
+	if (!(vms_p = get_vm_state_by_mailbox(vmu->mailbox, vmu->context, 1)) &&
 		!(vms_p = get_vm_state_by_mailbox(vmu->mailbox, vmu->context, 0))) {
-		/* Unlike when retrieving a message, it is reasonable not to be able to find a 
+		/* Unlike when retrieving a message, it is reasonable not to be able to find a
 		* vm_state for a mailbox when trying to retrieve a greeting. Just create one,
 		* that's all we need to do.
 		*/
@@ -2347,7 +2347,7 @@
 		res = -1;
 		goto exit;
 	}
-	
+
 	/* Find the format of the attached file */
 
 	strsep(&attachedfilefmt, ".");
@@ -2356,7 +2356,7 @@
 		res = -1;
 		goto exit;
 	}
-	
+
 	save_body(body, vms, "2", attachedfilefmt, 0);
 	if (save_body(body, vms, "3", attachedfilefmt, 1)) {
 		*vms->introfn = '\0';
@@ -2445,7 +2445,7 @@
 	int ret = 0;
 	int fold = folder_int(folder);
 	int urgent = 0;
-	
+
 	/* If URGENT, then look at INBOX */
 	if (fold == 11) {
 		fold = NEW_FOLDER;
@@ -2585,7 +2585,7 @@
  * \brief Gets the number of messages that exist in a mailbox folder.
  * \param mailbox_id
  * \param folder
- * 
+ *
  * This method is used when IMAP backend is used.
  * \return The number of messages in this mailbox folder (zero or more).
  */
@@ -2751,7 +2751,7 @@
  * \param newmsgs The variable that is updated with the count of new messages within this inbox.
  * \param oldmsgs The variable that is updated with the count of old messages within this inbox.
  * \param urgentmsgs The variable that is updated with the count of urgent messages within this inbox.
- * 
+ *
  * This method is used when IMAP backend is used.
  * Simultaneously determines the count of new,old, and urgent messages. The total messages would then be the sum of these three.
  *
@@ -2789,7 +2789,7 @@
 					return -1;
 				else {
 					if (newmsgs)
-						*newmsgs += tmpnew; 
+						*newmsgs += tmpnew;
 					if (oldmsgs)
 						*oldmsgs += tmpold;
 					if (urgentmsgs)
@@ -2833,7 +2833,7 @@
 	return 0;
 }
 
-/** 
+/**
  * \brief Determines if the given folder has messages.
  * \param mailbox The @ delimited string for user at context. If no context is found, uses 'default' for the context.
  * \param folder the folder to look in
@@ -2911,7 +2911,7 @@
 {
 	char tmp[256], *t = tmp;
 	size_t left = sizeof(tmp);
-	
+
 	if (box == OLD_FOLDER) {
 		ast_copy_string(vms->curbox, mbox(NULL, NEW_FOLDER), sizeof(vms->curbox));
 	} else {
@@ -3578,7 +3578,7 @@
 	}
 	AST_LIST_TRAVERSE_SAFE_END
 	AST_LIST_UNLOCK(&vmstates);
-	
+
 	if (vc) {
 		ast_mutex_destroy(&vc->vms->lock);
 		ast_free(vc->vms->msgArray);
@@ -3651,8 +3651,8 @@
 	return 0;
 }
 
-/*! 
- * \brief Get delimiter via mm_list callback 
+/*!
+ * \brief Get delimiter via mm_list callback
  * \param vms		The voicemail state object
  * \param stream
  *
@@ -3665,8 +3665,8 @@
 	mail_list(stream, tmp, "*");
 }
 
-/*! 
- * \brief Check Quota for user 
+/*!
+ * \brief Check Quota for user
  * \param vms a pointer to a vm_state struct, will use the mailstream property of this.
  * \param mailbox the mailbox to check the quota for.
  *
@@ -3772,14 +3772,14 @@
  * \brief Retrieves a file from an ODBC data store.
  * \param dir the path to the file to be retrieved.
  * \param msgnum the message number, such as within a mailbox folder.
- * 
+ *
  * This method is used by the RETRIEVE macro when mailboxes are stored in an ODBC back end.
  * The purpose is to get the message from the database store to the local file system, so that the message may be played, or the information file may be read.
  *
  * The file is looked up by invoking a SQL on the odbc_table (default 'voicemessages') using the dir and msgnum input parameters.
  * The output is the message information file with the name msgnum and the extension .txt
  * and the message file with the extension of its format, in the directory with base file name of the msgnum.
- * 
+ *
  * \return 0 on success, -1 on error.
  */
 static int retrieve_file(char *dir, int msgnum)
@@ -3826,12 +3826,12 @@
 
 		/* Create the information file */
 		snprintf(full_fn, sizeof(full_fn), "%s.txt", fn);
-		
+
 		if (!(f = fopen(full_fn, "w+"))) {
 			ast_log(AST_LOG_WARNING, "Failed to open/create '%s'\n", full_fn);
 			goto yuck;
 		}
-		
+
 		snprintf(full_fn, sizeof(full_fn), "%s.%s", fn, fmt);
 		snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE dir=? AND msgnum=?", odbc_table);
 		stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps);
@@ -3859,19 +3859,19 @@
 			goto yuck;
 		}
 		res = SQLNumResultCols(stmt, &colcount);
-		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {	
+		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 			ast_log(AST_LOG_WARNING, "SQL Column Count error!\n[%s]\n\n", sql);
 			SQLFreeHandle (SQL_HANDLE_STMT, stmt);
 			ast_odbc_release_obj(obj);
 			goto yuck;
 		}
-		if (f) 
+		if (f)
 			fprintf(f, "[message]\n");
 		for (x = 0; x < colcount; x++) {
 			rowdata[0] = '\0';
 			colsize = 0;
 			collen = sizeof(coltitle);
-			res = SQLDescribeCol(stmt, x + 1, (unsigned char *) coltitle, sizeof(coltitle), &collen, 
+			res = SQLDescribeCol(stmt, x + 1, (unsigned char *) coltitle, sizeof(coltitle), &collen,
 						&datatype, &colsize, &decimaldigits, &nullable);
 			if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 				ast_log(AST_LOG_WARNING, "SQL Describe Column error!\n[%s]\n\n", sql);
@@ -3945,7 +3945,7 @@
 
 /*!
  * \brief Determines the highest message number in use for a given user and mailbox folder.
- * \param vmu 
+ * \param vmu
  * \param dir the folder the mailbox folder to look for messages. Used to construct the SQL where clause.
  *
  * This method is used when mailboxes are stored in an ODBC back end.
@@ -4007,7 +4007,7 @@
 
 /*!
  * \brief Determines if the specified message exists.
- * \param dir the folder the mailbox folder to look for messages. 
+ * \param dir the folder the mailbox folder to look for messages.
  * \param msgnum the message index to query for.
  *
  * This method is used when mailboxes are stored in an ODBC back end.
@@ -4122,7 +4122,7 @@
  *
  * This method is used when mailboxes are stored in an ODBC back end.
  * The specified message is directly deleted from the database 'voicemessages' table.
- * 
+ *
  * \return the value greater than zero on success to indicate the number of messages, less than zero on error.
  */
 static void delete_file(const char *sdir, int smsg)
@@ -4148,7 +4148,7 @@
 		ast_odbc_release_obj(obj);
 	} else
 		ast_log(AST_LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
-	return;	
+	return;
 }
 
 /*!
@@ -4188,7 +4188,7 @@
 		ast_odbc_release_obj(obj);
 	} else
 		ast_log(AST_LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
-	return;	
+	return;
 }
 
 struct insert_data {
@@ -4256,7 +4256,7 @@
  * \param msgnum the message index for the message to be stored.
  *
  * This method is used when mailboxes are stored in an ODBC back end.
- * The message sound file and information file is looked up on the file system. 
+ * The message sound file and information file is looked up on the file system.
  * A SQL query is invoked to store the message into the (MySQL) database.
  *
  * \return the zero on success -1 on error.
@@ -4344,12 +4344,12 @@
 			ast_log(AST_LOG_WARNING, "Memory map failed for sound file '%s'!\n", full_fn);
 			res = -1;
 			break;
-		} 
+		}
 		idata.data = fdm;
 		idata.datalen = idata.indlen = fdlen;
 
-		if (!ast_strlen_zero(idata.category)) 
-			snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id,category) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)", odbc_table); 
+		if (!ast_strlen_zero(idata.category))
+			snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id,category) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)", odbc_table);
 		else
 			snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", odbc_table);
 
@@ -4409,7 +4409,7 @@
 		ast_odbc_release_obj(obj);
 	} else
 		ast_log(AST_LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
-	return;	
+	return;
 }
 
 /*!
@@ -4419,7 +4419,7 @@
  *
  * Removes the message content file and the information file.
  * This method is used by the DISPOSE macro when mailboxes are stored in an ODBC back end.
- * Typical use is to clean up after a RETRIEVE operation. 
+ * Typical use is to clean up after a RETRIEVE operation.
  * Note that this does not remove the message from the mailbox folders, to do that we would use delete_file().
  * \return zero on success, -1 on error.
  */
@@ -4428,13 +4428,13 @@
 	char fn[PATH_MAX];
 	char full_fn[PATH_MAX];
 	char msgnums[80];
-	
+
 	if (msgnum > -1) {
 		snprintf(msgnums, sizeof(msgnums), "%d", msgnum);
 		make_file(fn, sizeof(fn), dir, msgnum);
 	} else
 		ast_copy_string(fn, dir, sizeof(fn));
-	ast_filedelete(fn, NULL);	
+	ast_filedelete(fn, NULL);
 	snprintf(full_fn, sizeof(full_fn), "%s.txt", fn);
 	unlink(full_fn);
 	return 0;
@@ -4469,7 +4469,7 @@
 		closedir(vmdir);
 	}
 	ast_unlock_path(dir);
-	
+
 	return vmcount;
 }
 
@@ -4493,9 +4493,9 @@
 	rename(stxt, dtxt);
 }
 
-/*! 
+/*!
  * \brief Determines the highest message number in use for a given user and mailbox folder.
- * \param vmu 
+ * \param vmu
  * \param dir the folder the mailbox folder to look for messages. Used to construct the SQL where clause.
  *
  * This method is used when mailboxes are stored on the filesystem. (not ODBC and not IMAP).
@@ -4607,7 +4607,7 @@
 /*!
  * \brief Copies a voicemail information (envelope) file.
  * \param frompath
- * \param topath 
+ * \param topath
  *
  * Every voicemail has the data (.wav) file, and the information file.
  * This function performs the file system copying of the information file for a voicemail, handling the internal fields and their values.
@@ -4656,7 +4656,7 @@
 }
 #endif
 
-/*! 
+/*!
  * \brief Removes the voicemail sound and information file.
  * \param file The path to the sound file. This will be the the folder and message index, without the extension.
  *
@@ -4802,7 +4802,7 @@
 	}
 
 	fclose(fi);
-	
+
 	if (fputs(ENDL, so) == EOF) {
 		return 0;
 	}
@@ -4869,7 +4869,7 @@
  * \param from The string to work with.
  * \param buf The buffer into which to write the modified quoted string.
  * \param maxlen Always zero, but see \see ast_str
- * 
+ *
  * \return The destination string with quotes wrapped on it (the to field).
  */
 static const char *ast_str_quote(struct ast_str **buf, ssize_t maxlen, const char *from)
@@ -4983,13 +4983,13 @@
  * \param srcemail The email address to send the email to, presumably the email address for the owner of the mailbox.
  * \param vmu The voicemail user who is sending the voicemail.
  * \param msgnum The message index in the mailbox folder.
- * \param context 
+ * \param context
  * \param mailbox The voicemail box to read the voicemail to be notified in this email.
  * \param fromfolder
  * \param cidnum The caller ID number.
  * \param cidname The caller ID name.
  * \param attach the name of the sound file to be attached to the email, if attach_user_voicemail == 1.
- * \param attach2 
+ * \param attach2
  * \param format The message sound file format. i.e. .wav
  * \param duration The time of the message content, in seconds.
  * \param attach_user_voicemail if 1, the sound file is attached to the email.
@@ -5028,7 +5028,7 @@
 	struct ast_tm tm;
 	char enc_cidnum[256] = "", enc_cidname[256] = "";
 	struct ast_str *str1 = ast_str_create(16), *str2 = ast_str_create(16);
-	char *greeting_attachment; 
+	char *greeting_attachment;
 	char filename[256];
 	int first_line;
 	char *emailsbuf;
@@ -5551,9 +5551,9 @@
  * \brief Gets the current date and time, as formatted string.
  * \param s The buffer to hold the output formatted date.
  * \param len the length of the buffer. Used to prevent buffer overflow in ast_strftime.
- * 
+ *
  * The date format string used is "%a %b %e %r UTC %Y".
- * 
+ *
  * \return zero on success, -1 on error.
  */
 static int get_date(char *s, int len)
@@ -5738,7 +5738,7 @@
  * \brief Gets the number of messages that exist in a mailbox folder.
  * \param mailbox_id
  * \param folder
- * 
+ *
  * This method is used when ODBC backend is used.
  * \return The number of messages in this mailbox folder (zero or more).
  */
@@ -5799,10 +5799,10 @@
 	return nummsgs;
 }
 
-/** 
+/**
  * \brief Determines if the given folder has messages.
  * \param mailbox The @ delimited string for user at context. If no context is found, uses 'default' for the context.
- * 
+ *
  * This function is used when the mailbox is stored in an ODBC back end.
  * This invokes the messagecount(). Here we are interested in the presence of messages (> 0) only, not the actual count.
  * \return 1 if the folder has one or more messages. zero otherwise.
@@ -5822,7 +5822,7 @@
 }
 #endif
 #ifndef IMAP_STORAGE
-/*! 
+/*!
  * \brief Copies a message from one mailbox to another.
  * \param chan
  * \param vmu
@@ -5954,7 +5954,7 @@
 	return ret;
 }
 
-/** 
+/**
  * \brief Determines if the given folder has messages.
  * \param mailbox The \@ delimited string for user\@context. If no context is found, uses 'default' for the context.
  * \param folder the folder to look in
@@ -6014,7 +6014,7 @@
 					return -1;
 				else {
 					if (newmsgs)
-						*newmsgs += tmpnew; 
+						*newmsgs += tmpnew;
 					if (oldmsgs)
 						*oldmsgs += tmpold;
 					if (urgentmsgs)
@@ -6026,7 +6026,7 @@
 	}
 
 	ast_copy_string(tmp, mailbox, sizeof(tmp));
-	
+
 	if ((context = strchr(tmp, '@')))
 		*context++ = '\0';
 	else
@@ -6068,7 +6068,7 @@
 		ast_copy_string(ext_context, extension, sizeof(ext_context));
 
 	if (smdi_iface) {
-		if (ast_app_has_voicemail(ext_context, NULL)) 
+		if (ast_app_has_voicemail(ext_context, NULL))
 			ast_smdi_mwi_set(smdi_iface, extension);
 		else
 			ast_smdi_mwi_unset(smdi_iface, extension);
@@ -6415,9 +6415,9 @@
  * \param chan
  * \param ext
  * \param options OPT_BUSY_GREETING, OPT_UNAVAIL_GREETING
- * 
- * 
- * 
+ *
+ *
+ *
  * \return zero on success, -1 on error.
  */
 static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_options *options)
@@ -6505,7 +6505,7 @@
 	else
 		ast_copy_string(ext_context, vmu->mailbox, sizeof(ext_context));
 
-	/* Set the path to the prefile. Will be one of 
+	/* Set the path to the prefile. Will be one of
 		VM_SPOOL_DIRcontext/ext/busy
 		VM_SPOOL_DIRcontext/ext/unavail
 	   Depending on the flag set in options.
@@ -6591,11 +6591,11 @@
 	/* Play the beginning intro if desired */
 	if (!ast_strlen_zero(prefile)) {
 #ifdef ODBC_STORAGE
-		int success = 
+		int success =
 #endif
 			RETRIEVE(prefile, -1, ext, context);
 		if (ast_fileexists(prefile, NULL, NULL) > 0) {
-			if (ast_streamfile(chan, prefile, ast_channel_language(chan)) > -1) 
+			if (ast_streamfile(chan, prefile, ast_channel_language(chan)) > -1)
 				res = ast_waitstream(chan, ecodes);
 #ifdef ODBC_STORAGE
 			if (success == -1) {
@@ -6757,7 +6757,7 @@
 			/* Unless we're *really* silent, try to send the beep */
 			res = ast_stream_and_wait(chan, "beep", "");
 		}
-				
+
 		/* Store information in real-time storage */
 		if (ast_check_realtime("voicemail_data")) {
 			snprintf(priority, sizeof(priority), "%d", ast_channel_priority(chan));
@@ -6791,7 +6791,7 @@
 				S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, NULL),
 				S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL),
 				"Unknown");
-			fprintf(txt, 
+			fprintf(txt,
 				";\n"
 				"; Message Information file\n"
 				";\n"
@@ -6810,7 +6810,7 @@
 				"msg_id=%s\n",
 				ext,
 				ast_channel_context(chan),
-				ast_channel_macrocontext(chan), 
+				ast_channel_macrocontext(chan),
 				ast_channel_exten(chan),
 				S_COR(ast_channel_redirecting(chan)->from.number.valid,
 					ast_channel_redirecting(chan)->from.number.str, "unknown"),
@@ -6865,7 +6865,7 @@
 #endif
 					make_file(fn, sizeof(fn), dir, msgnum);
 
-					/* assign a variable with the name of the voicemail file */ 
+					/* assign a variable with the name of the voicemail file */
 #ifndef IMAP_STORAGE
 					pbx_builtin_setvar_helper(chan, "VM_MESSAGEFILE", fn);
 #else
@@ -6975,7 +6975,7 @@
 #ifdef HAVE_IMAP_TK2006
 		if (LEVELUIDPLUS (vms->mailstream)) {
 			mail_expunge_full(vms->mailstream, NIL, EX_UID);
-		} else 
+		} else
 #endif
 			mail_expunge(vms->mailstream);
 		ast_mutex_unlock(&vms->lock);
@@ -7345,7 +7345,7 @@
 static void adsi_message(struct ast_channel *chan, struct vm_state *vms)
 {
 	int bytes = 0;
-	unsigned char buf[256]; 
+	unsigned char buf[256];
 	char buf1[256], buf2[256];
 	char fn2[PATH_MAX];
 
@@ -7366,7 +7366,7 @@
 	snprintf(fn2, sizeof(fn2), "%s.txt", vms->fn);
 	f = fopen(fn2, "r");
 	if (f) {
-		while (!feof(f)) {	
+		while (!feof(f)) {
 			if (!fgets((char *) buf, sizeof(buf), f)) {
 				continue;
 			}
@@ -7582,7 +7582,7 @@
 	bytes += ast_adsi_voice_mode(buf + bytes, 0);
 
 	ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
-	
+
 }
 
 /*
@@ -7699,9 +7699,9 @@
  * \param start Does not appear to be used at this time.
  *
  * This is used by the main menu option to move a message to a folder or to save a message into a folder.
- * After playing the  message identified by the fn parameter value, it calls get_folder(), which plays the 
+ * After playing the  message identified by the fn parameter value, it calls get_folder(), which plays the
  * prompting for the number inputs that correspond to the available folders.
- * 
+ *
  * \return zero on success, or -1 on error.
  */
 static int get_folder2(struct ast_channel *chan, char *fn, int start)
@@ -7740,7 +7740,7 @@
  * \param record_gain
  * \param duration
  * \param vms
- * \param flag 
+ * \param flag
  *
  * Presents a prompt for 1 to prepend the current message, 2 to forward the message without prepending, or * to return to the main menu.
  *
@@ -7782,7 +7782,7 @@
 		if (cmd)
 			retries = 0;
 		switch (cmd) {
-		case '1': 
+		case '1':
 
 #ifdef IMAP_STORAGE
 			/* Record new intro file */
@@ -7840,7 +7840,7 @@
 			if (record_gain)
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &zero_gain, sizeof(zero_gain), 0);
 
-			
+
 			if ((duration_str = ast_variable_retrieve(msg_cfg, "message", "duration")))
 				*duration = atoi(duration_str);
 
@@ -7859,7 +7859,7 @@
 
 #endif
 			break;
-		case '2': 
+		case '2':
 			/* NULL out introfile so we know there is no intro! */
 #ifdef IMAP_STORAGE
 			*vms->introfn = '\0';
@@ -7869,7 +7869,7 @@
 		case '*':
 			cmd = '*';
 			break;
-		default: 
+		default:
 			/* If time_out and return to menu, reset already_recorded */
 			already_recorded = 0;
 
@@ -8004,7 +8004,7 @@
 		DELETE(todir, msgnum, fn, vmu);
 
 	/* Leave voicemail for someone */
-	if (ast_app_has_voicemail(ext_context, NULL)) 
+	if (ast_app_has_voicemail(ext_context, NULL))
 		ast_app_inboxcount2(ext_context, &urgentmsgs, &newmsgs, &oldmsgs);
 
 	queue_mwi_event(ast_channel_uniqueid(chan), ext_context, urgentmsgs, newmsgs, oldmsgs);
@@ -8028,14 +8028,14 @@
  * \param vms
  * \param sender
  * \param fmt
- * \param is_new_message Used to indicate the mode for which this method was invoked. 
+ * \param is_new_message Used to indicate the mode for which this method was invoked.
  *             Will be 0 when called to forward an existing message (option 8)
  *             Will be 1 when called to leave a message (option 3->5)
- * \param record_gain 
+ * \param record_gain
  * \param urgent
  *
  * Reads the destination mailbox(es) from keypad input for CID, or if use_directory feature is enabled, the Directory.
- * 
+ *
  * When in the leave message mode (is_new_message == 1):
  *   - allow the leaving of a message for ourselves. (Will not allow us to forward a message to ourselves, when is_new_message == 0).
  *   - attempt to determine the context and and mailbox, and then invoke leave_message() function to record and store the message.
@@ -8090,19 +8090,19 @@
 				if (cmd)
 					retries = 0;
 				switch (cmd) {
-				case '1': 
+				case '1':
 					use_directory = 0;
 					done = 1;
 					break;
-				case '2': 
+				case '2':
 					use_directory = 1;
 					done = 1;
 					break;
-				case '*': 
+				case '*':
 					cmd = 't';
 					done = 1;
 					break;
-				default: 
+				default:
 					/* Press 1 to enter an extension press 2 to use the directory */
 					cmd = ast_play_and_wait(chan, "vm-forward");
 					if (!cmd) {
@@ -8272,7 +8272,7 @@
 #ifdef IMAP_STORAGE
 				int attach_user_voicemail;
 				char *myserveremail = serveremail;
-				
+
 				/* get destination mailbox */
 				dstvms = get_vm_state_by_mailbox(vmtmp->mailbox, vmtmp->context, 0);
 				if (!dstvms) {
@@ -8284,7 +8284,7 @@
 						ast_log(AST_LOG_ERROR, "IMAP mailstream for %s is NULL\n", vmtmp->mailbox);
 					} else {
 						copy_msg_result = STORE(vmstmp.curdir, vmtmp->mailbox, vmtmp->context, dstvms->curmsg, chan, vmtmp, fmt, duration, dstvms, urgent_str, msg_id);
-						run_externnotify(vmtmp->context, vmtmp->mailbox, urgent_str); 
+						run_externnotify(vmtmp->context, vmtmp->mailbox, urgent_str);
 					}
 				} else {
 					ast_log(AST_LOG_ERROR, "Could not find state information for mailbox %s\n", vmtmp->mailbox);
@@ -8368,12 +8368,12 @@
 static int wait_file2(struct ast_channel *chan, struct vm_state *vms, char *file)
 {
 	int res;
-	if ((res = ast_stream_and_wait(chan, file, AST_DIGIT_ANY)) < 0) 
-		ast_log(AST_LOG_WARNING, "Unable to play message %s\n", file); 
+	if ((res = ast_stream_and_wait(chan, file, AST_DIGIT_ANY)) < 0)
+		ast_log(AST_LOG_WARNING, "Unable to play message %s\n", file);
 	return res;
 }
 
-static int wait_file(struct ast_channel *chan, struct vm_state *vms, char *file) 
+static int wait_file(struct ast_channel *chan, struct vm_state *vms, char *file)
 {
 	ast_test_suite_event_notify("PLAYVOICE", "Message: Playing %s", file);
 	return ast_control_streamfile(chan, file, listen_control_forward_key, listen_control_reverse_key, listen_control_stop_key, listen_control_pause_key, listen_control_restart_key, skipms, NULL);
@@ -8764,13 +8764,13 @@
 	char fn[PATH_MAX];
 	char full_fn[PATH_MAX];
 	char intro[PATH_MAX] = {0,};
-	
+
 	if (msgnum > -1) {
 		make_file(fn, sizeof(fn), dir, msgnum);
 		snprintf(intro, sizeof(intro), "%sintro", fn);
 	} else
 		ast_copy_string(fn, dir, sizeof(fn));
-	
+
 	if ((msgnum < 0 && imapgreetings) || msgnum > -1) {
 		ast_filedelete(fn, NULL);
 		if (!ast_strlen_zero(intro)) {
@@ -9097,7 +9097,7 @@
 
 	if (vms->newmessages) {
 		res = ast_play_and_wait(chan, "vm-youhave");
-		if (!res) 
+		if (!res)
 			res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, ast_channel_language(chan), NULL);
 		if (!res) {
 			if (vms->newmessages == 1) {
@@ -9123,20 +9123,20 @@
 			if (!res)
 				res = ast_play_and_wait(chan, "vm-messages");
 		}
-	} else if (!vms->oldmessages && !vms->newmessages) 
-		res = ast_play_and_wait(chan, "vm-denExeteMynhmata"); 
+	} else if (!vms->oldmessages && !vms->newmessages)
+		res = ast_play_and_wait(chan, "vm-denExeteMynhmata");
 	return res;
 }
 
 /* Version of vm_intro() designed to work for many languages.
  *
- * It is hoped that this function can prevent the proliferation of 
+ * It is hoped that this function can prevent the proliferation of
  * language-specific vm_intro() functions and in time replace the language-
  * specific functions which already exist.  An examination of the language-
  * specific functions revealed that they all corrected the same deficiencies
  * in vm_intro_en() (which was the default function). Namely:
  *
- *  1) The vm-Old and vm-INBOX sound files were overloaded.  The English 
+ *  1) The vm-Old and vm-INBOX sound files were overloaded.  The English
  *     wording of the voicemail greeting hides this problem.  For example,
  *     vm-INBOX contains only the word "new".  This means that both of these
  *     sequences produce valid utterances:
@@ -9162,7 +9162,7 @@
  *  3) Call ast_say_counted_adjective() to put the proper gender and number
  *     prefix on vm-new and vm-old (none for English).
  *  4) Pass the gender of the language's word for "message" as an agument to
- *     this function which is can in turn pass on to the functions which 
+ *     this function which is can in turn pass on to the functions which
  *     say numbers and put endings on nounds and adjectives.
  *
  * All languages require these messages:
@@ -9274,7 +9274,7 @@
 					if (vms->oldmessages == 2) {
 						res = ast_play_and_wait(chan, "vm-shtei");
 					} else {
-						res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, ast_channel_language(chan), "f");            
+						res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, ast_channel_language(chan), "f");
 					}
 					res = ast_play_and_wait(chan, "vm-Old");
 				}
@@ -9329,7 +9329,7 @@
       }
       return res;
 } /* Japanese */
-	
+
 /* Default English syntax */
 static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms)
 {
@@ -9363,7 +9363,7 @@
 				else
 					res = ast_play_and_wait(chan, "vm-messages");
 			}
-				
+
 		}
 		if (!res && vms->oldmessages) {
 			res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
@@ -9603,7 +9603,7 @@
 				else
 					res = ast_play_and_wait(chan, "vm-messages");
 			}
-				
+
 		}
 		if (!res && vms->oldmessages) {
 			if (vms->oldmessages == 1)
@@ -9747,7 +9747,7 @@
 				else
 					res = ast_play_and_wait(chan, "vm-messages");
 			}
-				
+
 		}
 		if (!res && vms->oldmessages) {
 			res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
@@ -9794,7 +9794,7 @@
 				else
 					res = ast_play_and_wait(chan, "vm-messages");
 			}
-				
+
 		}
 		if (!res && vms->oldmessages) {
 			res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
@@ -9875,14 +9875,14 @@
 /* in czech there must be declension of word new and message
  * czech        : english        : czech      : english
  * --------------------------------------------------------
- * vm-youhave   : you have 
+ * vm-youhave   : you have
  * vm-novou     : one new        : vm-zpravu  : message
  * vm-nove      : 2-4 new        : vm-zpravy  : messages
  * vm-novych    : 5-infinite new : vm-zprav   : messages
  * vm-starou	: one old
- * vm-stare     : 2-4 old 
+ * vm-stare     : 2-4 old
  * vm-starych   : 5-infinite old
- * jednu        : one	- falling 4. 
+ * jednu        : one	- falling 4.
  * vm-no        : no  ( no messages )
  */
 
@@ -9963,7 +9963,7 @@
 			res = ast_play_and_wait(chan, "vm-INBOX");
 		if (vms->oldmessages && !res)
 			res = ast_play_and_wait(chan, "vm-and");
-		else if (!res) 
+		else if (!res)
 			res = ast_play_and_wait(chan, "vm-messages");
 	}
 	if (!res && vms->oldmessages) {
@@ -10003,7 +10003,7 @@
 		if (!res && vms->oldmessages) {
 			res = say_and_wait(chan, vms->oldmessages, ast_channel_language(chan));
 			if (!res)
-				res = ast_play_and_wait(chan, "vm-Old");			
+				res = ast_play_and_wait(chan, "vm-Old");
 		}
 		if (!res) {
 			if (!vms->oldmessages && !vms->newmessages) {
@@ -10019,7 +10019,7 @@
 static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms)
 {
 	char prefile[256];
-	
+
 	/* Notify the user that the temp greeting is set and give them the option to remove it */
 	snprintf(prefile, sizeof(prefile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, vms->username);
 	if (ast_test_flag(vmu, VM_TEMPGREETWARN)) {
@@ -10526,7 +10526,7 @@
 }
 
 /*!
- * \brief The handler for 'record a temporary greeting'. 
+ * \brief The handler for 'record a temporary greeting'.
  * \param chan
  * \param vmu
  * \param vms
@@ -10570,7 +10570,7 @@
 			if (cmd == -1) {
 				break;
 			}
-			cmd = 't';	
+			cmd = 't';
 		} else {
 			switch (cmd) {
 			case '1':
@@ -10579,9 +10579,9 @@
 			case '2':
 				DELETE(prefile, -1, prefile, vmu);
 				ast_play_and_wait(chan, "vm-tempremoved");
-				cmd = 't';	
+				cmd = 't';
 				break;
-			case '*': 
+			case '*':
 				cmd = 't';
 				break;
 			default:
@@ -10614,7 +10614,7 @@
  * \param vmu
  *
  * \return zero on success, -1 on error.
- */	
+ */
 static int vm_browse_messages_gr(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu)
 {
 	int cmd = 0;
@@ -10638,7 +10638,7 @@
 				cmd = ast_play_and_wait(chan, vms->fn);
 			}
 		}
-	} 
+	}
 	return cmd;
 }
 
@@ -10659,7 +10659,7 @@
 	return cmd;
 }
 
-/*! 
+/*!
  * \brief Default English syntax for 'You have N messages' greeting.
  * \param chan
  * \param vms
@@ -10675,7 +10675,7 @@
 		cmd = play_message(chan, vmu, vms);
 	} else {
 		cmd = ast_play_and_wait(chan, "vm-youhave");
-		if (!cmd) 
+		if (!cmd)
 			cmd = ast_play_and_wait(chan, "vm-no");
 		if (!cmd) {
 			snprintf(vms->fn, sizeof(vms->fn), "vm-%s", vms->curbox);
@@ -10687,7 +10687,7 @@
 	return cmd;
 }
 
-/*! 
+/*!
  *\brief Italian syntax for 'You have N messages' greeting.
  * \param chan
  * \param vms
@@ -10740,7 +10740,7 @@
         return cmd;
 }
 
-/*! 
+/*!
  * \brief Spanish syntax for 'You have N messages' greeting.
  * \param chan
  * \param vms
@@ -10766,7 +10766,7 @@
 	return cmd;
 }
 
-/*! 
+/*!
  * \brief Portuguese syntax for 'You have N messages' greeting.
  * \param chan
  * \param vms
@@ -10792,7 +10792,7 @@
 	return cmd;
 }
 
-/*! 
+/*!
  * \brief Chinese (Taiwan)syntax for 'You have N messages' greeting.
  * \param chan
  * \param vms
@@ -10808,7 +10808,7 @@
 		cmd = play_message(chan, vmu, vms);
 	} else {
 		cmd = ast_play_and_wait(chan, "vm-you");
-		if (!cmd) 
+		if (!cmd)
 			cmd = ast_play_and_wait(chan, "vm-haveno");
 		if (!cmd)
 			cmd = ast_play_and_wait(chan, "vm-messages");
@@ -10820,7 +10820,7 @@
 	return cmd;
 }
 
-/*! 
+/*!
  * \brief Vietnamese syntax for 'You have N messages' greeting.
  * \param chan
  * \param vms
@@ -10849,7 +10849,7 @@
  * \param chan The channel for the current user. We read the language property from this.
  * \param vms passed into the language-specific vm_browse_messages function.
  * \param vmu passed into the language-specific vm_browse_messages function.
- * 
+ *
  * The method to be invoked is determined by the value of language code property in the user's channel.
  * The default (when unable to match) is to use english.
  *
@@ -10907,7 +10907,7 @@
 			if (ast_channel_caller(chan)->id.number.valid && ast_channel_caller(chan)->id.number.str) {
 				ast_copy_string(mailbox, ast_channel_caller(chan)->id.number.str, mailbox_size);
 			} else {
-				ast_verb(3, "Username not entered\n");	
+				ast_verb(3, "Username not entered\n");
 				return -1;
 			}
 		} else if (mailbox[0] == '*') {
@@ -11236,7 +11236,7 @@
 					ast_set_flag(&flags, OPT_SILENT);
 				else if (*(args.argv0) == 'p')
 					ast_set_flag(&flags, OPT_PREPEND_MAILBOX);
-				else 
+				else
 					break;
 				(args.argv0)++;
 			}
@@ -11373,7 +11373,7 @@
 	res = 0;
 
 	/* Check to see if this is a new user */
-	if (!strcasecmp(vmu->mailbox, vmu->password) && 
+	if (!strcasecmp(vmu->mailbox, vmu->password) &&
 		(ast_test_flag(vmu, VM_FORCENAME | VM_FORCEGREET))) {
 		if (ast_play_and_wait(chan, "vm-newuser") == -1)
 			ast_log(AST_LOG_WARNING, "Couldn't stream new user file\n");
@@ -11765,7 +11765,7 @@
 			snprintf(vms.fn, sizeof(vms.fn), "vm-%s", mbox(vmu, box));
 			if (!cmd) {
 				cmd = ast_play_and_wait(chan, "vm-message");
-				if (!cmd) 
+				if (!cmd)
 					cmd = say_and_wait(chan, vms.curmsg + 1, ast_channel_language(chan));
 				if (!cmd)
 					cmd = ast_play_and_wait(chan, "vm-savedto");
@@ -11863,7 +11863,7 @@
 		if (valid && res != OPERATOR_EXIT) {
 			if (silentexit)
 				res = ast_play_and_wait(chan, "vm-dialout");
-			else 
+			else
 				res = ast_play_and_wait(chan, "vm-goodbye");
 		}
 		if ((valid && res > 0) || res == OPERATOR_EXIT) {
@@ -11921,7 +11921,7 @@
 		AST_APP_ARG(argv0);
 		AST_APP_ARG(argv1);
 	);
-	
+
 	memset(&leave_options, 0, sizeof(leave_options));
 
 	if (ast_channel_state(chan) != AST_STATE_UP)
@@ -12035,15 +12035,15 @@
 			return NULL;
 		}
 	}
-	
+
 	if (!(vmu = ast_calloc(1, sizeof(*vmu))))
 		return NULL;
-	
+
 	ast_copy_string(vmu->context, context, sizeof(vmu->context));
 	ast_copy_string(vmu->mailbox, box, sizeof(vmu->mailbox));
 
 	AST_LIST_INSERT_TAIL(&users, vmu, list);
-	
+
 	return vmu;
 }
 
@@ -12292,7 +12292,7 @@
 	return res ? AST_TEST_FAIL : AST_TEST_PASS;
 }
 
-static int vm_box_exists(struct ast_channel *chan, const char *data) 
+static int vm_box_exists(struct ast_channel *chan, const char *data)
 {
 	struct ast_vm_user svm;
 	char *context, *box;
@@ -12450,7 +12450,7 @@
 	char *options = NULL;
 	int silent = 0, skipuser = 0;
 	int res = -1;
-	
+
 	if (data) {
 		s = ast_strdupa(data);
 		user = strsep(&s, ",");
@@ -12489,7 +12489,7 @@
 	struct ast_config *cfg;
 	const char *cat = NULL;
 
-	if (!(cfg = ast_load_realtime_multientry("voicemail", 
+	if (!(cfg = ast_load_realtime_multientry("voicemail",
 		"context", context, SENTINEL))) {
 		return CLI_FAILURE;
 	}
@@ -12564,7 +12564,7 @@
 		return NULL;
 	case CLI_GENERATE:
 		return complete_voicemail_show_users(a->line, a->word, a->pos, a->n);
-	}	
+	}
 
 	if ((a->argc < 3) || (a->argc > 5) || (a->argc == 4))
 		return CLI_SHOWUSAGE;
@@ -12676,9 +12676,9 @@
 	if (a->argc != 2)
 		return CLI_SHOWUSAGE;
 
-	ast_cli(a->fd, "Reloading voicemail configuration...\n");	
+	ast_cli(a->fd, "Reloading voicemail configuration...\n");
 	load_config(1);
-	
+
 	return CLI_SUCCESS;
 }
 
@@ -13094,9 +13094,9 @@
 		AST_LIST_UNLOCK(&users);
 		return RESULT_SUCCESS;
 	}
-	
+
 	astman_send_listack(s, m, "Voicemail user list will follow", "start");
-	
+
 	AST_LIST_TRAVERSE(&users, vmu, list) {
 		char dirname[256];
 #ifdef IMAP_STORAGE
@@ -13104,7 +13104,7 @@
 
 		inboxcount(vmu->mailbox, &new, &old);
 #endif
-		
+
 		make_dir(dirname, sizeof(dirname), vmu->context, vmu->mailbox, "INBOX");
 		astman_append(s,
 			"Event: VoicemailUserEntry\r\n"
@@ -13178,7 +13178,7 @@
 #endif
 			);
 		++num_users;
-	}		
+	}
 
 	astman_send_list_complete_start(s, m, "VoicemailUserEntryComplete", num_users);
 	astman_send_list_complete_end(s);
@@ -13189,7 +13189,7 @@
 }
 
 /*! \brief Free the users structure. */
-static void free_vm_users(void) 
+static void free_vm_users(void)
 {
 	struct ast_vm_user *current;
 	AST_LIST_LOCK(&users);
@@ -13218,7 +13218,7 @@
 	struct ast_str *str = ast_str_thread_get(&ast_str_thread_global_buf, strlen(value) + 16);
 
 	ast_str_reset(str);
-	
+
 	/* Substitute strings \r, \n, and \t into the appropriate characters */
 	for (current = (char *) value; *current; current++) {
 		if (*current == '\\') {
@@ -13328,13 +13328,13 @@
 	strcpy(listen_control_restart_key, DEFAULT_LISTEN_CONTROL_RESTART_KEY);
 	strcpy(listen_control_stop_key, DEFAULT_LISTEN_CONTROL_STOP_KEY);
 
-	/* Free all the users structure */	
+	/* Free all the users structure */
 	free_vm_users();
 
 	/* Free all the zones structure */
 	free_vm_zones();
 
-	AST_LIST_LOCK(&users);	
+	AST_LIST_LOCK(&users);
 
 	memset(ext_pass_cmd, 0, sizeof(ext_pass_cmd));
 	memset(ext_pass_check_cmd, 0, sizeof(ext_pass_check_cmd));
@@ -13346,9 +13346,9 @@
 			val = "default";
 		ast_copy_string(userscontext, val, sizeof(userscontext));
 		/* Attach voice message to mail message ? */
-		if (!(val = ast_variable_retrieve(cfg, "general", "attach"))) 
+		if (!(val = ast_variable_retrieve(cfg, "general", "attach")))
 			val = "yes";
-		ast_set2_flag((&globalflags), ast_true(val), VM_ATTACH);	
+		ast_set2_flag((&globalflags), ast_true(val), VM_ATTACH);
 
 		if (!(val = ast_variable_retrieve(cfg, "general", "searchcontexts")))
 			val = "no";
@@ -13367,7 +13367,7 @@
 		if ((val = ast_variable_retrieve(cfg, "general", "odbctable"))) {
 			ast_copy_string(odbc_table, val, sizeof(odbc_table));
 		}
-#endif		
+#endif
 		/* Mail command */
 		strcpy(mailcmd, SENDMAIL);
 		if ((val = ast_variable_retrieve(cfg, "general", "mailcmd")))
@@ -13379,7 +13379,7 @@
 			if (maxsilence > 0)
 				maxsilence *= 1000;
 		}
-		
+
 		if (!(val = ast_variable_retrieve(cfg, "general", "maxmsg"))) {
 			maxmsg = MAXMSG;
 		} else {
@@ -13495,7 +13495,7 @@
 		}
 
 		/* There is some very unorthodox casting done here. This is due
-		 * to the way c-client handles the argument passed in. It expects a 
+		 * to the way c-client handles the argument passed in. It expects a
 		 * void pointer and casts the pointer directly to a long without
 		 * first dereferencing it. */
 		if ((val = ast_variable_retrieve(cfg, "general", "imapreadtimeout"))) {
@@ -13604,7 +13604,7 @@
 
 		val = ast_variable_retrieve(cfg, "general", "format");
 		if (!val) {
-			val = "wav";	
+			val = "wav";
 		} else {
 			tmp = ast_strdupa(val);
 			val = ast_format_str_reduce(tmp);
@@ -13804,9 +13804,9 @@
 		if ((val = ast_variable_retrieve(cfg, "general", "listen-control-stop-key")) && is_valid_dtmf(val))
 			ast_copy_string(listen_control_stop_key, val, sizeof(listen_control_stop_key));
 
-		if (!(val = ast_variable_retrieve(cfg, "general", "usedirectory"))) 
+		if (!(val = ast_variable_retrieve(cfg, "general", "usedirectory")))
 			val = "no";
-		ast_set2_flag((&globalflags), ast_true(val), VM_DIRECFORWARD);	
+		ast_set2_flag((&globalflags), ast_true(val), VM_DIRECFORWARD);
 
 		if (!(val = ast_variable_retrieve(cfg, "general", "passwordlocation"))) {
 			val = "voicemail.conf";
@@ -13893,7 +13893,7 @@
 		}
 
 		/* load mailboxes from users.conf */
-		if (ucfg) {	
+		if (ucfg) {
 			for (cat = ast_category_browse(ucfg, NULL); cat ; cat = ast_category_browse(ucfg, cat)) {
 				if (!strcasecmp(cat, "general")) {
 					continue;
@@ -14287,7 +14287,7 @@
 
 		/* hasvm-old, hasvm-urgent, hasvm-new, ic-old, ic-urgent, ic-new, ic2-old, ic2-urgent, ic2-new, mc-old, mc-urgent, mc-new */
 		for (j = 0; j < 3; j++) {
-			/* folder[2] is INBOX, __has_voicemail will default back to INBOX */ 
+			/* folder[2] is INBOX, __has_voicemail will default back to INBOX */
 			if (ast_app_has_voicemail(testspec, (j==2 ? NULL : folders[j])) != expected_results[i][0 + j]) {
 				ast_test_status_update(test, "has_voicemail(%s, %s) returned %d and we expected %d\n",
 					testspec, folders[j], ast_app_has_voicemail(testspec, folders[j]), expected_results[i][0 + j]);
@@ -14703,8 +14703,8 @@
  * Module loading including tests for configuration or dependencies.
  * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE,
  * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails
- * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the 
- * configuration file or other non-critical problem return 
+ * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the
+ * configuration file or other non-critical problem return
  * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
  */
 static int load_module(void)
@@ -14719,7 +14719,7 @@
 
 	/* compute the location of the voicemail spool directory */
 	snprintf(VM_SPOOL_DIR, sizeof(VM_SPOOL_DIR), "%s/voicemail/", ast_config_AST_SPOOL_DIR);
-	
+
 	if (!(mwi_subscription_tps = ast_taskprocessor_get("app_voicemail", 0))) {
 		ast_log(AST_LOG_WARNING, "failed to reference mwi subscription taskprocessor.  MWI will not work\n");
 	}
@@ -14765,7 +14765,7 @@
 	return res;
 }
 
-static int dialout(struct ast_channel *chan, struct ast_vm_user *vmu, char *num, char *outgoing_context) 
+static int dialout(struct ast_channel *chan, struct ast_vm_user *vmu, char *num, char *outgoing_context)
 {
 	int cmd = 0;
 	char destination[80] = "";
@@ -14795,7 +14795,7 @@
 					ast_verb(3, "User hit '*' to cancel outgoing call\n");
 					return 0;
 				}
-				if ((cmd = ast_readstring(chan, destination + strlen(destination), sizeof(destination) - 1, 6000, 10000, "#")) < 0) 
+				if ((cmd = ast_readstring(chan, destination + strlen(destination), sizeof(destination) - 1, 6000, 10000, "#")) < 0)
 					retries++;
 				else
 					cmd = 't';
@@ -14805,7 +14805,7 @@
 		if (retries >= 3) {
 			return 0;
 		}
-		
+
 	} else {
 		ast_verb(3, "Destination number is CID number '%s'\n", num);
 		ast_copy_string(destination, num, sizeof(destination));
@@ -14813,7 +14813,7 @@
 
 	if (!ast_strlen_zero(destination)) {
 		if (destination[strlen(destination) -1 ] == '*')
-			return 0; 
+			return 0;
 		ast_verb(3, "Placing outgoing call to extension '%s' in context '%s' from context '%s'\n", destination, outgoing_context, ast_channel_context(chan));
 		ast_channel_exten_set(chan, destination);
 		ast_channel_context_set(chan, outgoing_context);
@@ -14826,13 +14826,13 @@
 /*!
  * \brief The advanced options within a message.
  * \param chan
- * \param vmu 
+ * \param vmu
  * \param vms
  * \param msg
  * \param option
  * \param record_gain
  *
- * Provides handling for the play message envelope, call the person back, or reply to message. 
+ * Provides handling for the play message envelope, call the person back, or reply to message.
  *
  * \return zero on success, -1 on error.
  */
@@ -14847,7 +14847,7 @@
 	char *cid;
 	struct ast_flags config_flags = { CONFIG_FLAG_NOCACHE, };
 
-	vms->starting = 0; 
+	vms->starting = 0;
 
 	make_file(vms->fn, sizeof(vms->fn), vms->curdir, msg);
 
@@ -14966,8 +14966,8 @@
 					}
 				}
 				ast_test_suite_event_notify("USERPRESS", "Message: User pressed %c\r\nDTMF: %c", res, res);
-				break; 
-				
+				break;
+
 			}
 			if (res == 't')
 				res = 0;
@@ -14975,7 +14975,7 @@
 				res = -1;
 		}
 		break;
-		
+
 	case 1:	/* Reply */
 		/* Send reply directly to sender */
 		if (ast_strlen_zero(cid))
@@ -14996,7 +14996,7 @@
 				snprintf(mailbox, sizeof(mailbox), "%s@%s", num, vmu->context);
 
 				ast_verb(3, "Leaving voicemail for '%s' in context '%s'\n", num, vmu->context);
-				
+
 				memset(&leave_options, 0, sizeof(leave_options));
 				leave_options.record_gain = record_gain;
 				res = leave_voicemail(chan, mailbox, &leave_options);
@@ -15012,7 +15012,7 @@
 				ast_config_destroy(msg_cfg);
 				return res;
 			}
-		} 
+		}
 		res = 0;
 
 		break;
@@ -15072,7 +15072,7 @@
 			} else {
 				/* Otherwise 1 is to save the existing message */
 				ast_verb(3, "Saving message as is\n");
-				if (!outsidecaller) 
+				if (!outsidecaller)
 					ast_filerename(tempfile, recordfile, NULL);
 				ast_stream_and_wait(chan, "vm-msgsaved", "");
 				if (!outsidecaller) {
@@ -15091,11 +15091,11 @@
 		case '3':
 			msg_exists = 0;
 			/* Record */
-			if (recorded == 1) 
+			if (recorded == 1)
 				ast_verb(3, "Re-recording the message\n");
-			else	
+			else
 				ast_verb(3, "Recording the message\n");
-			
+
 			if (recorded && outsidecaller) {
 				cmd = ast_play_and_wait(chan, INTRO);
 				cmd = ast_play_and_wait(chan, "beep");
@@ -15118,7 +15118,7 @@
 				if (!outsidecaller) {
 					/* user was recording a greeting and they hung up, so let's delete the recording. */
 					ast_filedelete(tempfile, NULL);
-				}		
+				}
 				return cmd;
 			}
 			if (cmd == '0') {
@@ -15175,7 +15175,7 @@
 		case '#':
 			cmd = ast_play_and_wait(chan, "vm-sorry");
 			break;
-#if 0 
+#if 0
 /*  XXX Commented out for the moment because of the dangers of deleting
     a message while recording (can put the message numbers out of sync) */
 		case '*':
@@ -15237,7 +15237,7 @@
 				if (!cmd)
 					cmd = ast_waitfordigit(chan, 600);
 			}
-			
+
 			if (!cmd && outsidecaller && ast_test_flag(vmu, VM_OPERATOR)) {
 				cmd = ast_play_and_wait(chan, "vm-reachoper");
 				if (!cmd)
diff --git a/apps/app_waitforring.c b/apps/app_waitforring.c
index c4e14ad..5af44f6 100644
--- a/apps/app_waitforring.c
+++ b/apps/app_waitforring.c
@@ -21,7 +21,7 @@
  * \brief Wait for Ring Application
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
diff --git a/apps/app_waitforsilence.c b/apps/app_waitforsilence.c
index b63b0c8..2e6108b 100644
--- a/apps/app_waitforsilence.c
+++ b/apps/app_waitforsilence.c
@@ -164,7 +164,7 @@
 			pbx_builtin_setvar_helper(chan, "WAITSTATUS", "HANGUP");
 			break;
 		}
-		
+
 		/* We waited and got no frame; sounds like digital silence or a muted digital channel */
 		if (res == 0) {
 			dsptime = timereqd;
diff --git a/apps/app_while.c b/apps/app_while.c
index 273b466..793f191 100644
--- a/apps/app_while.c
+++ b/apps/app_while.c
@@ -21,7 +21,7 @@
  * \brief While Loop Implementation
  *
  * \author Anthony Minessale <anthmct at yahoo.com>
- * 
+ *
  * \ingroup applications
  */
 
@@ -225,13 +225,13 @@
 	for (x=0;;x++) {
 		if (get_index(chan, prefix, x)) {
 			used_index_i = x;
-		} else 
+		} else
 			break;
 	}
-	
+
 	snprintf(used_index, VAR_SIZE, "%d", used_index_i);
 	snprintf(new_index, VAR_SIZE, "%d", used_index_i + 1);
-	
+
 	if (!end)
 		condition = ast_strdupa(data);
 
@@ -239,7 +239,7 @@
 	my_name = ast_alloca(size);
 	memset(my_name, 0, size);
 	snprintf(my_name, size, "%s_%s_%d", ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan));
-	
+
 	ast_channel_lock(chan);
 	if (end) {
 		label = used_index;
@@ -253,7 +253,7 @@
 		snprintf(end_varname,VAR_SIZE,"END_%s",varname);
 	}
 	ast_channel_unlock(chan);
-	
+
 
 	if ((!end && !pbx_checkcondition(condition)) || (end == 2)) {
 		/* Condition Met (clean up helper vars) */
@@ -338,7 +338,7 @@
 static int unload_module(void)
 {
 	int res;
-	
+
 	res = ast_unregister_application(start_app);
 	res |= ast_unregister_application(stop_app);
 	res |= ast_unregister_application(exit_app);
diff --git a/apps/app_zapateller.c b/apps/app_zapateller.c
index 27bcf63..f575ab9 100644
--- a/apps/app_zapateller.c
+++ b/apps/app_zapateller.c
@@ -21,14 +21,14 @@
  * \brief Playback the special information tone to get rid of telemarketers
  *
  * \author Mark Spencer <markster at digium.com>
- * 
+ *
  * \ingroup applications
  */
 
 /*** MODULEINFO
 	<support_level>extended</support_level>
  ***/
- 
+
 #include "asterisk.h"
 
 ASTERISK_REGISTER_FILE()
@@ -114,15 +114,15 @@
 		return res;
 	}
 
-	if (!res) 
+	if (!res)
 		res = ast_tonepair(chan, 950, 0, 330, 0);
-	if (!res) 
+	if (!res)
 		res = ast_tonepair(chan, 1400, 0, 330, 0);
-	if (!res) 
+	if (!res)
 		res = ast_tonepair(chan, 1800, 0, 330, 0);
-	if (!res) 
+	if (!res)
 		res = ast_tonepair(chan, 0, 0, 1000, 0);
-	
+
 	pbx_builtin_setvar_helper(chan, "ZAPATELLERSTATUS", "ZAPPED");
 	return res;
 }
diff --git a/cdr/cdr_radius.c b/cdr/cdr_radius.c
index e1a639c..2d544dd 100644
--- a/cdr/cdr_radius.c
+++ b/cdr/cdr_radius.c
@@ -200,7 +200,7 @@
 	}
 
 	/* Setting Acct-Session-Id & User-Name attributes for proper generation
-	 * of Acct-Unique-Session-Id on server side 
+	 * of Acct-Unique-Session-Id on server side
 	 */
 	/* Channel */
 	if (!rc_avpair_add(rh, tosend, PW_USER_NAME, &cdr->channel, strlen(cdr->channel), 0))
diff --git a/cel/cel_odbc.c b/cel/cel_odbc.c
index 2d8408b..c9d3b74 100644
--- a/cel/cel_odbc.c
+++ b/cel/cel_odbc.c
@@ -799,7 +799,7 @@
 	free_config();
 	AST_RWLIST_UNLOCK(&odbc_tables);
 	AST_RWLIST_HEAD_DESTROY(&odbc_tables);
-        
+
 	return 0;
 }
 

-- 
To view, visit https://gerrit.asterisk.org/571
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7cf800f66e1b83903af75f432da420c16c115d6
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Rodrigo Ramirez Norambuena <decipher.hk at gmail.com>



More information about the asterisk-code-review mailing list