[asterisk-commits] kpfleming: branch 1.2-netsec r48421 - in /branches/1.2-netsec: ./ apps/ cdr/ ...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Dec 12 15:58:50 MST 2006


Author: kpfleming
Date: Tue Dec 12 16:58:49 2006
New Revision: 48421

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48421
Log:
manual update, since automerge is not running at this time

Added:
    branches/1.2-netsec/sounds/silence/
      - copied from r48403, branches/1.2/sounds/silence/
    branches/1.2-netsec/sounds/silence/1.gsm
      - copied unchanged from r48403, branches/1.2/sounds/silence/1.gsm
    branches/1.2-netsec/sounds/silence/10.gsm
      - copied unchanged from r48403, branches/1.2/sounds/silence/10.gsm
    branches/1.2-netsec/sounds/silence/2.gsm
      - copied unchanged from r48403, branches/1.2/sounds/silence/2.gsm
    branches/1.2-netsec/sounds/silence/3.gsm
      - copied unchanged from r48403, branches/1.2/sounds/silence/3.gsm
    branches/1.2-netsec/sounds/silence/4.gsm
      - copied unchanged from r48403, branches/1.2/sounds/silence/4.gsm
    branches/1.2-netsec/sounds/silence/5.gsm
      - copied unchanged from r48403, branches/1.2/sounds/silence/5.gsm
    branches/1.2-netsec/sounds/silence/6.gsm
      - copied unchanged from r48403, branches/1.2/sounds/silence/6.gsm
    branches/1.2-netsec/sounds/silence/7.gsm
      - copied unchanged from r48403, branches/1.2/sounds/silence/7.gsm
    branches/1.2-netsec/sounds/silence/8.gsm
      - copied unchanged from r48403, branches/1.2/sounds/silence/8.gsm
    branches/1.2-netsec/sounds/silence/9.gsm
      - copied unchanged from r48403, branches/1.2/sounds/silence/9.gsm
Modified:
    branches/1.2-netsec/   (props changed)
    branches/1.2-netsec/Makefile
    branches/1.2-netsec/apps/app_cut.c
    branches/1.2-netsec/apps/app_db.c
    branches/1.2-netsec/apps/app_dial.c
    branches/1.2-netsec/apps/app_directory.c
    branches/1.2-netsec/apps/app_externalivr.c
    branches/1.2-netsec/apps/app_festival.c
    branches/1.2-netsec/apps/app_ices.c
    branches/1.2-netsec/apps/app_mp3.c
    branches/1.2-netsec/apps/app_nbscat.c
    branches/1.2-netsec/apps/app_sms.c
    branches/1.2-netsec/apps/app_voicemail.c
    branches/1.2-netsec/apps/app_zapras.c
    branches/1.2-netsec/cdr.c
    branches/1.2-netsec/cdr/Makefile
    branches/1.2-netsec/cdr/cdr_pgsql.c
    branches/1.2-netsec/channel.c
    branches/1.2-netsec/channels/chan_iax2.c
    branches/1.2-netsec/channels/chan_local.c
    branches/1.2-netsec/channels/chan_misdn.c
    branches/1.2-netsec/channels/chan_phone.c
    branches/1.2-netsec/channels/chan_sip.c
    branches/1.2-netsec/channels/chan_zap.c
    branches/1.2-netsec/channels/misdn/   (props changed)
    branches/1.2-netsec/channels/misdn/chan_misdn_config.h
    branches/1.2-netsec/channels/misdn/isdn_lib.c
    branches/1.2-netsec/channels/misdn/isdn_msg_parser.c
    branches/1.2-netsec/channels/misdn_config.c
    branches/1.2-netsec/config.c
    branches/1.2-netsec/configs/extensions.conf.sample
    branches/1.2-netsec/configs/iax.conf.sample
    branches/1.2-netsec/configs/sip.conf.sample
    branches/1.2-netsec/doc/README.cdr
    branches/1.2-netsec/doc/README.misdn
    branches/1.2-netsec/frame.c
    branches/1.2-netsec/include/asterisk/channel.h
    branches/1.2-netsec/include/asterisk/config.h
    branches/1.2-netsec/pbx/pbx_spool.c
    branches/1.2-netsec/res/res_agi.c
    branches/1.2-netsec/res/res_features.c
    branches/1.2-netsec/res/res_musiconhold.c
    branches/1.2-netsec/res/res_odbc.c
    branches/1.2-netsec/rtp.c
    branches/1.2-netsec/sounds.txt

Propchange: branches/1.2-netsec/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Dec 12 16:58:49 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-46989
+/branches/1.2:1-48420

Modified: branches/1.2-netsec/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/Makefile?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/Makefile (original)
+++ branches/1.2-netsec/Makefile Tue Dec 12 16:58:49 2006
@@ -557,10 +557,19 @@
 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 \
 			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+		else \
+			echo "No description for $$x"; \
+			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; \

Modified: branches/1.2-netsec/apps/app_cut.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/apps/app_cut.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/apps/app_cut.c (original)
+++ branches/1.2-netsec/apps/app_cut.c Tue Dec 12 16:58:49 2006
@@ -48,7 +48,7 @@
 static char *cut_synopsis = "Splits a variable's contents using the specified delimiter";
 
 static char *cut_descrip =
-"  Cut(newvar=varname,delimiter,fieldspec): This applicaiton will split the\n"
+"  Cut(newvar=varname,delimiter,fieldspec): This application will split the\n"
 "contents of a variable based on the given delimeter and store the result in\n"
 "a new variable.\n"
 "Parameters:\n"
@@ -66,7 +66,7 @@
 "  Sort(newvar=key1:val1[,key2:val2[[...],keyN:valN]]): This application will\n"
 "sort the list provided in ascending order. The result will be stored in the\n"
 "specified variable name.\n"
-"  This applicaiton has been deprecated in favor of the SORT function.\n";
+"  This application has been deprecated in favor of the SORT function.\n";
 
 STANDARD_LOCAL_USER;
 

Modified: branches/1.2-netsec/apps/app_db.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/apps/app_db.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/apps/app_db.c (original)
+++ branches/1.2-netsec/apps/app_db.c Tue Dec 12 16:58:49 2006
@@ -63,7 +63,7 @@
 "  This application has been deprecated in favor of the DB function.\n";
 
 static char *d_descrip =
-"  DBdel(family/key): This applicaiton will delete a key from the Asterisk\n"
+"  DBdel(family/key): This application will delete a key from the Asterisk\n"
 "database.\n";
 
 static char *dt_descrip =

Modified: branches/1.2-netsec/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/apps/app_dial.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/apps/app_dial.c (original)
+++ branches/1.2-netsec/apps/app_dial.c Tue Dec 12 16:58:49 2006
@@ -65,7 +65,7 @@
 
 static char *descrip =
 "  Dial(Technology/resource[&Tech2/resource2...][|timeout][|options][|URL]):\n"
-"This applicaiton will place calls to one or more specified channels. As soon\n"
+"This application will place calls to one or more specified channels. As soon\n"
 "as one of the requested channels answers, the originating channel will be\n"
 "answered, if it has not already been answered. These two channels will then\n"
 "be active in a bridged call. All other channels that were requested will then\n"
@@ -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: branches/1.2-netsec/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/apps/app_directory.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/apps/app_directory.c (original)
+++ branches/1.2-netsec/apps/app_directory.c Tue Dec 12 16:58:49 2006
@@ -61,7 +61,7 @@
 "the calling channel with a directory of extensions from which they can search\n"
 "by name. The list of names and corresponding extensions is retrieved from the\n"
 "voicemail configuration file, voicemail.conf.\n"
-"  This applicaiton will immediate exit if one of the following DTMF digits are\n"
+"  This application will immediately exit if one of the following DTMF digits are\n"
 "received and the extension to jump to exists:\n"
 "    0 - Jump to the 'o' extension, if it exists.\n"
 "    * - Jump to the 'a' extension, if it exists.\n\n"

Modified: branches/1.2-netsec/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/apps/app_externalivr.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/apps/app_externalivr.c (original)
+++ branches/1.2-netsec/apps/app_externalivr.c Tue Dec 12 16:58:49 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: branches/1.2-netsec/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/apps/app_festival.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/apps/app_festival.c (original)
+++ branches/1.2-netsec/apps/app_festival.c Tue Dec 12 16:58:49 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: branches/1.2-netsec/apps/app_ices.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/apps/app_ices.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/apps/app_ices.c (original)
+++ branches/1.2-netsec/apps/app_ices.c Tue Dec 12 16:58:49 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: branches/1.2-netsec/apps/app_mp3.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/apps/app_mp3.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/apps/app_mp3.c (original)
+++ branches/1.2-netsec/apps/app_mp3.c Tue Dec 12 16:58:49 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: branches/1.2-netsec/apps/app_nbscat.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/apps/app_nbscat.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/apps/app_nbscat.c (original)
+++ branches/1.2-netsec/apps/app_nbscat.c Tue Dec 12 16:58:49 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: branches/1.2-netsec/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/apps/app_sms.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/apps/app_sms.c (original)
+++ branches/1.2-netsec/apps/app_sms.c Tue Dec 12 16:58:49 2006
@@ -1050,7 +1050,7 @@
 		unsigned char p = 2;
 		h->omsg[0] = 0x91;		  /* SMS_DATA */
 		if (h->smsc) {			 /* deliver */
-			h->omsg[p++] = (more ? 4 : 0);
+			h->omsg[p++] = (more ? 4 : 0) + ((h->udhl > 0) ? 0x40 : 0);
 			p += packaddress (h->omsg + p, h->oa);
 			h->omsg[p++] = h->pid;
 			h->omsg[p++] = h->dcs;

Modified: branches/1.2-netsec/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/apps/app_voicemail.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/apps/app_voicemail.c (original)
+++ branches/1.2-netsec/apps/app_voicemail.c Tue Dec 12 16:58:49 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,17 +937,25 @@
 						fd = -1;
 						continue;
 					}
-					if (fd > -1)
-						fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
-				}
-				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;
+					/* 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;
+							}
+						}
 					}
+					truncate(full_fn, fdlen);
 				}
 			} else {
 				res = SQLGetData(stmt, x + 1, SQL_CHAR, rowdata, sizeof(rowdata), NULL);
@@ -964,8 +974,6 @@
 yuck:	
 	if (f)
 		fclose(f);
-	if (fdm)
-		munmap(fdm, fdlen);
 	if (fd > -1)
 		close(fd);
 	return x - 1;
@@ -2749,7 +2757,7 @@
 {
 	int bytes = 0;
 	bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 1, ADSI_JUST_CENT, 0, "Comedian Mail", "");
-	bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 2, ADSI_JUST_CENT, 0, "(C)2002 LSS, Inc.", "");
+	bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 2, ADSI_JUST_CENT, 0, "(C)2002-2006 Digium, Inc.", "");
 	return bytes;
 }
 
@@ -3277,12 +3285,11 @@
 	return res;
 }
 
-static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu, char *curdir, int curmsg, char *vmfts,
-			     char *context, signed char record_gain)
+static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu, char *curdir, int curmsg, char *vmfmts,
+			     char *context, signed char record_gain, long *duration)
 {
 	int cmd = 0;
 	int retries = 0;
-	int duration = 0;
 	signed char zero_gain = 0;
 
 	while ((cmd >= 0) && (cmd != 't') && (cmd != '*')) {
@@ -3290,15 +3297,66 @@
 			retries = 0;
 		switch (cmd) {
 		case '1': 
-			/* prepend a message to the current message and return */
+			/* prepend a message to the current message, update the metadata and return */
 		{
-			char file[200];
-			snprintf(file, sizeof(file), "%s/msg%04d", curdir, curmsg);
+			char msgfile[PATH_MAX];
+			char textfile[PATH_MAX];
+			int prepend_duration = 0;
+			struct ast_config *msg_cfg;
+			char *duration_str;
+
+			make_file(msgfile, sizeof(msgfile), curdir, curmsg);
+			strcpy(textfile, msgfile);
+			strncat(textfile, ".txt", sizeof(textfile) - 1);
+			*duration = 0;
+
+			/* if we can't read the message metadata, stop now */
+			if (!(msg_cfg = ast_config_load(textfile))) {
+				cmd = 0;
+				break;
+			}
+
 			if (record_gain)
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &record_gain, sizeof(record_gain), 0);
-			cmd = ast_play_and_prepend(chan, NULL, file, 0, vmfmts, &duration, 1, silencethreshold, maxsilence);
+
+			cmd = ast_play_and_prepend(chan, NULL, msgfile, 0, vmfmts, &prepend_duration, 1, silencethreshold, maxsilence);
 			if (record_gain)
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &zero_gain, sizeof(zero_gain), 0);
+
+			
+			if ((duration_str = ast_variable_retrieve(msg_cfg, "message", "duration")))
+				*duration = atoi(duration_str);
+
+			if (prepend_duration) {
+				struct ast_variable *var, *prev = NULL, *varlist;
+				struct ast_category *msg_cat;
+
+				*duration += prepend_duration;
+				msg_cat = ast_category_get(msg_cfg, "message");
+				varlist = ast_category_detach_variables(msg_cat);
+				for (var = varlist; var; prev = var, var = var->next) {
+					if (!strcmp(var->name, "duration")) {
+						if (!prev)
+							varlist = var->next;
+						else
+							prev->next = var->next;
+						free(var);
+						break;
+					}
+				}
+				/* need enough space for a maximum-length message duration */
+				duration_str = alloca(12);
+				snprintf(duration_str, 11, "%ld", *duration);
+				if ((var = ast_variable_new("duration", duration_str))) {
+					ast_variable_append(msg_cat, varlist);
+					ast_variable_append(msg_cat, var);
+					config_text_file_save(textfile, msg_cfg, "app_voicemail");
+					STORE(curdir, vmu->mailbox, context, curmsg);
+				}
+			}
+
+			ast_config_destroy(msg_cfg);
+
 			break;
 		}
 		case '2': 
@@ -3509,11 +3567,13 @@
 		cmd = leave_voicemail(chan, mailbox, &leave_options);
 	} else {
 		/* Forward VoiceMail */
+		long duration = 0;
+
 		RETRIEVE(dir, curmsg);
-		cmd = vm_forwardoptions(chan, sender, dir, curmsg, vmfmts, context, record_gain);
+		cmd = vm_forwardoptions(chan, sender, dir, curmsg, vmfmts, context, record_gain, &duration);
 		if (!cmd) {
 			while (!res && vmtmp) {
-				copy_message(chan, sender, 0, curmsg, 0, vmtmp, fmt);
+				copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt);
 	
 				saved_messages++;
 				vmfree = vmtmp;
@@ -5711,22 +5771,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: branches/1.2-netsec/apps/app_zapras.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/apps/app_zapras.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/apps/app_zapras.c (original)
+++ branches/1.2-netsec/apps/app_zapras.c Tue Dec 12 16:58:49 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: branches/1.2-netsec/cdr.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/cdr.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/cdr.c (original)
+++ branches/1.2-netsec/cdr.c Tue Dec 12 16:58:49 2006
@@ -440,11 +440,11 @@
 		next = cdr->next;
 		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_POSTED) && !ast_test_flag(cdr, AST_CDR_FLAG_POST_DISABLED))
-			ast_log(LOG_WARNING, "CDR on channel '%s' not posted\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' not posted\n", chan);
 		if (ast_tvzero(cdr->end))
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks end\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks end\n", chan);
 		if (ast_tvzero(cdr->start))
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks start\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks start\n", chan);
 
 		ast_cdr_free_vars(cdr, 0);
 		free(cdr);
@@ -806,11 +806,11 @@
 	while (cdr) {
 		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
 		if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
-			ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' already posted\n", chan);
 		if (ast_tvzero(cdr->end))
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks end\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks end\n", chan);
 		if (ast_tvzero(cdr->start)) {
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks start\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks start\n", chan);
 			cdr->disposition = AST_CDR_FAILED;
 		} else
 			cdr->duration = cdr->end.tv_sec - cdr->start.tv_sec;

Modified: branches/1.2-netsec/cdr/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/cdr/Makefile?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/cdr/Makefile (original)
+++ branches/1.2-netsec/cdr/Makefile Tue Dec 12 16:58:49 2006
@@ -65,7 +65,7 @@
 #
 # PGSQL stuff...  Autoconf anyone??
 #
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql/libpq-fe.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include/libpq-fe.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql/libpq-fe.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql/libpq-fe.h)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include/libpq-fe.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
   MODS+=cdr_pgsql.so
 endif
 

Modified: branches/1.2-netsec/cdr/cdr_pgsql.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/cdr/cdr_pgsql.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/cdr/cdr_pgsql.c (original)
+++ branches/1.2-netsec/cdr/cdr_pgsql.c Tue Dec 12 16:58:49 2006
@@ -64,8 +64,8 @@
 
 AST_MUTEX_DEFINE_STATIC(pgsql_lock);
 
-PGconn		*conn;
-PGresult	*result;
+PGconn		*conn = NULL;
+PGresult	*result = NULL;
 
 static int pgsql_log(struct ast_cdr *cdr)
 {

Modified: branches/1.2-netsec/channel.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/channel.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/channel.c (original)
+++ branches/1.2-netsec/channel.c Tue Dec 12 16:58:49 2006
@@ -355,8 +355,11 @@
 {
 	struct chanlist *chan, *last=NULL;
 
-	if (option_debug)
+	if (option_debug && tech && tech->type )
 		ast_log(LOG_DEBUG, "Unregistering channel type '%s'\n", tech->type);
+	else if (option_debug)
+		ast_log(LOG_DEBUG, "Unregistering channel, tech is NULL!!!\n");
+		
 
 	ast_mutex_lock(&chlock);
 
@@ -732,43 +735,34 @@
 					       const char *context, const char *exten)
 {
 	const char *msg = prev ? "deadlock" : "initial deadlock";
-	int retries, done;
+	int retries;
 	struct ast_channel *c;
 
 	for (retries = 0; retries < 10; retries++) {
+		int done;
+
 		ast_mutex_lock(&chlock);
 		for (c = channels; c; c = c->next) {
-			if (!prev) {
-				/* want head of list */
-				if (!name && !exten)
-					break;
-				if (name) {
-					/* want match by full name */
-					if (!namelen) {
-						if (!strcasecmp(c->name, name))
-							break;
-						else
-							continue;
-					}
-					/* want match by name prefix */
-					if (!strncasecmp(c->name, name, namelen))
-						break;
-				} else if (exten) {
-					/* want match by context and exten */
-					if (context && (strcasecmp(c->context, context) &&
-							strcasecmp(c->macrocontext, context)))
-						continue;
-					/* match by exten */
-					if (strcasecmp(c->exten, exten) &&
-					    strcasecmp(c->macroexten, exten))
-						continue;
-					else
-						break;
-				}
-			} else if (c == prev) { /* found, return c->next */
+			if (prev) {	/* look for next item */
+				if (c != prev)	/* not this one */
+					continue;
+				/* found, prepare to return c->next */
 				c = c->next;
-				break;
 			}
+			if (name) { /* want match by name */
+				if ((!namelen && strcasecmp(c->name, name)) ||
+				    (namelen && strncasecmp(c->name, name, namelen)))
+					continue;	/* name match failed */
+			} else if (exten) {
+				if (context && strcasecmp(c->context, context) &&
+				    strcasecmp(c->macrocontext, context))
+					continue;	/* context match failed */
+				if (strcasecmp(c->exten, exten) &&
+				    strcasecmp(c->macroexten, exten))
+					continue;	/* exten match failed */
+			}
+			/* if we get here, c points to the desired record */
+			break;
 		}
 		/* exit if chan not found or mutex acquired successfully */
 		done = (c == NULL) || (ast_mutex_trylock(&c->lock) == 0);
@@ -2301,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) {
@@ -2590,6 +2589,7 @@
 				      c->cid.cid_num ? c->cid.cid_num : "<unknown>",
 				      c->cid.cid_name ? c->cid.cid_name : "<unknown>",
 				      c->uniqueid);
+			ast_set_flag(c, AST_FLAG_NOTNEW);
 		}
 		return c;
 	}
@@ -3253,7 +3253,7 @@
 	chan->_state = state;
 	ast_device_state_changed_literal(chan->name);
 	manager_event(EVENT_FLAG_CALL,
-		      (oldstate == AST_STATE_DOWN) ? "Newchannel" : "Newstate",
+		      (oldstate == AST_STATE_DOWN && !ast_test_flag(chan, AST_FLAG_NOTNEW)) ? "Newchannel" : "Newstate",
 		      "Channel: %s\r\n"
 		      "State: %s\r\n"
 		      "CallerID: %s\r\n"
@@ -3510,10 +3510,11 @@
 		if (!ast_tvzero(nexteventts)) {
 			now = ast_tvnow();
 			to = ast_tvdiff_ms(nexteventts, now);
-			if (to <= 0) {
+			if (to <= 0 && !config->timelimit) {	
 				res = AST_BRIDGE_COMPLETE;
 				break;
-			}
+			}	
+				
 		}
 
 		if (config->timelimit) {
@@ -3533,7 +3534,7 @@
 				break;
 			}
 			
-			if (!to) {
+			if (to <= 0) {
 				if (time_left_ms >= 5000) {
 					/* force the time left to round up if appropriate */
 					if (caller_warning && config->warning_sound && config->play_warning)
@@ -3545,8 +3546,11 @@
 				}
 				if (config->warning_freq) {
 					nexteventts = ast_tvadd(nexteventts, ast_samp2tv(config->warning_freq, 1000));
-				} else
+				}
+					
+				if ( (!config->warning_freq) ||  ( config->timelimit - ast_tvdiff_ms(nexteventts, config->start_time) < 0)) {
 					nexteventts = ast_tvadd(config->start_time, ast_samp2tv(config->timelimit, 1000));
+				}
 			}
 		}
 
@@ -3644,7 +3648,7 @@
 			o1nativeformats = c1->nativeformats;
 		}
 		res = ast_generic_bridge(c0, c1, config, fo, rc, nexteventts);
-		if (res != AST_BRIDGE_RETRY)
+		if (res != AST_BRIDGE_RETRY && fo)
 			break;
 	}
 

Modified: branches/1.2-netsec/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/channels/chan_iax2.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/channels/chan_iax2.c (original)
+++ branches/1.2-netsec/channels/chan_iax2.c Tue Dec 12 16:58:49 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)
@@ -9347,9 +9354,6 @@
 
 	buf[0] = '\0';
 
-	if (chan->tech != &iax2_tech)
-		return buf;
-
 	if (!(peername = ast_strdupa(data))) {
 		ast_log(LOG_ERROR, "Memory Error!\n");
 		return ret;
@@ -9357,7 +9361,10 @@
 
 	/* if our channel, return the IP address of the endpoint of current channel */
 	if (!strcmp(peername,"CURRENTCHANNEL")) {
-	        unsigned short callno = PTR_TO_CALLNO(chan->tech_pvt);
+	        unsigned short callno;
+		if (chan->tech != &iax2_tech)
+			return buf;
+		callno = PTR_TO_CALLNO(chan->tech_pvt);	
 		ast_copy_string(buf, iaxs[callno]->addr.sin_addr.s_addr ? ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[callno]->addr.sin_addr) : "", len);
 		return buf;
 	}
@@ -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: branches/1.2-netsec/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/channels/chan_local.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/channels/chan_local.c (original)
+++ branches/1.2-netsec/channels/chan_local.c Tue Dec 12 16:58:49 2006
@@ -167,6 +167,9 @@
 	struct local_pvt *p = ast->tech_pvt;
 	int isoutbound;
 	int res = -1;
+
+	if (!p)
+		return -1;
 
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
@@ -245,6 +248,9 @@
 	int res = -1;
 	int isoutbound;
 
+	if (!p)
+		return -1;
+
 	/* Just queue for delivery to the other side */
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
@@ -263,6 +269,10 @@
 static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
 {
 	struct local_pvt *p = newchan->tech_pvt;
+
+	if (!p)
+		return -1;
+
 	ast_mutex_lock(&p->lock);
 
 	if ((p->owner != oldchan) && (p->chan != oldchan)) {
@@ -285,6 +295,9 @@
 	struct ast_frame f = { AST_FRAME_CONTROL, };
 	int isoutbound;
 
+	if (!p)
+		return -1;
+
 	/* Queue up a frame representing the indication as a control frame */
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
@@ -301,6 +314,9 @@
 	struct ast_frame f = { AST_FRAME_DTMF, };
 	int isoutbound;
 
+	if (!p)
+		return -1;
+
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
 	f.subclass = digit;
@@ -316,6 +332,9 @@
 	struct ast_frame f = { AST_FRAME_HTML, };
 	int isoutbound;
 
+	if (!p)
+		return -1;
+	
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
 	f.subclass = subclass;
@@ -334,6 +353,9 @@
 	int res;
 	struct ast_var_t *varptr = NULL, *new;
 	size_t len, namelen;
+
+	if (!p)
+		return -1;
 	
 	ast_mutex_lock(&p->lock);
 
@@ -409,6 +431,9 @@
 	struct local_pvt *cur, *prev=NULL;
 	struct ast_channel *ochan = NULL;
 	int glaredetect;
+
+	if (!p)
+		return -1;
 
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);

Modified: branches/1.2-netsec/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/branches/1.2-netsec/channels/chan_misdn.c?view=diff&rev=48421&r1=48420&r2=48421
==============================================================================
--- branches/1.2-netsec/channels/chan_misdn.c (original)
+++ branches/1.2-netsec/channels/chan_misdn.c Tue Dec 12 16:58:49 2006
@@ -796,8 +796,8 @@
 			print_bc_info(fd, help, bc);
 		} else {
 			if (help->state == MISDN_HOLDED) {
-				chan_misdn_log(0, 0, "ITS A HOLDED BC:\n");
-				chan_misdn_log(0,0," --> l3_id: %x\n"
+				chan_misdn_log(2, 0, "ITS A HOLDED BC:\n");
+				chan_misdn_log(2,0," --> l3_id: %x\n"
 						" --> dad:%s oad:%s\n"
 				
 						,help->l3id
@@ -1220,8 +1220,7 @@
 	
 	int port=bc->port;
 	
-	chan_misdn_log(1,port,"update_config: Getting Config\n");
-
+	chan_misdn_log(7,port,"update_config: Getting Config\n");
 
 	int hdlc=0;
 	misdn_cfg_get( port, MISDN_CFG_HDLC, &hdlc, sizeof(int));
@@ -1635,7 +1634,7 @@
 	
 	chan_misdn_log(1, port, "* CALL: %s\n",dest);
 	
-	chan_misdn_log(1, port, " --> * dad:%s tech:%s ctx:%s\n",ast->exten,ast->name, ast->context);
+	chan_misdn_log(2, port, " --> * dad:%s tech:%s ctx:%s\n",ast->exten,ast->name, ast->context);
 	
 	chan_misdn_log(3, port, " --> * adding2newbc ext %s\n",ast->exten);
 	if (ast->exten) {
@@ -1691,7 +1690,7 @@
 		return -1;
 	}
 	
-	chan_misdn_log(1, port, " --> * SEND: State Dialing pid:%d\n",newbc?newbc->pid:1);
+	chan_misdn_log(2, port, " --> * SEND: State Dialing pid:%d\n",newbc?newbc->pid:1);
 
 	ast_setstate(ast, AST_STATE_DIALING);
 	ast->hangupcause=16;
@@ -1855,12 +1854,11 @@
 		return -1;
 	}
 	
-	chan_misdn_log(1, p->bc->port, "* IND : Indication [%d] from %s\n",cond, ast->exten);

[... 1566 lines stripped ...]


More information about the asterisk-commits mailing list