[svn-commits] oej: branch oej/pinepeach r214351 - in /team/oej/pinepeach: ./ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Aug 27 03:47:23 CDT 2009


Author: oej
Date: Thu Aug 27 03:47:19 2009
New Revision: 214351

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=214351
Log:
Staying up to date

Modified:
    team/oej/pinepeach/   (props changed)
    team/oej/pinepeach/Makefile
    team/oej/pinepeach/main/channel.c
    team/oej/pinepeach/main/pbx.c
    team/oej/pinepeach/main/say.c

Propchange: team/oej/pinepeach/
------------------------------------------------------------------------------
--- automerge (original)
+++ automerge Thu Aug 27 03:47:19 2009
@@ -1,1 +1,1 @@
-Note to myself: Try to understand chan_sip
+http://www.codename-pineapple.org/

Propchange: team/oej/pinepeach/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Aug 27 03:47:19 2009
@@ -1,1 +1,1 @@
-/branches/1.4:1-213872
+/branches/1.4:1-214350

Modified: team/oej/pinepeach/Makefile
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepeach/Makefile?view=diff&rev=214351&r1=214350&r2=214351
==============================================================================
--- team/oej/pinepeach/Makefile (original)
+++ team/oej/pinepeach/Makefile Thu Aug 27 03:47:19 2009
@@ -671,7 +671,7 @@
 			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
 		elif [ -f /etc/debian_version ]; then \
 			$(INSTALL) -m 755 contrib/init.d/rc.debian.asterisk $(DESTDIR)/etc/init.d/asterisk; \
-			if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk start 50 2 3 4 5 . stop 91 2 3 4 5 .; fi; \
+			if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk defaults 50 91; fi; \
 		elif [ -f /etc/gentoo-release ]; then \
 			$(INSTALL) -m 755 contrib/init.d/rc.gentoo.asterisk $(DESTDIR)/etc/init.d/asterisk; \
 			if [ -z "$(DESTDIR)" ]; then /sbin/rc-update add asterisk default; fi; \

Modified: team/oej/pinepeach/main/channel.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepeach/main/channel.c?view=diff&rev=214351&r1=214350&r2=214351
==============================================================================
--- team/oej/pinepeach/main/channel.c (original)
+++ team/oej/pinepeach/main/channel.c Thu Aug 27 03:47:19 2009
@@ -2933,13 +2933,36 @@
 		}
 
 		if (chan->audiohooks) {
-			struct ast_frame *new_frame, *cur;
-
+			struct ast_frame *prev = NULL, *new_frame, *cur, *dup;
+
+			/* Since ast_audiohook_write may return a new frame, and the cur frame is
+			 * an item in a list of frames, create a new list adding each cur frame back to it
+			 * regardless if the cur frame changes or not. */
 			for (cur = f; cur; cur = AST_LIST_NEXT(cur, frame_list)) {
 				new_frame = ast_audiohook_write_list(chan, chan->audiohooks, AST_AUDIOHOOK_DIRECTION_WRITE, cur);
+
+				/* if this frame is different than cur, preserve the end of the list,
+				 * free the old frames, and set cur to be the new frame */
 				if (new_frame != cur) {
-					ast_frfree(new_frame);
+					/* doing an ast_frisolate here seems silly, but we are not guaranteed the new_frame
+					 * isn't part of local storage, meaning if ast_audiohook_write is called multiple
+					 * times it may override the previous frame we got from it unless we dup it */
+					if ((dup = ast_frisolate(new_frame))) {
+						AST_LIST_NEXT(dup, frame_list) = AST_LIST_NEXT(cur, frame_list);
+						ast_frfree(new_frame);
+						ast_frfree(cur);
+						cur = dup;
+					}
 				}
+
+				/* now, regardless if cur is new or not, add it to the new list,
+				 * if the new list has not started, cur will become the first item. */
+				if (prev) {
+					AST_LIST_NEXT(prev, frame_list) = cur;
+				} else {
+					f = cur; /* set f to be the beginning of our new list */
+				}
+				prev = cur;
 			}
 		}
 		

Modified: team/oej/pinepeach/main/pbx.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepeach/main/pbx.c?view=diff&rev=214351&r1=214350&r2=214351
==============================================================================
--- team/oej/pinepeach/main/pbx.c (original)
+++ team/oej/pinepeach/main/pbx.c Thu Aug 27 03:47:19 2009
@@ -1529,14 +1529,14 @@
 	char *args = strchr(function, '(');
 
 	if (!args)
-		ast_log(LOG_WARNING, "Function doesn't contain parentheses.  Assuming null argument.\n");
+		ast_log(LOG_WARNING, "Function '%s' doesn't contain parentheses.  Assuming null argument.\n", function);
 	else {
 		char *p;
 		*args++ = '\0';
 		if ((p = strrchr(args, ')')) )
 			*p = '\0';
 		else
-			ast_log(LOG_WARNING, "Can't find trailing parenthesis?\n");
+			ast_log(LOG_WARNING, "Can't find trailing parenthesis for function '%s(%s'?\n", function, args);
 	}
 	return args;
 }

Modified: team/oej/pinepeach/main/say.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepeach/main/say.c?view=diff&rev=214351&r1=214350&r2=214351
==============================================================================
--- team/oej/pinepeach/main/say.c (original)
+++ team/oej/pinepeach/main/say.c Thu Aug 27 03:47:19 2009
@@ -3477,6 +3477,12 @@
 	return res;
 }
 
+static char next_item(const char *format)
+{
+	const char *next = ast_skip_blanks(format);
+	return *next;
+}
+
 /* Danish syntax */
 int ast_say_date_with_format_da(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
 {
@@ -3570,14 +3576,14 @@
 				/* FALLTRHU */
 			case 'k':
 				/* 24-Hour */
-				res = ast_say_number(chan, tm.tm_hour, ints, lang, (char *) NULL);	
+				res = ast_say_number(chan, tm.tm_hour, ints, lang, (char *) NULL);
 				break;
 			case 'M':
 				/* Minute */
-				if (tm.tm_min > 0 || format[offset+ 1 ] == 'S' ) { /* zero 'digits/0' only if seconds follow (kind of a hack) */
-					res = ast_say_number(chan, tm.tm_min, ints, lang, "f");	
-				}
-				if ( !res && format[offset + 1] == 'S' ) { /* minutes only if seconds follow (kind of a hack) */
+				if (tm.tm_min > 0 || next_item(&format[offset + 1]) == 'S') { /* zero 'digits/0' only if seconds follow */
+					res = ast_say_number(chan, tm.tm_min, ints, lang, "f");
+				}
+				if (!res && next_item(&format[offset + 1]) == 'S') { /* minutes only if seconds follow */
 					if (tm.tm_min == 1) {
 						res = wait_file(chan,ints,"digits/minute",lang);
 					} else {
@@ -3777,10 +3783,13 @@
 				break;
 			case 'M':
 				/* Minute */
-				if (tm.tm_min > 0 || format[offset+ 1 ] == 'S' ) { /* zero 'digits/0' only if seconds follow (kind of a hack) */
-					res = ast_say_number(chan, tm.tm_min, ints, lang, "f");	
-				}
-				if ( !res && format[offset + 1] == 'S' ) { /* minutes only if seconds follow (kind of a hack) */
+				if (next_item(&format[offset + 1]) == 'S') { /* zero 'digits/0' only if seconds follow */
+					res = ast_say_number(chan, tm.tm_min, ints, lang, "f"); /* female only if we say digits/minutes */
+				} else if (tm.tm_min > 0) {
+					res = ast_say_number(chan, tm.tm_min, ints, lang, (char *) NULL);
+				}
+
+				if (!res && next_item(&format[offset + 1]) == 'S') { /* minutes only if seconds follow */
 					if (tm.tm_min == 1) {
 						res = wait_file(chan,ints,"digits/minute",lang);
 					} else {
@@ -3862,7 +3871,7 @@
 				if (!res) {
 					res = ast_say_number(chan, tm.tm_sec, ints, lang, "f");	
 					if (!res) {
-						res = wait_file(chan,ints, "digits/seconds",lang);
+						res = wait_file(chan, ints, tm.tm_sec == 1 ? "digits/second" : "digits/seconds", lang);
 					}
 				}
 				break;




More information about the svn-commits mailing list