[asterisk-commits] murf: branch murf/AEL2-1.2 r48412 - in /team/murf/AEL2-1.2: ./ apps/ channels...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Dec 12 10:45:56 MST 2006


Author: murf
Date: Tue Dec 12 11:45:56 2006
New Revision: 48412

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48412
Log:
Merged revisions 48157,48161,48165,48183,48192,48233,48236,48246,48251,48272,48315,48319-48322,48356,48361,48371,48374,48394 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48157 | file | 2006-11-30 13:06:43 -0700 (Thu, 30 Nov 2006) | 2 lines

Only print out debug message if bridged channel is not NULL. (issue #8412 reported by jubilex)

........
r48161 | file | 2006-11-30 13:27:29 -0700 (Thu, 30 Nov 2006) | 2 lines

Don't write AST_FRAME_NULL or AST_FRAME_IAX frames out to the channel driver. (issue #8390 reported by hselasky)

........
r48165 | oej | 2006-11-30 13:47:53 -0700 (Thu, 30 Nov 2006) | 2 lines

Issue 8319 - noriyuki - nonce-count updated *after* use

........
r48183 | qwell | 2006-12-01 13:19:10 -0700 (Fri, 01 Dec 2006) | 2 lines

Fix a small typo - issue 8848, reported by pabelanger

........
r48192 | kpfleming | 2006-12-01 16:30:59 -0700 (Fri, 01 Dec 2006) | 2 lines

if Dial() is going to send music-on-hold to the calling party, it has to send PROGRESS first to ensure that the reverse audio path has been setup first (BE-106)

........
r48233 | file | 2006-12-04 11:14:46 -0700 (Mon, 04 Dec 2006) | 2 lines

If the generic bridge tells us not to retry, and we have a frame to spit out then break the bridge. Props to markit in #asterisk-bugs for bringing this up.

........
r48236 | qwell | 2006-12-04 12:06:26 -0700 (Mon, 04 Dec 2006) | 4 lines

Fix an issue where a message isn't saved correctly when using ODBC storage and reviewing a message.

Issue 8016 - patch by sokhapkin.

........
r48246 | qwell | 2006-12-04 14:20:34 -0700 (Mon, 04 Dec 2006) | 7 lines

Revert change from 8016 - this breaks other stuff...  Needs further review.

Tip: When you've reported a bug about something and somebody has put up a
patch for it..  It's not a good idea to open a completely new bug and say that
something is broken because of the patch in the other bug - PLEASE mention
something in the bug where the patch was actually created.

........
r48251 | tilghman | 2006-12-04 18:26:08 -0700 (Mon, 04 Dec 2006) | 6 lines

If the recording in the database is too large, it will fail to retrieve with
an mmap error.  Not too sure why this doesn't happen when we put it in the
database, also, but since that doesn't seem to be broken, I'm not going to fix
it (at least until someone reports it).  Solution is to ask for the file in
smaller chunks.  (Bug 8385)

........
r48272 | oej | 2006-12-05 10:59:15 -0700 (Tue, 05 Dec 2006) | 2 lines

Only set the ALREADYGONE flag once in handle_response()

........
r48315 | oej | 2006-12-06 05:14:40 -0700 (Wed, 06 Dec 2006) | 3 lines

Don't add Contact header on BYE, CANCEL, MESSAGE requests
(Bye, Cancel backported from 1.4, MESSAGE bug reported to me by Gunnar at Omnitor)

........
r48319 | crichter | 2006-12-06 07:35:25 -0700 (Wed, 06 Dec 2006) | 1 line

changed a few debugs to higher debug levels
........
r48320 | oej | 2006-12-06 08:42:41 -0700 (Wed, 06 Dec 2006) | 4 lines

Issue #8528 - make sure we don't delete the dialog too quickly after receiving
a 487. Move 487 handling into handle_response_invite where it really
belongs and don't add an ALREADYGONE flag to the dialog.

........
r48321 | crichter | 2006-12-06 08:48:45 -0700 (Wed, 06 Dec 2006) | 1 line

added the export and import of the MISDN_ADDRESS_COMPLETE Variable to inidcate wether the extension is already completely dialed or if there might come additional digits by information elements. also added some docs for that.
........
r48322 | russell | 2006-12-06 09:05:54 -0700 (Wed, 06 Dec 2006) | 3 lines

Fix the name of the rtignoreregexpire option in the sample configuration file.
(issue #8526, arkadia)

........
r48356 | russell | 2006-12-07 11:14:13 -0700 (Thu, 07 Dec 2006) | 3 lines

Ensure that the file position is not incremented beyond the total number of
files available for playback.  (issue #8539, ulogic)

........
r48361 | russell | 2006-12-09 08:45:37 -0700 (Sat, 09 Dec 2006) | 6 lines

Use locking when accessing the registrations list.  This list is not actually
used very often, so the likelihood of there being a problem is pretty small,
but still possible.  For example, if the CLI command to list the registrations
was called at the same time that a reload was occurring and the registrations
list was getting destroyed and rebuilt, a crash could occur.

........
r48371 | murf | 2006-12-09 19:14:13 -0700 (Sat, 09 Dec 2006) | 1 line

This version applies the patch suggested by stevens in bug 7836 (make inbound channel RINGING state consistent with other channels).
........
r48374 | tilghman | 2006-12-10 17:33:59 -0700 (Sun, 10 Dec 2006) | 5 lines

When doing a fork() and exec(), two problems existed (Issue 8086):
1) Ignored signals stayed ignored after the exec().
2) Signals could possibly fire between the fork() and exec(), causing Asterisk
signal handlers within the child to execute, which caused nasty race conditions.

........
r48394 | mogorman | 2006-12-11 14:55:43 -0700 (Mon, 11 Dec 2006) | 4 lines

app_externalivr needs a real silence file, and additional
changes to add silence files into core instead of extra
patch provided by bug 8177 with minor additions.

........

Modified:
    team/murf/AEL2-1.2/   (props changed)
    team/murf/AEL2-1.2/Makefile
    team/murf/AEL2-1.2/apps/app_dial.c
    team/murf/AEL2-1.2/apps/app_externalivr.c
    team/murf/AEL2-1.2/apps/app_festival.c
    team/murf/AEL2-1.2/apps/app_ices.c
    team/murf/AEL2-1.2/apps/app_mp3.c
    team/murf/AEL2-1.2/apps/app_nbscat.c
    team/murf/AEL2-1.2/apps/app_voicemail.c
    team/murf/AEL2-1.2/apps/app_zapras.c
    team/murf/AEL2-1.2/channel.c
    team/murf/AEL2-1.2/channels/chan_iax2.c
    team/murf/AEL2-1.2/channels/chan_misdn.c
    team/murf/AEL2-1.2/channels/chan_sip.c
    team/murf/AEL2-1.2/channels/chan_zap.c
    team/murf/AEL2-1.2/channels/misdn/isdn_msg_parser.c
    team/murf/AEL2-1.2/configs/extensions.conf.sample
    team/murf/AEL2-1.2/configs/iax.conf.sample
    team/murf/AEL2-1.2/doc/README.misdn
    team/murf/AEL2-1.2/res/res_agi.c
    team/murf/AEL2-1.2/res/res_musiconhold.c
    team/murf/AEL2-1.2/sounds.txt

Propchange: team/murf/AEL2-1.2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Dec 12 11:45:56 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-48156
+/branches/1.2:1-48397

Modified: team/murf/AEL2-1.2/Makefile
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/Makefile?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/Makefile (original)
+++ team/murf/AEL2-1.2/Makefile Tue Dec 12 11:45:56 2006
@@ -553,6 +553,7 @@
 datafiles: all
 	if [ x`$(ID) -un` = xroot ]; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
 	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
+	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/silence
 	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
 	for x in sounds/digits/*.gsm; do \
 		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
@@ -562,6 +563,14 @@
 			exit 1; \
 		fi; \
 	done
+#	for x in sounds/silence/*.gsm; do \
+#		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+#			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/silence ; \
+#		else \
+#			# echo "No description for $$x"; \
+#			exit 1; \
+#		fi; \
+#	done
 	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
 	for x in sounds/dictate/*.gsm; do \
 		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \

Modified: team/murf/AEL2-1.2/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/apps/app_dial.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/apps/app_dial.c (original)
+++ team/murf/AEL2-1.2/apps/app_dial.c Tue Dec 12 11:45:56 2006
@@ -1197,6 +1197,7 @@
 		strcpy(status, "NOANSWER");
 		if (ast_test_flag(outgoing, OPT_MUSICBACK)) {
 			moh=1;
+			ast_indicate(chan, AST_CONTROL_PROGRESS);
 			ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK]);
 		} else if (ast_test_flag(outgoing, OPT_RINGBACK)) {
 			ast_indicate(chan, AST_CONTROL_RINGING);

Modified: team/murf/AEL2-1.2/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/apps/app_externalivr.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/apps/app_externalivr.c (original)
+++ team/murf/AEL2-1.2/apps/app_externalivr.c Tue Dec 12 11:45:56 2006
@@ -31,6 +31,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
+#include <signal.h>
 
 #include "asterisk.h"
 
@@ -152,7 +153,7 @@
 		if (state->current) {
 			file_to_stream = state->current->filename;
 		} else {
-			file_to_stream = "silence-10";
+			file_to_stream = "silence/10";
 			u->playing_silence = 1;
 		}
 
@@ -258,9 +259,13 @@
 	FILE *child_commands = NULL;
 	FILE *child_errors = NULL;
 	FILE *child_events = NULL;
+	sigset_t fullset, oldset;
 
 	LOCAL_USER_ADD(u);
-	
+
+	sigfillset(&fullset);
+	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
+
 	AST_LIST_HEAD_INIT(&u->playlist);
 	AST_LIST_HEAD_INIT(&u->finishlist);
 	u->abort_current_sound = 0;
@@ -313,6 +318,9 @@
 	if (!pid) {
 		/* child process */
 		int i;
+
+		signal(SIGPIPE, SIG_DFL);
+		pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
 
 		if (option_highpriority)
 			ast_set_priority(0);
@@ -336,6 +344,8 @@
 		int ready_fd;
 		int waitfds[2] = { child_errors_fd, child_commands_fd };
 		struct ast_channel *rchan;
+
+		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 
 		close(child_stdin[0]);
 		child_stdin[0] = 0;

Modified: team/murf/AEL2-1.2/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/apps/app_festival.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/apps/app_festival.c (original)
+++ team/murf/AEL2-1.2/apps/app_festival.c Tue Dec 12 11:45:56 2006
@@ -127,19 +127,26 @@
 #ifdef __PPC__ 
 	char c;
 #endif
+	sigset_t fullset, oldset;
+
+	sigfillset(&fullset);
+	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
 
         res = fork();
         if (res < 0)
                 ast_log(LOG_WARNING, "Fork failed\n");
-        if (res)
+        if (res) {
+		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
                 return res;
+	}
         for (x=0;x<256;x++) {
                 if (x != fd)
                         close(x);
         }
 	if (option_highpriority)
 		ast_set_priority(0);
-
+	signal(SIGPIPE, SIG_DFL);
+	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
 /*IAS */
 #ifdef __PPC__  
 	for( x=0; x<length; x+=2)

Modified: team/murf/AEL2-1.2/apps/app_ices.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/apps/app_ices.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/apps/app_ices.c (original)
+++ team/murf/AEL2-1.2/apps/app_ices.c Tue Dec 12 11:45:56 2006
@@ -68,15 +68,27 @@
 {
 	int res;
 	int x;
+	sigset_t fullset, oldset;
+
+	sigfillset(&fullset);
+	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
+
 	res = fork();
 	if (res < 0) 
 		ast_log(LOG_WARNING, "Fork failed\n");
-	if (res)
+	if (res) {
+		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 		return res;
+	}
+
+	/* Stop ignoring PIPE */
+	signal(SIGPIPE, SIG_DFL);
+	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
+
 	if (option_highpriority)
 		ast_set_priority(0);
 	dup2(fd, STDIN_FILENO);
-	for (x=STDERR_FILENO + 1;x<256;x++) {
+	for (x=STDERR_FILENO + 1;x<1024;x++) {
 		if ((x != STDIN_FILENO) && (x != STDOUT_FILENO))
 			close(x);
 	}
@@ -87,7 +99,7 @@
 	/* As a last-ditch effort, try to use PATH */
 	execlp("ices", "ices", filename, (char *)NULL);
 	ast_log(LOG_WARNING, "Execute of ices failed\n");
-	return -1;
+	_exit(0);
 }
 
 static int ices_exec(struct ast_channel *chan, void *data)

Modified: team/murf/AEL2-1.2/apps/app_mp3.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/apps/app_mp3.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/apps/app_mp3.c (original)
+++ team/murf/AEL2-1.2/apps/app_mp3.c Tue Dec 12 11:45:56 2006
@@ -67,15 +67,25 @@
 {
 	int res;
 	int x;
+	sigset_t fullset, oldset;
+
+	sigfillset(&fullset);
+	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
+
 	res = fork();
 	if (res < 0) 
 		ast_log(LOG_WARNING, "Fork failed\n");
-	if (res)
+	if (res) {
+		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 		return res;
+	}
 	if (option_highpriority)
 		ast_set_priority(0);
+	signal(SIGPIPE, SIG_DFL);
+	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
+
 	dup2(fd, STDOUT_FILENO);
-	for (x=0;x<256;x++) {
+	for (x=STDERR_FILENO + 1;x<256;x++) {
 		if (x != STDOUT_FILENO)
 			close(x);
 	}
@@ -97,7 +107,7 @@
 	    execlp("mpg123", "mpg123", "-q", "-s", "-f", "8192", "--mono", "-r", "8000", filename, (char *)NULL);
 	}
 	ast_log(LOG_WARNING, "Execute of mpg123 failed\n");
-	return -1;
+	_exit(0);
 }
 
 static int timed_read(int fd, void *data, int datalen, int timeout)

Modified: team/murf/AEL2-1.2/apps/app_nbscat.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/apps/app_nbscat.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/apps/app_nbscat.c (original)
+++ team/murf/AEL2-1.2/apps/app_nbscat.c Tue Dec 12 11:45:56 2006
@@ -71,16 +71,26 @@
 {
 	int res;
 	int x;
+	sigset_t fullset, oldset;
+
+	sigfillset(&fullset);
+	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
+
 	res = fork();
 	if (res < 0) 
 		ast_log(LOG_WARNING, "Fork failed\n");
-	if (res)
+	if (res) {
+		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 		return res;
+	}
+	signal(SIGPIPE, SIG_DFL);
+	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
+
 	if (option_highpriority)
 		ast_set_priority(0);
 
 	dup2(fd, STDOUT_FILENO);
-	for (x=0;x<256;x++) {
+	for (x = STDERR_FILENO + 1; x < 1024; x++) {
 		if (x != STDOUT_FILENO)
 			close(x);
 	}
@@ -88,7 +98,7 @@
 	execl(NBSCAT, "nbscat8k", "-d", (char *)NULL);
 	execl(LOCAL_NBSCAT, "nbscat8k", "-d", (char *)NULL);
 	ast_log(LOG_WARNING, "Execute of nbscat8k failed\n");
-	return -1;
+	_exit(0);
 }
 
 static int timed_read(int fd, void *data, int datalen)

Modified: team/murf/AEL2-1.2/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/apps/app_voicemail.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/apps/app_voicemail.c (original)
+++ team/murf/AEL2-1.2/apps/app_voicemail.c Tue Dec 12 11:45:56 2006
@@ -77,6 +77,7 @@
 #define COMMAND_TIMEOUT 5000
 #define	VOICEMAIL_DIR_MODE	0700
 #define	VOICEMAIL_FILE_MODE	0600
+#define	CHUNKSIZE	65536
 
 #define VOICEMAIL_CONFIG "voicemail.conf"
 #define ASTERISK_USERNAME "asterisk"
@@ -925,6 +926,7 @@
 				goto yuck;
 			}
 			if (!strcasecmp(coltitle, "recording")) {
+				off_t offset;
 				res = SQLGetData(stmt, x + 1, SQL_BINARY, NULL, 0, &colsize);
 				fdlen = colsize;
 				if (fd > -1) {
@@ -935,22 +937,25 @@
 						fd = -1;
 						continue;
 					}
-					if (fd > -1) {
-						if ((fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == -1) {
+					/* Read out in small chunks */
+					for (offset = 0; offset < colsize; offset += CHUNKSIZE) {
+						/* +1 because SQLGetData likes null-terminating binary data */
+						if ((fdm = mmap(NULL, CHUNKSIZE + 1, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset)) == -1) {
 							ast_log(LOG_WARNING, "Could not mmap the output file: %s (%d)\n", strerror(errno), errno);
 							SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 							goto yuck;
+						} else {
+							res = SQLGetData(stmt, x + 1, SQL_BINARY, fdm, CHUNKSIZE + 1, NULL);
+							munmap(fdm, 0);
+							if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+								ast_log(LOG_WARNING, "SQL Get Data error!\n[%s]\n\n", sql);
+								unlink(full_fn);
+								SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+								goto yuck;
+							}
 						}
 					}
-				}
-				if (fdm) {
-					memset(fdm, 0, fdlen);
-					res = SQLGetData(stmt, x + 1, SQL_BINARY, fdm, fdlen, &colsize);
-					if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
-						ast_log(LOG_WARNING, "SQL Get Data error!\n[%s]\n\n", sql);
-						SQLFreeHandle (SQL_HANDLE_STMT, stmt);
-						goto yuck;
-					}
+					truncate(full_fn, fdlen);
 				}
 			} else {
 				res = SQLGetData(stmt, x + 1, SQL_CHAR, rowdata, sizeof(rowdata), NULL);
@@ -969,8 +974,6 @@
 yuck:	
 	if (f)
 		fclose(f);
-	if (fdm)
-		munmap(fdm, fdlen);
 	if (fd > -1)
 		close(fd);
 	return x - 1;

Modified: team/murf/AEL2-1.2/apps/app_zapras.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/apps/app_zapras.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/apps/app_zapras.c (original)
+++ team/murf/AEL2-1.2/apps/app_zapras.c Tue Dec 12 11:45:56 2006
@@ -87,11 +87,23 @@
 	char *argv[PPP_MAX_ARGS];
 	int argc = 0;
 	char *stringp=NULL;
+	sigset_t fullset, oldset;
+
+	sigfillset(&fullset);
+	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
 
 	/* Start by forking */
 	pid = fork();
-	if (pid)
+	if (pid) {
+		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 		return pid;
+	}
+
+	/* Restore original signal handlers */
+	for (x=0;x<NSIG;x++)
+		signal(x, SIG_DFL);
+
+	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
 
 	/* Execute RAS on File handles */
 	dup2(chan->fds[0], STDIN_FILENO);
@@ -103,10 +115,6 @@
 	/* Close other file descriptors */
 	for (x=STDERR_FILENO + 1;x<1024;x++) 
 		close(x);
-
-	/* Restore original signal handlers */
-	for (x=0;x<NSIG;x++)
-		signal(x, SIG_DFL);
 
 	/* Reset all arguments */
 	memset(argv, 0, sizeof(argv));

Modified: team/murf/AEL2-1.2/channel.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/channel.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/channel.c (original)
+++ team/murf/AEL2-1.2/channel.c Tue Dec 12 11:45:56 2006
@@ -39,7 +39,7 @@
 #include <zaptel.h>
 #endif /* __linux__ */
 #ifndef ZT_TIMERPING
-#error "You need newer zaptel!  Please cvs update zaptel"
+#error "You need newer zaptel!  Please svn update zaptel"
 #endif
 #endif
 
@@ -2295,6 +2295,11 @@
 			res = chan->tech->write_video(chan, fr);
 		else
 			res = 0;
+		break;
+	case AST_FRAME_NULL:
+	case AST_FRAME_IAX:
+		/* Ignore these */
+		res = 0;
 		break;
 	default:
 		if (chan->tech->write) {
@@ -3346,7 +3351,10 @@
 		if (bridge_end.tv_sec) {
 			to = ast_tvdiff_ms(bridge_end, ast_tvnow());
 			if (to <= 0) {
-				res = AST_BRIDGE_COMPLETE;
+				if (config->timelimit)
+					res = AST_BRIDGE_RETRY;
+				else
+ 					res = AST_BRIDGE_COMPLETE;
 				break;
 			}
 		} else
@@ -3471,7 +3479,7 @@
 		if (callee_warning)
 			bridge_playfile(c1, c0, config->start_sound, time_left_ms / 1000);
 	}
-
+	
 	/* Keep track of bridge */
 	c0->_bridge = c1;
 	c1->_bridge = c0;
@@ -3495,6 +3503,14 @@
 		if (caller_warning || callee_warning)
 			nexteventts = ast_tvsub(nexteventts, ast_samp2tv(config->play_warning, 1000));
 	}
+	ast_log(LOG_NOTICE, "%s->%s timelimit=%d, time_left_ms=%d, start_time=%d, feature_timer=%d, play_warning=%d, nexteventts=%d, \n", 
+			c0->name, c1->name, 
+			(int)config->timelimit, 
+			(int)time_left_ms, 
+			(int)config->start_time.tv_sec, 
+			(int)config->feature_timer, 
+			(int)config->play_warning, 
+			(int)nexteventts.tv_sec);
 
 	for (/* ever */;;) {
 		struct timeval now = { 0, };
@@ -3507,6 +3523,7 @@
 			to = ast_tvdiff_ms(nexteventts, now);
 			if (to <= 0 && !config->timelimit) {	
 				res = AST_BRIDGE_COMPLETE;
+				ast_log(LOG_NOTICE, "ABout to break out of bridge -- timelimit reached\n");
 				break;
 			}	
 				
@@ -3526,6 +3543,7 @@
 				if (who) 
 					*rc = who;
 				res = 0;
+				ast_log(LOG_NOTICE, "ABout to break out of bridge -- time_left_ms reached\n");
 				break;
 			}
 			
@@ -3573,6 +3591,7 @@
 				ast_check_hangup(c0) ? "Yes" : "No",
 				ast_test_flag(c1, AST_FLAG_ZOMBIE) ? "Yes" : "No",
 				ast_check_hangup(c1) ? "Yes" : "No");
+			ast_log(LOG_NOTICE, "ABout to break out of bridge -- zombie\n");
 			break;
 		}
 
@@ -3607,6 +3626,7 @@
 				c0->_bridge = NULL;
 				c1->_bridge = NULL;
 
+				ast_log(LOG_NOTICE, "ABout to break out of bridge -- returning!!\n");
 				return res;
 			} else {
 				ast_clear_flag(c0, AST_FLAG_NBRIDGE);
@@ -3620,6 +3640,7 @@
 				/* fallthrough */
 			case AST_BRIDGE_FAILED_NOWARN:
 				nativefailed++;
+				ast_log(LOG_NOTICE, "ABout to break out of bridge -- failed, nowarn\n");
 				break;
 			}
 		}
@@ -3637,12 +3658,17 @@
 					      "CallerID1: %s\r\n"
 					      "CallerID2: %s\r\n",
 					      c0->name, c1->name, c0->uniqueid, c1->uniqueid, c0->cid.cid_num, c1->cid.cid_num);
+				ast_log(LOG_NOTICE, "ABout to Return after manager Unlink\n");
 				return AST_BRIDGE_FAILED;
 			}
 			o0nativeformats = c0->nativeformats;
 			o1nativeformats = c1->nativeformats;
 		}
-		res = ast_generic_bridge(c0, c1, config, fo, rc, nexteventts);
+		res = ast_generic_bridge(c0, c1, config, fo, rc, nexteventts); /* this is where all the work is done */
+		if (res != AST_BRIDGE_RETRY && fo) {
+			ast_log(LOG_NOTICE, "ABout to break out of bridge -- RETRY (res=%d)\n", res);
+			break;
+		}
 	}
 
 	c0->_bridge = NULL;

Modified: team/murf/AEL2-1.2/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/channels/chan_iax2.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/channels/chan_iax2.c (original)
+++ team/murf/AEL2-1.2/channels/chan_iax2.c Tue Dec 12 11:45:56 2006
@@ -410,6 +410,7 @@
 };
 
 static struct iax2_registry *registrations;
+AST_MUTEX_DEFINE_STATIC(reg_lock);
 
 /* Don't retry more frequently than every 10 ms, or less frequently than every 5 seconds */
 #define MIN_RETRY_TIME		100
@@ -4399,8 +4400,8 @@
 	char iabuf[INET_ADDRSTRLEN];
 	if (argc != 3)
 		return RESULT_SHOWUSAGE;
-	ast_mutex_lock(&peerl.lock);
 	ast_cli(fd, FORMAT2, "Host", "Username", "Perceived", "Refresh", "State");
+	ast_mutex_lock(&reg_lock);
 	for (reg = registrations;reg;reg = reg->next) {
 		snprintf(host, sizeof(host), "%s:%d", ast_inet_ntoa(iabuf, sizeof(iabuf), reg->addr.sin_addr), ntohs(reg->addr.sin_port));
 		if (reg->us.sin_addr.s_addr) 
@@ -4410,7 +4411,7 @@
 		ast_cli(fd, FORMAT, host, 
 					reg->username, perceived, reg->refresh, regstate2str(reg->regstate));
 	}
-	ast_mutex_unlock(&peerl.lock);
+	ast_mutex_unlock(&reg_lock);
 	return RESULT_SUCCESS;
 #undef FORMAT
 #undef FORMAT2
@@ -5624,9 +5625,11 @@
 		reg->addr.sin_family = AF_INET;
 		memcpy(&reg->addr.sin_addr, hp->h_addr, sizeof(&reg->addr.sin_addr));
 		reg->addr.sin_port = porta ? htons(atoi(porta)) : htons(IAX_DEFAULT_PORTNO);
+		ast_mutex_lock(&reg_lock);
 		reg->next = registrations;
 		reg->callno = 0;
 		registrations = reg;
+		ast_mutex_unlock(&reg_lock);
 	} else {
 		ast_log(LOG_ERROR, "Out of memory\n");
 		return -1;
@@ -7110,7 +7113,7 @@
 					if (!strcmp(ies.called_number, ast_parking_ext())) {
 						if (iax_park(ast_bridged_channel(iaxs[fr->callno]->owner), iaxs[fr->callno]->owner)) {
 							ast_log(LOG_WARNING, "Failed to park call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
-						} else
+						} else if (ast_bridged_channel(iaxs[fr->callno]->owner))
 							ast_log(LOG_DEBUG, "Parked call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
 					} else {
 						if (ast_async_goto(ast_bridged_channel(iaxs[fr->callno]->owner), iaxs[fr->callno]->context, ies.called_number, 1))
@@ -8582,6 +8585,7 @@
 		user = user->next;
 	}
 	ast_mutex_unlock(&userl.lock);
+	ast_mutex_lock(&reg_lock);
 	for (reg = registrations;reg;) {
 		regl = reg;
 		reg = reg->next;
@@ -8600,6 +8604,7 @@
 		free(regl);
 	}
 	registrations = NULL;
+	ast_mutex_unlock(&reg_lock);
 	ast_mutex_lock(&peerl.lock);
 	for (peer=peerl.peers;peer;) {
 		/* Assume all will be deleted, and we'll find out for sure later */
@@ -8976,8 +8981,10 @@
 	set_config(config,1);
 	prune_peers();
 	prune_users();
+	ast_mutex_lock(&reg_lock);
 	for (reg = registrations; reg; reg = reg->next)
 		iax2_do_register(reg);
+	ast_mutex_unlock(&reg_lock);
 	/* Qualify hosts, too */
 	ast_mutex_lock(&peerl.lock);
 	for (peer = peerl.peers; peer; peer = peer->next)
@@ -9742,8 +9749,10 @@
 		ast_netsock_release(netsock);
 	}
 
+	ast_mutex_lock(&reg_lock);
 	for (reg = registrations; reg; reg = reg->next)
 		iax2_do_register(reg);
+	ast_mutex_unlock(&reg_lock);
 	ast_mutex_lock(&peerl.lock);
 	for (peer = peerl.peers; peer; peer = peer->next) {
 		if (peer->sockfd < 0)

Modified: team/murf/AEL2-1.2/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/channels/chan_misdn.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/channels/chan_misdn.c (original)
+++ team/murf/AEL2-1.2/channels/chan_misdn.c Tue Dec 12 11:45:56 2006
@@ -1966,7 +1966,7 @@
 		chan_misdn_log(1, p->bc->port, " --> *\tUNHOLD pid:%d\n",p->bc?p->bc->pid:-1);
 		break;
 	default:
-		ast_log(LOG_NOTICE, " --> * Unknown Indication:%d pid:%d\n",cond,p->bc?p->bc->pid:-1);
+		chan_misdn_log(1, p->bc->port, " --> * Unknown Indication:%d pid:%d\n",cond,p->bc?p->bc->pid:-1);
 	}
   
 	return 0;
@@ -3183,6 +3183,11 @@
 			if (ch->other_ch) ch->other_ch->other_ch=ch;
 		}
 	}
+
+	tmp=pbx_builtin_getvar_helper(chan,"MISDN_ADDRESS_COMPLETE");
+	if (tmp && (atoi(tmp) == 1)) {
+		bc->sending_complete=1;
+	}
 }
  
 void export_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_list *ch)
@@ -3192,6 +3197,11 @@
 	chan_misdn_log(3,bc->port," --> EXPORT_PID: pid:%d\n",bc->pid);
 	sprintf(tmp,"%d",bc->pid);
 	pbx_builtin_setvar_helper(chan,"_MISDN_PID",tmp);
+
+	if (bc->sending_complete) {
+		sprintf(tmp,"%d",bc->sending_complete);
+		pbx_builtin_setvar_helper(chan,"MISDN_ADDRESS_COMPLETE",tmp);
+	}
 }
 
 
@@ -3936,7 +3946,11 @@
 				int ret=write(ch->pipe[1], bc->bframe, bc->bframe_len);
 				
 				if (ret<=0) {
-					chan_misdn_log(-1, bc->port, "Write returned <=0 (err=%s)\n",strerror(errno));
+					chan_misdn_log(-1, bc->port, "Write returned <=0 (err=%s) --> hanging up channel\n",strerror(errno));
+
+					stop_bc_tones(ch);
+					hangup_chan(ch);
+					release_chan(bc);
 				}
 			} else {
 				chan_misdn_log(1, bc->port, "Wripe Pipe full!\n");
@@ -4092,7 +4106,7 @@
 		break;
 				
 	default:
-		ast_log(LOG_NOTICE, "Got Unknown Event\n");
+		chan_misdn_log(1,0, "Got Unknown Event\n");
 		break;
 	}
 	
@@ -4350,7 +4364,7 @@
 		misdn_lib_send_facility(ch->bc, FACILITY_CALLDEFLECT, tok);
 		
 	} else {
-		ast_log(LOG_WARNING, "Unknown Facility: %s\n",tok);
+		chan_misdn_log(1, ch->bc->port, "Unknown Facility: %s\n",tok);
 	}
 	
 	return 0;

Modified: team/murf/AEL2-1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/channels/chan_sip.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/channels/chan_sip.c (original)
+++ team/murf/AEL2-1.2/channels/chan_sip.c Tue Dec 12 11:45:56 2006
@@ -4259,7 +4259,8 @@
 		add_header(req, "From", ot);
 		add_header(req, "To", of);
 	}
-	add_header(req, "Contact", p->our_contact);
+	if (sipmethod != SIP_BYE && sipmethod != SIP_CANCEL && sipmethod != SIP_MESSAGE)
+		add_header(req, "Contact", p->our_contact);
 	copy_header(req, orig, "Call-ID");
 	add_header(req, "CSeq", tmp);
 
@@ -5661,7 +5662,8 @@
 		ast_copy_string(p->domain, r->domain, sizeof(p->domain));
 		ast_copy_string(p->opaque, r->opaque, sizeof(p->opaque));
 		ast_copy_string(p->qop, r->qop, sizeof(p->qop));
-		p->noncecount = r->noncecount++;
+		r->noncecount++;
+		p->noncecount = r->noncecount;
 
 		memset(digest,0,sizeof(digest));
 		if(!build_reply_digest(p, sipmethod, digest, sizeof(digest)))
@@ -9825,12 +9827,23 @@
 		ast_log(LOG_WARNING, "Re-invite to non-existing call leg on other UA. SIP dialog '%s'. Giving up.\n", p->callid);
 		transmit_request(p, SIP_ACK, seqno, 0, 0);
 		break;
+	case 487: /* Cancelled transaction */
+		/* We have sent CANCEL on an outbound INVITE 
+			This transaction is already scheduled to be killed by sip_hangup().
+		*/
+		transmit_request(p, SIP_ACK, seqno, 0, 0);
+		if (p->owner && !ignore)
+			ast_queue_hangup(p->owner);
+		else if (!ignore)
+			update_call_counter(p, DEC_CALL_LIMIT);
+		break;
 	case 491: /* Pending */
 		/* we have to wait a while, then retransmit */
 		/* Transmission is rescheduled, so everything should be taken care of.
 			We should support the retry-after at some point */
 		break;
 	case 501: /* Not implemented */
+		transmit_request(p, SIP_ACK, seqno, 0, 0);
 		if (p->owner)
 			ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
 		break;
@@ -10138,6 +10151,10 @@
 				ast_set_flag(p, SIP_NEEDDESTROY);	
 
 			break;
+		case 487:
+			if (sipmethod == SIP_INVITE)
+				handle_response_invite(p, resp, rest, req, ignore, seqno);
+			break;
 		case 491: /* Pending */
 			if (sipmethod == SIP_INVITE) {
 				handle_response_invite(p, resp, rest, req, ignore, seqno);
@@ -10152,7 +10169,6 @@
 			if ((resp >= 300) && (resp < 700)) {
 				if ((option_verbose > 2) && (resp != 487))
 					ast_verbose(VERBOSE_PREFIX_3 "Got SIP response %d \"%s\" back from %s\n", resp, rest, ast_inet_ntoa(iabuf, sizeof(iabuf), p->sa.sin_addr));
-				ast_set_flag(p, SIP_ALREADYGONE);	
 				if (p->rtp) {
 					/* Immediately stop RTP */
 					ast_rtp_stop(p->rtp);
@@ -10174,12 +10190,6 @@
 				case 603: /* Decline */
 					if (p->owner)
 						ast_queue_control(p->owner, AST_CONTROL_BUSY);
-					break;
-				case 487:
-					/* channel now destroyed - dec the inUse counter */
-					if (owner)
-						ast_queue_hangup(p->owner);
-					update_call_counter(p, DEC_CALL_LIMIT);
 					break;
 				case 482: /* SIP is incapable of performing a hairpin call, which
 				             is yet another failure of not having a layer 2 (again, YAY
@@ -11438,7 +11448,7 @@
 				goto retrylock;
 		}
 		if (!lockretry) {
-			ast_log(LOG_ERROR, "We could NOT get the channel lock for %s! \n", p->owner->name);
+			ast_log(LOG_ERROR, "We could NOT get the channel lock for %s - Call ID %s! \n", p->owner->name, p->callid);
 			ast_log(LOG_ERROR, "SIP MESSAGE JUST IGNORED: %s \n", req.data);
 			ast_log(LOG_ERROR, "BAD! BAD! BAD!\n");
 			return 1;

Modified: team/murf/AEL2-1.2/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/channels/chan_zap.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/channels/chan_zap.c (original)
+++ team/murf/AEL2-1.2/channels/chan_zap.c Tue Dec 12 11:45:56 2006
@@ -3339,7 +3339,7 @@
 		   stop if now if appropriate */
 		if (ast_bridged_channel(p->subs[SUB_THREEWAY].owner))
 			ast_moh_stop(ast_bridged_channel(p->subs[SUB_THREEWAY].owner));
-		if (p->subs[SUB_THREEWAY].owner->_state == AST_STATE_RINGING) {
+		if (p->subs[SUB_REAL].owner->_state == AST_STATE_RINGING) {
 			ast_indicate(ast_bridged_channel(p->subs[SUB_REAL].owner), AST_CONTROL_RINGING);
 		}
 		if (p->subs[SUB_REAL].owner->cdr) {
@@ -3363,7 +3363,7 @@
 		ast_mutex_unlock(&p->subs[SUB_THREEWAY].owner->lock);
 		unalloc_sub(p, SUB_THREEWAY);
 	} else if (ast_bridged_channel(p->subs[SUB_THREEWAY].owner)) {
-		if (p->subs[SUB_REAL].owner->_state == AST_STATE_RINGING) {
+		if (p->subs[SUB_THREEWAY].owner->_state == AST_STATE_RINGING) {
 			ast_indicate(ast_bridged_channel(p->subs[SUB_THREEWAY].owner), AST_CONTROL_RINGING);
 		}
 		ast_moh_stop(ast_bridged_channel(p->subs[SUB_THREEWAY].owner));
@@ -4853,11 +4853,10 @@
 			}
 #endif
 			res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_RINGTONE);
-			if (chan->_state != AST_STATE_UP) {
-				if ((chan->_state != AST_STATE_RING) ||
-					((p->sig != SIG_FXSKS) &&
+			if (chan->_state != AST_STATE_UP && chan->_state != AST_STATE_RING) {
+				if ((p->sig != SIG_FXSKS) &&
 					 (p->sig != SIG_FXSLS) &&
-					 (p->sig != SIG_FXSGS)))
+					 (p->sig != SIG_FXSGS))
 					ast_setstate(chan, AST_STATE_RINGING);
 			}
 			break;

Modified: team/murf/AEL2-1.2/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/channels/misdn/isdn_msg_parser.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/channels/misdn/isdn_msg_parser.c (original)
+++ team/murf/AEL2-1.2/channels/misdn/isdn_msg_parser.c Tue Dec 12 11:45:56 2006
@@ -322,6 +322,10 @@
 		
     
 		enc_ie_bearer(&setup->BEARER, msg, coding, capability, mode, rate, -1, user, nt,bc);
+	}
+
+	if (bc->sending_complete) {
+		enc_ie_complete(&setup->BEARER,msg, bc->sending_complete, nt, bc);
 	}
   
 #if DEBUG 

Modified: team/murf/AEL2-1.2/configs/extensions.conf.sample
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/configs/extensions.conf.sample?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/configs/extensions.conf.sample (original)
+++ team/murf/AEL2-1.2/configs/extensions.conf.sample Tue Dec 12 11:45:56 2006
@@ -154,7 +154,7 @@
 ;
 ; List canonical entries here
 ;
-;exten => 12564286000,1,Macro(std-exten,6000,IAX2/foo)
+;exten => 12564286000,1,Macro(stdexten,6000,IAX2/foo)
 ;exten => _125642860XX,1,Dial(IAX2/otherbox/${EXTEN:7})
 
 [dundi-e164-customers]

Modified: team/murf/AEL2-1.2/configs/iax.conf.sample
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/configs/iax.conf.sample?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/configs/iax.conf.sample (original)
+++ team/murf/AEL2-1.2/configs/iax.conf.sample Tue Dec 12 11:45:56 2006
@@ -272,7 +272,7 @@
 				; friends expire within this number of seconds instead of the
 				; registration interval.
 
-;rtignoreexpire=yes		; When reading a peer from Realtime, if the peer's registration
+;rtignoreregexpire=yes		; When reading a peer from Realtime, if the peer's registration
 				; has expired based on its registration interval, used the stored
 				; address information regardless. (yes|no)
 

Modified: team/murf/AEL2-1.2/doc/README.misdn
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/doc/README.misdn?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/doc/README.misdn (original)
+++ team/murf/AEL2-1.2/doc/README.misdn Tue Dec 12 11:45:56 2006
@@ -40,6 +40,7 @@
 - Configuration
 - Dial and Options String
 - misdn cli commands
+- mISDN Variables
 - Debugging and sending Bugreports
 - Examples
 - Known working Configurations
@@ -235,6 +236,14 @@
 msn (callerid) of the Phone to send the text to.
 
 
+mISDN Variables
+---------------
+
+mISDN Exports/Imports a few Variables: 
+
+- MISDN_ADDRESS_COMPLETE : 	Is either set to 1 from the Provider, or you 
+				can set it to 1 to force a sending complete.
+				
 
 Debugging and sending bug reports
 ---------------------------------

Modified: team/murf/AEL2-1.2/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/res/res_agi.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/res/res_agi.c (original)
+++ team/murf/AEL2-1.2/res/res_agi.c Tue Dec 12 11:45:56 2006
@@ -234,7 +234,7 @@
 	int audio[2];
 	int x;
 	int res;
-	sigset_t signal_set;
+	sigset_t signal_set, old_set;
 	
 	if (!strncasecmp(script, "agi://", 6))
 		return launch_netscript(script, argv, fds, efd, opid);
@@ -276,6 +276,10 @@
 			return -1;
 		}
 	}
+
+	/* Block SIGHUP during the fork - prevents a race */
+	sigfillset(&signal_set);
+	pthread_sigmask(SIG_BLOCK, &signal_set, &old_set);
 	pid = fork();
 	if (pid < 0) {
 		ast_log(LOG_WARNING, "Failed to fork(): %s\n", strerror(errno));
@@ -293,9 +297,18 @@
 		} else {
 			close(STDERR_FILENO + 1);
 		}
-		
+
+		/* Before we unblock our signals, return our trapped signals back to the defaults */
+		signal(SIGHUP, SIG_DFL);
+		signal(SIGCHLD, SIG_DFL);
+		signal(SIGINT, SIG_DFL);
+		signal(SIGURG, SIG_DFL);
+		signal(SIGTERM, SIG_DFL);
+		signal(SIGPIPE, SIG_DFL);
+		signal(SIGXFSZ, SIG_DFL);
+
 		/* unblock important signal handlers */
-		if (sigfillset(&signal_set) || pthread_sigmask(SIG_UNBLOCK, &signal_set, NULL)) {
+		if (pthread_sigmask(SIG_UNBLOCK, &signal_set, NULL)) {
 			ast_log(LOG_WARNING, "unable to unblock signals for AGI script: %s\n", strerror(errno));
 			_exit(1);
 		}
@@ -310,6 +323,7 @@
 		fprintf(stderr, "Failed to execute '%s': %s\n", script, strerror(errno));
 		_exit(1);
 	}
+	pthread_sigmask(SIG_SETMASK, &old_set, NULL);
 	if (option_verbose > 2) 
 		ast_verbose(VERBOSE_PREFIX_3 "Launched AGI Script %s\n", script);
 	fds[0] = toast[0];

Modified: team/murf/AEL2-1.2/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/res/res_musiconhold.c?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/res/res_musiconhold.c (original)
+++ team/murf/AEL2-1.2/res/res_musiconhold.c Tue Dec 12 11:45:56 2006
@@ -227,6 +227,7 @@
 	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++;
+		state->pos %= state->class->total_files;
 		return -1;
 	}
 
@@ -325,6 +326,7 @@
 	int argc = 0;
 	DIR *dir = NULL;
 	struct dirent *de;
+	sigset_t signal_set, old_set;
 
 	
 	if (!strcasecmp(class->dir, "nodir")) {
@@ -425,6 +427,11 @@
 	if (time(NULL) - class->start < respawn_time) {
 		sleep(respawn_time - (time(NULL) - class->start));
 	}
+
+	/* Block signals during the fork() */
+	sigfillset(&signal_set);
+	pthread_sigmask(SIG_BLOCK, &signal_set, &old_set);
+
 	time(&class->start);
 	class->pid = fork();
 	if (class->pid < 0) {
@@ -438,6 +445,10 @@
 
 		if (option_highpriority)
 			ast_set_priority(0);
+
+		/* Reset ignored signals back to default */
+		signal(SIGPIPE, SIG_DFL);
+		pthread_sigmask(SIG_UNBLOCK, &signal_set, NULL);
 
 		close(fds[0]);
 		/* Stdout goes to pipe */
@@ -465,6 +476,7 @@
 		_exit(1);
 	} else {
 		/* Parent */
+		pthread_sigmask(SIG_SETMASK, &old_set, NULL);
 		close(fds[1]);
 	}
 	return fds[0];

Modified: team/murf/AEL2-1.2/sounds.txt
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/sounds.txt?view=diff&rev=48412&r1=48411&r2=48412
==============================================================================
--- team/murf/AEL2-1.2/sounds.txt (original)
+++ team/murf/AEL2-1.2/sounds.txt Tue Dec 12 11:45:56 2006
@@ -728,3 +728,25 @@
 
 %spy-zap.gsm%Zap
 
+; Silence directory
+
+%1.gsm%1 seconds of silence
+
+%2.gsm%2 seconds of silence
+
+%3.gsm%3 seconds of silence
+
+%4.gsm%4 seconds of silence
+
+%5.gsm%5 seconds of silence
+
+%6.gsm%6 seconds of silence
+
+%7.gsm%7 seconds of silence
+
+%8.gsm%8 seconds of silence
+
+%9.gsm%9 seconds of silence
+
+%10.gsm%10 seconds of silence
+



More information about the asterisk-commits mailing list