[asterisk-commits] oej: branch oej/invitestate r48124 - in /team/oej/invitestate: ./ apps/ chann...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Nov 30 00:55:34 MST 2006


Author: oej
Date: Thu Nov 30 01:55:34 2006
New Revision: 48124

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48124
Log:
Update to trunk 1.2

Modified:
    team/oej/invitestate/   (props changed)
    team/oej/invitestate/apps/app_voicemail.c
    team/oej/invitestate/channels/chan_phone.c
    team/oej/invitestate/pbx/pbx_spool.c
    team/oej/invitestate/res/res_musiconhold.c
    team/oej/invitestate/rtp.c

Propchange: team/oej/invitestate/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Nov 30 01:55:34 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-48006
+/branches/1.2:1-48123

Modified: team/oej/invitestate/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/apps/app_voicemail.c?view=diff&rev=48124&r1=48123&r2=48124
==============================================================================
--- team/oej/invitestate/apps/app_voicemail.c (original)
+++ team/oej/invitestate/apps/app_voicemail.c Thu Nov 30 01:55:34 2006
@@ -5768,22 +5768,13 @@
 			}
 		}
 		while (vmu) {
-			char dirname[256];
-			DIR *vmdir;
-			struct dirent *vment;
-			int vmcount = 0;
-			char count[12];
+			int newmsgs = 0, oldmsgs = 0;
+			char count[12], tmp[256] = "";
 
 			if ((argc == 3) || ((argc == 5) && !strcmp(argv[4],vmu->context))) {
-				make_dir(dirname, 255, vmu->context, vmu->mailbox, "INBOX");
-				if ((vmdir = opendir(dirname))) {
-					/* No matter what the format of VM, there will always be a .txt file for each message. */
-					while ((vment = readdir(vmdir)))
-						if (strlen(vment->d_name) > 7 && !strncmp(vment->d_name + 7,".txt",4))
-							vmcount++;
-					closedir(vmdir);
-				}
-				snprintf(count,sizeof(count),"%d",vmcount);
+				snprintf(tmp, sizeof(tmp), "%s@%s", vmu->mailbox, ast_strlen_zero(vmu->context) ? "default" : vmu->context);
+				messagecount(tmp, &newmsgs, &oldmsgs);
+				snprintf(count,sizeof(count),"%d",newmsgs);
 				ast_cli(fd, output_format, vmu->context, vmu->mailbox, vmu->fullname, vmu->zonetag, count);
 			}
 			vmu = vmu->next;

Modified: team/oej/invitestate/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/channels/chan_phone.c?view=diff&rev=48124&r1=48123&r2=48124
==============================================================================
--- team/oej/invitestate/channels/chan_phone.c (original)
+++ team/oej/invitestate/channels/chan_phone.c Thu Nov 30 01:55:34 2006
@@ -37,11 +37,6 @@
 #include <linux/telephony.h>
 /* Still use some IXJ specific stuff */
 #include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
-# include <linux/compiler.h>
-#endif
-#endif
 #include <linux/ixjuser.h>
 
 #include "asterisk.h"

Modified: team/oej/invitestate/pbx/pbx_spool.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/pbx/pbx_spool.c?view=diff&rev=48124&r1=48123&r2=48124
==============================================================================
--- team/oej/invitestate/pbx/pbx_spool.c (original)
+++ team/oej/invitestate/pbx/pbx_spool.c Thu Nov 30 01:55:34 2006
@@ -315,8 +315,8 @@
 					now += o->retrytime;
 					if (o->callingpid && (o->callingpid == ast_mainpid)) {
 						safe_append(o, time(NULL), "DelayedRetry");
+						ast_log(LOG_DEBUG, "Delaying retry since we're currently running '%s'\n", o->fn);
 						free_outgoing(o);
-						ast_log(LOG_DEBUG, "Delaying retry since we're currently running '%s'\n", o->fn);
 					} else {
 						/* Increment retries */
 						o->retries++;

Modified: team/oej/invitestate/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/res/res_musiconhold.c?view=diff&rev=48124&r1=48123&r2=48124
==============================================================================
--- team/oej/invitestate/res/res_musiconhold.c (original)
+++ team/oej/invitestate/res/res_musiconhold.c Thu Nov 30 01:55:34 2006
@@ -190,7 +190,7 @@
 		if (state->origwfmt && ast_set_write_format(chan, state->origwfmt)) {
 			ast_log(LOG_WARNING, "Unable to restore channel '%s' to format '%d'\n", chan->name, state->origwfmt);
 		}
-		state->save_pos = state->pos + 1;
+		state->save_pos = state->pos;
 	}
 }
 
@@ -201,32 +201,29 @@
 	int tries;
 
 	if (state->save_pos) {
-		state->pos = state->save_pos - 1;
+		state->pos = state->save_pos;
 		state->save_pos = 0;
-	} else {
+	}
+
+	state->samples = 0;
+	if (chan->stream) {
+		ast_closestream(chan->stream);
+		chan->stream = NULL;
+		state->pos++;
+		state->pos %= state->class->total_files;
+	}
+
+	if (ast_test_flag(state->class, MOH_RANDOMIZE)) {
 		/* Try 20 times to find something good */
-		for (tries=0;tries < 20;tries++) {
-			state->samples = 0;
-			if (chan->stream) {
-				ast_closestream(chan->stream);
-				chan->stream = NULL;
-				state->pos++;
-			}
-
-			if (ast_test_flag(state->class, MOH_RANDOMIZE))
-				state->pos = rand();
-
-			state->pos %= state->class->total_files;
+		for (tries = 0; tries < 20; tries++) {
+			state->pos = rand() % state->class->total_files;
 
 			/* check to see if this file's format can be opened */
 			if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) > 0)
 				break;
-
-		}
-	}
-
-	state->pos = state->pos % state->class->total_files;
-	
+		}
+	}
+
 	if (!ast_openstream_full(chan, state->class->filearray[state->pos], chan->language, 1)) {
 		ast_log(LOG_WARNING, "Unable to open file '%s': %s\n", state->class->filearray[state->pos], strerror(errno));
 		state->pos++;

Modified: team/oej/invitestate/rtp.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/rtp.c?view=diff&rev=48124&r1=48123&r2=48124
==============================================================================
--- team/oej/invitestate/rtp.c (original)
+++ team/oej/invitestate/rtp.c Thu Nov 30 01:55:34 2006
@@ -1463,6 +1463,8 @@
 			f = _f;
 		}
 		ast_rtp_raw_write(rtp, f, codec);
+		if (f != _f)
+			ast_frfree(f);
 	}
 		
 	return 0;



More information about the asterisk-commits mailing list