[asterisk-commits] seanbright: branch seanbright/res-jabber-astobj2 r114686 - in /team/seanbrigh...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 25 22:55:17 CDT 2008


Author: seanbright
Date: Fri Apr 25 22:55:17 2008
New Revision: 114686

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114686
Log:
Merged revisions 114650-114651,114655-114656,114660,114663,114665,114667,114674,114676,114678,114683 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

................
r114674 | russell | 2008-04-25 18:00:35 -0400 (Fri, 25 Apr 2008) | 11 lines

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

........
r114673 | russell | 2008-04-25 16:54:40 -0500 (Fri, 25 Apr 2008) | 3 lines

Use consistent logic for checking to see if a call number has been chosen yet.
Also, remove some redundant logic I recently added in a fix.

........

................
r114676 | russell | 2008-04-25 18:04:46 -0400 (Fri, 25 Apr 2008) | 7 lines

Lock the channel around datastore access

(closes issue #12527)
Reported by: mnicholson
Patches:
      pbx_lua4.diff uploaded by mnicholson (license 96)

................
r114678 | mmichelson | 2008-04-25 18:24:32 -0400 (Fri, 25 Apr 2008) | 11 lines

Adding a new option, 'B' to app_chanspy. This option allows the spy to
barge on the call. It is like the existing whisper option, except that
it allows the spy to talk to both sides of the conversation on which
he is spying.

This feature has existed in Switchvox, and this merges the functionality
into Asterisk.

(AST-32)


................
r114683 | tilghman | 2008-04-25 22:48:56 -0400 (Fri, 25 Apr 2008) | 8 lines

Add 'sip qualify peer <peer>' command (with AMI SIPqualifypeer)
(closes issue #12524)
 Reported by: ctooley
 Patches: 
       sip_qualify_peer.diff.2 uploaded by ctooley (license 136)
       some modifications for trunk by Corydon76
 Tested by: Corydon76

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

Removed:
    team/seanbright/res-jabber-astobj2/apps/app_pickupchan.c
Modified:
    team/seanbright/res-jabber-astobj2/   (props changed)
    team/seanbright/res-jabber-astobj2/CHANGES
    team/seanbright/res-jabber-astobj2/apps/app_chanspy.c
    team/seanbright/res-jabber-astobj2/apps/app_dial.c
    team/seanbright/res-jabber-astobj2/apps/app_directed_pickup.c
    team/seanbright/res-jabber-astobj2/apps/app_externalivr.c
    team/seanbright/res-jabber-astobj2/apps/app_followme.c
    team/seanbright/res-jabber-astobj2/apps/app_minivm.c
    team/seanbright/res-jabber-astobj2/apps/app_parkandannounce.c
    team/seanbright/res-jabber-astobj2/apps/app_playback.c
    team/seanbright/res-jabber-astobj2/apps/app_queue.c
    team/seanbright/res-jabber-astobj2/apps/app_rpt.c
    team/seanbright/res-jabber-astobj2/apps/app_sms.c
    team/seanbright/res-jabber-astobj2/apps/app_speech_utils.c
    team/seanbright/res-jabber-astobj2/apps/app_voicemail.c
    team/seanbright/res-jabber-astobj2/apps/app_waitforring.c
    team/seanbright/res-jabber-astobj2/apps/app_zapscan.c
    team/seanbright/res-jabber-astobj2/channels/chan_iax2.c
    team/seanbright/res-jabber-astobj2/channels/chan_sip.c
    team/seanbright/res-jabber-astobj2/main/app.c
    team/seanbright/res-jabber-astobj2/main/features.c
    team/seanbright/res-jabber-astobj2/pbx/pbx_lua.c

Propchange: team/seanbright/res-jabber-astobj2/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/seanbright/res-jabber-astobj2/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/seanbright/res-jabber-astobj2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Apr 25 22:55:17 2008
@@ -1,1 +1,1 @@
-/trunk:1-114646
+/trunk:1-114685

Modified: team/seanbright/res-jabber-astobj2/CHANGES
URL: http://svn.digium.com/view/asterisk/team/seanbright/res-jabber-astobj2/CHANGES?view=diff&rev=114686&r1=114685&r2=114686
==============================================================================
--- team/seanbright/res-jabber-astobj2/CHANGES (original)
+++ team/seanbright/res-jabber-astobj2/CHANGES Fri Apr 25 22:55:17 2008
@@ -33,6 +33,9 @@
  * ChanSpy and ExtenSpy have a new option, 's' which suppresses speaking the
    technology name (e.g. SIP, IAX, etc) of the channel being spied on.
  * The Jack application now has a c() option to supply a custom client name.
+ * Chanspy has a new option, 'B', which can be used to "barge" on a call. This is
+   like the pre-existing whisper mode, except that the spy can also talk to the
+   participant on the bridged channel as well.
 
 SIP Changes
 -----------

Modified: team/seanbright/res-jabber-astobj2/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/res-jabber-astobj2/apps/app_chanspy.c?view=diff&rev=114686&r1=114685&r2=114686
==============================================================================
--- team/seanbright/res-jabber-astobj2/apps/app_chanspy.c (original)
+++ team/seanbright/res-jabber-astobj2/apps/app_chanspy.c Fri Apr 25 22:55:17 2008
@@ -148,6 +148,7 @@
 	OPTION_EXIT      = (1 << 8),    /* Exit to a valid single digit extension */
 	OPTION_ENFORCED  = (1 << 9),    /* Enforced mode */
 	OPTION_NOTECH    = (1 << 10),   /* Skip technology name playback */
+	OPTION_BARGE     = (1 << 11),   /* Barge mode (whisper to both channels) */
 } chanspy_opt_flags;
 
 enum {
@@ -161,6 +162,7 @@
 AST_APP_OPTIONS(spy_opts, {
 	AST_APP_OPTION('q', OPTION_QUIET),
 	AST_APP_OPTION('b', OPTION_BRIDGED),
+	AST_APP_OPTION('B', OPTION_BARGE),
 	AST_APP_OPTION('w', OPTION_WHISPER),
 	AST_APP_OPTION('W', OPTION_PRIVATE),
 	AST_APP_OPTION_ARG('v', OPTION_VOLUME, OPT_ARG_VOLUME),
@@ -177,6 +179,7 @@
 	/* spy data */
 	struct ast_audiohook spy_audiohook;
 	struct ast_audiohook whisper_audiohook;
+	struct ast_audiohook bridge_whisper_audiohook;
 	int fd;
 	int volfactor;
 };
@@ -230,7 +233,7 @@
 	.generate = spy_generate,
 };
 
-static int start_spying(struct ast_channel *chan, const char *spychan_name, struct ast_audiohook *audiohook) 
+static int start_spying(struct ast_channel *chan, const char *spychan_name, struct ast_audiohook *audiohook)
 {
 	int res = 0;
 	struct ast_channel *peer = NULL;
@@ -239,12 +242,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 +293,23 @@
 
 	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)) {
+	if (ast_test_flag(flags, OPTION_BARGE)) {
+  		ast_audiohook_init(&csth.whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "ChanSpy");
+		ast_audiohook_init(&csth.bridge_whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "Chanspy");
+  		start_spying(spyee, spyer_name, &csth.whisper_audiohook); /* Unlocks spyee */
+		start_spying(ast_bridged_channel(spyee), spyer_name, &csth.bridge_whisper_audiohook);
+	} else 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 */
-	}
-
+  	}
+
+	ast_channel_unlock(spyee);
 	spyee = NULL;
 
 	csth.volfactor = *volfactor;
@@ -339,7 +346,16 @@
 			break;
 		}
 
-		if (ast_test_flag(flags, OPTION_WHISPER) && f->frametype == AST_FRAME_VOICE) {
+		if (ast_test_flag(flags, OPTION_BARGE) && f->frametype == AST_FRAME_VOICE) {
+			ast_audiohook_lock(&csth.whisper_audiohook);
+			ast_audiohook_lock(&csth.bridge_whisper_audiohook);
+			ast_audiohook_write_frame(&csth.whisper_audiohook, AST_AUDIOHOOK_DIRECTION_WRITE, f);
+			ast_audiohook_write_frame(&csth.bridge_whisper_audiohook, AST_AUDIOHOOK_DIRECTION_WRITE, f);
+			ast_audiohook_unlock(&csth.whisper_audiohook);
+			ast_audiohook_unlock(&csth.bridge_whisper_audiohook);
+			ast_frfree(f);
+			continue;
+		} else if (ast_test_flag(flags, OPTION_WHISPER) && f->frametype == AST_FRAME_VOICE) {
 			ast_audiohook_lock(&csth.whisper_audiohook);
 			ast_audiohook_write_frame(&csth.whisper_audiohook, AST_AUDIOHOOK_DIRECTION_WRITE, f);
 			ast_audiohook_unlock(&csth.whisper_audiohook);
@@ -401,7 +417,16 @@
 	else
 		ast_deactivate_generator(chan);
 
-	if (ast_test_flag(flags, OPTION_WHISPER)) {
+	if (ast_test_flag(flags, OPTION_BARGE)) {
+		ast_audiohook_lock(&csth.whisper_audiohook);
+		ast_audiohook_detach(&csth.whisper_audiohook);
+		ast_audiohook_unlock(&csth.whisper_audiohook);
+		ast_audiohook_destroy(&csth.whisper_audiohook);
+		ast_audiohook_lock(&csth.bridge_whisper_audiohook);
+		ast_audiohook_detach(&csth.bridge_whisper_audiohook);
+		ast_audiohook_unlock(&csth.bridge_whisper_audiohook);
+		ast_audiohook_destroy(&csth.bridge_whisper_audiohook);
+	} else if (ast_test_flag(flags, OPTION_WHISPER)) {
 		ast_audiohook_lock(&csth.whisper_audiohook);
 		ast_audiohook_detach(&csth.whisper_audiohook);
 		ast_audiohook_unlock(&csth.whisper_audiohook);

Modified: team/seanbright/res-jabber-astobj2/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/res-jabber-astobj2/apps/app_dial.c?view=diff&rev=114686&r1=114685&r2=114686
==============================================================================
--- team/seanbright/res-jabber-astobj2/apps/app_dial.c (original)
+++ team/seanbright/res-jabber-astobj2/apps/app_dial.c Fri Apr 25 22:55:17 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/res-jabber-astobj2/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/res-jabber-astobj2/apps/app_directed_pickup.c?view=diff&rev=114686&r1=114685&r2=114686
==============================================================================
--- team/seanbright/res-jabber-astobj2/apps/app_directed_pickup.c (original)
+++ team/seanbright/res-jabber-astobj2/apps/app_directed_pickup.c Fri Apr 25 22:55:17 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/res-jabber-astobj2/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/res-jabber-astobj2/apps/app_externalivr.c?view=diff&rev=114686&r1=114685&r2=114686
==============================================================================
--- team/seanbright/res-jabber-astobj2/apps/app_externalivr.c (original)
+++ team/seanbright/res-jabber-astobj2/apps/app_externalivr.c Fri Apr 25 22:55:17 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/res-jabber-astobj2/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/res-jabber-astobj2/apps/app_followme.c?view=diff&rev=114686&r1=114685&r2=114686
==============================================================================
--- team/seanbright/res-jabber-astobj2/apps/app_followme.c (original)
+++ team/seanbright/res-jabber-astobj2/apps/app_followme.c Fri Apr 25 22:55:17 2008
@@ -29,7 +29,7 @@
  */
 
 /*** MODULEINFO
-        <depend>chan_local</depend>
+	<depend>chan_local</depend>
  ***/
 
 #include "asterisk.h"

Modified: team/seanbright/res-jabber-astobj2/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/res-jabber-astobj2/apps/app_minivm.c?view=diff&rev=114686&r1=114685&r2=114686
==============================================================================
--- team/seanbright/res-jabber-astobj2/apps/app_minivm.c (original)
+++ team/seanbright/res-jabber-astobj2/apps/app_minivm.c Fri Apr 25 22:55:17 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/res-jabber-astobj2/apps/app_parkandannounce.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/res-jabber-astobj2/apps/app_parkandannounce.c?view=diff&rev=114686&r1=114685&r2=114686
==============================================================================
--- team/seanbright/res-jabber-astobj2/apps/app_parkandannounce.c (original)
+++ team/seanbright/res-jabber-astobj2/apps/app_parkandannounce.c Fri Apr 25 22:55:17 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/res-jabber-astobj2/apps/app_playback.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/res-jabber-astobj2/apps/app_playback.c?view=diff&rev=114686&r1=114685&r2=114686
==============================================================================
--- team/seanbright/res-jabber-astobj2/apps/app_playback.c (original)
+++ team/seanbright/res-jabber-astobj2/apps/app_playback.c Fri Apr 25 22:55:17 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 tv = { 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/res-jabber-astobj2/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/res-jabber-astobj2/apps/app_queue.c?view=diff&rev=114686&r1=114685&r2=114686
==============================================================================
--- team/seanbright/res-jabber-astobj2/apps/app_queue.c (original)
+++ team/seanbright/res-jabber-astobj2/apps/app_queue.c Fri Apr 25 22:55:17 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/res-jabber-astobj2/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/res-jabber-astobj2/apps/app_rpt.c?view=diff&rev=114686&r1=114685&r2=114686
==============================================================================
--- team/seanbright/res-jabber-astobj2/apps/app_rpt.c (original)
+++ team/seanbright/res-jabber-astobj2/apps/app_rpt.c Fri Apr 25 22:55:17 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/res-jabber-astobj2/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/res-jabber-astobj2/apps/app_sms.c?view=diff&rev=114686&r1=114685&r2=114686
==============================================================================
--- team/seanbright/res-jabber-astobj2/apps/app_sms.c (original)
+++ team/seanbright/res-jabber-astobj2/apps/app_sms.c Fri Apr 25 22:55:17 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/res-jabber-astobj2/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/res-jabber-astobj2/apps/app_speech_utils.c?view=diff&rev=114686&r1=114685&r2=114686
==============================================================================
--- team/seanbright/res-jabber-astobj2/apps/app_speech_utils.c (original)
+++ team/seanbright/res-jabber-astobj2/apps/app_speech_utils.c Fri Apr 25 22:55:17 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/res-jabber-astobj2/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/res-jabber-astobj2/apps/app_voicemail.c?view=diff&rev=114686&r1=114685&r2=114686

[... 1639 lines stripped ...]



More information about the asterisk-commits mailing list