[Freeswitch-svn] [commit] r9377 - freeswitch/trunk/src/mod/applications/mod_voicemail

Freeswitch SVN mikej at freeswitch.org
Thu Aug 28 01:17:03 EDT 2008


Author: mikej
Date: Thu Aug 28 01:17:02 2008
New Revision: 9377

Modified:
   freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c

Log:
Pfix voicemail created email date (int overflow) from MODAPP-125

Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	Thu Aug 28 01:17:02 2008
@@ -1212,7 +1212,7 @@
 					int total_saved_urgent_messages = 0;
 					int32_t message_len = 0;
 					char *p;
-					long l_duration = 0;
+					switch_time_t l_duration = 0;
 					switch_core_time_duration_t duration;
 					char duration_str[80];
 
@@ -1223,7 +1223,7 @@
 					message_count(profile, cbt->user, cbt->domain, cbt->in_folder, &total_new_messages, &total_saved_messages,
 								  &total_new_urgent_messages, &total_saved_urgent_messages);
 
-					switch_time_exp_lt(&tm, atoi(cbt->created_epoch) * 1000000);
+					switch_time_exp_lt(&tm, switch_time_make (atol(cbt->created_epoch), 0));
 					switch_strftime(date, &retsize, sizeof(date), profile->date_fmt, &tm);
 
 					switch_snprintf(tmp, sizeof(tmp), "%d", total_new_messages);
@@ -1246,7 +1246,7 @@
 					switch_channel_set_variable(channel, "voicemail_priority", tmp);
 					message_len = atoi(cbt->message_len);
 
-					l_duration = atol(cbt->message_len) * 1000000;
+					l_duration = switch_time_make (atol(cbt->message_len), 0);
 					switch_core_measure_time(l_duration, &duration);
 					duration.day += duration.yr * 365;
 					duration.hr += duration.day * 24;
@@ -1961,7 +1961,7 @@
 		int total_new_urgent_messages = 0;
 		int total_saved_urgent_messages = 0;
 		char *p;
-		long l_duration = 0;
+		switch_time_t l_duration = 0;
 		switch_core_time_duration_t duration;
 		char duration_str[80];
 		switch_time_exp_t tm;
@@ -1998,7 +1998,7 @@
 		if (vm_notify_email) {
 			switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_notify_email", vm_notify_email);
 		}
-		l_duration = (long) message_len *1000000;
+		l_duration = switch_time_make (message_len, 0);
 		switch_core_measure_time(l_duration, &duration);
 		duration.day += duration.yr * 365;
 		duration.hr += duration.day * 24;
@@ -2865,7 +2865,7 @@
 	switch_size_t retsize;
 	switch_time_t l_created = 0;
 	switch_time_t l_read = 0;
-	long l_duration = 0;
+	switch_time_t l_duration = 0;
 	switch_core_time_duration_t duration;
 	char duration_str[80];
 	const char *fmt = "%a, %e %b %Y %T %z";
@@ -2882,7 +2882,7 @@
 	}
 
 	if (argc > 9) {
-		l_duration = atol(argv[9]) * 1000000;
+		l_duration = switch_time_make (atol(argv[9]), 0);
 	}
 
 	if ((fname = strrchr(argv[8], '/'))) {
@@ -2957,7 +2957,7 @@
 	switch_file_t *fd;
 	switch_time_t l_created = 0;
 	switch_time_t l_read = 0;
-	long l_duration = 0;
+	switch_time_t l_duration = 0;
 	switch_core_time_duration_t duration;
 	char duration_str[80];
 	const char *fmt = "%a, %e %b %Y %T %z";
@@ -2972,7 +2972,7 @@
 	}
 
 	if (argc > 9) {
-		l_duration = atol(argv[9]) * 1000000;
+		l_duration = switch_time_make (atol(argv[9]), 0);
 	}
 
 	switch_core_measure_time(l_duration, &duration);



More information about the Freeswitch-svn mailing list