[svn-commits] branch kpfleming/test-for-merging - r8126 in /team/kpfleming/test-for-merging...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Jan 17 10:19:36 MST 2006


Author: kpfleming
Date: Tue Jan 17 11:19:30 2006
New Revision: 8126

URL: http://svn.digium.com/view/asterisk?rev=8126&view=rev
Log:
update for testing automerge script

Added:
    team/kpfleming/test-for-merging/channels/misdn/mISDN.patch
      - copied unchanged from r8124, branches/1.2/channels/misdn/mISDN.patch
    team/kpfleming/test-for-merging/channels/misdn/mISDNuser.patch
      - copied unchanged from r8124, branches/1.2/channels/misdn/mISDNuser.patch
Removed:
    team/kpfleming/test-for-merging/ast_expr.y
Modified:
    team/kpfleming/test-for-merging/   (props changed)
    team/kpfleming/test-for-merging/app.c
    team/kpfleming/test-for-merging/apps/app_chanspy.c
    team/kpfleming/test-for-merging/apps/app_cut.c
    team/kpfleming/test-for-merging/apps/app_dial.c
    team/kpfleming/test-for-merging/apps/app_directed_pickup.c
    team/kpfleming/test-for-merging/apps/app_externalivr.c
    team/kpfleming/test-for-merging/apps/app_hasnewvoicemail.c
    team/kpfleming/test-for-merging/apps/app_meetme.c
    team/kpfleming/test-for-merging/apps/app_mixmonitor.c
    team/kpfleming/test-for-merging/apps/app_privacy.c
    team/kpfleming/test-for-merging/apps/app_queue.c
    team/kpfleming/test-for-merging/apps/app_sms.c
    team/kpfleming/test-for-merging/apps/app_stack.c
    team/kpfleming/test-for-merging/apps/app_voicemail.c
    team/kpfleming/test-for-merging/apps/app_waitforsilence.c
    team/kpfleming/test-for-merging/ast_expr2.fl
    team/kpfleming/test-for-merging/ast_expr2f.c
    team/kpfleming/test-for-merging/asterisk.c
    team/kpfleming/test-for-merging/build_tools/make_svn_branch_name
    team/kpfleming/test-for-merging/cdr.c
    team/kpfleming/test-for-merging/cdr/cdr_tds.c
    team/kpfleming/test-for-merging/channel.c
    team/kpfleming/test-for-merging/channels/Makefile
    team/kpfleming/test-for-merging/channels/chan_agent.c
    team/kpfleming/test-for-merging/channels/chan_alsa.c
    team/kpfleming/test-for-merging/channels/chan_iax2.c
    team/kpfleming/test-for-merging/channels/chan_misdn.c
    team/kpfleming/test-for-merging/channels/chan_misdn_config.c
    team/kpfleming/test-for-merging/channels/chan_sip.c
    team/kpfleming/test-for-merging/channels/chan_zap.c
    team/kpfleming/test-for-merging/channels/misdn/Makefile
    team/kpfleming/test-for-merging/channels/misdn/chan_misdn_config.h
    team/kpfleming/test-for-merging/channels/misdn/ie.c
    team/kpfleming/test-for-merging/channels/misdn/isdn_lib.c
    team/kpfleming/test-for-merging/channels/misdn/isdn_lib.h
    team/kpfleming/test-for-merging/channels/misdn/isdn_lib_intern.h
    team/kpfleming/test-for-merging/channels/misdn/isdn_msg_parser.c
    team/kpfleming/test-for-merging/cli.c
    team/kpfleming/test-for-merging/config.c
    team/kpfleming/test-for-merging/configs/res_odbc.conf.sample
    team/kpfleming/test-for-merging/configs/sip.conf.sample
    team/kpfleming/test-for-merging/configs/voicemail.conf.sample
    team/kpfleming/test-for-merging/db.c
    team/kpfleming/test-for-merging/doc/README.ael
    team/kpfleming/test-for-merging/doc/README.cdr
    team/kpfleming/test-for-merging/doc/README.misdn
    team/kpfleming/test-for-merging/doc/README.variables
    team/kpfleming/test-for-merging/file.c
    team/kpfleming/test-for-merging/formats/format_pcm.c
    team/kpfleming/test-for-merging/formats/format_pcm_alaw.c
    team/kpfleming/test-for-merging/funcs/func_moh.c
    team/kpfleming/test-for-merging/funcs/func_strings.c
    team/kpfleming/test-for-merging/include/asterisk/chanspy.h
    team/kpfleming/test-for-merging/include/asterisk/linkedlists.h
    team/kpfleming/test-for-merging/include/asterisk/strings.h
    team/kpfleming/test-for-merging/logger.c
    team/kpfleming/test-for-merging/manager.c
    team/kpfleming/test-for-merging/pbx.c
    team/kpfleming/test-for-merging/pbx/pbx_ael.c
    team/kpfleming/test-for-merging/pbx/pbx_config.c
    team/kpfleming/test-for-merging/pbx/pbx_dundi.c
    team/kpfleming/test-for-merging/pbx/pbx_spool.c
    team/kpfleming/test-for-merging/res/res_agi.c
    team/kpfleming/test-for-merging/res/res_features.c
    team/kpfleming/test-for-merging/res/res_monitor.c
    team/kpfleming/test-for-merging/translate.c
    team/kpfleming/test-for-merging/utils.c
    team/kpfleming/test-for-merging/utils/astman.c

Propchange: team/kpfleming/test-for-merging/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jan 17 11:19:30 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-7396
+/branches/1.2:1-8125

Modified: team/kpfleming/test-for-merging/app.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/app.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/app.c (original)
+++ team/kpfleming/test-for-merging/app.c Tue Jan 17 11:19:30 2006
@@ -316,8 +316,12 @@
 				}
 			}
 		}
-		if (peer)
-			res = ast_autoservice_stop(peer);
+		if (peer) {
+			/* Stop autoservice on the peer channel, but don't overwrite any error condition 
+			   that has occurred previously while acting on the primary channel */	
+			if (ast_autoservice_stop(peer) && !res)
+				res = -1;
+		}
 	}
 	return res;
 }
@@ -430,11 +434,11 @@
 			   const char *stop, const char *pause,
 			   const char *restart, int skipms) 
 {
-	long elapsed = 0, last_elapsed = 0;
 	char *breaks = NULL;
 	char *end = NULL;
 	int blen = 2;
 	int res;
+	long pause_restart_point = 0;
 
 	if (stop)
 		blen += strlen(stop);
@@ -456,9 +460,6 @@
 	if (chan->_state != AST_STATE_UP)
 		res = ast_answer(chan);
 
-	if (chan)
-		ast_stopstream(chan);
-
 	if (file) {
 		if ((end = strchr(file,':'))) {
 			if (!strcasecmp(end, ":end")) {
@@ -469,25 +470,18 @@
 	}
 
 	for (;;) {
-		struct timeval started = ast_tvnow();
-
-		if (chan)
-			ast_stopstream(chan);
+		ast_stopstream(chan);
 		res = ast_streamfile(chan, file, chan->language);
 		if (!res) {
-			if (end) {
+			if (pause_restart_point) {
+				ast_seekstream(chan->stream, pause_restart_point, SEEK_SET);
+				pause_restart_point = 0;
+			}
+			else if (end) {
 				ast_seekstream(chan->stream, 0, SEEK_END);
-				end=NULL;
-			}
-			res = 1;
-			if (elapsed) {
-				ast_stream_fastforward(chan->stream, elapsed);
-				last_elapsed = elapsed - 200;
-			}
-			if (res)
-				res = ast_waitstream_fr(chan, breaks, fwd, rev, skipms);
-			else
-				break;
+				end = NULL;
+			};
+			res = ast_waitstream_fr(chan, breaks, fwd, rev, skipms);
 		}
 
 		if (res < 1)
@@ -496,17 +490,16 @@
 		/* We go at next loop if we got the restart char */
 		if (restart && strchr(restart, res)) {
 			ast_log(LOG_DEBUG, "we'll restart the stream here at next loop\n");
-			elapsed=0; /* To make sure the next stream will start at beginning */
+			pause_restart_point = 0;
 			continue;
 		}
 
-		if (pause != NULL && strchr(pause, res)) {
-			elapsed = ast_tvdiff_ms(ast_tvnow(), started) + last_elapsed;
-			for(;;) {
-				if (chan)
-					ast_stopstream(chan);
+		if (pause && strchr(pause, res)) {
+			pause_restart_point = ast_tellstream(chan->stream);
+			for (;;) {
+				ast_stopstream(chan);
 				res = ast_waitfordigit(chan, 1000);
-				if (res == 0)
+				if (!res)
 					continue;
 				else if (res == -1 || strchr(pause, res) || (stop && strchr(stop, res)))
 					break;
@@ -516,17 +509,16 @@
 				continue;
 			}
 		}
+
 		if (res == -1)
 			break;
 
 		/* if we get one of our stop chars, return it to the calling function */
-		if (stop && strchr(stop, res)) {
-			/* res = 0; */
-			break;
-		}
-	}
-	if (chan)
-		ast_stopstream(chan);
+		if (stop && strchr(stop, res))
+			break;
+	}
+
+	ast_stopstream(chan);
 
 	return res;
 }

Modified: team/kpfleming/test-for-merging/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_chanspy.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_chanspy.c (original)
+++ team/kpfleming/test-for-merging/apps/app_chanspy.c Tue Jan 17 11:19:30 2006
@@ -208,9 +208,9 @@
 
 static void stop_spying(struct ast_channel *chan, struct ast_channel_spy *spy) 
 {
-	/* If our status has changed, then the channel we're spying on is gone....
+	/* If our status has changed to DONE, then the channel we're spying on is gone....
 	   DON'T TOUCH IT!!!  RUN AWAY!!! */
-	if (spy->status != CHANSPY_RUNNING)
+	if (spy->status == CHANSPY_DONE)
 		return;
 
 	if (!chan)
@@ -439,8 +439,8 @@
 
 	if (recbase) {
 		char filename[512];
-		snprintf(filename,sizeof(filename),"%s/%s.%ld.raw",ast_config_AST_MONITOR_DIR, recbase, time(NULL));
-		if ((fd = open(filename, O_CREAT | O_WRONLY, O_TRUNC)) <= 0) {
+		snprintf(filename,sizeof(filename),"%s/%s.%d.raw",ast_config_AST_MONITOR_DIR, recbase, (int)time(NULL));
+		if ((fd = open(filename, O_CREAT | O_WRONLY, O_TRUNC, 0644)) <= 0) {
 			ast_log(LOG_WARNING, "Cannot open %s for recording\n", filename);
 			fd = 0;
 		}
@@ -482,7 +482,7 @@
 					}
 				}
 				
-				if (igrp && (!spec || ((strlen(spec) < strlen(peer->name) &&
+				if (igrp && (!spec || ((strlen(spec) <= strlen(peer->name) &&
 							!strncasecmp(peer->name, spec, strlen(spec)))))) {
 					if (peer && (!bronly || ast_bridged_channel(peer)) &&
 					    !ast_check_hangup(peer) && !ast_test_flag(peer, AST_FLAG_SPYING)) {

Modified: team/kpfleming/test-for-merging/apps/app_cut.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_cut.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_cut.c (original)
+++ team/kpfleming/test-for-merging/apps/app_cut.c Tue Jan 17 11:19:30 2006
@@ -145,8 +145,9 @@
 		int blen = strlen(buffer);
 		if (element_count++) {
 			strncat(buffer + blen, ",", buflen - blen - 1);
-		}
-		strncat(buffer + blen + 1, sortable_keys[count2].key, buflen - blen - 2);
+			blen++;
+		}
+		strncat(buffer + blen, sortable_keys[count2].key, buflen - blen - 1);
 	}
 
 	return 0;

Modified: team/kpfleming/test-for-merging/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_dial.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_dial.c (original)
+++ team/kpfleming/test-for-merging/apps/app_dial.c Tue Jan 17 11:19:30 2006
@@ -161,7 +161,7 @@
 "    S(x) - Hang up the call after 'x' seconds *after* the called party has\n"
 "           answered the call.\n"  	
 "    t    - Allow the called party to transfer the calling party by sending the\n"
-"           DTMF sequence defiend in features.conf.\n"
+"           DTMF sequence defined in features.conf.\n"
 "    T    - Allow the calling party to transfer the called party by sending the\n"
 "           DTMF sequence defined in features.conf.\n"
 "    w    - Allow the called party to enable recording of the call by sending\n"
@@ -962,7 +962,7 @@
 	/* If a channel group has been specified, get it for use when we create peer channels */
 	outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP");
 
-	ast_copy_flags(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID);
+	ast_copy_flags(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP);
 	cur = args.peers;
 	do {
 		/* Remember where to start next time */

Modified: team/kpfleming/test-for-merging/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_directed_pickup.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_directed_pickup.c (original)
+++ team/kpfleming/test-for-merging/apps/app_directed_pickup.c Tue Jan 17 11:19:30 2006
@@ -77,7 +77,7 @@
 
 	/* Find a channel to pickup */
 	origin = ast_get_channel_by_exten_locked(exten, context);
-	if (origin) {
+	if (origin && origin->cdr) {
 		ast_cdr_getvar(origin->cdr, "dstchannel", &tmp, workspace,
 			       sizeof(workspace), 0);
 		if (tmp) {
@@ -89,6 +89,8 @@
 		}
 		ast_mutex_unlock(&origin->lock);
 	} else {
+		if (origin)
+			ast_mutex_unlock(&origin->lock);
 		ast_log(LOG_DEBUG, "No originating channel found.\n");
 	}
 	

Modified: team/kpfleming/test-for-merging/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_externalivr.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_externalivr.c (original)
+++ team/kpfleming/test-for-merging/apps/app_externalivr.c Tue Jan 17 11:19:30 2006
@@ -94,9 +94,9 @@
 	char tmp[256];
 
 	if (!data) {
-		snprintf(tmp, sizeof(tmp), "%c,%10ld", event, time(NULL));
+		snprintf(tmp, sizeof(tmp), "%c,%10d", event, (int)time(NULL));
 	} else {
-		snprintf(tmp, sizeof(tmp), "%c,%10ld,%s", event, time(NULL), data);
+		snprintf(tmp, sizeof(tmp), "%c,%10d,%s", event, (int)time(NULL), data);
 	}
 
 	fprintf(handle, "%s\n", tmp);
@@ -345,8 +345,6 @@
 			goto exit;
 		}
 
-		setvbuf(child_events, NULL, _IONBF, 0);
-
 		if (!(child_commands = fdopen(child_commands_fd, "r"))) {
 			ast_chan_log(LOG_WARNING, chan, "Could not open stream for child commands\n");
 			goto exit;
@@ -356,6 +354,10 @@
 			ast_chan_log(LOG_WARNING, chan, "Could not open stream for child errors\n");
 			goto exit;
 		}
+
+		setvbuf(child_events, NULL, _IONBF, 0);
+		setvbuf(child_commands, NULL, _IONBF, 0);
+		setvbuf(child_errors, NULL, _IONBF, 0);
 
 		res = 0;
 

Modified: team/kpfleming/test-for-merging/apps/app_hasnewvoicemail.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_hasnewvoicemail.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_hasnewvoicemail.c (original)
+++ team/kpfleming/test-for-merging/apps/app_hasnewvoicemail.c Tue Jan 17 11:19:30 2006
@@ -90,7 +90,6 @@
 		while ((vment = readdir(vmdir))) {
 			if (!strncmp(vment->d_name + 7, ".txt", 4)) {
 				count++;
-				break;
 			}
 		}
 		closedir(vmdir);

Modified: team/kpfleming/test-for-merging/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_meetme.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_meetme.c (original)
+++ team/kpfleming/test-for-merging/apps/app_meetme.c Tue Jan 17 11:19:30 2006
@@ -263,14 +263,17 @@
 		return "(not talking)";
 }
 
-static int careful_write(int fd, unsigned char *data, int len)
+static int careful_write(int fd, unsigned char *data, int len, int block)
 {
 	int res;
 	int x;
 
 	while (len) {
-		x = ZT_IOMUX_WRITE | ZT_IOMUX_SIGEVENT;
-		res = ioctl(fd, ZT_IOMUX, &x);
+		if (block) {
+			x = ZT_IOMUX_WRITE | ZT_IOMUX_SIGEVENT;
+			res = ioctl(fd, ZT_IOMUX, &x);
+		} else
+			res = 0;
 		if (res >= 0)
 			res = write(fd, data, len);
 		if (res < 1) {
@@ -423,7 +426,7 @@
 		len = 0;
 	}
 	if (data) 
-		careful_write(conf->fd, data, len);
+		careful_write(conf->fd, data, len, 1);
 
 	ast_mutex_unlock(&conflock);
 
@@ -1307,7 +1310,11 @@
 						   audio frames (in which case carefully writing would only
 						   have delayed the audio even further).
 						*/
-						write(fd, f->data, f->datalen);
+						/* As it turns out, we do want to use careful write.  We just
+						   don't want to block, but we do want to at least *try*
+						   to write out all the samples.
+						 */
+						careful_write(fd, f->data, f->datalen, 0);
 					}
 				} else if ((f->frametype == AST_FRAME_DTMF) && (confflags & CONFFLAG_EXIT_CONTEXT)) {
 					char tmp[2];

Modified: team/kpfleming/test-for-merging/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_mixmonitor.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_mixmonitor.c (original)
+++ team/kpfleming/test-for-merging/apps/app_mixmonitor.c Tue Jan 17 11:19:30 2006
@@ -112,9 +112,9 @@
 
 static void stopmon(struct ast_channel *chan, struct ast_channel_spy *spy) 
 {
-	/* If our status has changed, then the channel we're spying on is gone....
+	/* If our status has changed to DONE, then the channel we're spying on is gone....
 	   DON'T TOUCH IT!!!  RUN AWAY!!! */
-	if (spy->status != CHANSPY_RUNNING)
+	if (spy->status == CHANSPY_DONE)
 		return;
 
 	if (!chan)

Modified: team/kpfleming/test-for-merging/apps/app_privacy.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_privacy.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_privacy.c (original)
+++ team/kpfleming/test-for-merging/apps/app_privacy.c Tue Jan 17 11:19:30 2006
@@ -193,7 +193,7 @@
 		}
 		
 		/*Got a number, play sounds and send them on their way*/
-		if ((retries < maxretries) && res == 1 ) {
+		if ((retries < maxretries) && !res ) {
 			res = ast_streamfile(chan, "privacy-thankyou", chan->language);
 			if (!res)
 				res = ast_waitstream(chan, "");

Modified: team/kpfleming/test-for-merging/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_queue.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_queue.c (original)
+++ team/kpfleming/test-for-merging/apps/app_queue.c Tue Jan 17 11:19:30 2006
@@ -484,11 +484,11 @@
 							"Membership: %s\r\n"
 							"Penalty: %d\r\n"
 							"CallsTaken: %d\r\n"
-							"LastCall: %ld\r\n"
+							"LastCall: %d\r\n"
 							"Status: %d\r\n"
 							"Paused: %d\r\n",
 						q->name, cur->interface, cur->dynamic ? "dynamic" : "static",
-						cur->penalty, cur->calls, cur->lastcall, cur->status, cur->paused);
+						cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
 					}
 				}
 			}
@@ -1262,11 +1262,11 @@
 					"Membership: %s\r\n"
 					"Penalty: %d\r\n"
 					"CallsTaken: %d\r\n"
-					"LastCall: %ld\r\n"
+					"LastCall: %d\r\n"
 					"Status: %d\r\n"
 					"Paused: %d\r\n",
 				q->name, cur->interface, cur->dynamic ? "dynamic" : "static",
-				cur->penalty, cur->calls, cur->lastcall, cur->status, cur->paused);
+				cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
 			}
 			break;
 		}
@@ -2422,11 +2422,11 @@
 						"Membership: %s\r\n"
 						"Penalty: %d\r\n"
 						"CallsTaken: %d\r\n"
-						"LastCall: %ld\r\n"
+						"LastCall: %d\r\n"
 						"Status: %d\r\n"
 						"Paused: %d\r\n",
 					q->name, new_member->interface, new_member->dynamic ? "dynamic" : "static",
-					new_member->penalty, new_member->calls, new_member->lastcall, new_member->status, new_member->paused);
+					new_member->penalty, new_member->calls, (int)new_member->lastcall, new_member->status, new_member->paused);
 					
 					if (dump)
 						dump_queue_members(q);
@@ -3436,13 +3436,13 @@
 						"Membership: %s\r\n"
 						"Penalty: %d\r\n"
 						"CallsTaken: %d\r\n"
-						"LastCall: %ld\r\n"
+						"LastCall: %d\r\n"
 						"Status: %d\r\n"
 						"Paused: %d\r\n"
 						"%s"
 						"\r\n",
 							q->name, mem->interface, mem->dynamic ? "dynamic" : "static",
-							mem->penalty, mem->calls, mem->lastcall, mem->status, mem->paused, idText);
+							mem->penalty, mem->calls, (int)mem->lastcall, mem->status, mem->paused, idText);
 				}
 			}
 			/* List Queue Entries */

Modified: team/kpfleming/test-for-merging/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_sms.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_sms.c (original)
+++ team/kpfleming/test-for-merging/apps/app_sms.c Tue Jan 17 11:19:30 2006
@@ -694,7 +694,7 @@
 		}
 		while (fgets (line, sizeof (line), s))
 		{								 /* process line in file */
-			char *p;
+			unsigned char *p;
 			for (p = line; *p && *p != '\n' && *p != '\r'; p++);
 			*p = 0;					 /* strip eoln */
 			p = line;
@@ -1379,8 +1379,8 @@
 		ast_copy_string (h.cli, chan->cid.cid_num, sizeof (h.cli));
 
 	{
-		char *d = data,
-			*p,
+		unsigned char *p;
+		unsigned char *d = data,
 			answer = 0;
 		if (!*d || *d == '|') {
 			ast_log (LOG_ERROR, "Requires queue name\n");
@@ -1449,7 +1449,7 @@
 			d = p;
 			h.udl = 0;
 			while (*p && h.udl < SMSLEN)
-				h.ud[h.udl++] = utf8decode((unsigned char **)&p);
+				h.ud[h.udl++] = utf8decode(&p);
 			if (is7bit (h.dcs) && packsms7 (0, h.udhl, h.udh, h.udl, h.ud) < 0)
 				ast_log (LOG_WARNING, "Invalid 7 bit GSM data\n");
 			if (is8bit (h.dcs) && packsms8 (0, h.udhl, h.udh, h.udl, h.ud) < 0)

Modified: team/kpfleming/test-for-merging/apps/app_stack.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_stack.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_stack.c (original)
+++ team/kpfleming/test-for-merging/apps/app_stack.c Tue Jan 17 11:19:30 2006
@@ -52,22 +52,18 @@
 
 static const char *gosub_descrip =
 "Gosub([[context|]exten|]priority)\n"
-"  Jumps to the label specified, saving the return address.\n"
-"  Returns 0 if the label exists or -1 otherwise.\n";
+"  Jumps to the label specified, saving the return address.\n";
 static const char *gosubif_descrip =
-"Gosub(condition?labeliftrue[:labeliffalse])\n"
+"GosubIf(condition?labeliftrue[:labeliffalse])\n"
 "  If the condition is true, then jump to labeliftrue.  If false, jumps to\n"
 "labeliffalse, if specified.  In either case, a jump saves the return point\n"
-"in the dialplan, to be returned to with a Return.\n"
-"  Returns 0 if the label exists or -1 otherwise.\n";
+"in the dialplan, to be returned to with a Return.\n";
 static const char *return_descrip =
 "Return()\n"
-"  Jumps to the last label in the stack, removing it.\n"
-"  Returns 0 if there's a label in the stack or -1 otherwise.\n";
+"  Jumps to the last label on the stack, removing it.\n";
 static const char *pop_descrip =
 "StackPop()\n"
-"  Removes last label in the stack, discarding it.\n"
-"  Always returns 0, even if the stack is empty.\n";
+"  Removes last label on the stack, discarding it.\n";
 
 STANDARD_LOCAL_USER;
 

Modified: team/kpfleming/test-for-merging/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_voicemail.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_voicemail.c (original)
+++ team/kpfleming/test-for-merging/apps/app_voicemail.c Tue Jan 17 11:19:30 2006
@@ -445,7 +445,7 @@
 		ast_copy_string(vmu->language, value, sizeof(vmu->language));
 	} else if (!strcasecmp(var, "tz")) {
 		ast_copy_string(vmu->zonetag, value, sizeof(vmu->zonetag));
-	} else if (!strcasecmp(var, "delete")) {
+	} else if (!strcasecmp(var, "delete") || !strcasecmp(var, "deletevoicemail")) {
 		ast_set2_flag(vmu, ast_true(value), VM_DELETE);	
 	} else if (!strcasecmp(var, "saycid")){
 		ast_set2_flag(vmu, ast_true(value), VM_SAYCID);	
@@ -536,10 +536,10 @@
 		if (mailbox) 
 			ast_copy_string(retval->mailbox, mailbox, sizeof(retval->mailbox));
 		populate_defaults(retval);
-		if (ast_test_flag((&globalflags), VM_SEARCH))
+		if (!context && ast_test_flag((&globalflags), VM_SEARCH))
 			var = ast_load_realtime("voicemail", "mailbox", mailbox, NULL);
 		else
-			var = ast_load_realtime("voicemail", "mailbox", mailbox, "context", retval->context, NULL);
+			var = ast_load_realtime("voicemail", "mailbox", mailbox, "context", context, NULL);
 		if (var) {
 			tmp = var;
 			while(tmp) {
@@ -582,7 +582,7 @@
 	while (cur) {
 		if (ast_test_flag((&globalflags), VM_SEARCH) && !strcasecmp(mailbox, cur->mailbox))
 			break;
-		if ((!strcasecmp(context, cur->context)) && (!strcasecmp(mailbox, cur->mailbox)))
+		if (context && (!strcasecmp(context, cur->context)) && (!strcasecmp(mailbox, cur->mailbox)))
 			break;
 		cur=cur->next;
 	}
@@ -2005,7 +2005,7 @@
 			ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
 			goto yuck;
 		}
-		snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir like \"%%%s/%s/%s\"%c", odbc_table, context, tmp, "INBOX", '\0');
+		snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir LIKE '%%%s/%s/%s'", odbc_table, context, tmp, "INBOX");
 		res = SQLPrepare(stmt, sql, SQL_NTS);
 		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 			ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -2038,7 +2038,7 @@
 			ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
 			goto yuck;
 		}
-		snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir like \"%%%s/%s/%s\"%c", odbc_table, context, tmp, "Old", '\0');
+		snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir like '%%%s/%s/%s'", odbc_table, context, tmp, "Old");
 		res = SQLPrepare(stmt, sql, SQL_NTS);
 		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 			ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -2105,7 +2105,7 @@
                         ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
                         goto yuck;
                 }
-		snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir like \"%%%s/%s/%s\"%c", odbc_table, context, tmp, "INBOX", '\0');
+		snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir like '%%%s/%s/%s'", odbc_table, context, tmp, "INBOX");
                 res = SQLPrepare(stmt, sql, SQL_NTS);
                 if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {  
                         ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -2613,8 +2613,8 @@
 				}
 			}
 			if (ast_fileexists(fn, NULL, NULL)) {
+				STORE(dir, vmu->mailbox, vmu->context, msgnum);
 				notify_new_message(chan, vmu, msgnum, duration, fmt, chan->cid.cid_num, chan->cid.cid_name);
-				STORE(dir, vmu->mailbox, vmu->context, msgnum);
 				DISPOSE(dir, msgnum);
 			}
 			pbx_builtin_setvar_helper(chan, "VMSTATUS", "SUCCESS");
@@ -3919,9 +3919,9 @@
 static int vm_play_folder_name_gr(struct ast_channel *chan, char *mbox)
 {
 	int cmd;
-	char buf[sizeof(mbox)+1]; 
-
-	memset(buf, '\0', sizeof(char)*(sizeof(buf)));
+	char *buf;
+
+	buf = alloca(strlen(mbox)+2); 
 	strcpy(buf, mbox);
 	strcat(buf,"s");
 
@@ -4764,13 +4764,14 @@
 	while((cmd >= 0) && (cmd != 't')) {
 		if (cmd)
 			retries = 0;
+		RETRIEVE(prefile, -1);
 		if (ast_fileexists(prefile, NULL, NULL) > 0) {
 			switch (cmd) {
 			case '1':
 				cmd = play_record_review(chan,"vm-rec-temp",prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
 				break;
 			case '2':
-				ast_filedelete(prefile, NULL);
+				DELETE(prefile, -1, prefile);
 				ast_play_and_wait(chan,"vm-tempremoved");
 				cmd = 't';	
 				break;
@@ -4794,6 +4795,7 @@
 			play_record_review(chan,"vm-rec-temp",prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
 			cmd = 't';	
 		}
+		DISPOSE(prefile, -1);
 	}
 	if (cmd == 't')
 		cmd = 0;
@@ -5645,10 +5647,10 @@
 static int vmauthenticate(struct ast_channel *chan, void *data)
 {
 	struct localuser *u;
-	char *s = data, *user=NULL, *context=NULL, mailbox[AST_MAX_EXTENSION];
+	char *s = data, *user=NULL, *context=NULL, mailbox[AST_MAX_EXTENSION] = "";
 	struct ast_vm_user vmus;
 	char *options = NULL;
-	int silent = 0;
+	int silent = 0, skipuser = 0;
 	int res = -1;
 
 	LOCAL_USER_ADD(u);
@@ -5665,6 +5667,9 @@
 			s = user;
 			user = strsep(&s, "@");
 			context = strsep(&s, "");
+			if (!ast_strlen_zero(user))
+				skipuser++;
+			ast_copy_string(mailbox, user, sizeof(mailbox));
 		}
 	}
 
@@ -5672,9 +5677,10 @@
 		silent = (strchr(options, 's')) != NULL;
 	}
 
-	if (!vm_authenticate(chan, mailbox, sizeof(mailbox), &vmus, context, NULL, 0, 3, silent)) {
+	if (!vm_authenticate(chan, mailbox, sizeof(mailbox), &vmus, context, NULL, skipuser, 3, silent)) {
 		pbx_builtin_setvar_helper(chan, "AUTH_MAILBOX", mailbox);
 		pbx_builtin_setvar_helper(chan, "AUTH_CONTEXT", vmus.context);
+		ast_play_and_wait(chan, "auth-thankyou");
 		res = 0;
 	}
 

Modified: team/kpfleming/test-for-merging/apps/app_waitforsilence.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_waitforsilence.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_waitforsilence.c (original)
+++ team/kpfleming/test-for-merging/apps/app_waitforsilence.c Tue Jan 17 11:19:30 2006
@@ -56,7 +56,7 @@
 "SILENCE - if silence of x ms was detected"
 "TIMEOUT - if silence of x ms was not detected."
 "Examples:\n"
-"  - WaitForSilence(500,2) will wait for 1/2 second of silence, twice\n"
+"  - WaitForSilence(500|2) will wait for 1/2 second of silence, twice\n"
 "  - WaitForSilence(1000) will wait for 1 second of silence, once\n";
 
 STANDARD_LOCAL_USER;

Modified: team/kpfleming/test-for-merging/ast_expr2.fl
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/ast_expr2.fl?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/ast_expr2.fl (original)
+++ team/kpfleming/test-for-merging/ast_expr2.fl Tue Jan 17 11:19:30 2006
@@ -98,42 +98,42 @@
 
 int ast_expr(char *expr, char *buf, int length)
 {
-	struct parse_io *io;
+	struct parse_io io;
+	int return_value = 0;
 	
-	io = calloc(sizeof(struct parse_io),1);
-	io->string = expr;  /* to pass to the error routine */
+	memset(&io, 0, sizeof(io));
+	io.string = expr;  /* to pass to the error routine */
 	
-	ast_yylex_init(&io->scanner);
+	ast_yylex_init(&io.scanner);
 	
-	ast_yy_scan_string(expr, io->scanner);
+	ast_yy_scan_string(expr, io.scanner);
 	
-	ast_yyparse ((void *) io);
+	ast_yyparse ((void *) &io);
 
-	ast_yylex_destroy(io->scanner);
+	ast_yylex_destroy(io.scanner);
 
-	if (io->val == NULL) {
+	if (!io.val) {
 		if (length > 1) {
 			strcpy(buf, "0");
-			return 1;
+			return_value = 1;
 		}
 	} else {
-		if (io->val->type == AST_EXPR_integer) {
+		if (io.val->type == AST_EXPR_integer) {
 			int res_length;
 
-			res_length = snprintf(buf, length, "%ld", (long int) io->val->u.i);
-			return res_length <= length ? res_length : length;
+			res_length = snprintf(buf, length, "%ld", (long int) io.val->u.i);
+			return_value = (res_length <= length) ? res_length : length;
 		} else {
 #ifdef STANDALONE
-			strncpy(buf, io->val->u.s, length - 1);
+			strncpy(buf, io.val->u.s, length - 1);
 #else /* !STANDALONE */
-			ast_copy_string(buf, io->val->u.s, length);
+			ast_copy_string(buf, io.val->u.s, length);
 #endif /* STANDALONE */
-			return strlen(buf);
+			return_value = strlen(buf);
 		}
-		free(io->val);
+		free(io.val);
 	}
-	free(io);
-	return 0;
+	return return_value;
 }
 
 int ast_yyerror (const char *s,  yyltype *loc, struct parse_io *parseio )

Modified: team/kpfleming/test-for-merging/ast_expr2f.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/ast_expr2f.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/ast_expr2f.c (original)
+++ team/kpfleming/test-for-merging/ast_expr2f.c Tue Jan 17 11:19:30 2006
@@ -2562,42 +2562,42 @@
 
 int ast_expr(char *expr, char *buf, int length)
 {
-	struct parse_io *io;
+	struct parse_io io;
+	int return_value = 0;
 	
-	io = calloc(sizeof(struct parse_io),1);
-	io->string = expr;  /* to pass to the error routine */
+	memset(&io, 0, sizeof(io));
+	io.string = expr;  /* to pass to the error routine */
 	
-	ast_yylex_init(&io->scanner);
+	ast_yylex_init(&io.scanner);
 	
-	ast_yy_scan_string(expr, io->scanner);
+	ast_yy_scan_string(expr, io.scanner);
 	
-	ast_yyparse ((void *) io);
-
-	ast_yylex_destroy(io->scanner);
-
-	if (io->val == NULL) {
+	ast_yyparse ((void *) &io);
+
+	ast_yylex_destroy(io.scanner);
+
+	if (!io.val) {
 		if (length > 1) {
 			strcpy(buf, "0");
-			return 1;
+			return_value = 1;
 		}
 	} else {
-		if (io->val->type == AST_EXPR_integer) {
+		if (io.val->type == AST_EXPR_integer) {
 			int res_length;
 
-			res_length = snprintf(buf, length, "%ld", (long int) io->val->u.i);
-			return res_length <= length ? res_length : length;
+			res_length = snprintf(buf, length, "%ld", (long int) io.val->u.i);
+			return_value = (res_length <= length) ? res_length : length;
 		} else {
 #ifdef STANDALONE
-			strncpy(buf, io->val->u.s, length - 1);
+			strncpy(buf, io.val->u.s, length - 1);
 #else /* !STANDALONE */
-			ast_copy_string(buf, io->val->u.s, length);
+			ast_copy_string(buf, io.val->u.s, length);
 #endif /* STANDALONE */
-			return strlen(buf);
+			return_value = strlen(buf);
 		}
-		free(io->val);
+		free(io.val);
 	}
-	free(io);
-	return 0;
+	return return_value;
 }
 
 int ast_yyerror (const char *s,  yyltype *loc, struct parse_io *parseio )

Modified: team/kpfleming/test-for-merging/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/asterisk.c?rev=8126&r1=8125&r2=8126&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/asterisk.c (original)
+++ team/kpfleming/test-for-merging/asterisk.c Tue Jan 17 11:19:30 2006
@@ -126,9 +126,14 @@
 #define NUM_MSGS 64
 
 /*! \brief Welcome message when starting a CLI interface */
-#define WELCOME_MESSAGE ast_verbose( "Asterisk " ASTERISK_VERSION ", Copyright (C) 1999 - 2005 Digium.\n"); \
-		ast_verbose( "Written by Mark Spencer <markster at digium.com>\n"); \
-		ast_verbose( "=========================================================================\n")
+#define WELCOME_MESSAGE \
+	ast_verbose("Asterisk " ASTERISK_VERSION ", Copyright (C) 1999 - 2006 Digium, Inc. and others.\n"); \
+	ast_verbose("Created by Mark Spencer <markster at digium.com>\n"); \
+	ast_verbose("Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show warranty' for details.\n"); \
+	ast_verbose("This is free software, with components licensed under the GNU General Public\n"); \
+	ast_verbose("License version 2 and other licenses; you are welcome to redistribute it under\n"); \
+	ast_verbose("certain conditions. Type 'show license' for details.\n"); \
+	ast_verbose("=========================================================================\n")
 
 /*! \defgroup main_options 
  \brief Main configuration options from \ref Config_ast "asterisk.conf" or 
@@ -680,8 +685,10 @@
 		ast_log(LOG_WARNING, "Unable to change ownership of %s: %s\n", ast_config_AST_SOCKET, strerror(errno));
 
 	if (!ast_strlen_zero(ast_config_AST_CTL_PERMISSIONS)) {
+		int p1;
 		mode_t p;
-		sscanf(ast_config_AST_CTL_PERMISSIONS, "%o", (int *) &p);
+		sscanf(ast_config_AST_CTL_PERMISSIONS, "%o", &p1);
+		p = p1;
 		if ((chmod(ast_config_AST_SOCKET, p)) < 0)
 			ast_log(LOG_WARNING, "Unable to change file permissions of %s: %s\n", ast_config_AST_SOCKET, strerror(errno));
 	}
@@ -1060,6 +1067,14 @@
 "Usage: !<command>\n"
 "       Executes a given shell command\n";
 
+static char show_warranty_help[] =
+"Usage: show warranty\n"
+"	Shows the warranty (if any) for this copy of Asterisk.\n";
+
+static char show_license_help[] =
+"Usage: show license\n"
+"	Shows the license(s) for this copy of Asterisk.\n";
+
 #if 0
 static int handle_quit(int fd, int argc, char *argv[])
 {
@@ -1129,6 +1144,69 @@
 
 static int handle_bang(int fd, int argc, char *argv[])
 {
+	return RESULT_SUCCESS;
+}
+static const char *warranty_lines[] = {
+	"\n",
+	"			    NO WARRANTY\n",
+	"\n",
+	"BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n",
+	"FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\n",
+	"OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n",
+	"PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n",
+	"OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n",
+	"MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\n",
+	"TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\n",
+	"PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n",
+	"REPAIR OR CORRECTION.\n",
+	"\n",
+	"IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n",
+	"WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n",
+	"REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n",
+	"INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n",
+	"OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n",
+	"TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n",
+	"YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n",
+	"PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n",
+	"POSSIBILITY OF SUCH DAMAGES.\n",
+};
+
+static int show_warranty(int fd, int argc, char *argv[])
+{
+	int x;
+
+	for (x = 0; x < sizeof(warranty_lines) / sizeof(warranty_lines[0]); x++)
+		ast_cli(fd, (char *) warranty_lines[x]);
+
+	return RESULT_SUCCESS;
+}
+
+static const char *license_lines[] = {
+	"\n",
+	"This program is free software; you can redistribute it and/or modify\n",
+	"it under the terms of the GNU General Public License version 2 as\n",
+	"published by the Free Software Foundation.\n",
+	"\n",
+	"This program also contains components licensed under other licenses.\n",
+	"They include:\n",
+	"\n",
+	"This program is distributed in the hope that it will be useful,\n",
+	"but WITHOUT ANY WARRANTY; without even the implied warranty of\n",
+	"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n",
+	"GNU General Public License for more details.\n",
+	"\n",
+	"You should have received a copy of the GNU General Public License\n",
+	"along with this program; if not, write to the Free Software\n",
+	"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n",
+};
+
+static int show_license(int fd, int argc, char *argv[])
+{
+	int x;
+
+	for (x = 0; x < sizeof(license_lines) / sizeof(license_lines[0]); x++)
+		ast_cli(fd, (char *) license_lines[x]);
+
 	return RESULT_SUCCESS;
 }
 
@@ -1151,6 +1229,10 @@
 	  "Restart Asterisk gracefully", restart_gracefully_help },
 	{ { "restart", "when", "convenient", NULL }, handle_restart_when_convenient,
 	  "Restart Asterisk at empty call volume", restart_when_convenient_help },
+	{ { "show", "warranty", NULL }, show_warranty,
+	  "Show the warranty (if any) for this copy of Asterisk", show_warranty_help },
+	{ { "show", "license", NULL }, show_license,
+	  "Show the license(s) for this copy of Asterisk", show_license_help },
 	{ { "!", NULL }, handle_bang,
 	  "Execute a shell command", bang_help },
 #if !defined(LOW_MEMORY)
@@ -1252,7 +1334,7 @@
 			if (*t == '%') {
 				char hostname[MAXHOSTNAMELEN]="";
 				int i;
-				struct timeval tv;
+				time_t ts;
 				struct tm tm;
 #ifdef linux
 				FILE *LOADAVG;
@@ -1280,8 +1362,8 @@
 						break;
 					case 'd': /* date */
 						memset(&tm, 0, sizeof(struct tm));
-						tv = ast_tvnow();
-						if (localtime_r(&(tv.tv_sec), &tm)) {
+						time(&ts);
+						if (localtime_r(&ts, &tm)) {
 							strftime(p, sizeof(prompt) - strlen(prompt), "%Y-%m-%d", &tm);
 						}
 						break;
@@ -1337,8 +1419,8 @@
 #endif
 					case 't': /* time */
 						memset(&tm, 0, sizeof(struct tm));

[... 2844 lines stripped ...]


More information about the svn-commits mailing list