[svn-commits] branch kpfleming/test-for-merging - r7284 in /team/kpfleming/test-for-merging...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Dec 2 12:06:09 CST 2005


Author: kpfleming
Date: Fri Dec  2 12:06:07 2005
New Revision: 7284

URL: http://svn.digium.com/view/asterisk?rev=7284&view=rev
Log:
Merged revisions 7257,7261,7263,7265-7266,7268-7275 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r7257 | kpfleming | 2005-12-01 13:25:06 -0600 (Thu, 01 Dec 2005) | 2 lines

ensure that 'svn info' output is in the expected language for the script to parse (issue #5880)

........
r7261 | oej | 2005-12-01 15:38:38 -0600 (Thu, 01 Dec 2005) | 2 lines

Fixing some spelling errors, as well as changing "cvs" to "subversion" in misdn documentation.

........
r7263 | oej | 2005-12-01 16:21:13 -0600 (Thu, 01 Dec 2005) | 2 lines

Removing references to 1.1dev, replacing with 1.2, in documentation files.

........
r7265 | oej | 2005-12-01 17:18:14 -0600 (Thu, 01 Dec 2005) | 2 lines

Changing bug report address to the Asterisk issue tracker

........
r7266 | kpfleming | 2005-12-01 17:18:29 -0600 (Thu, 01 Dec 2005) | 3 lines

Makefile 'update' target now supports updating from Subversion repositories (issue #5875)
remove support for 'patches' subdirectory, it's no longer useful

........
r7268 | kpfleming | 2005-12-01 17:34:58 -0600 (Thu, 01 Dec 2005) | 2 lines

ensure channel's scheduling context is freed (issue #5788)

........
r7269 | kpfleming | 2005-12-01 17:49:44 -0600 (Thu, 01 Dec 2005) | 2 lines

don't block waiting for the Festival server forever when it goes away (issue #5882)

........
r7270 | kpfleming | 2005-12-01 18:26:12 -0600 (Thu, 01 Dec 2005) | 2 lines

allow variables to exist on both 'halves' of the Local channel (issue #5810)

........
r7271 | kpfleming | 2005-12-01 18:28:48 -0600 (Thu, 01 Dec 2005) | 2 lines

protect agent_bridgedchannel() from segfaulting when there is no bridged channel (issue #5879)

........
r7272 | kpfleming | 2005-12-01 18:39:00 -0600 (Thu, 01 Dec 2005) | 3 lines

properly handle password changes when mailbox is last line of config file and not followed by a newline (issue #5870)
reformat password changing code to conform to coding guidelines (issue #5870)

........
r7273 | kpfleming | 2005-12-01 18:42:40 -0600 (Thu, 01 Dec 2005) | 2 lines

allow previous context-searching behavior to be used if desired (issue #5899)

........
r7274 | kpfleming | 2005-12-01 18:51:15 -0600 (Thu, 01 Dec 2005) | 2 lines

inherit channel variables into channels created by Page() application (issue #5888)

........
r7275 | oej | 2005-12-01 18:52:13 -0600 (Thu, 01 Dec 2005) | 2 lines

Bug #5907. Improve SIP INFO DTMF debugging output. (1.2 & Trunk)

........

Removed:
    team/kpfleming/test-for-merging/patches/
Modified:
    team/kpfleming/test-for-merging/   (props changed)
    team/kpfleming/test-for-merging/Makefile
    team/kpfleming/test-for-merging/UPGRADE.txt
    team/kpfleming/test-for-merging/apps/app_festival.c
    team/kpfleming/test-for-merging/apps/app_page.c
    team/kpfleming/test-for-merging/apps/app_voicemail.c
    team/kpfleming/test-for-merging/build_tools/make_svn_branch_name
    team/kpfleming/test-for-merging/channel.c
    team/kpfleming/test-for-merging/channels/chan_agent.c
    team/kpfleming/test-for-merging/channels/chan_local.c
    team/kpfleming/test-for-merging/channels/chan_sip.c
    team/kpfleming/test-for-merging/configs/voicemail.conf.sample
    team/kpfleming/test-for-merging/doc/README.jitterbuffer
    team/kpfleming/test-for-merging/doc/README.misdn
    team/kpfleming/test-for-merging/doc/README.realtime
    team/kpfleming/test-for-merging/pbx.c

Propchange: team/kpfleming/test-for-merging/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Dec  2 12:06:07 2005
@@ -1,1 +1,1 @@
-/branches/1.2:1-7252
+/branches/1.2:1-7283

Modified: team/kpfleming/test-for-merging/Makefile
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/Makefile?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/Makefile (original)
+++ team/kpfleming/test-for-merging/Makefile Fri Dec  2 12:06:07 2005
@@ -592,17 +592,16 @@
 	mkdir -p $(DESTDIR)$(AGI_DIR)
 
 update: 
-	@if [ -d CVS ]; then \
-		if [ -f patches/.applied ]; then \
-			patches=`cat patches/.applied`; \
-		fi; \
-		if [ ! -z "$$patches" ]; then \
-			for x in $$patches; do \
-				echo "Unapplying $$x..."; \
-				patch -R -p0 < patches/$$x; \
-			done; \
-			rm -f patches/.applied; \
+	@if [ -d .svn ]; then \
+		echo "Updating from Subversion..." ; \
+		svn update | tee update.out; \
+		rm -f .version; \
+		if [ `grep -c ^C update.out` -gt 0 ]; then \
+			echo ; echo "The following files have conflicts:" ; \
+			grep ^C update.out | cut -b4- ; \
 		fi ; \
+		rm -f update.out; \
+	elif [ -d CVS ]; then \
 		echo "Updating from CVS..." ; \
 		cvs -q -z3 update -Pd | tee update.out; \
 		rm -f .version; \
@@ -611,19 +610,8 @@
 			grep ^C update.out | cut -d' ' -f2- ; \
 		fi ; \
 		rm -f update.out; \
-		if [ ! -z "$$patches" ]; then \
-			for x in $$patches; do \
-				if [ -f patches/$$x ]; then \
-					echo "Applying patch $$x..."; \
-					patch -p0 < patches/$$x; \
-					echo $$x >> patches/.applied; \
-				else \
-					echo "Patch $$x no longer relevant"; \
-				fi; \
-			done; \
-		fi; \
 	else \
-		echo "Not CVS";  \
+		echo "Not under version control";  \
 	fi
 
 NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h))
@@ -911,47 +899,3 @@
 	if cmp -s .cleancount .lastclean ; then echo ; else \
 		$(MAKE) clean; cp -f .cleancount .lastclean;\
 	fi
-
-patchlist:
-	@echo "Experimental Patches:"
-	@for x in patches/*; do \
-		patch=`basename $$x`; \
-		if [ "$$patch" = "CVS" ]; then \
-			continue; \
-		fi; \
-		if grep -q ^$$patch$$ patches/.applied; then \
-			echo "$$patch (applied)"; \
-		else \
-			echo "$$patch (available)"; \
-		fi; \
-	done
-
-apply: 
-	@if [ -z "$(PATCH)" ]; then \
-		echo "Usage: make PATCH=<patchname> apply"; \
-	elif grep -q ^$(PATCH)$$ patches/.applied 2>/dev/null; then \
-		echo "Patch $(PATCH) is already applied"; \
-	elif [ -f "patches/$(PATCH)" ]; then \
-		echo "Applying patch $(PATCH)"; \
-		patch -p0 < patches/$(PATCH); \
-		echo "$(PATCH)" >> patches/.applied; \
-	else \
-		echo "No such patch $(PATCH) in patches directory"; \
-	fi
-
-unapply: 
-	@if [ -z "$(PATCH)" ]; then \
-		echo "Usage: make PATCH=<patchname> unapply"; \
-	elif grep -v -q ^$(PATCH)$$ patches/.applied 2>/dev/null; then \
-		echo "Patch $(PATCH) is not applied"; \
-	elif [ -f "patches/$(PATCH)" ]; then \
-		echo "Un-applying patch $(PATCH)"; \
-		patch -p0 -R < patches/$(PATCH); \
-		rm -f patches/.tmpapplied || :; \
-		mv patches/.applied patches/.tmpapplied; \
-		cat patches/.tmpapplied | grep -v ^$(PATCH)$$ > patches/.applied; \
-		rm -f patches/.tmpapplied; \
-	else \
-		echo "No such patch $(PATCH) in patches directory"; \
-	fi
-

Modified: team/kpfleming/test-for-merging/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/UPGRADE.txt?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/UPGRADE.txt (original)
+++ team/kpfleming/test-for-merging/UPGRADE.txt Fri Dec  2 12:06:07 2005
@@ -133,7 +133,8 @@
 
 * The application VoiceMailMain now only matches the 'default' context if
   none is specified in the arguments.  (This was the previously 
-  documented behavior, however, we didn't follow that behavior.)
+  documented behavior, however, we didn't follow that behavior.)  The old
+  behavior can be restored by setting searchcontexts=yes in voicemail.conf.
 
 Queues:
 

Modified: team/kpfleming/test-for-merging/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_festival.c?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_festival.c (original)
+++ team/kpfleming/test-for-merging/apps/app_festival.c Fri Dec  2 12:06:07 2005
@@ -455,8 +455,20 @@
 	/* This assumes only one waveform will come back, also LP is unlikely */
 	wave = 0;
 	do {
+               int read_data;
 		for (n=0; n < 3; )
-			n += read(fd,ack+n,3-n);
+               {
+                       read_data = read(fd,ack+n,3-n);
+                       /* this avoids falling in infinite loop
+                        * in case that festival server goes down
+                        * */
+                       if ( read_data == -1 )
+                       {
+                               ast_log(LOG_WARNING,"Unable to read from cache/festival fd");
+                               return -1;
+                       }
+                       n += read_data;
+               }
 		ack[3] = '\0';
 		if (strcmp(ack,"WV\n") == 0) {         /* receive a waveform */
 			ast_log(LOG_DEBUG,"Festival WV command\n");

Modified: team/kpfleming/test-for-merging/apps/app_page.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_page.c?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_page.c (original)
+++ team/kpfleming/test-for-merging/apps/app_page.c Fri Dec  2 12:06:07 2005
@@ -40,6 +40,7 @@
 #include "asterisk/module.h"
 #include "asterisk/file.h"
 #include "asterisk/app.h"
+#include "asterisk/chanvars.h"
 
 
 static const char *tdesc = "Page Multiple Phones";
@@ -77,13 +78,14 @@
 	char tech[64];
 	char resource[256];
 	char meetmeopts[64];
+	struct ast_variable *variables;
 };
 
 static void *page_thread(void *data)
 {
 	struct calloutdata *cd = data;
 	ast_pbx_outgoing_app(cd->tech, AST_FORMAT_SLINEAR, cd->resource, 30000,
-		"MeetMe", cd->meetmeopts, NULL, 0, cd->cidnum, cd->cidname, NULL, NULL);
+		"MeetMe", cd->meetmeopts, NULL, 0, cd->cidnum, cd->cidname, cd->variables, NULL);
 	free(cd);
 	return NULL;
 }
@@ -91,6 +93,9 @@
 static void launch_page(struct ast_channel *chan, const char *meetmeopts, const char *tech, const char *resource)
 {
 	struct calloutdata *cd;
+	const char *varname;
+	struct ast_variable *lastvar = NULL;
+	struct ast_var_t *varptr;
 	pthread_t t;
 	pthread_attr_t attr;
 	cd = malloc(sizeof(struct calloutdata));
@@ -101,6 +106,29 @@
 		ast_copy_string(cd->tech, tech, sizeof(cd->tech));
 		ast_copy_string(cd->resource, resource, sizeof(cd->resource));
 		ast_copy_string(cd->meetmeopts, meetmeopts, sizeof(cd->meetmeopts));
+
+		AST_LIST_TRAVERSE(&chan->varshead, varptr, entries) {
+			if (!(varname = ast_var_full_name(varptr)))
+				continue;
+			if (varname[0] == '_') {
+				struct ast_variable *newvar = NULL;
+
+				if (varname[1] == '_') {
+					newvar = ast_variable_new(varname, ast_var_value(varptr));
+				} else {
+					newvar = ast_variable_new(&varname[1], ast_var_value(varptr));
+				}
+
+				if (newvar) {
+					if (lastvar)
+						lastvar->next = newvar;
+					else
+						cd->variables = newvar;
+					lastvar = newvar;
+				}
+			}
+		}
+
 		pthread_attr_init(&attr);
 		pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 		if (ast_pthread_create(&t, &attr, page_thread, cd)) {

Modified: team/kpfleming/test-for-merging/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/apps/app_voicemail.c?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/apps/app_voicemail.c (original)
+++ team/kpfleming/test-for-merging/apps/app_voicemail.c Fri Dec  2 12:06:07 2005
@@ -110,6 +110,7 @@
 #define VM_ATTACH		(1 << 11)
 #define VM_DELETE		(1 << 12)
 #define VM_ALLOCED		(1 << 13)
+#define VM_SEARCH		(1 << 14)
 
 #define ERROR_LOCK_PATH		-100
 
@@ -534,12 +535,11 @@
 			ast_set_flag(retval, VM_ALLOCED);	
 		if (mailbox) 
 			ast_copy_string(retval->mailbox, mailbox, sizeof(retval->mailbox));
-		if (context) 
-			ast_copy_string(retval->context, context, sizeof(retval->context));
+		populate_defaults(retval);
+		if (ast_test_flag((&globalflags), VM_SEARCH))
+			var = ast_load_realtime("voicemail", "mailbox", mailbox, NULL);
 		else
-			strcpy(retval->context, "default");
-		populate_defaults(retval);
-		var = ast_load_realtime("voicemail", "mailbox", mailbox, "context", retval->context, NULL);
+			var = ast_load_realtime("voicemail", "mailbox", mailbox, "context", retval->context, NULL);
 		if (var) {
 			tmp = var;
 			while(tmp) {
@@ -554,6 +554,8 @@
 					ast_copy_string(retval->email, tmp->value, sizeof(retval->email));
 				} else if (!strcasecmp(tmp->name, "fullname")) {
 					ast_copy_string(retval->fullname, tmp->value, sizeof(retval->fullname));
+				} else if (!strcasecmp(tmp->name, "context")) {
+					ast_copy_string(retval->context, tmp->value, sizeof(retval->context));
 				} else
 					apply_option(retval, tmp->name, tmp->value);
 				tmp = tmp->next;
@@ -574,13 +576,14 @@
 	ast_mutex_lock(&vmlock);
 	cur = users;
 
-	if (!context)
+	if (!context && !ast_test_flag((&globalflags), VM_SEARCH))
 		context = "default";
 
 	while (cur) {
-		if ((!strcasecmp(context, cur->context)) &&
-			(!strcasecmp(mailbox, cur->mailbox)))
-				break;
+		if (ast_test_flag((&globalflags), VM_SEARCH) && !strcasecmp(mailbox, cur->mailbox))
+			break;
+		if ((!strcasecmp(context, cur->context)) && (!strcasecmp(mailbox, cur->mailbox)))
+			break;
 		cur=cur->next;
 	}
 	if (cur) {
@@ -660,91 +663,89 @@
 	}
 
 	while (!feof(configin)) {
+		char *user = NULL, *pass = NULL, *rest = NULL, *comment = NULL, *tmpctx = NULL, *tmpctxend = NULL;
+
 		/* Read in the line */
 		fgets(inbuf, sizeof(inbuf), configin);
 		linenum++;
-		if (!feof(configin)) {
-			char *user = NULL, *pass = NULL, *rest = NULL,
-				*comment = NULL, *tmpctx = NULL, *tmpctxend = NULL;
-			
-			if (ast_strlen_zero(inbuf)) {
-				fprintf(configout, "\n");
-				continue;
-			}
-
-			/* Make a backup of it */
-			ast_copy_string(orig, inbuf, sizeof(orig));
-			
-			/*
-			  Read the file line by line, split each line into a comment and command section
-			  only parse the command portion of the line
-			*/
-			if (inbuf[strlen(inbuf) - 1] == '\n')
-				inbuf[strlen(inbuf) - 1] = '\0';
-
-			if ((comment = strchr(inbuf, ';')))
-				*comment++ = '\0'; /* Now inbuf is terminated just before the comment */
-
-			if (ast_strlen_zero(inbuf)) {
+
+		if (ast_strlen_zero(inbuf)) {
+			fprintf(configout, "\n");
+			continue;
+		}
+
+		/* Make a backup of it */
+		ast_copy_string(orig, inbuf, sizeof(orig));
+
+		/*
+		  Read the file line by line, split each line into a comment and command section
+		  only parse the command portion of the line
+		*/
+		if (inbuf[strlen(inbuf) - 1] == '\n')
+			inbuf[strlen(inbuf) - 1] = '\0';
+
+		if ((comment = strchr(inbuf, ';')))
+			*comment++ = '\0'; /* Now inbuf is terminated just before the comment */
+
+		if (ast_strlen_zero(inbuf)) {
+			fprintf(configout, "%s", orig);
+			continue;
+		}
+
+		/* Check for a context, first '[' to first ']' */
+		if ((tmpctx = strchr(inbuf, '['))) {
+			tmpctxend = strchr(tmpctx, ']');
+			if (tmpctxend) {
+				/* Valid context */
+				ast_copy_string(currcontext, tmpctx + 1, tmpctxend - tmpctx);
 				fprintf(configout, "%s", orig);
 				continue;
 			}
-			
-			/* Check for a context, first '[' to first ']' */
-			if ((tmpctx = strchr(inbuf, '['))) {
-				tmpctxend = strchr(tmpctx, ']');
-				if (tmpctxend) {
-					/* Valid context */
-					ast_copy_string(currcontext, tmpctx + 1, tmpctxend - tmpctx);
-					fprintf(configout, "%s", orig);
-					continue;
-				}
-			}
-				
-			/* This isn't a context line, check for MBX => PSWD... */
-			user = inbuf;
-			if ((pass = strchr(user, '='))) {
-				/* We have a line in the form of aaaaa=aaaaaa */
+		}
+
+		/* This isn't a context line, check for MBX => PSWD... */
+		user = inbuf;
+		if ((pass = strchr(user, '='))) {
+			/* We have a line in the form of aaaaa=aaaaaa */
+			*pass++ = '\0';
+
+			user = ast_strip(user);
+
+			if (*pass == '>')
 				*pass++ = '\0';
-				
-				user = ast_strip(user);
-
-				if (*pass == '>')
-					*pass++ = '\0';
-
-				pass = ast_skip_blanks(pass);
-				
-				/* 
-				   Since no whitespace allowed in fields, or more correctly white space
-				   inside the fields is there for a purpose, we can just terminate pass
-				   at the comma or EOL whichever comes first.
-				*/
-				if ((rest = strchr(pass, ',')))
-					*rest++ = '\0';
+
+			pass = ast_skip_blanks(pass);
+
+			/* 
+			   Since no whitespace allowed in fields, or more correctly white space
+			   inside the fields is there for a purpose, we can just terminate pass
+			   at the comma or EOL whichever comes first.
+			*/
+			if ((rest = strchr(pass, ',')))
+				*rest++ = '\0';
+		} else {
+			user = NULL;
+		}			
+
+		/* Compare user, pass AND context */
+		if (!ast_strlen_zero(user) && !strcmp(user, vmu->mailbox) &&
+		    !ast_strlen_zero(pass) && !strcmp(pass, vmu->password) &&
+		    !strcasecmp(currcontext, vmu->context)) {
+			/* This is the line */
+			if (rest) {
+				fprintf(configout, "%s => %s,%s", user, newpassword, rest);
 			} else {
-				user = NULL;
-			}			
-			
-			/* Compare user, pass AND context */
-			if (!ast_strlen_zero(user) && !strcmp(user, vmu->mailbox) &&
-			    !ast_strlen_zero(pass) && !strcmp(pass, vmu->password) &&
-			    !strcasecmp(currcontext, vmu->context)) {
-				/* This is the line */
-				if (rest) {
-					fprintf(configout, "%s => %s,%s", user, newpassword, rest);
-				} else {
-					fprintf(configout, "%s => %s", user, newpassword);
-				}
-				/* If there was a comment on the line print it out */
-				if (comment) {
-					fprintf(configout, ";%s\n", comment);
-				} else {
-					fprintf(configout, "\n");
-				}
+				fprintf(configout, "%s => %s", user, newpassword);
+			}
+			/* If there was a comment on the line print it out */
+			if (comment) {
+				fprintf(configout, ";%s\n", comment);
 			} else {
-				/* Put it back like it was */
-				fprintf(configout, "%s", orig);
-			}
+				fprintf(configout, "\n");
+			}
+		} else {
+			/* Put it back like it was */
+			fprintf(configout, "%s", orig);
 		}
 	}
 	fclose(configin);
@@ -5812,6 +5813,7 @@
 	struct ast_variable *var;
 	char *notifystr = NULL;
 	char *astattach;
+	char *astsearch;
 	char *astsaycid;
 	char *send_voicemail;
 	char *astcallop;
@@ -5864,6 +5866,10 @@
 		if (!(astattach = ast_variable_retrieve(cfg, "general", "attach"))) 
 			astattach = "yes";
 		ast_set2_flag((&globalflags), ast_true(astattach), VM_ATTACH);	
+
+		if (!(astsearch = ast_variable_retrieve(cfg, "general", "searchcontexts")))
+			astsearch = "no";
+		ast_set2_flag((&globalflags), ast_true(astsearch), VM_SEARCH);
 
 #ifdef USE_ODBC_STORAGE
 		strcpy(odbc_database, "asterisk");

Modified: team/kpfleming/test-for-merging/build_tools/make_svn_branch_name
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/build_tools/make_svn_branch_name?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/build_tools/make_svn_branch_name (original)
+++ team/kpfleming/test-for-merging/build_tools/make_svn_branch_name Fri Dec  2 12:06:07 2005
@@ -1,10 +1,10 @@
 #!/bin/sh
 
-PARTS=`svn info | grep URL | awk '{print $2;}' | sed -e s:^.*/svn/asterisk/:: | sed -e 's:/: :'`
+PARTS=`LANG=C svn info | grep URL | awk '{print $2;}' | sed -e s:^.*/svn/asterisk/:: | sed -e 's:/: :'`
 BRANCH=0
 TEAM=0
 
-REV=`svn info | grep -e 'Last Changed Rev' | awk '{print $4;}'`
+REV=`LANG=C svn info | grep -e 'Last Changed Rev' | awk '{print $4;}'`
 
 if [ "${PARTS}" = "trunk" ]
 then

Modified: team/kpfleming/test-for-merging/channel.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/channel.c?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/channel.c (original)
+++ team/kpfleming/test-for-merging/channel.c Fri Dec  2 12:06:07 2005
@@ -909,8 +909,11 @@
 		free(chan->tech_pvt);
 	}
 
+	if (chan->sched)
+		sched_context_destroy(chan->sched);
+
 	ast_copy_string(name, chan->name, sizeof(name));
-	
+
 	/* Stop monitoring */
 	if (chan->monitor) {
 		chan->monitor->stop( chan, 0 );
@@ -1294,8 +1297,10 @@
 		ast_closestream(chan->stream);
 	if (chan->vstream)		/* Close video stream */
 		ast_closestream(chan->vstream);
-	if (chan->sched)
+	if (chan->sched) {
 		sched_context_destroy(chan->sched);
+		chan->sched = NULL;
+	}
 	
 	if (chan->generatordata)	/* Clear any tone stuff remaining */ 
 		chan->generator->release(chan, chan->generatordata);

Modified: team/kpfleming/test-for-merging/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/channels/chan_agent.c?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/channels/chan_agent.c (original)
+++ team/kpfleming/test-for-merging/channels/chan_agent.c Fri Dec  2 12:06:07 2005
@@ -910,15 +910,16 @@
 
 static struct ast_channel *agent_bridgedchannel(struct ast_channel *chan, struct ast_channel *bridge)
 {
-	struct agent_pvt *p;
+	struct agent_pvt *p = bridge->tech_pvt;
 	struct ast_channel *ret=NULL;
-	
-
-	p = bridge->tech_pvt;
-	if (chan == p->chan)
-		ret = bridge->_bridge;
-	else if (chan == bridge->_bridge)
-		ret = p->chan;
+
+	if (p) {
+		if (chan == p->chan)
+			ret = bridge->_bridge;
+		else if (chan == bridge->_bridge)
+			ret = p->chan;
+	}
+
 	if (option_debug)
 		ast_log(LOG_DEBUG, "Asked for bridged channel on '%s'/'%s', returning '%s'\n", chan->name, bridge->name, ret ? ret->name : "<none>");
 	return ret;

Modified: team/kpfleming/test-for-merging/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/channels/chan_local.c?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/channels/chan_local.c (original)
+++ team/kpfleming/test-for-merging/channels/chan_local.c Fri Dec  2 12:06:07 2005
@@ -320,6 +320,8 @@
 {
 	struct local_pvt *p = ast->tech_pvt;
 	int res;
+	struct ast_var_t *varptr = NULL, *new;
+	size_t len, namelen;
 	
 	ast_mutex_lock(&p->lock);
 	if (p->owner->cid.cid_num)
@@ -345,9 +347,22 @@
 	strncpy(p->chan->language, p->owner->language, sizeof(p->chan->language) - 1);
 	strncpy(p->chan->accountcode, p->owner->accountcode, sizeof(p->chan->accountcode) - 1);
 	p->chan->cdrflags = p->owner->cdrflags;
-	/* move the channel variables from the incoming channel to the outgoing channel */
-	AST_LIST_HEAD_SET_NOLOCK(&p->chan->varshead, AST_LIST_FIRST(&p->owner->varshead));
-	AST_LIST_HEAD_INIT_NOLOCK(&p->owner->varshead);
+
+	/* copy the channel variables from the incoming channel to the outgoing channel */
+	/* Note that due to certain assumptions, they MUST be in the same order */
+	AST_LIST_TRAVERSE(&p->owner->varshead, varptr, entries) {
+		namelen = strlen(varptr->name);
+		len = sizeof(struct ast_var_t) + namelen + strlen(varptr->value) + 2;
+		new = malloc(len);
+		if (new) {
+			memcpy(new, varptr, len);
+			new->value = &(new->name[0]) + namelen + 1;
+			AST_LIST_INSERT_TAIL(&p->chan->varshead, new, entries);
+		} else {
+			ast_log(LOG_ERROR, "Out of memory!\n");
+		}
+	}
+
 	p->launchedpbx = 1;
 
 	/* Start switch on sub channel */

Modified: team/kpfleming/test-for-merging/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/channels/chan_sip.c?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/channels/chan_sip.c (original)
+++ team/kpfleming/test-for-merging/channels/chan_sip.c Fri Dec  2 12:06:07 2005
@@ -8604,8 +8604,6 @@
 			return;
 		}
 
-		if (sipdebug)
-			ast_verbose("* DTMF-relay event received: '%c'\n", buf[0]);
 		if (buf[0] == '*')
 			event = 10;
 		else if (buf[0] == '#')
@@ -8618,6 +8616,8 @@
 			/* send a FLASH event */
 			struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_FLASH, };
 			ast_queue_frame(p->owner, &f);
+			if (sipdebug)
+				ast_verbose("* DTMF-relay event received: FLASH\n");
 		} else {
 			/* send a DTMF event */
 			struct ast_frame f = { AST_FRAME_DTMF, };
@@ -8631,6 +8631,8 @@
 				f.subclass = 'A' + (event - 12);
 			}
 			ast_queue_frame(p->owner, &f);
+			if (sipdebug)
+				ast_verbose("* DTMF-relay event received: %c\n", f.subclass);
 		}
 		transmit_response(p, "200 OK", req);
 		return;

Modified: team/kpfleming/test-for-merging/configs/voicemail.conf.sample
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/configs/voicemail.conf.sample?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/configs/voicemail.conf.sample (original)
+++ team/kpfleming/test-for-merging/configs/voicemail.conf.sample Fri Dec  2 12:06:07 2005
@@ -160,6 +160,9 @@
 sendvoicemail=yes	; Context to Send voicemail from [option 5 from the advanced menu]
   			; if not listed, sending messages from inside voicemail will not be 
 			; permitted
+; searchcontexts=yes	; Current default behavior is to search only the default context
+			; if one is not specified.  The older behavior was to search all contexts.
+			; This option restores the old behavior [DEFAULT=no]
 ; callback=fromvm 	; Context to call back from  
 			;     if not listed, calling the sender back will not be permitted
 ; review=yes 		; Allow sender to review/rerecord their message before saving it [OFF by default

Modified: team/kpfleming/test-for-merging/doc/README.jitterbuffer
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/doc/README.jitterbuffer?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/doc/README.jitterbuffer (original)
+++ team/kpfleming/test-for-merging/doc/README.jitterbuffer Fri Dec  2 12:06:07 2005
@@ -33,7 +33,7 @@
 
 3) Trunktimestamps:
 -------------------
-To use this, both sides must be using Asterisk v1.1dev (or coming 1.2 stable).
+To use this, both sides must be using Asterisk v1.2.
 Setting "trunktimestamps=yes" in iax.conf will cause your box to send 16-bit timestamps 
 for each trunked frame inside of a trunk frame. This will enable you to use jitterbuffer
 for an IAX2 trunk, something that was not possible in the old architecture.

Modified: team/kpfleming/test-for-merging/doc/README.misdn
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/doc/README.misdn?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/doc/README.misdn (original)
+++ team/kpfleming/test-for-merging/doc/README.misdn Fri Dec  2 12:06:07 2005
@@ -6,6 +6,7 @@
 supports every mISDN Hardware and provides an interface for asterisk. 
 
 Features: 
+---------
 
 * NT and TE mode
 * PP and PMP mode
@@ -18,11 +19,12 @@
 * Volume Control 
 * Crypting with mISDNdsp (Blowfish)
 * Data (HDLC) callthrough 
-* Data Callin (with app_ptyfork +pppd)
-* echo cancellation
-* some other
+* Data Calling (with app_ptyfork +pppd)
+* Echo cancellation
+* Some other
 
 Supported Hardware:
+-------------------
 
 chan_misdn supports any mISDN compatible Hardware. Especially the 1-8 Port
 BRI Cards available from http://shop.beronet.com
@@ -76,18 +78,19 @@
 --------------
 
 To compile and install this driver, you'll need at least one mISDN Driver, the
-mISDNuser package and the asterisk includes (which will be inside of the
-sources). Chan_misdn works with both, the current stable release and the cvs-head version of Asterisk.
+mISDNuser package and the Asterisk includes (which will be inside of the
+sources). Chan_misdn works with both, the current release version and the 
+development (svn trunk) version of Asterisk.
 
 To get the mISDN stuff please follow the instructions at
 http://www.isdn4linux.de.  Please Note that mISDN works good for the
 linux-2.6.x kernels. Some of the mISDN drivers do not compile against the
-2.4.x or older kernels, you can patch them, but than you'll get myterius
+2.4.x or older kernels, you can patch them, but than you'll get mysterious
 errors.
 
- I use Kernels > 2.6.9 and it works perfect. with kernels >= 2.6.10 there is a
+I use Kernels > 2.6.9 and it works perfect. with kernels >= 2.6.10 there is a
 very litle bug in hfc_multi.c which causes the module not to compile, it can
-be easyly fixed by changenging pci_findsubsys to pci_getsubsys in code.
+be easily fixed by changing pci_findsubsys to pci_getsubsys in code.
 
 Ok so far so good, now follow the compilation instructions.
 
@@ -100,19 +103,19 @@
 !! the compilation stops near iapplication.h, this isn't very important
 !! at this step you are ready. 
 
-After you've successfully installed mISDN, mISDNuser and asterisk, you should
+After you've successfully installed mISDN, mISDNuser and Asterisk, you should
 modify the Makefile in the chan_misdn source path. There you can tell the
 Makefile where to install the driver, sample-conf, and most important where it
-can find the linux kernel includes, the mISDNuser package and the asterisk
-includes.  If you use the Head-Revision of Asterisk (or at least a newer
-version than stable) uncomment the CCFLAGS+=-DASTERISK_STABLE, the stable
-version of asterisk is at the moment v1-0-X as cvs tag.
+can find the linux kernel includes, the mISDNuser package and the Asterisk
+includes.  If you use the development version of Asterisk (or at least a newer
+version than release) uncomment the CCFLAGS+=-DASTERISK_STABLE, the release
+version of Asterisk is at the moment v1-2 as subversion branch.
 
 Now you can type in: 
 
 make
 
-This should compile chan_misdn.so, if theres an error check the paths in the
+This should compile chan_misdn.so, if there's an error check the paths in the
 Makefile again.
 
 
@@ -123,10 +126,10 @@
 
 make install 
 
-as privileged user to put chan_misdn.so in the asterisk modules
+as privileged user to put chan_misdn.so in the Asterisk modules
 directory.
 
-You should see a Msg like: "Successfully installed chan_misdn". 
+You should see a message like: "Successfully installed chan_misdn". 
 Congratulations. 
 
 Theres a sample init.d script for loading the mISDN modules (mISDN.sample),
@@ -141,67 +144,68 @@
 
 First of all you must configure the mISDN drivers. Each driver module has got
 an options and layermask option, which tells the driver wether to start in
-TE,NT, PP or PMP mode (there are lots more please read docs in misdn for
+TE, NT, PP or PMP mode (there are lots more, please read docs in misdn for
 that).
 
 After thinking about the above you'll probably want to configure the
-misdn.conf file which resides in the asterisk-config directory.
-
+misdn.conf file which resides in the asterisk config directory (normally
+/etc/asterisk).
+
+- misdn.conf: [general]
 The misdn.conf file contains a "general" Section, and user sections which
-contain misdn port settings and different asterisk contexts.
+contain misdn port settings and different Asterisk contexts.
 
 The general section contains especially a variable named context with which
 the default context is set. There is also the very important debug variable
-which you can set from the asterisk cli (command line interface) or in this
-configfile, bigger numbers will lead to more debug output. Theres also a
-tracefile options, which takes a path+filename where debug output is written
+which you can set from the Asterisk cli (command line interface) or in this
+configuration file, bigger numbers will lead to more debug output. There's also a
+tracefile option, which takes a path+filename where debug output is written
 to.
 
-The user Sections have names which are unequal to "general". Those sections
+- misdn.conf: user/port sections
+The user sections have names which are unequal to "general". Those sections
 contain the ports variable which mean the mISDN Ports. Here you can add
-comma-sepperated multiple ports. 
+multiple ports, comma separated. 
 
 Espacially for TE-Mode Ports there is a msns variable. This variable tells the
 chan_misdn driver to listen for incomming calls with the given msns, you can
-insert a '*' as single msn, which leads in getting every incomming call (if
+insert a '*' as single msn, which leads in getting every incoming call (if
 you want to share on PMP TE S0 with a asterisk and a phone or isdn card you
-should insert here the msns which you'll like to give the asterisk).  Finally
+should insert here the msns which you'll like to give the Asterisk).  Finally
 a context variable resides in the user sections, which tells chan_misdn where
-to send incomming calls to (extension.conf).
+to send incoming calls to in the Asterisk dial plan (extension.conf).
 
 In NT-Mode Ports there is a new option, directly after the port number you can
-write ptp, this enables PP Mode for this port, please look at misdn.conf for
+write ptp, this enables PP Mode for this port, please look at misdn.conf.sample for
 an example.
-
-When everything worked you should get the asterisk running.
 
 
 Dial and Options String
 -----------------------
 
-The Dialstring of chan_misdn got more complex, because we added more features,
-so the generic dialstring looks like:
+The dial string of chan_misdn got more complex, because we added more features,
+so the generic dial string looks like:
 
 mISDN/<port>|g:<group>/<extension>[/<OPTIONSSTRING>]
 
 The Optionsstring looks Like:
 :<optchar1><OptParam1>:<optchar2><OptParam2>
 
-the ":" character is the delimeter.
+the ":" character is the delimiter.
 
 The available Optchars are: 
 	d - Send display text on called phone, text is the optparam
 	n - don't detect dtmf tones on called channel
 	h - make digital outgoing call
 	c - make crypted outgoing call, param is keyindex
-	e - perform echo cancelation on this channel, takes taps as 
-	arguments (32,64,128,256)
+	e - perform echo cancelation on this channel, 
+	    takes taps as arguments (32,64,128,256)
 	s - send Non Inband DTMF as inband
 	vr - rxgain control
 	vt - txgain control
 
 
-chan_misdn registers a new application "misdn_set_opt" when loaded. This 
+chan_misdn registers a new dial plan application "misdn_set_opt" when loaded. This 
 application takes the Optionsstring as argument. The Syntax is:
 
 misdn_set_opt(<OPTIONSSTRING>)
@@ -231,7 +235,7 @@
 misdn cli commands
 ------------------
 
-At the asterisk cli you can try to type in: 
+At the Asterisk cli you can try to type in: 
 
 misdn <tab> <tab>
 
@@ -241,7 +245,7 @@
 	-> pid 		(cleans a broken call, use with care, leads often
 			 to a segmentation fault)
 - send
-	-> display	(sends a Text Message to a asterisk channel, 
+	-> display	(sends a Text Message to a Asterisk channel, 
 			 this channel must be an misdn channel)
 - set
 	-> debug	(sets debug level)
@@ -257,9 +261,9 @@
 
 - reload 		(reloads misdn.conf)
 
-You can only use "misdn send display" when a asterisk channel is created and
-isdn is in the corect state, correct state means that you have established a
-call to another phone (mustnt be isdn though).
+You can only use "misdn send display" when an Asterisk channel is created and
+isdn is in the correct state. "correct state" means that you have established a
+call to another phone (mustn't be isdn though).
 
 Then you use it like this:
 
@@ -270,18 +274,24 @@
 
 
 
-Debugging and sending Bug-Reports
+Debugging and sending bug reports
 ---------------------------------
 
-If you encounter problems, you should set up the debugging flag, usually debug=1 should be enough. the Messages are divided in asterisk and misdn parts. Misdn Debug messages begin with an 'I', asterisk messages begin with an '*', the rest is clear I think. 
-
-Please take a trace of the problem and send this trace via mail to bugs at beronet.com
+If you encounter problems, you should set up the debugging flag, usually debug=1 
+should be enough. the messages are divided in asterisk and misdn parts. 
+Misdn Debug messages begin with an 'I', asterisk messages begin with an '*', 
+the rest is clear I think. 
+
+Please take a trace of the problem and open a report in the Asterisk issue
+tracker at http://bugs.digium.com in the "channel drivers" project,
+"chan_misdn" category. Read the bug guidelines to make sure you
+provide all the information needed.
 
 
 Examples
 --------
 
-here some examples of how to use chan_misdn in the dialplan (extensions.conf): 
+Here are some examples of how to use chan_misdn in the dialplan (extensions.conf): 
 
 
 [globals]
@@ -298,10 +308,10 @@
 as Display Message to the Phone.
 
 
-Known working Configurations
+Known working configurations
 ----------------------------
 
-In this Section I'll put working configurations for chan_misdn. Beware It
+In this section I'll put working configurations for chan_misdn. Beware It
 seems that between Kernel 2.6.3 and Kernel 2.6.8 there were lots of mISDN
 Bugs. I use Kernel 2.6.9 now, it works quite ok, Kernel 2.6.10+ has changed
 the pci_find_subgsys funktion, so hfc_multi from mISDN doesn't compile against
@@ -351,13 +361,12 @@
 and dtmf tone detection
 
 * I have strange ISDN behavior: sometimes I hear the other end, sometimes
-not. also i get STATUS Events with cause 100, with misdn debugging
+not. Also I get STATUS Events with cause 100, with misdn debugging
 
 -> Please update to newest version of chan_misdn and set the te_choose_channel
 option in misdn.conf to yes
 
 Changes
 -------
-
 in the Changes File
 

Modified: team/kpfleming/test-for-merging/doc/README.realtime
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/doc/README.realtime?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/doc/README.realtime (original)
+++ team/kpfleming/test-for-merging/doc/README.realtime Fri Dec  2 12:06:07 2005
@@ -2,8 +2,8 @@
 ----------------------------------
 
 The Asterisk Realtime Architecture is a new set of drivers and 
-functions implemented in Asterisk 1.1dev (and the following v1.2 stable).
-The benefits of this architecture are many, both from a code management
+functions implemented in Asterisk 1.2. The benefits of this 
+architecture are many, both from a code management
 standpoint and from an installation perspective. 
 
 Additional information on the configuration of Realtime with Asterisk 

Modified: team/kpfleming/test-for-merging/pbx.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/test-for-merging/pbx.c?rev=7284&r1=7283&r2=7284&view=diff
==============================================================================
--- team/kpfleming/test-for-merging/pbx.c (original)
+++ team/kpfleming/test-for-merging/pbx.c Fri Dec  2 12:06:07 2005
@@ -5217,7 +5217,7 @@
 			goto outgoing_app_cleanup;
 		}
 		memset(as, 0, sizeof(struct async_stat));
-		chan = ast_request_and_dial(type, format, data, timeout, reason, cid_num, cid_name);
+		chan = __ast_request_and_dial(type, format, data, timeout, reason, cid_num, cid_name, &oh);
 		if (!chan) {
 			free(as);
 			res = -1;



More information about the svn-commits mailing list