[asterisk-commits] branch group/asterisk-imap r37381 - in /team/group/asterisk-imap: ./ agi/ app...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jul 11 12:11:11 MST 2006


Author: mogorman
Date: Tue Jul 11 14:11:10 2006
New Revision: 37381

URL: http://svn.digium.com/view/asterisk?rev=37381&view=rev
Log:
Merged revisions 37222-37223,37225-37226,37255,37273-37291,37293-37303,37308,37318,37320,37323-37324,37339,37345-37348,37355,37362,37379 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r37222 | kpfleming | 2006-07-06 16:04:28 -0500 (Thu, 06 Jul 2006) | 2 lines

move rules file to prepare for generic rules file

................
r37223 | mogorman | 2006-07-06 16:36:17 -0500 (Thu, 06 Jul 2006) | 4 lines

patch resolves issue with when to decide if its right time 
to native bridge, feature redirect was not being checked.
patch from bug #7296

................
r37225 | mogorman | 2006-07-06 16:42:09 -0500 (Thu, 06 Jul 2006) | 11 lines

Blocked revisions 37224 via svnmerge

........
r37224 | mogorman | 2006-07-06 16:41:23 -0500 (Thu, 06 Jul 2006) | 4 lines

patch resolves issue with when to decide if its right time 
to native bridge, feature redirect was not being checked.
patch from bug #7296

........

................
r37226 | mattf | 2006-07-06 16:51:51 -0500 (Thu, 06 Jul 2006) | 2 lines

Asterisk portion of the T309 patch. (#7271)

................
r37255 | murf | 2006-07-06 17:49:18 -0500 (Thu, 06 Jul 2006) | 16 lines

OK, here is everything I changed to fix 7474:

1. ael/ael.flex -- the "fix" is here. In short, I modified the
   pattern for the chars that break args, to exclude those chars that
   would normally break args if they are preceded by a backslash. I did
   this to 3 patterns where really, this kind of exclusion should be placed.

2. ael_lex.c is an updated output from lex.

3. the ael-test stuff -- instituted a regression test for this condition.
   as ael_ntest9. The "n" in the name means that instead of just getting
   the syntax/semantic errors and high-level output from aelparse, we
   also want the compilation results to be in the comparison file.
   (remove the -n option). 


................
r37273 | kpfleming | 2006-07-06 18:18:45 -0500 (Thu, 06 Jul 2006) | 2 lines

make the build output less noisy (optional, can be controlled by the NOISY_BUILD variable in the top-level Makefile)

................
r37274 | kpfleming | 2006-07-06 18:20:14 -0500 (Thu, 06 Jul 2006) | 3 lines

add missing file
ignore .oo files from C++ modules

................
r37275 | kpfleming | 2006-07-06 18:21:27 -0500 (Thu, 06 Jul 2006) | 2 lines

ignore muted if present

................
r37276 | russell | 2006-07-06 18:51:15 -0500 (Thu, 06 Jul 2006) | 2 lines

dirty hack of a fix to deal with the fact that chan_vpb changed to chan_vpb.cc

................
r37277 | kpfleming | 2006-07-06 19:48:40 -0500 (Thu, 06 Jul 2006) | 2 lines

various minor fixes

................
r37278 | kpfleming | 2006-07-06 21:20:04 -0500 (Thu, 06 Jul 2006) | 2 lines

actually do proper searching for c-client and output the results so app_voicemail can be built against it

................
r37279 | kpfleming | 2006-07-06 21:20:28 -0500 (Thu, 06 Jul 2006) | 2 lines

rename this file so it doesn't appear to be a module by itself

................
r37280 | kpfleming | 2006-07-06 21:33:24 -0500 (Thu, 06 Jul 2006) | 2 lines

small cleanup

................
r37281 | russell | 2006-07-06 21:58:53 -0500 (Thu, 06 Jul 2006) | 2 lines

spaces to tabs

................
r37282 | russell | 2006-07-07 00:29:31 -0500 (Fri, 07 Jul 2006) | 2 lines

sort entries in this file

................
r37283 | russell | 2006-07-07 00:32:28 -0500 (Fri, 07 Jul 2006) | 2 lines

sort lib info

................
r37284 | russell | 2006-07-07 00:51:29 -0500 (Fri, 07 Jul 2006) | 2 lines

avoid an error from configure by not doing a cat on a file that doesn't exist

................
r37285 | russell | 2006-07-07 01:44:40 -0500 (Fri, 07 Jul 2006) | 2 lines

resolve some pointer signedness warnings

................
r37286 | russell | 2006-07-07 01:55:48 -0500 (Fri, 07 Jul 2006) | 2 lines

fix various pointer signedness issues

................
r37287 | russell | 2006-07-07 01:57:02 -0500 (Fri, 07 Jul 2006) | 2 lines

fix a pointer signedness issue

................
r37288 | russell | 2006-07-07 01:58:16 -0500 (Fri, 07 Jul 2006) | 2 lines

remove the unused usecount function to eliminate a compiler warning

................
r37289 | russell | 2006-07-07 02:00:28 -0500 (Fri, 07 Jul 2006) | 2 lines

eliminate a pointer signedness warning

................
r37290 | russell | 2006-07-07 02:01:50 -0500 (Fri, 07 Jul 2006) | 2 lines

eliminate some pointer signedness warnings

................
r37291 | russell | 2006-07-07 02:03:42 -0500 (Fri, 07 Jul 2006) | 2 lines

eliminate some pointer signedness warnings

................
r37293 | russell | 2006-07-07 10:44:39 -0500 (Fri, 07 Jul 2006) | 2 lines

more pointer signedness cleanup

................
r37294 | russell | 2006-07-07 10:58:20 -0500 (Fri, 07 Jul 2006) | 2 lines

pointer signedness warnings cleanup

................
r37295 | russell | 2006-07-07 11:01:36 -0500 (Fri, 07 Jul 2006) | 2 lines

pointer signedness warnings cleanup

................
r37296 | russell | 2006-07-07 11:03:56 -0500 (Fri, 07 Jul 2006) | 2 lines

pointer signedness warnings elimination

................
r37297 | kpfleming | 2006-07-07 11:04:29 -0500 (Fri, 07 Jul 2006) | 2 lines

restore broken properties

................
r37298 | russell | 2006-07-07 11:07:17 -0500 (Fri, 07 Jul 2006) | 2 lines

eliminate warning about unused variable that occurs in some cases

................
r37299 | russell | 2006-07-07 11:11:39 -0500 (Fri, 07 Jul 2006) | 2 lines

pointer signedness warnings

................
r37300 | russell | 2006-07-07 11:14:23 -0500 (Fri, 07 Jul 2006) | 2 lines

pointer signedness warnings

................
r37301 | bweschke | 2006-07-07 11:16:41 -0500 (Fri, 07 Jul 2006) | 11 lines

Merged revisions 37212 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r37212 | bweschke | 2006-07-06 15:38:45 -0500 (Thu, 06 Jul 2006) | 3 lines

 Don't do wierd things on a callback agent that has attempted logoff while still on the phone.


........

................
r37302 | russell | 2006-07-07 11:20:28 -0500 (Fri, 07 Jul 2006) | 2 lines

pointer signedness warnings

................
r37303 | russell | 2006-07-07 11:22:32 -0500 (Fri, 07 Jul 2006) | 3 lines

remove the use of -Wno-pointer-sign. Asterisk now builds without any of these
warnings present on my machine.

................
r37308 | file | 2006-07-07 18:59:54 -0500 (Fri, 07 Jul 2006) | 10 lines

Merged revisions 37307 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r37307 | file | 2006-07-07 19:57:53 -0400 (Fri, 07 Jul 2006) | 2 lines

Change message regarding marker bit forcing when SSRC changes to be shown only during debug so it doesn't overload high capacity systems

........

................
r37318 | markster | 2006-07-07 21:24:07 -0500 (Fri, 07 Jul 2006) | 3 lines

Support hold/unhold in Zap, update IAX2 parser to know about modern commands, forward hold/unhold in dial, add hold device state 
and implement holding in the SLA.

................
r37320 | kpfleming | 2006-07-09 09:32:08 -0500 (Sun, 09 Jul 2006) | 2 lines

remove skeleton support for G.723.1 codec since we will never ship the rest of what is needed anyway :-)

................
r37323 | crichter | 2006-07-10 06:06:47 -0500 (Mon, 10 Jul 2006) | 1 line

removed unnecessary locking, which might have created deadlocks. removed find_chan_by_l3id, since the l3id is not unique over all ports. removed automatic nt_stack reinitialization, since this creates segfaults.
................
r37324 | oej | 2006-07-10 06:20:49 -0500 (Mon, 10 Jul 2006) | 4 lines

Remove configuration option "restrictcid" that is nowhere to
be seen in the code. Did it exist, was it planned to exist
or was it documentationware only? Ask Dr Asterisk.

................
r37339 | tilghman | 2006-07-10 12:42:12 -0500 (Mon, 10 Jul 2006) | 2 lines

Whitespace changes only

................
r37345 | tilghman | 2006-07-10 14:05:48 -0500 (Mon, 10 Jul 2006) | 2 lines

Whitespace changes only

................
r37346 | file | 2006-07-10 14:39:47 -0500 (Mon, 10 Jul 2006) | 2 lines

Remove BRIDGE_OPTIMIZATION since it is deprecated or obsolete (take your pick)

................
r37347 | file | 2006-07-10 14:55:06 -0500 (Mon, 10 Jul 2006) | 2 lines

Unbreak ast_join due to whitespace changes

................
r37348 | file | 2006-07-10 14:58:33 -0500 (Mon, 10 Jul 2006) | 2 lines

Fixed. Done. Good. Make ast_join work like it used to.

................
r37355 | crichter | 2006-07-10 15:53:44 -0500 (Mon, 10 Jul 2006) | 1 line

removed mqueue branch reference, because mqueue is head now.
................
r37362 | kpfleming | 2006-07-10 16:07:48 -0500 (Mon, 10 Jul 2006) | 10 lines

Merged revisions 37361 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r37361 | kpfleming | 2006-07-10 16:01:35 -0500 (Mon, 10 Jul 2006) | 2 lines

do masquerade-behind-proxy checking with better control over locks

........

................
r37379 | file | 2006-07-11 14:01:49 -0500 (Tue, 11 Jul 2006) | 9 lines

Blocked revisions 37378 via svnmerge

........
r37378 | file | 2006-07-11 14:00:50 -0500 (Tue, 11 Jul 2006) | 2 lines

Add configuration option for IAX2 users that will limit the amount of outstanding AUTHREQs we are waiting for replies on.

........

................

Added:
    team/group/asterisk-imap/Makefile.moddir_rules
      - copied unchanged from r37379, trunk/Makefile.moddir_rules
    team/group/asterisk-imap/channels/chan_vpb.cc
      - copied unchanged from r37379, trunk/channels/chan_vpb.cc
    team/group/asterisk-imap/pbx/ael/ael-test/ael-ntest9/
      - copied from r37379, trunk/pbx/ael/ael-test/ael-ntest9/
    team/group/asterisk-imap/pbx/ael/ael-test/ael-ntest9/extensions.ael
      - copied unchanged from r37379, trunk/pbx/ael/ael-test/ael-ntest9/extensions.ael
    team/group/asterisk-imap/pbx/ael/ael-test/ref.ael-ntest9
      - copied unchanged from r37379, trunk/pbx/ael/ael-test/ref.ael-ntest9
    team/group/asterisk-imap/pbx/kdeconsole_main.cc
      - copied unchanged from r37379, trunk/pbx/kdeconsole_main.cc
Removed:
    team/group/asterisk-imap/channels/chan_vpb.c
    team/group/asterisk-imap/codecs/codec_g723_1.c
    team/group/asterisk-imap/codecs/g723_slin_ex.h
    team/group/asterisk-imap/codecs/slin_g723_ex.h
    team/group/asterisk-imap/pbx/pbx_kdeconsole_main.cc
Modified:
    team/group/asterisk-imap/   (props changed)
    team/group/asterisk-imap/Makefile
    team/group/asterisk-imap/Makefile.rules
    team/group/asterisk-imap/acl.c
    team/group/asterisk-imap/agi/Makefile
    team/group/asterisk-imap/app.c
    team/group/asterisk-imap/apps/Makefile
    team/group/asterisk-imap/apps/app_dial.c
    team/group/asterisk-imap/apps/app_meetme.c
    team/group/asterisk-imap/apps/app_osplookup.c
    team/group/asterisk-imap/apps/app_sms.c
    team/group/asterisk-imap/apps/app_voicemail.c
    team/group/asterisk-imap/build_tools/menuselect-deps.in
    team/group/asterisk-imap/build_tools/prep_moduledeps
    team/group/asterisk-imap/cdr/Makefile
    team/group/asterisk-imap/channel.c
    team/group/asterisk-imap/channels/   (props changed)
    team/group/asterisk-imap/channels/Makefile
    team/group/asterisk-imap/channels/chan_agent.c
    team/group/asterisk-imap/channels/chan_iax2.c
    team/group/asterisk-imap/channels/chan_misdn.c
    team/group/asterisk-imap/channels/chan_sip.c
    team/group/asterisk-imap/channels/chan_zap.c
    team/group/asterisk-imap/channels/iax2-parser.c
    team/group/asterisk-imap/channels/iax2-provision.c
    team/group/asterisk-imap/channels/misdn/isdn_lib.c
    team/group/asterisk-imap/codecs/Makefile
    team/group/asterisk-imap/codecs/codec_gsm.c
    team/group/asterisk-imap/codecs/codec_ilbc.c
    team/group/asterisk-imap/codecs/codec_lpc10.c
    team/group/asterisk-imap/codecs/gsm/Makefile
    team/group/asterisk-imap/codecs/gsm/src/preprocess.c
    team/group/asterisk-imap/codecs/ilbc/Makefile
    team/group/asterisk-imap/codecs/lpc10/Makefile
    team/group/asterisk-imap/configs/sip.conf.sample
    team/group/asterisk-imap/configs/zapata.conf.sample
    team/group/asterisk-imap/configure
    team/group/asterisk-imap/configure.ac
    team/group/asterisk-imap/db1-ast/Makefile
    team/group/asterisk-imap/devicestate.c
    team/group/asterisk-imap/dns.c
    team/group/asterisk-imap/doc/misdn.txt
    team/group/asterisk-imap/enum.c
    team/group/asterisk-imap/formats/Makefile
    team/group/asterisk-imap/formats/format_wav_gsm.c
    team/group/asterisk-imap/funcs/Makefile
    team/group/asterisk-imap/http.c
    team/group/asterisk-imap/include/asterisk/autoconfig.h.in
    team/group/asterisk-imap/include/asterisk/devicestate.h
    team/group/asterisk-imap/include/asterisk/dns.h
    team/group/asterisk-imap/include/asterisk/pbx.h
    team/group/asterisk-imap/makeopts.in
    team/group/asterisk-imap/pbx.c
    team/group/asterisk-imap/pbx/Makefile
    team/group/asterisk-imap/pbx/ael/ael-test/runtests
    team/group/asterisk-imap/pbx/ael/ael.flex
    team/group/asterisk-imap/pbx/ael/ael_lex.c
    team/group/asterisk-imap/pbx/pbx_kdeconsole.cc
    team/group/asterisk-imap/plc.c
    team/group/asterisk-imap/res/Makefile
    team/group/asterisk-imap/res/res_config_pgsql.c
    team/group/asterisk-imap/res/res_jabber.c
    team/group/asterisk-imap/rtp.c
    team/group/asterisk-imap/sched.c
    team/group/asterisk-imap/sha1.c
    team/group/asterisk-imap/slinfactory.c
    team/group/asterisk-imap/srv.c
    team/group/asterisk-imap/tdd.c
    team/group/asterisk-imap/translate.c
    team/group/asterisk-imap/udptl.c
    team/group/asterisk-imap/ulaw.c
    team/group/asterisk-imap/utils.c
    team/group/asterisk-imap/utils/Makefile
    team/group/asterisk-imap/utils/smsq.c

Propchange: team/group/asterisk-imap/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

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

Propchange: team/group/asterisk-imap/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Jul 11 14:11:10 2006
@@ -21,3 +21,4 @@
 config.log
 makeopts.xml
 autom4te.cache
+muted

Propchange: team/group/asterisk-imap/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jul 11 14:11:10 2006
@@ -1,1 +1,1 @@
-/trunk:1-37200
+/trunk:1-37379

Modified: team/group/asterisk-imap/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/Makefile?rev=37381&r1=37380&r2=37381&view=diff
==============================================================================
--- team/group/asterisk-imap/Makefile (original)
+++ team/group/asterisk-imap/Makefile Tue Jul 11 14:11:10 2006
@@ -13,6 +13,9 @@
 
 .EXPORT_ALL_VARIABLES:
 
+#Uncomment this to see all build commands instead of 'quiet' output
+#NOISY_BUILD=yes
+
 # Create OPTIONS variable
 OPTIONS=
 
@@ -25,14 +28,14 @@
 #SUB_PROC=xscale # or maverick
 
 ifeq ($(CROSS_COMPILE),)
-  OSARCH=$(shell uname -s)
-  PROC?=$(shell uname -m)
+  OSARCH:=$(shell uname -s)
+  PROC?:=$(shell uname -m)
 else
   OSARCH=$(CROSS_ARCH)
   PROC=$(CROSS_PROC)
 endif
 
-PWD=$(shell pwd)
+ASTTOPDIR:=$(shell pwd)
 
 # Remember the MAKELEVEL at the top
 MAKETOPLEVEL?=$(MAKELEVEL)
@@ -218,9 +221,6 @@
   ASTCFLAGS+=-Werror -Wunused
 endif
 
-ifeq ($(shell gcc -v 2>&1 | grep 'gcc version' | cut -f3 -d' ' | cut -f1 -d.),4)
-ASTCFLAGS+=-Wno-pointer-sign
-endif
 ASTOBJ=-o asterisk
 
 ifeq ($(findstring BSD,$(OSARCH)),BSD)
@@ -366,6 +366,8 @@
   HAVEDOT=no
 endif
 
+include Makefile.rules
+
 _all: all
 	@echo " +--------- Asterisk Build Complete ---------+"  
 	@echo " + Asterisk has successfully been built, but +"  
@@ -484,16 +486,17 @@
 channel.o: CFLAGS+=$(ZAPTEL_INCLUDE)
 
 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 \
+	@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 $(LIBS)
+	@rm -f include/asterisk/build.h.tmp
+	@$(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
+	@echo "   [LD] $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.1 $(LIBS) -> $@"
+	@$(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a $(LIBS)
 
 muted: muted.o
-	$(CC) $(AUDIO_LIBS) -o muted muted.o
+muted: LDFLAGS+=$(AUDIO_LIBS)
 
 $(SUBDIRS_CLEAN_DEPEND):
 	@$(MAKE) -C $(@:-clean-depend=) clean-depend
@@ -886,13 +889,13 @@
 	- 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 menuselect/linkedlists.h config.status mxml/libmxml.a
-	@CFLAGS="-include $(PWD)/include/asterisk/autoconfig.h -I$(PWD)/include" PARENTSRC="$(PWD)" $(MAKE) -C menuselect menuselect
+	@CFLAGS="-include $(ASTTOPDIR)/include/asterisk/autoconfig.h -I$(ASTTOPDIR)/include" PARENTSRC="$(ASTTOPDIR)" $(MAKE) -C menuselect menuselect
 
 mxml/libmxml.a:
 	@cd mxml && unset CFLAGS LIBS && test -f config.h || ./configure
 	$(MAKE) -C mxml libmxml.a
 
-makeopts.xml: $(foreach dir,$(MOD_SUBDIRS),$(dir)/*.c) build_tools/cflags.xml sounds/sounds.xml
+makeopts.xml: $(foreach dir,$(MOD_SUBDIRS),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml
 	@echo "Generating list of available modules ..."
 	@build_tools/prep_moduledeps > $@
 

Modified: team/group/asterisk-imap/Makefile.rules
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/Makefile.rules?rev=37381&r1=37380&r2=37381&view=diff
==============================================================================
--- team/group/asterisk-imap/Makefile.rules (original)
+++ team/group/asterisk-imap/Makefile.rules Tue Jul 11 14:11:10 2006
@@ -11,43 +11,123 @@
 # the GNU General Public License
 #
 
-define module_o_template
-$(1).o: $(1).c
-	$$(CC) -c -o $$@ $$< $$(CFLAGS) $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
+ifeq ($(NOISY_BUILD),)
+
+define ast_make_o_c
+$(1): $(2)
+	@echo "   [CC] $$< -> $$@"
+	@$$(CC) -o $$@ -c $$< $$(CFLAGS)
 endef
 
-define module_so_template
-$(1).so: $(1).o
-	$$(CC) $$(SOLINK) -o $$@ $$^ $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+define ast_make_oo_cc
+$(1): $(2)
+	@echo "   [CXX] $$< -> $$@"
+	@$$(CXX) -o $$@ -c $$< $$(CFLAGS)
 endef
 
-%.o: %.c
-	$(CC) -c -o $@ $< $(CFLAGS)
+define ast_make_c_y
+$(1): $(2)
+	@echo "   [BISON] $$< -> $$@"
+	@bison -o $$@ -d --name-prefix=ast_yy $$<
+endef
 
-$(foreach mod,$(SELECTED_MODS),$(eval $(call module_o_template,$(mod))))
+define ast_make_c_fl
+$(1): $(2)
+	@echo "   [FLEX] $$< -> $$@"
+	@flex -o $$@ --full $$<
+endef
 
-$(foreach mod,$(SELECTED_MODS),$(eval $(call module_so_template,$(mod))))
+define ast_make_so_o
+$(1): $(2)
+	@echo "   [LD] $$^ -> $$@"
+	@$$(CC) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+endef
 
-.PHONY: clean clean-depend depend uninstall _all
+define ast_make_so_oo
+$(1): $(2)
+	@echo "   [LDXX] $$^ -> $$@"
+	@$$(CXX) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+endef
 
-_all: $(SELECTED_MODS:%=%.so)
+define ast_make_a_o
+$(1): $(2)
+	@echo "   [AR] $$^ -> $$@"
+	@$$(AR) cr $$@ $$^
+	@$$(RANLIB) $$@
+endef
 
-clean-depend::
-	rm -f .depend
+define ast_make_final
+$(1): $(2)
+	@echo "   [LD] $$^ -> $$@"
+	@$$(CC) -o $$@ $$^ $$(LDFLAGS)
+endef
 
-clean:: clean-depend
-	rm -f *.so *.o
+define ast_make_final_host
+$(1): $(2)
+	@echo "   [LD] $$^ -> $$@"
+	@$$(HOST_CC) -o $$@ $$^ $$(CFLAGS) $$(LDFLAGS)
+endef
 
-install:: all
-	for x in $(SELECTED_MODS:%=%.so); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+else
 
-uninstall::
+define ast_make_o_c
+$(1): $(2)
+	$$(CC) -o $$@ -c $$< $$(CFLAGS)
+endef
 
-ifneq ($(wildcard .depend),)
- include .depend
+define ast_make_oo_cc
+$(1): $(2)
+	$$(CXX) -o $$@ -c $$< $$(CFLAGS)
+endef
+
+define ast_make_c_y
+$(1): $(2)
+	bison -o $$@ -d --name-prefix=ast_yy $$<
+endef
+
+define ast_make_c_fl
+$(1): $(2)
+	flex -o $$@ --full $$<
+endef
+
+define ast_make_so_o
+$(1): $(2)
+	$$(CC) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+endef
+
+define ast_make_so_oo
+$(1): $(2)
+	$$(CXX) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+endef
+
+define ast_make_a_o
+$(1): $(2)
+	$$(AR) cr $$@ $$^
+	$$(RANLIB) $$@
+endef
+
+define ast_make_final
+$(1): $(2)
+	$$(CC) -o $$@ $$^ $$(LDFLAGS)
+endef
+
+define ast_make_final_host
+$(1): $(2)
+	$$(HOST_CC) -o $$@ $$^ $$(CFLAGS) $$(LDFLAGS)
+endef
+
 endif
 
-depend: .depend
+$(eval $(call ast_make_o_c,%.o,%.c))
 
-.depend:
-	../build_tools/mkdep $(CFLAGS) `ls *.c`
+$(eval $(call ast_make_oo_cc,%.oo,%.cc))
+
+$(eval $(call ast_make_so_o,%.so,%.o))
+
+$(eval $(call ast_make_so_oo,%.so,%.oo))
+
+$(eval $(call ast_make_final,%,%.o))
+
+$(eval $(call ast_make_c_y,%.c,%.y))
+
+$(eval $(call ast_make_c_fl,%.c,%.fl))

Modified: team/group/asterisk-imap/acl.c
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/acl.c?rev=37381&r1=37380&r2=37381&view=diff
==============================================================================
--- team/group/asterisk-imap/acl.c (original)
+++ team/group/asterisk-imap/acl.c Tue Jul 11 14:11:10 2006
@@ -90,7 +90,7 @@
 void ast_free_ha(struct ast_ha *ha)
 {
 	struct ast_ha *hal;
-	while(ha) {
+	while (ha) {
 		hal = ha;
 		ha = ha->next;
 		free(hal);
@@ -122,9 +122,9 @@
 /*  Used in chan_sip2 templates */
 struct ast_ha *ast_duplicate_ha_list(struct ast_ha *original)
 {
-	struct ast_ha *start=original;
+	struct ast_ha *start = original;
 	struct ast_ha *ret = NULL;
-	struct ast_ha *link,*prev=NULL;
+	struct ast_ha *link, *prev = NULL;
 
 	while (start) {
 		link = ast_duplicate_ha(start);  /* Create copy of this object */
@@ -167,7 +167,7 @@
 		if (!strchr(nm, '.')) {
 			if ((sscanf(nm, "%d", &x) == 1) && (x >= 0) && (x <= 32)) {
 				y = 0;
-				for (z=0;z<x;z++) {
+				for (z = 0; z < x; z++) {
 					y >>= 1;
 					y |= 0x80000000;
 				}
@@ -423,3 +423,4 @@
 		return 0;
 	return -1;
 }
+

Modified: team/group/asterisk-imap/agi/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/agi/Makefile?rev=37381&r1=37380&r2=37381&view=diff
==============================================================================
--- team/group/asterisk-imap/agi/Makefile (original)
+++ team/group/asterisk-imap/agi/Makefile Tue Jul 11 14:11:10 2006
@@ -15,12 +15,17 @@
 
 AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi
 
-LIBS=
 ifeq ($(OSARCH),SunOS)
-  LIBS=-lsocket -lnsl ../strcompat.o
+  LDFLAGS+=-lsocket -lnsl ../strcompat.o
 endif
 
+include $(ASTTOPDIR)/Makefile.rules
+
 all: $(AGIS)
+
+eagi-test: eagi-test.o
+
+eagi-sphinx-test: eagi-sphinx-test.o
 
 install: all
 	mkdir -p $(DESTDIR)$(AGI_DIR)
@@ -29,20 +34,11 @@
 uninstall:
 	for x in $(AGIS); do rm -f $(DESTDIR)$(AGI_DIR)/$$x ; done
 
-eagi-test: eagi-test.o
-	$(CC) $(CFLAGS) -include ../include/autoconfig.h -o eagi-test eagi-test.o $(LIBS)
-
-eagi-sphinx-test: eagi-sphinx-test.o
-	$(CC) $(CFLAGS) -include ../include/autoconfig.h -o eagi-sphinx-test eagi-sphinx-test.o $(LIBS) 
-
 clean-depend:
 	rm -f .depend
 
 clean: clean-depend
 	rm -f *.so *.o look eagi-test eagi-sphinx-test
-
-%.so : %.o
-	$(CC) -shared -Xlinker -x -o $@ $<
 
 ifneq ($(wildcard .depend),)
 include .depend

Modified: team/group/asterisk-imap/app.c
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/app.c?rev=37381&r1=37380&r2=37381&view=diff
==============================================================================
--- team/group/asterisk-imap/app.c (original)
+++ team/group/asterisk-imap/app.c Tue Jul 11 14:11:10 2006
@@ -65,12 +65,12 @@
 	struct tone_zone_sound *ts;
 	int res=0, x=0;
 
-	if(maxlen > size)
+	if (maxlen > size)
 		maxlen = size;
 	
-	if(!timeout && chan->pbx)
+	if (!timeout && chan->pbx)
 		timeout = chan->pbx->dtimeout;
-	else if(!timeout)
+	else if (!timeout)
 		timeout = 5;
 	
 	ts = ast_get_indication_tone(chan->zone,"dial");
@@ -99,8 +99,6 @@
 	return res;
 }
 
-
-
 /*! \param timeout set timeout to 0 for "standard" timeouts. Set timeout to -1 for 
    "ludicrous time" (essentially never times out) */
 int ast_app_getdata(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout)
@@ -128,7 +126,7 @@
 
 int ast_app_getdata_full(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout, int audiofd, int ctrlfd)
 {
-	int res,to,fto;
+	int res, to, fto;
 	if (prompt) {
 		res = ast_streamfile(c, prompt, c->language);
 		if (res < 0)
@@ -538,7 +536,7 @@
 
 	stringp = fmts;
 	strsep(&stringp, "|");
-	ast_log(LOG_DEBUG,"Recording Formats: sfmts=%s\n", fmts);
+	ast_log(LOG_DEBUG, "Recording Formats: sfmts=%s\n", fmts);
 	sfmt[0] = ast_strdupa(fmts);
 
 	while ((fmt = strsep(&stringp, "|"))) {
@@ -555,9 +553,8 @@
 		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "x=%d, open writing:  %s format: %s, %p\n", x, prepend ? prependfile : recordfile, sfmt[x], others[x]);
 
-		if (!others[x]) {
+		if (!others[x])
 			break;
-		}
 	}
 
 	if (path)
@@ -705,7 +702,7 @@
 			if (!others[x])
 				break;
 			if (res > 0)
-				ast_stream_rewind(others[x], totalsilence ? totalsilence-200 : 200);
+				ast_stream_rewind(others[x], totalsilence ? totalsilence - 200 : 200);
 			ast_truncstream(others[x]);
 			ast_closestream(others[x]);
 		}
@@ -720,7 +717,7 @@
 			realfiles[x] = ast_readfile(recordfile, sfmt[x], comment, O_RDONLY, 0, 0);
 			if (!others[x] || !realfiles[x])
 				break;
-			ast_stream_rewind(others[x], totalsilence ? totalsilence-200 : 200);
+			ast_stream_rewind(others[x], totalsilence ? totalsilence - 200 : 200);
 			ast_truncstream(others[x]);
 			/* add the original file too */
 			while ((fr = ast_readframe(realfiles[x]))) {
@@ -925,7 +922,7 @@
 	snprintf(fs, strlen(path) + 19, "%s/.lock-%08lx", path, ast_random());
 	fd = open(fs, O_WRONLY | O_CREAT | O_EXCL, 0600);
 	if (fd < 0) {
-		fprintf(stderr, "Unable to create lock file '%s': %s\n", path, strerror(errno));
+		ast_log(LOG_ERROR, "Unable to create lock file '%s': %s\n", path, strerror(errno));
 		return AST_LOCK_PATH_NOT_FOUND;
 	}
 	close(fd);
@@ -1056,6 +1053,7 @@
 #define RES_RESTART ((1 << 19) | RES_REPEAT)
 
 static int ast_ivr_menu_run_internal(struct ast_channel *chan, struct ast_ivr_menu *menu, void *cbdata);
+
 static int ivr_dispatch(struct ast_channel *chan, struct ast_ivr_option *option, char *exten, void *cbdata)
 {
 	int res;
@@ -1127,7 +1125,7 @@
 static int option_exists(struct ast_ivr_menu *menu, char *option)
 {
 	int x;
-	for (x=0;menu->options[x].option;x++)
+	for (x = 0; menu->options[x].option; x++)
 		if (!strcasecmp(menu->options[x].option, option))
 			return x;
 	return -1;
@@ -1136,7 +1134,7 @@
 static int option_matchmore(struct ast_ivr_menu *menu, char *option)
 {
 	int x;
-	for (x=0;menu->options[x].option;x++)
+	for (x = 0; menu->options[x].option; x++)
 		if ((!strncasecmp(menu->options[x].option, option, strlen(option))) && 
 				(menu->options[x].option[strlen(option)]))
 			return x;
@@ -1147,7 +1145,7 @@
 {
 	int res=0;
 	int ms;
-	while(option_matchmore(menu, exten)) {
+	while (option_matchmore(menu, exten)) {
 		ms = chan->pbx ? chan->pbx->dtimeout : 5000;
 		if (strlen(exten) >= maxexten - 1) 
 			break;
@@ -1202,7 +1200,7 @@
 						else if (option_exists(menu, "s") > -1)
 							strcpy(exten, "s");
 					}
-					pos=0;
+					pos = 0;
 					continue;
 				} else if (res && strchr(AST_DIGIT_ANY, res)) {
 					ast_log(LOG_DEBUG, "Got start of extension, %c\n", res);
@@ -1242,26 +1240,23 @@
 
 int ast_ivr_menu_run(struct ast_channel *chan, struct ast_ivr_menu *menu, void *cbdata)
 {
-	int res;
-	res = ast_ivr_menu_run_internal(chan, menu, cbdata);
+	int res = ast_ivr_menu_run_internal(chan, menu, cbdata);
 	/* Hide internal coding */
-	if (res > 0)
-		res = 0;
-	return res;
+	return res > 0 ? 0 : res;
 }
 	
 char *ast_read_textfile(const char *filename)
 {
 	int fd;
-	char *output=NULL;
+	char *output = NULL;
 	struct stat filesize;
-	int count=0;
+	int count = 0;
 	int res;
-	if(stat(filename,&filesize)== -1){
-		ast_log(LOG_WARNING,"Error can't stat %s\n", filename);
+	if (stat(filename, &filesize) == -1) {
+		ast_log(LOG_WARNING, "Error can't stat %s\n", filename);
 		return NULL;
 	}
-	count=filesize.st_size + 1;
+	count = filesize.st_size + 1;
 	fd = open(filename, O_RDONLY);
 	if (fd < 0) {
 		ast_log(LOG_WARNING, "Cannot open file '%s' for reading: %s\n", filename, strerror(errno));
@@ -1272,7 +1267,7 @@
 		if (res == count - 1) {
 			output[res] = '\0';
 		} else {
-			ast_log(LOG_WARNING, "Short read of %s (%d of %d): %s\n", filename, res, count -  1, strerror(errno));
+			ast_log(LOG_WARNING, "Short read of %s (%d of %d): %s\n", filename, res, count - 1, strerror(errno));
 			free(output);
 			output = NULL;
 		}
@@ -1318,3 +1313,4 @@
 
 	return res;
 }
+

Modified: team/group/asterisk-imap/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/apps/Makefile?rev=37381&r1=37380&r2=37381&view=diff
==============================================================================
--- team/group/asterisk-imap/apps/Makefile (original)
+++ team/group/asterisk-imap/apps/Makefile Tue Jul 11 14:11:10 2006
@@ -16,11 +16,19 @@
 
 SELECTED_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.c,%,$(wildcard app_*.c)))
 
-MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_ODBC_STORAGE) $(MENUSELECT_DEPENDS_EXTENDED_ODBC_STORAGE)
+ifneq ($(findstring ODBC_STORAGE,$(MENUSELECT_app_voicemail)),)
+MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_ODBC_STORAGE)
+endif
+ifneq ($(findstring EXTENDED_ODBC_STORAGE,$(MENUSELECT_app_voicemail)),)
+MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_EXTENDED_ODBC_STORAGE)
+endif
+ifneq ($(findstring IMAP_STORAGE,$(MENUSELECT_app_voicemail)),)
+MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_IMAP_STORAGE)
+endif
 
 all: _all
 
-include ../Makefile.rules
+include $(ASTTOPDIR)/Makefile.moddir_rules
 
 ifeq (SunOS,$(shell uname))
 app_chanspy.so: app_chanspy.o

Modified: team/group/asterisk-imap/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/apps/app_dial.c?rev=37381&r1=37380&r2=37381&view=diff
==============================================================================
--- team/group/asterisk-imap/apps/app_dial.c (original)
+++ team/group/asterisk-imap/apps/app_dial.c Tue Jul 11 14:11:10 2006
@@ -728,10 +728,13 @@
 				if (ast_write(outgoing->chan, f))
 					ast_log(LOG_WARNING, "Unable to forward voice\n");
 			}
-			if (single && (f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_VIDUPDATE)) {
+			if (single && (f->frametype == AST_FRAME_CONTROL) && 
+				((f->subclass == AST_CONTROL_HOLD) || 
+				 (f->subclass == AST_CONTROL_UNHOLD) || 
+				 (f->subclass == AST_CONTROL_VIDUPDATE))) {
 				if (option_verbose > 2)
-					ast_verbose(VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", in->name,outgoing->chan->name);
-				ast_indicate(outgoing->chan, AST_CONTROL_VIDUPDATE);
+					ast_verbose(VERBOSE_PREFIX_3 "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
+				ast_indicate_data(outgoing->chan, f->subclass, f->data, f->datalen);
 			}
 			ast_frfree(f);
 		}

Modified: team/group/asterisk-imap/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/apps/app_meetme.c?rev=37381&r1=37380&r2=37381&view=diff
==============================================================================
--- team/group/asterisk-imap/apps/app_meetme.c (original)
+++ team/group/asterisk-imap/apps/app_meetme.c Tue Jul 11 14:11:10 2006
@@ -145,11 +145,17 @@
 	/*! If set, won't speak the extra prompt when the first person 
 	 *  enters the conference */
 	CONFFLAG_NOONLYPERSON = (1 << 22),
-	CONFFLAG_INTROUSERNOREVIEW = (1 << 23),
 	/*! If set, user will be asked to record name on entry of conference 
 	 *  without review */
-	CONFFLAG_STARTMUTED = (1 << 24)
+	CONFFLAG_INTROUSERNOREVIEW = (1 << 23),
 	/*! If set, the user will be initially self-muted */
+	CONFFLAG_STARTMUTED = (1 << 24),
+	/*! If set, the user is a shared line appearance station */
+	CONFFLAG_SLA_STATION = (1 << 25),
+	/*! If set, the user is a shared line appearance trunk */
+	CONFFLAG_SLA_TRUNK = (1 << 26),
+	/*! If set, the user has put us on hold */
+	CONFFLAG_HOLD = (1 << 27)
 };
 
 AST_APP_OPTIONS(meetme_opts, {
@@ -332,7 +338,9 @@
 	int talking;                            /*!< Is user talking */
 	int zapchannel;                         /*!< Is a Zaptel channel */
 	char usrvalue[50];                      /*!< Custom User Value */
-	char namerecloc[PATH_MAX];		/*!< Name Recorded file Location */
+	char namerecloc[PATH_MAX];				/*!< Name Recorded file Location */
+	int control;							/*! Queue Control for transmission */
+	int dtmf;								/*! Queue DTMF for transmission */
 	time_t jointime;                        /*!< Time the user joined the conference */
 	struct volume talk;
 	struct volume listen;
@@ -809,7 +817,7 @@
 			min = ((now - user->jointime) % 3600) / 60;
 			sec = (now - user->jointime) % 60;
 			if ( !concise )
-				ast_cli(fd, "User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s %02d:%02d:%02d\n",
+				ast_cli(fd, "User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s %s %02d:%02d:%02d\n",
 					user->user_no,
 					S_OR(user->chan->cid.cid_num, "<unknown>"),
 					S_OR(user->chan->cid.cid_name, "<no name>"),
@@ -817,7 +825,8 @@
 					user->userflags & CONFFLAG_ADMIN ? "(Admin)" : "",
 					user->userflags & CONFFLAG_MONITOR ? "(Listen only)" : "",
 					user->adminflags & ADMINFLAG_MUTED ? "(Admin Muted)" : user->adminflags & ADMINFLAG_SELFMUTED ? "(Muted)" : "",
-					istalking(user->talking), hr, min, sec);
+					istalking(user->talking), 
+					user->userflags & CONFFLAG_HOLD ? " (On Hold) " : "", hr, min, sec);
 			else 
 				ast_cli(fd, "%d!%s!%s!%s!%s!%s!%s!%d!%02d:%02d:%02d\n",
 					user->user_no,
@@ -979,6 +988,23 @@
 
 	return 0;
 }
+
+static void conf_queue_dtmf(struct ast_conference *conf, int digit)
+{
+	struct ast_conf_user *user;
+	AST_LIST_TRAVERSE(&conf->userlist, user, list) {
+		user->dtmf = digit;
+	}
+}
+
+static void conf_queue_control(struct ast_conference *conf, int control)
+{
+	struct ast_conf_user *user;
+	AST_LIST_TRAVERSE(&conf->userlist, user, list) {
+		user->control = control;
+	}
+}
+
 
 static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int confflags)
 {
@@ -1087,6 +1113,8 @@
 	/* This device changed state now - if this is the first user */
 	if (conf->users == 1)
 		ast_device_state_changed("meetme:%s", conf->confno);
+	if (confflags & (CONFFLAG_SLA_STATION|CONFFLAG_SLA_TRUNK))
+		ast_device_state_changed("SLA:%s", conf->confno + 4);
 
 	ast_mutex_unlock(&conf->playlock);
 
@@ -1549,6 +1577,17 @@
 						if (user->talking || !(confflags & CONFFLAG_OPTIMIZETALKER))
 							careful_write(fd, f->data, f->datalen, 0);
 					}
+				} else if ((f->frametype == AST_FRAME_DTMF) && 
+							(confflags & (CONFFLAG_SLA_STATION|CONFFLAG_SLA_TRUNK))) {
+					conf_queue_dtmf(conf, f->subclass);
+				} else if ((f->frametype == AST_FRAME_CONTROL) && 
+							(confflags & (CONFFLAG_SLA_STATION|CONFFLAG_SLA_TRUNK))) {
+					conf_queue_control(conf, f->subclass);
+					if (f->subclass == AST_CONTROL_HOLD)
+						confflags |= CONFFLAG_HOLD;
+					else if (f->subclass == AST_CONTROL_UNHOLD)
+						confflags &= ~CONFFLAG_HOLD;
+					user->userflags = confflags;
 				} else if ((f->frametype == AST_FRAME_DTMF) && (confflags & CONFFLAG_EXIT_CONTEXT)) {
 					char tmp[2];
 
@@ -1727,6 +1766,33 @@
 				}
 				ast_frfree(f);
 			} else if (outfd > -1) {
+				if (user->control) {
+					switch(user->control) {
+					case AST_CONTROL_RINGING:
+					case AST_CONTROL_PROGRESS:
+					case AST_CONTROL_PROCEEDING:
+						ast_indicate(chan, user->control);
+						break;
+					case AST_CONTROL_ANSWER:
+						if (chan->_state != AST_STATE_UP)
+							ast_answer(chan);
+						break;
+					}
+					user->control = 0;
+					if (confflags & (CONFFLAG_SLA_STATION|CONFFLAG_SLA_TRUNK))
+						ast_device_state_changed("SLA:%s", conf->confno + 4);
+					continue;
+				}
+				if (user->dtmf) {
+					memset(&fr, 0, sizeof(fr));
+					fr.frametype = AST_FRAME_DTMF;
+					fr.subclass = user->dtmf;
+					if (ast_write(chan, &fr) < 0) {
+						ast_log(LOG_WARNING, "Unable to write frame to channel: %s\n", strerror(errno));
+					}
+					user->dtmf = 0;
+					continue;
+				}
 				res = read(outfd, buf, CONF_SIZE);
 				if (res > 0) {
 					memset(&fr, 0, sizeof(fr));
@@ -1867,6 +1933,8 @@
 		/* This device changed state now */
 		if (!conf->users)	/* If there are no more members */
 			ast_device_state_changed("meetme:%s", conf->confno);
+		if (confflags & (CONFFLAG_SLA_STATION|CONFFLAG_SLA_TRUNK))
+			ast_device_state_changed("SLA:%s", conf->confno + 4);
 	}
 	free(user);
 	AST_LIST_UNLOCK(&confs);
@@ -2402,6 +2470,31 @@
 }
 
 
+static int sla_checkforhold(struct ast_conference *conf, int hangup)
+{
+	struct ast_conf_user *user;
+	struct ast_channel *onhold=NULL;
+	int holdcount = 0;
+	int stationcount = 0;
+	int amonhold = 0;
+	AST_LIST_TRAVERSE(&conf->userlist, user, list) {
+		if (user->userflags & CONFFLAG_SLA_STATION) {
+			stationcount++;
+			if ((user->userflags & CONFFLAG_HOLD)) {
+				holdcount++;
+				onhold = user->chan;
+			}
+		}
+	}
+	if ((holdcount == 1) && (stationcount == 1)) {
+		amonhold = 1;
+		if (hangup)
+			ast_softhangup(onhold, AST_SOFTHANGUP_EXPLICIT);
+	} else if (holdcount && (stationcount == holdcount))
+		amonhold = 1;
+	return amonhold;
+}
+
 
 /*! \brief The slas()/slat() application */
 static int sla_exec(struct ast_channel *chan, void *data, int trunk)
@@ -2435,29 +2528,31 @@
 	
 	LOCAL_USER_ADD(u);
 
-	if (chan->_state != AST_STATE_UP)
-		ast_answer(chan);
 
 	if (args.options)
 		ast_app_parse_options(sla_opts, &confflags, NULL, args.options);
 		
 	ast_set_flag(&confflags, CONFFLAG_QUIET|CONFFLAG_DYNAMIC);
 	if (trunk)
-		ast_set_flag(&confflags, CONFFLAG_WAITMARKED|CONFFLAG_MARKEDEXIT);
+		ast_set_flag(&confflags, CONFFLAG_WAITMARKED|CONFFLAG_MARKEDEXIT|CONFFLAG_SLA_TRUNK);
 	else
-		ast_set_flag(&confflags, CONFFLAG_MARKEDUSER);
+		ast_set_flag(&confflags, CONFFLAG_MARKEDUSER|CONFFLAG_SLA_STATION);
 
 	sla = ASTOBJ_CONTAINER_FIND(&slas, args.confno);
 	if (sla) {
 		snprintf(confno, sizeof(confno), "sla-%s", args.confno);
 		cnf = find_conf(chan, confno, 1, dynamic, "", 1, &confflags);
 		if (cnf) {
+			sla_checkforhold(cnf, 1);
 			if (!cnf->users) {
-				if (trunk)
+				if (trunk) {
+					ast_indicate(chan, AST_CONTROL_RINGING);
 					invite_stations(chan, sla);
-				else
+				} else
 					invite_trunk(chan, sla);
-			}
+			} else if (chan->_state != AST_STATE_UP)
+				ast_answer(chan);
+
 			/* Run the conference */
 			res = conf_run(chan, cnf, confflags.flags);
 		} else
@@ -2808,6 +2903,44 @@
 	return AST_DEVICE_INUSE;
 }
 
+/*! \brief Callback for devicestate providers */
+static int slastate(const char *data)
+{
+	struct ast_conference *conf;
+	struct ast_sla *sla, *sla2;
+
+	ast_log(LOG_DEBUG, "asked for sla state for '%s'\n", data);
+
+	/* Find conference */
+	AST_LIST_LOCK(&confs);
+	AST_LIST_TRAVERSE(&confs, conf, list) {

[... 5096 lines stripped ...]


More information about the asterisk-commits mailing list