[asterisk-commits] branch bweschke/bug_5374 - r7645 in /team/bweschke/bug_5374: ./ apps/ cdr/ ch...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Dec 26 21:10:43 CST 2005


Author: bweschke
Date: Mon Dec 26 21:10:33 2005
New Revision: 7645

URL: http://svn.digium.com/view/asterisk?rev=7645&view=rev
Log:
 Merge with latest changes from /trunk


Removed:
    team/bweschke/bug_5374/apps/app_datetime.c
Modified:
    team/bweschke/bug_5374/   (props changed)
    team/bweschke/bug_5374/UPGRADE.txt
    team/bweschke/bug_5374/apps/Makefile
    team/bweschke/bug_5374/apps/app_chanspy.c
    team/bweschke/bug_5374/apps/app_externalivr.c
    team/bweschke/bug_5374/apps/app_meetme.c
    team/bweschke/bug_5374/apps/app_queue.c
    team/bweschke/bug_5374/apps/app_sms.c
    team/bweschke/bug_5374/apps/app_voicemail.c
    team/bweschke/bug_5374/asterisk.c
    team/bweschke/bug_5374/cdr/cdr_tds.c
    team/bweschke/bug_5374/channel.c
    team/bweschke/bug_5374/channels/chan_agent.c
    team/bweschke/bug_5374/channels/chan_iax2.c
    team/bweschke/bug_5374/channels/chan_sip.c
    team/bweschke/bug_5374/channels/chan_zap.c
    team/bweschke/bug_5374/cli.c
    team/bweschke/bug_5374/config.c
    team/bweschke/bug_5374/configs/func_odbc.conf.sample
    team/bweschke/bug_5374/configs/zapata.conf.sample
    team/bweschke/bug_5374/funcs/Makefile
    team/bweschke/bug_5374/funcs/func_callerid.c
    team/bweschke/bug_5374/funcs/func_odbc.c
    team/bweschke/bug_5374/funcs/func_strings.c
    team/bweschke/bug_5374/include/asterisk/pbx.h
    team/bweschke/bug_5374/pbx.c
    team/bweschke/bug_5374/pbx/pbx_dundi.c
    team/bweschke/bug_5374/res/res_monitor.c
    team/bweschke/bug_5374/say.c

Propchange: team/bweschke/bug_5374/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Dec 26 21:10:33 2005
@@ -1,2 +1,2 @@
 /branches/1.2:1-7351
-/trunk:1-7611
+/trunk:1-7644

Modified: team/bweschke/bug_5374/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/UPGRADE.txt?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/UPGRADE.txt (original)
+++ team/bweschke/bug_5374/UPGRADE.txt Mon Dec 26 21:10:33 2005
@@ -8,3 +8,21 @@
   marked deprecated in Asterisk 1.2.  An option to disable it was provided with
   the default value set to 'on'.  The default value for the global priority
   jumping option is now 'off'.
+
+* The applications Cut, Sort, DBGet, DBPut, SetCIDNum, SetCIDName, SetRDNIS,
+  AbsoluteTimeout, DigitTimeout, ResponseTimeout, SetLanguage, GetGroupCount,
+  and GetGroupMatchCount were all deprecated in version 1.2, and therefore have
+  been removed in this version.  You should use the equivalent dialplan
+  function in places where you have previously used one of these applications.
+
+* The application SetVar has been renamed to Set.  The syntax SetVar was marked
+  deprecated in version 1.2 and is no longer recognized in this version.
+
+Variables:
+
+* The builtin variables ${CALLERID}, ${CALLERIDNAME}, ${CALLERIDNUM},
+  ${CALLERANI}, ${DNID}, ${RDNIS}, ${DATETIME}, ${TIMESTAMP}, ${ACCOUNTCODE},
+  and ${LANGUAGE} have all been deprecated in favor of their related dialplan
+  functions.  You are encouraged to move towards the associated dialplan
+  function, as these variables will be removed in a future release.
+

Modified: team/bweschke/bug_5374/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/Makefile?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/Makefile (original)
+++ team/bweschke/bug_5374/apps/Makefile Mon Dec 26 21:10:33 2005
@@ -91,6 +91,7 @@
 
 install: all
 	for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+	rm -f $(DESTDIR)$(MODULES_DIR)/app_cut.so
 	rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
 	rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so
 

Modified: team/bweschke/bug_5374/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/app_chanspy.c?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/app_chanspy.c (original)
+++ team/bweschke/bug_5374/apps/app_chanspy.c Mon Dec 26 21:10:33 2005
@@ -439,7 +439,7 @@
 
 	if (recbase) {
 		char filename[512];
-		snprintf(filename,sizeof(filename),"%s/%s.%ld.raw",ast_config_AST_MONITOR_DIR, recbase, time(NULL));
+		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)) <= 0) {
 			ast_log(LOG_WARNING, "Cannot open %s for recording\n", filename);
 			fd = 0;

Modified: team/bweschke/bug_5374/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/app_externalivr.c?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/app_externalivr.c (original)
+++ team/bweschke/bug_5374/apps/app_externalivr.c Mon Dec 26 21:10:33 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/bweschke/bug_5374/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/app_meetme.c?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/app_meetme.c (original)
+++ team/bweschke/bug_5374/apps/app_meetme.c Mon Dec 26 21:10:33 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/bweschke/bug_5374/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/app_queue.c?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/app_queue.c (original)
+++ team/bweschke/bug_5374/apps/app_queue.c Mon Dec 26 21:10:33 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/bweschke/bug_5374/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/app_sms.c?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/app_sms.c (original)
+++ team/bweschke/bug_5374/apps/app_sms.c Mon Dec 26 21:10:33 2005
@@ -1380,8 +1380,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");
@@ -1394,11 +1394,11 @@
 			LOCAL_USER_REMOVE(u);
 			return -1;
 		}
-		strncpy (h.queue, d, p - d);
+		strncpy (h.queue, (char *)d, p - d);
 		if (*p == '|')
 			p++;
 		d = p;
-		for (p = h.queue; *p; p++)
+		for (p = (unsigned char *)h.queue; *p; p++)
 			if (!isalnum (*p))
 				*p = '-';			  /* make very safe for filenames */
 		while (*d && *d != '|') {
@@ -1430,27 +1430,27 @@
 		}
 		if (*d == '|') {
 			/* submitting a message, not taking call. */
-			/* depricated, use smsq instead */
+			/* deprecated, use smsq instead */
 			d++;
 			h.scts = time (0);
 			for (p = d; *p && *p != '|'; p++);
 			if (*p)
 				*p++ = 0;
-			if (strlen (d) >= sizeof (h.oa)) {
+			if (strlen ((char *)d) >= sizeof (h.oa)) {
 				ast_log (LOG_ERROR, "Address too long %s\n", d);
 				return 0;
 			}
 			if (h.smsc) {
-				ast_copy_string (h.oa, d, sizeof (h.oa));
+				ast_copy_string (h.oa, (char *)d, sizeof (h.oa));
 			} else {
-				ast_copy_string (h.da, d, sizeof (h.da));
+				ast_copy_string (h.da, (char *)d, sizeof (h.da));
 			}
 			if (!h.smsc)
 				ast_copy_string (h.oa, h.cli, sizeof (h.oa));
 			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/bweschke/bug_5374/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/app_voicemail.c?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/app_voicemail.c (original)
+++ team/bweschke/bug_5374/apps/app_voicemail.c Mon Dec 26 21:10:33 2005
@@ -1603,10 +1603,44 @@
 	pbx_builtin_setvar_helper(ast, "VM_DATE", date);
 }
 
+/*
+ * fill in *tm for current time according to the proper timezone, if any.
+ * Return tm so it can be used as a function argument.
+ */
+static const struct tm *vmu_tm(const struct ast_vm_user *vmu, struct tm *tm)
+{
+	const struct vm_zone *z = NULL;
+	time_t t = time(NULL);
+
+	/* Does this user have a timezone specified? */
+	if (!ast_strlen_zero(vmu->zonetag)) {
+		/* Find the zone in the list */
+		for (z = zones; z ; z = z->next)
+			if (!strcmp(z->name, vmu->zonetag))
+				break;
+	}
+	ast_localtime(&t, tm, z ? z->timezone : NULL);
+	return tm;
+}
+
+/* same as mkstemp, but return a FILE * */
+static FILE *vm_mkftemp(char *template)
+{
+	FILE *p = NULL;
+	int pfd = mkstemp(template);
+	if (pfd > -1) {
+		p = fdopen(pfd, "w");
+		if (!p) {
+			close(pfd);
+			pfd = -1;
+		}
+	}
+	return p;
+}
+
 static int sendmail(char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *attach, char *format, int duration, int attach_user_voicemail)
 {
 	FILE *p=NULL;
-	int pfd;
 	char date[256];
 	char host[MAXHOSTNAMELEN] = "";
 	char who[256];
@@ -1615,9 +1649,8 @@
 	char dur[256];
 	char tmp[80] = "/tmp/astmail-XXXXXX";
 	char tmp2[256];
-	time_t t;
 	struct tm tm;
-	struct vm_zone *the_zone = NULL;
+
 	if (vmu && ast_strlen_zero(vmu->email)) {
 		ast_log(LOG_WARNING, "E-mail address missing for mailbox [%s].  E-mail will not be sent.\n", vmu->mailbox);
 		return(0);
@@ -1627,15 +1660,11 @@
 	ast_log(LOG_DEBUG, "Attaching file '%s', format '%s', uservm is '%d', global is %d\n", attach, format, attach_user_voicemail, ast_test_flag((&globalflags), VM_ATTACH));
 	/* Make a temporary file instead of piping directly to sendmail, in case the mail
 	   command hangs */
-	pfd = mkstemp(tmp);
-	if (pfd > -1) {
-		p = fdopen(pfd, "w");
-		if (!p) {
-			close(pfd);
-			pfd = -1;
-		}
-	}
-	if (p) {
+	p = vm_mkftemp(tmp);
+	if (p == NULL) {
+		ast_log(LOG_WARNING, "Unable to launch '%s'\n", mailcmd);
+		return -1;
+	} else {
 		gethostname(host, sizeof(host)-1);
 		if (strchr(srcemail, '@'))
 			ast_copy_string(who, srcemail, sizeof(who));
@@ -1643,27 +1672,7 @@
 			snprintf(who, sizeof(who), "%s@%s", srcemail, host);
 		}
 		snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
-		time(&t);
-
-		/* Does this user have a timezone specified? */
-		if (!ast_strlen_zero(vmu->zonetag)) {
-			/* Find the zone in the list */
-			struct vm_zone *z;
-			z = zones;
-			while (z) {
-				if (!strcmp(z->name, vmu->zonetag)) {
-					the_zone = z;
-					break;
-				}
-				z = z->next;
-			}
-		}
-
-		if (the_zone)
-			ast_localtime(&t,&tm,the_zone->timezone);
-		else
-			ast_localtime(&t,&tm,NULL);
-		strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", &tm);
+		strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm));
 		fprintf(p, "Date: %s\n", date);
 
 		/* Set date format for voicemail mail */
@@ -1758,37 +1767,25 @@
 		snprintf(tmp2, sizeof(tmp2), "( %s < %s ; rm -f %s ) &", mailcmd, tmp, tmp);
 		ast_safe_system(tmp2);
 		ast_log(LOG_DEBUG, "Sent mail to %s with command '%s'\n", vmu->email, mailcmd);
-	} else {
-		ast_log(LOG_WARNING, "Unable to launch '%s'\n", mailcmd);
-		return -1;
 	}
 	return 0;
 }
 
 static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, int duration, struct ast_vm_user *vmu)
 {
-	FILE *p=NULL;
-	int pfd;
 	char date[256];
 	char host[MAXHOSTNAMELEN]="";
 	char who[256];
 	char dur[256];
 	char tmp[80] = "/tmp/astmail-XXXXXX";
 	char tmp2[256];
-	time_t t;
 	struct tm tm;
-	struct vm_zone *the_zone = NULL;
-	pfd = mkstemp(tmp);
-
-	if (pfd > -1) {
-		p = fdopen(pfd, "w");
-		if (!p) {
-			close(pfd);
-			pfd = -1;
-		}
-	}
-
-	if (p) {
+	FILE *p = vm_mkftemp(tmp);
+
+	if (p == NULL) {
+		ast_log(LOG_WARNING, "Unable to launch '%s'\n", mailcmd);
+		return -1;
+	} else {
 		gethostname(host, sizeof(host)-1);
 		if (strchr(srcemail, '@'))
 			ast_copy_string(who, srcemail, sizeof(who));
@@ -1796,28 +1793,7 @@
 			snprintf(who, sizeof(who), "%s@%s", srcemail, host);
 		}
 		snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
-		time(&t);
-
-		/* Does this user have a timezone specified? */
-		if (!ast_strlen_zero(vmu->zonetag)) {
-			/* Find the zone in the list */
-			struct vm_zone *z;
-			z = zones;
-			while (z) {
-				if (!strcmp(z->name, vmu->zonetag)) {
-					the_zone = z;
-					break;
-				}
-				z = z->next;
-			}
-		}
-
-		if (the_zone)
-			ast_localtime(&t,&tm,the_zone->timezone);
-		else
-			ast_localtime(&t,&tm,NULL);
-
-		strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", &tm);
+		strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm));
 		fprintf(p, "Date: %s\n", date);
 
 		if (*pagerfromstring) {
@@ -1874,9 +1850,6 @@
 		snprintf(tmp2, sizeof(tmp2), "( %s < %s ; rm -f %s ) &", mailcmd, tmp, tmp);
 		ast_safe_system(tmp2);
 		ast_log(LOG_DEBUG, "Sent page to %s with command '%s'\n", pager, mailcmd);
-	} else {
-		ast_log(LOG_WARNING, "Unable to launch '%s'\n", mailcmd);
-		return -1;
 	}
 	return 0;
 }
@@ -2360,7 +2333,7 @@
 	char tmp[256] = "", *tmpptr;
 	struct ast_vm_user *vmu;
 	struct ast_vm_user svm;
-	char *category = NULL;
+	const char *category = NULL;
 
 	ast_copy_string(tmp, ext, sizeof(tmp));
 	ext = tmp;
@@ -4751,8 +4724,7 @@
 	unsigned char buf[256];
 	int bytes=0;
 
-	if (adsi_available(chan))
-	{
+	if (adsi_available(chan)) {
 		bytes += adsi_logo(buf + bytes);
 		bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Temp Greeting Menu", "");
 		bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "Not Done", "");
@@ -4760,39 +4732,37 @@
 		bytes += adsi_voice_mode(buf + bytes, 0);
 		adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
 	}
-	snprintf(prefile,sizeof(prefile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, vms->username);
-	while((cmd >= 0) && (cmd != 't')) {
+	snprintf(prefile, sizeof(prefile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, vms->username);
+	while (cmd >= 0 && cmd != 't') {
 		if (cmd)
 			retries = 0;
-		if (ast_fileexists(prefile, NULL, NULL) > 0) {
+		if (ast_fileexists(prefile, NULL, NULL) <= 0) {
+			play_record_review(chan, "vm-rec-temp", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
+			cmd = 't';	
+		} else {
 			switch (cmd) {
 			case '1':
-				cmd = play_record_review(chan,"vm-rec-temp",prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
+				cmd = play_record_review(chan, "vm-rec-temp", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
 				break;
 			case '2':
 				ast_filedelete(prefile, NULL);
-				ast_play_and_wait(chan,"vm-tempremoved");
+				ast_play_and_wait(chan, "vm-tempremoved");
 				cmd = 't';	
 				break;
 			case '*': 
 				cmd = 't';
 				break;
 			default:
-				if (ast_fileexists(prefile, NULL, NULL) > 0) {
-					cmd = ast_play_and_wait(chan,"vm-tempgreeting2");
-				} else {
-					cmd = ast_play_and_wait(chan,"vm-tempgreeting");
-				} if (!cmd) {
+				cmd = ast_play_and_wait(chan,
+					ast_fileexists(prefile, NULL, NULL) > 0 ? /* XXX always true ? */
+						"vm-tempgreeting2" : "vm-tempgreeting");
+				if (!cmd)
 					cmd = ast_waitfordigit(chan,6000);
-				} if (!cmd) {
+				if (!cmd)
 					retries++;
-				} if (retries > 3) {
+				if (retries > 3)
 					cmd = 't';
-				}
-			}
-		} else {
-			play_record_review(chan,"vm-rec-temp",prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
-			cmd = 't';	
+			}
 		}
 	}
 	if (cmd == 't')

Modified: team/bweschke/bug_5374/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/asterisk.c?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/asterisk.c (original)
+++ team/bweschke/bug_5374/asterisk.c Mon Dec 26 21:10:33 2005
@@ -670,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));
 	}
@@ -1318,7 +1320,7 @@
 			if (*t == '%') {
 				char hostname[MAXHOSTNAMELEN]="";
 				int i;
-				struct timeval tv;
+				time_t ts;
 				struct tm tm;
 #ifdef linux
 				FILE *LOADAVG;
@@ -1346,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;
@@ -1403,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;

Modified: team/bweschke/bug_5374/cdr/cdr_tds.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/cdr/cdr_tds.c?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/cdr/cdr_tds.c (original)
+++ team/bweschke/bug_5374/cdr/cdr_tds.c Mon Dec 26 21:10:33 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/bweschke/bug_5374/channel.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/channel.c?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/channel.c (original)
+++ team/bweschke/bug_5374/channel.c Mon Dec 26 21:10:33 2005
@@ -170,19 +170,18 @@
 static int show_channeltypes(int fd, int argc, char *argv[])
 {
 #define FORMAT  "%-10.10s  %-30.30s %-12.12s %-12.12s %-12.12s\n"
-	struct chanlist *cl = backends;
+	struct chanlist *cl;
 	ast_cli(fd, FORMAT, "Type", "Description",       "Devicestate", "Indications", "Transfer");
 	ast_cli(fd, FORMAT, "----------", "-----------", "-----------", "-----------", "--------");
 	if (ast_mutex_lock(&chlock)) {
 		ast_log(LOG_WARNING, "Unable to lock channel list\n");
 		return -1;
 	}
-	while (cl) {
+	for (cl = backends; cl; cl = cl->next) {
 		ast_cli(fd, FORMAT, cl->tech->type, cl->tech->description, 
 			(cl->tech->devicestate) ? "yes" : "no", 
 			(cl->tech->indicate) ? "yes" : "no",
 			(cl->tech->transfer) ? "yes" : "no");
-		cl = cl->next;
 	}
 	ast_mutex_unlock(&chlock);
 	return RESULT_SUCCESS;
@@ -236,11 +235,8 @@
 	shutting_down = 1;
 	if (hangup) {
 		ast_mutex_lock(&chlock);
-		c = channels;
-		while(c) {
+		for (c = channels; c; c = c->next)
 			ast_softhangup(c, AST_SOFTHANGUP_SHUTDOWN);
-			c = c->next;
-		}
 		ast_mutex_unlock(&chlock);
 	}
 }
@@ -251,11 +247,8 @@
 	struct ast_channel *c;
 	int cnt = 0;
 	ast_mutex_lock(&chlock);
-	c = channels;
-	while(c) {
+	for (c = channels; c; c = c->next)
 		cnt++;
-		c = c->next;
-	}
 	ast_mutex_unlock(&chlock);
 	return cnt;
 }
@@ -319,14 +312,12 @@
 
 	ast_mutex_lock(&chlock);
 
-	chan = backends;
-	while (chan) {
+	for (chan = backends; chan; chan = chan->next) {
 		if (!strcasecmp(tech->type, chan->tech->type)) {
 			ast_log(LOG_WARNING, "Already have a handler for type '%s'\n", tech->type);
 			ast_mutex_unlock(&chlock);
 			return -1;
 		}
-		chan = chan->next;
 	}
 
 	chan = malloc(sizeof(*chan));
@@ -359,8 +350,7 @@
 
 	ast_mutex_lock(&chlock);
 
-	chan = backends;
-	while (chan) {
+	for (chan = backends; chan; chan = chan->next) {
 		if (chan->tech == tech) {
 			if (last)
 				last->next = chan->next;
@@ -375,7 +365,6 @@
 			return;
 		}
 		last = chan;
-		chan = chan->next;
 	}
 
 	ast_mutex_unlock(&chlock);
@@ -620,8 +609,7 @@
 	}
 	ast_mutex_lock(&chan->lock);
 	prev = NULL;
-	cur = chan->readq;
-	while(cur) {
+	for (cur = chan->readq; cur; cur = cur->next) {
 		if ((cur->frametype == AST_FRAME_CONTROL) && (cur->subclass == AST_CONTROL_HANGUP)) {
 			/* Don't bother actually queueing anything after a hangup */
 			ast_frfree(f);
@@ -629,7 +617,6 @@
 			return 0;
 		}
 		prev = cur;
-		cur = cur->next;
 		qlen++;
 	}
 	/* Allow up to 96 voice frames outstanding, and up to 128 total frames */
@@ -884,8 +871,7 @@
 	headp=&chan->varshead;
 	
 	ast_mutex_lock(&chlock);
-	cur = channels;
-	while(cur) {
+	for (cur = channels; cur; cur = cur->next) {
 		if (cur == chan) {
 			if (last)
 				last->next = cur->next;
@@ -894,7 +880,6 @@
 			break;
 		}
 		last = cur;
-		cur = cur->next;
 	}
 	if (!cur)
 		ast_log(LOG_WARNING, "Unable to find channel in list\n");
@@ -2931,12 +2916,10 @@
 	/* Save any pending frames on both sides.  Start by counting
 	 * how many we're going to need... */
 	prev = NULL;
-	cur = clone->readq;
 	x = 0;
-	while(cur) {
+	for (cur = clone->readq; cur; cur = cur->next) {
 		x++;
 		prev = cur;
-		cur = cur->next;
 	}
 	/* If we had any, prepend them to the ones already in the queue, and 
 	 * load up the alertpipe */
@@ -3159,10 +3142,10 @@
 
 static void bridge_playfile(struct ast_channel *chan, struct ast_channel *peer, const char *sound, int remain) 
 {
-	int res=0, min=0, sec=0,check=0;
+	int min = 0, sec = 0, check;
 
 	check = ast_autoservice_start(peer);
-	if(check) 
+	if (check) 
 		return;
 
 	if (remain > 0) {
@@ -3175,21 +3158,21 @@
 	}
 	
 	if (!strcmp(sound,"timeleft")) {	/* Queue support */
-		res = ast_streamfile(chan, "vm-youhave", chan->language);
-		res = ast_waitstream(chan, "");
+		ast_streamfile(chan, "vm-youhave", chan->language);
+		ast_waitstream(chan, "");
 		if (min) {
-			res = ast_say_number(chan, min, AST_DIGIT_ANY, chan->language, (char *) NULL);
-			res = ast_streamfile(chan, "queue-minutes", chan->language);
-			res = ast_waitstream(chan, "");
+			ast_say_number(chan, min, AST_DIGIT_ANY, chan->language, (char *) NULL);
+			ast_streamfile(chan, "queue-minutes", chan->language);
+			ast_waitstream(chan, "");
 		}
 		if (sec) {
-			res = ast_say_number(chan, sec, AST_DIGIT_ANY, chan->language, (char *) NULL);
-			res = ast_streamfile(chan, "queue-seconds", chan->language);
-			res = ast_waitstream(chan, "");
+			ast_say_number(chan, sec, AST_DIGIT_ANY, chan->language, (char *) NULL);
+			ast_streamfile(chan, "queue-seconds", chan->language);
+			ast_waitstream(chan, "");
 		}
 	} else {
-		res = ast_streamfile(chan, sound, chan->language);
-		res = ast_waitstream(chan, "");
+		ast_streamfile(chan, sound, chan->language);
+		ast_waitstream(chan, "");
 	}
 
 	check = ast_autoservice_stop(peer);
@@ -3581,10 +3564,9 @@
 	struct tonepair_state *ts;
 	struct tonepair_def *td = params;
 
-	ts = malloc(sizeof(struct tonepair_state));
+	ts = calloc(1, sizeof(struct tonepair_state));
 	if (!ts)
 		return NULL;
-	memset(ts, 0, sizeof(struct tonepair_state));
 	ts->origwfmt = chan->writeformat;
 	if (ast_set_write_format(chan, AST_FORMAT_SLINEAR)) {
 		ast_log(LOG_WARNING, "Unable to set '%s' to signed linear format (write)\n", chan->name);
@@ -3673,7 +3655,7 @@
 		return res;
 
 	/* Give us some wiggle room */
-	while(chan->generatordata && (ast_waitfor(chan, 100) >= 0)) {
+	while (chan->generatordata && (ast_waitfor(chan, 100) >= 0)) {
 		f = ast_read(chan);
 		if (f)
 			ast_frfree(f);
@@ -3698,7 +3680,7 @@
 	}
 	c = copy;
 	
-	while((piece = strsep(&c, ","))) {
+	while ((piece = strsep(&c, ","))) {
 		if (sscanf(piece, "%d-%d", &start, &finish) == 2) {
 			/* Range */
 		} else if (sscanf(piece, "%d", &start)) {
@@ -3755,14 +3737,14 @@
 /*! Turn off music on hold on a given channel */
 void ast_moh_stop(struct ast_channel *chan) 
 {
-	if(ast_moh_stop_ptr)
+	if (ast_moh_stop_ptr)
 		ast_moh_stop_ptr(chan);
 }
 
 void ast_moh_cleanup(struct ast_channel *chan) 
 {
-	if(ast_moh_cleanup_ptr)
-        ast_moh_cleanup_ptr(chan);
+	if (ast_moh_cleanup_ptr)
+		ast_moh_cleanup_ptr(chan);
 }
 
 void ast_channels_init(void)
@@ -3780,9 +3762,9 @@
 	buf[0] = '\0';
 	
 	if (!group)	/* Return empty string if no group */
-		return(buf);
-
-	for (i=0; i<=63; i++) {	/* Max group is 63 */
+		return buf;
+
+	for (i = 0; i <= 63; i++) {	/* Max group is 63 */
 		if (group & ((ast_group_t) 1 << i)) {
 	   		if (!first) {
 				strncat(buf, ", ", buflen);
@@ -3793,7 +3775,7 @@
 			strncat(buf, num, buflen);
 		}
 	}
-	return(buf);
+	return buf;
 }
 
 void ast_set_variables(struct ast_channel *chan, struct ast_variable *vars)

Modified: team/bweschke/bug_5374/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/channels/chan_agent.c?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/channels/chan_agent.c (original)
+++ team/bweschke/bug_5374/channels/chan_agent.c Mon Dec 26 21:10:33 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/bweschke/bug_5374/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/channels/chan_iax2.c?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/channels/chan_iax2.c (original)
+++ team/bweschke/bug_5374/channels/chan_iax2.c Mon Dec 26 21:10:33 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/bweschke/bug_5374/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/channels/chan_sip.c?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/channels/chan_sip.c (original)
+++ team/bweschke/bug_5374/channels/chan_sip.c Mon Dec 26 21:10:33 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));
 	}
@@ -12059,7 +12059,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));
@@ -12222,7 +12222,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/bweschke/bug_5374/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/channels/chan_zap.c?rev=7645&r1=7644&r2=7645&view=diff
==============================================================================
--- team/bweschke/bug_5374/channels/chan_zap.c (original)
+++ team/bweschke/bug_5374/channels/chan_zap.c Mon Dec 26 21:10:33 2005
@@ -133,7 +133,7 @@
 #define AST_LAW(p) (((p)->law == ZT_LAW_ALAW) ? AST_FORMAT_ALAW : AST_FORMAT_ULAW)
 
 /*! \brief Signaling types that need to use MF detection should be placed in this macro */
-#define NEED_MFDETECT(p) (((p)->sig == SIG_FEATDMF) || ((p)->sig == SIG_FEATDMF_TA) || ((p)->sig == SIG_E911) || ((p)->sig == SIG_FEATB)) 
+#define NEED_MFDETECT(p) (((p)->sig == SIG_FEATDMF) || ((p)->sig == SIG_FEATDMF_TA) || ((p)->sig == SIG_E911) || ((p)->sig == SIG_FGC_CAMA) || ((p)->sig == SIG_FGC_CAMAMF) || ((p)->sig == SIG_FEATB)) 
 
 static const char desc[] = "Zapata Telephony"
 #ifdef ZAPATA_PRI
@@ -163,6 +163,8 @@
 #define	SIG_FEATB	(0x0800000 | ZT_SIG_EM)
 #define	SIG_E911	(0x1000000 | ZT_SIG_EM)
 #define	SIG_FEATDMF_TA	(0x2000000 | ZT_SIG_EM)
+#define	SIG_FGC_CAMA	(0x4000000 | ZT_SIG_EM)
+#define	SIG_FGC_CAMAMF	(0x8000000 | ZT_SIG_EM)
 #define SIG_FXSLS	ZT_SIG_FXSLS
 #define SIG_FXSGS	ZT_SIG_FXSGS
 #define SIG_FXSKS	ZT_SIG_FXSKS
@@ -1148,6 +1150,10 @@

[... 5143 lines stripped ...]


More information about the asterisk-commits mailing list