[svn-commits] branch kpfleming/vldtmf r34845 - in /team/kpfleming/vldtmf: ./ apps/ build_to...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon Jun 19 08:25:14 MST 2006


Author: kpfleming
Date: Mon Jun 19 10:25:13 2006
New Revision: 34845

URL: http://svn.digium.com/view/asterisk?rev=34845&view=rev
Log:
update to trunk

Added:
    team/kpfleming/vldtmf/build_tools/get_makeopts
      - copied unchanged from r34844, trunk/build_tools/get_makeopts
    team/kpfleming/vldtmf/build_tools/get_moduleinfo
      - copied unchanged from r34844, trunk/build_tools/get_moduleinfo
    team/kpfleming/vldtmf/pbx/ael/ael-test/ael-test8/
      - copied from r34844, trunk/pbx/ael/ael-test/ael-test8/
    team/kpfleming/vldtmf/pbx/ael/ael-test/ael-test8/extensions.ael
      - copied unchanged from r34844, trunk/pbx/ael/ael-test/ael-test8/extensions.ael
    team/kpfleming/vldtmf/pbx/ael/ael-test/ref.ael-test8
      - copied unchanged from r34844, trunk/pbx/ael/ael-test/ref.ael-test8
Removed:
    team/kpfleming/vldtmf/build_tools/get_moduledeps
Modified:
    team/kpfleming/vldtmf/   (props changed)
    team/kpfleming/vldtmf/Makefile
    team/kpfleming/vldtmf/apps/Makefile
    team/kpfleming/vldtmf/apps/app_voicemail.c
    team/kpfleming/vldtmf/build_tools/cflags.xml
    team/kpfleming/vldtmf/build_tools/menuselect.c
    team/kpfleming/vldtmf/build_tools/menuselect.h
    team/kpfleming/vldtmf/build_tools/prep_moduledeps
    team/kpfleming/vldtmf/cdr/Makefile
    team/kpfleming/vldtmf/channels/Makefile
    team/kpfleming/vldtmf/channels/chan_iax2.c
    team/kpfleming/vldtmf/channels/chan_jingle.c
    team/kpfleming/vldtmf/channels/chan_misdn.c
    team/kpfleming/vldtmf/channels/chan_skinny.c
    team/kpfleming/vldtmf/channels/misdn/isdn_lib.c
    team/kpfleming/vldtmf/channels/misdn/isdn_lib.h
    team/kpfleming/vldtmf/codecs/Makefile
    team/kpfleming/vldtmf/configs/iax.conf.sample
    team/kpfleming/vldtmf/configs/indications.conf.sample
    team/kpfleming/vldtmf/configs/skinny.conf.sample
    team/kpfleming/vldtmf/db1-ast/Makefile
    team/kpfleming/vldtmf/doc/ael.txt
    team/kpfleming/vldtmf/doc/radius.txt
    team/kpfleming/vldtmf/formats/Makefile
    team/kpfleming/vldtmf/funcs/Makefile
    team/kpfleming/vldtmf/include/asterisk/ael_structs.h
    team/kpfleming/vldtmf/pbx/Makefile
    team/kpfleming/vldtmf/pbx/ael/ael-test/ref.ael-test1
    team/kpfleming/vldtmf/pbx/ael/ael-test/ref.ael-test2
    team/kpfleming/vldtmf/pbx/ael/ael-test/ref.ael-test3
    team/kpfleming/vldtmf/pbx/ael/ael-test/ref.ael-test4
    team/kpfleming/vldtmf/pbx/ael/ael-test/ref.ael-test5
    team/kpfleming/vldtmf/pbx/ael/ael-test/ref.ael-test6
    team/kpfleming/vldtmf/pbx/ael/ael-test/ref.ael-test7
    team/kpfleming/vldtmf/pbx/ael/ael.tab.c
    team/kpfleming/vldtmf/pbx/ael/ael.tab.h
    team/kpfleming/vldtmf/pbx/ael/ael.y
    team/kpfleming/vldtmf/pbx/ael/ael_lex.c
    team/kpfleming/vldtmf/pbx/pbx_ael.c
    team/kpfleming/vldtmf/res/Makefile
    team/kpfleming/vldtmf/res/res_jabber.c
    team/kpfleming/vldtmf/res/res_smdi.c
    team/kpfleming/vldtmf/say.c
    team/kpfleming/vldtmf/sounds/Makefile

Propchange: team/kpfleming/vldtmf/
------------------------------------------------------------------------------
    automerge = yeah

Propchange: team/kpfleming/vldtmf/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/kpfleming/vldtmf/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/kpfleming/vldtmf/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jun 19 10:25:13 2006
@@ -1,1 +1,1 @@
-/trunk:1-34488
+/trunk:1-34844

Modified: team/kpfleming/vldtmf/Makefile
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/Makefile?rev=34845&r1=34844&r2=34845&view=diff
==============================================================================
--- team/kpfleming/vldtmf/Makefile (original)
+++ team/kpfleming/vldtmf/Makefile Mon Jun 19 10:25:13 2006
@@ -145,13 +145,13 @@
 OPTIMIZE+=-O6
   else
     # Stack backtraces, while useful for debugging, are incompatible with optimizations
-    ifeq (${OSARCH},Linux)
+    ifeq ($(OSARCH),Linux)
       CFLAGS+=-DSTACK_BACKTRACES
     endif
   endif
 else
   # Stack backtraces, while useful for debugging, are incompatible with optimizations
-  ifeq (${OSARCH},Linux)
+  ifeq ($(OSARCH),Linux)
     CFLAGS+=-DSTACK_BACKTRACES
   endif
 endif
@@ -263,21 +263,14 @@
   RPMVERSION=unknown
 endif
 
-# CVS mirrors of SVN have .svnrevision files showing
-# which SVN revision they are based on, and .svnbranch
-# showing the branch they are made from
-ifneq ($(wildcard .svnrevision),)
+ifneq ($(wildcard .svn),)
   ASTERISKVERSIONNUM=999999
-else
-  ifneq ($(wildcard .svn),)
-    ASTERISKVERSIONNUM=999999
-  endif
 endif
 
 ASTCFLAGS+=$(MALLOC_DEBUG)$(BUSYDETECT)$(OPTIONS)
 
 MOD_SUBDIRS=res channels pbx apps codecs formats cdr funcs
-OTHER_SUBDIRS=utils stdtime agi
+OTHER_SUBDIRS=utils agi
 SUBDIRS:=$(MOD_SUBDIRS) $(OTHER_SUBDIRS)
 
 OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
@@ -458,36 +451,33 @@
 
 defaults.h: makeopts
 	@build_tools/make_defaults_h > $@.tmp
-	@if cmp -s $@.tmp $@ ; then echo ; else \
+	@if cmp -s $@.tmp $@ ; then : ; else \
 		mv $@.tmp $@ ; \
 	fi
 	@rm -f $@.tmp
 
 include/asterisk/version.h:
 	@build_tools/make_version_h > $@.tmp
-	@if cmp -s $@.tmp $@ ; then echo; else \
+	@if cmp -s $@.tmp $@ ; then : ; else \
 		mv $@.tmp $@ ; \
 	fi
 	@rm -f $@.tmp
 
 include/asterisk/buildopts.h: menuselect.makeopts
 	@build_tools/make_buildopts_h > $@.tmp
-	@if cmp -s $@.tmp $@ ; then echo; else \
+	@if cmp -s $@.tmp $@ ; then : ; else \
 		mv $@.tmp $@ ; \
 	fi
 	@rm -f $@.tmp
 
-stdtime/libtime.a:
-	CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C stdtime libtime.a
-
-asterisk: include/asterisk/buildopts.h editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
+asterisk: include/asterisk/buildopts.h editline/libedit.a db1-ast/libdb1.a $(OBJS)
 	build_tools/make_build_h > include/asterisk/build.h.tmp
 	if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
 		mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
 	fi
 	rm -f include/asterisk/build.h.tmp
 	$(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
-	$(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
+	$(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a $(LIBS)
 
 muted: muted.o
 	$(CC) $(AUDIO_LIBS) -o muted muted.o
@@ -547,16 +537,6 @@
 		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; \
-		$(MAKE) clean-depend; \
-	elif [ -d CVS ]; then \
-		echo "Updating from CVS..." ; \
-		cvs -q -z3 update -Pd | 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 -d' ' -f2- ; \
 		fi ; \
 		rm -f update.out; \
 		$(MAKE) clean-depend; \
@@ -606,11 +586,7 @@
 	$(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
 	$(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
 	$(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
-	if [ -d contrib/firmware/iax ]; then \
-		$(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
-	else \
-		echo "You need to do cvs update -d not just cvs update" ; \
-	fi 
+	$(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
 
 install-subdirs:
 	@for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
@@ -668,7 +644,7 @@
 adsi:
 	mkdir -p $(DESTDIR)$(ASTETCDIR)
 	for x in configs/*.adsi; do \
-		if [ ! -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
+		if [ ! -f $(DESTDIR)$(ASTETCDIR)/$$x ]; then \
 			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
 		fi ; \
 	done

Modified: team/kpfleming/vldtmf/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/apps/Makefile?rev=34845&r1=34844&r2=34845&view=diff
==============================================================================
--- team/kpfleming/vldtmf/apps/Makefile (original)
+++ team/kpfleming/vldtmf/apps/Makefile Mon Jun 19 10:25:13 2006
@@ -11,20 +11,15 @@
 # the GNU General Public License
 #
 
-include ../menuselect.makeopts
+ifneq ($(wildcard ../menuselect.makeopts),)
+  include ../menuselect.makeopts
+endif
 
 SELECTED_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.c,%,$(wildcard app_*.c)))
 
-# If you have UnixODBC you can use ODBC voicemail
-# storage
-#
-# Uncomment to use ODBC storage
-#CFLAGS+=-DUSE_ODBC_STORAGE
-# Uncomment for extended ODBC voicemail storage
-#CFLAGS+=-DEXTENDED_ODBC_STORAGE
-# See doc/README.odbcstorage for more information
+MODS:=$(patsubst %,%.so,$(SELECTED_MODS))
 
-MODS:=$(patsubst %,%.so,$(SELECTED_MODS))
+app_voicemail.o: CFLAGS+=$(patsubst %,-D%,$(MENUSELECT_app_voicemail))
 
 all: $(MODS)
 

Modified: team/kpfleming/vldtmf/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/apps/app_voicemail.c?rev=34845&r1=34844&r2=34845&view=diff
==============================================================================
--- team/kpfleming/vldtmf/apps/app_voicemail.c (original)
+++ team/kpfleming/vldtmf/apps/app_voicemail.c Mon Jun 19 10:25:13 2006
@@ -40,6 +40,19 @@
  * 12-04-2006 : Support for Polish added by DIR (www.dir.pl)
  *				 Bartosz Supczinski <Bartosz.Supczinski at dir.pl>
  */
+
+/*** MAKEOPTS
+<category name="MENUSELECT_app_voicemail" displayname="Voicemail Build Options" positive_output="yes" remove_on_change="apps/app_voicemail.o">
+	<member name="ODBC_STORAGE" displayname="Storage of Voicemail using ODBC">
+		<depend>unixodbc</depend>
+		<defaultenabled>no</defaultenabled>
+	</member>
+	<member name="EXTENDED_ODBC_STORAGE" displayname="Storage of Voicemail using ODBC (extended)">
+		<depend>unixodbc</depend>
+		<defaultenabled>no</defaultenabled>
+	</member>
+</category>
+ ***/
 
 #include "asterisk.h"
 
@@ -77,7 +90,7 @@
 #include "asterisk/stringfields.h"
 #include "asterisk/smdi.h"
 #define SMDI_MWI_WAIT_TIMEOUT 1000 /* 1 second */
-#ifdef USE_ODBC_STORAGE
+#ifdef ODBC_STORAGE
 #include "asterisk/res_odbc.h"
 #endif
 
@@ -289,7 +302,7 @@
 
 static void apply_options(struct ast_vm_user *vmu, const char *options);
 
-#ifdef USE_ODBC_STORAGE
+#ifdef ODBC_STORAGE
 static char odbc_database[80];
 static char odbc_table[80];
 #define RETRIEVE(a,b) retrieve_file(a,b)
@@ -838,7 +851,7 @@
 }
 
 
-#ifdef USE_ODBC_STORAGE
+#ifdef ODBC_STORAGE
 static int retrieve_file(char *dir, int msgnum)
 {
 	int x = 0;
@@ -1290,7 +1303,7 @@
 		}
 		fdlen = lseek(fd, 0, SEEK_END);
 		lseek(fd, 0, SEEK_SET);
-		printf("Length is %d\n", fdlen);
+		printf("Length is %zd\n", fdlen);
 		fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED,fd, 0);
 		if (!fdm) {
 			ast_log(LOG_WARNING, "Memory map failed!\n");
@@ -2015,7 +2028,7 @@
 	return (id >= 0 && id < (sizeof(msgs)/sizeof(msgs[0]))) ? msgs[id] : "Unknown";
 }
 
-#ifdef USE_ODBC_STORAGE
+#ifdef ODBC_STORAGE
 static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
 {
 	int x = -1;
@@ -6183,7 +6196,7 @@
 			astsearch = "no";
 		ast_set2_flag((&globalflags), ast_true(astsearch), VM_SEARCH);
 
-#ifdef USE_ODBC_STORAGE
+#ifdef ODBC_STORAGE
 		strcpy(odbc_database, "asterisk");
 		if ((thresholdstr = ast_variable_retrieve(cfg, "general", "odbcstorage"))) {
 			ast_copy_string(odbc_database, thresholdstr, sizeof(odbc_database));
@@ -6614,7 +6627,7 @@
 
 	ast_install_vm_functions(has_voicemail, inboxcount, messagecount);
 
-#if defined(USE_ODBC_STORAGE) && !defined(EXTENDED_ODBC_STORAGE)
+#if defined(ODBC_STORAGE) && !defined(EXTENDED_ODBC_STORAGE)
 	ast_log(LOG_WARNING, "The current ODBC storage table format will be changed soon."
 				"Please update your tables as per the README and edit the apps/Makefile "
 				"and uncomment the line containing EXTENDED_ODBC_STORAGE to enable the "

Modified: team/kpfleming/vldtmf/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/build_tools/cflags.xml?rev=34845&r1=34844&r2=34845&view=diff
==============================================================================
--- team/kpfleming/vldtmf/build_tools/cflags.xml (original)
+++ team/kpfleming/vldtmf/build_tools/cflags.xml Mon Jun 19 10:25:13 2006
@@ -1,4 +1,4 @@
-	<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" force_clean_on_change="yes">
+	<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" remove_on_change=".lastclean">
 		<member name="DEBUG_CHANNEL_LOCKS" displayname="Debug Channel Locking">
 		</member>
 		<member name="DEBUG_SCHEDULER" displayname="Enable Scheduler Debugging Output">

Modified: team/kpfleming/vldtmf/build_tools/menuselect.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/build_tools/menuselect.c?rev=34845&r1=34844&r2=34845&view=diff
==============================================================================
--- team/kpfleming/vldtmf/build_tools/menuselect.c (original)
+++ team/kpfleming/vldtmf/build_tools/menuselect.c Mon Jun 19 10:25:13 2006
@@ -70,20 +70,17 @@
 /*! This is set when the --check-deps argument is provided. */
 static int check_deps = 0;
 
-/*! Force a clean of the source tree */
-static int force_clean = 0;
-
-static int add_category(struct category *cat);
-static int add_member(struct member *mem, struct category *cat);
-static int parse_makeopts_xml(const char *makeopts_xml);
-static int process_deps(void);
-static int build_member_list(void);
-static void mark_as_present(const char *member, const char *category);
-static void process_prev_failed_deps(char *buf);
-static int parse_existing_config(const char *infile);
-static int generate_makeopts_file(void);
-static void free_member_list(void);
-static void free_trees(void);
+#if !defined(ast_strdupa) && defined(__GNUC__)
+#define ast_strdupa(s)                                                    \
+	(__extension__                                                    \
+	({                                                                \
+		const char *__old = (s);                                  \
+		size_t __len = strlen(__old) + 1;                         \
+		char *__new = __builtin_alloca(__len);                    \
+		memcpy (__new, __old, __len);                             \
+		__new;                                                    \
+	}))
+#endif
 
 /*! \brief return a pointer to the first non-whitespace character */
 static inline char *skip_blanks(char *str)
@@ -127,6 +124,19 @@
 	AST_LIST_INSERT_TAIL(&cat->members, mem, list);
 
 	return 0;
+}
+
+/*! \brief Free a member structure and all of its members */
+static void free_member(struct member *mem)
+{
+	struct depend *dep;
+	struct conflict *cnf;
+
+	while ((dep = AST_LIST_REMOVE_HEAD(&mem->deps, list)))
+		free(dep);
+	while ((cnf = AST_LIST_REMOVE_HEAD(&mem->conflicts, list)))
+		free(cnf);
+	free(mem);
 }
 
 /*! \brief Parse an input makeopts file */
@@ -174,8 +184,7 @@
 		cat->displayname = mxmlElementGetAttr(cur, "displayname");
 		if ((tmp = mxmlElementGetAttr(cur, "positive_output")))
 			cat->positive_output = !strcasecmp(tmp, "yes");
-		if ((tmp = mxmlElementGetAttr(cur, "force_clean_on_change")))
-			cat->force_clean_on_change = !strcasecmp(tmp, "yes");
+		cat->remove_on_change = mxmlElementGetAttr(cur, "remove_on_change");
 
 		if (add_category(cat)) {
 			free(cat);
@@ -192,8 +201,10 @@
 			mem->name = mxmlElementGetAttr(cur2, "name");
 			mem->displayname = mxmlElementGetAttr(cur2, "displayname");
 		
+			mem->remove_on_change = mxmlElementGetAttr(cur2, "remove_on_change");
+
 			if (!cat->positive_output)
-				mem->enabled = 1;
+				mem->was_enabled = mem->enabled = 1;
 	
 			cur3 = mxmlFindElement(cur2, cur2, "defaultenabled", NULL, NULL, MXML_DESCEND);
 			if (cur3 && cur3->child)
@@ -203,8 +214,10 @@
 			     cur3 && cur3->child;
 			     cur3 = mxmlFindElement(cur3, cur2, "depend", NULL, NULL, MXML_DESCEND))
 			{
-				if (!(dep = calloc(1, sizeof(*dep))))
+				if (!(dep = calloc(1, sizeof(*dep)))) {
+					free_member(mem);
 					return -1;
+				}
 				if (!strlen_zero(cur3->child->value.opaque)) {
 					dep->name = cur3->child->value.opaque;
 					AST_LIST_INSERT_HEAD(&mem->deps, dep, list);
@@ -216,8 +229,10 @@
 			     cur3 && cur3->child;
 			     cur3 = mxmlFindElement(cur3, cur2, "conflict", NULL, NULL, MXML_DESCEND))
 			{
-				if (!(cnf = calloc(1, sizeof(*cnf))))
+				if (!(cnf = calloc(1, sizeof(*cnf)))) {
+					free_member(mem);
 					return -1;
+				}
 				if (!strlen_zero(cur3->child->value.opaque)) {
 					cnf->name = cur3->child->value.opaque;
 					AST_LIST_INSERT_HEAD(&mem->conflicts, cnf, list);
@@ -226,7 +241,7 @@
 			}
 
 			if (add_member(mem, cat))
-				free(mem);
+				free_member(mem);
 		}
 	}
 
@@ -343,7 +358,7 @@
 			continue;
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
 			if (!strcmp(member, mem->name)) {
-				mem->enabled = cat->positive_output;
+				mem->was_enabled = mem->enabled = cat->positive_output;
 				break;
 			}
 		}
@@ -369,8 +384,6 @@
 
 	if (mem && !(mem->depsfailed || mem->conflictsfailed)) {
 		mem->enabled = !mem->enabled;
-		if (cat->force_clean_on_change)
-			force_clean = 1;
 	}
 }
 
@@ -502,6 +515,34 @@
 
 	fclose(f);
 
+	/* Traverse all categories and members and remove any files that are supposed
+	   to be removed when an item has been changed */
+	AST_LIST_TRAVERSE(&categories, cat, list) {
+		unsigned int had_changes = 0;
+		char *file, *buf;
+
+		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->enabled == mem->was_enabled)
+				continue;
+
+			had_changes = 1;
+
+			if (mem->remove_on_change) {
+				for (buf = ast_strdupa(mem->remove_on_change), file = strsep(&buf, " ");
+				     file;
+				     file = strsep(&buf, " "))
+					unlink(file);
+			}
+		}
+
+		if (cat->remove_on_change && had_changes) {
+			for (buf = ast_strdupa(cat->remove_on_change), file = strsep(&buf, " ");
+			     file;
+			     file = strsep(&buf, " "))
+				unlink(file);
+		}
+	}
+
 	return 0;
 }
 
@@ -517,7 +558,8 @@
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		fprintf(stderr, "Category: '%s'\n", cat->name);
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
-			fprintf(stderr, "   ==>> Member: '%s'  (%s)\n", mem->name, mem->enabled ? "Enabled" : "Disabled");
+			fprintf(stderr, "   ==>> Member: '%s'  (%s)", mem->name, mem->enabled ? "Enabled" : "Disabled");
+			fprintf(stderr, "        Was %s\n", mem->was_enabled ? "Enabled" : "Disabled");
 			AST_LIST_TRAVERSE(&mem->deps, dep, list)
 				fprintf(stderr, "      --> Depends on: '%s'\n", dep->name);
 			if (!AST_LIST_EMPTY(&mem->deps))
@@ -696,11 +738,5 @@
 	free_trees();
 	free_member_list();
 
-	/* In some cases, such as modifying the CFLAGS for the build,
-	 * a "make clean" needs to be forced.  Removing the .lastclean 
-	 * file does this. */
-	if (force_clean)
-		unlink(".lastclean");
-
 	exit(res);
 }

Modified: team/kpfleming/vldtmf/build_tools/menuselect.h
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/build_tools/menuselect.h?rev=34845&r1=34844&r2=34845&view=diff
==============================================================================
--- team/kpfleming/vldtmf/build_tools/menuselect.h (original)
+++ team/kpfleming/vldtmf/build_tools/menuselect.h Mon Jun 19 10:25:13 2006
@@ -52,8 +52,12 @@
 	const char *displayname;
 	/*! Default setting */
 	const char *defaultenabled;
+	/*! Delete these file(s) if this member changes */
+	const char *remove_on_change;
 	/*! This module is currently selected */
 	unsigned int enabled:1;
+	/*! This module was enabled when the config was loaded */
+	unsigned int was_enabled:1;
 	/*! This module has failed dependencies */
 	unsigned int depsfailed:1;
 	/*! This module has failed conflicts */
@@ -71,10 +75,10 @@
 	const char *name;
 	/*! the name displayed in the menu */
 	const char *displayname;
-	/*! Display what is selected, as opposed to not selected */
+	/*! Delete these file(s) if anything in this category changes */
+	const char *remove_on_change;
+	/*! Output what is selected, as opposed to not selected */
 	unsigned int positive_output:1;
-	/*! Force a clean of the source tree if anything in this category changes */
-	unsigned int force_clean_on_change:1;
 	/*! the list of possible values to be set in this variable */
 	AST_LIST_HEAD_NOLOCK(, member) members;
 	/*! for linking */

Modified: team/kpfleming/vldtmf/build_tools/prep_moduledeps
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/build_tools/prep_moduledeps?rev=34845&r1=34844&r2=34845&view=diff
==============================================================================
--- team/kpfleming/vldtmf/build_tools/prep_moduledeps (original)
+++ team/kpfleming/vldtmf/build_tools/prep_moduledeps Mon Jun 19 10:25:13 2006
@@ -38,16 +38,22 @@
 		fname=${file##${dir}/}
 		get_description ${file}
 		desc=${TDESC}
-		echo -e "\t\t<member name=\"${fname%%.c}\" displayname=\"${desc}\">"
-		awk -f build_tools/get_moduledeps ${file}
+		echo -e "\t\t<member name=\"${fname%%.c}\" displayname=\"${desc}\" remove_on_change=\"${dir}/${fname%%.c}.o ${dir}/${fname%%.c}.so\">"
+		awk -f build_tools/get_moduleinfo ${file}
 		echo -e "\t\t</member>"
 	done
 	echo -e "\t</category>"
+
+	for file in ${dir}/${prefix}*.c
+	do
+		awk -f build_tools/get_makeopts ${file} >> .makeoptstmp
+	done
 }
 
 echo "<?xml version="1.0"?>"
 echo
 echo "<menu>"
+rm -f .makeoptstmp
 process_dir apps app APPS Applications
 process_dir cdr cdr CDR "Call Detail Recording"
 process_dir channels chan CHANNELS "Channel Drivers"
@@ -58,4 +64,6 @@
 process_dir res res RES "Resource Modules"
 cat build_tools/cflags.xml
 cat sounds/sounds.xml
+cat .makeoptstmp
+rm -f .makeoptstmp
 echo "</menu>"

Modified: team/kpfleming/vldtmf/cdr/Makefile
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/cdr/Makefile?rev=34845&r1=34844&r2=34845&view=diff
==============================================================================
--- team/kpfleming/vldtmf/cdr/Makefile (original)
+++ team/kpfleming/vldtmf/cdr/Makefile Mon Jun 19 10:25:13 2006
@@ -11,7 +11,9 @@
 # the GNU General Public License
 #
 
-include ../menuselect.makeopts
+ifneq ($(wildcard ../menuselect.makeopts),)
+  include ../menuselect.makeopts
+endif
 
 SELECTED_MODS:=$(filter-out $(MENUSELECT_CDR),$(patsubst %.c,%,$(wildcard cdr_*.c)))
 
@@ -39,7 +41,7 @@
 
 MODS:=$(patsubst %,%.so,$(SELECTED_MODS))
 
-all: depend $(MODS)
+all: $(MODS)
 
 install: all
 	for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done

Modified: team/kpfleming/vldtmf/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/channels/Makefile?rev=34845&r1=34844&r2=34845&view=diff
==============================================================================
--- team/kpfleming/vldtmf/channels/Makefile (original)
+++ team/kpfleming/vldtmf/channels/Makefile Mon Jun 19 10:25:13 2006
@@ -11,7 +11,9 @@
 # the GNU General Public License
 #
 
-include ../menuselect.makeopts
+ifneq ($(wildcard ../menuselect.makeopts),)
+  include ../menuselect.makeopts
+endif
 
 SELECTED_MODS:=$(filter-out $(MENUSELECT_CHANNELS),$(patsubst %.c,%,$(wildcard chan_*.c)))
 
@@ -66,7 +68,7 @@
 
 MODS:=$(patsubst %,%.so,$(SELECTED_MODS))
 
-all: depend $(MODS) 
+all: $(MODS) 
 
 clean-depend:
 	rm -f .depend

Modified: team/kpfleming/vldtmf/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/channels/chan_iax2.c?rev=34845&r1=34844&r2=34845&view=diff
==============================================================================
--- team/kpfleming/vldtmf/channels/chan_iax2.c (original)
+++ team/kpfleming/vldtmf/channels/chan_iax2.c Mon Jun 19 10:25:13 2006
@@ -8351,11 +8351,7 @@
 		peer->peercontext[0] = '\0';
 		while(v) {
 			if (!strcasecmp(v->name, "secret")) {
-				if (!ast_strlen_zero(peer->secret)) {
-					strncpy(peer->secret + strlen(peer->secret), ";", sizeof(peer->secret)-strlen(peer->secret) - 1);
-					strncpy(peer->secret + strlen(peer->secret), v->value, sizeof(peer->secret)-strlen(peer->secret) - 1);
-				} else
-					ast_copy_string(peer->secret, v->value, sizeof(peer->secret));
+				ast_copy_string(peer->secret, v->value, sizeof(peer->secret));
 			} else if (!strcasecmp(v->name, "mailbox")) {
 				ast_copy_string(peer->mailbox, v->value, sizeof(peer->mailbox));
 			} else if (!strcasecmp(v->name, "dbsecret")) {

Modified: team/kpfleming/vldtmf/channels/chan_jingle.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/channels/chan_jingle.c?rev=34845&r1=34844&r2=34845&view=diff
==============================================================================
--- team/kpfleming/vldtmf/channels/chan_jingle.c (original)
+++ team/kpfleming/vldtmf/channels/chan_jingle.c Mon Jun 19 10:25:13 2006
@@ -479,13 +479,10 @@
 	struct jingle_pvt *tmp;
 
 	ast_log(LOG_DEBUG, "The client is %s\n", client->name);
-	tmp = client->p;
 	/* Make sure our new call doesn't exist yet */
-	while (tmp) {
-		if (iks_find_with_attrib(pak->x, GOOGLE_NODE, GOOGLE_SID, tmp->sid)) {
+	for (tmp = client->p; tmp; tmp = tmp->next) {
+		if (iks_find_with_attrib(pak->x, GOOGLE_NODE, GOOGLE_SID, tmp->sid))
 			break;
-		}
-		tmp = tmp->next;
 	}
 
 	if (tmp) {
@@ -502,13 +499,10 @@
 	struct jingle_pvt *tmp;
 
 	ast_log(LOG_DEBUG, "The client is %s\n", client->name);
-	tmp = client->p;
 	/* Make sure our new call doesn't exist yet */
-	while (tmp) {
-		if (iks_find_with_attrib(pak->x, GOOGLE_NODE, GOOGLE_SID, tmp->sid)) {
+	for (tmp = client->p; tmp; tmp = tmp->next) {
+		if (iks_find_with_attrib(pak->x, GOOGLE_NODE, GOOGLE_SID, tmp->sid))
 			break;
-		}
-		tmp = tmp->next;
 	}
 
 	if (tmp) {
@@ -536,21 +530,20 @@
 	iq = iks_new("iq");
 	jingle = iks_new(GOOGLE_NODE);
 	candidate = iks_new("candidate");
-	ours1 = (struct jingle_candidate *) ast_calloc(1, sizeof(struct jingle_candidate));
-	ours2 = (struct jingle_candidate *) ast_calloc(1, sizeof(struct jingle_candidate));
-	if (!iq || !jingle || !candidate || !ours1 || !ours2) {
-		ast_log(LOG_WARNING, "out of memory!\n");
+	if (!iq || !jingle || !candidate) {
+		ast_log(LOG_ERROR, "Memory allocation error\n");
 		goto safeout;
 	}
-
+	ours1 = ast_calloc(1, sizeof(*ours1));
+	ours2 = ast_calloc(1, sizeof(*ours2));
+	if (!ours1 || !ours2)
+		goto safeout;
 	iks_insert_node(iq, jingle);
 	iks_insert_node(jingle, candidate);
 
-	while (p) {
-		if (!strcasecmp(p->sid, sid)) {
+	for (; p; p = p->next) {
+		if (!strcasecmp(p->sid, sid))
 			break;
-		}
-		p = p->next;
 	}
 
 	if (!p) {
@@ -596,8 +589,7 @@
 	dest.sin_port = sin.sin_port;
 
 
-	tmp = p->ourcandidates;
-	while (tmp) {				/*send standard candidates */
+	for (tmp = p->ourcandidates; tmp; tmp = tmp->next) {
 		snprintf(port, sizeof(port), "%d", tmp->port);
 		snprintf(preference, sizeof(preference), "%.2f", tmp->preference);
 		iks_insert_attrib(iq, "from", c->jid->full);
@@ -628,7 +620,6 @@
 		iks_insert_attrib(candidate, "network", "0");
 		iks_insert_attrib(candidate, "generation", "0");
 		iks_send(c->p, iq);
-		tmp = tmp->next;
 	}
 	p->laststun = 0;
 
@@ -958,23 +949,18 @@
 	struct aji_client *c = client->connection;
 	struct jingle_candidate *newcandidate = NULL;
 	iks  *traversenodes = NULL, *receipt = NULL;
-	newcandidate =
-		(struct jingle_candidate *) ast_calloc(1, sizeof(struct jingle_candidate));
+	newcandidate = ast_calloc(1, sizeof(*newcandidate));
 	if (!newcandidate)
 		return 0;
-	memset(newcandidate, 0, sizeof(struct jingle_candidate));
-	tmp = client->p;
-	while (tmp) {
+	for (tmp = client->p; tmp; tmp = tmp->next) {
 		if (iks_find_with_attrib(pak->x, GOOGLE_NODE, GOOGLE_SID, tmp->sid)) {
 			p = tmp;
 			break;
 		}
-		tmp = tmp->next;
-	}
-
-	if (!p) {
+	}
+
+	if (!p)
 		return -1;
-	}
 
 	traversenodes = pak->query;
 	while(traversenodes) {
@@ -983,11 +969,9 @@
 			continue;
 		}
 		if(!strcasecmp(iks_name(traversenodes), "candidate")) {
-			newcandidate =
-				(struct jingle_candidate *) ast_calloc(1, sizeof(struct jingle_candidate));
+			newcandidate = ast_calloc(1, sizeof(*newcandidate));
 			if (!newcandidate)
 				return 0;
-			memset(newcandidate, 0, sizeof(struct jingle_candidate));
 			ast_copy_string(newcandidate->name, iks_find_attrib(traversenodes, "name"),
 							sizeof(newcandidate->name));
 			ast_copy_string(newcandidate->ip, iks_find_attrib(traversenodes, "address"),

Modified: team/kpfleming/vldtmf/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/channels/chan_misdn.c?rev=34845&r1=34844&r2=34845&view=diff
==============================================================================
--- team/kpfleming/vldtmf/channels/chan_misdn.c (original)
+++ team/kpfleming/vldtmf/channels/chan_misdn.c Mon Jun 19 10:25:13 2006
@@ -88,8 +88,6 @@
 	ast_mutex_t mutexjb;
 };
 
-void export_ies(struct ast_channel *chan, struct misdn_bchannel *bc);
-void import_ies(struct ast_channel *chan, struct misdn_bchannel *bc);
 
 
 /* allocates the jb-structure and initialise the elements*/
@@ -112,16 +110,6 @@
 
 /* BEGIN: chan_misdn.h */
 
-
-enum tone_e {
-	TONE_NONE=0,
-	TONE_DIAL,
-	TONE_ALERTING,
-	TONE_FAR_ALERTING,
-	TONE_BUSY,
-	TONE_CUSTOM,
-	TONE_FILE
-};
 
 
 enum misdn_chan_state {
@@ -185,6 +173,8 @@
 	struct ast_trans_pvt *trans;
   
 	struct ast_channel * ast;
+
+	int dummy;
   
 	struct misdn_bchannel *bc;
 	struct misdn_bchannel *holded_bc;
@@ -198,6 +188,8 @@
 	int dropped_frame_cnt;
 
 	int far_alerting;
+	int other_pid;
+	struct chan_list *other_ch;
 
 	const struct tone_zone_sound *ts;
 	
@@ -206,6 +198,11 @@
 	struct chan_list *prev;
 	struct chan_list *first;
 };
+
+
+
+void export_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_list *ch);
+void import_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_list *ch);
 
 struct robin_list {
 	char *group;
@@ -306,6 +303,7 @@
 static void cl_queue_chan(struct chan_list **list, struct chan_list *chan);
 static void cl_dequeue_chan(struct chan_list **list, struct chan_list *chan);
 static struct chan_list *find_chan_by_bc(struct chan_list *list, struct misdn_bchannel *bc);
+static struct chan_list *find_chan_by_pid(struct chan_list *list, int pid);
 
 
 
@@ -1638,7 +1636,7 @@
 		update_config(ch,ORG_AST);
 		
 		/* fill in some ies from channel vary*/
-		import_ies(ast, newbc);
+		import_ch(ast, newbc, ch);
 		
 		/* Finally The Options Override Everything */
 		if (opts)
@@ -1854,7 +1852,12 @@
 				p->state=MISDN_ALERTING;
 				chan_misdn_log(1, p->bc->port, " --> * IND :\tringing pid:%d\n",p->bc?p->bc->pid:-1);
 				misdn_lib_send_event( p->bc, EVENT_ALERTING);
-				
+			
+				if (p->other_ch && p->other_ch->bc && misdn_inband_avail(p->other_ch->bc)) {
+					chan_misdn_log(1,p->bc->port, " --> other End is mISDN and has inband info available\n");
+					break;
+				}
+			
 				if ( !p->bc->nt && (p->orginator==ORG_MISDN) && !p->incoming_early_audio ) 
 					chan_misdn_log(1,p->bc->port, " --> incoming_early_audio off\n");
 				 else 
@@ -1902,10 +1905,11 @@
 	case -1 :
 		chan_misdn_log(1, p->bc->port, " --> * IND :\t-1! (stop indication) pid:%d\n",p->bc?p->bc->pid:-1);
 		
-		if (p->state == MISDN_CONNECTED)
+		tone_indicate(p, TONE_NONE);
+
+		if (p->state == MISDN_CONNECTED) 
 			start_bc_tones(p);
-		else 
-			tone_indicate(p, TONE_NONE);
+
 		break;
 
 	case AST_CONTROL_HOLD:
@@ -1967,7 +1971,9 @@
 		return 0;
 	}
 
-	stop_bc_tones(p);
+	if (!p->bc->nt) 
+		stop_bc_tones(p);
+
 	
 	release_unlock;
 	
@@ -1994,10 +2000,13 @@
 		case MISDN_HOLDED:
 		case MISDN_DIALING:
 			start_bc_tones(p);
-			tone_indicate(p, TONE_BUSY);
+			tone_indicate(p, TONE_HANGUP);
 			p->state=MISDN_CLEANING;
-			
-			misdn_lib_send_event( bc, EVENT_RELEASE_COMPLETE);
+		
+			if (bc->nt)
+				misdn_lib_send_event( bc, EVENT_DISCONNECT);
+			else
+				misdn_lib_send_event( bc, EVENT_RELEASE_COMPLETE);
       
 			break;
       
@@ -2007,7 +2016,7 @@
 			chan_misdn_log(2, bc->port, " --> * State Alerting\n");
 
 			if (p->orginator != ORG_AST) 
-				tone_indicate(p, TONE_BUSY);
+				tone_indicate(p, TONE_HANGUP);
       
 			p->state=MISDN_CLEANING;
 			misdn_lib_send_event( bc, EVENT_DISCONNECT);
@@ -2016,7 +2025,7 @@
 			/*  Alerting or Disconect */
 			chan_misdn_log(2, bc->port, " --> * State Connected\n");
 			start_bc_tones(p);
-			tone_indicate(p, TONE_BUSY);
+			tone_indicate(p, TONE_HANGUP);
 			misdn_lib_send_event( bc, EVENT_DISCONNECT);
       
 			p->state=MISDN_CLEANING; /* MISDN_HUNGUP_FROM_AST; */
@@ -2112,7 +2121,7 @@
 	if (!ast) return NULL;
 	if (! (tmp=MISDN_ASTERISK_TECH_PVT(ast)) ) return NULL;
 	if (!tmp->bc) return NULL;
-	
+
 	len=read(tmp->pipe[0],tmp->ast_rd_buf,sizeof(tmp->ast_rd_buf));
 
 	if (len<=0) {
@@ -2349,6 +2358,9 @@
 	chan_misdn_log(3,cl->bc->port,"Tone Indicate:\n");
 	
 	if (!cl->ast) {
+		chan_misdn_log(-1,cl->bc->port,"Ast Ptr Not existing anymore.. we need to generate tones ourselves now (tbd)\n");
+		
+		misdn_lib_send_tone(cl->bc,tone);
 		return 0;
 	}
 	
@@ -2361,7 +2373,7 @@
 	case TONE_ALERTING:
 		chan_misdn_log(3,cl->bc->port," --> Ring\n");
 		ts=ast_get_indication_tone(ast->zone,"ring");
-		misdn_lib_tone_generator_stop(cl->bc);
+		misdn_lib_tone_generator_start(cl->bc);
 		break;
 	case TONE_FAR_ALERTING:
 	/* VERY UGLY HACK, BECAUSE CHAN_SIP DOES NOT GENERATE TONES */
@@ -2373,7 +2385,7 @@
 	case TONE_BUSY:
 		chan_misdn_log(3,cl->bc->port," --> Busy\n");
 		ts=ast_get_indication_tone(ast->zone,"busy");
-		misdn_lib_tone_generator_stop(cl->bc);
+		misdn_lib_tone_generator_start(cl->bc);
 		break;
 	case TONE_FILE:
 		break;
@@ -2460,7 +2472,7 @@
 			chan_misdn_log(2, 0, " --> Group Call group: %s\n",group);
 		} 
 		else if ((p = strchr(port_str, ':'))) {
-			// we have a preselected channel
+			/* we have a preselected channel */
 			*p = 0;
 			channel = atoi(++p);
 			port = atoi(port_str);
@@ -2748,6 +2760,17 @@
 	return NULL;
 }
 
+static struct chan_list *find_chan_by_pid(struct chan_list *list, int pid)
+{
+	struct chan_list *help=list;
+	for (;help; help=help->next) {
+		if (help->bc->pid == pid) return help;
+	}
+  
+	chan_misdn_log(6, 0, "$$$ find_chan: No channel found for pid:%d\n",pid);
+  
+	return NULL;
+}
 
 static struct chan_list *find_holded(struct chan_list *list, struct misdn_bchannel *bc)
 {
@@ -2839,8 +2862,15 @@
 		release_unlock;
 		
 		chan_misdn_log(1, bc->port, "release_chan: bc with l3id: %x\n",bc->l3_id);
-		
-		//releaseing jitterbuffer
+#if 0
+		if (ch->dummy) {
+			ast_hangup(ast);
+			ch->ast=NULL;
+			ast=NULL;
+		}
+#endif
+		
+		/*releaseing jitterbuffer*/
 		if (ch->jb ) {
 			misdn_jb_destroy(ch->jb);
 			ch->jb=NULL;
@@ -3042,46 +3072,30 @@
 	}
 }
 
-void import_ies(struct ast_channel *chan, struct misdn_bchannel *bc)
-{
-	const char *tmp;
-
-	tmp=pbx_builtin_getvar_helper(chan,"PRI_MODE");
-	if (tmp) bc->mode=atoi(tmp);
-
-	tmp=pbx_builtin_getvar_helper(chan,"PRI_URATE");
-	if (tmp) bc->urate=atoi(tmp);
-
-	tmp=pbx_builtin_getvar_helper(chan,"PRI_RATE");
-	if (tmp) bc->rate=atoi(tmp);
-
-	tmp=pbx_builtin_getvar_helper(chan,"PRI_USER1");
-	if (tmp) bc->user1=atoi(tmp);
-
-	tmp=pbx_builtin_getvar_helper(chan,"PRI_PROGRESS_INDICATOR");
-	if (tmp) bc->progress_indicator=atoi(tmp);
-}
-
-void export_ies(struct ast_channel *chan, struct misdn_bchannel *bc)
+
+
+
+void import_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_list *ch)
+{
+	char *tmp;
+	tmp=pbx_builtin_getvar_helper(chan,"MISDN_PID");
+	if (tmp) {
+		ch->other_pid=atoi(tmp);
+		chan_misdn_log(1,bc->port,"IMPORT_PID: importing pid:%s\n",tmp);
+		if (ch->other_pid >0) {
+			ch->other_ch=find_chan_by_pid(cl_te,ch->other_pid);
+			if (ch->other_ch) ch->other_ch->other_ch=ch;
+		}
+	}
+}
+
+void export_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_list *ch)
 {
 	char tmp[32];
-	
-	sprintf(tmp,"%d",bc->mode);
-	pbx_builtin_setvar_helper(chan,"_PRI_MODE",tmp);
-
-	sprintf(tmp,"%d",bc->urate);
-	pbx_builtin_setvar_helper(chan,"_PRI_URATE",tmp);
-
-	sprintf(tmp,"%d",bc->rate);
-	pbx_builtin_setvar_helper(chan,"_PRI_RATE",tmp);
-	
-	sprintf(tmp,"%d",bc->user1);
-	pbx_builtin_setvar_helper(chan,"_PRI_USER1",tmp);
-	
-	sprintf(tmp,"%d",bc->progress_indicator);
-	pbx_builtin_setvar_helper(chan,"_PRI_PROGRESS_INDICATOR",tmp);
-}
-
+	chan_misdn_log(1,bc->port,"EXPORT_PID: pid:%d\n",bc->pid);
+	sprintf(tmp,"%d",bc->pid);
+	pbx_builtin_setvar_helper(chan,"_MISDN_PID",tmp);
+}
 
 int add_in_calls(int port)
 {
@@ -3145,9 +3159,12 @@
 	
 	if (ch ) {
 		switch (event) {
+		case EVENT_DISCONNECT:
 		case EVENT_RELEASE:
 		case EVENT_RELEASE_COMPLETE:
 		case EVENT_CLEANUP:
+		case EVENT_TIMEOUT:
+			chan_misdn_log(3,bc->port,"ast_hangup already called, so we have no ast ptr anymore in event(%s)\n",manager_isdn_get_info(event));
 			break;
 		default:
 			if ( !ch->ast  || !MISDN_ASTERISK_PVT(ch->ast) || !MISDN_ASTERISK_TECH_PVT(ch->ast)) {
@@ -3357,8 +3374,8 @@
 
 		read_config(ch, ORG_MISDN);
 		
-		export_ies(chan, bc);
-		
+		export_ch(chan, bc, ch);
+
 		ch->ast->rings=1;
 		ast_setstate(ch->ast, AST_STATE_RINGING);
 
@@ -3483,10 +3500,18 @@
 			}
 		} else {
 
-
 			if (bc->sending_complete) {
+				ch->state=MISDN_EXTCANTMATCH;
 				bc->out_cause=1;
-				misdn_lib_send_event(bc, EVENT_RELEASE);
+
+				if (bc->nt)  {
+					chan_misdn_log(0,bc->port," --> sending_complete so we never match ..\n");
+					misdn_lib_send_event(bc, EVENT_RELEASE_COMPLETE);
+				} else {
+					chan_misdn_log(0,bc->port," --> sending_complete so we never match ..\n");
+					misdn_lib_send_event(bc, EVENT_RELEASE);
+				}
+
 			} else {
 				
 				int ret= misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
@@ -3633,12 +3658,12 @@
 	}
 	break;
 	case EVENT_DISCONNECT:
+	/*we might not have an ch->ast ptr here anymore*/
 	{
-		
 		struct chan_list *holded_ch=find_holded(cl_te, bc);
 		
-		
-		send_cause2ast(ch->ast,bc);
+		if (ch->ast)	
+			send_cause2ast(ch->ast,bc);
 
 
 		chan_misdn_log(3,bc->port," --> org:%d nt:%d, inbandavail:%d state:%d\n", ch->orginator, bc->nt, misdn_inband_avail(bc), ch->state);
@@ -3655,7 +3680,7 @@
 		}
 		
 		/*Check for holded channel, to implement transfer*/
-		if (holded_ch ) {
+		if (holded_ch && ch->ast ) {
 			if  (ch->state == MISDN_CONNECTED ) {
 				misdn_transfer_bc(ch, holded_ch) ;
 				misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);
@@ -3722,10 +3747,18 @@
 		chan_misdn_log(9,bc->port,"TONE_GEN: len:%d\n");
 
 		if (!ast->generator) break;
-		
+	
+		
+	
 		tmp = ast->generatordata;
 		ast->generatordata = NULL;
 		generate = ast->generator->generate;
+
+		if (tone_len <0 || tone_len > 512 ) {
+			ast_log(LOG_WARNING, "TONE_GEN: len was %d, set to 128\n",tone_len);
+			tone_len=128;
+		}
+
 		res = generate(ast, tmp, tone_len, tone_len);
 		ast->generatordata = tmp;
 		
@@ -3788,18 +3821,28 @@
 	}
 	break;
 	case EVENT_TIMEOUT:
-
-		misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);
-		break;
 		{
-			switch (ch->state) {
+		switch (ch->state) {
+			case MISDN_WAITING4DIGS:
 			case MISDN_CALLING:
-
-				chan_misdn_log(-1, bc?bc->port:0, "GOT TIMOUT AT CALING pid:%d\n", bc?bc->pid:-1);
-					break;
 			case MISDN_DIALING:
 			case MISDN_PROGRESS:
-				break;
+			case MISDN_ALERTING:
+			case MISDN_PROCEEDING:
+			case MISDN_CALLING_ACKNOWLEDGE:
+				if (bc->nt) {
+					bc->progress_indicator=8;
+					tone_indicate(ch, TONE_BUSY);
+				}
+				
+				bc->out_cause=1;
+				misdn_lib_send_event(bc,EVENT_DISCONNECT);
+			break;
+
+			case MISDN_CLEANING: 
+				chan_misdn_log(1,bc->port," --> in state cleaning .. so ingoring, the stack should clean it for us\n");
+			break;
+
 			default:
 				misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);
 			}
@@ -3883,7 +3926,7 @@
 			

[... 9221 lines stripped ...]


More information about the svn-commits mailing list