[asterisk-commits] branch group/new_loader_completion r35767 - in /team/group/new_loader_complet...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jun 23 16:46:38 MST 2006


Author: kpfleming
Date: Fri Jun 23 18:46:37 2006
New Revision: 35767

URL: http://svn.digium.com/view/asterisk?rev=35767&view=rev
Log:
partial update

Added:
    team/group/new_loader_completion/codecs/codec_zap.c
      - copied, changed from r35766, trunk/codecs/codec_zap.c
Removed:
    team/group/new_loader_completion/build_tools/Makefile
    team/group/new_loader_completion/build_tools/menuselect.c
    team/group/new_loader_completion/build_tools/menuselect.h
    team/group/new_loader_completion/build_tools/menuselect_curses.c
    team/group/new_loader_completion/mxml/
Modified:
    team/group/new_loader_completion/   (props changed)
    team/group/new_loader_completion/Makefile
    team/group/new_loader_completion/agi/Makefile
    team/group/new_loader_completion/apps/Makefile
    team/group/new_loader_completion/apps/app_queue.c
    team/group/new_loader_completion/build_tools/menuselect-deps.in
    team/group/new_loader_completion/cdr/Makefile
    team/group/new_loader_completion/channels/Makefile
    team/group/new_loader_completion/channels/chan_iax2.c
    team/group/new_loader_completion/channels/chan_skinny.c
    team/group/new_loader_completion/channels/chan_zap.c
    team/group/new_loader_completion/channels/h323/Makefile
    team/group/new_loader_completion/codecs/Makefile
    team/group/new_loader_completion/configs/queues.conf.sample
    team/group/new_loader_completion/configure
    team/group/new_loader_completion/configure.ac
    team/group/new_loader_completion/doc/   (props changed)
    team/group/new_loader_completion/formats/Makefile
    team/group/new_loader_completion/funcs/Makefile
    team/group/new_loader_completion/makeopts.in
    team/group/new_loader_completion/manager.c
    team/group/new_loader_completion/pbx/Makefile
    team/group/new_loader_completion/res/Makefile
    team/group/new_loader_completion/res/res_snmp.c
    team/group/new_loader_completion/sounds/Makefile
    team/group/new_loader_completion/utils/Makefile

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
--- svn:externals (added)
+++ svn:externals Fri Jun 23 18:46:37 2006
@@ -1,0 +1,2 @@
+menuselect	http://svn.digium.com/svn/menuselect/trunk
+mxml		http://svn.digium.com/svn/mxml/trunk

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jun 23 18:46:37 2006
@@ -1,1 +1,1 @@
-/trunk:1-35481
+/trunk:1-35766

Modified: team/group/new_loader_completion/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/Makefile?rev=35767&r1=35766&r2=35767&view=diff
==============================================================================
--- team/group/new_loader_completion/Makefile (original)
+++ team/group/new_loader_completion/Makefile Fri Jun 23 18:46:37 2006
@@ -12,8 +12,6 @@
 #
 
 .EXPORT_ALL_VARIABLES:
-
-.PHONY: sounds clean clean-depend dist-clean all
 
 # Create OPTIONS variable
 OPTIONS=
@@ -264,12 +262,16 @@
 
 ASTCFLAGS+=$(MALLOC_DEBUG)$(BUSYDETECT)$(OPTIONS)
 
-MOD_SUBDIRS=res channels pbx codecs formats cdr funcs apps
-OTHER_SUBDIRS=utils agi
+MOD_SUBDIRS:=res channels pbx apps codecs formats cdr funcs
+OTHER_SUBDIRS:=utils agi
 SUBDIRS:=$(MOD_SUBDIRS) $(OTHER_SUBDIRS)
 SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
 SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
 SUBDIRS_CLEAN_DEPEND:=$(SUBDIRS:%=%-clean-depend)
+MOD_SUBDIRS_DEPEND:=$(MOD_SUBDIRS:%=%-depend)
+OTHER_SUBDIRS_DEPEND:=$(OTHER_SUBDIRS:%=%-depend)
+SUBDIRS_DEPEND:=$(MOD_SUBDIRS_DEPEND) $(OTHER_SUBDIRS_DEPEND)
+SUBDIRS_UNINSTALL:=$(SUBDIRS:%=%-uninstall)
 
 OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
 	translate.o file.o pbx.o cli.o md5.o term.o \
@@ -368,10 +370,10 @@
 
 all: cleantest config.status menuselect.makeopts depend asterisk $(SUBDIRS)
 
-$(MOD_SUBDIRS): FORCE
+$(MOD_SUBDIRS):
 	@CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $@
 
-$(OTHER_SUBDIRS): FORCE 
+$(OTHER_SUBDIRS):
 	@CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $@
 
 config.status: configure
@@ -390,8 +392,8 @@
 	@echo "****"
 	@exit 1
 
-menuselect.makeopts: build_tools/menuselect makeopts.xml
-	@build_tools/menuselect --check-deps ${GLOBAL_MAKEOPTS} ${USER_MAKEOPTS} $@
+menuselect.makeopts: menuselect/menuselect makeopts.xml
+	@menuselect/menuselect --check-deps ${GLOBAL_MAKEOPTS} ${USER_MAKEOPTS} $@
 
 #ifneq ($(wildcard tags),)
 ctags: tags
@@ -511,8 +513,10 @@
 	@$(MAKE) -C sounds dist-clean
 	rm -f menuselect.makeopts makeopts makeopts.xml
 	rm -f config.log config.status
+	rm -rf autom4te.cache
 	rm -f include/autoconfig.h
 	rm -f include/asterisk/buildopts.h
+	rm -rf doc/api
 
 datafiles: all
 	if [ x`$(ID) -un` = xroot ]; then sh build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
@@ -775,9 +779,13 @@
 
 valgrind: dont-optimize
 
-depend: include/asterisk/version.h include/asterisk/buildopts.h .depend defaults.h 
-	@for x in $(MOD_SUBDIRS); do CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $$x depend || exit 1 ; done
-	@for x in $(OTHER_SUBDIRS); do CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $$x depend || exit 1 ; done
+$(MOD_SUBDIRS_DEPEND):
+	@CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $(@:-depend=) depend
+
+$(OTHER_SUBDIRS_DEPEND):
+	@CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $(@:-depend=) depend
+
+depend: include/asterisk/version.h include/asterisk/buildopts.h .depend defaults.h $(SUBDIRS_DEPEND)
 
 .depend: include/asterisk/version.h include/asterisk/buildopts.h defaults.h
 	build_tools/mkdep $(CFLAGS) $(wildcard *.c)
@@ -809,8 +817,6 @@
 
 etags: TAGS
 
-FORCE:
-
 %_env:
 	$(MAKE) -C $(shell echo $@ | sed "s/_env//g") env
 
@@ -830,7 +836,10 @@
 		$(MAKE) defaults.h;\
 	fi
 
-_uninstall:
+$(SUBDIRS_UNINSTALL):
+	@$(MAKE) -C $(@:-uninstall=) uninstall
+
+_uninstall: $(SUBDIRS_UNINSTALL)
 	rm -f $(DESTDIR)$(MODULES_DIR)/*
 	rm -f $(DESTDIR)$(ASTSBINDIR)/*asterisk*
 	rm -f $(DESTDIR)$(ASTSBINDIR)/astgenkey
@@ -838,7 +847,6 @@
 	rm -rf $(DESTDIR)$(ASTHEADERDIR)
 	rm -rf $(DESTDIR)$(ASTDATADIR)/firmware
 	rm -rf $(DESTDIR)$(ASTMANDIR)/man8
-	for x in $(SUBDIRS); do $(MAKE) -C $$x uninstall || exit 1 ; done
 	$(MAKE) -C sounds uninstall
 
 uninstall: _uninstall
@@ -863,11 +871,11 @@
 	rm -rf $(DESTDIR)$(ASTETCDIR)
 	rm -rf $(DESTDIR)$(ASTLOGDIR)
 
-menuselect: build_tools/menuselect makeopts.xml
-	- at build_tools/menuselect ${GLOBAL_MAKEOPTS} ${USER_MAKEOPTS} menuselect.makeopts && echo "menuselect changes saved!" || echo "menuselect changes NOT saved!"
-
-build_tools/menuselect: build_tools/menuselect.c build_tools/menuselect_curses.c build_tools/menuselect.h config.status mxml/libmxml.a $(MENUSELECT_OBJS)
-	$(MAKE) -C build_tools menuselect
+menuselect: menuselect/menuselect makeopts.xml
+	- at menuselect/menuselect ${GLOBAL_MAKEOPTS} ${USER_MAKEOPTS} menuselect.makeopts && echo "menuselect changes saved!" || echo "menuselect changes NOT saved!"
+
+menuselect/menuselect: menuselect/menuselect.c menuselect/menuselect_curses.c menuselect/menuselect.h config.status mxml/libmxml.a $(MENUSELECT_OBJS)
+	@CFLAGS="-include ../include/asterisk/autoconfig.h" $(MAKE) -C menuselect menuselect
 
 mxml/libmxml.a:
 	@cd mxml && unset CFLAGS LIBS && test -f config.h || ./configure
@@ -876,3 +884,5 @@
 makeopts.xml: $(foreach dir,$(MOD_SUBDIRS),$(dir)/*.c) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml
 	@echo "Generating list of available modules ..."
 	@build_tools/prep_moduledeps > $@
+
+.PHONY: sounds clean clean-depend dist-clean distclean all _all depend cleantest uninstall _uninstall uninstall-all dont-optimize valgrind $(SUBDIRS_INSTALL) $(SUBDIRS_CLEAN) $(SUBDIRS_CLEAN_DEPEND) $(SUBDIRS_DEPEND) $(SUBDIRS_UNINSTALL) $(SUBDIRS)

Modified: team/group/new_loader_completion/agi/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/agi/Makefile?rev=35767&r1=35766&r2=35767&view=diff
==============================================================================
--- team/group/new_loader_completion/agi/Makefile (original)
+++ team/group/new_loader_completion/agi/Makefile Fri Jun 23 18:46:37 2006
@@ -11,7 +11,7 @@
 # the GNU General Public License
 #
 
-.PHONY: clean clean-depend all
+.PHONY: clean clean-depend all depend uninstall
 
 AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi
 

Modified: team/group/new_loader_completion/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/apps/Makefile?rev=35767&r1=35766&r2=35767&view=diff
==============================================================================
--- team/group/new_loader_completion/apps/Makefile (original)
+++ team/group/new_loader_completion/apps/Makefile Fri Jun 23 18:46:37 2006
@@ -11,7 +11,7 @@
 # the GNU General Public License
 #
 
-.PHONY: clean clean-depend all
+.PHONY: clean clean-depend all depend uninstall
 
 ifneq ($(wildcard ../menuselect.makeopts),)
   include ../menuselect.makeopts

Modified: team/group/new_loader_completion/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/apps/app_queue.c?rev=35767&r1=35766&r2=35767&view=diff
==============================================================================
--- team/group/new_loader_completion/apps/app_queue.c (original)
+++ team/group/new_loader_completion/apps/app_queue.c Fri Jun 23 18:46:37 2006
@@ -327,6 +327,7 @@
 #define QUEUE_EMPTY_STRICT 2
 #define ANNOUNCEHOLDTIME_ALWAYS 1
 #define ANNOUNCEHOLDTIME_ONCE 2
+#define QUEUE_EVENT_VARIABLES 3
 
 struct call_queue {
 	ast_mutex_t lock;	
@@ -337,7 +338,7 @@
 	unsigned int monjoin:1;
 	unsigned int dead:1;
 	unsigned int joinempty:2;
-	unsigned int eventwhencalled:1;
+	unsigned int eventwhencalled:2;
 	unsigned int leavewhenempty:2;
 	unsigned int ringinuse:1;
 	unsigned int setinterfacevar:1;
@@ -871,7 +872,11 @@
 	} else if (!strcasecmp(param, "eventmemberstatus")) {
 		q->maskmemberstatus = !ast_true(val);
 	} else if (!strcasecmp(param, "eventwhencalled")) {
-		q->eventwhencalled = ast_true(val);
+		if (strcasecmp(val, "vars")) {
+			q->eventwhencalled = QUEUE_EVENT_VARIABLES;
+		} else {
+			q->eventwhencalled = ast_true(val);
+		}
 	} else if (!strcasecmp(param, "reportholdtime")) {
 		q->reportholdtime = ast_true(val);
 	} else if (!strcasecmp(param, "memberdelay")) {
@@ -1493,6 +1498,41 @@
 	o->stillgoing = 0;
 	ast_hangup(o->chan);
 	o->chan = NULL;
+}
+
+static char *vars2manager(struct ast_channel *chan, char *vars, size_t len)
+{
+	char *tmp = alloca(len);
+
+	if (pbx_builtin_serialize_variables(chan, tmp, len)) {
+		int i, j;
+
+		/* convert "\n" to "\nVariable: " */
+		strcpy(vars, "Variable: ");
+
+		for (i = 0, j = 10; (i < len - 1) && (j < len - 1); i++, j++) {
+			vars[j] = tmp[i];
+
+			if (tmp[i + 1] == '\0')
+				break;
+			if (tmp[i] == '\n') {
+				vars[j] = '\r';
+				vars[++j] = '\n';
+
+				ast_copy_string(&(vars[j]), "Variable: ", len - j);
+				j += 9;
+			}
+		}
+		if (j > len - 1)
+			j = len - 1;
+		vars[j - 2] = '\r';
+		vars[j - 1] = '\n';
+		vars[j] = '\0';
+	} else {
+		/* there are no channel variables; leave it blank */
+		*vars = '\0';
+	}
+	return vars;
 }
 
 static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies)
@@ -1586,21 +1626,23 @@
 		do_hang(tmp);
 		(*busies)++;
 		return 0;
-	} else {
-		if (qe->parent->eventwhencalled) {
-			manager_event(EVENT_FLAG_AGENT, "AgentCalled",
-						"AgentCalled: %s\r\n"
-						"ChannelCalling: %s\r\n"
-						"CallerID: %s\r\n"
-						"CallerIDName: %s\r\n"
-						"Context: %s\r\n"
-						"Extension: %s\r\n"
-						"Priority: %d\r\n",
-						tmp->interface, qe->chan->name,
-						S_OR(tmp->chan->cid.cid_num, "unknown"),
-						S_OR(tmp->chan->cid.cid_name, "unknown"),
-						qe->chan->context, qe->chan->exten, qe->chan->priority);
-		}
+	} else if (qe->parent->eventwhencalled) {
+		char vars[2048];
+
+		manager_event(EVENT_FLAG_AGENT, "AgentCalled",
+					"AgentCalled: %s\r\n"
+					"ChannelCalling: %s\r\n"
+					"CallerID: %s\r\n"
+					"CallerIDName: %s\r\n"
+					"Context: %s\r\n"
+					"Extension: %s\r\n"
+					"Priority: %d\r\n"
+					"%s",
+					tmp->interface, qe->chan->name,
+					tmp->chan->cid.cid_num ? tmp->chan->cid.cid_num : "unknown",
+					tmp->chan->cid.cid_name ? tmp->chan->cid.cid_name : "unknown",
+					qe->chan->context, qe->chan->exten, qe->chan->priority,
+					qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
 		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", tmp->interface);
 	}
@@ -2230,6 +2272,7 @@
 	char mixmonargs[1512];
 	struct ast_app *mixmonapp = NULL;
 	char *p;
+	char vars[2048];
 
 	memset(&bridge_config, 0, sizeof(bridge_config));
 	time(&now);
@@ -2378,14 +2421,15 @@
 				ast_log(LOG_WARNING, "Agent on %s hungup on the customer.  They're going to be pissed.\n", peer->name);
 				ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "AGENTDUMP", "%s", "");
 				record_abandoned(qe);
-				if (qe->parent->eventwhencalled) {
+				if (qe->parent->eventwhencalled)
 					manager_event(EVENT_FLAG_AGENT, "AgentDump",
-						      "Queue: %s\r\n"
-						      "Uniqueid: %s\r\n"
-						      "Channel: %s\r\n"
-						      "Member: %s\r\n",
-						      queuename, qe->chan->uniqueid, peer->name, member->interface);
-				}
+							"Queue: %s\r\n"
+							"Uniqueid: %s\r\n"
+							"Channel: %s\r\n"
+							"Member: %s\r\n"
+							"%s",
+							queuename, qe->chan->uniqueid, peer->name, member->interface,
+							qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
 				ast_hangup(peer);
 				goto out;
 			} else if (res2) {
@@ -2523,14 +2567,16 @@
 		ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "CONNECT", "%ld|%s", (long)time(NULL) - qe->start, peer->uniqueid);
 		if (qe->parent->eventwhencalled)
 			manager_event(EVENT_FLAG_AGENT, "AgentConnect",
-				      "Queue: %s\r\n"
-				      "Uniqueid: %s\r\n"
-				      "Channel: %s\r\n"
-				      "Member: %s\r\n"
-				      "Holdtime: %ld\r\n"
-				      "BridgedChannel: %s\r\n",
-				      queuename, qe->chan->uniqueid, peer->name, member->interface,
-				      (long) time(NULL) - qe->start,peer->uniqueid);
+					"Queue: %s\r\n"
+					"Uniqueid: %s\r\n"
+					"Channel: %s\r\n"
+					"Member: %s\r\n"
+					"Holdtime: %ld\r\n"
+					"BridgedChannel: %s\r\n"
+					"%s",
+					queuename, qe->chan->uniqueid, peer->name, member->interface,
+					(long)time(NULL) - qe->start, peer->uniqueid,
+					qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
 		ast_copy_string(oldcontext, qe->chan->context, sizeof(oldcontext));
 		ast_copy_string(oldexten, qe->chan->exten, sizeof(oldexten));
 		time(&callstart);
@@ -2546,28 +2592,32 @@
 				      (long) (callstart - qe->start), (long) (time(NULL) - callstart));
 			if (qe->parent->eventwhencalled)
 				manager_event(EVENT_FLAG_AGENT, "AgentComplete",
-					      "Queue: %s\r\n"
-					      "Uniqueid: %s\r\n"
-					      "Channel: %s\r\n"
-					      "Member: %s\r\n"
-					      "HoldTime: %ld\r\n"
-					      "TalkTime: %ld\r\n"
-					      "Reason: caller\r\n",
-					      queuename, qe->chan->uniqueid, peer->name, member->interface,
-					      (long) (callstart - qe->start), (long) (time(NULL) - callstart));
+						"Queue: %s\r\n"
+						"Uniqueid: %s\r\n"
+						"Channel: %s\r\n"
+						"Member: %s\r\n"
+						"HoldTime: %ld\r\n"
+						"TalkTime: %ld\r\n"
+						"Reason: caller\r\n"
+						"%s",
+						queuename, qe->chan->uniqueid, peer->name, member->interface,
+						(long)(callstart - qe->start), (long)(time(NULL) - callstart),
+						qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
 		} else {
 			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "COMPLETEAGENT", "%ld|%ld",
 				      (long) (callstart - qe->start), (long) (time(NULL) - callstart));
 			if (qe->parent->eventwhencalled)
 				manager_event(EVENT_FLAG_AGENT, "AgentComplete",
-					      "Queue: %s\r\n"
-					      "Uniqueid: %s\r\n"
-					      "Channel: %s\r\n"
-					      "HoldTime: %ld\r\n"
-					      "TalkTime: %ld\r\n"
-					      "Reason: agent\r\n",
-					      queuename, qe->chan->uniqueid, peer->name, (long)(callstart - qe->start),
-					      (long) (time(NULL) - callstart));
+						"Queue: %s\r\n"
+						"Uniqueid: %s\r\n"
+						"Channel: %s\r\n"
+						"HoldTime: %ld\r\n"
+						"TalkTime: %ld\r\n"
+						"Reason: agent\r\n"
+						"%s",
+						queuename, qe->chan->uniqueid, peer->name, (long)(callstart - qe->start),
+						(long)(time(NULL) - callstart),
+						qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
 		}
 
 		if (bridge != AST_PBX_NO_HANGUP_PEER)
@@ -3693,8 +3743,10 @@
 			else
 				ast_log(LOG_DEBUG, "XXX Leaking a little memory :( XXX\n");
 		} else {
+			ast_mutex_lock(&q->lock);
 			for (cur = q->members; cur; cur = cur->next)
 				cur->status = ast_device_state(cur->interface);
+			ast_mutex_unlock(&q->lock);
 		}
 	}
 	AST_LIST_TRAVERSE_SAFE_END;

Modified: team/group/new_loader_completion/build_tools/menuselect-deps.in
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/build_tools/menuselect-deps.in?rev=35767&r1=35766&r2=35767&view=diff
==============================================================================
--- team/group/new_loader_completion/build_tools/menuselect-deps.in (original)
+++ team/group/new_loader_completion/build_tools/menuselect-deps.in Fri Jun 23 18:46:37 2006
@@ -26,3 +26,4 @@
 LIBGSM=@PBX_LIBgsm@
 IKSEMEL=@PBX_LIBIKSEMEL@
 IXJUSER=@PBX_IXJUSER@
+NETSNMP=@PBX_NETSNMP@

Modified: team/group/new_loader_completion/cdr/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/cdr/Makefile?rev=35767&r1=35766&r2=35767&view=diff
==============================================================================
--- team/group/new_loader_completion/cdr/Makefile (original)
+++ team/group/new_loader_completion/cdr/Makefile Fri Jun 23 18:46:37 2006
@@ -11,7 +11,7 @@
 # the GNU General Public License
 #
 
-.PHONY: clean clean-depend all
+.PHONY: clean clean-depend all depend uninstall
 
 ifneq ($(wildcard ../menuselect.makeopts),)
   include ../menuselect.makeopts

Modified: team/group/new_loader_completion/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/Makefile?rev=35767&r1=35766&r2=35767&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/Makefile (original)
+++ team/group/new_loader_completion/channels/Makefile Fri Jun 23 18:46:37 2006
@@ -11,7 +11,7 @@
 # the GNU General Public License
 #
 
-.PHONY: clean clean-depend all
+.PHONY: clean clean-depend all depend uninstall
 
 ifneq ($(wildcard ../menuselect.makeopts),)
   include ../menuselect.makeopts

Modified: team/group/new_loader_completion/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_iax2.c?rev=35767&r1=35766&r2=35767&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_iax2.c (original)
+++ team/group/new_loader_completion/channels/chan_iax2.c Fri Jun 23 18:46:37 2006
@@ -3268,60 +3268,67 @@
 	struct chan_iax2_pvt *i;
 	struct ast_variable *v = NULL;
 
+	if (!(i = iaxs[callno])) {
+		ast_log(LOG_WARNING, "No IAX2 pvt found for callno '%d' !\n", callno);
+		return NULL;
+	}
+
 	/* Don't hold call lock */
 	ast_mutex_unlock(&iaxsl[callno]);
 	tmp = ast_channel_alloc(1);
 	ast_mutex_lock(&iaxsl[callno]);
-	i = iaxs[callno];
-	if (i && tmp) {
-		tmp->tech = &iax2_tech;
-		ast_string_field_build(tmp, name, "IAX2/%s-%d", i->host, i->callno);
-		/* We can support any format by default, until we get restricted */
-		tmp->nativeformats = capability;
-		tmp->readformat = ast_best_codec(capability);
-		tmp->writeformat = ast_best_codec(capability);
-		tmp->tech_pvt = CALLNO_TO_PTR(i->callno);
-
-		if (!ast_strlen_zero(i->cid_num))
-			tmp->cid.cid_num = ast_strdup(i->cid_num);
-		if (!ast_strlen_zero(i->cid_name))
-			tmp->cid.cid_name = ast_strdup(i->cid_name);
-		if (!ast_strlen_zero(i->ani))
-			tmp->cid.cid_ani = ast_strdup(i->ani);
-		if (!ast_strlen_zero(i->language))
-			ast_string_field_set(tmp, language, i->language);
-		if (!ast_strlen_zero(i->dnid))
-			tmp->cid.cid_dnid = ast_strdup(i->dnid);
-		if (!ast_strlen_zero(i->rdnis))
-			tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
-		tmp->cid.cid_pres = i->calling_pres;
-		tmp->cid.cid_ton = i->calling_ton;
-		tmp->cid.cid_tns = i->calling_tns;
-		if (!ast_strlen_zero(i->accountcode))
-			ast_string_field_set(tmp, accountcode, i->accountcode);
-		if (i->amaflags)
-			tmp->amaflags = i->amaflags;
-		ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
-		ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
-		tmp->adsicpe = i->peeradsicpe;
-		i->owner = tmp;
-		i->capability = capability;
-		ast_setstate(tmp, state);
-		ast_mutex_lock(&usecnt_lock);
-		usecnt++;
-		ast_mutex_unlock(&usecnt_lock);
-		ast_update_use_count();
-		if (state != AST_STATE_DOWN) {
-			if (ast_pbx_start(tmp)) {
-				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
-				ast_hangup(tmp);
-				tmp = NULL;
-			}
-		}
-		for (v = i->vars ; v ; v = v->next)
-			pbx_builtin_setvar_helper(tmp,v->name,v->value);
-		
-	}
+	if (!tmp)
+		return NULL;
+	tmp->tech = &iax2_tech;
+	ast_string_field_build(tmp, name, "IAX2/%s-%d", i->host, i->callno);
+	/* We can support any format by default, until we get restricted */
+	tmp->nativeformats = capability;
+	tmp->readformat = ast_best_codec(capability);
+	tmp->writeformat = ast_best_codec(capability);
+	tmp->tech_pvt = CALLNO_TO_PTR(i->callno);
+
+	if (!ast_strlen_zero(i->cid_num))
+		tmp->cid.cid_num = ast_strdup(i->cid_num);
+	if (!ast_strlen_zero(i->cid_name))
+		tmp->cid.cid_name = ast_strdup(i->cid_name);
+	if (!ast_strlen_zero(i->ani))
+		tmp->cid.cid_ani = ast_strdup(i->ani);
+	if (!ast_strlen_zero(i->language))
+		ast_string_field_set(tmp, language, i->language);
+	if (!ast_strlen_zero(i->dnid))
+		tmp->cid.cid_dnid = ast_strdup(i->dnid);
+	if (!ast_strlen_zero(i->rdnis))
+		tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
+	tmp->cid.cid_pres = i->calling_pres;
+	tmp->cid.cid_ton = i->calling_ton;
+	tmp->cid.cid_tns = i->calling_tns;
+	if (!ast_strlen_zero(i->accountcode))
+		ast_string_field_set(tmp, accountcode, i->accountcode);
+	if (i->amaflags)
+		tmp->amaflags = i->amaflags;
+	ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
+	ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
+	tmp->adsicpe = i->peeradsicpe;
+	i->owner = tmp;
+	i->capability = capability;
+	ast_setstate(tmp, state);
+	if (state != AST_STATE_DOWN) {
+		if (ast_pbx_start(tmp)) {
+			ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
+			ast_hangup(tmp);
+			i->owner = NULL;
+			return NULL;
+		}
+	}
+
+	for (v = i->vars ; v ; v = v->next)
+		pbx_builtin_setvar_helper(tmp, v->name, v->value);
+
+	ast_mutex_lock(&usecnt_lock);
+	usecnt++;
+	ast_mutex_unlock(&usecnt_lock);
+	ast_update_use_count();
+	
 	return tmp;
 }
 

Modified: team/group/new_loader_completion/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_skinny.c?rev=35767&r1=35766&r2=35767&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_skinny.c (original)
+++ team/group/new_loader_completion/channels/chan_skinny.c Fri Jun 23 18:46:37 2006
@@ -3138,14 +3138,15 @@
 		switch (btn[i].buttonDefinition) {
 			case BT_CUST_LINESPEEDDIAL:
 				/* assume failure */
-				req->data.buttontemplate.definition[i].buttonDefinition = htolel(BT_NONE);
+				req->data.buttontemplate.definition[i].buttonDefinition = BT_NONE;
 				req->data.buttontemplate.definition[i].instanceNumber = htolel(0);
 
 				for (l = d->lines; l; l = l->next) {
 					if (l->instance == lineInstance) {
 						ast_verbose("Adding button: %d, %d\n", BT_LINE, lineInstance);
-						req->data.buttontemplate.definition[i].buttonDefinition = htolel(BT_LINE);
-						req->data.buttontemplate.definition[i].instanceNumber = htolel(lineInstance++);
+						req->data.buttontemplate.definition[i].buttonDefinition = BT_LINE;
+						req->data.buttontemplate.definition[i].instanceNumber = htolel(lineInstance);
+						lineInstance++;
 						buttonCount++;
 						btnSet = 1;
 						break;
@@ -3156,8 +3157,9 @@
 					for (sd = d->speeddials; sd; sd = sd->next) {
 						if (sd->instance == speeddialInstance) {
 							ast_verbose("Adding button: %d, %d\n", BT_SPEEDDIAL, speeddialInstance);
-							req->data.buttontemplate.definition[i].buttonDefinition = htolel(BT_SPEEDDIAL);
-							req->data.buttontemplate.definition[i].instanceNumber = htolel(speeddialInstance++);
+							req->data.buttontemplate.definition[i].buttonDefinition = BT_SPEEDDIAL;
+							req->data.buttontemplate.definition[i].instanceNumber = htolel(speeddialInstance);
+							speeddialInstance++;
 							buttonCount++;
 							btnSet = 1;
 							break;
@@ -3172,8 +3174,9 @@
 				for (l = d->lines; l; l = l->next) {
 					if (l->instance == lineInstance) {
 						ast_verbose("Adding button: %d, %d\n", BT_LINE, lineInstance);
-						req->data.buttontemplate.definition[i].buttonDefinition = htolel(BT_LINE);
-						req->data.buttontemplate.definition[i].instanceNumber = htolel(lineInstance++);
+						req->data.buttontemplate.definition[i].buttonDefinition = BT_LINE;
+						req->data.buttontemplate.definition[i].instanceNumber = htolel(lineInstance);
+						lineInstance++;
 						buttonCount++;
 						btnSet = 1;
 						break;
@@ -3187,8 +3190,9 @@
 				for (sd = d->speeddials; sd; sd = sd->next) {
 					if (sd->instance == speeddialInstance) {
 						ast_verbose("Adding button: %d, %d\n", BT_SPEEDDIAL, speeddialInstance);
-						req->data.buttontemplate.definition[i].buttonDefinition = htolel(BT_SPEEDDIAL);
-						req->data.buttontemplate.definition[i].instanceNumber = htolel(speeddialInstance++);
+						req->data.buttontemplate.definition[i].buttonDefinition = BT_SPEEDDIAL;
+						req->data.buttontemplate.definition[i].instanceNumber = htolel(speeddialInstance);
+						speeddialInstance++;
 						buttonCount++;
 						btnSet = 1;
 						break;

Modified: team/group/new_loader_completion/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_zap.c?rev=35767&r1=35766&r2=35767&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_zap.c (original)
+++ team/group/new_loader_completion/channels/chan_zap.c Fri Jun 23 18:46:37 2006
@@ -5039,173 +5039,170 @@
 		ast_log(LOG_WARNING, "Channel %d already has a %s call\n", i->channel,subnames[index]);
 		return NULL;
 	}
-	tmp = ast_channel_alloc(0);
-	if (tmp) {
-		tmp->tech = &zap_tech;
-		ps.channo = i->channel;
-		res = ioctl(i->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &ps);
-		if (res) {
-			ast_log(LOG_WARNING, "Unable to get parameters, assuming MULAW\n");
-			ps.curlaw = ZT_LAW_MULAW;
-		}
-		if (ps.curlaw == ZT_LAW_ALAW)
+	if (!(tmp = ast_channel_alloc(0)))
+		return NULL;
+	tmp->tech = &zap_tech;
+	ps.channo = i->channel;
+	res = ioctl(i->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &ps);
+	if (res) {
+		ast_log(LOG_WARNING, "Unable to get parameters, assuming MULAW\n");
+		ps.curlaw = ZT_LAW_MULAW;
+	}
+	if (ps.curlaw == ZT_LAW_ALAW)
+		deflaw = AST_FORMAT_ALAW;
+	else
+		deflaw = AST_FORMAT_ULAW;
+	if (law) {
+		if (law == ZT_LAW_ALAW)
 			deflaw = AST_FORMAT_ALAW;
 		else
 			deflaw = AST_FORMAT_ULAW;
-		if (law) {
-			if (law == ZT_LAW_ALAW)
-				deflaw = AST_FORMAT_ALAW;
+	}
+	y = 1;
+	do {
+#ifdef HAVE_LIBPRI
+		if (i->bearer || (i->pri && (i->sig == SIG_FXSKS)))
+			ast_string_field_build(tmp, name, "Zap/%d:%d-%d", i->pri->trunkgroup, i->channel, y);
+		else
+#endif
+		if (i->channel == CHAN_PSEUDO)
+			ast_string_field_build(tmp, name, "Zap/pseudo-%d", ast_random());
+		else	
+			ast_string_field_build(tmp, name, "Zap/%d-%d", i->channel, y);
+		for (x = 0; x < 3; x++) {
+			if ((index != x) && i->subs[x].owner && !strcasecmp(tmp->name, i->subs[x].owner->name))
+				break;
+		}
+		y++;
+	} while (x < 3);
+	tmp->fds[0] = i->subs[index].zfd;
+	tmp->nativeformats = AST_FORMAT_SLINEAR | deflaw;
+	/* Start out assuming ulaw since it's smaller :) */
+	tmp->rawreadformat = deflaw;
+	tmp->readformat = deflaw;
+	tmp->rawwriteformat = deflaw;
+	tmp->writeformat = deflaw;
+	i->subs[index].linear = 0;
+	zt_setlinear(i->subs[index].zfd, i->subs[index].linear);
+	features = 0;
+	if (i->busydetect && CANBUSYDETECT(i))
+		features |= DSP_FEATURE_BUSY_DETECT;
+	if ((i->callprogress & 1) && CANPROGRESSDETECT(i))
+		features |= DSP_FEATURE_CALL_PROGRESS;
+	if ((!i->outgoing && (i->callprogress & 4)) || 
+	    (i->outgoing && (i->callprogress & 2))) {
+		features |= DSP_FEATURE_FAX_DETECT;
+	}
+#ifdef ZT_TONEDETECT
+	x = ZT_TONEDETECT_ON | ZT_TONEDETECT_MUTE;
+	if (ioctl(i->subs[index].zfd, ZT_TONEDETECT, &x)) {
+#endif		
+		i->hardwaredtmf = 0;
+		features |= DSP_FEATURE_DTMF_DETECT;
+#ifdef ZT_TONEDETECT
+	} else if (NEED_MFDETECT(i)) {
+		i->hardwaredtmf = 1;
+		features |= DSP_FEATURE_DTMF_DETECT;
+	}
+#endif
+	if (features) {
+		if (i->dsp) {
+			ast_log(LOG_DEBUG, "Already have a dsp on %s?\n", tmp->name);
+		} else {
+			if (i->channel != CHAN_PSEUDO)
+				i->dsp = ast_dsp_new();
 			else
-				deflaw = AST_FORMAT_ULAW;
-		}
-		y = 1;
-		do {
+				i->dsp = NULL;
+			if (i->dsp) {
+				i->dsp_features = features & ~DSP_PROGRESS_TALK;
 #ifdef HAVE_LIBPRI
-			if (i->bearer || (i->pri && (i->sig == SIG_FXSKS)))
-				ast_string_field_build(tmp, name, "Zap/%d:%d-%d", i->pri->trunkgroup, i->channel, y);
-			else
+				/* We cannot do progress detection until receives PROGRESS message */
+				if (i->outgoing && (i->sig == SIG_PRI)) {
+					/* Remember requested DSP features, don't treat
+					   talking as ANSWER */
+					features = 0;
+				}
 #endif
-			if (i->channel == CHAN_PSEUDO)
-				ast_string_field_build(tmp, name, "Zap/pseudo-%d", ast_random());
-			else	
-				ast_string_field_build(tmp, name, "Zap/%d-%d", i->channel, y);
-			for (x = 0; x < 3; x++) {
-				if ((index != x) && i->subs[x].owner && !strcasecmp(tmp->name, i->subs[x].owner->name))
-					break;
-			}
-			y++;
-		} while (x < 3);
-		tmp->fds[0] = i->subs[index].zfd;
-		tmp->nativeformats = AST_FORMAT_SLINEAR | deflaw;
-		/* Start out assuming ulaw since it's smaller :) */
-		tmp->rawreadformat = deflaw;
-		tmp->readformat = deflaw;
-		tmp->rawwriteformat = deflaw;
-		tmp->writeformat = deflaw;
-		i->subs[index].linear = 0;
-		zt_setlinear(i->subs[index].zfd, i->subs[index].linear);
-		features = 0;
-		if (i->busydetect && CANBUSYDETECT(i)) {
-			features |= DSP_FEATURE_BUSY_DETECT;
-		}
-		if ((i->callprogress & 1) && CANPROGRESSDETECT(i)) {
-			features |= DSP_FEATURE_CALL_PROGRESS;
-		}
-		if ((!i->outgoing && (i->callprogress & 4)) || 
-		    (i->outgoing && (i->callprogress & 2))) {
-			features |= DSP_FEATURE_FAX_DETECT;
-		}
-#ifdef ZT_TONEDETECT
-		x = ZT_TONEDETECT_ON | ZT_TONEDETECT_MUTE;
-		if (ioctl(i->subs[index].zfd, ZT_TONEDETECT, &x)) {
-#endif		
-			i->hardwaredtmf = 0;
-			features |= DSP_FEATURE_DTMF_DETECT;
-#ifdef ZT_TONEDETECT
-		} else if (NEED_MFDETECT(i)) {
-			i->hardwaredtmf = 1;
-			features |= DSP_FEATURE_DTMF_DETECT;
-		}
+				ast_dsp_set_features(i->dsp, features);
+				ast_dsp_digitmode(i->dsp, DSP_DIGITMODE_DTMF | i->dtmfrelax);
+				if (!ast_strlen_zero(progzone))
+					ast_dsp_set_call_progress_zone(i->dsp, progzone);
+				if (i->busydetect && CANBUSYDETECT(i)) {
+					ast_dsp_set_busy_count(i->dsp, i->busycount);
+					ast_dsp_set_busy_pattern(i->dsp, i->busy_tonelength, i->busy_quietlength);
+				}
+			}
+		}
+	}
+		
+	if (state == AST_STATE_RING)
+		tmp->rings = 1;
+	tmp->tech_pvt = i;
+	if ((i->sig == SIG_FXOKS) || (i->sig == SIG_FXOGS) || (i->sig == SIG_FXOLS)) {
+		/* Only FXO signalled stuff can be picked up */
+		tmp->callgroup = i->callgroup;
+		tmp->pickupgroup = i->pickupgroup;
+	}
+	if (!ast_strlen_zero(i->language))
+		ast_string_field_set(tmp, language, i->language);
+	if (!ast_strlen_zero(i->musicclass))
+		ast_string_field_set(tmp, musicclass, i->musicclass);
+	if (!i->owner)
+		i->owner = tmp;
+	if (!ast_strlen_zero(i->accountcode))
+		ast_string_field_set(tmp, accountcode, i->accountcode);
+	if (i->amaflags)
+		tmp->amaflags = i->amaflags;
+	i->subs[index].owner = tmp;
+	ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
+	ast_string_field_set(tmp, call_forward, i->call_forward);
+	/* If we've been told "no ADSI" then enforce it */
+	if (!i->adsi)
+		tmp->adsicpe = AST_ADSI_UNAVAILABLE;
+	if (!ast_strlen_zero(i->exten))
+		ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
+	if (!ast_strlen_zero(i->rdnis))
+		tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
+	if (!ast_strlen_zero(i->dnid))
+		tmp->cid.cid_dnid = ast_strdup(i->dnid);
+
+#ifdef PRI_ANI
+	ast_set_callerid(tmp, i->cid_num, i->cid_name, S_OR(i->cid_ani, i->cid_num));
+#else
+	ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
 #endif
-		if (features) {
-			if (i->dsp) {
-				ast_log(LOG_DEBUG, "Already have a dsp on %s?\n", tmp->name);
-			} else {
-				if (i->channel != CHAN_PSEUDO)
-					i->dsp = ast_dsp_new();
-				else
-					i->dsp = NULL;
-				if (i->dsp) {
-					i->dsp_features = features & ~DSP_PROGRESS_TALK;
+	tmp->cid.cid_pres = i->callingpres;
+	tmp->cid.cid_ton = i->cid_ton;
 #ifdef HAVE_LIBPRI
-					/* We cannot do progress detection until receives PROGRESS message */
-					if (i->outgoing && (i->sig == SIG_PRI)) {
-						/* Remember requested DSP features, don't treat
-						   talking as ANSWER */
-						features = 0;
-					}
+	tmp->transfercapability = transfercapability;
+	pbx_builtin_setvar_helper(tmp, "TRANSFERCAPABILITY", ast_transfercapability2str(transfercapability));
+	if (transfercapability & PRI_TRANS_CAP_DIGITAL)
+		i->digital = 1;
+	/* Assume calls are not idle calls unless we're told differently */
+	i->isidlecall = 0;
+	i->alreadyhungup = 0;
 #endif
-					ast_dsp_set_features(i->dsp, features);
-					ast_dsp_digitmode(i->dsp, DSP_DIGITMODE_DTMF | i->dtmfrelax);
-					if (!ast_strlen_zero(progzone))
-						ast_dsp_set_call_progress_zone(i->dsp, progzone);
-					if (i->busydetect && CANBUSYDETECT(i)) {
-						ast_dsp_set_busy_count(i->dsp, i->busycount);
-						ast_dsp_set_busy_pattern(i->dsp, i->busy_tonelength, i->busy_quietlength);
-					}
-				}
-			}
-		}
-		
-		if (state == AST_STATE_RING)
-			tmp->rings = 1;
-		tmp->tech_pvt = i;
-		if ((i->sig == SIG_FXOKS) || (i->sig == SIG_FXOGS) || (i->sig == SIG_FXOLS)) {
-			/* Only FXO signalled stuff can be picked up */
-			tmp->callgroup = i->callgroup;
-			tmp->pickupgroup = i->pickupgroup;
-		}
-		if (!ast_strlen_zero(i->language))
-			ast_string_field_set(tmp, language, i->language);
-		if (!ast_strlen_zero(i->musicclass))
-			ast_string_field_set(tmp, musicclass, i->musicclass);
-		if (!i->owner)
-			i->owner = tmp;
-		if (!ast_strlen_zero(i->accountcode))
-			ast_string_field_set(tmp, accountcode, i->accountcode);
-		if (i->amaflags)
-			tmp->amaflags = i->amaflags;
-		i->subs[index].owner = tmp;
-		ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
-		ast_string_field_set(tmp, call_forward, i->call_forward);
-		/* If we've been told "no ADSI" then enforce it */
-		if (!i->adsi)
-			tmp->adsicpe = AST_ADSI_UNAVAILABLE;
-		if (!ast_strlen_zero(i->exten))
-			ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
-		if (!ast_strlen_zero(i->rdnis))
-			tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
-		if (!ast_strlen_zero(i->dnid))
-			tmp->cid.cid_dnid = ast_strdup(i->dnid);
-
-#ifdef PRI_ANI
-		ast_set_callerid(tmp, i->cid_num, i->cid_name, S_OR(i->cid_ani, i->cid_num));
-#else
-		ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
-#endif
-		tmp->cid.cid_pres = i->callingpres;
-		tmp->cid.cid_ton = i->cid_ton;
-#ifdef HAVE_LIBPRI
-		tmp->transfercapability = transfercapability;
-		pbx_builtin_setvar_helper(tmp, "TRANSFERCAPABILITY", ast_transfercapability2str(transfercapability));
-		if (transfercapability & PRI_TRANS_CAP_DIGITAL) {
-			i->digital = 1;
-		}
-		/* Assume calls are not idle calls unless we're told differently */
-		i->isidlecall = 0;
-		i->alreadyhungup = 0;
-#endif
-		/* clear the fake event in case we posted one before we had ast_channel */
-		i->fake_event = 0;
-		/* Assure there is no confmute on this channel */
-		zt_confmute(i, 0);
-		ast_setstate(tmp, state);
-		ast_mutex_lock(&usecnt_lock);
-		usecnt++;
-		ast_mutex_unlock(&usecnt_lock);
-		ast_update_use_count();
-		if (startpbx) {
-			if (ast_pbx_start(tmp)) {
-				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
-				ast_hangup(tmp);
-				tmp = NULL;
-			}
-		}
-	} else
-		ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
+	/* clear the fake event in case we posted one before we had ast_channel */
+	i->fake_event = 0;
+	/* Assure there is no confmute on this channel */
+	zt_confmute(i, 0);
+	ast_setstate(tmp, state);
 	/* Configure the new channel jb */
-	if (tmp && i)
-		ast_jb_configure(tmp, &global_jbconf);
+	ast_jb_configure(tmp, &global_jbconf);
+	if (startpbx) {
+		if (ast_pbx_start(tmp)) {
+			ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
+			ast_hangup(tmp);
+			i->owner = NULL;
+			return NULL;
+		}
+	}
+
+	ast_mutex_lock(&usecnt_lock);
+	usecnt++;
+	ast_mutex_unlock(&usecnt_lock);
+	ast_update_use_count();
+	
 	return tmp;
 }
 

Modified: team/group/new_loader_completion/channels/h323/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/h323/Makefile?rev=35767&r1=35766&r2=35767&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/h323/Makefile (original)
+++ team/group/new_loader_completion/channels/h323/Makefile Fri Jun 23 18:46:37 2006
@@ -3,6 +3,8 @@
 #
 # Make file for OpenH323 support layer
 #
+
+.PHONY: Makefile.ast
 
 # Verify those options with main Makefile
 STDCCFLAGS	+= -DNDEBUG
@@ -31,7 +33,7 @@
 libchanh323.a:	$(OBJS)
 	ar crv $@ $(OBJS)
 
-Makefile.ast:	FORCE
+Makefile.ast:
 	@echo H323CFLAGS  = $(STDCCFLAGS) $(OPTCCFLAGS) $(CFLAGS) >$@.tmp
 	@echo H323LDFLAGS = $(CFLAGS) $(LDFLAGS) >>$@.tmp
 	@echo H323LDLIBS  = $(LDLIBS) $(ENDLDLIBS) $(ENDLDFLAGS) >>$@.tmp
@@ -39,5 +41,3 @@
 
 clean::
 	rm -f ast_h323.cxx libchanh323.a Makefile.ast *.dep
-
-FORCE:

Modified: team/group/new_loader_completion/codecs/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/codecs/Makefile?rev=35767&r1=35766&r2=35767&view=diff
==============================================================================
--- team/group/new_loader_completion/codecs/Makefile (original)
+++ team/group/new_loader_completion/codecs/Makefile Fri Jun 23 18:46:37 2006
@@ -11,7 +11,7 @@
 # the GNU General Public License
 #
 
-.PHONY: clean clean-depend all
+.PHONY: clean clean-depend all depend uninstall
 
 ifneq ($(wildcard ../menuselect.makeopts),)
   include ../menuselect.makeopts

Copied: team/group/new_loader_completion/codecs/codec_zap.c (from r35766, trunk/codecs/codec_zap.c)

[... 585 lines stripped ...]


More information about the asterisk-commits mailing list