[asterisk-commits] oej: branch oej/fixtoheader-1.4 r93876 - in /team/oej/fixtoheader-1.4: ./ app...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Dec 19 02:39:13 CST 2007


Author: oej
Date: Wed Dec 19 02:39:12 2007
New Revision: 93876

URL: http://svn.digium.com/view/asterisk?view=rev&rev=93876
Log:
Resolve, reset automerge


Added:
    team/oej/fixtoheader-1.4/include/asterisk/global_datastores.h
      - copied unchanged from r93764, branches/1.4/include/asterisk/global_datastores.h
    team/oej/fixtoheader-1.4/main/global_datastores.c
      - copied unchanged from r93764, branches/1.4/main/global_datastores.c
Removed:
    team/oej/fixtoheader-1.4/build_tools/prep_moduledeps
Modified:
    team/oej/fixtoheader-1.4/   (props changed)
    team/oej/fixtoheader-1.4/.cleancount
    team/oej/fixtoheader-1.4/Makefile
    team/oej/fixtoheader-1.4/Makefile.moddir_rules
    team/oej/fixtoheader-1.4/apps/   (props changed)
    team/oej/fixtoheader-1.4/apps/Makefile
    team/oej/fixtoheader-1.4/apps/app_dial.c
    team/oej/fixtoheader-1.4/apps/app_meetme.c
    team/oej/fixtoheader-1.4/apps/app_mixmonitor.c
    team/oej/fixtoheader-1.4/apps/app_playback.c
    team/oej/fixtoheader-1.4/apps/app_queue.c
    team/oej/fixtoheader-1.4/apps/app_voicemail.c
    team/oej/fixtoheader-1.4/build_tools/make_buildopts_h
    team/oej/fixtoheader-1.4/build_tools/make_version
    team/oej/fixtoheader-1.4/build_tools/prep_tarball
    team/oej/fixtoheader-1.4/cdr/   (props changed)
    team/oej/fixtoheader-1.4/cdr/Makefile
    team/oej/fixtoheader-1.4/cdr/cdr_pgsql.c
    team/oej/fixtoheader-1.4/cdr/cdr_tds.c
    team/oej/fixtoheader-1.4/channels/   (props changed)
    team/oej/fixtoheader-1.4/channels/Makefile
    team/oej/fixtoheader-1.4/channels/chan_h323.c
    team/oej/fixtoheader-1.4/channels/chan_iax2.c
    team/oej/fixtoheader-1.4/channels/chan_local.c
    team/oej/fixtoheader-1.4/channels/chan_mgcp.c
    team/oej/fixtoheader-1.4/channels/chan_misdn.c
    team/oej/fixtoheader-1.4/channels/chan_sip.c
    team/oej/fixtoheader-1.4/channels/chan_skinny.c
    team/oej/fixtoheader-1.4/channels/chan_zap.c
    team/oej/fixtoheader-1.4/channels/misdn/chan_misdn_config.h
    team/oej/fixtoheader-1.4/channels/misdn/isdn_lib.c
    team/oej/fixtoheader-1.4/channels/misdn/isdn_lib.h
    team/oej/fixtoheader-1.4/channels/misdn/isdn_lib_intern.h
    team/oej/fixtoheader-1.4/channels/misdn/isdn_msg_parser.c
    team/oej/fixtoheader-1.4/channels/misdn_config.c
    team/oej/fixtoheader-1.4/codecs/   (props changed)
    team/oej/fixtoheader-1.4/codecs/Makefile
    team/oej/fixtoheader-1.4/codecs/codec_zap.c
    team/oej/fixtoheader-1.4/configs/agents.conf.sample
    team/oej/fixtoheader-1.4/configs/cdr.conf.sample
    team/oej/fixtoheader-1.4/configs/extensions.ael.sample
    team/oej/fixtoheader-1.4/configs/misdn.conf.sample
    team/oej/fixtoheader-1.4/configs/res_odbc.conf.sample
    team/oej/fixtoheader-1.4/configs/sip.conf.sample
    team/oej/fixtoheader-1.4/configs/users.conf.sample
    team/oej/fixtoheader-1.4/configs/voicemail.conf.sample
    team/oej/fixtoheader-1.4/configure
    team/oej/fixtoheader-1.4/configure.ac
    team/oej/fixtoheader-1.4/doc/localchannel.txt
    team/oej/fixtoheader-1.4/doc/queues-with-callback-members.txt
    team/oej/fixtoheader-1.4/doc/valgrind.txt
    team/oej/fixtoheader-1.4/formats/   (props changed)
    team/oej/fixtoheader-1.4/formats/Makefile
    team/oej/fixtoheader-1.4/formats/format_g726.c
    team/oej/fixtoheader-1.4/formats/format_h263.c
    team/oej/fixtoheader-1.4/formats/format_h264.c
    team/oej/fixtoheader-1.4/formats/format_ogg_vorbis.c
    team/oej/fixtoheader-1.4/formats/format_pcm.c
    team/oej/fixtoheader-1.4/formats/format_wav.c
    team/oej/fixtoheader-1.4/formats/format_wav_gsm.c
    team/oej/fixtoheader-1.4/funcs/   (props changed)
    team/oej/fixtoheader-1.4/funcs/Makefile
    team/oej/fixtoheader-1.4/funcs/func_callerid.c
    team/oej/fixtoheader-1.4/funcs/func_env.c
    team/oej/fixtoheader-1.4/include/asterisk/astobj2.h
    team/oej/fixtoheader-1.4/include/asterisk/autoconfig.h.in
    team/oej/fixtoheader-1.4/include/asterisk/cdr.h
    team/oej/fixtoheader-1.4/include/asterisk/channel.h
    team/oej/fixtoheader-1.4/include/asterisk/compat.h
    team/oej/fixtoheader-1.4/include/asterisk/compiler.h
    team/oej/fixtoheader-1.4/include/asterisk/file.h
    team/oej/fixtoheader-1.4/include/asterisk/lock.h
    team/oej/fixtoheader-1.4/include/asterisk/logger.h
    team/oej/fixtoheader-1.4/include/asterisk/module.h
    team/oej/fixtoheader-1.4/include/asterisk/pbx.h
    team/oej/fixtoheader-1.4/include/asterisk/res_odbc.h
    team/oej/fixtoheader-1.4/include/asterisk/rtp.h
    team/oej/fixtoheader-1.4/include/asterisk/time.h
    team/oej/fixtoheader-1.4/main/Makefile
    team/oej/fixtoheader-1.4/main/app.c
    team/oej/fixtoheader-1.4/main/astobj2.c
    team/oej/fixtoheader-1.4/main/autoservice.c
    team/oej/fixtoheader-1.4/main/cdr.c
    team/oej/fixtoheader-1.4/main/channel.c
    team/oej/fixtoheader-1.4/main/config.c
    team/oej/fixtoheader-1.4/main/dial.c
    team/oej/fixtoheader-1.4/main/dsp.c
    team/oej/fixtoheader-1.4/main/file.c
    team/oej/fixtoheader-1.4/main/loader.c
    team/oej/fixtoheader-1.4/main/logger.c
    team/oej/fixtoheader-1.4/main/manager.c
    team/oej/fixtoheader-1.4/main/pbx.c
    team/oej/fixtoheader-1.4/main/rtp.c
    team/oej/fixtoheader-1.4/main/say.c
    team/oej/fixtoheader-1.4/main/srv.c
    team/oej/fixtoheader-1.4/main/tdd.c
    team/oej/fixtoheader-1.4/main/threadstorage.c
    team/oej/fixtoheader-1.4/main/translate.c
    team/oej/fixtoheader-1.4/main/udptl.c
    team/oej/fixtoheader-1.4/main/utils.c
    team/oej/fixtoheader-1.4/makeopts.in
    team/oej/fixtoheader-1.4/pbx/   (props changed)
    team/oej/fixtoheader-1.4/pbx/Makefile
    team/oej/fixtoheader-1.4/pbx/pbx_ael.c
    team/oej/fixtoheader-1.4/pbx/pbx_config.c
    team/oej/fixtoheader-1.4/res/   (props changed)
    team/oej/fixtoheader-1.4/res/Makefile
    team/oej/fixtoheader-1.4/res/res_adsi.c
    team/oej/fixtoheader-1.4/res/res_agi.c
    team/oej/fixtoheader-1.4/res/res_config_odbc.c
    team/oej/fixtoheader-1.4/res/res_config_pgsql.c
    team/oej/fixtoheader-1.4/res/res_features.c
    team/oej/fixtoheader-1.4/res/res_jabber.c
    team/oej/fixtoheader-1.4/res/res_musiconhold.c
    team/oej/fixtoheader-1.4/res/res_odbc.c
    team/oej/fixtoheader-1.4/sounds/Makefile

Propchange: team/oej/fixtoheader-1.4/
------------------------------------------------------------------------------
    automerge = http://www.codename-pineapple.org/

Propchange: team/oej/fixtoheader-1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/oej/fixtoheader-1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/oej/fixtoheader-1.4/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Dec 19 02:39:12 2007
@@ -1,1 +1,1 @@
-/branches/1.4:1-89014
+/branches/1.4:1-93867

Modified: team/oej/fixtoheader-1.4/.cleancount
URL: http://svn.digium.com/view/asterisk/team/oej/fixtoheader-1.4/.cleancount?view=diff&rev=93876&r1=93875&r2=93876
==============================================================================
--- team/oej/fixtoheader-1.4/.cleancount (original)
+++ team/oej/fixtoheader-1.4/.cleancount Wed Dec 19 02:39:12 2007
@@ -1,1 +1,1 @@
-29
+30

Modified: team/oej/fixtoheader-1.4/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/fixtoheader-1.4/Makefile?view=diff&rev=93876&r1=93875&r2=93876
==============================================================================
--- team/oej/fixtoheader-1.4/Makefile (original)
+++ team/oej/fixtoheader-1.4/Makefile Wed Dec 19 02:39:12 2007
@@ -58,6 +58,7 @@
 export SOLINK
 export STRIP
 export DOWNLOAD
+export AWK
 export GREP
 export ID
 export OSARCH
@@ -238,10 +239,10 @@
   ASTCFLAGS+=-Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include
 endif
 
-ASTERISKVERSION:=$(shell build_tools/make_version .)
+ASTERISKVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) build_tools/make_version .)
 
 ifneq ($(wildcard .version),)
-  ASTERISKVERSIONNUM:=$(shell awk -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}' .version)
+  ASTERISKVERSIONNUM:=$(shell $(AWK) -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}' .version)
   RPMVERSION:=$(shell sed 's/[-\/:]/_/g' .version)
 else
   RPMVERSION=unknown
@@ -263,6 +264,7 @@
 MOD_SUBDIRS_EMBED_LDSCRIPT:=$(MOD_SUBDIRS:%=%-embed-ldscript)
 MOD_SUBDIRS_EMBED_LDFLAGS:=$(MOD_SUBDIRS:%=%-embed-ldflags)
 MOD_SUBDIRS_EMBED_LIBS:=$(MOD_SUBDIRS:%=%-embed-libs)
+MOD_SUBDIRS_MENUSELECT_TREE:=$(MOD_SUBDIRS:%=%-menuselect-tree)
 
 ifneq ($(findstring darwin,$(OSARCH)),)
   ASTCFLAGS+=-D__Darwin__
@@ -279,6 +281,8 @@
 ifeq ($(OSARCH),SunOS)
   SOLINK=-shared -fpic -L/usr/local/ssl/lib
 endif
+
+SUBMAKE=$(MAKE) --quiet --no-print-directory
 
 # This is used when generating the doxygen documentation
 ifneq ($(DOT),:)
@@ -312,13 +316,17 @@
 	menuselect/menuselect --check-deps $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts
 
 $(MOD_SUBDIRS_EMBED_LDSCRIPT):
-	@echo "EMBED_LDSCRIPTS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-ldscript=) SUBDIR=$(@:-embed-ldscript=) __embed_ldscript` >> makeopts.embed_rules
+	@echo "EMBED_LDSCRIPTS+="`$(SUBMAKE) -C $(@:-embed-ldscript=) SUBDIR=$(@:-embed-ldscript=) __embed_ldscript` >> makeopts.embed_rules
 
 $(MOD_SUBDIRS_EMBED_LDFLAGS):
-	@echo "EMBED_LDFLAGS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-ldflags=) SUBDIR=$(@:-embed-ldflags=) __embed_ldflags` >> makeopts.embed_rules
+	@echo "EMBED_LDFLAGS+="`$(SUBMAKE) -C $(@:-embed-ldflags=) SUBDIR=$(@:-embed-ldflags=) __embed_ldflags` >> makeopts.embed_rules
 
 $(MOD_SUBDIRS_EMBED_LIBS):
-	@echo "EMBED_LIBS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-libs=) SUBDIR=$(@:-embed-libs=) __embed_libs` >> makeopts.embed_rules
+	@echo "EMBED_LIBS+="`$(SUBMAKE) -C $(@:-embed-libs=) SUBDIR=$(@:-embed-libs=) __embed_libs` >> makeopts.embed_rules
+
+$(MOD_SUBDIRS_MENUSELECT_TREE):
+	@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) moduleinfo
+	@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) makeopts
 
 makeopts.embed_rules: menuselect.makeopts
 	@echo "Generating embedded module rules ..."
@@ -652,11 +660,11 @@
 			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
 		elif [ -f /etc/debian_version ]; then \
 			$(INSTALL) -m 755 contrib/init.d/rc.debian.asterisk $(DESTDIR)/etc/init.d/asterisk; \
-			if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk start 10 2 3 4 5 . stop 91 2 3 4 5 .; fi; \
+			if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk start 50 2 3 4 5 . stop 91 2 3 4 5 .; fi; \
 		elif [ -f /etc/gentoo-release ]; then \
 			$(INSTALL) -m 755 contrib/init.d/rc.gentoo.asterisk $(DESTDIR)/etc/init.d/asterisk; \
 			if [ -z "$(DESTDIR)" ]; then /sbin/rc-update add asterisk default; fi; \
-		elif [ -f /etc/mandrake-release ]; then \
+		elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ]; then \
 			$(INSTALL) -m 755 contrib/init.d/rc.mandrake.asterisk $(DESTDIR)/etc/rc.d/init.d/asterisk; \
 			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
 		elif [ -f /etc/SuSE-release -o -f /etc/novell-release ]; then \
@@ -741,6 +749,14 @@
 
 menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml configure
 	@echo "Generating input for menuselect ..."
-	@build_tools/prep_moduledeps > $@
+	@echo "<?xml version=\"1.0\"?>" > $@
+	@echo >> $@
+	@echo "<menu name=\"Asterisk Module and Build Option Selection\">" >> $@
+	@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SUBMAKE) -C $${dir} SUBDIR=$${dir} moduleinfo >> $@; done
+	@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SUBMAKE) -C $${dir} SUBDIR=$${dir} makeopts >> $@; done
+	@cat build_tools/cflags.xml >> $@
+	@cat build_tools/embed_modules.xml >> $@
+	@cat sounds/sounds.xml >> $@
+	@echo "</menu>" >> $@
 
 .PHONY: menuselect main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) menuselect.makeopts

Modified: team/oej/fixtoheader-1.4/Makefile.moddir_rules
URL: http://svn.digium.com/view/asterisk/team/oej/fixtoheader-1.4/Makefile.moddir_rules?view=diff&rev=93876&r1=93875&r2=93876
==============================================================================
--- team/oej/fixtoheader-1.4/Makefile.moddir_rules (original)
+++ team/oej/fixtoheader-1.4/Makefile.moddir_rules Wed Dec 19 02:39:12 2007
@@ -42,7 +42,7 @@
 modules.link: $(addsuffix .o,$(filter $(EMBEDDED_MODS),$(C_MODS)))
 modules.link: $(addsuffix .oo,$(filter $(EMBEDDED_MODS),$(CC_MODS)))
 
-.PHONY: clean uninstall _all
+.PHONY: clean uninstall _all moduleinfo makeopts
 
 ifneq ($(LOADABLE_MODS),)
 _all: $(LOADABLE_MODS:%=%.so)
@@ -79,6 +79,40 @@
 
 uninstall::
 
+dist-clean::
+	rm -f .*.moduleinfo .moduleinfo
+	rm -f .*.makeopts .makeopts
+
+.%.moduleinfo: %.c
+	@echo "<member name=\"$*\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.o $(SUBDIR)/$*.so\">" > $@
+	$(AWK) -f $(ASTTOPDIR)/build_tools/get_moduleinfo $< >> $@
+	echo "</member>" >> $@
+
+.%.moduleinfo: %.cc
+	@echo "<member name=\"$*\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.oo $(SUBDIR)/$*.so\">" > $@
+	$(AWK) -f $(ASTTOPDIR)/build_tools/get_moduleinfo $< >> $@
+	echo "</member>" >> $@
+
+.moduleinfo:: $(addsuffix .moduleinfo,$(addprefix .,$(ALL_C_MODS) $(ALL_CC_MODS)))
+	@echo "<category name=\"MENUSELECT_$(MENUSELECT_CATEGORY)\" displayname=\"$(MENUSELECT_DESCRIPTION)\" remove_on_change=\"$(SUBDIR)/modules.link\">" > $@
+	@cat $^ >> $@
+	@echo "</category>" >> $@
+
+moduleinfo: .moduleinfo
+	@cat $<
+
+.%.makeopts: %.c
+	@$(AWK) -f $(ASTTOPDIR)/build_tools/get_makeopts $< > $@
+
+.%.makeopts: %.cc
+	@$(AWK) -f $(ASTTOPDIR)/build_tools/get_makeopts $< > $@
+
+.makeopts:: $(addsuffix .makeopts,$(addprefix .,$(ALL_C_MODS) $(ALL_CC_MODS)))
+	@cat $^ > $@
+
+makeopts: .makeopts
+	@cat $<
+
 ifneq ($(wildcard .*.d),)
    include .*.d
 endif

Propchange: team/oej/fixtoheader-1.4/apps/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Dec 19 02:39:12 2007
@@ -1,6 +1,8 @@
+*.a
 *.d
-*.a
+*.i
+*.makeopts
+*.moduleinfo
+*.s
 *.so
-*.s
-*.i
 modules.link

Modified: team/oej/fixtoheader-1.4/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/fixtoheader-1.4/apps/Makefile?view=diff&rev=93876&r1=93875&r2=93876
==============================================================================
--- team/oej/fixtoheader-1.4/apps/Makefile (original)
+++ team/oej/fixtoheader-1.4/apps/Makefile Wed Dec 19 02:39:12 2007
@@ -11,8 +11,14 @@
 
 -include ../menuselect.makeopts ../menuselect.makedeps
 
-C_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.c,%,$(wildcard app_*.c)))
-CC_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.cc,%,$(wildcard app_*.cc)))
+MENUSELECT_CATEGORY=APPS
+MENUSELECT_DESCRIPTION=Applications
+
+ALL_C_MODS:=$(patsubst %.c,%,$(wildcard app_*.c))
+ALL_CC_MODS:=$(patsubst %.cc,%,$(wildcard app_*.cc))
+
+C_MODS:=$(filter-out $(MENUSELECT_APPS),$(ALL_C_MODS))
+CC_MODS:=$(filter-out $(MENUSELECT_APPS),$(ALL_CC_MODS))
 
 LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
 

Modified: team/oej/fixtoheader-1.4/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/fixtoheader-1.4/apps/app_dial.c?view=diff&rev=93876&r1=93875&r2=93876
==============================================================================
--- team/oej/fixtoheader-1.4/apps/app_dial.c (original)
+++ team/oej/fixtoheader-1.4/apps/app_dial.c Wed Dec 19 02:39:12 2007
@@ -57,9 +57,11 @@
 #include "asterisk/app.h"
 #include "asterisk/causes.h"
 #include "asterisk/rtp.h"
+#include "asterisk/cdr.h"
 #include "asterisk/manager.h"
 #include "asterisk/privacy.h"
 #include "asterisk/stringfields.h"
+#include "asterisk/global_datastores.h"
 
 static char *app = "Dial";
 
@@ -302,7 +304,6 @@
 struct dial_localuser {
 	struct ast_channel *chan;
 	unsigned int flags;
-	int forwards;
 	struct dial_localuser *next;
 };
 
@@ -320,8 +321,6 @@
 		free(oo);
 	}
 }
-
-#define AST_MAX_FORWARDS   8
 
 #define AST_MAX_WATCHERS 256
 
@@ -487,30 +486,23 @@
 					tech = "Local";
 				}
 				/* Before processing channel, go ahead and check for forwarding */
-				o->forwards++;
-				if (o->forwards < AST_MAX_FORWARDS) {
+				if (option_verbose > 2)
+					ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name);
+				/* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */
+				if (ast_test_flag(peerflags, OPT_IGNORE_FORWARDING)) {
 					if (option_verbose > 2)
-						ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name);
-					/* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */
-					if (ast_test_flag(peerflags, OPT_IGNORE_FORWARDING)) {
-						if (option_verbose > 2)
-							ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s/%s' prevented.\n", in->name, tech, stuff);
-						c = o->chan = NULL;
-						cause = AST_CAUSE_BUSY;
-					} else {
-						/* Setup parameters */
-						if ((c = o->chan = ast_request(tech, in->nativeformats, stuff, &cause))) {
-							if (single)
-								ast_channel_make_compatible(o->chan, in);
-							ast_channel_inherit_variables(in, o->chan);
-						} else
-							ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
-					}
+						ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s/%s' prevented.\n", in->name, tech, stuff);
+					c = o->chan = NULL;
+					cause = AST_CAUSE_BUSY;
 				} else {
-					if (option_verbose > 2)
-						ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", c->name);
-					cause = AST_CAUSE_CONGESTION;
-					c = o->chan = NULL;
+					/* Setup parameters */
+					if ((c = o->chan = ast_request(tech, in->nativeformats, stuff, &cause))) {
+						if (single)
+							ast_channel_make_compatible(o->chan, in);
+						ast_channel_inherit_variables(in, o->chan);
+						ast_channel_datastore_inherit(in, o->chan);
+					} else
+						ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
 				}
 				if (!c) {
 					ast_clear_flag(o, DIAL_STILLGOING);	
@@ -762,7 +754,26 @@
 		}
 		
 	}
-
+	if (peer && !ast_cdr_log_unanswered()) {
+		/* suppress the CDR's that didn't win */
+		struct dial_localuser *o;
+		for (o = outgoing; o; o = o->next) {
+			struct ast_channel *c = o->chan;
+			if (c && c != peer && c->cdr) {
+				ast_set_flag(c->cdr, AST_CDR_FLAG_POST_DISABLED);
+			}
+		}
+	} else if (!peer && !ast_cdr_log_unanswered()) {
+			/* suppress the CDR's that didn't win */
+		struct dial_localuser *o;
+		for (o = outgoing; o; o = o->next) {
+			struct ast_channel *c = o->chan;
+			if (c && c->cdr) {
+				ast_set_flag(c->cdr, AST_CDR_FLAG_POST_DISABLED);		
+			}
+		}
+	}
+	
 	return peer;
 }
 
@@ -827,6 +838,8 @@
 	);
 	struct ast_flags opts = { 0, };
 	char *opt_args[OPT_ARG_ARRAY_SIZE];
+	struct ast_datastore *datastore = NULL;
+	int fulldial = 0, num_dialed = 0;
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
@@ -1087,7 +1100,12 @@
 		struct dial_localuser *tmp;
 		/* Get a technology/[device:]number pair */
 		char *number = cur;
+		char *interface = ast_strdupa(number);
 		char *tech = strsep(&number, "/");
+		/* find if we already dialed this interface */
+		struct ast_dialed_interface *di;
+		AST_LIST_HEAD(, ast_dialed_interface) *dialed_interfaces;
+		num_dialed++;
 		if (!number) {
 			ast_log(LOG_WARNING, "Dial argument takes format (technology/[device:]number1)\n");
 			goto out;
@@ -1105,6 +1123,68 @@
 		}
 		ast_copy_string(numsubst, number, sizeof(numsubst));
 		/* Request the peer */
+
+		ast_channel_lock(chan);
+		datastore = ast_channel_datastore_find(chan, &dialed_interface_info, NULL);
+		ast_channel_unlock(chan);
+
+		if (datastore)
+			dialed_interfaces = datastore->data;
+		else {
+			if (!(datastore = ast_channel_datastore_alloc(&dialed_interface_info, NULL))) {
+				ast_log(LOG_WARNING, "Unable to create channel datastore for dialed interfaces. Aborting!\n"); 
+				free(tmp);
+				goto out;
+			}
+
+			datastore->inheritance = DATASTORE_INHERIT_FOREVER;
+
+			if (!(dialed_interfaces = ast_calloc(1, sizeof(*dialed_interfaces)))) {
+				free(tmp);
+				goto out;
+			}
+
+			datastore->data = dialed_interfaces;
+			AST_LIST_HEAD_INIT(dialed_interfaces);
+
+			ast_channel_lock(chan);
+			ast_channel_datastore_add(chan, datastore);
+			ast_channel_unlock(chan);
+		}
+
+		AST_LIST_LOCK(dialed_interfaces);
+		AST_LIST_TRAVERSE(dialed_interfaces, di, list) {
+			if (!strcasecmp(di->interface, interface)) {
+				ast_log(LOG_WARNING, "Skipping dialing interface '%s' again since it has already been dialed\n", 
+					di->interface);
+				break;
+			}
+		}
+		AST_LIST_UNLOCK(dialed_interfaces);
+
+		if (di) {
+			fulldial++;
+			free(tmp);
+			continue;
+		}
+
+		/* It is always ok to dial a Local interface.  We only keep track of
+		 * which "real" interfaces have been dialed.  The Local channel will
+		 * inherit this list so that if it ends up dialing a real interface,
+		 * it won't call one that has already been called. */
+		if (strcasecmp(tech, "Local")) {
+			if (!(di = ast_calloc(1, sizeof(*di) + strlen(interface)))) {
+				AST_LIST_UNLOCK(dialed_interfaces);
+				free(tmp);
+				goto out;
+			}
+			strcpy(di->interface, interface);
+
+			AST_LIST_LOCK(dialed_interfaces);
+			AST_LIST_INSERT_TAIL(dialed_interfaces, di, list);
+			AST_LIST_UNLOCK(dialed_interfaces);
+		}
+
 		tmp->chan = ast_request(tech, chan->nativeformats, numsubst, &cause);
 		if (!tmp->chan) {
 			/* If we can't, just go on to the next call */
@@ -1115,51 +1195,8 @@
 			free(tmp);
 			continue;
 		}
-		pbx_builtin_setvar_helper(tmp->chan, "DIALEDPEERNUMBER", numsubst);
-		if (!ast_strlen_zero(tmp->chan->call_forward)) {
-			char tmpchan[256];
-			char *stuff;
-			char *tech;
-			ast_copy_string(tmpchan, tmp->chan->call_forward, sizeof(tmpchan));
-			if ((stuff = strchr(tmpchan, '/'))) {
-				*stuff++ = '\0';
-				tech = tmpchan;
-			} else {
-				snprintf(tmpchan, sizeof(tmpchan), "%s@%s", tmp->chan->call_forward, tmp->chan->context);
-				stuff = tmpchan;
-				tech = "Local";
-			}
-			tmp->forwards++;
-			if (tmp->forwards < AST_MAX_FORWARDS) {
-				if (option_verbose > 2)
-					ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", chan->name, tech, stuff, tmp->chan->name);
-				ast_hangup(tmp->chan);
-				/* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */
-				if (ast_test_flag(&opts, OPT_IGNORE_FORWARDING)) {
-					tmp->chan = NULL;
-					cause = AST_CAUSE_BUSY;
-					if (option_verbose > 2)
-						ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s/%s' prevented.\n", chan->name, tech, stuff);
-				} else {
-					tmp->chan = ast_request(tech, chan->nativeformats, stuff, &cause);
-				}
-				if (!tmp->chan)
-					ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
-				else
-					ast_channel_inherit_variables(chan, tmp->chan);
-			} else {
-				if (option_verbose > 2)
-					ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", tmp->chan->name);
-				ast_hangup(tmp->chan);
-				tmp->chan = NULL;
-				cause = AST_CAUSE_CONGESTION;
-			}
-			if (!tmp->chan) {
-				HANDLE_CAUSE(cause, chan);
-				free(tmp);
-				continue;
-			}
-		}
+
+				pbx_builtin_setvar_helper(tmp->chan, "DIALEDPEERNUMBER", numsubst);
 
 		/* Setup outgoing SDP to match incoming one */
 		ast_rtp_make_compatible(tmp->chan, chan, !outgoing && !rest);
@@ -1264,6 +1301,10 @@
 
 	if (!outgoing) {
 		strcpy(status, "CHANUNAVAIL");
+		if(fulldial == num_dialed) {
+			res = -1;
+			goto out;
+		}
 	} else {
 		/* Our status will at least be NOANSWER */
 		strcpy(status, "NOANSWER");
@@ -1286,7 +1327,9 @@
 
 	time(&start_time);
 	peer = wait_for_answer(chan, outgoing, &to, peerflags, &sentringing, status, sizeof(status), numbusy, numnochan, numcongestion, ast_test_flag(&opts, OPT_PRIORITY_JUMP), &result);
-	
+
+	ast_channel_datastore_remove(chan, datastore);
+	ast_channel_datastore_free(datastore);
 	if (!peer) {
 		if (result) {
 			res = result;
@@ -1502,8 +1545,10 @@
 		if (chan && peer && ast_test_flag(&opts, OPT_GOTO) && !ast_strlen_zero(opt_args[OPT_ARG_GOTO])) {
 			replace_macro_delimiter(opt_args[OPT_ARG_GOTO]);
 			ast_parseable_goto(chan, opt_args[OPT_ARG_GOTO]);
-			ast_parseable_goto(peer, opt_args[OPT_ARG_GOTO]);
-			peer->priority++;
+			/* peer goes to the same context and extension as chan, so just copy info from chan*/
+			ast_copy_string(peer->context, chan->context, sizeof(peer->context));
+			ast_copy_string(peer->exten, chan->exten, sizeof(peer->exten));
+			peer->priority = chan->priority + 2;
 			ast_pbx_start(peer);
 			hanguptree(outgoing, NULL);
 			if (continue_exec)

Modified: team/oej/fixtoheader-1.4/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/fixtoheader-1.4/apps/app_meetme.c?view=diff&rev=93876&r1=93875&r2=93876
==============================================================================
--- team/oej/fixtoheader-1.4/apps/app_meetme.c (original)
+++ team/oej/fixtoheader-1.4/apps/app_meetme.c Wed Dec 19 02:39:12 2007
@@ -1254,7 +1254,7 @@
 		ast_hangup(conf->lchan);
 	if (conf->chan)
 		ast_hangup(conf->chan);
-	else
+	if (conf->fd >= 0)
 		close(conf->fd);
 
 	ast_mutex_destroy(&conf->playlock);
@@ -1406,6 +1406,7 @@
 	ZT_BUFFERINFO bi;
 	char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
 	char *buf = __buf + AST_FRIENDLY_OFFSET;
+	int setusercount = 0;
 
 	if (!(user = ast_calloc(1, sizeof(*user))))
 		return ret;
@@ -1464,9 +1465,6 @@
 		goto outrun;
 	}
 
-	if (confflags & CONFFLAG_MARKEDUSER)
-		conf->markedusers++;
-      
    	ast_mutex_lock(&conf->playlock);
 
 	if (AST_LIST_EMPTY(&conf->userlist))
@@ -1480,25 +1478,8 @@
 	user->userflags = confflags;
 	user->adminflags = (confflags & CONFFLAG_STARTMUTED) ? ADMINFLAG_SELFMUTED : 0;
 	user->talking = -1;
-	conf->users++;
-	/* Update table */
-	snprintf(members, sizeof(members), "%d", conf->users);
-	ast_update_realtime("meetme", "confno", conf->confno, "members", members , NULL);
-
-	/* This device changed state now - if this is the first user */
-	if (conf->users == 1)
-		ast_device_state_changed("meetme:%s", conf->confno);
 
 	ast_mutex_unlock(&conf->playlock);
-
-	if (confflags & CONFFLAG_EXIT_CONTEXT) {
-		if ((agifile = pbx_builtin_getvar_helper(chan, "MEETME_EXIT_CONTEXT"))) 
-			ast_copy_string(exitcontext, agifile, sizeof(exitcontext));
-		else if (!ast_strlen_zero(chan->macrocontext)) 
-			ast_copy_string(exitcontext, chan->macrocontext, sizeof(exitcontext));
-		else
-			ast_copy_string(exitcontext, chan->context, sizeof(exitcontext));
-	}
 
 	if (!(confflags & CONFFLAG_QUIET) && ((confflags & CONFFLAG_INTROUSER) || (confflags & CONFFLAG_INTROUSERNOREVIEW))) {
 		snprintf(user->namerecloc, sizeof(user->namerecloc),
@@ -1510,6 +1491,31 @@
 			res = ast_record_review(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, NULL);
 		if (res == -1)
 			goto outrun;
+	}
+
+	ast_mutex_lock(&conf->playlock);
+
+	if (confflags & CONFFLAG_MARKEDUSER)
+		conf->markedusers++;
+	conf->users++;
+	/* Update table */
+	snprintf(members, sizeof(members), "%d", conf->users);
+	ast_update_realtime("meetme", "confno", conf->confno, "members", members , NULL);
+	setusercount = 1;
+
+	/* This device changed state now - if this is the first user */
+	if (conf->users == 1)
+		ast_device_state_changed("meetme:%s", conf->confno);
+
+	ast_mutex_unlock(&conf->playlock);
+
+	if (confflags & CONFFLAG_EXIT_CONTEXT) {
+		if ((agifile = pbx_builtin_getvar_helper(chan, "MEETME_EXIT_CONTEXT"))) 
+			ast_copy_string(exitcontext, agifile, sizeof(exitcontext));
+		else if (!ast_strlen_zero(chan->macrocontext)) 
+			ast_copy_string(exitcontext, chan->macrocontext, sizeof(exitcontext));
+		else
+			ast_copy_string(exitcontext, chan->context, sizeof(exitcontext));
 	}
 
 	if ( !(confflags & (CONFFLAG_QUIET | CONFFLAG_NOONLYPERSON)) ) {
@@ -2274,12 +2280,14 @@
 				      (long)(now - user->jointime));
 		}
 
-		conf->users--;
-		/* Update table */
-		snprintf(members, sizeof(members), "%d", conf->users);
-		ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
-		if (confflags & CONFFLAG_MARKEDUSER) 
-			conf->markedusers--;
+		if (setusercount) {
+			conf->users--;
+			/* Update table */
+			snprintf(members, sizeof(members), "%d", conf->users);
+			ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
+			if (confflags & CONFFLAG_MARKEDUSER) 
+				conf->markedusers--;
+		}
 		/* Remove ourselves from the list */
 		AST_LIST_REMOVE(&conf->userlist, user, list);
 
@@ -4171,6 +4179,29 @@
 			trunk_ref->state = SLA_TRUNK_STATE_UP;
 			ast_device_state_changed("SLA:%s_%s", station->name, trunk_ref->trunk->name);
 		}
+	} else if (trunk_ref->state == SLA_TRUNK_STATE_RINGING) {
+		struct sla_ringing_trunk *ringing_trunk;
+
+		ast_mutex_lock(&sla.lock);
+		AST_LIST_TRAVERSE_SAFE_BEGIN(&sla.ringing_trunks, ringing_trunk, entry) {
+			if (ringing_trunk->trunk == trunk_ref->trunk) {
+				AST_LIST_REMOVE_CURRENT(&sla.ringing_trunks, entry);
+				break;
+			}
+		}
+		AST_LIST_TRAVERSE_SAFE_END
+		ast_mutex_unlock(&sla.lock);
+
+		if (ringing_trunk) {
+			ast_answer(ringing_trunk->trunk->chan);
+			sla_change_trunk_state(ringing_trunk->trunk, SLA_TRUNK_STATE_UP, ALL_TRUNK_REFS, NULL);
+
+			free(ringing_trunk);
+
+			/* Queue up reprocessing ringing trunks, and then ringing stations again */
+			sla_queue_event(SLA_EVENT_RINGING_TRUNK);
+			sla_queue_event(SLA_EVENT_DIAL_STATE);
+		}
 	}
 
 	trunk_ref->chan = chan;
@@ -4459,6 +4490,9 @@
 		pthread_join(sla.thread, NULL);
 	}
 
+	/* Drop any created contexts from the dialplan */
+	ast_context_destroy(NULL, sla_registrar);
+
 	ast_mutex_destroy(&sla.lock);
 	ast_cond_destroy(&sla.cond);
 }

Modified: team/oej/fixtoheader-1.4/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/oej/fixtoheader-1.4/apps/app_mixmonitor.c?view=diff&rev=93876&r1=93875&r2=93876
==============================================================================
--- team/oej/fixtoheader-1.4/apps/app_mixmonitor.c (original)
+++ team/oej/fixtoheader-1.4/apps/app_mixmonitor.c Wed Dec 19 02:39:12 2007
@@ -211,14 +211,14 @@
 	if (option_verbose > 1)
 		ast_verbose(VERBOSE_PREFIX_2 "End MixMonitor Recording %s\n", mixmonitor->name);
 
+	if (fs)
+		ast_closestream(fs);
+
 	if (mixmonitor->post_process) {
 		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_2 "Executing [%s]\n", mixmonitor->post_process);
 		ast_safe_system(mixmonitor->post_process);
 	}
-		
-	if (fs)
-		ast_closestream(fs);
 
 	free(mixmonitor);
 

Modified: team/oej/fixtoheader-1.4/apps/app_playback.c
URL: http://svn.digium.com/view/asterisk/team/oej/fixtoheader-1.4/apps/app_playback.c?view=diff&rev=93876&r1=93875&r2=93876
==============================================================================
--- team/oej/fixtoheader-1.4/apps/app_playback.c (original)
+++ team/oej/fixtoheader-1.4/apps/app_playback.c Wed Dec 19 02:39:12 2007
@@ -152,7 +152,6 @@
 	struct varshead head = { .first = NULL, .last = NULL };
 	struct ast_var_t *n;
 
-	ast_log(LOG_WARNING, "string <%s> depth <%d>\n", s, depth);
 	if (depth++ > 10) {
 		ast_log(LOG_WARNING, "recursion too deep, exiting\n");
 		return -1;
@@ -164,7 +163,6 @@
 	/* scan languages same as in file.c */
 	if (a->language == NULL)
 		a->language = "en";     /* default */
-	ast_log(LOG_WARNING, "try <%s> in <%s>\n", s, a->language);
 	lang = ast_strdupa(a->language);
 	for (;;) {
 		for (v = ast_variable_browse(say_cfg, lang); v ; v = v->next) {
@@ -190,12 +188,11 @@
 		s = x + 1;
 	if ( (x = strchr(s, ':')) )
 		s = x + 1;
-	ast_log(LOG_WARNING, "value is <%s>\n", s);
 	n = ast_var_assign("SAY", s);
 	AST_LIST_INSERT_HEAD(&head, n, entries);
 
 	/* scan the body, one piece at a time */
-	while ( ret <= 0 && (x = strsep(&rule, ",")) ) { /* exit on key */
+	while ( !ret && (x = strsep(&rule, ",")) ) { /* exit on key */
 		char fn[128];
 		const char *p, *fmt, *data; /* format and data pointers */
 
@@ -206,7 +203,6 @@
 		/* replace variables */
 		memset(fn, 0, sizeof(fn)); /* XXX why isn't done in pbx_substitute_variables_helper! */
 		pbx_substitute_variables_varshead(&head, x, fn, sizeof(fn));
-		ast_log(LOG_WARNING, "doing [%s]\n", fn);
 
 		/* locate prefix and data, if any */
 		fmt = index(fn, ':');
@@ -245,6 +241,10 @@
 				strcpy(fn2 + l, data);
 				ret = do_say(a, fn2, options, depth);
 			}
+			
+			if (ret) {
+				break;
+			}
 		}
 	}
 	ast_var_delete(n);

Modified: team/oej/fixtoheader-1.4/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/fixtoheader-1.4/apps/app_queue.c?view=diff&rev=93876&r1=93875&r2=93876
==============================================================================
--- team/oej/fixtoheader-1.4/apps/app_queue.c (original)
+++ team/oej/fixtoheader-1.4/apps/app_queue.c Wed Dec 19 02:39:12 2007
@@ -56,6 +56,10 @@
  * \ingroup applications
  */
 
+/*** MODULEINFO
+        <depend>res_monitor</depend>
+ ***/
+
 #include "asterisk.h"
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -93,6 +97,7 @@
 #include "asterisk/devicestate.h"
 #include "asterisk/stringfields.h"
 #include "asterisk/astobj2.h"
+#include "asterisk/global_datastores.h"
 
 enum {
 	QUEUE_STRATEGY_RINGALL = 0,
@@ -307,6 +312,7 @@
 	time_t last_pos;                    /*!< Last time we told the user their position */
 	int opos;                           /*!< Where we started in the queue */
 	int handled;                        /*!< Whether our call was handled */
+	int pending;                        /*!< Non-zero if we are attempting to call a member */
 	int max_penalty;                    /*!< Limit the members that can take this call to this penalty or lower */
 	time_t start;                       /*!< When we started holding */
 	time_t expire;                      /*!< When this entry should expire (time out of queue) */
@@ -1016,7 +1022,7 @@
 		if (!strcasecmp(val, "vars")) {
 			q->eventwhencalled = QUEUE_EVENT_VARIABLES;
 		} else {
-			q->eventwhencalled = ast_true(val);
+			q->eventwhencalled = ast_true(val) ? 1 : 0;
 		}
 	} else if (!strcasecmp(param, "reportholdtime")) {
 		q->reportholdtime = ast_true(val);
@@ -1069,6 +1075,8 @@
 			m->realtime = 1;
 			add_to_interfaces(interface);
 			ao2_link(q->members, m);
+			ao2_ref(m, -1);
+			m = NULL;
 			q->membercount++;
 		}
 	} else {
@@ -1321,6 +1329,7 @@
 			member_config = ast_load_realtime_multientry("queue_members", "interface LIKE", "%", "queue_name", queuename, NULL);
 			if (!member_config) {
 				ast_log(LOG_ERROR, "no queue_members defined in your config (extconfig.conf).\n");
+				ast_variables_destroy(queue_vars);
 				return NULL;
 			}
 		}
@@ -1739,8 +1748,8 @@
 			if (tmp[i + 1] == '\0')
 				break;
 			if (tmp[i] == '\n') {
-				vars[j] = '\r';
-				vars[++j] = '\n';
+				vars[j++] = '\r';
+				vars[j++] = '\n';
 
 				ast_copy_string(&(vars[j]), "Variable: ", len - j);
 				j += 9;
@@ -2035,7 +2044,6 @@
 	char *queue = qe->parent->name;
 	struct callattempt *o;
 	int status;
-	int sentringing = 0;
 	int numbusies = prebusies;
 	int numnochan = 0;
 	int stillgoing = 0;
@@ -2130,6 +2138,7 @@
 						numnochan++;
 					} else {
 						ast_channel_inherit_variables(in, o->chan);
+						ast_channel_datastore_inherit(in, o->chan);
 						if (o->chan->cid.cid_num)
 							free(o->chan->cid.cid_num);
 						o->chan->cid.cid_num = ast_strdup(in->cid.cid_num);
@@ -2206,12 +2215,6 @@
 						case AST_CONTROL_RINGING:
 							if (option_verbose > 2)
 								ast_verbose( VERBOSE_PREFIX_3 "%s is ringing\n", o->chan->name);
-							if (!sentringing) {
-#if 0
-								ast_indicate(in, AST_CONTROL_RINGING);
-#endif								
-								sentringing++;
-							}
 							break;
 						case AST_CONTROL_OFFHOOK:
 							/* Ignore going off hook */
@@ -2296,7 +2299,7 @@
 	
 		if (qe->parent->strategy == QUEUE_STRATEGY_RINGALL) {
 			if (option_debug)
-				ast_log(LOG_DEBUG, "Even though there are %d available members, the strategy is ringall so only the head call is allowed in\n", avl);
+				ast_log(LOG_DEBUG, "Even though there may be multiple members available, the strategy is ringall so only the head call is allowed in\n");
 			avl = 1;
 		} else {
 			struct ao2_iterator mem_iter = ao2_iterator_init(qe->parent->members, 0);
@@ -2315,7 +2318,7 @@
 		if (option_debug)
 			ast_log(LOG_DEBUG, "There are %d available members.\n", avl);
 	
-		while ((idx < avl) && (ch) && (ch != qe)) {
+		while ((idx < avl) && (ch) &&  !ch->pending && (ch != qe)) {
 			idx++;
 			ch = ch->next;			
 		}
@@ -2497,6 +2500,11 @@
 	int forwardsallowed = 1;
 	int callcompletedinsl;
 	struct ao2_iterator memi;
+	struct ast_datastore *datastore;
+
+	ast_channel_lock(qe->chan);
+	datastore = ast_channel_datastore_find(qe->chan, &dialed_interface_info, NULL);
+	ast_channel_unlock(qe->chan);
 
 	memset(&bridge_config, 0, sizeof(bridge_config));
 	time(&now);
@@ -2552,7 +2560,8 @@
 	memi = ao2_iterator_init(qe->parent->members, 0);
 	while ((cur = ao2_iterator_next(&memi))) {
 		struct callattempt *tmp = ast_calloc(1, sizeof(*tmp));
-
+		struct ast_dialed_interface *di;
+		AST_LIST_HEAD(, ast_dialed_interface) *dialed_interfaces;
 		if (!tmp) {
 			ao2_ref(cur, -1);
 			ast_mutex_unlock(&qe->parent->lock);
@@ -2560,6 +2569,68 @@
 				AST_LIST_UNLOCK(&queues);
 			goto out;
 		}
+		if (!datastore) {
+			if (!(datastore = ast_channel_datastore_alloc(&dialed_interface_info, NULL))) {
+				ao2_ref(cur, -1);
+				ast_mutex_unlock(&qe->parent->lock);
+				if (use_weight)
+					AST_LIST_UNLOCK(&queues);
+				free(tmp);
+				goto out;
+			}
+			datastore->inheritance = DATASTORE_INHERIT_FOREVER;
+			if (!(dialed_interfaces = ast_calloc(1, sizeof(*dialed_interfaces)))) {
+				ao2_ref(cur, -1);
+				ast_mutex_unlock(&qe->parent->lock);
+				if (use_weight)
+					AST_LIST_UNLOCK(&queues);
+				free(tmp);
+				goto out;
+			}
+			datastore->data = dialed_interfaces;
+			AST_LIST_HEAD_INIT(dialed_interfaces);
+
+			ast_channel_lock(qe->chan);
+			ast_channel_datastore_add(qe->chan, datastore);
+			ast_channel_unlock(qe->chan);
+		} else
+			dialed_interfaces = datastore->data;
+
+		AST_LIST_LOCK(dialed_interfaces);
+		AST_LIST_TRAVERSE(dialed_interfaces, di, list) {
+			if (!strcasecmp(cur->interface, di->interface)) {
+				ast_log(LOG_DEBUG, "Skipping dialing interface '%s' since it has already been dialed\n", 
+					di->interface);
+				break;
+			}
+		}
+		AST_LIST_UNLOCK(dialed_interfaces);
+		
+		if (di) {
+			free(tmp);
+			continue;
+		}
+
+		/* It is always ok to dial a Local interface.  We only keep track of
+		 * which "real" interfaces have been dialed.  The Local channel will
+		 * inherit this list so that if it ends up dialing a real interface,
+		 * it won't call one that has already been called. */
+		if (strncasecmp(cur->interface, "Local/", 6)) {
+			if (!(di = ast_calloc(1, sizeof(*di) + strlen(cur->interface)))) {
+				ao2_ref(cur, -1);
+				ast_mutex_unlock(&qe->parent->lock);
+				if (use_weight)
+					AST_LIST_UNLOCK(&queues);

[... 7835 lines stripped ...]



More information about the asterisk-commits mailing list