[asterisk-commits] branch oej/managerstuff r34064 - in /team/oej/managerstuff: ./ apps/ channels...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Jun 14 04:30:17 MST 2006


Author: oej
Date: Wed Jun 14 06:30:17 2006
New Revision: 34064

URL: http://svn.digium.com/view/asterisk?rev=34064&view=rev
Log:
Reset automerge

Modified:
    team/oej/managerstuff/   (props changed)
    team/oej/managerstuff/apps/app_alarmreceiver.c
    team/oej/managerstuff/apps/app_dial.c
    team/oej/managerstuff/apps/app_festival.c
    team/oej/managerstuff/apps/app_ices.c
    team/oej/managerstuff/apps/app_meetme.c
    team/oej/managerstuff/apps/app_mixmonitor.c
    team/oej/managerstuff/apps/app_queue.c
    team/oej/managerstuff/apps/app_test.c
    team/oej/managerstuff/apps/app_url.c
    team/oej/managerstuff/apps/app_voicemail.c
    team/oej/managerstuff/apps/app_zapbarge.c
    team/oej/managerstuff/apps/app_zapscan.c
    team/oej/managerstuff/asterisk.c
    team/oej/managerstuff/callerid.c
    team/oej/managerstuff/channel.c
    team/oej/managerstuff/channels/chan_iax2.c
    team/oej/managerstuff/channels/chan_local.c
    team/oej/managerstuff/channels/chan_sip.c
    team/oej/managerstuff/file.c
    team/oej/managerstuff/frame.c
    team/oej/managerstuff/include/asterisk/channel.h
    team/oej/managerstuff/include/asterisk/chanspy.h
    team/oej/managerstuff/include/asterisk/linkedlists.h
    team/oej/managerstuff/pbx.c
    team/oej/managerstuff/res/res_agi.c
    team/oej/managerstuff/res/res_musiconhold.c

Propchange: team/oej/managerstuff/
------------------------------------------------------------------------------
    automerge = http://edvina.net/training/

Propchange: team/oej/managerstuff/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jun 14 06:30:17 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-7496,7498-31354
+/branches/1.2:1-7496,7498-34063

Modified: team/oej/managerstuff/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/apps/app_alarmreceiver.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/apps/app_alarmreceiver.c (original)
+++ team/oej/managerstuff/apps/app_alarmreceiver.c Wed Jun 14 06:30:17 2006
@@ -215,6 +215,7 @@
 
 			i += wf.datalen / 8;
 			if (i > duration) {
+				ast_frfree(f);
 				break;
 			}
 			if (ast_write(chan, &wf)){
@@ -222,6 +223,7 @@
 					ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Failed to write frame on %s\n", chan->name);
 				ast_log(LOG_WARNING, "AlarmReceiver Failed to write frame on %s\n",chan->name);
 				res = -1;
+				ast_frfree(f);
 				break;
 			}
 		}

Modified: team/oej/managerstuff/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/apps/app_dial.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/apps/app_dial.c (original)
+++ team/oej/managerstuff/apps/app_dial.c Wed Jun 14 06:30:17 2006
@@ -987,9 +987,18 @@
 				   "At the tone, please say your name:"
 
 				*/
-				ast_play_and_record(chan, "priv-recordintro", privintro, 4, "gsm", &duration, 128, 2000, 0);  /* NOTE: I've reduced the total time to 4 sec */
-															/* don't think we'll need a lock removed, we took care of
-															   conflicts by naming the privintro file */
+				res = ast_play_and_record(chan, "priv-recordintro", privintro, 4, "gsm", &duration, 128, 2000, 0);  /* NOTE: I've reduced the total time to */
+															/* 4 sec don't think we'll need a lock removed, we 
+															   took care of conflicts by naming the privintro file */
+				if (res == -1) {
+					/* Delete the file regardless since they hung up during recording */
+                                        ast_filedelete(privintro, NULL);
+                                        if( ast_fileexists(privintro,NULL,NULL ) > 0 )
+                                                ast_log(LOG_NOTICE,"privacy: ast_filedelete didn't do its job on %s\n", privintro);
+                                        else if (option_verbose > 2)
+                                                ast_verbose( VERBOSE_PREFIX_3 "Successfully deleted %s intro file\n", privintro);
+					goto out;
+				}
 			}
 		}
 	}
@@ -1266,18 +1275,18 @@
 					do {
 						if (!res2)
 							res2 = ast_play_and_wait(peer,"priv-callpending");
-						if( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
+						if ( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
 							res2 = 0;
 						
 						/* priv-callpending script: 
 						   "I have a caller waiting, who introduces themselves as:"
 						*/
 						if (!res2)
-							res2 = ast_play_and_wait(peer,privintro);
-						if( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
+							res2 = ast_play_and_wait(peer, privintro);
+						if ( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
 							res2 = 0;
 						/* now get input from the called party, as to their choice */
-						if( !res2 ) {
+						if (!res2) {
 							if( ast_test_flag(&opts, OPT_PRIVACY) )
 								res2 = ast_play_and_wait(peer,"priv-callee-options");
 							if( ast_test_flag(&opts, OPT_SCREENING) )

Modified: team/oej/managerstuff/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/apps/app_festival.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/apps/app_festival.c (original)
+++ team/oej/managerstuff/apps/app_festival.c Wed Jun 14 06:30:17 2006
@@ -236,11 +236,13 @@
 					myf.f.data = myf.frdata;
 					if (ast_write(chan, &myf.f) < 0) {
 						res = -1;
+						ast_frfree(f);
 						break;
 					}
 					if (res < needed) { /* last frame */
 						ast_log(LOG_DEBUG, "Last frame\n");
 						res=0;
+						ast_frfree(f);
 						break;
 					}
 				} else {
@@ -472,6 +474,9 @@
                        if ( read_data == -1 )
                        {
                                ast_log(LOG_WARNING,"Unable to read from cache/festival fd");
+			       close(fd);
+			       ast_config_destroy(cfg);
+			       LOCAL_USER_REMOVE(u);
                                return -1;
                        }
                        n += read_data;

Modified: team/oej/managerstuff/apps/app_ices.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/apps/app_ices.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/apps/app_ices.c (original)
+++ team/oej/managerstuff/apps/app_ices.c Wed Jun 14 06:30:17 2006
@@ -177,6 +177,7 @@
 					if (errno != EAGAIN) {
 						ast_log(LOG_WARNING, "Write failed to pipe: %s\n", strerror(errno));
 						res = -1;
+						ast_frfree(f);
 						break;
 					}
 				}

Modified: team/oej/managerstuff/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/apps/app_meetme.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/apps/app_meetme.c (original)
+++ team/oej/managerstuff/apps/app_meetme.c Wed Jun 14 06:30:17 2006
@@ -29,6 +29,10 @@
 	<depend>zaptel</depend>
  ***/
 
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -40,10 +44,6 @@
 #else
 #include <zaptel.h>
 #endif /* __linux__ */
-
-#include "asterisk.h"
-
-ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #include "asterisk/lock.h"
 #include "asterisk/file.h"
@@ -1440,16 +1440,19 @@
 					if (!ast_goto_if_exists(chan, exitcontext, tmp, 1)) {
 						ast_log(LOG_DEBUG, "Got DTMF %c, goto context %s\n", tmp[0], exitcontext);
 						ret = 0;
+						ast_frfree(f);
 						break;
 					} else if (option_debug > 1)
 						ast_log(LOG_DEBUG, "Exit by single digit did not work in meetme. Extension %s does not exist in context %s\n", tmp, exitcontext);
 				} else if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#') && (confflags & CONFFLAG_POUNDEXIT)) {
 					ret = 0;
+					ast_frfree(f);
 					break;
 				} else if (((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*') && (confflags & CONFFLAG_STARMENU)) || ((f->frametype == AST_FRAME_DTMF) && menu_active)) {
 					if (ioctl(fd, ZT_SETCONF, &ztc_empty)) {
 						ast_log(LOG_WARNING, "Error setting conference\n");
 						close(fd);
+						ast_frfree(f);
 						goto outrun;
 					}
 
@@ -1595,7 +1598,7 @@
 					if (ioctl(fd, ZT_SETCONF, &ztc)) {
 						ast_log(LOG_WARNING, "Error setting conference\n");
 						close(fd);
-						AST_LIST_UNLOCK(&confs);
+						ast_frfree(f);
 						goto outrun;
 					}
 
@@ -2312,7 +2315,7 @@
 				if (user)
 					user->adminflags |= ADMINFLAG_KICKME;
 				else
-					ast_log(LOG_NOTICE, "Specified User not found!");
+					ast_log(LOG_NOTICE, "Specified User not found!\n");
 				break;
 			case 118: /* v: Lower all users listen volume */
 				AST_LIST_TRAVERSE(&cnf->userlist, user, list)
@@ -2338,31 +2341,31 @@
 				if (user)
 					reset_volumes(user);
 				else
-					ast_log(LOG_NOTICE, "Specified User not found!");
+					ast_log(LOG_NOTICE, "Specified User not found!\n");
 				break;
 			case 85: /* U: Raise user's listen volume */
 				if (user)
 					tweak_listen_volume(user, VOL_UP);
 				else
-					ast_log(LOG_NOTICE, "Specified User not found!");
+					ast_log(LOG_NOTICE, "Specified User not found!\n");
 				break;
 			case 117: /* u: Lower user's listen volume */
 				if (user)
 					tweak_listen_volume(user, VOL_DOWN);
 				else
-					ast_log(LOG_NOTICE, "Specified User not found!");
+					ast_log(LOG_NOTICE, "Specified User not found!\n");
 				break;
 			case 84: /* T: Raise user's talk volume */
 				if (user)
 					tweak_talk_volume(user, VOL_UP);
 				else
-					ast_log(LOG_NOTICE, "Specified User not found!");
+					ast_log(LOG_NOTICE, "Specified User not found!\n");
 				break;
 			case 116: /* t: Lower user's talk volume */
 				if (user) 
 					tweak_talk_volume(user, VOL_DOWN);
 				else 
-					ast_log(LOG_NOTICE, "Specified User not found!");
+					ast_log(LOG_NOTICE, "Specified User not found!\n");
 				break;
 			}
 		} else {
@@ -2384,12 +2387,12 @@
 	char *userid = astman_get_header(m, "Usernum");
 	int userno;
 
-	if (!confid || ast_strlen_zero(confid)) {
+	if (ast_strlen_zero(confid)) {
 		astman_send_error(s, m, "Meetme conference not specified");
 		return 0;
 	}
 
-	if (!userid || ast_strlen_zero(userid)) {
+	if (ast_strlen_zero(userid)) {
 		astman_send_error(s, m, "Meetme user number not specified");
 		return 0;
 	}

Modified: team/oej/managerstuff/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/apps/app_mixmonitor.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/apps/app_mixmonitor.c (original)
+++ team/oej/managerstuff/apps/app_mixmonitor.c Wed Jun 14 06:30:17 2006
@@ -86,12 +86,11 @@
 static const char *mixmonitor_spy_type = "MixMonitor";
 
 struct mixmonitor {
-	struct ast_channel *chan;
-	char *filename;
+	struct ast_channel_spy spy;
+	struct ast_filestream *fs;
 	char *post_process;
+	char *name;
 	unsigned int flags;
-	int readvol;
-	int writevol;
 };
 
 enum {
@@ -117,13 +116,15 @@
 	AST_APP_OPTION_ARG('W', MUXFLAG_VOLUME, OPT_ARG_VOLUME),
 });
 
-static void stopmon(struct ast_channel *chan, struct ast_channel_spy *spy) 
-{
+static void stopmon(struct ast_channel_spy *spy) 
+{
+	struct ast_channel *chan = spy->chan;
+
 	/* 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_DONE)
 		return;
-
+  
 	if (!chan)
 		return;
 
@@ -143,7 +144,7 @@
 	ast_mutex_lock(&chan->lock);
 	res = ast_channel_spy_add(chan, spy);
 	ast_mutex_unlock(&chan->lock);
-		
+
 	if (!res && ast_test_flag(chan, AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(chan)))
 		ast_softhangup(peer, AST_SOFTHANGUP_UNBRIDGE);	
 
@@ -155,91 +156,31 @@
 static void *mixmonitor_thread(void *obj) 
 {
 	struct mixmonitor *mixmonitor = obj;
-	struct ast_channel_spy spy;
-	struct ast_filestream *fs = NULL;
-	char *ext, *name;
-	unsigned int oflags;
-	struct ast_frame *f;
-	char post_process[1024] = "";
+	struct ast_frame *f = NULL;
 	
 	STANDARD_INCREMENT_USECOUNT;
-
-	name = ast_strdupa(mixmonitor->chan->name);
-
-	oflags = O_CREAT|O_WRONLY;
-	oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;
-		
-	if ((ext = strrchr(mixmonitor->filename, '.'))) {
-		*(ext++) = '\0';
-	} else {
-		ext = "raw";
-	}
-
-	fs = ast_writefile(mixmonitor->filename, ext, NULL, oflags, 0, 0644);
-	if (!fs) {
-		ast_log(LOG_ERROR, "Cannot open %s.%s\n", mixmonitor->filename, ext);
-		goto out;
-	}
-
-	if (ast_test_flag(mixmonitor, MUXFLAG_APPEND))
-		ast_seekstream(fs, 0, SEEK_END);
-	
-	memset(&spy, 0, sizeof(spy));
-	ast_set_flag(&spy, CHANSPY_FORMAT_AUDIO);
-	ast_set_flag(&spy, CHANSPY_MIXAUDIO);
-	spy.type = mixmonitor_spy_type;
-	spy.status = CHANSPY_RUNNING;
-	spy.read_queue.format = AST_FORMAT_SLINEAR;
-	spy.write_queue.format = AST_FORMAT_SLINEAR;
-	if (mixmonitor->readvol) {
-		ast_set_flag(&spy, CHANSPY_READ_VOLADJUST);
-		spy.read_vol_adjustment = mixmonitor->readvol;
-	}
-	if (mixmonitor->writevol) {
-		ast_set_flag(&spy, CHANSPY_WRITE_VOLADJUST);
-		spy.write_vol_adjustment = mixmonitor->writevol;
-	}
-	ast_mutex_init(&spy.lock);
-
-	if (startmon(mixmonitor->chan, &spy)) {
-		ast_log(LOG_WARNING, "Unable to add '%s' spy to channel '%s'\n",
-			spy.type, mixmonitor->chan->name);
-		goto out2;
-	}
-
+	
 	if (option_verbose > 1)
-		ast_verbose(VERBOSE_PREFIX_2 "Begin MixMonitor Recording %s\n", name);
-	
-	if (mixmonitor->post_process) {
-		char *p;
-
-		for (p = mixmonitor->post_process; *p ; p++) {
-			if (*p == '^' && *(p+1) == '{') {
-				*p = '$';
-			}
-		}
-		pbx_substitute_variables_helper(mixmonitor->chan, mixmonitor->post_process, post_process, sizeof(post_process) - 1);
-	}
-
-	while (1) {
+		ast_verbose(VERBOSE_PREFIX_2 "Begin MixMonitor Recording %s\n", mixmonitor->name);
+	
+	ast_mutex_lock(&mixmonitor->spy.lock);
+
+	while (mixmonitor->spy.chan) {
 		struct ast_frame *next;
 		int write;
 
-		ast_mutex_lock(&spy.lock);
-
-		ast_channel_spy_trigger_wait(&spy);
+		ast_channel_spy_trigger_wait(&mixmonitor->spy);
 		
-		if (ast_check_hangup(mixmonitor->chan) || spy.status != CHANSPY_RUNNING) {
-			ast_mutex_unlock(&spy.lock);
+		if (!mixmonitor->spy.chan || mixmonitor->spy.status != CHANSPY_RUNNING) {
 			break;
 		}
 		
 		while (1) {
-			if (!(f = ast_channel_spy_read_frame(&spy, SAMPLES_PER_FRAME)))
+			if (!(f = ast_channel_spy_read_frame(&mixmonitor->spy, SAMPLES_PER_FRAME)))
 				break;
 
 			write = (!ast_test_flag(mixmonitor, MUXFLAG_BRIDGED) ||
-				 ast_bridged_channel(mixmonitor->chan));
+				 ast_bridged_channel(mixmonitor->spy.chan));
 
 			/* it is possible for ast_channel_spy_read_frame() to return a chain
 			   of frames if a queue flush was necessary, so process them
@@ -247,32 +188,29 @@
 			for (; f; f = next) {
 				next = f->next;
 				if (write)
-					ast_writestream(fs, f);
+					ast_writestream(mixmonitor->fs, f);
 				ast_frfree(f);
 			}
 		}
-
-		ast_mutex_unlock(&spy.lock);
-	}
-	
-	stopmon(mixmonitor->chan, &spy);
+	}
+
+	ast_mutex_unlock(&mixmonitor->spy.lock);
+	
+	stopmon(&mixmonitor->spy);
 
 	if (option_verbose > 1)
-		ast_verbose(VERBOSE_PREFIX_2 "End MixMonitor Recording %s\n", name);
-
-	if (!ast_strlen_zero(post_process)) {
+		ast_verbose(VERBOSE_PREFIX_2 "End MixMonitor Recording %s\n", mixmonitor->name);
+
+	if (mixmonitor->post_process) {
 		if (option_verbose > 2)
-			ast_verbose(VERBOSE_PREFIX_2 "Executing [%s]\n", post_process);
-		ast_safe_system(post_process);
-	}
-
-out2:
-	ast_mutex_destroy(&spy.lock);
-
-	if (fs)
-		ast_closestream(fs);
-
-out:
+			ast_verbose(VERBOSE_PREFIX_2 "Executing [%s]\n", mixmonitor->post_process);
+		ast_safe_system(mixmonitor->post_process);
+	}
+
+	ast_mutex_destroy(&mixmonitor->spy.lock);
+		
+	ast_closestream(mixmonitor->fs);
+
 	free(mixmonitor);
 
 	STANDARD_DECREMENT_USECOUNT;
@@ -286,32 +224,94 @@
 	pthread_attr_t attr;
 	pthread_t thread;
 	struct mixmonitor *mixmonitor;
-	int len;
-
-	len = sizeof(*mixmonitor) + strlen(filename) + 1;
-	if (!ast_strlen_zero(post_process))
-		len += strlen(post_process) + 1;
-
+	char *file_name, *ext;
+	char postprocess2[1024] = "";
+	unsigned int oflags;
+	size_t len;
+
+	len = sizeof(*mixmonitor) + strlen(chan->name) + 1;
+
+	/* If a post process system command is given attach it to the structure */
+	if (!ast_strlen_zero(post_process)) {
+		char *p1, *p2;
+
+		p1 = ast_strdupa(post_process);
+		for (p2 = p1; *p2 ; p2++) {
+			if (*p2 == '^' && *(p2+1) == '{') {
+				*p2 = '$';
+			}
+		}
+
+		pbx_substitute_variables_helper(chan, p1, postprocess2, sizeof(postprocess2) - 1);
+		if (!ast_strlen_zero(postprocess2))
+			len += strlen(postprocess2) + 1;
+	}
+
+	/* Pre-allocate mixmonitor structure and spy */
 	if (!(mixmonitor = calloc(1, len))) {
 		ast_log(LOG_ERROR, "Memory Error!\n");
 		return;
 	}
 
-	mixmonitor->chan = chan;
-	mixmonitor->filename = (char *) mixmonitor + sizeof(*mixmonitor);
-	strcpy(mixmonitor->filename, filename);
-	if (!ast_strlen_zero(post_process)) {
-		mixmonitor->post_process = mixmonitor->filename + strlen(filename) + 1;
-		strcpy(mixmonitor->post_process, post_process);
-	}
-	mixmonitor->readvol = readvol;
-	mixmonitor->writevol = writevol;
+	/* Copy over flags and channel name */
 	mixmonitor->flags = flags;
+	mixmonitor->name = (char *) mixmonitor + sizeof(*mixmonitor);
+	strcpy(mixmonitor->name, chan->name);
+	if (!ast_strlen_zero(postprocess2)) {
+		mixmonitor->post_process = mixmonitor->name + strlen(mixmonitor->name) + 1;
+		strcpy(mixmonitor->post_process, postprocess2);
+	}
+
+	/* Determine creation flags and filename plus extension for filestream */
+	oflags = O_CREAT | O_WRONLY;
+	oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;
+	file_name = ast_strdupa(filename);
+	if ((ext = strrchr(file_name, '.'))) {
+		*(ext++) = '\0';
+	} else {
+		ext = "raw";
+	}
+
+	/* Move onto actually creating the filestream */
+	mixmonitor->fs = ast_writefile(file_name, ext, NULL, oflags, 0, 0644);
+	if (!mixmonitor->fs) {
+		ast_log(LOG_ERROR, "Cannot open %s.%s\n", file_name, ext);
+		free(mixmonitor);
+		return;
+	}
+
+	/* Setup the actual spy before creating our thread */
+	ast_set_flag(&mixmonitor->spy, CHANSPY_FORMAT_AUDIO);
+	ast_set_flag(&mixmonitor->spy, CHANSPY_MIXAUDIO);
+	mixmonitor->spy.type = mixmonitor_spy_type;
+	mixmonitor->spy.status = CHANSPY_RUNNING;
+	mixmonitor->spy.read_queue.format = AST_FORMAT_SLINEAR;
+	mixmonitor->spy.write_queue.format = AST_FORMAT_SLINEAR;
+	if (readvol) {
+		ast_set_flag(&mixmonitor->spy, CHANSPY_READ_VOLADJUST);
+		mixmonitor->spy.read_vol_adjustment = readvol;
+	}
+	if (writevol) {
+		ast_set_flag(&mixmonitor->spy, CHANSPY_WRITE_VOLADJUST);
+		mixmonitor->spy.write_vol_adjustment = writevol;
+	}
+	ast_mutex_init(&mixmonitor->spy.lock);
+
+	if (startmon(chan, &mixmonitor->spy)) {
+		ast_log(LOG_WARNING, "Unable to add '%s' spy to channel '%s'\n",
+			mixmonitor->spy.type, chan->name);
+		/* Since we couldn't add ourselves - bail out! */
+		ast_mutex_destroy(&mixmonitor->spy.lock);
+		ast_closestream(mixmonitor->fs);
+		free(mixmonitor);
+		return;
+	}
 
 	pthread_attr_init(&attr);
 	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 	ast_pthread_create(&thread, &attr, mixmonitor_thread, mixmonitor);
 	pthread_attr_destroy(&attr);
+
 }
 
 static int mixmonitor_exec(struct ast_channel *chan, void *data)

Modified: team/oej/managerstuff/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/apps/app_queue.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/apps/app_queue.c (original)
+++ team/oej/managerstuff/apps/app_queue.c Wed Jun 14 06:30:17 2006
@@ -2606,7 +2606,7 @@
 		if (bridge != AST_PBX_NO_HANGUP_PEER)
 			ast_hangup(peer);
 		update_queue(qe->parent, member);
-		res = bridge ? -1 : 0;
+		res = bridge ? bridge : 1;
 	}
 out:
 	hangupcalls(outgoing, NULL);

Modified: team/oej/managerstuff/apps/app_test.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/apps/app_test.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/apps/app_test.c (original)
+++ team/oej/managerstuff/apps/app_test.c Wed Jun 14 06:30:17 2006
@@ -103,6 +103,7 @@
 				samples++;
 			}
 		}
+		ast_frfree(f);
 	}
 
 	if (rformat) {

Modified: team/oej/managerstuff/apps/app_url.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/apps/app_url.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/apps/app_url.c (original)
+++ team/oej/managerstuff/apps/app_url.c Wed Jun 14 06:30:17 2006
@@ -150,6 +150,7 @@
 					if (local_option_jump || ast_opt_priority_jumping)
 			 			ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
 					res = 0;
+					ast_frfree(f);
 					goto out;
 					break;
 				default:

Modified: team/oej/managerstuff/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/apps/app_voicemail.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/apps/app_voicemail.c (original)
+++ team/oej/managerstuff/apps/app_voicemail.c Wed Jun 14 06:30:17 2006
@@ -2575,7 +2575,8 @@
 			if (duration < vmminmessage) {
 				if (option_verbose > 2) 
 					ast_verbose( VERBOSE_PREFIX_3 "Recording was %d seconds long but needs to be at least %d - abandoning\n", duration, vmminmessage);
-				DELETE(dir,msgnum,fn);
+				ast_filedelete(tmptxtfile, NULL);
+				unlink(tmptxtfile);
 			} else {
 				fprintf(txt, "duration=%d\n", duration);
 				fclose(txt);
@@ -6190,9 +6191,13 @@
 							} else {
 								ast_log(LOG_WARNING, "Out of memory while reading voicemail config\n");
 								free(z);
+								ast_mutex_unlock(&vmlock);
+								ast_config_destroy(cfg);
 								return -1;
 							}
 						} else {						
+							ast_mutex_unlock(&vmlock);
+							ast_config_destroy(cfg);
 							return -1;
 						}
 						var = var->next;
@@ -6452,14 +6457,18 @@
 		return 0;
 	}
 
-	if (!(origtime = ast_variable_retrieve(msg_cfg, "message", "origtime")))
+	if (!(origtime = ast_variable_retrieve(msg_cfg, "message", "origtime"))) {
+		ast_config_destroy(msg_cfg);
 		return 0;
+	}
 
 	cid = ast_variable_retrieve(msg_cfg, "message", "callerid");
 
 	context = ast_variable_retrieve(msg_cfg, "message", "context");
 	if (!strncasecmp("macro",context,5)) /* Macro names in contexts are useless for our needs */
 		context = ast_variable_retrieve(msg_cfg, "message","macrocontext");
+
+	ast_config_destroy(msg_cfg);
 
 	if (option == 3) {
 
@@ -6592,8 +6601,6 @@
 			res = 0;
 		}
 	}
-
-	ast_config_destroy(msg_cfg);
 
 	if (!res) {
 		make_file(vms->fn, sizeof(vms->fn), vms->curdir, msg);

Modified: team/oej/managerstuff/apps/app_zapbarge.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/apps/app_zapbarge.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/apps/app_zapbarge.c (original)
+++ team/oej/managerstuff/apps/app_zapbarge.c Wed Jun 14 06:30:17 2006
@@ -217,6 +217,7 @@
 				break;
 			if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#')) {
 				ret = 0;
+				ast_frfree(f);
 				break;
 			} else if (fd != chan->fds[0]) {
 				if (f->frametype == AST_FRAME_VOICE) {

Modified: team/oej/managerstuff/apps/app_zapscan.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/apps/app_zapscan.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/apps/app_zapscan.c (original)
+++ team/oej/managerstuff/apps/app_zapscan.c Wed Jun 14 06:30:17 2006
@@ -271,6 +271,8 @@
 					ast_log(LOG_WARNING, "Failed to read frame: %s\n", strerror(errno));
 			}
         }
+	if (f)
+		ast_frfree(f);
         if (fd != chan->fds[0])
 			close(fd);
         else {

Modified: team/oej/managerstuff/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/asterisk.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/asterisk.c (original)
+++ team/oej/managerstuff/asterisk.c Wed Jun 14 06:30:17 2006
@@ -1790,17 +1790,12 @@
 
 	if (ast_opt_exec && data) {  /* hack to print output then exit if asterisk -rx is used */
 		char tempchar;
-#ifdef __Darwin__
-		struct pollfd fds[0];
-		fds[0].fd = ast_consock;
-		fds[0].events = POLLIN;
-		fds[0].revents = 0;
-		while (poll(fds, 1, 100) > 0) {
+		struct pollfd fds;
+		fds.fd = ast_consock;
+		fds.events = POLLIN;
+		fds.revents = 0;
+		while (poll(&fds, 1, 100) > 0)
 			ast_el_read_char(el, &tempchar);
-		}
-#else
-		while (!ast_el_read_char(el, &tempchar));
-#endif
 		return;
 	}
 	for(;;) {

Modified: team/oej/managerstuff/callerid.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/callerid.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/callerid.c (original)
+++ team/oej/managerstuff/callerid.c Wed Jun 14 06:30:17 2006
@@ -550,6 +550,7 @@
 		res = fsk_serie(&cid->fskd, buf, &mylen, &b);
 		if (mylen < 0) {
 			ast_log(LOG_ERROR, "fsk_serie made mylen < 0 (%d)\n", mylen);
+			free(obuf);
 			return -1;
 		}
 		buf += (olen - mylen);
@@ -583,6 +584,7 @@
 			case 4: /* Retrieve message */
 				if (cid->pos >= 128) {
 					ast_log(LOG_WARNING, "Caller ID too long???\n");
+					free(obuf);
 					return -1;
 				}
 				cid->rawdata[cid->pos++] = b;
@@ -668,6 +670,7 @@
 					strcpy(cid->name, "");
 					cid->flags |= CID_UNKNOWN_NAME;
 				}
+				free(obuf);
 				return 1;
 				break;
 			default:

Modified: team/oej/managerstuff/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/channel.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/channel.c (original)
+++ team/oej/managerstuff/channel.c Wed Jun 14 06:30:17 2006
@@ -940,6 +940,9 @@
 
 int ast_channel_spy_add(struct ast_channel *chan, struct ast_channel_spy *spy)
 {
+	/* Link the owner channel to the spy */
+	spy->chan = chan;
+
 	if (!ast_test_flag(spy, CHANSPY_FORMAT_AUDIO)) {
 		ast_log(LOG_WARNING, "Could not add channel spy '%s' to channel '%s', only audio format spies are supported.\n",
 			spy->type, chan->name);
@@ -1010,7 +1013,14 @@
 
 void ast_channel_spy_trigger_wait(struct ast_channel_spy *spy)
 {
-	ast_cond_wait(&spy->trigger, &spy->lock);
+	struct timeval tv;
+	struct timespec ts;
+
+	tv = ast_tvadd(ast_tvnow(), ast_samp2tv(50000, 1000));
+	ts.tv_sec = tv.tv_sec;
+	ts.tv_nsec = tv.tv_usec * 1000;
+
+	ast_cond_timedwait(&spy->trigger, &spy->lock, &ts);
 }
 
 void ast_channel_spy_remove(struct ast_channel *chan, struct ast_channel_spy *spy)
@@ -1023,6 +1033,8 @@
 	AST_LIST_REMOVE(&chan->spies->list, spy, list);
 
 	ast_mutex_lock(&spy->lock);
+
+	spy->chan = NULL;
 
 	for (f = spy->read_queue.head; f; f = spy->read_queue.head) {
 		spy->read_queue.head = f->next;
@@ -1061,6 +1073,7 @@
 	/* Marking the spies as done is sufficient.  Chanspy or spy users will get the picture. */
 	AST_LIST_TRAVERSE(&chan->spies->list, spy, list) {
 		ast_mutex_lock(&spy->lock);
+		spy->chan = NULL;
 		if (spy->status == CHANSPY_RUNNING)
 			spy->status = CHANSPY_DONE;
 		if (ast_test_flag(spy, CHANSPY_TRIGGER_MODE) != CHANSPY_TRIGGER_NONE)
@@ -2736,6 +2749,14 @@
 	struct ast_frame null = { AST_FRAME_NULL, };
 	int res = -1;
 
+	/* each of these channels may be sitting behind a channel proxy (i.e. chan_agent)
+	   and if so, we don't really want to masquerade it, but its proxy */
+	if (original->_bridge && (original->_bridge != ast_bridged_channel(original)))
+		original = original->_bridge;
+
+	if (clone->_bridge && (clone->_bridge != ast_bridged_channel(clone)))
+		clone = clone->_bridge;
+
 	if (original == clone) {
 		ast_log(LOG_WARNING, "Can't masquerade channel '%s' into itself!\n", original->name);
 		return -1;

Modified: team/oej/managerstuff/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/channels/chan_iax2.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/channels/chan_iax2.c (original)
+++ team/oej/managerstuff/channels/chan_iax2.c Wed Jun 14 06:30:17 2006
@@ -5869,11 +5869,9 @@
 	ast_mutex_lock(&iaxsl[callno]);
 	iaxs[callno]->authfail = failcode;
 	if (delayreject) {
-		ast_mutex_lock(&iaxsl[callno]);
 		if (iaxs[callno]->authid > -1)
 			ast_sched_del(sched, iaxs[callno]->authid);
 		iaxs[callno]->authid = ast_sched_add(sched, 1000, auth_reject, (void *)(long)callno);
-		ast_mutex_unlock(&iaxsl[callno]);
 	} else
 		auth_reject((void *)(long)callno);
 	ast_mutex_unlock(&iaxsl[callno]);
@@ -6326,27 +6324,39 @@
 			return 1;
  
 	}
-	if (res < sizeof(struct ast_iax2_mini_hdr)) {
-		ast_log(LOG_WARNING, "midget packet received (%d of %d min)\n", res, (int)sizeof(struct ast_iax2_mini_hdr));
+	if (res < sizeof(*mh)) {
+		ast_log(LOG_WARNING, "midget packet received (%d of %zd min)\n", res, sizeof(*mh));
 		return 1;
 	}
 	if ((vh->zeros == 0) && (ntohs(vh->callno) & 0x8000)) {
+		if (res < sizeof(*vh)) {
+			ast_log(LOG_WARNING, "Rejecting packet from '%s.%d' that is flagged as a video frame but is too short\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
+			return 1;
+		}
+
 		/* This is a video frame, get call number */
 		fr->callno = find_callno(ntohs(vh->callno) & ~0x8000, dcallno, &sin, new, 1, fd);
 		minivid = 1;
-	} else if (meta->zeros == 0) {
+	} else if ((meta->zeros == 0) && !(ntohs(meta->metacmd) & 0x8000)) {
 		unsigned char metatype;
+
+		if (res < sizeof(*meta)) {
+			ast_log(LOG_WARNING, "Rejecting packet from '%s.%d' that is flagged as a meta frame but is too short\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
+			return 1;
+		}
+
 		/* This is a meta header */
 		switch(meta->metacmd) {
 		case IAX_META_TRUNK:
-			if (res < sizeof(struct ast_iax2_meta_hdr) + sizeof(struct ast_iax2_meta_trunk_hdr)) {
-				ast_log(LOG_WARNING, "midget meta trunk packet received (%d of %d min)\n", res, (int)sizeof(struct ast_iax2_mini_hdr));
+			if (res < (sizeof(*meta) + sizeof(*mth))) {
+				ast_log(LOG_WARNING, "midget meta trunk packet received (%d of %zd min)\n", res,
+					sizeof(*meta) + sizeof(*mth));
 				return 1;
 			}
 			mth = (struct ast_iax2_meta_trunk_hdr *)(meta->data);
 			ts = ntohl(mth->ts);
 			metatype = meta->cmddata;
-			res -= (sizeof(struct ast_iax2_meta_hdr) + sizeof(struct ast_iax2_meta_trunk_hdr));
+			res -= (sizeof(*meta) + sizeof(*mth));
 			ptr = mth->data;
 			tpeer = find_tpeer(&sin, fd);
 			if (!tpeer) {
@@ -6358,21 +6368,21 @@
 				tpeer->rxtrunktime = tpeer->trunkact;
 			rxtrunktime = tpeer->rxtrunktime;
 			ast_mutex_unlock(&tpeer->lock);
-			while(res >= sizeof(struct ast_iax2_meta_trunk_entry)) {
+			while(res >= sizeof(*mte)) {
 				/* Process channels */
 				unsigned short callno, trunked_ts, len;
 
-				if(metatype == IAX_META_TRUNK_MINI) {
+				if (metatype == IAX_META_TRUNK_MINI) {
 					mtm = (struct ast_iax2_meta_trunk_mini *)ptr;
-					ptr += sizeof(struct ast_iax2_meta_trunk_mini);
-					res -= sizeof(struct ast_iax2_meta_trunk_mini);
+					ptr += sizeof(*mtm);
+					res -= sizeof(*mtm);
 					len = ntohs(mtm->len);
 					callno = ntohs(mtm->mini.callno);
 					trunked_ts = ntohs(mtm->mini.ts);
-				} else if ( metatype == IAX_META_TRUNK_SUPERMINI ) {
+				} else if (metatype == IAX_META_TRUNK_SUPERMINI) {
 					mte = (struct ast_iax2_meta_trunk_entry *)ptr;
-					ptr += sizeof(struct ast_iax2_meta_trunk_entry);
-					res -= sizeof(struct ast_iax2_meta_trunk_entry);
+					ptr += sizeof(*mte);
+					res -= sizeof(*mte);
 					len = ntohs(mte->len);
 					callno = ntohs(mte->callno);
 					trunked_ts = 0;
@@ -6417,9 +6427,9 @@
 									iax_frame_wrap(fr, &f);
 #ifdef BRIDGE_OPTIMIZATION
 									if (iaxs[fr->callno]->bridgecallno) {
-										forward_delivery(&fr);
+										forward_delivery(fr);
 									} else {
-										duped_fr = iaxfrdup2(&fr);
+										duped_fr = iaxfrdup2(fr);
 										if (duped_fr) {
 											schedule_delivery(duped_fr, updatehistory, 1, &fr->ts);
 										}
@@ -6455,11 +6465,17 @@
 		}
 		return 1;
 	}
+
 #ifdef DEBUG_SUPPORT
-	if (iaxdebug)
-		iax_showframe(NULL, fh, 1, &sin, res - sizeof(struct ast_iax2_full_hdr));
+	if (iaxdebug && (res >= sizeof(*fh)))
+		iax_showframe(NULL, fh, 1, &sin, res - sizeof(*fh));
 #endif
 	if (ntohs(mh->callno) & IAX_FLAG_FULL) {
+		if (res < sizeof(*fh)) {
+			ast_log(LOG_WARNING, "Rejecting packet from '%s.%d' that is flagged as a full frame but is too short\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
+			return 1;
+		}
+
 		/* Get the destination call number */
 		dcallno = ntohs(fh->dcallno) & ~IAX_FLAG_RETRANS;
 		/* Retrieve the type and subclass */
@@ -6510,7 +6526,7 @@
 		}
 #ifdef DEBUG_SUPPORT
 		else if (iaxdebug)
-			iax_showframe(NULL, fh, 3, &sin, res - sizeof(struct ast_iax2_full_hdr));
+			iax_showframe(NULL, fh, 3, &sin, res - sizeof(*fh));
 #endif
 	}
 
@@ -6595,12 +6611,12 @@
 				iaxs[fr->callno]->iseqno++;
 		}
 		/* A full frame */
-		if (res < sizeof(struct ast_iax2_full_hdr)) {
-			ast_log(LOG_WARNING, "midget packet received (%d of %d min)\n", res, (int)sizeof(struct ast_iax2_full_hdr));
+		if (res < sizeof(*fh)) {
+			ast_log(LOG_WARNING, "midget packet received (%d of %zd min)\n", res, sizeof(*fh));
 			ast_mutex_unlock(&iaxsl[fr->callno]);
 			return 1;
 		}
-		f.datalen = res - sizeof(struct ast_iax2_full_hdr);
+		f.datalen = res - sizeof(*fh);
 
 		/* Handle implicit ACKing unless this is an INVAL, and only if this is 
 		   from the real peer, not the transfer peer */
@@ -6658,14 +6674,14 @@
 
 		if (f.datalen) {
 			if (f.frametype == AST_FRAME_IAX) {
-				if (iax_parse_ies(&ies, buf + sizeof(struct ast_iax2_full_hdr), f.datalen)) {
+				if (iax_parse_ies(&ies, buf + sizeof(*fh), f.datalen)) {
 					ast_log(LOG_WARNING, "Undecodable frame received from '%s'\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr));
 					ast_mutex_unlock(&iaxsl[fr->callno]);
 					return 1;
 				}
 				f.data = NULL;
 			} else
-				f.data = buf + sizeof(struct ast_iax2_full_hdr);
+				f.data = buf + sizeof(*fh);
 		} else {
 			if (f.frametype == AST_FRAME_IAX)
 				f.data = NULL;
@@ -7543,9 +7559,9 @@
 			ast_mutex_unlock(&iaxsl[fr->callno]);
 			return 1;
 		}
-		f.datalen = res - sizeof(struct ast_iax2_video_hdr);
+		f.datalen = res - sizeof(*vh);
 		if (f.datalen)
-			f.data = buf + sizeof(struct ast_iax2_video_hdr);
+			f.data = buf + sizeof(*vh);
 		else
 			f.data = NULL;
 #ifdef IAXTESTS
@@ -7572,7 +7588,7 @@
 			return 1;
 		}
 		if (f.datalen)
-			f.data = buf + sizeof(struct ast_iax2_mini_hdr);
+			f.data = buf + sizeof(*mh);
 		else
 			f.data = NULL;
 #ifdef IAXTESTS
@@ -7612,9 +7628,9 @@
 	}
 #ifdef BRIDGE_OPTIMIZATION
 	if (iaxs[fr->callno]->bridgecallno) {
-		forward_delivery(&fr);
+		forward_delivery(fr);
 	} else {
-		duped_fr = iaxfrdup2(&fr);
+		duped_fr = iaxfrdup2(fr);
 		if (duped_fr) {
 			schedule_delivery(duped_fr, updatehistory, 0, &fr->ts);
 		}

Modified: team/oej/managerstuff/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/channels/chan_local.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/channels/chan_local.c (original)
+++ team/oej/managerstuff/channels/chan_local.c Wed Jun 14 06:30:17 2006
@@ -188,7 +188,13 @@
 		return;
 	if (!p->chan || !p->owner)
 		return;
-	if (isoutbound&& p->chan->_bridge /* Not ast_bridged_channel!  Only go one step! */ && !p->owner->readq) {
+
+	/* only do the masquerade if we are being called on the outbound channel,
+	   if it has been bridged to another channel and if there are no pending
+	   frames on the owner channel (because they would be transferred to the
+	   outbound channel during the masquerade)
+	*/
+	if (isoutbound && p->chan->_bridge /* Not ast_bridged_channel!  Only go one step! */ && !p->owner->readq) {
 		/* Masquerade bridged channel into owner */
 		/* Lock everything we need, one by one, and give up if
 		   we can't get everything.  Remember, we'll get another
@@ -205,6 +211,11 @@
 				ast_mutex_unlock(&(p->chan->_bridge)->lock);
 			}
 		}
+	/* We only allow masquerading in one 'direction'... it's important to preserve the state
+	   (group variables, etc.) that live on p->chan->_bridge (and were put there by the dialplan)
+	   when the local channels go away.
+	*/
+#if 0
 	} else if (!isoutbound && p->owner && p->owner->_bridge && p->chan && !p->chan->readq) {
 		/* Masquerade bridged channel into chan */
 		if (!ast_mutex_trylock(&(p->owner->_bridge)->lock)) {
@@ -219,6 +230,7 @@
 			}
 			ast_mutex_unlock(&(p->owner->_bridge)->lock);
 		}
+#endif
 	}
 }
 

Modified: team/oej/managerstuff/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/channels/chan_sip.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/channels/chan_sip.c (original)
+++ team/oej/managerstuff/channels/chan_sip.c Wed Jun 14 06:30:17 2006
@@ -14531,10 +14531,10 @@
 			if (context)
 				*context++ = '\0';
 
+			if (option_debug && ast_strlen_zero(context))
+				ast_log(LOG_DEBUG, "No context specified at line %d for domain '%s'\n", v->lineno, domain);
 			if (ast_strlen_zero(domain))
 				ast_log(LOG_WARNING, "Empty domain specified at line %d\n", v->lineno);
-			else if (ast_strlen_zero(context))
-				ast_log(LOG_WARNING, "Empty context specified at line %d for domain '%s'\n", v->lineno, domain);
 			else
 				add_sip_domain(ast_strip(domain), SIP_DOMAIN_CONFIG, context ? ast_strip(context) : "");
 		} else if (!strcasecmp(v->name, "register")) {

Modified: team/oej/managerstuff/file.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/file.c?rev=34064&r1=34063&r2=34064&view=diff
==============================================================================
--- team/oej/managerstuff/file.c (original)
+++ team/oej/managerstuff/file.c Wed Jun 14 06:30:17 2006
@@ -866,6 +866,7 @@
 	struct ast_filestream *fs = NULL;
 	char *buf = NULL;
 	size_t size = 0;
+	int format_found = 0;
 
 	if (AST_LIST_LOCK(&formats)) {
 		ast_log(LOG_WARNING, "Unable to lock format list\n");
@@ -892,6 +893,8 @@
 
 		if (!exts_compare(f->exts, type))
 			continue;
+		else
+			format_found = 1;
 
 		fn = build_filename(filename, type);
 		fd = open(fn, flags | myflags, mode);
@@ -974,7 +977,8 @@
 	}
 
 	AST_LIST_UNLOCK(&formats);
-	if (!fs)
+
+	if (!format_found)
 		ast_log(LOG_WARNING, "No such format '%s'\n", type);
 
 	return fs;

Modified: team/oej/managerstuff/frame.c

[... 185 lines stripped ...]


More information about the asterisk-commits mailing list