[asterisk-commits] branch oej/moduletest - r7673 in /team/oej/moduletest: ./ apps/ cdr/ channels...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Dec 30 04:58:11 CST 2005


Author: oej
Date: Fri Dec 30 04:57:57 2005
New Revision: 7673

URL: http://svn.digium.com/view/asterisk?rev=7673&view=rev
Log:
Updating to svn trunk current version

Added:
    team/oej/moduletest/channels/misdn/mISDN.patch
      - copied unchanged from r7490, branches/1.2/channels/misdn/mISDN.patch
    team/oej/moduletest/channels/misdn/mISDNuser.patch
      - copied unchanged from r7490, branches/1.2/channels/misdn/mISDNuser.patch
Modified:
    team/oej/moduletest/   (props changed)
    team/oej/moduletest/apps/app_chanspy.c
    team/oej/moduletest/apps/app_externalivr.c
    team/oej/moduletest/apps/app_hasnewvoicemail.c
    team/oej/moduletest/apps/app_meetme.c
    team/oej/moduletest/apps/app_queue.c
    team/oej/moduletest/apps/app_sms.c
    team/oej/moduletest/apps/app_voicemail.c
    team/oej/moduletest/apps/app_waitforsilence.c
    team/oej/moduletest/asterisk.c
    team/oej/moduletest/cdr/cdr_tds.c
    team/oej/moduletest/channels/Makefile
    team/oej/moduletest/channels/chan_agent.c
    team/oej/moduletest/channels/chan_alsa.c
    team/oej/moduletest/channels/chan_iax2.c
    team/oej/moduletest/channels/chan_sip.c
    team/oej/moduletest/channels/chan_zap.c
    team/oej/moduletest/cli.c
    team/oej/moduletest/config.c
    team/oej/moduletest/configs/sip.conf.sample
    team/oej/moduletest/pbx/pbx_dundi.c
    team/oej/moduletest/res/res_agi.c
    team/oej/moduletest/res/res_monitor.c

Propchange: team/oej/moduletest/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Dec 30 04:57:57 2005
@@ -1,1 +1,1 @@
-/branches/1.2:1-7489,7491-7496,7498-7515,7519,7521,7523,7577
+/branches/1.2:1-7496,7498-7672

Modified: team/oej/moduletest/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/apps/app_chanspy.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/apps/app_chanspy.c (original)
+++ team/oej/moduletest/apps/app_chanspy.c Fri Dec 30 04:57:57 2005
@@ -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;
 		}

Modified: team/oej/moduletest/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/apps/app_externalivr.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/apps/app_externalivr.c (original)
+++ team/oej/moduletest/apps/app_externalivr.c Fri Dec 30 04:57:57 2005
@@ -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);

Modified: team/oej/moduletest/apps/app_hasnewvoicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/apps/app_hasnewvoicemail.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/apps/app_hasnewvoicemail.c (original)
+++ team/oej/moduletest/apps/app_hasnewvoicemail.c Fri Dec 30 04:57:57 2005
@@ -90,7 +90,6 @@
 		while ((vment = readdir(vmdir))) {
 			if (!strncmp(vment->d_name + 7, ".txt", 4)) {
 				count++;
-				break;
 			}
 		}
 		closedir(vmdir);

Modified: team/oej/moduletest/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/apps/app_meetme.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/apps/app_meetme.c (original)
+++ team/oej/moduletest/apps/app_meetme.c Fri Dec 30 04:57:57 2005
@@ -139,6 +139,7 @@
 	ast_mutex_t listenlock;				/* Conference specific lock (listeners) */
 	char confno[AST_MAX_EXTENSION];		/* Conference */
 	struct ast_channel *chan;		/* Announcements channel */
+	struct ast_channel *lchan;		/* Listen/Record channel */
 	int fd;					/* Announcements fd */
 	int zapconf;				/* Zaptel Conf # */
 	int users;				/* Number of active users */
@@ -509,7 +510,18 @@
 				cnf = NULL;
 				goto cnfout;
 			}
-
+			cnf->lchan = ast_request("zap", AST_FORMAT_SLINEAR, "pseudo", NULL);
+			if (cnf->lchan) {
+				ast_set_read_format(cnf->lchan, AST_FORMAT_SLINEAR);
+				ast_set_write_format(cnf->lchan, AST_FORMAT_SLINEAR);
+				ztc.chan = 0;
+				ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
+				if (ioctl(cnf->lchan->fds[0], ZT_SETCONF, &ztc)) {
+					ast_log(LOG_WARNING, "Error setting conference\n");
+					ast_hangup(cnf->lchan);
+					cnf->lchan = NULL;
+				}
+			}
 			/* Fill the conference struct */
 			cnf->start = time(NULL);
 			cnf->zapconf = ztc.confno;
@@ -816,6 +828,8 @@
 	}
 	if (conf->origframe)
 		ast_frfree(conf->origframe);
+	if (conf->lchan)
+		ast_hangup(conf->lchan);
 	if (conf->chan)
 		ast_hangup(conf->chan);
 	else
@@ -885,7 +899,7 @@
 		}
 	}
 
-	if ((conf->recording == MEETME_RECORD_OFF) && ((confflags & CONFFLAG_RECORDCONF) || (conf->chan))) {
+	if ((conf->recording == MEETME_RECORD_OFF) && ((confflags & CONFFLAG_RECORDCONF) || (conf->lchan))) {
 		pthread_attr_init(&conf->attr);
 		pthread_attr_setdetachstate(&conf->attr, PTHREAD_CREATE_DETACHED);
 		ast_pthread_create(&conf->recordthread, &conf->attr, recordthread, conf);
@@ -2231,16 +2245,16 @@
 	int x;
 	const char *oldrecordingfilename = NULL;
 
-	if (!cnf || !cnf->chan) {
+	if (!cnf || !cnf->lchan) {
 		pthread_exit(0);
 	}
 
-	ast_stopstream(cnf->chan);
+	ast_stopstream(cnf->lchan);
 	flags = O_CREAT|O_TRUNC|O_WRONLY;
 
 
 	cnf->recording = MEETME_RECORD_ACTIVE;
-	while (ast_waitfor(cnf->chan, -1) > -1) {
+	while (ast_waitfor(cnf->lchan, -1) > -1) {
 		if (cnf->recording == MEETME_RECORD_TERMINATE) {
 			ast_mutex_lock(&conflock);
 			ast_mutex_unlock(&conflock);
@@ -2251,7 +2265,7 @@
 			oldrecordingfilename = cnf->recordingfilename;
 		}
 		
-		f = ast_read(cnf->chan);
+		f = ast_read(cnf->lchan);
 		if (!f) {
 			res = -1;
 			break;
@@ -2264,10 +2278,10 @@
 					ast_frfree(cnf->transframe[x]);
 					cnf->transframe[x] = NULL;
 				}
-				if (cnf->origframe)
-					ast_frfree(cnf->origframe);
-				cnf->origframe = f;
-			}
+			}
+			if (cnf->origframe)
+				ast_frfree(cnf->origframe);
+			cnf->origframe = f;
 			ast_mutex_unlock(&cnf->listenlock);
 			if (s)
 				res = ast_writestream(s, f);

Modified: team/oej/moduletest/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/apps/app_queue.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/apps/app_queue.c (original)
+++ team/oej/moduletest/apps/app_queue.c Fri Dec 30 04:57:57 2005
@@ -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;
 		}
@@ -2421,11 +2421,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);
@@ -3435,13 +3435,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/oej/moduletest/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/apps/app_sms.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/apps/app_sms.c (original)
+++ team/oej/moduletest/apps/app_sms.c Fri Dec 30 04:57:57 2005
@@ -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/oej/moduletest/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/apps/app_voicemail.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/apps/app_voicemail.c (original)
+++ team/oej/moduletest/apps/app_voicemail.c Fri Dec 30 04:57:57 2005
@@ -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);

Modified: team/oej/moduletest/apps/app_waitforsilence.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/apps/app_waitforsilence.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/apps/app_waitforsilence.c (original)
+++ team/oej/moduletest/apps/app_waitforsilence.c Fri Dec 30 04:57:57 2005
@@ -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/oej/moduletest/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/asterisk.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/asterisk.c (original)
+++ team/oej/moduletest/asterisk.c Fri Dec 30 04:57:57 2005
@@ -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 - 2005 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 
@@ -665,8 +670,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));
 	}
@@ -1046,6 +1053,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[])
 {
@@ -1115,6 +1130,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;
 }
 
@@ -1137,6 +1215,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)
@@ -1238,7 +1320,7 @@
 			if (*t == '%') {
 				char hostname[MAXHOSTNAMELEN]="";
 				int i;
-				struct timeval tv;
+				time_t ts;
 				struct tm tm;
 #ifdef linux
 				FILE *LOADAVG;
@@ -1266,8 +1348,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;
@@ -1323,8 +1405,8 @@
 #endif
 					case 't': /* time */
 						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), "%H:%M:%S", &tm);
 						}
 						break;
@@ -1729,7 +1811,7 @@
 }
 
 static int show_cli_help(void) {
-	printf("Asterisk " ASTERISK_VERSION ", Copyright (C) 2000 - 2005, Digium.\n");
+	printf("Asterisk " ASTERISK_VERSION ", Copyright (C) 1999 - 2005, Digium, Inc. and others.\n");
 	printf("Usage: asterisk [OPTIONS]\n");
 	printf("Valid Options:\n");
 	printf("   -V              Display version number and exit\n");

Modified: team/oej/moduletest/cdr/cdr_tds.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/cdr/cdr_tds.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/cdr/cdr_tds.c (original)
+++ team/oej/moduletest/cdr/cdr_tds.c Fri Dec 30 04:57:57 2005
@@ -98,7 +98,6 @@
 static TDSLOGIN *login;
 static TDSCONTEXT *context;
 
-static char *stristr(const char*, const char*);
 static char *anti_injection(const char *, int);
 static void get_date(char *, struct timeval);
 
@@ -233,119 +232,6 @@
 	return res;
 }
 
-/* Return the offset of one string within another.
-   Copyright (C) 1994, 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-/*
- * My personal strstr() implementation that beats most other algorithms.
- * Until someone tells me otherwise, I assume that this is the
- * fastest implementation of strstr() in C.
- * I deliberately chose not to comment it.  You should have at least
- * as much fun trying to understand it, as I had to write it :-).
- *
- * Stephen R. van den Berg, berg at pool.informatik.rwth-aachen.de	*/
-
-static char *
-stristr (phaystack, pneedle)
-     const char *phaystack;
-     const char *pneedle;
-{
-  typedef unsigned chartype;
-
-  const unsigned char *haystack, *needle;
-  chartype b;
-  const unsigned char *rneedle;
-
-  haystack = (const unsigned char *) phaystack;
-
-  if ((b = toupper(*(needle = (const unsigned char *) pneedle))))
-    {
-      chartype c;
-      haystack--;		/* possible ANSI violation */
-
-      {
-	chartype a;
-	do
-	  if (!(a = toupper(*++haystack)))
-	    goto ret0;
-	while (a != b);
-      }
-
-      if (!(c = toupper(*++needle)))
-	goto foundneedle;
-      ++needle;
-      goto jin;
-
-      for (;;)
-	{
-	  {
-	    chartype a;
-	    if (0)
-	    jin:{
-		if ((a = toupper(*++haystack)) == c)
-		  goto crest;
-	      }
-	    else
-	      a = toupper(*++haystack);
-	    do
-	      {
-		for (; a != b; a = toupper(*++haystack))
-		  {
-		    if (!a)
-		      goto ret0;
-		    if ((a = toupper(*++haystack)) == b)
-		      break;
-		    if (!a)
-		      goto ret0;
-		  }
-	      }
-	    while ((a = toupper(*++haystack)) != c);
-	  }
-	crest:
-	  {
-	    chartype a;
-	    {
-	      const unsigned char *rhaystack;
-	      if (toupper(*(rhaystack = haystack-- + 1)) == (a = toupper(*(rneedle = needle))))
-		do
-		  {
-		    if (!a)
-		      goto foundneedle;
-		    if (toupper(*++rhaystack) != (a = toupper(*++needle)))
-		      break;
-		    if (!a)
-		      goto foundneedle;
-		  }
-		while (toupper(*++rhaystack) == (a = toupper(*++needle)));
-	      needle = rneedle;	/* took the register-poor aproach */
-	    }
-	    if (!a)
-	      break;
-	  }
-	}
-    }
-foundneedle:
-  return (char *) haystack;
-ret0:
-  return 0;
-}
-
 static char *anti_injection(const char *str, int len)
 {
 	/* Reference to http://www.nextgenss.com/papers/advanced_sql_injection.pdf */
@@ -376,7 +262,7 @@
 	/* Erase known bad input */
 	for (idx=0; *known_bad[idx]; idx++)
 	{
-		while((srh_ptr = stristr(buf, known_bad[idx]))) /* fix me! */
+		while((srh_ptr = strcasestr(buf, known_bad[idx])))
 		{
 			memmove(srh_ptr, srh_ptr+strlen(known_bad[idx]), strlen(srh_ptr+strlen(known_bad[idx]))+1);
 		}

Modified: team/oej/moduletest/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/channels/Makefile?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/channels/Makefile (original)
+++ team/oej/moduletest/channels/Makefile Fri Dec 30 04:57:57 2005
@@ -237,7 +237,7 @@
 endif
 
 chan_misdn.so: chan_misdn.o chan_misdn_config.o misdn/chan_misdn_lib.a
-	$(CC) -shared -Xlinker -x -L/usr/lib -o $@ $^ -lisdnnet -lmISDN
+	$(CC) -shared -Xlinker -x -L/usr/lib -o $@ $^ -lmISDN -lisdnnet
 
 chan_misdn.o: chan_misdn.c
 	$(CC) $(CFLAGS) -DCHAN_MISDN_VERSION=\"0.2.1\" -c $< -o $@

Modified: team/oej/moduletest/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/channels/chan_agent.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/channels/chan_agent.c (original)
+++ team/oej/moduletest/channels/chan_agent.c Fri Dec 30 04:57:57 2005
@@ -1445,11 +1445,11 @@
 			"Name: %s\r\n"
 			"Status: %s\r\n"
 			"LoggedInChan: %s\r\n"
-			"LoggedInTime: %ld\r\n"
+			"LoggedInTime: %d\r\n"
 			"TalkingTo: %s\r\n"
 			"%s"
 			"\r\n",
-			p->agent, username, status, loginChan, p->loginstart, talkingtoChan, idText);
+			p->agent, username, status, loginChan, (int)p->loginstart, talkingtoChan, idText);
 		ast_mutex_unlock(&p->lock);
 		p = p->next;
 	}

Modified: team/oej/moduletest/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/channels/chan_alsa.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/channels/chan_alsa.c (original)
+++ team/oej/moduletest/channels/chan_alsa.c Fri Dec 30 04:57:57 2005
@@ -1109,8 +1109,10 @@
 	ast_channel_unregister(&alsa_tech);
 	for (x=0;x<sizeof(myclis)/sizeof(struct ast_cli_entry); x++)
 		ast_cli_unregister(myclis + x);
-	snd_pcm_close(alsa.icard);
-	snd_pcm_close(alsa.ocard);
+	if (alsa.icard)
+		snd_pcm_close(alsa.icard);
+	if (alsa.ocard)
+		snd_pcm_close(alsa.ocard);
 	if (sndcmd[0] > 0) {
 		close(sndcmd[0]);
 		close(sndcmd[1]);

Modified: team/oej/moduletest/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/channels/chan_iax2.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/channels/chan_iax2.c (original)
+++ team/oej/moduletest/channels/chan_iax2.c Fri Dec 30 04:57:57 2005
@@ -2599,7 +2599,7 @@
 				break;
 			} 
 		} else if (!strcasecmp(tmp->name, "regseconds")) {
-			if (sscanf(tmp->value, "%li", &regseconds) != 1)
+			if (sscanf(tmp->value, "%i", (int *)&regseconds) != 1)
 				regseconds = 0;
 		} else if (!strcasecmp(tmp->name, "ipaddr")) {
 			inet_aton(tmp->value, &(peer->addr.sin_addr));
@@ -2638,13 +2638,13 @@
 		if ((nowtime - regseconds) > IAX_DEFAULT_REG_EXPIRE) {
 			memset(&peer->addr, 0, sizeof(peer->addr));
 			if (option_debug)
-				ast_log(LOG_DEBUG, "realtime_peer: Bah, '%s' is expired (%ld/%ld/%ld)!\n",
-						peername, nowtime - regseconds, regseconds, nowtime);
+				ast_log(LOG_DEBUG, "realtime_peer: Bah, '%s' is expired (%d/%d/%d)!\n",
+						peername, (int)(nowtime - regseconds), (int)regseconds, (int)nowtime);
 		}
 		else {
 			if (option_debug)
-				ast_log(LOG_DEBUG, "realtime_peer: Registration for '%s' still active (%ld/%ld/%ld)!\n",
-						peername, nowtime - regseconds, regseconds, nowtime);
+				ast_log(LOG_DEBUG, "realtime_peer: Registration for '%s' still active (%d/%d/%d)!\n",
+						peername, (int)(nowtime - regseconds), (int)regseconds, (int)nowtime);
 		}
 	}
 
@@ -2700,7 +2700,7 @@
 	time_t nowtime;
 	
 	time(&nowtime);
-	snprintf(regseconds, sizeof(regseconds), "%ld", nowtime);
+	snprintf(regseconds, sizeof(regseconds), "%d", (int)nowtime);
 	ast_inet_ntoa(ipaddr, sizeof(ipaddr), sin->sin_addr);
 	snprintf(port, sizeof(port), "%d", ntohs(sin->sin_port));
 	ast_update_realtime("iaxpeers", "name", peername, "ipaddr", ipaddr, "port", port, "regseconds", regseconds, NULL);
@@ -4285,7 +4285,7 @@
 #if !defined(__FreeBSD__)
 #define FORMAT "%-15.15s  %-15d %-15d\n"
 #else /* __FreeBSD__ */
-#define FORMAT "%-15.15s  %-15d %-15ld\n"
+#define FORMAT "%-15.15s  %-15d %-15d\n" /* XXX 2.95 ? */
 #endif /* __FreeBSD__ */
 	struct iax_firmware *cur;
 	if ((argc != 3) && (argc != 4))
@@ -4296,7 +4296,7 @@
 	for (cur = waresl.wares;cur;cur = cur->next) {
 		if ((argc == 3) || (!strcasecmp(argv[3], (char *)cur->fwh->devname))) 
 			ast_cli(fd, FORMAT, cur->fwh->devname, ntohs(cur->fwh->version),
-				ntohl(cur->fwh->datalen));
+				(int)ntohl(cur->fwh->datalen));
 	}
 	ast_mutex_unlock(&waresl.lock);
 	return RESULT_SUCCESS;

Modified: team/oej/moduletest/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/channels/chan_sip.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/channels/chan_sip.c (original)
+++ team/oej/moduletest/channels/chan_sip.c Fri Dec 30 04:57:57 2005
@@ -1598,7 +1598,7 @@
 		time_t nowtime;
 		time(&nowtime);
 		nowtime += expirey;
-		snprintf(regseconds, sizeof(regseconds), "%ld", nowtime);	/* Expiration time */
+		snprintf(regseconds, sizeof(regseconds), "%d", (int)nowtime);	/* Expiration time */
 		ast_inet_ntoa(ipaddr, sizeof(ipaddr), sin->sin_addr);
 		snprintf(port, sizeof(port), "%d", ntohs(sin->sin_port));
 	}
@@ -2740,7 +2740,6 @@
 		tmp->nativeformats = ast_codec_choose(&i->prefs, i->capability, 1);
 	else
 		tmp->nativeformats = ast_codec_choose(&i->prefs, global_capability, 1);
-	ast_mutex_unlock(&i->lock);
 	fmt = ast_best_codec(tmp->nativeformats);
 
 	if (title)
@@ -4634,13 +4633,10 @@
 	if (p->rpid || p->rpid_from)
 		return;
 
-	if (p->owner && p->owner->cid.cid_num) {
-		clid = strdup(p->owner->cid.cid_num);
-	} 
-
-	if (p->owner && p->owner->cid.cid_name) {
-		clin = strdup(p->owner->cid.cid_name);
-	}
+	if (p->owner && p->owner->cid.cid_num)
+		clid = p->owner->cid.cid_num;
+	if (p->owner && p->owner->cid.cid_name)
+		clin = p->owner->cid.cid_name;
 	if (ast_strlen_zero(clin))
 		clin = clid;
 
@@ -12073,7 +12069,7 @@
 		}
 
 		if (realtime && !strcasecmp(v->name, "regseconds")) {
-			if (sscanf(v->value, "%li", &regseconds) != 1)
+			if (sscanf(v->value, "%i", (int *)&regseconds) != 1)
 				regseconds = 0;
 		} else if (realtime && !strcasecmp(v->name, "ipaddr") && !ast_strlen_zero(v->value) ) {
 			inet_aton(v->value, &(peer->addr.sin_addr));
@@ -12236,7 +12232,7 @@
 			destroy_association(peer);
 			memset(&peer->addr, 0, sizeof(peer->addr));
 			if (option_debug)
-				ast_log(LOG_DEBUG, "Bah, we're expired (%ld/%ld/%ld)!\n", nowtime - regseconds, regseconds, nowtime);
+				ast_log(LOG_DEBUG, "Bah, we're expired (%d/%d/%d)!\n", (int)(nowtime - regseconds), (int)regseconds, (int)nowtime);
 		}
 	}
 	ast_copy_flags(peer, &peerflags, mask.flags);

Modified: team/oej/moduletest/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/channels/chan_zap.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/channels/chan_zap.c (original)
+++ team/oej/moduletest/channels/chan_zap.c Fri Dec 30 04:57:57 2005
@@ -3006,6 +3006,9 @@
 #ifdef ZT_TONEDETECT
 	int val;
 #endif
+
+	if (p->channel == CHAN_PSEUDO)
+		return;
 
 	p->ignoredtmf = 0;
 
@@ -5079,7 +5082,10 @@
 			if (i->dsp) {
 				ast_log(LOG_DEBUG, "Already have a dsp on %s?\n", tmp->name);
 			} else {
-				i->dsp = ast_dsp_new();
+				if (i->channel != CHAN_PSEUDO)
+					i->dsp = ast_dsp_new();
+				else
+					i->dsp = NULL;
 				if (i->dsp) {
 					i->dsp_features = features & ~DSP_PROGRESS_TALK;
 #ifdef ZAPATA_PRI

Modified: team/oej/moduletest/cli.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/cli.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/cli.c (original)
+++ team/oej/moduletest/cli.c Fri Dec 30 04:57:57 2005
@@ -383,7 +383,7 @@
 	if (ast_startuptime) {
 		tmptime = curtime - ast_startuptime;
 		if (printsec) {
-			ast_cli(fd, "System uptime: %lu\n",tmptime);
+			ast_cli(fd, "System uptime: %lu\n",(u_long)tmptime);
 		} else {
 			timestr = format_uptimestr(tmptime);
 			if (timestr) {
@@ -395,7 +395,7 @@
 	if (ast_lastreloadtime) {
 		tmptime = curtime - ast_lastreloadtime;
 		if (printsec) {
-			ast_cli(fd, "Last reload: %lu\n", tmptime);
+			ast_cli(fd, "Last reload: %lu\n", (u_long) tmptime);
 		} else {
 			timestr = format_uptimestr(tmptime);
 			if ((timestr) && (!printsec)) {

Modified: team/oej/moduletest/config.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/config.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/config.c (original)
+++ team/oej/moduletest/config.c Fri Dec 30 04:57:57 2005
@@ -470,7 +470,7 @@
 				/* #exec </path/to/executable>
 				   We create a tmp file, then we #include it, then we delete it. */
 				if (do_exec) { 
-					snprintf(exec_file, sizeof(exec_file), "/var/tmp/exec.%ld.%ld", time(NULL), (long)pthread_self());
+					snprintf(exec_file, sizeof(exec_file), "/var/tmp/exec.%d.%ld", (int)time(NULL), (long)pthread_self());
 					snprintf(cmd, sizeof(cmd), "%s > %s 2>&1", cur, exec_file);
 					ast_safe_system(cmd);
 					cur = exec_file;

Modified: team/oej/moduletest/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/configs/sip.conf.sample?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/configs/sip.conf.sample (original)
+++ team/oej/moduletest/configs/sip.conf.sample Fri Dec 30 04:57:57 2005
@@ -290,7 +290,6 @@
 ; call-limit		      call-limit
 ; restrictcid		      restrictcid
 ; subscribecontext	      subscribecontext
-; videosupport		      videosupport
 ;                             mailbox
 ;                             username
 ;                             template

Modified: team/oej/moduletest/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/pbx/pbx_dundi.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/pbx/pbx_dundi.c (original)
+++ team/oej/moduletest/pbx/pbx_dundi.c Fri Dec 30 04:57:57 2005
@@ -1149,7 +1149,7 @@
 	/* Build request string */
 	if (!ast_db_get("dundi/cache", key, data, sizeof(data))) {
 		ptr = data;
-		if (sscanf(ptr, "%ld|%n", &timeout, &length) == 1) {
+		if (sscanf(ptr, "%d|%n", (int *)&timeout, &length) == 1) {
 			expiration = timeout - now;
 			if (expiration > 0) {
 				ast_log(LOG_DEBUG, "Found cache expiring in %d seconds!\n", (int)(timeout - now));
@@ -2032,7 +2032,7 @@
 		snprintf(tmp, sizeof(tmp), "%s", newkey);
 	rotatetime = time(NULL) + DUNDI_SECRET_TIME;
 	ast_db_put(secretpath, "secret", tmp);
-	snprintf(tmp, sizeof(tmp), "%ld", rotatetime);
+	snprintf(tmp, sizeof(tmp), "%d", (int)rotatetime);
 	ast_db_put(secretpath, "secretexpiry", tmp);
 }
 
@@ -2044,7 +2044,7 @@
 	time_t expired;
 	
 	ast_db_get(secretpath, "secretexpiry", tmp, sizeof(tmp));
-	if (sscanf(tmp, "%ld", &expired) == 1) {
+	if (sscanf(tmp, "%d", (int *)&expired) == 1) {
 		ast_db_get(secretpath, "secret", tmp, sizeof(tmp));
 		current = strchr(tmp, ';');
 		if (!current)

Modified: team/oej/moduletest/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/res/res_agi.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/res/res_agi.c (original)
+++ team/oej/moduletest/res/res_agi.c Fri Dec 30 04:57:57 2005
@@ -1993,7 +1993,7 @@
 	ast_copy_string(buf, data, sizeof(buf));
 
 	memset(&agi, 0, sizeof(agi));
-        while ((stringp = strsep(&tmp, "|")) && argc < MAX_ARGS-1)
+        while ((stringp = strsep(&tmp, "|")) && argc < MAX_ARGS - 1)
 		argv[argc++] = stringp;
 	argv[argc] = NULL;
 

Modified: team/oej/moduletest/res/res_monitor.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/res/res_monitor.c?rev=7673&r1=7672&r2=7673&view=diff
==============================================================================
--- team/oej/moduletest/res/res_monitor.c (original)
+++ team/oej/moduletest/res/res_monitor.c Fri Dec 30 04:57:57 2005
@@ -150,8 +150,8 @@
 				while((p = strchr(channel_name, '/'))) {
 					*p = '-';
 				}
-				snprintf(monitor->filename_base, FILENAME_MAX, "%s/%ld-%s",
-						 ast_config_AST_MONITOR_DIR, time(NULL),channel_name);
+				snprintf(monitor->filename_base, FILENAME_MAX, "%s/%d-%s",
+						 ast_config_AST_MONITOR_DIR, (int)time(NULL),channel_name);
 				monitor->filename_changed = 1;
 			} else {
 				ast_log(LOG_ERROR,"Failed to allocate Memory\n");



More information about the asterisk-commits mailing list