[asterisk-commits] seanbright: branch seanbright/resolve-shadow-warnings r114669 - in /team/sean...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 25 15:43:16 CDT 2008


Author: seanbright
Date: Fri Apr 25 15:43:15 2008
New Revision: 114669

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114669
Log:
Merged revisions 114650-114651,114655-114656,114660,114663,114665,114667 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r114650 | tilghman | 2008-04-25 11:58:36 -0400 (Fri, 25 Apr 2008) | 13 lines

Blocked revisions 114649 via svnmerge

........
r114649 | tilghman | 2008-04-25 10:53:52 -0500 (Fri, 25 Apr 2008) | 6 lines

Reference documentation files that actually exist.
(closes issue #12516)
 Reported by: linuxmaniac
 Patches: 
       diff_rev114611.patch uploaded by linuxmaniac (license 472)

........

................
r114651 | mmichelson | 2008-04-25 12:25:17 -0400 (Fri, 25 Apr 2008) | 4 lines

Fix a memory leak and protect against potential dereferences of a NULL
pointer.


................
r114655 | russell | 2008-04-25 14:18:27 -0400 (Fri, 25 Apr 2008) | 10 lines

Merge code from team/russell/parking_updates

Add some additional features to the core park_call_full() function, and expose
them as options to the Park() application.  The functionality being added is the
ability to specify a custom return extension/context/priority, a custom timeout,
and a couple of options.  The options are to play ringing instead of MOH to the
parked caller, and to randomize parking spot selection.

(code inspired by the patch in AST-17, code from switchvox)

................
r114656 | mmichelson | 2008-04-25 14:18:30 -0400 (Fri, 25 Apr 2008) | 13 lines

This patch allows for forwarding a message with a "comment" attachment
if using IMAP storage for voicemail. The comment will be recorded and attached
as a second attachment in addition to the original message. This will be invoked
if you choose to prepend a message the way you would with file or ODBC storage


(closes issue #12028)
Reported by: jaroth
Patches:
      forward_with_comment_v2.patch uploaded by jaroth (license 50)
Tested by: jaroth


................
r114660 | qwell | 2008-04-25 14:32:22 -0400 (Fri, 25 Apr 2008) | 12 lines

Merge app_pickupchan with app_directed_pickup, for AST-27.

Initially, this was to be a new feature, with a patch from Switchvox,
 but after discussions, it was noted that this feature already existed in trunk.

The resulting discussions ended in a comment that was along the lines of
 "the patch provided here is a lot smaller than what is already in trunk,
 because it doesn't create a new application and duplicate existing code"

It was decided that these two applications could be easily merged to reduce
 code duplication.  SO, that's what this does.

................
r114663 | mmichelson | 2008-04-25 15:33:27 -0400 (Fri, 25 Apr 2008) | 12 lines

Merged revisions 114662 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114662 | mmichelson | 2008-04-25 14:32:02 -0500 (Fri, 25 Apr 2008) | 4 lines

Move the unlock of the spyee channel to outside the start_spying() function so that
the channel is not unlocked twice when using whisper mode.


........

................
r114665 | tilghman | 2008-04-25 15:39:26 -0400 (Fri, 25 Apr 2008) | 2 lines

Oops, this isn't necessarily AGI that is forking anymore

................
r114667 | tilghman | 2008-04-25 16:20:10 -0400 (Fri, 25 Apr 2008) | 2 lines

Whitespace changes only

................

Removed:
    team/seanbright/resolve-shadow-warnings/apps/app_pickupchan.c
Modified:
    team/seanbright/resolve-shadow-warnings/   (props changed)
    team/seanbright/resolve-shadow-warnings/apps/app_chanspy.c
    team/seanbright/resolve-shadow-warnings/apps/app_dial.c
    team/seanbright/resolve-shadow-warnings/apps/app_directed_pickup.c
    team/seanbright/resolve-shadow-warnings/apps/app_externalivr.c
    team/seanbright/resolve-shadow-warnings/apps/app_followme.c
    team/seanbright/resolve-shadow-warnings/apps/app_minivm.c
    team/seanbright/resolve-shadow-warnings/apps/app_parkandannounce.c
    team/seanbright/resolve-shadow-warnings/apps/app_playback.c
    team/seanbright/resolve-shadow-warnings/apps/app_queue.c
    team/seanbright/resolve-shadow-warnings/apps/app_rpt.c
    team/seanbright/resolve-shadow-warnings/apps/app_sms.c
    team/seanbright/resolve-shadow-warnings/apps/app_speech_utils.c
    team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c
    team/seanbright/resolve-shadow-warnings/apps/app_waitforring.c
    team/seanbright/resolve-shadow-warnings/apps/app_zapscan.c
    team/seanbright/resolve-shadow-warnings/main/app.c
    team/seanbright/resolve-shadow-warnings/main/features.c

Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Apr 25 15:43:15 2008
@@ -1,1 +1,1 @@
-/trunk:1-114645
+/trunk:1-114668

Modified: team/seanbright/resolve-shadow-warnings/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_chanspy.c?view=diff&rev=114669&r1=114668&r2=114669
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_chanspy.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_chanspy.c Fri Apr 25 15:43:15 2008
@@ -239,12 +239,9 @@
 
 	res = ast_audiohook_attach(chan, audiohook);
 
-	if (!res && ast_test_flag(chan, AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(chan))) {
-		ast_channel_unlock(chan);
+	if (!res && ast_test_flag(chan, AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(chan))) { 
 		ast_softhangup(peer, AST_SOFTHANGUP_UNBRIDGE);
-	} else
-		ast_channel_unlock(chan);
-
+	}
 	return res;
 }
 
@@ -293,16 +290,18 @@
 
 	ast_audiohook_init(&csth.spy_audiohook, AST_AUDIOHOOK_TYPE_SPY, "ChanSpy");
 
-	if (start_spying(spyee, spyer_name, &csth.spy_audiohook)) { /* Unlocks spyee */
+	if (start_spying(spyee, spyer_name, &csth.spy_audiohook)) {
 		ast_audiohook_destroy(&csth.spy_audiohook);
+		ast_channel_unlock(spyee);
 		return 0;
 	}
 
 	if (ast_test_flag(flags, OPTION_WHISPER)) {
 		ast_audiohook_init(&csth.whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "ChanSpy");
-		start_spying(spyee, spyer_name, &csth.whisper_audiohook); /* Unlocks spyee */
-	}
-
+		start_spying(spyee, spyer_name, &csth.whisper_audiohook);
+	}
+
+	ast_channel_unlock(spyee);
 	spyee = NULL;
 
 	csth.volfactor = *volfactor;

Modified: team/seanbright/resolve-shadow-warnings/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_dial.c?view=diff&rev=114669&r1=114668&r2=114669
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_dial.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_dial.c Fri Apr 25 15:43:15 2008
@@ -26,7 +26,7 @@
  */
 
 /*** MODULEINFO
-        <depend>chan_local</depend>
+	<depend>chan_local</depend>
  ***/
 
 
@@ -1934,9 +1934,9 @@
 		}
 		if (res != AST_PBX_NO_HANGUP_PEER) {
 			if (!ast_check_hangup(peer) && ast_test_flag64(&opts, OPT_CALLEE_GO_ON) && !ast_strlen_zero(opt_args[OPT_ARG_CALLEE_GO_ON])) {		
-                        	replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_GO_ON]);
-                        	ast_parseable_goto(peer, opt_args[OPT_ARG_CALLEE_GO_ON]);
-	                        ast_pbx_start(peer);
+				replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_GO_ON]);
+				ast_parseable_goto(peer, opt_args[OPT_ARG_CALLEE_GO_ON]);
+				ast_pbx_start(peer);
 			} else {
 				if (!ast_check_hangup(chan))
 					chan->hangupcause = peer->hangupcause;

Modified: team/seanbright/resolve-shadow-warnings/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_directed_pickup.c?view=diff&rev=114669&r1=114668&r2=114669
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_directed_pickup.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_directed_pickup.c Fri Apr 25 15:43:15 2008
@@ -4,6 +4,9 @@
  * Copyright (C) 2005, Joshua Colp
  *
  * Joshua Colp <jcolp at digium.com>
+ *
+ * Portions merged from app_pickupchan, which was
+ * Copyright (C) 2008, Gary Cook
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
@@ -21,6 +24,7 @@
  * \brief Directed Call Pickup Support
  *
  * \author Joshua Colp <jcolp at digium.com>
+ * \author Gary Cook
  *
  * \ingroup applications
  */
@@ -51,6 +55,13 @@
 "When no parameter is specified, the application will pickup a channel matching\n"
 "the pickup group of the active channel.";
 
+static const char *app2 = "PickupChan";
+static const char *synopsis2 = "Pickup a ringing channel";
+static const char *descrip2 =
+"  PickupChan(channel[&channel...]): This application can pickup any ringing channel\n";
+
+/*! \todo This application should return a result code, like PICKUPRESULT */
+
 /* Perform actual pickup between two channels */
 static int pickup_do(struct ast_channel *chan, struct ast_channel *target)
 {
@@ -83,6 +94,47 @@
 		return 1;
 	else
 		return 0;
+}
+
+/*! \brief Helper Function to walk through ALL channels checking NAME and STATE */
+static struct ast_channel *my_ast_get_channel_by_name_locked(char *channame)
+{
+	struct ast_channel *chan;
+	char *chkchan = alloca(strlen(channame) + 2);
+
+	/* need to append a '-' for the comparison so we check full channel name,
+	 * i.e SIP/hgc- , use a temporary variable so original stays the same for
+	 * debugging.
+	 */
+	strcpy(chkchan, channame);
+	strcat(chkchan, "-");
+
+	for (chan = ast_walk_channel_by_name_prefix_locked(NULL, channame, strlen(channame));
+		 chan;
+		 chan = ast_walk_channel_by_name_prefix_locked(chan, channame, strlen(channame))) {
+		if (!strncasecmp(chan->name, chkchan, strlen(chkchan)) && can_pickup(chan))
+			return chan;
+		ast_channel_unlock(chan);
+	}
+	return NULL;
+}
+
+/*! \brief Attempt to pick up specified channel named , does not use context */
+static int pickup_by_channel(struct ast_channel *chan, char *pickup)
+{
+	int res = 0;
+	struct ast_channel *target;
+
+	if (!(target = my_ast_get_channel_by_name_locked(pickup)))
+		return -1;
+
+	/* Just check that we are not picking up the SAME as target */
+	if (chan->name != target->name && chan != target) {
+		res = pickup_do(chan, target);
+		ast_channel_unlock(target);
+	}
+
+	return res;
 }
 
 /* Attempt to pick up specified extension with context */
@@ -126,7 +178,7 @@
 	return res;
 }
 
-/* Main application entry point */
+/* application entry point for Pickup() */
 static int pickup_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
@@ -155,18 +207,51 @@
 	return res;
 }
 
+/* application entry point for PickupChan() */
+static int pickupchan_exec(struct ast_channel *chan, void *data)
+{
+	int res = 0;
+	char *tmp = ast_strdupa(data);
+	char *pickup = NULL;
+
+	if (ast_strlen_zero(data)) {
+		ast_log(LOG_WARNING, "PickupChan requires an argument (channel)!\n");
+		return -1;	
+	}
+
+	/* Parse channel */
+	while (!ast_strlen_zero(tmp) && (pickup = strsep(&tmp, "&"))) {
+		if (!strncasecmp(chan->name, pickup, strlen(pickup))) {
+			ast_log(LOG_NOTICE, "Cannot pickup your own channel %s.\n", pickup);
+		} else {
+			if (!pickup_by_channel(chan, pickup)) {
+				break;
+			}
+			ast_log(LOG_NOTICE, "No target channel found for %s.\n", pickup);
+		}
+	}
+
+	return res;
+}
+
 static int unload_module(void)
 {
 	int res;
 
 	res = ast_unregister_application(app);
+	res |= ast_unregister_application(app2);
 
 	return res;
 }
 
 static int load_module(void)
 {
-	return ast_register_application(app, pickup_exec, synopsis, descrip);
+	int res;
+
+	res = ast_register_application(app, pickup_exec, synopsis, descrip);
+	res |= ast_register_application(app2, pickupchan_exec, synopsis2, descrip2);
+
+	return res;
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Directed Call Pickup Application");

Modified: team/seanbright/resolve-shadow-warnings/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_externalivr.c?view=diff&rev=114669&r1=114668&r2=114669
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_externalivr.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_externalivr.c Fri Apr 25 15:43:15 2008
@@ -87,8 +87,8 @@
 };
 
 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 char *args);
+	int eivr_events_fd, int eivr_commands_fd, int eivr_errors_fd, 
+	const char *args);
 
 int eivr_connect_socket(struct ast_channel *chan, const char *host, int port);
 

Modified: team/seanbright/resolve-shadow-warnings/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_followme.c?view=diff&rev=114669&r1=114668&r2=114669
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_followme.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_followme.c Fri Apr 25 15:43:15 2008
@@ -29,7 +29,7 @@
  */
 
 /*** MODULEINFO
-        <depend>chan_local</depend>
+	<depend>chan_local</depend>
  ***/
 
 #include "asterisk.h"

Modified: team/seanbright/resolve-shadow-warnings/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_minivm.c?view=diff&rev=114669&r1=114668&r2=114669
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_minivm.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_minivm.c Fri Apr 25 15:43:15 2008
@@ -736,8 +736,9 @@
 		return;
 	}
 
-	for (var = vmu->chanvars ; var ; var = var->next)
-                pbx_builtin_setvar_helper(channel, var->name, var->value);
+	for (var = vmu->chanvars ; var ; var = var->next) {
+		pbx_builtin_setvar_helper(channel, var->name, var->value);
+	}
 
 	/* Prepare variables for substition in email body and subject */
 	pbx_builtin_setvar_helper(channel, "MVM_NAME", vmu->fullname);
@@ -2778,12 +2779,12 @@
 */
 static int vm_lock_path(const char *path)
 {
-        switch (ast_lock_path(path)) {
-        case AST_LOCK_TIMEOUT:
-                return -1;
-        default:
-                return 0;
-        }
+	switch (ast_lock_path(path)) {
+	case AST_LOCK_TIMEOUT:
+		return -1;
+	default:
+		return 0;
+	}
 }
 
 /*! \brief Access counter file, lock directory, read and possibly write it again changed 

Modified: team/seanbright/resolve-shadow-warnings/apps/app_parkandannounce.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_parkandannounce.c?view=diff&rev=114669&r1=114668&r2=114669
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_parkandannounce.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_parkandannounce.c Fri Apr 25 15:43:15 2008
@@ -129,7 +129,7 @@
 			ast_verb(4, "Channel %s was answered.\n", dchan->name);
 		} else {
 			ast_verb(4, "Channel %s was never answered.\n", dchan->name);
-        			ast_log(LOG_WARNING, "PARK: Channel %s was never answered for the announce.\n", dchan->name);
+			ast_log(LOG_WARNING, "PARK: Channel %s was never answered for the announce.\n", dchan->name);
 			ast_hangup(dchan);
 			return -1;
 		}

Modified: team/seanbright/resolve-shadow-warnings/apps/app_playback.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_playback.c?view=diff&rev=114669&r1=114668&r2=114669
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_playback.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_playback.c Fri Apr 25 15:43:15 2008
@@ -75,16 +75,16 @@
 	int i = 0;
 	say_api_buf[i++] = arg;
 
-        say_api_buf[i++] = ast_say_number_full;
-        say_api_buf[i++] = ast_say_enumeration_full;
-        say_api_buf[i++] = ast_say_digit_str_full;
-        say_api_buf[i++] = ast_say_character_str_full;
-        say_api_buf[i++] = ast_say_phonetic_str_full;
-        say_api_buf[i++] = ast_say_datetime;
-        say_api_buf[i++] = ast_say_time;
-        say_api_buf[i++] = ast_say_date;
-        say_api_buf[i++] = ast_say_datetime_from_now;
-        say_api_buf[i++] = ast_say_date_with_format;
+	say_api_buf[i++] = ast_say_number_full;
+	say_api_buf[i++] = ast_say_enumeration_full;
+	say_api_buf[i++] = ast_say_digit_str_full;
+	say_api_buf[i++] = ast_say_character_str_full;
+	say_api_buf[i++] = ast_say_phonetic_str_full;
+	say_api_buf[i++] = ast_say_datetime;
+	say_api_buf[i++] = ast_say_time;
+	say_api_buf[i++] = ast_say_date;
+	say_api_buf[i++] = ast_say_datetime_from_now;
+	say_api_buf[i++] = ast_say_date_with_format;
 }
 
 static void restore_say_mode(void *arg)
@@ -92,16 +92,16 @@
 	int i = 0;
 	say_api_buf[i++] = arg;
 
-        ast_say_number_full = say_api_buf[i++];
-        ast_say_enumeration_full = say_api_buf[i++];
-        ast_say_digit_str_full = say_api_buf[i++];
-        ast_say_character_str_full = say_api_buf[i++];
-        ast_say_phonetic_str_full = say_api_buf[i++];
-        ast_say_datetime = say_api_buf[i++];
-        ast_say_time = say_api_buf[i++];
-        ast_say_date = say_api_buf[i++];
-        ast_say_datetime_from_now = say_api_buf[i++];
-        ast_say_date_with_format = say_api_buf[i++];
+	ast_say_number_full = say_api_buf[i++];
+	ast_say_enumeration_full = say_api_buf[i++];
+	ast_say_digit_str_full = say_api_buf[i++];
+	ast_say_character_str_full = say_api_buf[i++];
+	ast_say_phonetic_str_full = say_api_buf[i++];
+	ast_say_datetime = say_api_buf[i++];
+	ast_say_time = say_api_buf[i++];
+	ast_say_date = say_api_buf[i++];
+	ast_say_datetime_from_now = say_api_buf[i++];
+	ast_say_date_with_format = say_api_buf[i++];
 }
 
 /* 
@@ -111,25 +111,25 @@
  * parameter.
  */
 typedef struct {
-        struct ast_channel *chan;
-        const char *ints;
-        const char *language;
-        int audiofd;
-        int ctrlfd;
+	struct ast_channel *chan;
+	const char *ints;
+	const char *language;
+	int audiofd;
+	int ctrlfd;
 } say_args_t;
 
 static int s_streamwait3(const say_args_t *a, const char *fn)
 {
-        int res = ast_streamfile(a->chan, fn, a->language);
-        if (res) {
-                ast_log(LOG_WARNING, "Unable to play message %s\n", fn);
-                return res;
-        }
-        res = (a->audiofd  > -1 && a->ctrlfd > -1) ?
-                ast_waitstream_full(a->chan, a->ints, a->audiofd, a->ctrlfd) :
-                ast_waitstream(a->chan, a->ints);
-        ast_stopstream(a->chan);
-        return res;  
+	int res = ast_streamfile(a->chan, fn, a->language);
+	if (res) {
+		ast_log(LOG_WARNING, "Unable to play message %s\n", fn);
+		return res;
+	}
+	res = (a->audiofd  > -1 && a->ctrlfd > -1) ?
+	ast_waitstream_full(a->chan, a->ints, a->audiofd, a->ctrlfd) :
+	ast_waitstream(a->chan, a->ints);
+	ast_stopstream(a->chan);
+	return res;  
 }
 
 /*
@@ -247,11 +247,11 @@
 }
 
 static int say_full(struct ast_channel *chan, const char *string,
-        const char *ints, const char *lang, const char *options,
-        int audiofd, int ctrlfd)
-{
-        say_args_t a = { chan, ints, lang, audiofd, ctrlfd };
-        return do_say(&a, string, options, 0);
+	const char *ints, const char *lang, const char *options,
+	int audiofd, int ctrlfd)
+{
+	say_args_t a = { chan, ints, lang, audiofd, ctrlfd };
+	return do_say(&a, string, options, 0);
 }
 
 static int say_number_full(struct ast_channel *chan, int num,
@@ -259,9 +259,9 @@
 	int audiofd, int ctrlfd)
 {
 	char buf[64];
-        say_args_t a = { chan, ints, lang, audiofd, ctrlfd };
+	say_args_t a = { chan, ints, lang, audiofd, ctrlfd };
 	snprintf(buf, sizeof(buf), "num:%d", num);
-        return do_say(&a, buf, options, 0);
+	return do_say(&a, buf, options, 0);
 }
 
 static int say_enumeration_full(struct ast_channel *chan, int num,
@@ -269,9 +269,9 @@
 	int audiofd, int ctrlfd)
 {
 	char buf[64];
-        say_args_t a = { chan, ints, lang, audiofd, ctrlfd };
+	say_args_t a = { chan, ints, lang, audiofd, ctrlfd };
 	snprintf(buf, sizeof(buf), "enum:%d", num);
-        return do_say(&a, buf, options, 0);
+	return do_say(&a, buf, options, 0);
 }
 
 static int say_date_generic(struct ast_channel *chan, time_t t,
@@ -280,7 +280,7 @@
 	char buf[128];
 	struct ast_tm tm;
 	struct timeval when = { t, 0 };
-        say_args_t a = { chan, ints, lang, -1, -1 };
+	say_args_t a = { chan, ints, lang, -1, -1 };
 	if (format == NULL)
 		format = "";
 
@@ -296,7 +296,7 @@
 		tm.tm_sec,
 		tm.tm_wday,
 		tm.tm_yday);
-        return do_say(&a, buf, NULL, 0);
+	return do_say(&a, buf, NULL, 0);
 }
 
 static int say_date_with_format(struct ast_channel *chan, time_t t,
@@ -515,7 +515,7 @@
 		}
 	}
 
-        ast_cli_register_multiple(cli_playback, sizeof(cli_playback) / sizeof(struct ast_cli_entry));
+	ast_cli_register_multiple(cli_playback, sizeof(cli_playback) / sizeof(struct ast_cli_entry));
 	return ast_register_application(app, playback_exec, synopsis, descrip);
 }
 

Modified: team/seanbright/resolve-shadow-warnings/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_queue.c?view=diff&rev=114669&r1=114668&r2=114669
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_queue.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_queue.c Fri Apr 25 15:43:15 2008
@@ -57,7 +57,7 @@
  */
 
 /*** MODULEINFO
-        <depend>res_monitor</depend>
+	<depend>res_monitor</depend>
  ***/
 
 #include "asterisk.h"
@@ -135,7 +135,7 @@
 #define DEFAULT_TIMEOUT		15
 #define RECHECK			1		/*!< Recheck every second to see we we're at the top yet */
 #define MAX_PERIODIC_ANNOUNCEMENTS 10           /*!< The maximum periodic announcements we can have */
-#define DEFAULT_MIN_ANNOUNCE_FREQUENCY 15       /*!< The minimum number of seconds between position announcements
+#define DEFAULT_MIN_ANNOUNCE_FREQUENCY 15       /*!< The minimum number of seconds between position announcements \
                                                      The default value of 15 provides backwards compatibility */
 #define MAX_QUEUE_BUCKETS 53
 
@@ -581,7 +581,7 @@
 {
 	char interfacevar[256]="";
 	float sl = 0;
-        
+
 	if (qe->parent->setqueuevar) {
 		sl = 0;
 		if (qe->parent->callscompleted > 0) 
@@ -1904,10 +1904,11 @@
 
 	/* Don't restart music on hold if we're about to exit the caller from the queue */
 	if (!res) {
-                if (ringing)
-                        ast_indicate(qe->chan, AST_CONTROL_RINGING);
-                else
-                        ast_moh_start(qe->chan, qe->moh, NULL);
+		if (ringing) {
+			ast_indicate(qe->chan, AST_CONTROL_RINGING);
+		} else {
+			ast_moh_start(qe->chan, qe->moh, NULL);
+		}
 	}
 	return res;
 }
@@ -3113,12 +3114,12 @@
 		case 'H':
 			ast_set_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT);
 			break;
-                case 'k':
-                        ast_set_flag(&(bridge_config.features_callee), AST_FEATURE_PARKCALL);
-                        break;
-                case 'K':
-                        ast_set_flag(&(bridge_config.features_caller), AST_FEATURE_PARKCALL);
-                        break;
+		case 'k':
+			ast_set_flag(&(bridge_config.features_callee), AST_FEATURE_PARKCALL);
+			break;
+		case 'K':
+			ast_set_flag(&(bridge_config.features_caller), AST_FEATURE_PARKCALL);
+			break;
 		case 'n':
 			if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY || qe->parent->strategy == QUEUE_STRATEGY_LINEAR)
 				(*tries)++;
@@ -4643,8 +4644,8 @@
 		.name = data,	
 	};
 
-	char interfacevar[256]="";
-        float sl = 0;
+	char interfacevar[256] = "";
+	float sl = 0;
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_ERROR, "%s requires an argument: queuename\n", cmd);
@@ -4653,24 +4654,26 @@
 
 	if ((q = ao2_find(queues, &tmpq, OBJ_POINTER))) {
 		ao2_lock(q);
-        	if (q->setqueuevar) {
-		        sl = 0;
+		if (q->setqueuevar) {
+			sl = 0;
 			res = 0;
 
-		        if (q->callscompleted > 0)
-		                sl = 100 * ((float) q->callscompletedinsl / (float) q->callscompleted);
-
-		        snprintf(interfacevar, sizeof(interfacevar),
-                		"QUEUEMAX=%d,QUEUESTRATEGY=%s,QUEUECALLS=%d,QUEUEHOLDTIME=%d,QUEUECOMPLETED=%d,QUEUEABANDONED=%d,QUEUESRVLEVEL=%d,QUEUESRVLEVELPERF=%2.1f",
-		                q->maxlen, int2strat(q->strategy), q->count, q->holdtime, q->callscompleted, q->callsabandoned,  q->servicelevel, sl);
-
-		        pbx_builtin_setvar_multiple(chan, interfacevar);
-	        }
+			if (q->callscompleted > 0) {
+				sl = 100 * ((float) q->callscompletedinsl / (float) q->callscompleted);
+			}
+
+			snprintf(interfacevar, sizeof(interfacevar),
+				"QUEUEMAX=%d,QUEUESTRATEGY=%s,QUEUECALLS=%d,QUEUEHOLDTIME=%d,QUEUECOMPLETED=%d,QUEUEABANDONED=%d,QUEUESRVLEVEL=%d,QUEUESRVLEVELPERF=%2.1f",
+				q->maxlen, int2strat(q->strategy), q->count, q->holdtime, q->callscompleted, q->callsabandoned,  q->servicelevel, sl);
+
+			pbx_builtin_setvar_multiple(chan, interfacevar);
+		}
 
 		ao2_unlock(q);
 		queue_unref(q);
-	} else
+	} else {
 		ast_log(LOG_WARNING, "queue %s was not found\n", data);
+	}
 
 	snprintf(buf, len, "%d", res);
 
@@ -4865,7 +4868,7 @@
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(queuename);
 		AST_APP_ARG(interface);
-        );
+	);
 	/* Make sure the returned value on error is NULL. */
 	buf[0] = '\0';
 

Modified: team/seanbright/resolve-shadow-warnings/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_rpt.c?view=diff&rev=114669&r1=114668&r2=114669
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_rpt.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_rpt.c Fri Apr 25 15:43:15 2008
@@ -202,7 +202,7 @@
 enum {REM_MODE_FM, REM_MODE_USB, REM_MODE_LSB, REM_MODE_AM};
 
 enum {HF_SCAN_OFF, HF_SCAN_DOWN_SLOW, HF_SCAN_DOWN_QUICK,
-      HF_SCAN_DOWN_FAST, HF_SCAN_UP_SLOW, HF_SCAN_UP_QUICK, HF_SCAN_UP_FAST};
+	HF_SCAN_DOWN_FAST, HF_SCAN_UP_SLOW, HF_SCAN_UP_QUICK, HF_SCAN_UP_FAST};
 
 #include "asterisk.h"
 

Modified: team/seanbright/resolve-shadow-warnings/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_sms.c?view=diff&rev=114669&r1=114668&r2=114669
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_sms.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_sms.c Fri Apr 25 15:43:15 2008
@@ -260,8 +260,9 @@
 	if (*s == '+')
 		*d++ = *s++;
 	while (*s) {
-  		if (isdigit(*s))
-     			*d++ = *s;
+  		if (isdigit(*s)) {
+			*d++ = *s;
+		}
 		s++;
 	}
 	*d = 0;
@@ -600,8 +601,9 @@
 }
 
 /*! \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 */
+ *  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)
 {
 	unsigned short *o = ud;

Modified: team/seanbright/resolve-shadow-warnings/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_speech_utils.c?view=diff&rev=114669&r1=114668&r2=114669
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_speech_utils.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_speech_utils.c Fri Apr 25 15:43:15 2008
@@ -137,8 +137,9 @@
 	char *tmp = NULL;
 	int nbest_num = 0, wanted_num = 0, i = 0;
 
-	if (!result)
+	if (!result) {
 		return NULL;
+	}
 
 	if ((tmp = strchr(result_num, '/'))) {
 		*tmp++ = '\0';
@@ -167,8 +168,9 @@
 	struct ast_speech *speech = find_speech(chan);
 	char tmp[128] = "";
 
-	if (data == NULL || speech == NULL || !(result = find_result(speech->results, data)))
-		return -1;
+	if (data == NULL || speech == NULL || !(result = find_result(speech->results, data))) {
+		return -1;
+	}
 	
 	snprintf(tmp, sizeof(tmp), "%d", result->score);
 	
@@ -178,65 +180,69 @@
 }
 
 static struct ast_custom_function speech_score_function = {
-        .name = "SPEECH_SCORE",
-        .synopsis = "Gets the confidence score of a result.",
-        .syntax = "SPEECH_SCORE([nbest number/]result number)",
-        .desc =
-        "Gets the confidence score of a result.\n",
-        .read = speech_score,
-        .write = NULL,
+	.name = "SPEECH_SCORE",
+	.synopsis = "Gets the confidence score of a result.",
+	.syntax = "SPEECH_SCORE([nbest number/]result number)",
+	.desc =
+	"Gets the confidence score of a result.\n",
+	.read = speech_score,
+	.write = NULL,
 };
 
 /*! \brief SPEECH_TEXT() Dialplan Function */
 static int speech_text(struct ast_channel *chan, const char *cmd, char *data,
 			char *buf, size_t len)
 {
-        struct ast_speech_result *result = NULL;
-        struct ast_speech *speech = find_speech(chan);
-
-	if (data == NULL || speech == NULL || !(result = find_result(speech->results, data)))
-                return -1;
-
-	if (result->text != NULL)
+	struct ast_speech_result *result = NULL;
+	struct ast_speech *speech = find_speech(chan);
+
+	if (data == NULL || speech == NULL || !(result = find_result(speech->results, data))) {
+		return -1;
+	}
+
+	if (result->text != NULL) {
 		ast_copy_string(buf, result->text, len);
-
-        return 0;
+	}
+
+	return 0;
 }
 
 static struct ast_custom_function speech_text_function = {
-        .name = "SPEECH_TEXT",
-        .synopsis = "Gets the recognized text of a result.",
-        .syntax = "SPEECH_TEXT([nbest number/]result number)",
-        .desc =
-        "Gets the recognized text of a result.\n",
-        .read = speech_text,
-        .write = NULL,
+	.name = "SPEECH_TEXT",
+	.synopsis = "Gets the recognized text of a result.",
+	.syntax = "SPEECH_TEXT([nbest number/]result number)",
+	.desc =
+	"Gets the recognized text of a result.\n",
+	.read = speech_text,
+	.write = NULL,
 };
 
 /*! \brief SPEECH_GRAMMAR() Dialplan Function */
 static int speech_grammar(struct ast_channel *chan, const char *cmd, char *data,
 			char *buf, size_t len)
 {
-        struct ast_speech_result *result = NULL;
-        struct ast_speech *speech = find_speech(chan);
-
-	if (data == NULL || speech == NULL || !(result = find_result(speech->results, data)))
-                return -1;
-
-	if (result->grammar != NULL)
+	struct ast_speech_result *result = NULL;
+	struct ast_speech *speech = find_speech(chan);
+
+	if (data == NULL || speech == NULL || !(result = find_result(speech->results, data))) {
+		return -1;
+	}
+
+	if (result->grammar != NULL) {
 		ast_copy_string(buf, result->grammar, len);
-
-        return 0;
+	}
+
+	return 0;
 }
 
 static struct ast_custom_function speech_grammar_function = {
-        .name = "SPEECH_GRAMMAR",
-        .synopsis = "Gets the matched grammar of a result if available.",
-        .syntax = "SPEECH_GRAMMAR([nbest number/]result number)",
-        .desc =
-        "Gets the matched grammar of a result if available.\n",
-        .read = speech_grammar,
-        .write = NULL,
+	.name = "SPEECH_GRAMMAR",
+	.synopsis = "Gets the matched grammar of a result if available.",
+	.syntax = "SPEECH_GRAMMAR([nbest number/]result number)",
+	.desc =
+	"Gets the matched grammar of a result if available.\n",
+	.read = speech_grammar,
+	.write = NULL,
 };
 
 /*! \brief SPEECH_ENGINE() Dialplan Function */
@@ -244,8 +250,9 @@
 {
 	struct ast_speech *speech = find_speech(chan);
 
-	if (data == NULL || speech == NULL)
-		return -1;
+	if (data == NULL || speech == NULL) {
+		return -1;
+	}
 
 	ast_speech_change(speech, data, value);
 
@@ -329,16 +336,16 @@
 }
 
 static struct ast_custom_function speech_function = {
-        .name = "SPEECH",
-        .synopsis = "Gets information about speech recognition results.",
-        .syntax = "SPEECH(argument)",
-        .desc =
+	.name = "SPEECH",
+	.synopsis = "Gets information about speech recognition results.",
+	.syntax = "SPEECH(argument)",
+	.desc =
 	"Gets information about speech recognition results.\n"
 	"status:   Returns 1 upon speech object existing, or 0 if not\n"
 	"spoke:  Returns 1 if spoker spoke, or 0 if not\n"
 	"results:  Returns number of results that were recognized\n",
-        .read = speech_read,
-        .write = NULL,
+	.read = speech_read,
+	.write = NULL,
 };
 
 
@@ -645,14 +652,14 @@
 			if (!strlen(dtmf)) {
 				if (chan->stream == NULL) {
 					if (speech->processing_sound != NULL) {
-						if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound,"none")) {
+						if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound, "none")) {
 							speech_streamfile(chan, speech->processing_sound, chan->language);
 						}
 					}
 				} else if (chan->streamid == -1 && chan->timingfunc == NULL) {
 					ast_stopstream(chan);
 					if (speech->processing_sound != NULL) {
-						if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound,"none")) {
+						if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound, "none")) {
 							speech_streamfile(chan, speech->processing_sound, chan->language);
 						}
 					}

Modified: team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c?view=diff&rev=114669&r1=114668&r2=114669
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c Fri Apr 25 15:43:15 2008
@@ -149,12 +149,12 @@
 static void init_vm_state(struct vm_state *vms);
 static void check_msgArray(struct vm_state *vms);
 static void copy_msgArray(struct vm_state *dst, struct vm_state *src);
-static int save_body(BODY *body, struct vm_state *vms, char *section, char *format);
-static int make_gsm_file(char *dest, size_t len, char *imapuser, char *dir, int num);
+static int save_body(BODY *body, struct vm_state *vms, char *section, char *format, char *altfile);
+static int make_gsm_file(char *dest, size_t len, char *imapuser, char *dir, int num, char *prefix);
 static void get_mailbox_delimiter(MAILSTREAM *stream);
 static void mm_parsequota (MAILSTREAM *stream, unsigned char *msg, QUOTALIST *pquota);
 static void imap_mailbox_name(char *spec, size_t len, struct vm_state *vms, int box, int target);
-static int imap_store_file(char *dir, char *mailboxuser, char *mailboxcontext, int msgnum, struct ast_channel *chan, struct ast_vm_user *vmu, char *fmt, int duration, struct vm_state *vms);
+static int imap_store_file(char *dir, char *mailboxuser, char *mailboxcontext, int msgnum, struct ast_channel *chan, struct ast_vm_user *vmu, char *fmt, int duration, struct vm_state *vms, char *introfile);
 static void update_messages_by_imapuser(const char *user, unsigned long number);
 
 static int imap_remove_file (char *dir, int msgnum);
@@ -414,6 +414,7 @@
 	char vmbox[PATH_MAX];
 	char fn[PATH_MAX];
 	char fn2[PATH_MAX];
+	char intro[PATH_MAX];
 	int *deleted;
 	int *heard;
 	int curmsg;
@@ -450,7 +451,7 @@
 #ifdef IMAP_STORAGE
 #define RETRIEVE(a,b,c,d) (imap_retrieve_file(a,b,c,d ))
 #define DISPOSE(a,b) (imap_remove_file(a,b))
-#define STORE(a,b,c,d,e,f,g,h,i) (imap_store_file(a,b,c,d,e,f,g,h,i))
+#define STORE(a,b,c,d,e,f,g,h,i,j) (imap_store_file(a,b,c,d,e,f,g,h,i,j))
 #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_file(g,h));
@@ -459,7 +460,7 @@
 #else
 #define RETRIEVE(a,b,c,d)
 #define DISPOSE(a,b)
-#define STORE(a,b,c,d,e,f,g,h,i)
+#define STORE(a,b,c,d,e,f,g,h,i,j)
 #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));
@@ -670,8 +671,9 @@
 static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, char *fmtc, signed char record_gain);
 static int vm_play_folder_name(struct ast_channel *chan, char *mbox);
 static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int msgnum, long duration, char *fmt, char *cidnum, char *cidname);
-static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *attach, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, int imap);
+static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *attach, char *attach2, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, int imap);
 static void apply_options(struct ast_vm_user *vmu, const char *options);
+static int add_email_attachment(FILE *p, struct ast_vm_user *vmu, char *format, char *attach, char *greeting_attachment, char *mailbox, char *bound, char *filename, int last, int msgnum);
 static int is_valid_dtmf(const char *key);
 
 #if !(defined(ODBC_STORAGE) || defined(IMAP_STORAGE))
@@ -1121,14 +1123,14 @@
 }
 
 #ifdef IMAP_STORAGE
-static int make_gsm_file(char *dest, size_t len, char *imapuser, char *dir, int num)
+static int make_gsm_file(char *dest, size_t len, char *imapuser, char *dir, int num, char *prefix)
 {
 	int res;
 	if ((res = ast_mkdir(dir, 01777))) {
 		ast_log(AST_LOG_WARNING, "ast_mkdir '%s' failed: %s\n", dir, strerror(res));
-		return snprintf(dest, len, "%s/msg%04d", dir, num);
-	}
-	return snprintf(dest, len, "%s/msg%04d", dir, num);
+		return snprintf(dest, len, "%s/%smsg%04d", dir, prefix, num);
+	}
+	return snprintf(dest, len, "%s/%smsg%04d", dir, prefix, num);
 }
 
 static void vm_imap_delete(int msgnum, struct vm_state *vms)
@@ -2252,19 +2254,18 @@
  *
  * The email body, and base 64 encoded attachement (if any) are stored to the file identified by *p. This method does not actually send the email.  That is done by invoking the configure 'mailcmd' and piping this generated file into it, or with the sendemail() function.
  */
-static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *attach, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, int imap)
+static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *attach, char *attach2, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, int imap)
 {
 	char date[256];
 	char host[MAXHOSTNAMELEN] = "";
 	char who[256];
 	char bound[256];
-	char fname[256];

[... 1291 lines stripped ...]



More information about the asterisk-commits mailing list