.EXPORT_ALL_VARIABLES:
+include makeopts
+
#Uncomment this to see all build commands instead of 'quiet' output
#NOISY_BUILD=yes
# Create OPTIONS variable
OPTIONS=
-# If cross compiling, define these to suit
-#CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be-
-#CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/
-#CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target
-#CROSS_ARCH=Linux
-#CROSS_PROC=arm
-#SUB_PROC=xscale # or maverick
-
-ifeq ($(CROSS_COMPILE),)
- OSARCH:=$(shell uname -s)
- PROC?:=$(shell uname -m)
-else
- OSARCH=$(CROSS_ARCH)
- PROC=$(CROSS_PROC)
-endif
-
ASTTOPDIR:=$(shell pwd)
-# Remember the MAKELEVEL at the top
-MAKETOPLEVEL?=$(MAKELEVEL)
-
# Overwite config files on "make samples"
OVERWRITE=y
# For example, make DESTDIR=/tmp/asterisk woud put things in
# /tmp/asterisk/etc/asterisk
# !!! Watch out, put no spaces or comments after the value !!!
-DESTDIR?=
#DESTDIR?=/tmp/asterisk
-# Original busydetect routine
-#BUSYDETECT = -DBUSYDETECT
-
-# Improved busydetect routine, comment the previous one if you use this one
-#BUSYDETECT+= -DBUSYDETECT_MARTIN
-# Detect the busy signal looking only at tone lengths
-# For example if you have 3 beeps 100ms tone, 100ms silence separated by 500 ms of silence
-#BUSYDETECT+= -DBUSYDETECT_TONEONLY
-# Enforce the detection of busy signal (get rid of false hangups)
-# Don't use together with -DBUSYDETECT_TONEONLY
-#BUSYDETECT+= -DBUSYDETECT_COMPARE_TONE_AND_SILENCE
-
# Define standard directories for various platforms
# These apply if they are not redefined in asterisk.conf
ifeq ($(OSARCH),SunOS)
GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts)
USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts)
-ifeq ($(strip $(foreach var,clean distclean dist-clean update,$(findstring $(var),$(MAKECMDGOALS)))),)
- ifneq ($(wildcard menuselect.makeopts),)
- include menuselect.makeopts
- include menuselect.makedeps
- endif
-endif
-
-ifeq ($(strip $(foreach var,clean distclean dist-clean update,$(findstring $(var),$(MAKECMDGOALS)))),)
- ifneq ($(wildcard makeopts),)
- include makeopts
- endif
-endif
-
-TOPDIR_CFLAGS=-Iinclude
-MOD_SUBDIR_CFLAGS=-I../include -I..
-OTHER_SUBDIR_CFLAGS=-I../include -I..
-
-ifeq ($(origin MENUSELECT_CFLAGS),undefined)
- MENUSELECT_CFLAGS:=$(shell grep MENUSELECT_CFLAGS $(USER_MAKEOPTS) .)
- ifeq ($(MENUSELECT_CFLAGS),)
- MENUSELECT_CFLAGS:=$(shell grep MENUSELECT_CFLAGS $(GLOBAL_MAKEOPTS) .)
- endif
- ifneq ($(MENUSELECT_CFLAGS),)
- MENUSELECT_CFLAGS:=$(shell echo $(MENUSELECT_CFLAGS) | cut -f2 -d'=')
- endif
-endif
-
-ifeq ($(findstring dont-optimize,$(MAKECMDGOALS)),$(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)))
-# More GSM codec optimization
-# Uncomment to enable MMXTM optimizations for x86 architecture CPU's
-# which support MMX instructions. This should be newer pentiums,
-# ppro's, etc, as well as the AMD K6 and K7.
-#K6OPT = -DK6OPT
-
-# Tell gcc to optimize the code
-OPTIMIZE+=-O6
-else
- # Stack backtraces, while useful for debugging, are incompatible with optimizations
- ifeq ($(OSARCH),Linux)
- CFLAGS+=-DSTACK_BACKTRACES
- endif
-endif
-
-# *CLI> show memory allocations [filename]
-# *CLI> show memory summary [filename]
-ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),)
- TOPDIR_CFLAGS+=-include include/asterisk/astmm.h
- MOD_SUBDIR_CFLAGS+=-include ../include/asterisk/astmm.h
-endif
+MOD_SUBDIR_CFLAGS=-I../include -I../main
+OTHER_SUBDIR_CFLAGS=-I../include
-MOD_SUBDIR_CFLAGS+=-fPIC
-
-ifeq ($(OSARCH),Linux)
+ifeq ($(OSARCH),linux-gnu)
ifeq ($(PROC),x86_64)
# You must have GCC 3.4 to use k8, otherwise use athlon
PROC=k8
endif
endif
-GREP=grep
ID=id
ifeq ($(OSARCH),SunOS)
- GREP=/usr/xpg4/bin/grep
M4=/usr/local/bin/m4
ID=/usr/xpg4/bin/id
endif
ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
-ifneq ($(OPTIMIZE),)
-ASTCFLAGS+=$(OPTIMIZE)
-endif
ifeq ($(AST_DEVMODE),yes)
ASTCFLAGS+=-Werror -Wunused
endif
-ASTOBJ=-o asterisk
-
-ifeq ($(findstring BSD,$(OSARCH)),BSD)
- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
+ifneq ($(findstring BSD,$(OSARCH)),)
+ ASTCFLAGS+=-I/usr/local/include -L/usr/local/lib
endif
ifneq ($(PROC),ultrasparc)
endif
ifeq ($(OSARCH),FreeBSD)
- BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk)
+ BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
AST_LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
-endif # FreeBSD
+endif
ifeq ($(OSARCH),NetBSD)
- AST_CFLAGS+=-pthread -I$(CROSS_COMPILE_TARGET)/usr/pkg/include
+ ASTCFLAGS+=-pthread -I/usr/pkg/include
endif
ifeq ($(OSARCH),OpenBSD)
endif
ifeq ($(OSARCH),SunOS)
- ASTCFLAGS+=-Wcast-align -DSOLARIS -Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/opt/ssl/include -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
+ ASTCFLAGS+=-Wcast-align -DSOLARIS -Iinclude/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include
endif
-LIBEDIT=editline/libedit.a
-
ASTERISKVERSION:=$(shell build_tools/make_version .)
ifneq ($(wildcard .version),)
ASTCFLAGS+=$(MALLOC_DEBUG)$(BUSYDETECT)$(OPTIONS)
-MOD_SUBDIRS:=res channels pbx apps codecs formats cdr funcs
+MOD_SUBDIRS:=res channels pbx apps codecs formats cdr funcs main
OTHER_SUBDIRS:=utils agi
+# Note: OTHER_SUBDIRS must be after MOD_SUBDIRS, because 'utils' uses files from 'main'
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_DEPEND:=$(OTHER_SUBDIRS_DEPEND) $(MOD_SUBDIRS_DEPEND)
SUBDIRS_UNINSTALL:=$(SUBDIRS:%=%-uninstall)
+MOD_SUBDIRS_EMBED_LDSCRIPT:=$(MOD_SUBDIRS:%=%-embed-ldscript)
+MOD_SUBDIRS_EMBED_LDFLAGS:=$(MOD_SUBDIRS:%=%-embed-ldflags)
+MOD_SUBDIRS_EMBED_LIBS:=$(MOD_SUBDIRS:%=%-embed-libs)
-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 \
- ulaw.o alaw.o callerid.o fskmodem.o image.o app.o \
- cdr.o tdd.o acl.o rtp.o udptl.o manager.o asterisk.o \
- dsp.o chanvars.o indications.o autoservice.o db.o privacy.o \
- astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
- utils.o plc.o jitterbuf.o dnsmgr.o devicestate.o \
- netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \
- cryptostub.o sha1.o http.o fixedjitterbuf.o abstract_jb.o
-
-# we need to link in the objects statically, not as a library, because
-# otherwise modules will not have them available if none of the static
-# objects use it.
-OBJS+=stdtime/localtime.o
-
-# At the moment say.o is an optional component which can be overridden
-# by a module.
-OBJS+=say.o
-
-ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),)
- OBJS+= poll.o
- ASTCFLAGS+=-DPOLLCOMPAT
-endif
-
-ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/dlfcn.h),)
- OBJS+= dlfcn.o
- ASTCFLAGS+=-DDLFCNCOMPAT
-endif
-
-ifeq ($(OSARCH),Linux)
- AST_LIBS+=-ldl -lpthread $(EDITLINE_LIB) -lm -lresolv #-lnjamd
-else
- AST_LIBS+=$(EDITLINE_LIB) -lm
-endif
-
-ifeq ($(OSARCH),Darwin)
- AST_LIBS+=-lresolv
+ifneq ($(findstring darwin,$(OSARCH)),)
ASTCFLAGS+=-D__Darwin__
AUDIO_LIBS=-framework CoreAudio
- ASTLINK=-Wl,-dynamic
SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
- # Mac on Intel CoreDuo does not need poll compatibility layer
- ifneq ($(PROC),i386)
- OBJS+=poll.o
- ASTCFLAGS+=-DPOLLCOMPAT
- endif
else
# These are used for all but Darwin
- ASTLINK=-Wl,-E
SOLINK=-shared -Xlinker -x
- ifeq ($(findstring BSD,$(OSARCH)),BSD)
- LDFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
+ ifneq ($(findstring BSD,$(OSARCH)),)
+ LDFLAGS+=-L/usr/local/lib
endif
endif
-ifeq ($(OSARCH),FreeBSD)
- AST_LIBS+=-lcrypto
-endif
-
-ifeq ($(OSARCH),NetBSD)
- AST_LIBS+=-lpthread -lcrypto -lm -L$(CROSS_COMPILE_TARGET)/usr/pkg/lib $(EDITLINE_LIB)
-endif
-
-ifeq ($(OSARCH),OpenBSD)
- AST_LIBS+=-lcrypto -lpthread -lm $(EDITLINE_LIB)
-endif
-
ifeq ($(OSARCH),SunOS)
- AST_LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/opt/ssl/lib -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
- OBJS+=strcompat.o
- ASTLINK=
- SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
-endif
-
-ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
- CFLAGS+=$(TOPDIR_CFLAGS)$(ASTCFLAGS)
+ SOLINK=-shared -fpic -L/usr/local/ssl/lib
endif
# This is used when generating the doxygen documentation
HAVEDOT=no
endif
-include Makefile.rules
-
-_all: all
+all: cleantest $(SUBDIRS)
@echo " +--------- Asterisk Build Complete ---------+"
@echo " + Asterisk has successfully been built, but +"
@echo " + cannot be run before being installed by +"
@echo " + make install +"
@echo " +-------------------------------------------+"
-all: cleantest config.status menuselect.makeopts depend $(SUBDIRS) asterisk
-
-$(MOD_SUBDIRS):
- @CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $@
-
-$(OTHER_SUBDIRS):
- @CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $@
-
-config.status: configure
- @CFLAGS="" ./configure
- @echo "****"
- @echo "**** The configure script was just executed, so 'make' needs to be"
- @echo "**** restarted."
- @echo "****"
- @exit 1
-
-makeopts: configure
- @CFLAGS="" ./configure
+makeopts:
@echo "****"
- @echo "**** The configure script was just executed, so 'make' needs to be"
- @echo "**** restarted."
+ @echo "**** The configure script must be executed before running 'make'."
@echo "****"
@exit 1
-menuselect.makeopts menuselect.makedeps: menuselect/menuselect menuselect-tree
+menuselect.makeopts: menuselect/menuselect menuselect-tree
menuselect/menuselect --check-deps $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts
-#ifneq ($(wildcard tags),)
-ctags: tags
-#endif
-
-ifneq ($(wildcard TAGS),)
-all: TAGS
-endif
-
-editline/config.h:
- cd editline && unset CFLAGS AST_LIBS && CFLAGS="$(OPTIMIZE)" ./configure ; \
-
-editline/libedit.a:
- cd editline && unset CFLAGS AST_LIBS && test -f config.h || CFLAGS="$(OPTIMIZE)" ./configure
- $(MAKE) -C editline libedit.a
-
-db1-ast/libdb1.a:
- $(MAKE) -C db1-ast libdb1.a
-
-ifeq ($(strip $(foreach var,clean distclean dist-clean update,$(findstring $(var),$(MAKECMDGOALS)))),)
- ifneq ($(wildcard .depend),)
- include .depend
- endif
-endif
-
-ifeq ($(strip $(foreach var,clean distclean dist-clean update,$(findstring $(var),$(MAKECMDGOALS)))),)
- ifneq ($(wildcard .tags-depend),)
- include .tags-depend
- endif
-endif
+$(MOD_SUBDIRS_EMBED_LDSCRIPT):
+ @echo "EMBED_LDSCRIPTS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-ldscript=) SUBDIR=$(@:-embed-ldscript=) __embed_ldscript` >> makeopts.embed_rules
-ast_expr2.c ast_expr2.h:
- bison -o $@ -d --name-prefix=ast_yy ast_expr2.y
+$(MOD_SUBDIRS_EMBED_LDFLAGS):
+ @echo "EMBED_LDFLAGS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-ldflags=) SUBDIR=$(@:-embed-ldflags=) __embed_ldflags` >> makeopts.embed_rules
-ast_expr2f.c:
- flex -o $@ --full ast_expr2.fl
+$(MOD_SUBDIRS_EMBED_LIBS):
+ @echo "EMBED_LIBS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-libs=) SUBDIR=$(@:-embed-libs=) __embed_libs` >> makeopts.embed_rules
-testexpr2: config.status include/asterisk/buildopts.h ast_expr2f.c ast_expr2.c ast_expr2.h
- $(CC) -g -c -Iinclude -DSTANDALONE ast_expr2f.c
- $(CC) -g -c -Iinclude -DSTANDALONE ast_expr2.c
- $(CC) -g -o testexpr2 ast_expr2f.o ast_expr2.o
- rm ast_expr2.o ast_expr2f.o
-
-manpage: asterisk.8
-
-asterisk.8: asterisk.sgml
- rm -f asterisk.8
- docbook2man asterisk.sgml
- mv ./*.8 asterisk.8
+makeopts.embed_rules: menuselect.makeopts
+ @echo "Generating embedded module rules ..."
+ @rm -f $@
+ @$(MAKE) --no-print-directory $(MOD_SUBDIRS_EMBED_LDSCRIPT)
+ @$(MAKE) --no-print-directory $(MOD_SUBDIRS_EMBED_LDFLAGS)
+ @$(MAKE) --no-print-directory $(MOD_SUBDIRS_EMBED_LIBS)
-asterisk.pdf: asterisk.sgml
- docbook2pdf asterisk.sgml
+$(SUBDIRS): depend makeopts.embed_rules
-asterisk.ps: asterisk.sgml
- docbook2ps asterisk.sgml
+# ensure that all module subdirectories are processed before 'main' during
+# a parallel build, since if there are modules selected to be embedded the
+# directories containing them must be completed before the main Asterisk
+# binary can be built
+main: $(filter-out main,$(MOD_SUBDIRS))
-asterisk.html: asterisk.sgml
- docbook2html asterisk.sgml
- mv r1.html asterisk.html
+$(MOD_SUBDIRS):
+ @CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $@ SUBDIR=$@ all
-asterisk.txt: asterisk.sgml
- docbook2txt asterisk.sgml
+$(OTHER_SUBDIRS):
+ @CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $@ SUBDIR=$@ all
defaults.h: makeopts
@build_tools/make_defaults_h > $@.tmp
fi
@rm -f $@.tmp
-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 \
- 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
- @echo " [LD] $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.1 $(AST_LIBS) -> $@"
- @$(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a $(AST_LIBS)
-
-muted: muted.o
-muted: LIBS+=$(AUDIO_LIBS)
-
$(SUBDIRS_CLEAN_DEPEND):
- @$(MAKE) -C $(@:-clean-depend=) clean-depend
+ @$(MAKE) --no-print-directory -C $(@:-clean-depend=) clean-depend
$(SUBDIRS_CLEAN):
- @$(MAKE) -C $(@:-clean=) clean
+ @$(MAKE) --no-print-directory -C $(@:-clean=) clean
clean-depend: $(SUBDIRS_CLEAN_DEPEND)
clean: $(SUBDIRS_CLEAN) clean-depend
- rm -f *.o *.so asterisk
rm -f defaults.h
rm -f include/asterisk/build.h
rm -f include/asterisk/version.h
- rm -f .tags-sources tags TAGS
- rm -f .depend .tags-depend
- @if [ -f editline/Makefile ]; then $(MAKE) -C editline distclean ; fi
- @$(MAKE) -C db1-ast clean
- @$(MAKE) -C stdtime clean
+ rm -f .depend
@$(MAKE) -C menuselect clean
dist-clean: distclean
@$(MAKE) -C mxml clean
@$(MAKE) -C menuselect dist-clean
@$(MAKE) -C sounds dist-clean
- rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
+ rm -f menuselect.makeopts makeopts makeopts.xml menuselect.makedeps
+ rm -f makeopts.embed_rules
rm -f config.log config.status
rm -rf autom4te.cache
rm -f include/asterisk/autoconfig.h
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
- if [ -f asterisk ]; then $(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
- if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ $(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
$(LN) -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
$(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
$(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
$(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
$(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
- $(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(INSTALL) -m 644 doc/asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
$(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
$(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
$(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
echo "PROJECT_NUMBER=$(ASTERISKVERSION)") | doxygen -
config:
- @if [ "${OSARCH}" = "Linux" ]; then \
+ @if [ "${OSARCH}" = "linux-gnu" ]; then \
if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
$(INSTALL) -m 755 contrib/init.d/rc.redhat.asterisk /etc/rc.d/init.d/asterisk; \
/sbin/chkconfig --add asterisk; \
echo "We could not install init scripts for your operating system."; \
fi
-dont-optimize: _all
-
-valgrind: dont-optimize
-
$(MOD_SUBDIRS_DEPEND):
- @CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $(@:-depend=) depend
+ @CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $(@:-depend=) depend
$(OTHER_SUBDIRS_DEPEND):
- @CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $(@:-depend=) depend
+ @CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -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)
-
-.tags-depend:
- @echo -n ".tags-depend: " > $@
- @$(FIND) . -maxdepth 1 -name \*.c -printf "\t%p \\\\\n" >> $@
- @$(FIND) . -maxdepth 1 -name \*.h -printf "\t%p \\\\\n" >> $@
- @$(FIND) $(SUBDIRS) -name \*.c -printf "\t%p \\\\\n" >> $@
- @$(FIND) $(SUBDIRS) -name \*.h -printf "\t%p \\\\\n" >> $@
- @$(FIND) include -name \*.h -printf "\t%p \\\\\n" >> $@
- @echo >> $@
-
-.tags-sources:
- @rm -f $@
- @$(FIND) . -maxdepth 1 -name \*.c -print >> $@
- @$(FIND) . -maxdepth 1 -name \*.h -print >> $@
- @$(FIND) $(SUBDIRS) -name \*.c -print >> $@
- @$(FIND) $(SUBDIRS) -name \*.h -print >> $@
- @$(FIND) include -name \*.h -print >> $@
-
-tags: .tags-depend .tags-sources
- ctags -L .tags-sources -o $@
-
-ctags: tags
-
-TAGS: .tags-depend .tags-sources
- etags -o $@ `cat .tags-sources`
-
-etags: TAGS
-
-%_env:
- $(MAKE) -C $(shell echo $@ | sed "s/_env//g") env
+depend: include/asterisk/version.h include/asterisk/buildopts.h defaults.h $(SUBDIRS_DEPEND)
sounds:
$(MAKE) -C sounds all
-env:
- env
-
# If the cleancount has been changed, force a make clean.
# .cleancount is the global clean count, and .lastclean is the
# last clean count we had
cleantest:
- @if cmp -s .cleancount .lastclean ; then echo ; else \
+ @if ! cmp -s .cleancount .lastclean ; then \
$(MAKE) clean; cp -f .cleancount .lastclean;\
$(MAKE) defaults.h;\
fi
$(SUBDIRS_UNINSTALL):
- @$(MAKE) -C $(@:-uninstall=) uninstall
+ @$(MAKE) --no-print-directory -C $(@:-uninstall=) uninstall
_uninstall: $(SUBDIRS_UNINSTALL)
rm -f $(DESTDIR)$(MODULES_DIR)/*
menuselect: menuselect/menuselect menuselect-tree
-@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_stub.c menuselect/menuselect.h menuselect/linkedlists.h config.status mxml/libmxml.a
- @CFLAGS="-include $(ASTTOPDIR)/include/asterisk/autoconfig.h -I$(ASTTOPDIR)/include" PARENTSRC="$(ASTTOPDIR)" $(MAKE) -C menuselect menuselect
+menuselect/menuselect: makeopts menuselect/menuselect.c menuselect/menuselect_curses.c menuselect/menuselect_stub.c menuselect/menuselect.h menuselect/linkedlists.h makeopts mxml/libmxml.a
+ @CFLAGS="-include $(ASTTOPDIR)/include/asterisk/autoconfig.h -I$(ASTTOPDIR)/include" PARENTSRC="$(ASTTOPDIR)" $(MAKE) -C menuselect CC="$(HOST_CC)" menuselect
mxml/libmxml.a:
- @cd mxml && unset CFLAGS AST_LIBS && test -f config.h || ./configure
+ @cd mxml && unset CFLAGS AST_LIBS && test -f config.h || ./configure --build=$(BUILD_PLATFORM) --host=$(BUILD_PLATFORM)
$(MAKE) -C mxml libmxml.a
-menuselect-tree: $(foreach dir,$(MOD_SUBDIRS),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml
- @echo "Generating list of available modules ..."
+menuselect-tree: $(foreach dir,$(MOD_SUBDIRS),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml
+ @echo "Generating input for menuselect ..."
@build_tools/prep_moduledeps > $@
-.PHONY: menuselect 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)
+.PHONY: menuselect main sounds clean clean-depend dist-clean distclean all prereqs depend cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_CLEAN) $(SUBDIRS_CLEAN_DEPEND) $(SUBDIRS_DEPEND) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS)
#
# Asterisk -- A telephony toolkit for Linux.
#
-# Makefile rules
+# Makefile rules for subdirectories containing modules
#
# Copyright (C) 2006, Digium, Inc.
#
# the GNU General Public License
#
+ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),)
+ CFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h
+endif
+
+ifneq ($(findstring STATIC_BUILD,$(MENUSELECT_CFLAGS)),)
+ STATIC_BUILD=-static
+endif
+
include $(ASTTOPDIR)/Makefile.rules
-define module_o_c_template
-$(1).o: $(1).c
-$(1).o: CFLAGS+=$$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
-endef
+comma:=,
-define module_oo_cc_template
-$(1).oo: $(1).cc
-$(1).oo: CFLAGS+=$$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
+define module_o_template
+$(2): $(3)
+$(2): CFLAGS+=-DAST_MODULE=\"$(1)\" $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
endef
-define module_so_o_template
-$(1).so: $(1).o
+define module_so_template
+$(1)=$(1).so
+$(1).so: CFLAGS+=-fPIC
$(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
+$(1).so: $(2)
endef
-define module_so_oo_template
-$(1).so: $(1).oo
-$(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
-$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
+define module_a_template
+$(1)=modules.link
+modules.link: $(2)
endef
-$(foreach mod,$(C_MODS),$(eval $(call module_o_c_template,$(mod))))
+$(foreach mod,$(C_MODS),$(eval $(call module_o_template,$(mod),$(mod).o,$(mod).c)))
-$(foreach mod,$(C_MODS),$(eval $(call module_so_o_template,$(mod))))
+$(foreach mod,$(CC_MODS),$(eval $(call module_o_template,$(mod),$(mod).oo,$(mod).cc)))
-$(foreach mod,$(CC_MODS),$(eval $(call module_oo_cc_template,$(mod))))
+$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(C_MODS)),$(eval $(call module_so_template,$(mod),$(mod).o)))
-$(foreach mod,$(CC_MODS),$(eval $(call module_so_oo_template,$(mod))))
+$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(CC_MODS)),$(eval $(call module_so_template,$(mod),$(mod).oo)))
+
+$(foreach mod,$(filter $(EMBEDDED_MODS),$(C_MODS)),$(eval $(call module_a_template,$(mod),$(mod).o)))
+
+$(foreach mod,$(filter $(EMBEDDED_MODS),$(CC_MODS)),$(eval $(call module_a_template,$(mod),$(mod).oo)))
.PHONY: clean clean-depend depend uninstall _all
-_all: $(SELECTED_MODS:%=%.so)
+ifneq ($(LOADABLE_MODS),)
+_all: $(LOADABLE_MODS:%=%.so)
+endif
+
+ifneq ($(EMBEDDED_MODS),)
+_all: modules.link
+__embed_ldscript:
+ @echo "../$(SUBDIR)/modules.link"
+__embed_ldflags:
+ @echo "$(foreach mod,$(filter $(EMBEDDED_MODS),$(C_MODS)),$(foreach dep,$(MENUSELECT_DEPENDS_$(mod)),$(dep)_LDFLAGS))"
+ @echo "$(foreach mod,$(filter $(EMBEDDED_MODS),$(CC_MODS)),$(foreach dep,$(MENUSELECT_DEPENDS_$(mod)),$(dep)_LDFLAGS))"
+__embed_libs:
+ @echo "$(foreach mod,$(filter $(EMBEDDED_MODS),$(C_MODS)),$(foreach dep,$(MENUSELECT_DEPENDS_$(mod)),$(dep)_LIB))"
+ @echo "$(foreach mod,$(filter $(EMBEDDED_MODS),$(CC_MODS)),$(foreach dep,$(MENUSELECT_DEPENDS_$(mod)),$(dep)_LIB))"
+else
+__embed_ldscript:
+__embed_ldflags:
+__embed_libs:
+endif
+
+modules.link:
+ @rm -f $@
+ @for file in $(patsubst $(ASTTOPDIR)/%,%,$(realpath $^)); do echo "INPUT (../$${file})" >> $@; done
clean-depend::
rm -f .depend
clean:: clean-depend
rm -f *.so *.o *.oo
+ rm -f modules.link
install:: all
- for x in $(SELECTED_MODS:%=%.so); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(LOADABLE_MODS:%=%.so); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
uninstall::
depend: .depend
.depend:
- ../build_tools/mkdep $(CFLAGS) `ls *.c`
+ ../build_tools/mkdep $(CFLAGS) `ls *.c *.cc 2> /dev/null`
# Prefixing one or the other with @\# or @ or nothing makes the desired
# behaviour. ECHO_PREFIX prefixes the comment, CMD_PREFIX prefixes the command.
+include $(ASTTOPDIR)/makeopts
+
ifeq ($(NOISY_BUILD),)
ECHO_PREFIX=@
CMD_PREFIX=@
CMD_PREFIX=
endif
+ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),)
+# More GSM codec optimization
+# Uncomment to enable MMXTM optimizations for x86 architecture CPU's
+# which support MMX instructions. This should be newer pentiums,
+# ppro's, etc, as well as the AMD K6 and K7.
+#K6OPT=-DK6OPT
+
+OPTIMIZE?=-O6
+CFLAGS+=$(OPTIMIZE)
+endif
+
define ast_make_o_c
$(1): $(2)
$(ECHO_PREFIX) echo " [CC] $$< -> $$@"
define ast_make_so_o
$(1): $(2)
$(ECHO_PREFIX) echo " [LD] $$^ -> $$@"
- $(CMD_PREFIX) $$(CC) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
+ $(CMD_PREFIX) $$(CC) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
endef
define ast_make_so_oo
$(1): $(2)
$(ECHO_PREFIX) echo " [LDXX] $$^ -> $$@"
- $(CMD_PREFIX) $$(CXX) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
+ $(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
endef
define ast_make_a_o
define ast_make_final
$(1): $(2)
$(ECHO_PREFIX) echo " [LD] $$^ -> $$@"
- $(CMD_PREFIX) $$(CC) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
+ $(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
endef
define ast_make_final_host
$(1): $(2)
$(ECHO_PREFIX) echo " [LD] $$^ -> $$@"
- $(CMD_PREFIX) $$(HOST_CC) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
+ $(CMD_PREFIX) $$(HOST_CC) $$(STATIC_BUILD) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
endef
$(eval $(call ast_make_o_c,%.o,%.c))
$(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))
+# AST_GCC_ATTRIBUTE([attribute name])
+
+AC_DEFUN([AST_GCC_ATTRIBUTE],
+[
+AC_MSG_CHECKING(checking for compiler 'attribute $1' support)
+AC_COMPILE_IFELSE(
+ AC_LANG_PROGRAM([static int __attribute__(($1)) test(void) {}],
+ []),
+ AC_MSG_RESULT(yes)
+ AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),
+ AC_MSG_RESULT(no))
+])
+
# AST_EXT_LIB_SETUP([package symbol name], [package friendly name], [package option name], [additional help text])
AC_DEFUN([AST_EXT_LIB_SETUP],
# the GNU General Public License
#
-ifneq ($(wildcard ../menuselect.makeopts),)
+ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),)
include ../menuselect.makeopts
include ../menuselect.makedeps
endif
C_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.c,%,$(wildcard app_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.cc,%,$(wildcard app_*.cc)))
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring apps,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
ifneq ($(findstring ODBC_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),)
MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_ODBC_STORAGE)
endif
-ifneq ($(findstring EXTENDED_ODBC_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),)
-MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_EXTENDED_ODBC_STORAGE)
-endif
ifneq ($(findstring IMAP_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),)
MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_IMAP_STORAGE)
endif
+ifeq (SunOS,$(shell uname))
+MENUSELECT_DEPENDS_app_chanspy+=RT
+RT_LIB=-lrt
+endif
+
all: _all
include $(ASTTOPDIR)/Makefile.moddir_rules
-
-ifeq (SunOS,$(shell uname))
-app_chanspy.so: LIBS+=-lrt
-endif
static int adsi_exec(struct ast_channel *chan, void *data)
{
int res=0;
- struct localuser *u;
+ struct ast_module_user *u;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (ast_strlen_zero(data))
data = "asterisk.adsi";
res = adsi_prog(chan, data);
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
res = ast_unregister_application(app);
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
- __mod_desc = mod;
return ast_register_application(app, adsi_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Asterisk ADSI Programming Application";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Asterisk ADSI Programming Application");
static int alarmreceiver_exec(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
event_node_t *elp, *efree;
char signalling_type[64] = "";
event_node_t *event_head = NULL;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
/* Set write and read formats to ULAW */
if (ast_set_write_format(chan,AST_FORMAT_ULAW)){
ast_log(LOG_WARNING, "AlarmReceiver: Unable to set write format to Mu-law on %s\n",chan->name);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if (ast_set_read_format(chan,AST_FORMAT_ULAW)){
ast_log(LOG_WARNING, "AlarmReceiver: Unable to set read format to Mu-law on %s\n",chan->name);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
res = ast_answer(chan);
if (res) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
}
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
*/
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
- __mod_desc = mod;
load_config();
return ast_register_application(app, alarmreceiver_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Alarm Receiver for Asterisk";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Alarm Receiver for Asterisk");
static int amd_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
isAnsweringMachine(chan, data);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
return;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return ast_unregister_application(app);
}
-static int load_module(void *mod)
+static int load_module(void)
{
- __mod_desc = mod;
load_config();
return ast_register_application(app, amd_exec, synopsis, descrip);
}
-static int reload(void *mod)
+static int reload(void)
{
load_config();
return 0;
}
-static const char *description(void)
-{
- return "Answering Machine Detection Application";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Answering Machine Detection Application",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
{
int res=0;
int retries;
- struct localuser *u;
+ struct ast_module_user *u;
char passwd[256];
char *prompt;
int maxdigits;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (chan->_state != AST_STATE_UP) {
res = ast_answer(chan);
if (res) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
}
res = -1;
}
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
res = ast_unregister_application(app);
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, auth_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Authentication Application";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Authentication Application");
static char *nocdr_app = "NoCDR";
static char *nocdr_synopsis = "Tell Asterisk to not maintain a CDR for the current call";
-LOCAL_USER_DECL;
static int nocdr_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (chan->cdr) {
ast_cdr_free(chan->cdr);
chan->cdr = NULL;
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(nocdr_app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip);
}
-static const char *description(void)
-{
- return "Tell Asterisk to not maintain a CDR for the current call";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Tell Asterisk to not maintain a CDR for the current call");
" s - Consider the channel unavailable if the channel is in use at all\n"
" j - Support jumping to priority n+101 if no channel is available\n";
-LOCAL_USER_DECL;
static int chanavail_exec(struct ast_channel *chan, void *data)
{
int res=-1, inuse=-1, option_state=0, priority_jump=0;
int status;
- struct localuser *u;
+ struct ast_module_user *u;
char *info, tmp[512], trychan[512], *peers, *tech, *number, *rest, *cur;
struct ast_channel *tempchan;
AST_DECLARE_APP_ARGS(args,
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
info = ast_strdupa(data);
number = strchr(tech, '/');
if (!number) {
ast_log(LOG_WARNING, "ChanIsAvail argument takes format ([technology]/[device])\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
*number = '\0';
pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", "");
if (priority_jump || ast_opt_priority_jumping) {
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
}
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res = 0;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
- __mod_desc = mod;
return ast_register_application(app, chanavail_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Check channel availability";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Check channel availability");
"ChannelRedirect(channel|[[context|]extension|]priority):\n"
" Sends the specified channel to the specified extension priority\n";
-LOCAL_USER_DECL;
static int asyncgoto_exec(struct ast_channel *chan, void *data)
{
int res = -1;
- struct localuser *u;
+ struct ast_module_user *u;
char *info, *context, *exten, *priority;
int prio = 1;
struct ast_channel *chan2 = NULL;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
info = ast_strdupa(data);
AST_STANDARD_APP_ARGS(args, info);
chanquit:
ast_mutex_unlock(&chan2->lock);
quit:
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
- __mod_desc = mod;
return ast_register_application(app, asyncgoto_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Channel Redirect";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Channel Redirect");
AST_APP_OPTION_ARG('r', OPTION_RECORD, OPT_ARG_RECORD),
});
-LOCAL_USER_DECL;
struct chanspy_translation_helper {
/* spy data */
static int chanspy_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
char *options = NULL;
char *spec = NULL;
char *argv[2];
data = ast_strdupa(data);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if ((argc = ast_app_separate_args(data, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
spec = argv[0];
oldwf = chan->writeformat;
if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if (oldwf && ast_set_write_format(chan, oldwf) < 0)
ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int extenspy_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
char *options = NULL;
char *exten = NULL;
char *context = NULL;
data = ast_strdupa(data);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if ((argc = ast_app_separate_args(data, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
context = argv[0];
oldwf = chan->writeformat;
if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if (oldwf && ast_set_write_format(chan, oldwf) < 0)
ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res = 0;
res |= ast_unregister_application(app_chan);
res |= ast_unregister_application(app_ext);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
- __mod_desc = mod;
-
res |= ast_register_application(app_chan, chanspy_exec, tdesc, desc_chan);
res |= ast_register_application(app_ext, extenspy_exec, tdesc, desc_ext);
return res;
}
-static const char *description(void)
-{
- return (char *) tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Listen to the audio of an active channel");
" CPLAYBACKSTATUS - This variable contains the status of the attempt as a text\n"
" string, one of: SUCCESS | USERSTOPPED | ERROR\n";
-LOCAL_USER_DECL;
static int is_on_phonepad(char key)
{
{
int res = 0, priority_jump = 0;
int skipms = 0;
- struct localuser *u;
+ struct ast_module_user *u;
char *tmp;
int argc;
char *argv[8];
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
tmp = ast_strdupa(data);
memset(argv, 0, sizeof(argv));
if (argc < 1) {
ast_log(LOG_WARNING, "ControlPlayback requires an argument (filename)\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
pbx_builtin_setvar_helper(chan, "CPLAYBACKSTATUS", "SUCCESS");
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, controlplayback_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Control Playback Application";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Control Playback Application");
static char *d_synopsis = "Delete a key from the database";
static char *dt_synopsis = "Delete a family or keytree from the database";
-LOCAL_USER_DECL;
static int deltree_exec(struct ast_channel *chan, void *data)
{
char *argv, *family, *keytree;
- struct localuser *u;
+ struct ast_module_user *u;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
argv = ast_strdupa(data);
keytree = strsep(&argv, "\0");
if (!family || !keytree) {
ast_log(LOG_DEBUG, "Ignoring; Syntax error in argument\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
if (ast_strlen_zero(keytree))
ast_verbose(VERBOSE_PREFIX_3 "DBdeltree: Error deleting key from database.\n");
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
static int del_exec(struct ast_channel *chan, void *data)
{
char *argv, *family, *key;
- struct localuser *u;
+ struct ast_module_user *u;
static int deprecation_warning = 0;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!deprecation_warning) {
deprecation_warning = 1;
key = strsep(&argv, "\0");
if (!family || !key) {
ast_log(LOG_DEBUG, "Ignoring; Syntax error in argument\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
if (option_verbose > 2)
ast_log(LOG_DEBUG, "Ignoring, no parameters\n");
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int retval;
return retval;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int retval;
- __mod_desc = mod;
retval = ast_register_application(d_app, del_exec, d_synopsis, d_descrip);
retval |= ast_register_application(dt_app, deltree_exec, dt_synopsis, dt_descrip);
return retval;
}
-static const char *description(void)
-{
- return "Database Access Functions";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Database Access Functions");
struct dial_localuser *next;
};
-LOCAL_USER_DECL;
static void hanguptree(struct dial_localuser *outgoing, struct ast_channel *exception)
{
static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags)
{
int res = -1;
- struct localuser *u;
+ struct ast_module_user *u;
char *rest, *cur;
struct dial_localuser *outgoing = NULL;
struct ast_channel *peer;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
parse = ast_strdupa(data);
res = 0;
done:
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
char *announce = NULL, *dialdata = NULL;
const char *context = NULL;
int sleep = 0, loops = 0, res = -1;
- struct localuser *u;
+ struct ast_module_user *u;
struct ast_flags peerflags;
if (ast_strlen_zero(data)) {
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
announce = ast_strdupa(data);
if (ast_test_flag(chan, AST_FLAG_MOH))
ast_moh_stop(chan);
done:
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
res |= ast_unregister_application(rapp);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static const char *description(void)
-{
- return "Dialing Application";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dialing Application");
static char *desc = " Dictate([<base_dir>[|<filename>]])\n"
"Start dictation machine using optional base dir for files.\n";
-LOCAL_USER_DECL;
typedef enum {
DFLAG_RECORD = (1 << 0),
struct ast_flags flags = {0};
struct ast_filestream *fs;
struct ast_frame *f = NULL;
- struct localuser *u;
+ struct ast_module_user *u;
int ffactor = 320 * 80,
res = 0,
done = 0,
maxlen = 0,
mode = 0;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
snprintf(dftbase, sizeof(dftbase), "%s/dictate", ast_config_AST_SPOOL_DIR);
if (!ast_strlen_zero(data)) {
oldr = chan->readformat;
if ((res = ast_set_read_format(chan, AST_FORMAT_SLINEAR)) < 0) {
ast_log(LOG_WARNING, "Unable to set to linear mode.\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if (oldr) {
ast_set_read_format(chan, oldr);
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
- __mod_desc = mod;
return ast_register_application(app, dictate_exec, synopsis, desc);
}
-static const char *description(void)
-{
- return "Virtual Dictation Machine";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Virtual Dictation Machine");
"10@PICKUPMARK, this application tries to find a channel which has defined a channel variable with the same context\n"
"as \"extension\".";
-LOCAL_USER_DECL;
static int pickup_exec(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u = NULL;
+ struct ast_module_user *u = NULL;
struct ast_channel *origin = NULL, *target = NULL;
char *tmp = NULL, *exten = NULL, *context = NULL, *rest=data;
char workspace[256] = "";
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
while (!target && (exten = rest) ) {
res = 0;
if (target)
ast_mutex_unlock(&target->lock);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
- __mod_desc = mod;
return ast_register_application(app, pickup_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Directed Call Pickup Application";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Directed Call Pickup Application");
/* How many digits to read in */
#define NUMDIGITS 3
-LOCAL_USER_DECL;
#ifdef USE_ODBC_STORAGE
static void retrieve_file(char *dir)
static int directory_exec(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
struct ast_config *cfg;
int last = 1;
int readext = 0;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
parse = ast_strdupa(data);
cfg = realtime_directory(args.vmcontext);
if (!cfg) {
ast_log(LOG_ERROR, "Unable to read the configuration data!\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
break;
}
ast_config_destroy(cfg);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
- __mod_desc = mod;
#ifdef USE_ODBC_STORAGE
struct ast_config *cfg = ast_config_load(VOICEMAIL_CONFIG);
char *tmp;
return ast_register_application(app, directory_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Extension Directory";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Extension Directory");
"exists in the context, it will be used. Also, if you set the 5th argument\n"
"to 'NOANSWER', the DISA application will not answer initially.\n";
-LOCAL_USER_DECL;
static void play_dialtone(struct ast_channel *chan, char *mailbox)
{
int i,j,k,x,did_ignore,special_noanswer;
int firstdigittimeout = 20000;
int digittimeout = 10000;
- struct localuser *u;
+ struct ast_module_user *u;
char *tmp, exten[AST_MAX_EXTENSION],acctcode[20]="";
char pwline[256];
char ourcidname[256],ourcidnum[256];
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (chan->pbx) {
firstdigittimeout = chan->pbx->rtimeout*1000;
if (ast_set_write_format(chan,AST_FORMAT_ULAW)) {
ast_log(LOG_WARNING, "Unable to set write format to Mu-law on %s\n", chan->name);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if (ast_set_read_format(chan,AST_FORMAT_ULAW)) {
ast_log(LOG_WARNING, "Unable to set read format to Mu-law on %s\n", chan->name);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
f = ast_read(chan);
if (f == NULL) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if ((f->frametype == AST_FRAME_CONTROL) &&
(f->subclass == AST_CONTROL_HANGUP)) {
ast_frfree(f);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if (f->frametype == AST_FRAME_VOICE) {
fp = fopen(args.passcode,"r");
if (!fp) {
ast_log(LOG_WARNING,"DISA password file %s not found on chan %s\n",args.passcode,chan->name);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
pwline[0] = 0;
if (special_noanswer) flags.flags = 0;
ast_cdr_reset(chan->cdr, &flags);
ast_explicit_goto(chan, args.context, exten, 1);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
}
ast_frfree(f);
}
ast_playtones_stop(chan);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, disa_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "DISA (Direct Inward System Access) Application";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "DISA (Direct Inward System Access) Application");
"displayed when the verbose level is currently set to that number\n"
"or greater. \n";
-LOCAL_USER_DECL;
static int serialize_showchan(struct ast_channel *c, char *buf, size_t size)
{
static int dumpchan_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
char vars[BUFSIZ * 4];
char info[1024];
int level = 0;
static char *line = "================================================================================";
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!ast_strlen_zero(data))
level = atoi(data);
if (option_verbose >= level)
ast_verbose("\nDumping Info For Channel: %s:\n%s\nInfo:\n%s\nVariables:\n%s%s\n", chan->name, line, info, vars, line);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, dumpchan_exec, synopsis, desc);
}
-static const char *description(void)
-{
- return "Dump Info About The Calling Channel";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dump Info About The Calling Channel");
#include "asterisk/pbx.h"
#include "asterisk/module.h"
-static char *tdesc = "Simple Echo Application";
-
static char *app = "Echo";
static char *synopsis = "Echo audio, video, or DTMF back to the calling party";
"the calling channel back to itself. If the DTMF digit '#' is received, the\n"
"application will exit.\n";
-LOCAL_USER_DECL;
static int echo_exec(struct ast_channel *chan, void *data)
{
int res = -1;
int format;
- struct localuser *u;
+ struct ast_module_user *u;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
format = ast_best_codec(chan->nativeformats);
ast_set_write_format(chan, format);
ast_frfree(f);
}
end:
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, echo_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Simple Echo Application");
/* Maximum length of any variable */
#define MAXRESULT 1024
-static char *tdesc = "Executes dialplan applications";
-
/*! Note
*
* The key difference between these two apps is exit status. In a
"If <expr> is true, but <app> is not found, then the application\n"
"will return a non-zero value.\n";
-LOCAL_USER_DECL;
-
static int exec_exec(struct ast_channel *chan, void *data)
{
int res=0;
- struct localuser *u;
+ struct ast_module_user *u;
char *s, *appname, *endargs, args[MAXRESULT] = "";
struct ast_app *app;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
/* Check and parse arguments */
if (data) {
}
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int tryexec_exec(struct ast_channel *chan, void *data)
{
int res=0;
- struct localuser *u;
+ struct ast_module_user *u;
char *s, *appname, *endargs, args[MAXRESULT] = "";
struct ast_app *app;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
/* Check and parse arguments */
if (data) {
}
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
-static int execif_exec(struct ast_channel *chan, void *data) {
- int res=0;
- struct localuser *u;
+static int execif_exec(struct ast_channel *chan, void *data)
+{
+ int res = 0;
+ struct ast_module_user *u;
char *myapp = NULL;
char *mydata = NULL;
char *expr = NULL;
struct ast_app *app = NULL;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
expr = ast_strdupa(data);
res = -1;
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
+
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res |= ast_unregister_application(app_tryexec);
res |= ast_unregister_application(app_execif);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = ast_register_application(app_exec, exec_exec, exec_synopsis, exec_descrip);
res |= ast_register_application(app_tryexec, tryexec_exec, tryexec_synopsis, tryexec_descrip);
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Executes dialplan applications");
int option_autoclear;
};
-LOCAL_USER_DECL;
struct gen_state {
struct ivr_localuser *u;
static int app_exec(struct ast_channel *chan, void *data)
{
- struct localuser *lu = NULL;
+ struct ast_module_user *lu;
struct playlist_entry *entry;
const char *args = data;
int child_stdin[2] = { 0,0 };
};
struct ivr_localuser *u = &foo;
- LOCAL_USER_ADD(lu);
+ lu = ast_module_user_add(chan);
u->abort_current_sound = 0;
u->chan = chan;
if (ast_strlen_zero(args)) {
ast_log(LOG_WARNING, "ExternalIVR requires a command to execute\n");
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
return -1;
}
while ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list)))
free(entry);
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, app_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "External IVR Interface Application";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "External IVR Interface Application");
"play it to the user, allowing any given interrupt keys to immediately terminate and return\n"
"the value, or 'any' to allow any number back (useful in dialplan)\n";
-LOCAL_USER_DECL;
static char *socket_receive_file_to_buff(int fd,int *size)
{
{
int usecache;
int res=0;
- struct localuser *u;
+ struct ast_module_user *u;
struct sockaddr_in serv_addr;
struct hostent *serverhost;
struct ast_hostent ahp;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
cfg = ast_config_load(FESTIVAL_CONFIG);
if (!cfg) {
ast_log(LOG_WARNING, "No such configuration file %s\n", FESTIVAL_CONFIG);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if (!(host = ast_variable_retrieve(cfg, "general", "host"))) {
if (fd < 0) {
ast_log(LOG_WARNING,"festival_client: can't get socket\n");
ast_config_destroy(cfg);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
memset(&serv_addr, 0, sizeof(serv_addr));
if (serverhost == (struct hostent *)0) {
ast_log(LOG_WARNING,"festival_client: gethostbyname failed\n");
ast_config_destroy(cfg);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
memmove(&serv_addr.sin_addr,serverhost->h_addr, serverhost->h_length);
if (connect(fd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) != 0) {
ast_log(LOG_WARNING,"festival_client: connect to server failed\n");
ast_config_destroy(cfg);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
ast_log(LOG_WARNING,"Unable to read from cache/festival fd");
close(fd);
ast_config_destroy(cfg);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
n += read_data;
} while (strcmp(ack,"OK\n") != 0);
close(fd);
ast_config_destroy(cfg);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, festival_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Simple Festival Interface";
-
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Simple Festival Interface");
"people who want to perform transfers and such via AGI and is generally\n"
"quite useless oths application will only work on Zap trunks.\n";
-LOCAL_USER_DECL;
static inline int zt_wait_event(int fd)
{
{
int res = -1;
int x;
- struct localuser *u;
+ struct ast_module_user *u;
struct zt_params ztp;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!strcasecmp(chan->tech->type, "Zap")) {
memset(&ztp, 0, sizeof(ztp));
res = ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp);
ast_log(LOG_WARNING, "Unable to get parameters of %s: %s\n", chan->name, strerror(errno));
} else
ast_log(LOG_WARNING, "%s is not a Zap channel\n", chan->name);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, flash_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Flash zap trunk application";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Flash channel application");
" s - Playback the incoming status message prior to starting the follow-me step(s)\n"
" a - Record the caller's name so it can be announced to the callee on each step\n"
" n - Playback the unreachable status message if we've run out of steps to reach the\n"
-" or the callee has elected not to be reachable.\n"
-
-
-LOCAL_USER_DECL;
+" or the callee has elected not to be reachable.\n";
struct number {
char number[512]; /*!< Phone Number(s) and/or Extension(s) */
struct ast_call_followme *f;
struct number *nm, *newnm;
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
char *argstr;
char namerecloc[255];
int duration = 0;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
AST_STANDARD_APP_ARGS(args, argstr);
}
outrun:
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
+
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct ast_call_followme *f;
- STANDARD_HANGUP_LOCALUSERS;
+
+ ast_module_user_hangup_all();
+
ast_unregister_application(app);
+
/* Free Memory. Yeah! I'm free! */
AST_LIST_LOCK(&followmes);
- AST_LIST_TRAVERSE_SAFE_BEGIN(&followmes, f, entry) {
+ while ((f = AST_LIST_REMOVE_HEAD(&followmes, entry))) {
free_numbers(f);
- AST_LIST_REMOVE_CURRENT(&followmes, entry);
free(f);
}
- AST_LIST_TRAVERSE_SAFE_END
+
AST_LIST_UNLOCK(&followmes);
+
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
reload_followme();
- return ast_register_application(app, app_exec, synopsis, descrip);
-}
-static const char *description(void)
-{
- return "Find-Me/Follow-Me Application";
+ return ast_register_application(app, app_exec, synopsis, descrip);
}
-static int reload(void *mod)
+static int reload(void)
{
reload_followme();
- return 0;
-}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
+ return 0;
}
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Find-Me/Follow-Me Application",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
"cdr record starting from the time of the fork call\n"
"If the option 'v' is passed all cdr variables will be passed along also.\n";
-LOCAL_USER_DECL;
static void ast_cdr_fork(struct ast_channel *chan)
{
static int forkcdr_exec(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
if (!chan->cdr) {
ast_log(LOG_WARNING, "Channel does not have a CDR\n");
return 0;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!ast_strlen_zero(data))
ast_set2_flag(chan->cdr, strchr(data, 'v'), AST_CDR_FLAG_KEEP_VARS);
ast_cdr_fork(chan);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, forkcdr_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Fork The CDR into 2 separate entities.";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Fork The CDR into 2 separate entities");
" GetCPEID: Obtains and displays ADSI CPE ID and other information in order\n"
"to properly setup zapata.conf for on-hook operations.\n";
-LOCAL_USER_DECL;
static int cpeid_setstatus(struct ast_channel *chan, char *stuff[], int voice)
{
static int cpeid_exec(struct ast_channel *chan, void *idata)
{
int res=0;
- struct localuser *u;
+ struct ast_module_user *u;
unsigned char cpeid[4];
int gotgeometry = 0;
int gotcpeid = 0;
char data[4][80];
char *stuff[4];
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
stuff[0] = data[0];
stuff[1] = data[1];
stuff[2] = data[2];
adsi_unload_session(chan);
}
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, cpeid_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Get ADSI CPE ID";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Get ADSI CPE ID");
" HASVMSTATUS The result of the new voicemail check returned as a text string as follows\n"
" <# of messages in the folder, 0 for NONE>\n";
-LOCAL_USER_DECL;
static int hasvoicemail_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
char *input, *varname = NULL, *vmbox, *context = "default";
char *vmfolder;
int vmcount = 0;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
input = ast_strdupa(data);
snprintf(tmp, sizeof(tmp), "%d", vmcount);
pbx_builtin_setvar_helper(chan, "HASVMSTATUS", tmp);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
static int acf_vmcount_exec(struct ast_channel *chan, char *cmd, char *argsstr, char *buf, size_t len)
{
- struct localuser *u;
+ struct ast_module_user *u;
char *context;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(vmbox);
AST_APP_ARG(folder);
);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
buf[0] = '\0';
snprintf(buf, len, "%d", ast_app_messagecount(context, args.vmbox, args.folder));
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
.read = acf_vmcount_exec,
};
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res |= ast_unregister_application(app_hasvoicemail);
res |= ast_unregister_application(app_hasnewvoicemail);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static const char *description(void)
-{
- return "Indicator for whether a voice mailbox has messages in a given folder.";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Indicator for whether a voice mailbox has messages in a given folder.");
"(available separately). A configuration file must be supplied\n"
"for ices (see examples/asterisk-ices.conf). \n";
-LOCAL_USER_DECL;
static int icesencode(char *filename, int fd)
{
static int ices_exec(struct ast_channel *chan, void *data)
{
int res=0;
- struct localuser *u;
+ struct ast_module_user *u;
int fds[2];
int ms = -1;
int pid = -1;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
last = ast_tv(0, 0);
if (pipe(fds)) {
ast_log(LOG_WARNING, "Unable to create pipe\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
flags = fcntl(fds[1], F_GETFL);
close(fds[0]);
close(fds[1]);
ast_log(LOG_WARNING, "Answer failed!\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
close(fds[0]);
close(fds[1]);
ast_log(LOG_WARNING, "Unable to set write format to signed linear\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if (((char *)data)[0] == '/')
if (!res && oreadformat)
ast_set_read_format(chan, oreadformat);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, ices_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Encode and Stream via icecast and ices";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Encode and Stream via icecast and ices");
#include "asterisk/app.h"
#include "asterisk/options.h"
-static char *tdesc = "Image Transmission Application";
-
static char *app = "SendImage";
static char *synopsis = "Send an image file";
" SENDIMAGESTATUS The status is the result of the attempt as a text string, one of\n"
" OK | NOSUPPORT \n";
-LOCAL_USER_DECL;
static int sendimage_exec(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
char *parse;
int priority_jump = 0;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(options);
);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
parse = ast_strdupa(data);
if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "NOSUPPORT");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
if (!res)
pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "OK");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, sendimage_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Image Transmission Application");
{ NULL },
});
-LOCAL_USER_DECL;
static int skel_exec(struct ast_channel *chan, void *data)
{
int res=0;
- struct localuser *u;
+ struct ast_module_user *u;
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "skel requires an argument (filename)\n");
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
/* Do our thing here */
if (!res)
res = ast_ivr_menu_run(chan, &ivr_demo, data);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, skel_exec, tdesc, synopsis);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
-
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "IVR Demo Application");
#include "asterisk/astdb.h"
#include "asterisk/options.h"
-static char *tdesc = "Look up Caller*ID name/number from blacklist database";
-
static char *app = "LookupBlacklist";
static char *synopsis = "Look up Caller*ID name/number from blacklist database";
" FOUND | NOTFOUND\n"
"Example: exten => 1234,1,LookupBlacklist()\n";
-LOCAL_USER_DECL;
static int blacklist_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
{
lookupblacklist_exec (struct ast_channel *chan, void *data)
{
char blacklist[1];
- struct localuser *u;
+ struct ast_module_user *u;
int bl = 0;
int priority_jump = 0;
static int dep_warning = 0;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!dep_warning) {
dep_warning = 1;
} else
pbx_builtin_setvar_helper(chan, "LOOKUPBLSTATUS", "NOTFOUND");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
res |= ast_custom_function_unregister(&blacklist_function);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = ast_custom_function_register(&blacklist_function);
res |= ast_register_application (app, lookupblacklist_exec, synopsis,descrip);
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Look up Caller*ID name/number from blacklist database");
#include "asterisk/callerid.h"
#include "asterisk/astdb.h"
-static char *tdesc = "Look up CallerID Name from local database";
-
static char *app = "LookupCIDName";
static char *synopsis = "Look up CallerID Name from local database";
"name delivery, or if you want to change the names on some incoming\n"
"calls.\n";
-LOCAL_USER_DECL;
-static int
-lookupcidname_exec (struct ast_channel *chan, void *data)
+static int lookupcidname_exec (struct ast_channel *chan, void *data)
{
- char dbname[64];
- struct localuser *u;
+ char dbname[64];
+ struct ast_module_user *u;
static int dep_warning = 0;
- LOCAL_USER_ADD (u);
+ u = ast_module_user_add(chan);
if (!dep_warning) {
dep_warning = 1;
ast_log(LOG_WARNING, "LookupCIDName is deprecated. Please use ${DB(cidname/${CALLERID(num)})} instead.\n");
}
- if (chan->cid.cid_num) {
- if (!ast_db_get ("cidname", chan->cid.cid_num, dbname, sizeof (dbname))) {
- ast_set_callerid (chan, NULL, dbname, NULL);
- if (option_verbose > 2)
- ast_verbose (VERBOSE_PREFIX_3 "Changed Caller*ID name to %s\n",
- dbname);
+ if (chan->cid.cid_num) {
+ if (!ast_db_get ("cidname", chan->cid.cid_num, dbname, sizeof (dbname))) {
+ ast_set_callerid (chan, NULL, dbname, NULL);
+ if (option_verbose > 2)
+ ast_verbose (VERBOSE_PREFIX_3 "Changed Caller*ID name to %s\n",
+ dbname);
+ }
}
- }
- LOCAL_USER_REMOVE (u);
- return 0;
+ ast_module_user_remove(u);
+
+ return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application (app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application (app, lookupcidname_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Look up CallerID Name from local database");
/* special result value used to force macro exit */
#define MACRO_EXIT_RESULT 1024
-static char *tdesc = "Extension Macros";
-
static char *descrip =
" Macro(macroname|arg1|arg2...): Executes a macro using the context\n"
"'macro-<macroname>', jumping to the 's' extension of that context and\n"
static char *exclusive_synopsis = "Exclusive Macro Implementation";
static char *exit_synopsis = "Exit From Macro";
-LOCAL_USER_DECL;
static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
{
char *save_macro_context;
char *save_macro_priority;
char *save_macro_offset;
- struct localuser *u;
+ struct ast_module_user *u;
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "Macro() requires arguments. See \"show application macro\" for help.\n");
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
/* does the user want a deeper rabbit hole? */
s = pbx_builtin_getvar_helper(chan, "MACRO_RECURSION");
sscanf(s, "%d", &depth);
if (depth >= maxdepth) {
ast_log(LOG_ERROR, "Macro(): possible infinite loop detected. Returning early.\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
snprintf(depthc, sizeof(depthc), "%d", depth + 1);
macro = strsep(&rest, "|");
if (ast_strlen_zero(macro)) {
ast_log(LOG_WARNING, "Invalid macro name specified\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
ast_log(LOG_WARNING, "No such context '%s' for macro '%s'\n", fullmacro, macro);
else
ast_log(LOG_WARNING, "Context '%s' for macro '%s' lacks 's' extension, priority 1\n", fullmacro, macro);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
if (ast_context_lockmacro(fullmacro)) {
ast_log(LOG_WARNING, "Failed to lock macro '%s' as in-use\n", fullmacro);
ast_autoservice_stop(chan);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
+
return 0;
}
ast_autoservice_stop(chan);
}
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
+
return res;
}
{
char *expr = NULL, *label_a = NULL, *label_b = NULL;
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!(expr = ast_strdupa(data))) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
} else
ast_log(LOG_WARNING, "Invalid Syntax.\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
return MACRO_EXIT_RESULT;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res |= ast_unregister_application(app);
res |= ast_unregister_application(exclusive_app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Extension Macros");
#include "enter.h"
#include "leave.h"
-LOCAL_USER_DECL;
-
#define CONFIG_FILE_NAME "meetme.conf"
/*! each buffer is 20ms, so this is 640ms total */
#define CONFIG_FILE_NAME "meetme.conf"
#define CONFIG_FILE_NAME_SLA "sla.conf"
-LOCAL_USER_DECL;
-
/*! \brief The MeetMe Conference object */
struct ast_conference {
ast_mutex_t playlock; /*!< Conference specific lock (players) */
/*! \brief The MeetmeCount application */
static int count_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
int res = 0;
struct ast_conference *conf;
int count;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!(localdata = ast_strdupa(data))) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
ast_answer(chan);
res = ast_say_number(chan, count, "", chan->language, (char *) NULL); /* Needs gender */
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int conf_exec(struct ast_channel *chan, void *data)
{
int res=-1;
- struct localuser *u;
+ struct ast_module_user *u;
char confno[AST_MAX_EXTENSION] = "";
int allowretry = 0;
int retrycnt = 0;
AST_APP_ARG(pin);
);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (ast_strlen_zero(data)) {
allowretry = 1;
}
} while (allowretry);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int sla_exec(struct ast_channel *chan, void *data, int trunk)
{
int res=-1;
- struct localuser *u;
+ struct ast_module_user *u;
char confno[AST_MAX_EXTENSION] = "";
struct ast_sla *sla;
struct ast_conference *cnf;
return -1;
}
- LOCAL_USER_ADD(u);
-
+ u = ast_module_user_add(chan);
if (args.options)
ast_app_parse_options(sla_opts, &confflags, NULL, args.options);
ast_log(LOG_WARNING, "SLA%c: SLA '%s' not found!\n", trunk ? 'T' : 'S', args.confno);
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
char *params;
struct ast_conference *cnf;
struct ast_conf_user *user = NULL;
- struct localuser *u;
+ struct ast_module_user *u;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(confno);
AST_APP_ARG(command);
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
AST_LIST_LOCK(&confs);
if (!args.command) {
ast_log(LOG_WARNING, "MeetmeAdmin requires a command!\n");
AST_LIST_UNLOCK(&confs);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
AST_LIST_TRAVERSE(&confs, cnf, list) {
if (!cnf) {
ast_log(LOG_WARNING, "Conference number '%s' not found!\n", args.confno);
- LOCAL_USER_REMOVE(u);
AST_LIST_UNLOCK(&confs);
+ ast_module_user_remove(u);
return 0;
}
AST_LIST_UNLOCK(&confs);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
load_config_sla();
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
- int res;
+ int res = 0;
- res = ast_cli_unregister(&cli_show_confs);
+ res |= ast_cli_unregister(&cli_show_confs);
res |= ast_cli_unregister(&cli_sla_show);
res |= ast_cli_unregister(&cli_conf);
res |= ast_manager_unregister("MeetmeMute");
res |= ast_unregister_application(appslas);
res |= ast_unregister_application(appslat);
+ ast_module_user_hangup_all();
ast_devstate_prov_del("Meetme");
ast_devstate_prov_del("SLA");
- STANDARD_HANGUP_LOCALUSERS;
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static int reload(void *mod)
+static int reload(void)
{
load_config();
return 0;
}
-static const char *description(void)
-{
- return "MeetMe conference bridge";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "MeetMe conference bridge",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
static char *descrip =
"Milliwatt(): Generate a Constant 1000Hz tone at 0dbm (mu-law)\n";
-LOCAL_USER_DECL;
static char digital_milliwatt[] = {0x1e,0x0b,0x0b,0x1e,0x9e,0x8b,0x8b,0x9e} ;
static int milliwatt_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
- LOCAL_USER_ADD(u);
+ struct ast_module_user *u;
+ u = ast_module_user_add(chan);
ast_set_write_format(chan, AST_FORMAT_ULAW);
ast_set_read_format(chan, AST_FORMAT_ULAW);
if (chan->_state != AST_STATE_UP)
if (ast_activate_generator(chan,&milliwattgen,"milliwatt") < 0)
{
ast_log(LOG_WARNING,"Failed to activate generator on '%s'\n",chan->name);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
while(!ast_safe_sleep(chan, 10000));
ast_deactivate_generator(chan);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, milliwatt_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Digital Milliwatt (mu-law) Test Application";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Digital Milliwatt (mu-law) Test Application");
struct mixmonitor *mixmonitor = obj;
struct ast_frame *f = NULL;
- ast_atomic_fetchadd_int(&__mod_desc->usecnt, +1);
if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "Begin MixMonitor Recording %s\n", mixmonitor->name);
free(mixmonitor);
- ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1);
return NULL;
}
static int mixmonitor_exec(struct ast_channel *chan, void *data)
{
int x, readvol = 0, writevol = 0;
- struct localuser *u;
+ struct ast_module_user *u;
struct ast_flags flags = {0};
char *parse;
AST_DECLARE_APP_ARGS(args,
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
parse = ast_strdupa(data);
if (ast_strlen_zero(args.filename)) {
ast_log(LOG_WARNING, "MixMonitor requires an argument (filename)\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
pbx_builtin_setvar_helper(chan, "MIXMONITOR_FILENAME", args.filename);
launch_monitor_thread(chan, args.filename, flags.flags, readvol, writevol, args.post_process);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
static int stop_mixmonitor_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
ast_channel_lock(chan);
ast_channel_spy_stop_by_type(chan, mixmonitor_spy_type);
ast_channel_unlock(chan);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
complete_mixmonitor_cli
};
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res |= ast_unregister_application(stop_app);
res |= ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static const char *description(void)
-{
- return "Mixed Audio Monitoring Application";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Mixed Audio Monitoring Application");
#include "asterisk/module.h"
#include "asterisk/indications.h"
-static char *tdesc = "Morse code";
-
static char *app_morsecode = "Morsecode";
static char *morsecode_synopsis = "Plays morse code";
"(defaults to 80). Additionally, if MORSETONE is set, it will use that tone\n"
"(in Hz). The tone default is 800.\n";
-LOCAL_USER_DECL;
static char *morsecode[] = {
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /* 0-15 */
int res=0, ditlen, tone;
char *digit;
const char *ditlenc, *tonec;
- struct localuser *u;
+ struct ast_module_user *u;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "Syntax: Morsecode(<string>) - no argument found\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
playtone(chan, 0, 2 * ditlen);
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app_morsecode);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app_morsecode, morsecode_exec, morsecode_synopsis, morsecode_descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Morse code");
#define LOCAL_MPG_123 "/usr/local/bin/mpg123"
#define MPG_123 "/usr/bin/mpg123"
-static char *tdesc = "Silly MP3 Application";
-
static char *app = "MP3Player";
static char *synopsis = "Play an MP3 file or stream";
"which typically would be a filename or a URL. User can exit by pressing\n"
"any key on the dialpad, or by hanging up.";
-LOCAL_USER_DECL;
static int mp3play(char *filename, int fd)
{
static int mp3_exec(struct ast_channel *chan, void *data)
{
int res=0;
- struct localuser *u;
+ struct ast_module_user *u;
int fds[2];
int ms = -1;
int pid = -1;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (pipe(fds)) {
ast_log(LOG_WARNING, "Unable to create pipe\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
res = ast_set_write_format(chan, AST_FORMAT_SLINEAR);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to set write format to signed linear\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if (!res && owriteformat)
ast_set_write_format(chan, owriteformat);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, mp3_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Silly MP3 Application");
#define AF_LOCAL AF_UNIX
#endif
-static char *tdesc = "Silly NBS Stream Application";
-
static char *app = "NBScat";
static char *synopsis = "Play an NBS local stream";
" NBScat: Executes nbscat to listen to the local NBS stream.\n"
"User can exit by pressing any key\n.";
-LOCAL_USER_DECL;
static int NBScatplay(int fd)
{
static int NBScat_exec(struct ast_channel *chan, void *data)
{
int res=0;
- struct localuser *u;
+ struct ast_module_user *u;
int fds[2];
int ms = -1;
int pid = -1;
short frdata[160];
} myf;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (socketpair(AF_LOCAL, SOCK_STREAM, 0, fds)) {
ast_log(LOG_WARNING, "Unable to create socketpair\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
res = ast_set_write_format(chan, AST_FORMAT_SLINEAR);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to set write format to signed linear\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if (!res && owriteformat)
ast_set_write_format(chan, owriteformat);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, NBScat_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Silly NBS Stream Application");
static int ospauth_exec(struct ast_channel* chan, void* data)
{
int res;
- struct localuser* u;
+ struct ast_module_user *u;
const char* provider = OSP_DEF_PROVIDER;
int priority_jump = 0;
- struct varshead* headp;
- struct ast_var_t* current;
- const char* source = "";
- const char* token = "";
+ struct varshead *headp;
+ struct ast_var_t *current;
+ const char *source = "";
+ const char *token = "";
int handle;
unsigned int timelimit;
char buffer[OSP_INTSTR_SIZE];
- const char* status;
- char* tmp;
+ const char *status;
+ char *tmp;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(provider);
AST_APP_ARG(options);
);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!(tmp = ast_strdupa(data))) {
ast_log(LOG_ERROR, "Out of memory\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
res = 0;
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int osplookup_exec(struct ast_channel* chan, void* data)
{
int res, cres;
- struct localuser* u;
- const char* provider = OSP_DEF_PROVIDER;
+ struct ast_module_user *u;
+ const char *provider = OSP_DEF_PROVIDER;
int priority_jump = 0;
- struct varshead* headp;
+ struct varshead *headp;
struct ast_var_t* current;
- const char* srcdev = "";
+ const char *srcdev = "";
char buffer[OSP_TOKSTR_SIZE];
struct osp_result result;
- const char* status;
- char* tmp;
+ const char *status;
+ char *tmp;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(exten);
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!(tmp = ast_strdupa(data))) {
ast_log(LOG_ERROR, "Out of memory\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
ast_log(LOG_DEBUG, "OSPLookup: source device '%s'\n", srcdev);
if ((cres = ast_autoservice_start(chan)) < 0) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
}
if ((cres = ast_autoservice_stop(chan)) < 0) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
res = 0;
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int ospnext_exec(struct ast_channel* chan, void* data)
{
int res;
- struct localuser* u;
+ struct ast_module_user *u;
int priority_jump = 0;
int cause = 0;
struct varshead* headp;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!(tmp = ast_strdupa(data))) {
ast_log(LOG_ERROR, "Out of memory\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
res = 0;
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int ospfinished_exec(struct ast_channel* chan, void* data)
{
int res = 1;
- struct localuser* u;
+ struct ast_module_user *u;
int priority_jump = 0;
int cause = 0;
- struct varshead* headp;
- struct ast_var_t* current;
+ struct varshead *headp;
+ struct ast_var_t *current;
int inhandle = OSP_INVALID_HANDLE;
int outhandle = OSP_INVALID_HANDLE;
int recorded = 0;
time_t start, connect, end;
unsigned int release;
char buffer[OSP_INTSTR_SIZE];
- const char* status;
- char* tmp;
+ const char *status;
+ char *tmp;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(cause);
AST_APP_ARG(options);
);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!(tmp = ast_strdupa(data))) {
ast_log(LOG_ERROR, "Out of memory\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
res = 0;
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
osp_usage
};
-LOCAL_USER_DECL;
-
-static int load_module(void* mod)
+static int load_module(void)
{
int res;
return res;
}
-static int unload_module(void* mod)
+static int unload_module(void)
{
int res;
res |= ast_cli_unregister(&osp_cli);
osp_unload();
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int reload(void* mod)
+static int reload(void)
{
osp_unload();
osp_load();
- return 0;
-}
-static const char* description(void)
-{
- return "Open Settlement Protocol Applications";
-}
-
-static const char* key(void)
-{
- return ASTERISK_GPL_KEY;
+ return 0;
}
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Open Settlement Protocol Applications",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
" q - quiet, do not play beep to caller\n"
" r - record the page into a file (see 'r' for app_meetme)\n";
-LOCAL_USER_DECL;
enum {
PAGE_DUPLEX = (1 << 0),
static int page_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
char *options;
char *tech, *resource;
char meetmeopts[80];
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!(app = pbx_findapp("MeetMe"))) {
ast_log(LOG_WARNING, "There is no MeetMe application available!\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
};
pbx_exec(chan, app, meetmeopts);
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app_page);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app_page, page_exec, page_synopsis, page_descrip);
}
-static const char *description(void)
-{
- return "Page Multiple Phones";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Page Multiple Phones");
#include "asterisk/lock.h"
#include "asterisk/utils.h"
-static char *tdesc = "Call Parking and Announce Application";
-
static char *app = "ParkAndAnnounce";
static char *synopsis = "Park and Announce";
"call was placed. Use with the Local channel to allow the dialplan to make\n"
"use of this information.\n";
-LOCAL_USER_DECL;
static int parkandannounce_exec(struct ast_channel *chan, void *data)
{
struct outgoing_helper oh;
int outstate;
- struct localuser *u;
+ struct ast_module_user *u;
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "ParkAndAnnounce requires arguments: (announce:template|timeout|dial|[return_context])\n");
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
l=strlen(data)+2;
if (!(orig_s = ast_malloc(l))) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
s=orig_s;
if(! template) {
ast_log(LOG_WARNING, "PARK: An announce template must be defined\n");
free(orig_s);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if(!dial) {
ast_log(LOG_WARNING, "PARK: A dial resource must be specified i.e: Console/dsp or Zap/g1/5551212\n");
free(orig_s);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
} else {
dialtech=strsep(&dial, "/");
if(atoi(priority) < 0) {
ast_log(LOG_WARNING, "Priority '%s' must be a number > 0\n", priority);
free(orig_s);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
/* At this point we have a priority and maybe an extension and a context */
ast_log(LOG_WARNING, "PARK: Channel %s was never answered for the announce.\n", dchan->name);
ast_hangup(dchan);
free(orig_s);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
} else {
ast_log(LOG_WARNING, "PARK: Unable to allocate announce channel.\n");
free(orig_s);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
ast_hangup(dchan);
free(orig_s);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
/* return ast_register_application(app, park_exec); */
return ast_register_application(app, parkandannounce_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Call Parking and Announce Application");
#include "asterisk/localtime.h"
#include "asterisk/say.h"
-static char *tdesc = "Sound File Playback Application";
-
static char *app = "Playback";
static char *synopsis = "Play a file";
" SUCCESS | FAILED\n"
;
-LOCAL_USER_DECL;
static struct ast_config *say_cfg;
/* save the say' api calls.
static int playback_exec(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
char *tmp;
int option_skip=0;
int option_say=0;
tmp = ast_strdupa(data);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
AST_STANDARD_APP_ARGS(args, tmp);
if (args.options) {
pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", mres ? "FAILED" : "SUCCESS");
}
done:
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int reload(void *mod)
+static int reload(void)
{
if (say_cfg) {
ast_config_destroy(say_cfg);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
if (say_cfg)
ast_config_destroy(say_cfg);
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
- reload(mod);
+ reload();
ast_cli_register_multiple(myclis, sizeof(myclis)/sizeof(struct ast_cli_entry));
return ast_register_application(app, playback_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1,reload,NULL,NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Sound File Playback Application",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
#define PRIV_CONFIG "privacy.conf"
-static char *tdesc = "Require phone number to be entered, if no CallerID sent";
-
static char *app = "PrivacyManager";
static char *synopsis = "Require phone number to be entered, if no CallerID sent";
" SUCCESS | FAILED \n"
;
-LOCAL_USER_DECL;
static int privacy_exec (struct ast_channel *chan, void *data)
{
int x = 0;
char *s;
char phone[30];
- struct localuser *u;
+ struct ast_module_user *u;
struct ast_config *cfg = NULL;
char *parse = NULL;
int priority_jump = 0;
AST_APP_ARG(options);
);
- LOCAL_USER_ADD (u);
+ u = ast_module_user_add(chan);
+
if (!ast_strlen_zero(chan->cid.cid_num)) {
if (option_verbose > 2)
ast_verbose (VERBOSE_PREFIX_3 "CallerID Present: Skipping\n");
if (chan->_state != AST_STATE_UP) {
res = ast_answer(chan);
if (res) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
}
- if (!ast_strlen_zero((char *)data))
- {
+ if (!ast_strlen_zero(data)) {
parse = ast_strdupa(data);
AST_STANDARD_APP_ARGS(args, parse);
ast_config_destroy(cfg);
}
- LOCAL_USER_REMOVE (u);
- return 0;
+ ast_module_user_remove(u);
+
+ return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application (app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application (app, privacy_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Require phone number to be entered, if no CallerID sent");
#define RES_OUTOFMEMORY (-2) /* Out of memory */
#define RES_NOSUCHQUEUE (-3) /* No such queue */
-static char *tdesc = "True Call Queueing";
-
static char *app = "Queue";
static char *synopsis = "Queue a call for a call queue";
struct member *member;
};
-LOCAL_USER_DECL;
struct queue_ent {
struct call_queue *parent; /*!< What queue is our parent */
static int pqm_exec(struct ast_channel *chan, void *data)
{
- struct localuser *lu;
+ struct ast_module_user *lu;
char *parse;
int priority_jump = 0;
AST_DECLARE_APP_ARGS(args,
AST_STANDARD_APP_ARGS(args, parse);
- LOCAL_USER_ADD(lu);
+ lu = ast_module_user_add(chan);
if (args.options) {
if (strchr(args.options, 'j'))
if (ast_strlen_zero(args.interface)) {
ast_log(LOG_WARNING, "Missing interface argument to PauseQueueMember ([queuename]|interface[|options])\n");
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
return -1;
}
if (priority_jump || ast_opt_priority_jumping) {
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
pbx_builtin_setvar_helper(chan, "PQMSTATUS", "NOTFOUND");
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
return 0;
}
}
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
pbx_builtin_setvar_helper(chan, "PQMSTATUS", "NOTFOUND");
return -1;
}
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
pbx_builtin_setvar_helper(chan, "PQMSTATUS", "PAUSED");
return 0;
static int upqm_exec(struct ast_channel *chan, void *data)
{
- struct localuser *lu;
+ struct ast_module_user *lu;
char *parse;
int priority_jump = 0;
AST_DECLARE_APP_ARGS(args,
AST_STANDARD_APP_ARGS(args, parse);
- LOCAL_USER_ADD(lu);
+ lu = ast_module_user_add(chan);
if (args.options) {
if (strchr(args.options, 'j'))
if (ast_strlen_zero(args.interface)) {
ast_log(LOG_WARNING, "Missing interface argument to PauseQueueMember ([queuename]|interface[|options])\n");
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
return -1;
}
if (priority_jump || ast_opt_priority_jumping) {
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
pbx_builtin_setvar_helper(chan, "UPQMSTATUS", "NOTFOUND");
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
return 0;
}
}
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
pbx_builtin_setvar_helper(chan, "UPQMSTATUS", "NOTFOUND");
return -1;
}
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
pbx_builtin_setvar_helper(chan, "UPQMSTATUS", "UNPAUSED");
return 0;
static int rqm_exec(struct ast_channel *chan, void *data)
{
int res=-1;
- struct localuser *lu;
+ struct ast_module_user *lu;
char *parse, *temppos = NULL;
int priority_jump = 0;
AST_DECLARE_APP_ARGS(args,
AST_STANDARD_APP_ARGS(args, parse);
- LOCAL_USER_ADD(lu);
+ lu = ast_module_user_add(chan);
if (ast_strlen_zero(args.interface)) {
args.interface = ast_strdupa(chan->name);
break;
}
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
return res;
}
static int aqm_exec(struct ast_channel *chan, void *data)
{
int res=-1;
- struct localuser *lu;
+ struct ast_module_user *lu;
char *parse, *temppos = NULL;
int priority_jump = 0;
AST_DECLARE_APP_ARGS(args,
AST_STANDARD_APP_ARGS(args, parse);
- LOCAL_USER_ADD(lu);
+ lu = ast_module_user_add(chan);
if (ast_strlen_zero(args.interface)) {
args.interface = ast_strdupa(chan->name);
break;
}
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
return res;
}
static int ql_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
char *parse;
AST_DECLARE_APP_ARGS(args,
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
parse = ast_strdupa(data);
if (ast_strlen_zero(args.queuename) || ast_strlen_zero(args.uniqueid)
|| ast_strlen_zero(args.peer) || ast_strlen_zero(args.event)) {
ast_log(LOG_WARNING, "QueueLog requires arguments (queuename|uniqueid|peer|event[|additionalinfo])\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
ast_queue_log(args.queuename, args.uniqueid, args.peer, args.event,
"%s", args.params ? args.params : "");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
{
int res=-1;
int ringing=0;
- struct localuser *lu;
+ struct ast_module_user *lu;
const char *user_priority;
const char *max_penalty_str;
int prio;
parse = ast_strdupa(data);
AST_STANDARD_APP_ARGS(args, parse);
- LOCAL_USER_ADD(lu);
+ lu = ast_module_user_add(chan);
/* Setup our queue entry */
memset(&qe, 0, sizeof(qe));
set_queue_result(chan, reason);
res = 0;
}
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
return res;
}
{
int count = 0;
struct call_queue *q;
- struct localuser *lu;
+ struct ast_module_user *lu;
struct member *m;
buf[0] = '\0';
return -1;
}
- LOCAL_USER_ADD(lu);
+ lu = ast_module_user_add(chan);
AST_LIST_LOCK(&queues);
AST_LIST_TRAVERSE(&queues, q, list) {
ast_log(LOG_WARNING, "queue %s was not found\n", data);
snprintf(buf, len, "%d", count);
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
return 0;
}
{
int count = 0;
struct call_queue *q;
- struct localuser *lu;
+ struct ast_module_user *lu;
buf[0] = '\0';
return -1;
}
- LOCAL_USER_ADD(lu);
+ lu = ast_module_user_add(chan);
AST_LIST_LOCK(&queues);
AST_LIST_TRAVERSE(&queues, q, list) {
ast_log(LOG_WARNING, "queue %s was not found\n", data);
snprintf(buf, len, "%d", count);
- LOCAL_USER_REMOVE(lu);
+ ast_module_user_remove(lu);
return 0;
}
static int queue_function_queuememberlist(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
{
- struct localuser *u;
+ struct ast_module_user *u;
struct call_queue *q;
struct member *m;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
AST_LIST_LOCK(&queues);
AST_LIST_TRAVERSE(&queues, q, list) {
/* We should already be terminated, but let's make sure. */
buf[len - 1] = '\0';
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
{ "remove", "queue", "member", NULL }, handle_remove_queue_member,
"Removes a channel from a specified queue", rqm_cmd_usage, complete_remove_queue_member };
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res |= ast_custom_function_unregister(&queuewaitingcount_function);
res |= ast_unregister_application(app);
- clear_and_free_interfaces();
+ ast_module_user_hangup_all();
- STANDARD_HANGUP_LOCALUSERS;
+ clear_and_free_interfaces();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static int reload(void *mod)
+static int reload(void)
{
reload_queues();
return 0;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "True Call Queueing",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
/*! \todo The Random() app should be removed from trunk following the release of 1.4 */
-static char *tdesc = "Random goto";
-
static char *app_random = "Random";
static char *random_synopsis = "Conditionally branches, based upon a probability";
" probability := INTEGER in the range 1 to 100\n"
"DEPRECATED: Use GotoIf($[${RAND(1,100)} > <number>]?<label>)\n";
-LOCAL_USER_DECL;
static int random_exec(struct ast_channel *chan, void *data)
{
int res=0;
- struct localuser *u;
+ struct ast_module_user *u;
char *s;
char *prob;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
s = ast_strdupa(data);
ast_verbose( VERBOSE_PREFIX_3 "Random branches to (%s,%s,%d)\n",
chan->context,chan->exten, chan->priority+1);
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app_random);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app_random, random_exec, random_synopsis, random_descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Random goto");
AST_APP_OPTION('n', OPT_NOANSWER),
});
-static char *tdesc = "Read Variable Application";
-
static char *app = "Read";
static char *synopsis = "Read a variable";
" timeout -- if greater than 0, that value will override the default timeout.\n\n"
"Read should disconnect if the function fails or errors out.\n";
-LOCAL_USER_DECL;
#define ast_next_data(instr,ptr,delim) if((ptr=strchr(instr,delim))) { *(ptr) = '\0' ; ptr++;}
static int read_exec(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
char tmp[256];
int maxdigits=255;
int tries = 1;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
argcopy = ast_strdupa(data);
}
if (ast_strlen_zero(arglist.variable)) {
ast_log(LOG_WARNING, "Invalid! Usage: Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])\n\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
ts=NULL;
if (ast_test_flag(&flags,OPT_SKIP)) {
/* At the user's option, skip if the line is not up */
pbx_builtin_setvar_helper(chan, arglist.variable, "\0");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
} else if (!ast_test_flag(&flags,OPT_NOANSWER)) {
/* Otherwise answer unless we're supposed to read while on-hook */
}
}
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, read_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Read Variable Application");
#include "asterisk/app.h"
#include "asterisk/module.h"
-static char *tdesc = "Stores output of file into a variable";
-
static char *app_readfile = "ReadFile";
static char *readfile_synopsis = "ReadFile(varname=file,length)";
" File - The name of the file to read.\n"
" Length - Maximum number of characters to capture.\n";
-LOCAL_USER_DECL;
static int readfile_exec(struct ast_channel *chan, void *data)
{
int res=0;
- struct localuser *u;
+ struct ast_module_user *u;
char *s, *varname=NULL, *file=NULL, *length=NULL, *returnvar=NULL;
int len=0;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
s = ast_strdupa(data);
if (!varname || !file) {
ast_log(LOG_ERROR, "No file or variable specified!\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
pbx_builtin_setvar_helper(chan, varname, returnvar);
free(returnvar);
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app_readfile);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app_readfile, readfile_exec, readfile_synopsis, readfile_descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Stores output of file into a variable");
#define next_one(var) var = var->next
#define crop_data(str) { *(str) = '\0' ; (str)++; }
-static char *tdesc = "Realtime Data Lookup/Rewrite";
static char *app = "RealTime";
static char *uapp = "RealTimeUpdate";
static char *synopsis = "Realtime Data Lookup";
"updated to <newval>. REALTIMECOUNT will be set with the number of rows\n"
"updated or -1 if an error occurs.\n";
-LOCAL_USER_DECL;
static int cli_load_realtime(int fd, int argc, char **argv)
{
static int realtime_update_exec(struct ast_channel *chan, void *data)
{
char *family=NULL, *colmatch=NULL, *value=NULL, *newcol=NULL, *newval=NULL;
- struct localuser *u;
+ struct ast_module_user *u;
int res = 0, count = 0;
char countc[13];
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
family = ast_strdupa(data);
if ((colmatch = strchr(family,'|'))) {
snprintf(countc, sizeof(countc), "%d", count);
pbx_builtin_setvar_helper(chan, "REALTIMECOUNT", countc);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int realtime_exec(struct ast_channel *chan, void *data)
{
int res=0, count=0;
- struct localuser *u;
+ struct ast_module_user *u;
struct ast_variable *var, *itt;
char *family=NULL, *colmatch=NULL, *value=NULL, *prefix=NULL, *vname=NULL;
char countc[13];
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
family = ast_strdupa(data);
if ((colmatch = strchr(family,'|'))) {
snprintf(countc, sizeof(countc), "%d", count);
pbx_builtin_setvar_helper(chan, "REALTIMECOUNT", countc);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res |= ast_unregister_application(uapp);
res |= ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Realtime Data Lookup/Rewrite");
"If the user should hangup during a recording, all data will be lost and the\n"
"application will teminate. \n";
-LOCAL_USER_DECL;
static int record_exec(struct ast_channel *chan, void *data)
{
char tmp[256];
struct ast_filestream *s = '\0';
- struct localuser *u;
+ struct ast_module_user *u;
struct ast_frame *f = NULL;
struct ast_dsp *sildet = NULL; /* silence detector dsp */
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
/* Yay for strsep being easy */
vdata = ast_strdupa(data);
}
if (!ext) {
ast_log(LOG_WARNING, "No extension specified to filename!\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if (silstr) {
if (chan->_state != AST_STATE_UP) {
if (option_skip) {
/* At the user's option, skip if the line is not up */
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
} else if (!option_noanswer) {
/* Otherwise answer unless we're supposed to record while on-hook */
res = ast_set_read_format(chan, AST_FORMAT_SLINEAR);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to set to linear mode, giving up\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
sildet = ast_dsp_new();
if (!sildet) {
ast_log(LOG_WARNING, "Unable to create silence detector :(\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
ast_dsp_set_threshold(sildet, 256);
ast_dsp_free(sildet);
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, record_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Trivial Record Application";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Trivial Record Application");
-/* #define OLD_ASTERISK */
/*
* Asterisk -- An open source telephony toolkit.
*
#include "asterisk/say.h"
#include "asterisk/localtime.h"
-static char *tdesc = "Radio Repeater / Remote Base version 0.48 06/13/2006";
-
static char *app = "Rpt";
static char *synopsis = "Radio Repeater/Remote Base Control System";
" available to the phone user.\n"
"\n";
+static unsigned int vmajor = 0;
+static unsigned int vminor = 47;
+
static int debug = 0; /* FIXME Set this >0 for extra debug output */
static int nrpts = 0;
STANDARD_LOCAL_USER;
#endif
-LOCAL_USER_DECL;
#define MSWAIT 200
#define HANGTIME 5000
struct rpt *myrpt;
struct rpt_link *l,*m,linkbase;
struct ast_channel *mychannel;
-int vmajor, vminor;
char *p,*ct,*ct_copy,*ident, *nodename;
time_t t;
struct tm localtm;
imdone = 1;
break;
case STATS_VERSION:
- p = strstr(tdesc, "version");
- if(!p)
- break;
- if(sscanf(p, "version %d.%d", &vmajor, &vminor) != 2)
- break;
wait_interval(myrpt, DLY_TELEM, mychannel); /* Wait a little bit */
/* Say "version" */
if (sayfile(mychannel,"rpt/version") == -1)
static int rpt_exec(struct ast_channel *chan, void *data)
{
int res=-1,i,rem_totx,n,phone_mode = 0;
- struct localuser *u;
+ struct ast_module_user *u;
char tmp[256], keyed = 0;
char *options,*stringp,*tele,c;
struct rpt *myrpt;
ast_log(LOG_WARNING, "Cant get io permission on IO port %x hex\n",myrpt->p.iobase);
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
rpt_mutex_unlock(&myrpt->lock);
/* find our index, and load the vars initially */
for(i = 0; i < nrpts; i++)
myrpt->remoteon = 0;
rpt_mutex_unlock(&myrpt->lock);
closerem(myrpt);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-#ifdef OLD_ASTERISK
-int unload_module()
-#else
-static int unload_module(void* mod)
-#endif
+static int unload_module(void)
{
int i;
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
for(i = 0; i < nrpts; i++) {
if (!strcmp(rpt_vars[i].name,rpt_vars[i].p.nodes)) continue;
ast_mutex_destroy(&rpt_vars[i].lock);
return i;
}
-#ifdef OLD_ASTERISK
-int load_module()
-#else
-static int load_module(void *mod)
-#endif
+static int load_module(void)
{
ast_pthread_create(&rpt_master_thread,NULL,rpt_master,NULL);
return ast_register_application(app, rpt_exec, synopsis, descrip);
}
-#ifdef OLD_ASTERISK
-char *description()
-#else
-static const char *description(void)
-#endif
-{
- return tdesc;
-}
-
-#ifdef OLD_ASTERISK
-int usecount(void)
-{
- int res;
- STANDARD_USECOUNT(res);
- return res;
-}
-#endif
-
-#ifdef OLD_ASTERISK
-char *key()
-#else
-static const char *key(void)
-#endif
+static int reload(void)
{
- return ASTERISK_GPL_KEY;
-}
-
-#ifdef OLD_ASTERISK
-int reload()
-#else
-static int reload(void *mod)
-#endif
-{
-int n;
+ int n;
for(n = 0; n < nrpts; n++) rpt_vars[n].reload = 1;
return(0);
}
-#ifndef OLD_ASTERISK
-STD_MOD(MOD_1, reload, NULL, NULL);
-#endif
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Radio Repeater / Remote Base",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
#include "asterisk/say.h"
#include "asterisk/app.h"
-static char *tdesc = "Say time";
-
static char *app_sayunixtime = "SayUnixTime";
static char *app_datetime = "DateTime";
" format: a format the time is to be said in. See voicemail.conf.\n"
" defaults to \"ABdY 'digits/at' IMp\"\n";
-LOCAL_USER_DECL;
static int sayunixtime_exec(struct ast_channel *chan, void *data)
{
);
char *parse;
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
time_t unixtime;
if (!data)
parse = ast_strdupa(data);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
AST_STANDARD_APP_ARGS(args, parse);
res = ast_say_date_with_format(chan, unixtime, AST_DIGIT_ANY,
chan->language, args.format, args.timezone);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app_sayunixtime);
res |= ast_unregister_application(app_datetime);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Say time");
#include "asterisk/app.h"
#include "asterisk/manager.h"
-static char *tdesc = "Send DTMF digits Application";
-
static char *app = "SendDTMF";
static char *synopsis = "Sends arbitrary DTMF digits";
" The application will either pass the assigned digits or terminate if it\n"
" encounters an error.\n";
-LOCAL_USER_DECL;
static int senddtmf_exec(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
char *digits = NULL, *to = NULL;
int timeout = 250;
return 0;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
digits = ast_strdupa(data);
res = ast_dtmf_stream(chan,NULL,digits,timeout);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
res |= ast_manager_unregister("PlayDTMF");
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Send DTMF digits Application");
"'j' -- jump to n+101 priority if the channel doesn't support\n"
" text transport\n";
-LOCAL_USER_DECL;
static int sendtext_exec(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
char *status = "UNSUPPORTED";
char *parse = NULL;
int priority_jump = 0;
AST_APP_ARG(options);
);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "SendText requires an argument (text[|options])\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
} else
parse = ast_strdupa(data);
/* Does not support transport */
if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
status = "FAILURE";
if (!res)
status = "SUCCESS";
pbx_builtin_setvar_helper(chan, "SENDTEXTSTATUS", status);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, sendtext_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Send Text Applications";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Send Text Applications");
static char *synopsis2 = "Set CallerID Presentation";
-LOCAL_USER_DECL;
static char *descrip2 =
" SetCallerPres(presentation): Set Caller*ID presentation on a call.\n"
static int setcallerid_pres_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
int pres = -1;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
pres = ast_parse_caller_presentation(data);
if (pres < 0) {
ast_log(LOG_WARNING, "'%s' is not a valid presentation (see 'show application SetCallerPres')\n",
(char *) data);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
chan->cid.cid_pres = pres;
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
-
-
-static char *tdesc = "Set CallerID Application";
-
static char *app = "SetCallerID";
static char *synopsis = "Set CallerID";
char *tmp = NULL;
char name[256];
char num[256];
- struct localuser *u;
+ struct ast_module_user *u;
char *opt;
int anitoo = 0;
static int dep_warning = 0;
return 0;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!dep_warning) {
dep_warning = 1;
ast_callerid_split(tmp, name, sizeof(name), num, sizeof(num));
ast_set_callerid(chan, num, name, anitoo ? num : NULL);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app2);
res |= ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Set CallerID Application");
#include "asterisk/utils.h"
-static char *tdesc = "CDR user field apps";
-
static char *setcdruserfield_descrip =
"[Synopsis]\n"
"SetCDRUserField(value)\n\n"
static char *appendcdruserfield_app = "AppendCDRUserField";
static char *appendcdruserfield_synopsis = "Append to the CDR user field";
-LOCAL_USER_DECL;
static int action_setcdruserfield(struct mansession *s, struct message *m)
{
static int setcdruserfield_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
int res = 0;
static int dep_warning = 0;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (chan->cdr && data) {
ast_cdr_setuserfield(chan, (char*)data);
ast_log(LOG_WARNING, "SetCDRUserField is deprecated. Please use CDR(userfield) instead.\n");
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int appendcdruserfield_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
int res = 0;
static int dep_warning = 0;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (chan->cdr && data) {
ast_cdr_appenduserfield(chan, (char*)data);
ast_log(LOG_WARNING, "AppendCDRUserField is deprecated. Please use CDR(userfield) instead.\n");
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res |= ast_unregister_application(appendcdruserfield_app);
res |= ast_manager_unregister("SetCDRUserField");
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "CDR user field apps");
static char *synopsis = "Set ISDN Transfer Capability";
-LOCAL_USER_DECL;
static struct { int val; char *name; } transcaps[] = {
{ AST_TRANS_CAP_SPEECH, "SPEECH" },
static int settransfercapability_exec(struct ast_channel *chan, void *data)
{
char *tmp = NULL;
- struct localuser *u;
+ struct ast_module_user *u;
int x;
char *opts;
int transfercapability = -1;
static int dep_warning = 0;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!dep_warning) {
dep_warning = 1;
}
if (transfercapability < 0) {
ast_log(LOG_WARNING, "'%s' is not a valid transfer capability (see 'show application SetTransferCapability')\n", tmp);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Setting transfer capability to: 0x%.2x - %s.\n", transfercapability, tmp);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, settransfercapability_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return synopsis;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Set ISDN Transfer Capability");
AST_APP_OPTION_ARG('c', OPTION_C, OPTION_ARG_C),
});
-LOCAL_USER_DECL;
static int app_exec(struct ast_channel *chan, void *data)
{
int res = 0;
struct ast_flags flags;
- struct localuser *u;
+ struct ast_module_user *u;
char *parse, *opts[OPTION_ARG_ARRAY_SIZE];
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(dummy);
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
/* Do our thing here */
if (ast_test_flag(&flags, OPTION_C))
ast_log(LOG_NOTICE, "Option C is set with : %s\n", opts[OPTION_ARG_C] ? opts[OPTION_ARG_C] : "<unspecified>");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, app_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Trivial skeleton Application";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
-
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Skeleton (sample) Application");
static char log_file[255];
static char spool_dir[255];
-static char *tdesc = "SMS/PSTN handler";
-
static char *app = "SMS";
static char *synopsis = "Communicates with SMS service centres and SMS capable analogue phones";
static unsigned char wavea[80];
#endif
-LOCAL_USER_DECL;
/* SMS 7 bit character mapping to UCS-2 */
static const unsigned short defaultalphabet[] = {
static int sms_exec (struct ast_channel *chan, void *data)
{
int res = -1;
- struct localuser *u;
+ struct ast_module_user *u;
struct ast_frame *f;
sms_t h = { 0 };
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
h.ipc0 = h.ipc1 = 20; /* phase for cosine */
h.dcs = 0xF1; /* default */
if (!data) {
ast_log (LOG_ERROR, "Requires queue name at least\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
answer = 0;
if (!*d || *d == '|') {
ast_log (LOG_ERROR, "Requires queue name\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
for (p = d; *p && *p != '|'; p++);
if (p - d >= sizeof (h.queue)) {
ast_log (LOG_ERROR, "Queue name too long\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
strncpy (h.queue, (char *)d, p - d);
h.rx = 0; /* sent message */
h.mr = -1;
sms_writefile (&h);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
res = ast_set_read_format (chan, AST_FORMAT_SLINEAR);
if (res < 0) {
ast_log (LOG_ERROR, "Unable to set to linear mode, giving up\n");
- LOCAL_USER_REMOVE (u);
+ ast_module_user_remove(u);
return -1;
}
if (ast_activate_generator (chan, &smsgen, &h) < 0) {
ast_log (LOG_ERROR, "Failed to activate generator on '%s'\n", chan->name);
- LOCAL_USER_REMOVE (u);
+ ast_module_user_remove(u);
return -1;
}
sms_log (&h, '?'); /* log incomplete message */
- LOCAL_USER_REMOVE (u);
+ ast_module_user_remove(u);
return (h.err);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application (app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
#ifdef OUTALAW
{
return ast_register_application (app, sms_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "SMS/PSTN handler");
static char *synopsis = "Soft Hangup Application";
-static char *tdesc = "Hangs up the requested channel";
-
static char *desc = " SoftHangup(Technology/resource|options)\n"
"Hangs up the requested channel. If there are no channels to hangup,\n"
"the application will report it.\n"
static char *app = "SoftHangup";
-LOCAL_USER_DECL;
static int softhangup_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
struct ast_channel *c=NULL;
char *options, *cut, *cdata, *match;
char name[AST_CHANNEL_NAME] = "";
return 0;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
cdata = ast_strdupa(data);
match = strsep(&cdata, "|");
c = ast_channel_walk_locked(c);
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, softhangup_exec, synopsis, desc);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Hangs up the requested channel");
#include "asterisk/app.h"
#include "asterisk/speech.h"
-static char *tdesc = "Dialplan Speech Applications";
-
-LOCAL_USER_DECL;
-
/* Descriptions for each application */
static char *speechcreate_descrip =
"SpeechCreate(engine name)\n"
/*! \brief SpeechCreate() Dialplan Application */
static int speech_create(struct ast_channel *chan, void *data)
{
- struct localuser *u = NULL;
+ struct ast_module_user *u = NULL;
struct ast_speech *speech = NULL;
struct ast_datastore *datastore = NULL;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
/* Request a speech object */
speech = ast_speech_new(data, AST_FORMAT_SLINEAR);
if (speech == NULL) {
/* Not available */
pbx_builtin_setvar_helper(chan, "ERROR", "1");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
if (datastore == NULL) {
ast_speech_destroy(speech);
pbx_builtin_setvar_helper(chan, "ERROR", "1");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
datastore->data = speech;
ast_channel_datastore_add(chan, datastore);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
static int speech_load(struct ast_channel *chan, void *data)
{
int res = 0, argc = 0;
- struct localuser *u = NULL;
+ struct ast_module_user *u = NULL;
struct ast_speech *speech = find_speech(chan);
char *argv[2], *args = NULL, *name = NULL, *path = NULL;
args = ast_strdupa(data);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (speech == NULL) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
/* Parse out arguments */
argc = ast_app_separate_args(args, '|', argv, sizeof(argv) / sizeof(argv[0]));
if (argc != 2) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
name = argv[0];
/* Load the grammar locally on the object */
res = ast_speech_grammar_load(speech, name, path);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int speech_unload(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u = NULL;
+ struct ast_module_user *u = NULL;
struct ast_speech *speech = find_speech(chan);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (speech == NULL) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
/* Unload the grammar */
res = ast_speech_grammar_unload(speech, data);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int speech_deactivate(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u = NULL;
+ struct ast_module_user *u = NULL;
struct ast_speech *speech = find_speech(chan);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (speech == NULL) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
/* Deactivate the grammar on the speech object */
res = ast_speech_grammar_deactivate(speech, data);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int speech_activate(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u = NULL;
+ struct ast_module_user *u = NULL;
struct ast_speech *speech = find_speech(chan);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (speech == NULL) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
/* Activate the grammar on the speech object */
res = ast_speech_grammar_activate(speech, data);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int speech_start(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u = NULL;
+ struct ast_module_user *u = NULL;
struct ast_speech *speech = find_speech(chan);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (speech == NULL) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
ast_speech_start(speech);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int speech_processing_sound(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u = NULL;
+ struct ast_module_user *u = NULL;
struct ast_speech *speech = find_speech(chan);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (speech == NULL) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
speech->processing_sound = strdup(data);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
{
unsigned int timeout = 0;
int res = 0, done = 0, argc = 0, started = 0;
- struct localuser *u = NULL;
+ struct ast_module_user *u = NULL;
struct ast_speech *speech = find_speech(chan);
struct ast_frame *f = NULL;
int oldreadformat = AST_FORMAT_SLINEAR;
args = ast_strdupa(data);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (speech == NULL) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
/* If channel is not already answered, then answer it */
if (chan->_state != AST_STATE_UP && ast_answer(chan)) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
/* Change read format to be signed linear */
if (ast_set_read_format(chan, AST_FORMAT_SLINEAR)) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if (filename != NULL && ast_streamfile(chan, filename, chan->language)) {
/* An error occured while streaming */
ast_set_read_format(chan, oldreadformat);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
ast_set_read_format(chan, oldreadformat);
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
static int speech_destroy(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u = NULL;
+ struct ast_module_user *u = NULL;
struct ast_speech *speech = find_speech(chan);
struct ast_datastore *datastore = NULL;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (speech == NULL) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
ast_channel_datastore_remove(chan, datastore);
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res = 0;
res |= ast_custom_function_unregister(&speech_grammar_function);
res |= ast_custom_function_unregister(&speech_engine_function);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dialplan Speech Applications");
"StackPop()\n"
" Removes last label on the stack, discarding it.\n";
-LOCAL_USER_DECL;
static int pop_exec(struct ast_channel *chan, void *data)
{
static int gosub_exec(struct ast_channel *chan, void *data)
{
char newlabel[AST_MAX_EXTENSION * 2 + 3 + 11];
- struct localuser *u;
+ struct ast_module_user *u;
if (ast_strlen_zero(data)) {
ast_log(LOG_ERROR, "%s requires an argument: %s([[context|]exten|]priority)\n", app_gosub, app_gosub);
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
snprintf(newlabel, sizeof(newlabel), "%s|%s|%d", chan->context, chan->exten, chan->priority + 1);
if (ast_parseable_goto(chan, data)) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
pbx_builtin_pushvar_helper(chan, STACKVAR, newlabel);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
static int gosubif_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
char *condition="", *label1, *label2, *args;
int res=0;
args = ast_strdupa(data);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
condition = strsep(&args, "?");
label1 = strsep(&args, ":");
res = gosub_exec(chan, label2);
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
ast_unregister_application(app_return);
ast_unregister_application(app_pop);
ast_unregister_application(app_gosubif);
ast_unregister_application(app_gosub);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
ast_register_application(app_pop, pop_exec, pop_synopsis, pop_descrip);
ast_register_application(app_return, return_exec, return_synopsis, return_descrip);
return 0;
}
-static const char *description(void)
-{
- return "Stack Routines";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Stack Routines");
#include "asterisk/app.h"
#include "asterisk/options.h"
-static char *tdesc = "Generic System() application";
-
static char *app = "System";
static char *app2 = "TrySystem";
"instance, then the channel will be setup to continue at that\n"
"priority level. Otherwise, System will terminate.\n";
-LOCAL_USER_DECL;
static int system_exec_helper(struct ast_channel *chan, void *data, int failmode)
{
int res=0;
- struct localuser *u;
+ struct ast_module_user *u;
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "System requires an argument(command)\n");
return failmode;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
/* Do our thing here */
res = ast_safe_system((char *)data);
res = 0;
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
return system_exec_helper(chan, data, 0);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
res |= ast_unregister_application(app2);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Generic System() application");
#include "asterisk/utils.h"
#include "asterisk/dsp.h"
-static char *tdesc = "Playback with Talk Detection";
-
static char *app = "BackgroundDetect";
static char *synopsis = "Background a file with talk detect";
"if available. If unspecified, sil, min, and max default to 1000, 100, and\n"
"infinity respectively.\n";
-LOCAL_USER_DECL;
static int background_detect_exec(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
char *tmp;
char *options;
char *stringp;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
tmp = ast_strdupa(data);
}
if (dsp)
ast_dsp_free(dsp);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, background_detect_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Playback with Talk Detection");
#include "asterisk/pbx.h"
#include "asterisk/utils.h"
-LOCAL_USER_DECL;
-
-static char *tdesc = "Interface Test Application";
-
static char *tests_descrip =
"TestServer(): Perform test server function and write call report.\n"
"Results stored in /var/log/asterisk/testreports/<testid>-server.txt";
static int testclient_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
int res = 0;
char *testid=data;
char fn[80];
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (chan->_state != AST_STATE_UP)
res = ast_answer(chan);
ast_log(LOG_NOTICE, "Did not read a test ID on '%s'\n", chan->name);
res = -1;
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int testserver_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
int res = 0;
char testid[80]="";
char fn[80];
FILE *f;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (chan->_state != AST_STATE_UP)
res = ast_answer(chan);
/* Read version */
ast_log(LOG_NOTICE, "Did not read a test ID on '%s'\n", chan->name);
res = -1;
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(testc_app);
res |= ast_unregister_application(tests_app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Interface Test Application");
#include "asterisk/options.h"
#include "asterisk/app.h"
-LOCAL_USER_DECL;
static const char *app = "Transfer";
{
int res;
int len;
- struct localuser *u;
+ struct ast_module_user *u;
char *slash;
char *tech = NULL;
char *dest = NULL;
AST_APP_ARG(options);
);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (ast_strlen_zero((char *)data)) {
ast_log(LOG_WARNING, "Transfer requires an argument ([Tech/]destination[|options])\n");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", "FAILURE");
return 0;
} else
/* Allow execution only if the Tech/destination agrees with the type of the channel */
if (strncasecmp(chan->tech->type, tech, len)) {
pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", "FAILURE");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
}
/* Check if the channel supports transfer before we try it */
if (!chan->tech->transfer) {
pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", "UNSUPPORTED");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", status);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, transfer_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Transfer";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Transfer");
#include "asterisk/image.h"
#include "asterisk/options.h"
-static char *tdesc = "Send URL Applications";
-
static char *app = "SendURL";
static char *synopsis = "Send a URL";
" SendURL only returns 0 if the URL was sent correctly or if\n"
" the channel does not support HTML transport, and -1 otherwise.\n";
-LOCAL_USER_DECL;
static int sendurl_exec(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
char *tmp;
char *options;
int local_option_wait=0;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
tmp = ast_strdupa(data);
if (local_option_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
pbx_builtin_setvar_helper(chan, "SENDURLSTATUS", "UNSUPPORTED");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
res = ast_channel_sendurl(chan, tmp);
if (res == -1) {
pbx_builtin_setvar_helper(chan, "SENDURLSTATUS", "FAILURE");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
status = "SUCCESS";
}
out:
pbx_builtin_setvar_helper(chan, "SENDURLSTATUS", status);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, sendurl_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Send URL Applications");
#include "asterisk/manager.h"
#include "asterisk/app.h"
-static char *tdesc = "Custom User Event Application";
-
static char *app = "UserEvent";
static char *synopsis = "Send an arbitrary event to the manager interface";
" [body]\n"
"If no body is specified, only Event and UserEvent headers will be present.\n";
-LOCAL_USER_DECL;
static int userevent_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
char *parse, buf[2048] = "";
int x, buflen = 0;
AST_DECLARE_APP_ARGS(args,
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
parse = ast_strdupa(data);
manager_event(EVENT_FLAG_USER, "UserEvent", "UserEvent: %s\r\n%s\r\n", args.eventname, buf);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
+
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, userevent_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Custom User Event Application");
#include "asterisk/pbx.h"
#include "asterisk/module.h"
-
-static char *tdesc = "Send verbose output";
-
static char *app_verbose = "Verbose";
static char *verbose_synopsis = "Send arbitrary text to verbose output";
static char *verbose_descrip =
"Log(<level>|<message>)\n"
" level must be one of ERROR, WARNING, NOTICE, DEBUG, VERBOSE, DTMF\n";
-LOCAL_USER_DECL;
static int verbose_exec(struct ast_channel *chan, void *data)
{
char *vtext;
int vsize;
- struct localuser *u;
+ struct ast_module_user *u;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (data) {
char *tmp;
}
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
static int log_exec(struct ast_channel *chan, void *data)
{
char *level, *ltext;
- struct localuser *u;
+ struct ast_module_user *u;
int lnum = -1;
char extension[AST_MAX_EXTENSION + 5], context[AST_MAX_EXTENSION + 2];
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (ast_strlen_zero(data)) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
ast_log(lnum, extension, chan->priority, context, "%s\n", ltext);
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app_verbose);
res |= ast_unregister_application(app_log);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Send verbose output");
static char ext_pass_cmd[128];
#ifdef ODBC_STORAGE
-static char *tdesc = "Comedian Mail (Voicemail System) with ODBC Storage";
+#define tdesc "Comedian Mail (Voicemail System) with ODBC Storage"
#else
#ifdef IMAP_STORAGE
-static char *tdesc = "Comedian Mail (Voicemail System) with IMAP Storage";
+#define tdesc "Comedian Mail (Voicemail System) with IMAP Storage"
#else
-static char *tdesc = "Comedian Mail (Voicemail System)";
+#define tdesc "Comedian Mail (Voicemail System)"
#endif
#endif
static int adsiver = 1;
static char emaildateformat[32] = "%A, %B %d, %Y at %r";
-LOCAL_USER_DECL;
static void populate_defaults(struct ast_vm_user *vmu)
{
int res=-1;
int cmd=0;
int valid = 0;
- struct localuser *u;
+ struct ast_module_user *u;
char prefixstr[80] ="";
char ext_context[256]="";
int box;
#ifdef IMAP_STORAGE
int deleted = 0;
#endif
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
/* Add the vm_state to the active list and keep it active */
memset(&vms, 0, sizeof(vms));
if (args.argc == 2) {
if (ast_app_parse_options(vm_app_options, &flags, opts, args.argv1)) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
if (ast_test_flag(&flags, OPT_RECORDGAIN)) {
if (opts[OPT_ARG_RECORDGAIN]) {
if (sscanf(opts[OPT_ARG_RECORDGAIN], "%d", &gain) != 1) {
ast_log(LOG_WARNING, "Invalid value '%s' provided for record gain option\n", opts[OPT_ARG_RECORDGAIN]);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
} else {
record_gain = (signed char) gain;
free(vms.deleted);
if (vms.heard)
free(vms.heard);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int vm_exec(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
char *tmp;
struct leave_vm_options leave_options;
struct ast_flags flags = { 0 };
AST_APP_ARG(argv1);
);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
memset(&leave_options, 0, sizeof(leave_options));
AST_STANDARD_APP_ARGS(args, tmp);
if (args.argc == 2) {
if (ast_app_parse_options(vm_app_options, &flags, opts, args.argv1)) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
ast_copy_flags(&leave_options, &flags, OPT_SILENT | OPT_BUSY_GREETING | OPT_UNAVAIL_GREETING | OPT_PRIORITY_JUMP);
if (sscanf(opts[OPT_ARG_RECORDGAIN], "%d", &gain) != 1) {
ast_log(LOG_WARNING, "Invalid value '%s' provided for record gain option\n", opts[OPT_ARG_RECORDGAIN]);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
} else {
leave_options.record_gain = (signed char) gain;
char tmp[256];
res = ast_app_getdata(chan, "vm-whichbox", tmp, sizeof(tmp) - 1, 0);
if (res < 0) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
if (ast_strlen_zero(tmp)) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
args.argv0 = ast_strdupa(tmp);
res = 0;
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
static int vm_box_exists(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
struct ast_vm_user svm;
char *context, *box;
int priority_jump = 0;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
box = ast_strdupa(data);
ast_log(LOG_WARNING, "VM box %s@%s exists, but extension %s, priority %d doesn't exist\n", box, context, chan->exten, chan->priority + 101);
} else
pbx_builtin_setvar_helper(chan, "VMBOXEXISTSSTATUS", "FAILED");
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
static int vmauthenticate(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
char *s = data, *user=NULL, *context=NULL, mailbox[AST_MAX_EXTENSION] = "";
struct ast_vm_user vmus;
char *options = NULL;
int silent = 0, skipuser = 0;
int res = -1;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (s) {
s = ast_strdupa(s);
res = 0;
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
}
}
-static int reload(void *mod)
+static int reload(void)
{
return(load_config());
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res |= ast_cli_unregister(&show_voicemail_zones_cli);
ast_uninstall_vm_functions();
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
res = ast_register_application(app, vm_exec, synopsis_vm, descrip_vm);
get_mailbox_delimiter(MAILSTREAM *stream) {
mail_list(stream, "", "*");
}
-#endif
-
-static const char *description(void)
-{
- return tdesc;
-}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+#endif /* IMAP_STORAGE */
+
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, tdesc,
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
static char *synopsis = "Wait for Ring Application";
-static char *tdesc = "Waits until first ring after time";
-
static char *desc = " WaitForRing(timeout)\n"
"Returns 0 after waiting at least timeout seconds. and\n"
"only after the next ring has completed. Returns 0 on\n"
static char *app = "WaitForRing";
-LOCAL_USER_DECL;
static int waitforring_exec(struct ast_channel *chan, void *data)
{
- struct localuser *u;
+ struct ast_module_user *u;
struct ast_frame *f;
int res = 0;
int ms;
return 0;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
ms *= 1000;
while(ms > 0) {
}
}
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, waitforring_exec, synopsis, desc);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Waits until first ring after time");
#include "asterisk/module.h"
#include "asterisk/options.h"
-static char *tdesc = "Wait For Silence";
static char *app = "WaitForSilence";
static char *synopsis = "Waits for a specified amount of silence";
static char *descrip =
" - WaitForSilence(500|2) will wait for 1/2 second of silence, twice\n"
" - WaitForSilence(1000) will wait for 1 second of silence, once\n";
-LOCAL_USER_DECL;
static int do_waiting(struct ast_channel *chan, int maxsilence) {
static int waitforsilence_exec(struct ast_channel *chan, void *data)
{
int res = 1;
- struct localuser *u;
+ struct ast_module_user *u;
int maxsilence = 1000;
int iterations = 1, i;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
res = ast_answer(chan); /* Answer the channel */
for (i=0; (i<iterations) && (res == 1); i++) {
res = do_waiting(chan, maxsilence);
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
if (res > 0)
res = 0;
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, waitforsilence_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Wait For Silence");
#include "asterisk/lock.h"
#include "asterisk/options.h"
-#define ALL_DONE(u,ret) {LOCAL_USER_REMOVE(u); return ret;}
+#define ALL_DONE(u,ret) {ast_module_user_remove(u); return ret;}
static char *start_app = "While";
"Returns to the top of the while loop and re-evaluates the conditional.\n";
static char *continue_synopsis = "Restart a While loop";
-static char *tdesc = "While Loops and Conditional Execution";
-
-LOCAL_USER_DECL;
-
#define VAR_SIZE 64
static int _while_exec(struct ast_channel *chan, void *data, int end)
{
int res=0;
- struct localuser *u;
+ struct ast_module_user *u;
const char *while_pri = NULL;
char *my_name = NULL;
const char *condition = NULL, *label = NULL;
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
/* dont want run away loops if the chan isn't even up
this is up for debate since it slows things down a tad ......
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res |= ast_unregister_application(exit_app);
res |= ast_unregister_application(continue_app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "While Loops and Conditional Execution");
#include "asterisk/module.h"
#include "asterisk/translate.h"
-static char *tdesc = "Block Telemarketers with Special Information Tone";
-
static char *app = "Zapateller";
static char *synopsis = "Block telemarketers with SIT";
"is no callerid information available. Options should be separated by |\n"
"characters\n";
-LOCAL_USER_DECL;
static int zapateller_exec(struct ast_channel *chan, void *data)
{
int res = 0;
- struct localuser *u;
+ struct ast_module_user *u;
int answer = 0, nocallerid = 0;
char *c;
char *stringp=NULL;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
stringp=data;
c = strsep(&stringp, "|");
}
}
if (chan->cid.cid_num && nocallerid) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
if (!res)
res = ast_tonepair(chan, 1800, 0, 330, 0);
if (!res)
res = ast_tonepair(chan, 0, 0, 1000, 0);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, zapateller_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Block Telemarketers with Special Information Tone");
#include "asterisk/say.h"
#include "asterisk/utils.h"
-static char *tdesc = "Barge in on Zap channel application";
-
static char *app = "ZapBarge";
static char *synopsis = "Barge in (monitor) Zap channel";
"-1 when caller user hangs up and is independent of the\n"
"state of the channel being monitored.";
-LOCAL_USER_DECL;
#define CONF_SIZE 160
static int conf_exec(struct ast_channel *chan, void *data)
{
int res=-1;
- struct localuser *u;
+ struct ast_module_user *u;
int retrycnt = 0;
int confflags = 0;
int confno = 0;
char confstr[80] = "";
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (!ast_strlen_zero(data)) {
if ((sscanf(data, "Zap/%d", &confno) != 1) &&
(sscanf(data, "%d", &confno) != 1)) {
ast_log(LOG_WARNING, "ZapBarge Argument (if specified) must be a channel number, not '%s'\n", (char *)data);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
}
}
out:
/* Do the conference */
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, conf_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
-
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Barge in on Zap channel application");
#include "asterisk/module.h"
#include "asterisk/options.h"
-static char *tdesc = "Zap RAS Application";
-
static char *app = "ZapRAS";
static char *synopsis = "Executes Zaptel ISDN RAS application";
"Your pppd must be patched to be zaptel aware. Arguments should be\n"
"separated by | characters.\n";
-LOCAL_USER_DECL;
#define PPP_MAX_ARGS 32
#define PPP_EXEC "/usr/sbin/pppd"
{
int res=-1;
char *args;
- struct localuser *u;
+ struct ast_module_user *u;
ZT_PARAMS ztp;
if (!data)
data = "";
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
args = ast_strdupa(data);
run_ras(chan, args);
}
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, zapras_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Zap RAS Application");
#include "asterisk/cli.h"
#include "asterisk/say.h"
-static char *tdesc = "Scan Zap channels application";
-
static char *app = "ZapScan";
static char *synopsis = "Scan Zap channels to monitor calls";
"a convenient way. Use '#' to select the next channel and use '*' to exit\n"
"Limit scanning to a channel GROUP by setting the option group argument.\n";
-LOCAL_USER_DECL;
#define CONF_SIZE 160
static int conf_exec(struct ast_channel *chan, void *data)
{
int res=-1;
- struct localuser *u;
+ struct ast_module_user *u;
int confflags = 0;
int confno = 0;
char confstr[80] = "", *tmp = NULL;
char *desired_group;
int input=0,search_group=0;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
if (chan->_state != AST_STATE_UP)
ast_answer(chan);
ast_mutex_unlock(&tempchan->lock);
lastchan = tempchan;
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_unregister_application(app);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_register_application(app, conf_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Scan Zap channels application");
</member>
<member name="TRACE_FRAMES" displayname="Trace Frame Allocations">
</member>
+ <member name="STATIC_BUILD" displayname="Build static binaries">
+ </member>
+ <member name="LOADABLE_MODULES" displayname="Runtime module loading">
+ <defaultenabled>yes</defaultenabled>
+ </member>
</category>
--- /dev/null
+ <category name="MENUSELECT_EMBED" displayname="Module Embedding" positive_output="yes" remove_on_change="main/asterisk">
+ <member name="apps" displayname="Applications" remove_on_change="apps/*.o">
+ </member>
+ <member name="cdr" displayname="Call Detail Recording" remove_on_change="cdr/*.o">
+ </member>
+ <member name="channels" displayname="Channels" remove_on_change="channels/*.o channels/misdn/*.o">
+ </member>
+ <member name="codecs" displayname="Coders/Decoders" remove_on_change="codecs/*.o">
+ </member>
+ <member name="formats" displayname="File Formats" remove_on_change="formats/*.o">
+ </member>
+ <member name="funcs" displayname="Dialplan Functions" remove_on_change="funcs/*.o">
+ </member>
+ <member name="pbx" displayname="PBX Functionality" remove_on_change="pbx/*.o pbx/ael/*.o">
+ </member>
+ <member name="res" displayname="Resource Modules" remove_on_change="res/*.o res/snmp/*.o">
+ </member>
+ </category>
WIN32=@OSISWIN32@
ZAPTEL=@PBX_ZAPTEL@
ZLIB=@PBX_ZLIB@
+ISDNNET=@PBX_ISDNNET@
+MISDN=@PBX_MISDN@
+SUPPSERV=@PBX_SUPPSERV@
#!/bin/sh
get_description() {
- x=${1}
- TDESC=`cat $x | grep -e *tdesc | cut -f 2 -d '"'`
- if [ "$TDESC" = "" ]; then
- TDESC=`cat $x | grep -A 2 -e *description | grep -e '\"' | cut -f 2 -d '"'`
- fi
- if [ "$TDESC" = "" ]; then
- TDESC=`cat $x | grep -e MODULE_DESCRIPTION | grep -v return | cut -f 2 -d '"'`
- fi
- if [ "$TDESC" = "" ]; then
- TDESC=`cat $x | grep -e tdesc\\\[\\\] | cut -f 2 -d '"'`
- fi
- if [ "$TDESC" = "" ]; then
- TDESC=`cat $x | grep -e desc\\\[\\\] | grep -v description | cut -f 2 -d '"'`
- fi
- if [ "$TDESC" = "" ]; then
- TDESC=`cat $x | grep -e *desc | grep -v descrip | cut -f 2 -d '"'`
- fi
- if [ "$TDESC" = "" ]; then
- TDESC=`cat $x | grep -e *dtext | grep static | cut -f 2 -d '"'`
- fi
- if [ "$TDESC" = "" ]; then
- TDESC=`cat $x | grep -A 2 -e *synopsis | grep -e '\"' | cut -f 2 -d '"'`
- fi
+ TDESC=`grep -e AST_MODULE_INFO ${1} | cut -d '"' -f 2`
}
process_dir() {
catsuffix=${3}
displayname=${4}
- echo -e "\t<category name=\"MENUSELECT_${catsuffix}\" displayname=\"${displayname}\">"
+ echo -e "\t<category name=\"MENUSELECT_${catsuffix}\" displayname=\"${displayname}\" remove_on_change=\"${dir}/modules.link\">"
for file in `ls ${dir}/${prefix}*.c ${dir}/${prefix}*.cc 2> /dev/null | sort`
do
if [ ! -f ${file} ]; then
echo -e "\t\t<member name=\"${fname}\" displayname=\"${desc}\" remove_on_change=\"${dir}/${fname}.o ${dir}/${fname}.oo ${dir}/${fname}.so\">"
awk -f build_tools/get_moduleinfo ${file}
echo -e "\t\t</member>"
- done
- echo -e "\t</category>"
-
- for file in ${dir}/${prefix}*.c
- do
awk -f build_tools/get_makeopts ${file} >> .makeoptstmp
done
+ echo -e "\t</category>"
}
echo "<?xml version="1.0"?>"
process_dir funcs func FUNCS "Dialplan Functions"
process_dir pbx pbx PBX "PBX Modules"
process_dir res res RES "Resource Modules"
+cat .makeoptstmp
cat build_tools/cflags.xml
+cat build_tools/embed_modules.xml
cat sounds/sounds.xml
-cat .makeoptstmp
rm -f .makeoptstmp
echo "</menu>"
# the GNU General Public License
#
-ifneq ($(wildcard ../menuselect.makeopts),)
+ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),)
include ../menuselect.makeopts
include ../menuselect.makedeps
endif
C_MODS:=$(filter-out $(MENUSELECT_CDR),$(patsubst %.c,%,$(wildcard cdr_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_CDR),$(patsubst %.cc,%,$(wildcard cdr_*.cc)))
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring cdr,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
all: _all
"userfield" user field set via SetCDRUserField
----------------------------------------------------------*/
-static char *desc = "Comma Separated Values CDR Backend";
-
static char *name = "csv";
static FILE *mf = NULL;
return 0;
}
-static const char *description(void)
-{
- return desc;
-}
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
if (mf)
fclose(mf);
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
load_config();
- res = ast_cdr_register(name, desc, csv_log);
+ res = ast_cdr_register(name, ast_module_info->description, csv_log);
if (res) {
ast_log(LOG_ERROR, "Unable to register CSV CDR handling\n");
if (mf)
return res;
}
-static int reload(void *mod)
+static int reload(void)
{
load_config();
- return 0;
-}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
+ return 0;
}
-STD_MOD(MOD_1 | NO_USECOUNT, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Comma Separated Values CDR Backend",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
AST_MUTEX_DEFINE_STATIC(lock);
-static char *desc = "Customizable Comma Separated Values CDR Backend";
-
static char *name = "cdr-custom";
static FILE *mf = NULL;
return 0;
}
-static const char *description(void)
-{
- return desc;
-}
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
if (mf)
fclose(mf);
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
if (!load_config(0)) {
- res = ast_cdr_register(name, desc, custom_log);
+ res = ast_cdr_register(name, ast_module_info->description, custom_log);
if (res)
ast_log(LOG_ERROR, "Unable to register custom CDR handling\n");
if (mf)
return res;
}
-static int reload(void *mod)
+static int reload(void)
{
return load_config(1);
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Customizable Comma Separated Values CDR Backend",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
#define DATE_FORMAT "%Y-%m-%d %T"
#define CONF_FILE "cdr_manager.conf"
-static char *desc = "Asterisk Call Manager CDR Backend";
static char *name = "cdr_manager";
static int enablecdr = 0;
return 0;
}
-static const char *description(void)
-{
- return desc;
-}
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
ast_cdr_unregister(name);
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
/* Configuration file */
loadconfigurationfile();
- res = ast_cdr_register(name, desc, manager_log);
+ res = ast_cdr_register(name, "Asterisk Manager Interface CDR Backend", manager_log);
if (res) {
ast_log(LOG_ERROR, "Unable to register Asterisk Call Manager CDR handling\n");
}
return res;
}
-static int reload(void *mod)
+static int reload(void)
{
loadconfigurationfile();
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Asterisk Manager Interface CDR Backend",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
#define DATE_FORMAT "%Y-%m-%d %T"
-static char *desc = "ODBC CDR Backend";
static char *name = "ODBC";
static char *config = "cdr_odbc.conf";
static char *dsn = NULL, *username = NULL, *password = NULL, *table = NULL;
return 0;
}
-static const char *description(void)
-{
- return desc;
-}
-
static int odbc_unload_module(void)
{
ast_mutex_lock(&odbc_lock);
ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: Unable to connect to datasource: %s\n", dsn);
}
}
- res = ast_cdr_register(name, desc, odbc_log);
+ res = ast_cdr_register(name, ast_module_info->description, odbc_log);
if (res) {
ast_log(LOG_ERROR, "cdr_odbc: Unable to register ODBC CDR handling\n");
}
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return odbc_load_module();
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return odbc_unload_module();
}
-static int reload(void *mod)
+static int reload(void)
{
odbc_unload_module();
return odbc_load_module();
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "ODBC CDR Backend",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
#define DATE_FORMAT "%Y-%m-%d %T"
-static char *desc = "PostgreSQL CDR Backend";
static char *name = "pgsql";
static char *config = "cdr_pgsql.conf";
static char *pghostname = NULL, *pgdbname = NULL, *pgdbuser = NULL, *pgpassword = NULL, *pgdbport = NULL, *table = NULL;
return 0;
}
-static const char *description(void)
-{
- return desc;
-}
-
static int my_unload_module(void)
{
if (conn)
connected = 0;
}
- return ast_cdr_register(name, desc, pgsql_log);
+ return ast_cdr_register(name, ast_module_info->description, pgsql_log);
}
static int my_load_module(void)
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return my_load_module();
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return my_unload_module();
}
-static int reload(void *mod)
+static int reload(void)
{
my_unload_module();
return my_load_module();
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "PostgreSQL CDR Backend",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
return result;
}
-static const char *description(void)
-{
- return desc;
-}
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
ast_cdr_unregister(name);
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
struct ast_config *cfg;
char *tmp;
return ast_cdr_register(name, desc, radius_log);
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "RADIUS CDR Backend");
/* When you change the DATE_FORMAT, be sure to change the CHAR(19) below to something else */
#define DATE_FORMAT "%Y-%m-%d %T"
-static char *desc = "SQLite CDR Backend";
static char *name = "sqlite";
static sqlite* db = NULL;
return res;
}
-
-static const char *description(void)
-{
- return desc;
-}
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
if (db)
sqlite_close(db);
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
char *zErr;
char fn[PATH_MAX];
/* TODO: here we should probably create an index */
}
- res = ast_cdr_register(name, desc, sqlite_log);
+ res = ast_cdr_register(name, ast_module_info->description, sqlite_log);
if (res) {
ast_log(LOG_ERROR, "Unable to register SQLite CDR handling\n");
return -1;
return -1;
}
-static int reload(void *mod)
-{
- return 0;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "SQLite CDR Backend");
#define DATE_FORMAT "%Y/%m/%d %T"
-static char *desc = "MSSQL CDR Backend";
static char *name = "mssql";
static char *config = "cdr_tds.conf";
}
}
-static const char *description(void)
-{
- return desc;
-}
-
static int mssql_disconnect(void)
{
if (tds) {
mssql_connect();
/* Register MSSQL CDR handler */
- res = ast_cdr_register(name, desc, tds_log);
+ res = ast_cdr_register(name, ast_module_info->description, tds_log);
if (res)
{
ast_log(LOG_ERROR, "Unable to register MSSQL CDR handling\n");
return res;
}
-static int reload(void *mod)
+static int reload(void)
{
tds_unload_module();
return tds_load_module();
}
-static int load_module(void *mod)
+static int load_module(void)
{
return tds_load_module();
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return tds_unload_module();
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "MSSQL CDR Backend",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
# the GNU General Public License
#
-ifneq ($(wildcard ../menuselect.makeopts),)
+ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),)
include ../menuselect.makeopts
include ../menuselect.makedeps
endif
H323LIB=-lh323_OpenBSD_x86_r
endif
-ifeq ($(OSARCH),Linux)
+ifeq ($(OSARCH),linux-gnu)
PTLIB=-lpt_linux_x86_r
H323LIB=-lh323_linux_x86_r
CHANH323LIB=-ldl
CC_MODS:=$(filter-out chan_h323,$(CC_MODS))
endif
-ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/mISDNuser/mISDNlib.h),)
- C_MODS:=$(filter-out chan_misdn,$(C_MODS))
-endif
-
ifndef OPENH323DIR
OPENH323DIR=$(HOME)/openh323
endif
PWLIBDIR=$(HOME)/pwlib
endif
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring channels,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
all: _all
clean::
rm -f busy.h ringtone.h gentone
+ make -C misdn clean
ifneq ($(wildcard $(PWD)/Makefile.ast),)
include $(PWD)/Makefile.ast
chan_oss.o: busy.h ringtone.h
-chan_iax2.so: iax2-parser.o iax2-provision.o
+$(chan_iax2): iax2-parser.o iax2-provision.o
chan_alsa.o: busy.h ringtone.h
-ifeq ($(OSARCH),Linux)
-chan_h323.so: chan_h323.o h323/libchanh323.a $(PWD)/Makefile.ast
- $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++
+ifeq ($(OSARCH),linux-gnu)
+chan_h323.so: chan_h323.o h323_module_interface.so h323/libchanh323.a h323/Makefile.ast
+ $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $^ h323/libchanh323.a $(H323LDLIBS) -lstdc++
else
-chan_h323.so: chan_h323.o h323/libchanh323.a
- $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
+chan_h323.so: chan_h323.o h323_module_interface.so h323/libchanh323.a
+ $(CC) $(SOLINK) -o $@ $^ h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
endif
-misdn/chan_misdn_lib.a:
- make -C misdn
-
chan_misdn.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\"
misdn_config.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\"
-chan_misdn.so: chan_misdn.o misdn_config.o misdn/chan_misdn_lib.a
-chan_misdn.so: LIBS+=-lisdnnet -lmISDN -lsuppserv
+$(chan_misdn): chan_misdn.o misdn_config.o misdn/isdn_lib.o misdn/isdn_msg_parser.o
char agent[AST_MAX_AGENT]; /*!< Agent ID */
char password[AST_MAX_AGENT]; /*!< Password for Agent login */
char name[AST_MAX_AGENT];
- ast_mutex_t app_lock; /*!< Synchronization between owning applications */
- volatile pthread_t owning_app; /*!< Owning application thread id */
- volatile int app_sleep_cond; /*!< Sleep condition for the login app */
- struct ast_channel *owner; /*!< Agent */
- char loginchan[80]; /*!< channel they logged in from */
- char logincallerid[80]; /*!< Caller ID they had when they logged in */
- struct ast_channel *chan; /*!< Channel we use */
- AST_LIST_ENTRY(agent_pvt) list; /*!< Next Agent in the linked list. */
+ ast_mutex_t app_lock; /**< Synchronization between owning applications */
+ volatile pthread_t owning_app; /**< Owning application thread id */
+ volatile int app_sleep_cond; /**< Sleep condition for the login app */
+ struct ast_channel *owner; /**< Agent */
+ char loginchan[80]; /**< channel they logged in from */
+ char logincallerid[80]; /**< Caller ID they had when they logged in */
+ struct ast_channel *chan; /**< Channel we use */
+ struct ast_module_user *u; /*! reference to keep our module in memory while in use */
+ AST_LIST_ENTRY(agent_pvt) list; /**< Next Agent in the linked list. */
};
static AST_LIST_HEAD_STATIC(agents, agent_pvt); /*!< Holds the list of agents (loaded form agents.conf). */
* as in apps/app_chanisavail.c:chanavail_exec()
*/
- ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1);
- /* XXX do we need ast_update_use_count(); */
+ ast_module_user_remove(p->u);
if (option_debug)
ast_log(LOG_DEBUG, "Hangup called for state %s\n", ast_state2str(ast->_state));
ast_setstate(tmp, state);
tmp->tech_pvt = p;
p->owner = tmp;
+ /* XXX: this needs fixing */
+#if 0
ast_atomic_fetchadd_int(&__mod_desc->usecnt, +1);
+#endif
ast_update_use_count();
tmp->priority = 1;
/* Wake up and wait for other applications (by definition the login app)
int tries = 0;
int max_login_tries = maxlogintries;
struct agent_pvt *p;
- struct localuser *u;
+ struct ast_module_user *u;
int login_state = 0;
char user[AST_MAX_AGENT] = "";
char pass[AST_MAX_AGENT];
char *filename = "agent-loginok";
char tmpchan[AST_MAX_BUF] = "";
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
parse = ast_strdupa(data);
/* AgentLogin() exit */
if (!callbackmode) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
} else { /* AgentCallbackLogin() exit*/
/* Set variables */
pbx_builtin_setvar_helper(chan, "AGENTSTATUS", "fail");
}
if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 1, chan->cid.cid_num)) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
/* Do we need to play agent-goodbye now that we will be hanging up? */
}
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
/* We should never get here if next priority exists when in callbackmode */
return -1;
*
* \returns int Always 0.
*/
-static int load_module(void *mod)
+static int load_module(void)
{
- __mod_desc = mod;
/* Make sure we can register our agent channel type */
if (ast_channel_register(&agent_tech)) {
ast_log(LOG_ERROR, "Unable to register channel class 'Agent'\n");
return 0;
}
-static int reload(void *mod)
+static int reload(void)
{
read_agent_config();
if (persistent_agents)
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct agent_pvt *p;
/* First, take us out of the channel loop */
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return "Agent Proxy Channel";
-}
-
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Agent Proxy Channel",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
AST_MUTEX_DEFINE_STATIC(usecnt_lock);
AST_MUTEX_DEFINE_STATIC(alsalock);
-static const char desc[] = "ALSA Console Channel Driver";
static const char tdesc[] = "ALSA Console Channel Driver";
static const char config[] = "alsa.conf";
{ { "autoanswer", NULL }, console_autoanswer, "Sets/displays autoanswer", autoanswer_usage, autoanswer_complete }
};
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
int x;
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int x;
return 0;
}
-static const char *description(void)
-{
- return (char *) desc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "ALSA Console Channel Driver");
{ "feature", "show", "channels", NULL }, features_show,
"Show status of feature channels", show_features_usage, NULL };
-static int load_module(void *mod)
+static int load_module(void)
{
/* Make sure we can register our sip channel type */
if (ast_channel_register(&features_tech)) {
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct feature_pvt *p;
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return "Feature Proxy Channel";
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Feature Proxy Channel");
/** Variables required by Asterisk */
static const char desc[] = "The NuFone Network's Open H.323 Channel Driver";
-static const char tdesc[] = "The NuFone Network's Open H.323 Channel Driver";
static const char config[] = "h323.conf";
static char default_context[AST_MAX_CONTEXT] = "default";
static struct sockaddr_in bindaddr;
return 0;
}
-static const char *description(void)
-{
- return desc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "The NuFone Network's OpenH323 Channel Driver",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
#include "iax2.h"
#include "iax2-parser.h"
#include "iax2-provision.h"
-#include "../jitterbuf.h"
+#include "jitterbuf.h"
/* Define SCHED_MULTITHREADED to run the scheduler in a special
multithreaded mode. */
return reload_config();
}
-static int reload(void *mod)
+static int reload(void)
{
return reload_config();
}
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
ast_mutex_destroy(&iaxq.lock);
ast_mutex_destroy(&waresl.lock);
/*! \brief Load IAX2 module, load configuraiton ---*/
-static int load_module(void *mod)
+static int load_module(void)
{
char *config = "iax.conf";
int res = 0;
return res;
}
-static const char *description(void)
-{
- return "Inter Asterisk eXchange (Ver 2)";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Inter Asterisk eXchange (Ver 2)",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
static const char desc[] = "Jingle Channel";
static const char type[] = "Jingle";
-static const char tdesc[] = "Jingle Channel Driver";
static int usecnt = 0;
AST_MUTEX_DEFINE_STATIC(usecnt_lock);
/*! \brief PBX interface structure for channel registration */
static const struct ast_channel_tech jingle_tech = {
.type = type,
- .description = tdesc,
+ .description = "Jingle Channel Driver",
.capabilities = ((AST_FORMAT_MAX_AUDIO << 1) - 1),
.requester = jingle_request,
.send_digit = jingle_digit,
}
/*! \brief Load module into PBX, register channel */
-static int load_module(void *mod)
+static int load_module(void)
{
ASTOBJ_CONTAINER_INIT(&jingles);
if (!jingle_load_config()) {
}
/*! \brief Reload module */
-static int reload(void *mod)
+static int reload(void)
{
return 0;
}
/*! \brief Unload the jingle channel from Asterisk */
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct jingle_pvt *privates = NULL;
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return desc;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Jingle Channel Driver",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
int nooptimization; /* Don't leave masq state */
struct ast_channel *owner; /* Master Channel */
struct ast_channel *chan; /* Outbound channel */
+ struct ast_module_user *u_owner; /*! reference to keep the module loaded while in use */
+ struct ast_module_user *u_chan; /*! reference to keep the module loaded while in use */
AST_LIST_ENTRY(local_pvt) list; /* Next entity */
};
pbx_builtin_setvar_helper(p->owner, "CHANLOCALSTATUS", status);
p->chan = NULL;
p->launchedpbx = 0;
- } else
+ ast_module_user_remove(p->u_chan);
+ } else {
p->owner = NULL;
- ast->tech_pvt = NULL;
+ ast_module_user_remove(p->u_owner);
+ }
- ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1);
+ ast->tech_pvt = NULL;
if (!p->owner && !p->chan) {
/* Okay, done with the private part now, too. */
tmp2->tech_pvt = p;
p->owner = tmp;
p->chan = tmp2;
- ast_atomic_fetchadd_int(&__mod_desc->usecnt, +2); /* we allocate 2 new channels */
- ast_update_use_count();
+ p->u_owner = ast_module_user_add(p->owner);
+ p->u_chan = ast_module_user_add(p->chan);
ast_copy_string(tmp->context, p->context, sizeof(tmp->context));
ast_copy_string(tmp2->context, p->context, sizeof(tmp2->context));
ast_copy_string(tmp2->exten, p->exten, sizeof(tmp->exten));
"Show status of local channels", show_locals_usage, NULL };
/*! \brief Load module into PBX, register channel */
-static int load_module(void *mod)
+static int load_module(void)
{
- __mod_desc = mod;
-
/* Make sure we can register our channel type */
if (ast_channel_register(&local_tech)) {
ast_log(LOG_ERROR, "Unable to register channel class 'Local'\n");
}
/*! \brief Unload the local proxy channel from Asterisk */
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct local_pvt *p;
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return "Local Proxy Channel";
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Local Proxy Channel");
sub->rtp = NULL;
}
- /* Decrement use count */
- ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1);
- ast_update_use_count();
- /* Decrement use count */
+ ast_module_unref(ast_module_info->self);
if ((p->hookstate == MGCP_ONHOOK) && (!sub->next->rtp)) {
p->hidecallerid = 0;
if (i->amaflags)
tmp->amaflags = i->amaflags;
sub->owner = tmp;
- ast_atomic_fetchadd_int(&__mod_desc->usecnt, +1);
- ast_update_use_count();
+ ast_module_ref(ast_module_info->self);
tmp->callgroup = i->callgroup;
tmp->pickupgroup = i->pickupgroup;
ast_string_field_set(tmp, call_forward, i->call_forward);
}
/*! \brief load_module: PBX load module - initialization ---*/
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
- __mod_desc = mod;
sched = sched_context_create();
if (!sched) {
ast_log(LOG_WARNING, "Unable to create schedule context\n");
return 0;
}
-static int reload(void *mod)
+static int reload(void)
{
mgcp_reload(0, 0, NULL);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct mgcp_endpoint *e;
struct mgcp_gateway *g;
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return "Media Gateway Control Protocol (MGCP)";
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Media Gateway Control Protocol (MGCP)",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
* \ingroup channel_drivers
*/
+/*** MODULEINFO
+ <depend>isdnnet</depend>
+ <depend>misdn</depend>
+ <depend>suppserv</depend>
+ ***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
/* #define MISDN_DEBUG 1 */
-static char *desc = "Channel driver for mISDN Support (Bri/Pri)";
static const char misdn_type[] = "mISDN";
static int tracing = 0 ;
static int g_config_initialized=0;
-static int unload_module(void *mod)
+static int unload_module(void)
{
/* First, take us out of the channel loop */
ast_log(LOG_VERBOSE, "-- Unregistering mISDN Channel Driver --\n");
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int i, port;
{
if (ast_channel_register(&misdn_tech)) {
ast_log(LOG_ERROR, "Unable to register channel class %s\n", misdn_type);
- unload_module(mod);
+ unload_module();
return -1;
}
}
-static int reload(void *mod)
+static int reload(void)
{
reload_config();
return 0;
}
-static const char *description(void)
-{
- return desc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-
-
-
/*** SOME APPS ;)***/
static int misdn_facility_exec(struct ast_channel *chan, void *data)
}
}
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Channel driver for mISDN Support (BRI/PRI)",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
#include "asterisk/options.h"
#include "asterisk/utils.h"
-static const char desc[] = "Network Broadcast Sound Support";
static const char tdesc[] = "Network Broadcast Sound Driver";
-static int usecnt =0;
-
/* Only linear is allowed */
static int prefformat = AST_FORMAT_SLINEAR;
-AST_MUTEX_DEFINE_STATIC(usecnt_lock);
-
static char context[AST_MAX_EXTENSION] = "default";
static char type[] = "NBS";
char app[16]; /* Our app */
char stream[80]; /* Our stream */
struct ast_frame fr; /* "null" frame */
+ struct ast_module_user *u; /*! for holding a reference to this module */
};
static struct ast_channel *nbs_request(const char *type, int format, void *data, int *cause);
{
if (p->nbs)
nbs_delstream(p->nbs);
+ ast_module_user_remove(p->u);
free(p);
}
int flags = 0;
char stream[256] = "";
char *opts;
+
strncpy(stream, data, sizeof(stream) - 1);
if ((opts = strchr(stream, ':'))) {
*opts = '\0';
strncpy(tmp->exten, "s", sizeof(tmp->exten) - 1);
ast_string_field_set(tmp, language, "");
i->owner = tmp;
- ast_mutex_lock(&usecnt_lock);
- usecnt++;
- ast_mutex_unlock(&usecnt_lock);
- ast_update_use_count();
+ i->u = ast_module_user_add(tmp);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(tmp)) {
ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
return tmp;
}
-static int __unload_module(void)
+static int unload_module(void)
{
/* First, take us out of the channel loop */
ast_channel_unregister(&nbs_tech);
return 0;
}
-static int unload_module(void *mod)
-{
- return __unload_module();
-}
-
-static int load_module(void *mod)
+static int load_module(void)
{
/* Make sure we can register our channel type */
if (ast_channel_register(&nbs_tech)) {
ast_log(LOG_ERROR, "Unable to register channel class %s\n", type);
- __unload_module();
return -1;
}
return 0;
}
-static const char *description(void)
-{
- return (char *) desc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Network Broadcast Sound Support");
return NULL;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int i;
struct ast_config *cfg;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct chan_oss_pvt *o;
return 0;
}
-static const char *description(void)
-{
- return (char *)oss_tech.description;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
-
-
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "OSS Console Channel Driver");
#define PHONE_MAX_BUF 480
#define DEFAULT_GAIN 0x100
-static const char desc[] = "Linux Telephony API Support";
static const char tdesc[] = "Standard Linux Telephony API Driver";
static const char config[] = "phone.conf";
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return __unload_module();
}
-static int load_module(void *mod)
+static int load_module(void)
{
struct ast_config *cfg;
struct ast_variable *v;
return 0;
}
-static const char *description(void)
-{
- return (char *) desc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
-
-
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Linux Telephony API Support");
};
static struct ast_jb_conf global_jbconf;
-static const char tdesc[] = "Session Initiation Protocol (SIP)";
static const char config[] = "sip.conf";
static const char notify_config[] = "sip_notify.conf";
static int usecnt = 0;
}
/*! \brief reload: Part of Asterisk module interface */
-static int reload(void *mod)
+static int reload(void)
{
return sip_reload(0, 0, NULL);
}
};
/*! \brief load_module: PBX load module - initialization */
-static int load_module(void *mod)
+static int load_module(void)
{
ASTOBJ_CONTAINER_INIT(&userl); /* User object list */
ASTOBJ_CONTAINER_INIT(&peerl); /* Peer object list */
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct sip_pvt *p, *pl;
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return (char *) tdesc;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Session Initiation Protocol (SIP)",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
ast_mutex_unlock(&devicelock);
}
-static int reload(void *mod)
+static int reload(void)
{
delete_devices();
reload_config();
return 0;
}
-
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
#if 0
struct skinnysession *s;
return -1;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return "Skinny Client Control Protocol (Skinny)";
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Skinny Client Control Protocol (Skinny)",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
#ifdef HAVE_PRI
int y;
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
}
-static int reload(void *mod)
+static int reload(void)
{
int res = 0;
return 0;
}
-static const char *description(void)
-{
- return "Zapata Telephony"
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Zapata Telephony"
#ifdef ZAPATA_PRI
" w/PRI"
#endif
- ;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+ ,
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
STDCCFLAGS += -DNDEBUG
STDCCFLAGS += $(shell grep ^DEBUG_THREADS ../../Makefile | sed -e "s/^DEBUG_THREADS[ ]*=//" -e "s/\([^\#]*\)\#.*/\1/")
STDCCFLAGS += -I../../include -include autoconfig.h
-STDCCFLAGS += -fPIC
#OPTCCFLAGS +=
CFLAGS += -pipe
TARGET += libchanh323.a
#
-# Makefile
+# Makefile for chan_misdn support
#
-# Make file for chan_misdn support
-#
-
-# Verify those options with main Makefile
-CFLAGS = -pipe -c -Wall -ggdb
-ifeq ($(shell uname -m),x86_64)
-CFLAGS += -fPIC
-endif
-SOURCES = isdn_lib.c isdn_msg_parser.c
-OBJDIR = .
-OBJS = isdn_lib.o isdn_msg_parser.o
-
-all: chan_misdn_lib.a
+all:
%.o: %.c
- $(CC) $(CFLAGS) -o $@ $<
-
-chan_misdn_lib.a: $(OBJS)
- ar crv $@ $(OBJS)
-
+ $(CC) $(CFLAGS) -c -o $@ $<
portinfo: portinfo.o
- $(CC) -L/usr/lib -o $@ $^ -lisdnnet -lmISDN -lpthread
-
+ $(CC) -o $@ $^ -lisdnnet -lmISDN -lpthread
clean:
rm -rf *.a *.o *.so portinfo
/* IE_COMPLETE */
-void enc_ie_complete(unsigned char **ntmode, msg_t *msg, int complete, int nt, struct misdn_bchannel *bc)
+#if 0
+static void enc_ie_complete(unsigned char **ntmode, msg_t *msg, int complete, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
p[0] = IE_COMPLETE;
}
}
+#endif
-void dec_ie_complete(unsigned char *p, Q931_info_t *qi, int *complete, int nt, struct misdn_bchannel *bc)
+static void dec_ie_complete(unsigned char *p, Q931_info_t *qi, int *complete, int nt, struct misdn_bchannel *bc)
{
*complete = 0;
if (!nt)
/* IE_BEARER */
-void enc_ie_bearer(unsigned char **ntmode, msg_t *msg, int coding, int capability, int mode, int rate, int multi, int user, int nt, struct misdn_bchannel *bc)
+static void enc_ie_bearer(unsigned char **ntmode, msg_t *msg, int coding, int capability, int mode, int rate, int multi, int user, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
p[4+(multi>=0)] = 0xa0 + user;
}
-void dec_ie_bearer(unsigned char *p, Q931_info_t *qi, int *coding, int *capability, int *mode, int *rate, int *multi, int *user,
+static void dec_ie_bearer(unsigned char *p, Q931_info_t *qi, int *coding, int *capability, int *mode, int *rate, int *multi, int *user,
int *async, int *urate, int *stopbits, int *dbits, int *parity, int nt, struct misdn_bchannel *bc)
{
int octet;
/* IE_CALL_ID */
-void enc_ie_call_id(unsigned char **ntmode, msg_t *msg, char *callid, int callid_len, int nt, struct misdn_bchannel *bc)
+#if 0
+static void enc_ie_call_id(unsigned char **ntmode, msg_t *msg, char *callid, int callid_len, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
p[1] = l;
memcpy(p+2, callid, callid_len);
}
+#endif
-void dec_ie_call_id(unsigned char *p, Q931_info_t *qi, char *callid, int *callid_len, int nt, struct misdn_bchannel *bc)
+#if 0
+static void dec_ie_call_id(unsigned char *p, Q931_info_t *qi, char *callid, int *callid_len, int nt, struct misdn_bchannel *bc)
{
char debug[25];
int i;
if (MISDN_IE_DEBG) printf(" callid%s\n", debug);
}
-
+#endif
/* IE_CALLED_PN */
-void enc_ie_called_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, char *number, int nt, struct misdn_bchannel *bc)
+static void enc_ie_called_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, char *number, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
strncpy((char *)p+3, (char *)number, strlen((char *)number));
}
-void dec_ie_called_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, char *number, int number_len, int nt, struct misdn_bchannel *bc)
+static void dec_ie_called_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, char *number, int number_len, int nt, struct misdn_bchannel *bc)
{
*type = -1;
*plan = -1;
/* IE_CALLING_PN */
-void enc_ie_calling_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc)
+static void enc_ie_calling_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
}
}
-void dec_ie_calling_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc)
+static void dec_ie_calling_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc)
{
*type = -1;
*plan = -1;
/* IE_CONNECTED_PN */
-void enc_ie_connected_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc)
+static void enc_ie_connected_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
}
}
-void dec_ie_connected_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc)
+static void dec_ie_connected_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc)
{
*type = -1;
*plan = -1;
/* IE_CAUSE */
-void enc_ie_cause(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc)
+static void enc_ie_cause(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
p[2] = 0x80 + location;
p[3] = 0x80 + cause;
}
-void enc_ie_cause_standalone(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc)
+
+#if 0
+static void enc_ie_cause_standalone(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc)
{
unsigned char *p = msg_put(msg, 4);
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
p[2] = 0x80 + location;
p[3] = 0x80 + cause;
}
+#endif
-
-void dec_ie_cause(unsigned char *p, Q931_info_t *qi, int *location, int *cause, int nt, struct misdn_bchannel *bc)
+static void dec_ie_cause(unsigned char *p, Q931_info_t *qi, int *location, int *cause, int nt, struct misdn_bchannel *bc)
{
*location = -1;
*cause = -1;
/* IE_CHANNEL_ID */
-void enc_ie_channel_id(unsigned char **ntmode, msg_t *msg, int exclusive, int channel, int nt, struct misdn_bchannel *bc)
+static void enc_ie_channel_id(unsigned char **ntmode, msg_t *msg, int exclusive, int channel, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
}
}
-void dec_ie_channel_id(unsigned char *p, Q931_info_t *qi, int *exclusive, int *channel, int nt, struct misdn_bchannel *bc)
+static void dec_ie_channel_id(unsigned char *p, Q931_info_t *qi, int *exclusive, int *channel, int nt, struct misdn_bchannel *bc)
{
struct misdn_stack *stack=get_stack_by_bc(bc);
int pri =stack->pri;
/* IE_DATE */
-void enc_ie_date(unsigned char **ntmode, msg_t *msg, time_t ti, int nt, struct misdn_bchannel *bc)
+static void enc_ie_date(unsigned char **ntmode, msg_t *msg, time_t ti, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
/* IE_DISPLAY */
-void enc_ie_display(unsigned char **ntmode, msg_t *msg, char *display, int nt, struct misdn_bchannel *bc)
+static void enc_ie_display(unsigned char **ntmode, msg_t *msg, char *display, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
strncpy((char *)p+2, (char *)display, strlen((char *)display));
}
-void dec_ie_display(unsigned char *p, Q931_info_t *qi, char *display, int display_len, int nt, struct misdn_bchannel *bc)
+#if 0
+static void dec_ie_display(unsigned char *p, Q931_info_t *qi, char *display, int display_len, int nt, struct misdn_bchannel *bc)
{
*display = '\0';
if (MISDN_IE_DEBG) printf(" display='%s'\n", display);
}
-
+#endif
/* IE_KEYPAD */
-void enc_ie_keypad(unsigned char **ntmode, msg_t *msg, char *keypad, int nt, struct misdn_bchannel *bc)
+#if 0
+static void enc_ie_keypad(unsigned char **ntmode, msg_t *msg, char *keypad, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
p[1] = l;
strncpy((char *)p+2, (char *)keypad, strlen((char *)keypad));
}
+#endif
-void dec_ie_keypad(unsigned char *p, Q931_info_t *qi, char *keypad, int keypad_len, int nt, struct misdn_bchannel *bc)
+static void dec_ie_keypad(unsigned char *p, Q931_info_t *qi, char *keypad, int keypad_len, int nt, struct misdn_bchannel *bc)
{
*keypad = '\0';
/* IE_NOTIFY */
-void enc_ie_notify(unsigned char **ntmode, msg_t *msg, int notify, int nt, struct misdn_bchannel *bc)
+#if 0
+static void enc_ie_notify(unsigned char **ntmode, msg_t *msg, int notify, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
p[1] = l;
p[2] = 0x80 + notify;
}
+#endif
-void dec_ie_notify(unsigned char *p, Q931_info_t *qi, int *notify, int nt, struct misdn_bchannel *bc)
+#if 0
+static void dec_ie_notify(unsigned char *p, Q931_info_t *qi, int *notify, int nt, struct misdn_bchannel *bc)
{
*notify = -1;
if (MISDN_IE_DEBG) printf(" notify=%d\n", *notify);
}
+#endif
/* IE_PROGRESS */
-void enc_ie_progress(unsigned char **ntmode, msg_t *msg, int coding, int location, int progress, int nt, struct misdn_bchannel *bc)
+static void enc_ie_progress(unsigned char **ntmode, msg_t *msg, int coding, int location, int progress, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
p[3] = 0x80 + progress;
}
-void dec_ie_progress(unsigned char *p, Q931_info_t *qi, int *coding, int *location, int *progress, int nt, struct misdn_bchannel *bc)
+static void dec_ie_progress(unsigned char *p, Q931_info_t *qi, int *coding, int *location, int *progress, int nt, struct misdn_bchannel *bc)
{
*coding = -1;
*location = -1;
/* IE_REDIR_NR (redirecting = during MT_SETUP) */
-void enc_ie_redir_nr(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, int reason, char *number, int nt, struct misdn_bchannel *bc)
+static void enc_ie_redir_nr(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, int reason, char *number, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
}
}
-void dec_ie_redir_nr(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, int *reason, char *number, int number_len, int nt, struct misdn_bchannel *bc)
+static void dec_ie_redir_nr(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, int *reason, char *number, int number_len, int nt, struct misdn_bchannel *bc)
{
*type = -1;
*plan = -1;
/* IE_REDIR_DN (redirection = during MT_NOTIFY) */
-void enc_ie_redir_dn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, char *number, int nt, struct misdn_bchannel *bc)
+#if 0
+static void enc_ie_redir_dn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, char *number, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
/* Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); */
strncpy((char *)p+3, (char *)number, strlen((char *)number));
}
}
+#endif
-void dec_ie_redir_dn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, char *number, int number_len, int nt, struct misdn_bchannel *bc)
+#if 0
+static void dec_ie_redir_dn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, char *number, int number_len, int nt, struct misdn_bchannel *bc)
{
*type = -1;
*plan = -1;
if (MISDN_IE_DEBG) printf(" type=%d plan=%d present=%d number='%s'\n", *type, *plan, *present, number);
}
-
+#endif
/* IE_USERUSER */
-void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, char *user, int user_len, int nt, struct misdn_bchannel *bc)
+#if 0
+static void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, char *user, int user_len, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
p[2] = 0x80 + protocol;
memcpy(p+3, user, user_len);
}
+#endif
-void dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, char *user, int *user_len, int nt, struct misdn_bchannel *bc)
+#if 0
+static void dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, char *user, int *user_len, int nt, struct misdn_bchannel *bc)
{
char debug[768];
int i;
if (MISDN_IE_DEBG) printf(" protocol=%d user-user%s\n", *protocol, debug);
}
-
-
-
+#endif
#include <syslog.h>
-#include "isdn_lib_intern.h"
#include <mISDNuser/isdn_debug.h>
+#include "isdn_lib_intern.h"
+#include "isdn_lib.h"
+
void misdn_join_conf(struct misdn_bchannel *bc, int conf_id);
void misdn_split_conf(struct misdn_bchannel *bc, int conf_id);
void manager_bchannel_setup (struct misdn_bchannel *bc);
void manager_bchannel_cleanup (struct misdn_bchannel *bc);
-int isdn_msg_get_index(struct isdn_msg msgs[], msg_t *frm, int nt);
-enum event_e isdn_msg_get_event(struct isdn_msg msgs[], msg_t *frm, int nt);
-int isdn_msg_parse_event(struct isdn_msg msgs[], msg_t *frm, struct misdn_bchannel *bc, int nt);
-char * isdn_get_info(struct isdn_msg msgs[], enum event_e event, int nt);
-msg_t * isdn_msg_build_event(struct isdn_msg msgs[], struct misdn_bchannel *bc, enum event_e event, int nt);
void ec_chunk( struct misdn_bchannel *bc, unsigned char *rxchunk, unsigned char *txchunk, int chunk_size);
/* end */
int bchdev_echocancel_activate(struct misdn_bchannel* dev);
static char flip_table[256];
-void init_flip_bits(void)
+static void init_flip_bits(void)
{
int i,k;
}
}
-char * flip_buf_bits ( char * buf , int len)
+static char * flip_buf_bits ( char * buf , int len)
{
int i;
char * start = buf;
-msg_t *create_l2msg(int prim, int dinfo, int size) /* NT only */
+static msg_t *create_l2msg(int prim, int dinfo, int size) /* NT only */
{
int i = 0;
msg_t *dmsg;
}
-int send_msg (int midev, struct misdn_bchannel *bc, msg_t *dmsg)
+static int send_msg (int midev, struct misdn_bchannel *bc, msg_t *dmsg)
{
iframe_t *frm;
frm = (iframe_t *)dmsg->data;
}
-void dump_chan_list(struct misdn_stack *stack)
+static void dump_chan_list(struct misdn_stack *stack)
{
int i;
return 0;
}
-int empty_chan_in_stack(struct misdn_stack *stack, int channel)
+static int empty_chan_in_stack(struct misdn_stack *stack, int channel)
{
if (channel<=0) {
cb_log(0,stack?stack->port:0, "empty_chan_inst_stack: cannot empty channel %d\n",channel);
}
}
-void bc_next_state_change(struct misdn_bchannel *bc, enum bchannel_state state)
+static void bc_next_state_change(struct misdn_bchannel *bc, enum bchannel_state state)
{
cb_log(5,bc->port,"BC_NEXT_STATE_CHANGE: from:%s to:%s\n",
bc_state2str(bc->next_bc_state),
}
-void empty_bc(struct misdn_bchannel *bc)
+static void empty_bc(struct misdn_bchannel *bc)
{
bc->bframe_len=0;
}
-int clean_up_bc(struct misdn_bchannel *bc)
+static int clean_up_bc(struct misdn_bchannel *bc)
{
int ret=0;
unsigned char buff[32];
-void clear_l3(struct misdn_stack *stack)
+static void clear_l3(struct misdn_stack *stack)
{
int i;
}
}
-int set_chan_in_stack(struct misdn_stack *stack, int channel)
+static int set_chan_in_stack(struct misdn_stack *stack, int channel)
{
cb_log(4,stack->port,"set_chan_in_stack: %d\n",channel);
return 0;
}
-int chan_in_stack_free(struct misdn_stack *stack, int channel)
+#if 0
+static int chan_in_stack_free(struct misdn_stack *stack, int channel)
{
if (stack->channels[channel-1])
return 0;
return 1;
}
-
+#endif
static int newteid=0;
#define MAXPROCS 0x100
-int misdn_lib_get_l1_down(struct misdn_stack *stack)
+static int misdn_lib_get_l1_down(struct misdn_stack *stack)
{
/* Pull Up L1 */
iframe_t act;
}
-int misdn_lib_get_l2_down(struct misdn_stack *stack)
+static int misdn_lib_get_l2_down(struct misdn_stack *stack)
{
if (stack->ptp && (stack->nt) ) {
}
-int misdn_lib_get_l1_up(struct misdn_stack *stack)
+static int misdn_lib_get_l1_up(struct misdn_stack *stack)
{
/* Pull Up L1 */
iframe_t act;
return 0;
}
-int misdn_lib_get_l2_te_ptp_up(struct misdn_stack *stack)
+#if 0
+static int misdn_lib_get_l2_te_ptp_up(struct misdn_stack *stack)
{
iframe_t act;
return mISDN_write(stack->midev, &act, mISDN_HEADER_LEN+act.len, TIMEOUT_1SEC);
return 0;
}
+#endif
-
-int misdn_lib_get_short_status(struct misdn_stack *stack)
+static int misdn_lib_get_short_status(struct misdn_stack *stack)
{
iframe_t act;
}
-struct misdn_stack * find_stack_by_addr(int addr)
+static struct misdn_stack * find_stack_by_addr(int addr)
{
struct misdn_stack *stack;
}
-struct misdn_stack * find_stack_by_port(int port)
+static struct misdn_stack * find_stack_by_port(int port)
{
struct misdn_stack *stack;
return NULL;
}
-struct misdn_stack * find_stack_by_mgr(manager_t* mgr_nt)
+static struct misdn_stack * find_stack_by_mgr(manager_t* mgr_nt)
{
struct misdn_stack *stack;
return NULL;
}
-struct misdn_bchannel *find_bc_by_masked_l3id(struct misdn_stack *stack, unsigned long l3id, unsigned long mask)
+static struct misdn_bchannel *find_bc_by_masked_l3id(struct misdn_stack *stack, unsigned long l3id, unsigned long mask)
{
int i;
for (i=0; i<stack->b_num; i++) {
return stack_holder_find(stack,l3id);
}
-struct misdn_bchannel *find_bc_holded(struct misdn_stack *stack)
+static struct misdn_bchannel *find_bc_holded(struct misdn_stack *stack)
{
int i;
for (i=0; i<stack->b_num; i++) {
}
-struct misdn_bchannel *find_bc_by_addr(unsigned long addr)
+static struct misdn_bchannel *find_bc_by_addr(unsigned long addr)
{
struct misdn_stack* stack;
int i;
}
-struct misdn_bchannel *find_bc_by_channel(int port, int channel)
+static struct misdn_bchannel *find_bc_by_channel(int port, int channel)
{
struct misdn_stack* stack=find_stack_by_port(port);
int i;
-int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_t *frm)
+static int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_t *frm)
{
struct misdn_stack *stack=get_stack_by_bc(bc);
return 0;
}
-int handle_new_process(struct misdn_stack *stack, iframe_t *frm)
+static int handle_new_process(struct misdn_stack *stack, iframe_t *frm)
{
struct misdn_bchannel* bc=misdn_lib_get_free_bc(stack->port, 0);
return 0;
}
-int handle_cr ( struct misdn_stack *stack, iframe_t *frm)
+static int handle_cr ( struct misdn_stack *stack, iframe_t *frm)
{
if (!stack) return -1;
}
-int handle_timers(msg_t* msg)
+static int handle_timers(msg_t* msg)
{
iframe_t *frm= (iframe_t*)msg->data;
struct misdn_stack *stack;
}
}
-int handle_bchan(msg_t *msg)
+static int handle_bchan(msg_t *msg)
{
iframe_t *frm= (iframe_t*)msg->data;
-int handle_frm_nt(msg_t *msg)
+static int handle_frm_nt(msg_t *msg)
{
iframe_t *frm= (iframe_t*)msg->data;
struct misdn_stack *stack;
}
-int handle_frm(msg_t *msg)
+static int handle_frm(msg_t *msg)
{
iframe_t *frm = (iframe_t*) msg->data;
}
-int handle_l1(msg_t *msg)
+static int handle_l1(msg_t *msg)
{
iframe_t *frm = (iframe_t*) msg->data;
struct misdn_stack *stack = find_stack_by_addr(frm->addr);
return 0;
}
-int handle_l2(msg_t *msg)
+static int handle_l2(msg_t *msg)
{
iframe_t *frm = (iframe_t*) msg->data;
return 0;
}
-int handle_mgmt(msg_t *msg)
+static int handle_mgmt(msg_t *msg)
{
iframe_t *frm = (iframe_t*) msg->data;
}
-msg_t *fetch_msg(int midev)
+static msg_t *fetch_msg(int midev)
{
msg_t *msg=alloc_msg(MAX_MSG_SIZE);
int r;
-void prepare_bc(struct misdn_bchannel*bc, int channel)
+static void prepare_bc(struct misdn_bchannel*bc, int channel)
{
bc->channel = channel;
bc->channel_preselected = channel?1:0;
}
-char *fac2str (enum FacFunction func) {
+static char *fac2str (enum FacFunction func)
+{
struct arr_el {
enum FacFunction p;
char *s ;
}
-int handle_err(msg_t *msg)
+static int handle_err(msg_t *msg)
{
iframe_t *frm = (iframe_t*) msg->data;
return 0;
}
-
-int queue_l2l3(msg_t *msg) {
+#if 0
+static int queue_l2l3(msg_t *msg)
+{
iframe_t *frm= (iframe_t*)msg->data;
struct misdn_stack *stack;
stack=find_stack_by_addr( frm->addr );
sem_post(&glob_mgr->new_msg);
return 1;
}
+#endif
int manager_isdn_handler(iframe_t *frm ,msg_t *msg)
{
sem_t handler_started;
-void manager_event_handler(void *arg)
+static void manager_event_handler(void *arg)
{
sem_post(&handler_started);
while (1) {
};
struct misdn_bchannel **bc;
- for (bc=bc_list; *bc; *bc++) {
+ for (bc=bc_list; *bc; bc++) {
(*bc)->conf_id=conf_id;
cb_log(1, (*bc)->port, " --> bc_addr:%x\n",(*bc)->addr);
};
struct misdn_bchannel **bc;
- for (bc=bc_list; *bc; *bc++) {
+ for (bc=bc_list; *bc; bc++) {
if ( (*bc)->bc_state == BCHAN_BRIDGED){
misdn_split_conf( *bc, (*bc)->conf_id);
} else {
void bc_state_change(struct misdn_bchannel *bc, enum bchannel_state state);
-
#endif
#include "isdn_lib.h"
-
#if !defined MISDNUSER_VERSION_CODE || (MISDNUSER_VERSION_CODE < MISDNUSER_VERSION(1, 0, 3))
#error "You need a newer version of mISDNuser ..."
#endif
struct misdn_stack* get_stack_by_bc(struct misdn_bchannel *bc);
+int isdn_msg_get_index(struct isdn_msg msgs[], msg_t *frm, int nt);
+enum event_e isdn_msg_get_event(struct isdn_msg msgs[], msg_t *frm, int nt);
+int isdn_msg_parse_event(struct isdn_msg msgs[], msg_t *frm, struct misdn_bchannel *bc, int nt);
+char * isdn_get_info(struct isdn_msg msgs[], enum event_e event, int nt);
+msg_t * isdn_msg_build_event(struct isdn_msg msgs[], struct misdn_bchannel *bc, enum event_e event, int nt);
+int isdn_msg_get_index_by_event(struct isdn_msg msgs[], enum event_e event, int nt);
+char * isdn_msg_get_info(struct isdn_msg msgs[], msg_t *msg, int nt);
#endif
#include "ie.c"
-void set_channel(struct misdn_bchannel *bc, int channel) {
+static void set_channel(struct misdn_bchannel *bc, int channel)
+{
cb_log(3,bc->port,"set_channel: bc->channel:%d channel:%d\n", bc->channel, channel);
}
}
-void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
CALL_PROCEEDING_t *proceeding=(CALL_PROCEEDING_t*)((unsigned long)msg->data+ HEADER_LEN);
printf("Parsing PROCEEDING Msg\n");
#endif
}
-msg_t *build_proceeding (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_proceeding (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
CALL_PROCEEDING_t *proceeding;
return msg;
}
-void parse_alerting (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_alerting (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
ALERTING_t *alerting=(ALERTING_t*)((unsigned long)(msg->data+HEADER_LEN));
}
-msg_t *build_alerting (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_alerting (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
ALERTING_t *alerting;
}
-void parse_progress (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_progress (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
PROGRESS_t *progress=(PROGRESS_t*)((unsigned long)(msg->data+HEADER_LEN));
#endif
}
-msg_t *build_progress (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_progress (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
PROGRESS_t *progress;
return msg;
}
-void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SETUP_t *setup= (SETUP_t*)((unsigned long)msg->data+HEADER_LEN);
}
#define ANY_CHANNEL 0xff /* IE attribut for 'any channel' */
-msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SETUP_t *setup;
return msg;
}
-void parse_connect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_connect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
CONNECT_t *connect=(CONNECT_t*)((unsigned long)(msg->data+HEADER_LEN));
printf("Parsing CONNECT Msg\n");
#endif
}
-msg_t *build_connect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_connect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
CONNECT_t *connect;
return msg;
}
-void parse_setup_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_setup_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SETUP_ACKNOWLEDGE_t *setup_acknowledge=(SETUP_ACKNOWLEDGE_t*)((unsigned long)(msg->data+HEADER_LEN));
}
-msg_t *build_setup_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_setup_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SETUP_ACKNOWLEDGE_t *setup_acknowledge;
return msg;
}
-void parse_connect_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_connect_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing CONNECT_ACKNOWLEDGE Msg\n");
}
-msg_t *build_connect_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_connect_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
CONNECT_ACKNOWLEDGE_t *connect_acknowledge;
return msg;
}
-void parse_user_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_user_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing USER_INFORMATION Msg\n");
}
-msg_t *build_user_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_user_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
USER_INFORMATION_t *user_information;
return msg;
}
-void parse_suspend_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_suspend_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing SUSPEND_REJECT Msg\n");
}
-msg_t *build_suspend_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_suspend_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SUSPEND_REJECT_t *suspend_reject;
return msg;
}
-void parse_resume_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_resume_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing RESUME_REJECT Msg\n");
}
-msg_t *build_resume_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_resume_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RESUME_REJECT_t *resume_reject;
return msg;
}
-void parse_hold (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_hold (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing HOLD Msg\n");
}
-msg_t *build_hold (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_hold (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
HOLD_t *hold;
return msg;
}
-void parse_suspend (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_suspend (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing SUSPEND Msg\n");
}
-msg_t *build_suspend (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_suspend (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SUSPEND_t *suspend;
return msg;
}
-void parse_resume (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_resume (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing RESUME Msg\n");
}
-msg_t *build_resume (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_resume (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RESUME_t *resume;
return msg;
}
-void parse_hold_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_hold_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing HOLD_ACKNOWLEDGE Msg\n");
}
-msg_t *build_hold_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_hold_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
HOLD_ACKNOWLEDGE_t *hold_acknowledge;
return msg;
}
-void parse_suspend_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_suspend_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing SUSPEND_ACKNOWLEDGE Msg\n");
}
-msg_t *build_suspend_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_suspend_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SUSPEND_ACKNOWLEDGE_t *suspend_acknowledge;
return msg;
}
-void parse_resume_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_resume_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing RESUME_ACKNOWLEDGE Msg\n");
}
-msg_t *build_resume_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_resume_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RESUME_ACKNOWLEDGE_t *resume_acknowledge;
return msg;
}
-void parse_hold_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_hold_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing HOLD_REJECT Msg\n");
}
-msg_t *build_hold_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_hold_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
HOLD_REJECT_t *hold_reject;
return msg;
}
-void parse_retrieve (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_retrieve (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing RETRIEVE Msg\n");
}
-msg_t *build_retrieve (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_retrieve (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RETRIEVE_t *retrieve;
return msg;
}
-void parse_retrieve_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_retrieve_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing RETRIEVE_ACKNOWLEDGE Msg\n");
}
-msg_t *build_retrieve_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_retrieve_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RETRIEVE_ACKNOWLEDGE_t *retrieve_acknowledge;
return msg;
}
-void parse_retrieve_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_retrieve_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing RETRIEVE_REJECT Msg\n");
}
-msg_t *build_retrieve_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_retrieve_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RETRIEVE_REJECT_t *retrieve_reject;
return msg;
}
-void parse_disconnect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_disconnect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
DISCONNECT_t *disconnect=(DISCONNECT_t*)((unsigned long)(msg->data+HEADER_LEN));
}
-msg_t *build_disconnect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_disconnect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
DISCONNECT_t *disconnect;
return msg;
}
-void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RESTART_t *restart=(RESTART_t*)((unsigned long)(msg->data+HEADER_LEN));
#endif
{
- int exclusive, channel;
+ int exclusive, channel = 0;
dec_ie_channel_id(restart->CHANNEL_ID, (Q931_info_t *)restart, &exclusive, &bc->restart_channel, nt,bc);
+ /* XXX: this is broken... channel is not used */
if (channel==0xff) /* any channel */
channel=-1;
cb_log(3, stack->port, "CC_RESTART Request on channel:%d on this port.\n");
}
-msg_t *build_restart (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_restart (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RESTART_t *restart;
return msg;
}
-void parse_release (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_release (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RELEASE_t *release=(RELEASE_t*)((unsigned long)(msg->data+HEADER_LEN));
}
-msg_t *build_release (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_release (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RELEASE_t *release;
return msg;
}
-void parse_release_complete (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_release_complete (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RELEASE_COMPLETE_t *release_complete=(RELEASE_COMPLETE_t*)((unsigned long)(msg->data+HEADER_LEN));
#endif
}
-msg_t *build_release_complete (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_release_complete (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RELEASE_COMPLETE_t *release_complete;
return msg;
}
-void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt ? mISDNUSER_HEAD_SIZE : mISDN_HEADER_LEN;
FACILITY_t *facility = (FACILITY_t*)(msg->data+HEADER_LEN);
}
}
-msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int len,
HEADER_LEN = nt ? mISDNUSER_HEAD_SIZE : mISDN_HEADER_LEN;
return msg;
}
-void parse_notify (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_notify (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing NOTIFY Msg\n");
#endif
}
-msg_t *build_notify (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_notify (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
NOTIFY_t *notify;
return msg;
}
-void parse_status_enquiry (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_status_enquiry (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing STATUS_ENQUIRY Msg\n");
#endif
}
-msg_t *build_status_enquiry (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_status_enquiry (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
STATUS_ENQUIRY_t *status_enquiry;
return msg;
}
-void parse_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
INFORMATION_t *information=(INFORMATION_t*)((unsigned long)(msg->data+HEADER_LEN));
#endif
}
-msg_t *build_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
INFORMATION_t *information;
return msg;
}
-void parse_status (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_status (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
STATUS_t *status=(STATUS_t*)((unsigned long)(msg->data+HEADER_LEN));
#endif
}
-msg_t *build_status (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_status (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
STATUS_t *status;
return msg;
}
-void parse_timeout (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_timeout (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing STATUS Msg\n");
#endif
}
-msg_t *build_timeout (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_timeout (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
STATUS_t *status;
return msgs[i].msg_builder(msgs, bc, nt);
}
-
# the GNU General Public License
#
-ifneq ($(wildcard ../menuselect.makeopts),)
+ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),)
include ../menuselect.makeopts
include ../menuselect.makedeps
endif
C_MODS:=$(filter-out $(MENUSELECT_CODECS),$(patsubst %.c,%,$(wildcard codec_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_CODECS),$(patsubst %.cc,%,$(wildcard codec_*.cc)))
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring codecs,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
LIBILBC:=ilbc/libilbc.a
LIBLPC10:=lpc10/liblpc10.a
all: _all
-ifeq ($(GSM_LIB),internal)
-GSM_INCLUDE:=-Igsm/inc
-GSM_LIB:=
+include $(ASTTOPDIR)/Makefile.moddir_rules
-codec_gsm.so: gsm/lib/libgsm.a
+ifneq ($(GSM_INTERNAL),)
+GSM_INCLUDE:=-Igsm/inc
+$(codec_gsm): gsm/lib/libgsm.a
endif
-include $(ASTTOPDIR)/Makefile.moddir_rules
-
clean::
$(MAKE) -C gsm clean
$(MAKE) -C lpc10 clean
gsm/lib/libgsm.a:
@mkdir -p gsm/lib
- @CFLAGS="$(CFLAGS) -I." $(MAKE) -C gsm lib/libgsm.a
+ @CFLAGS="$(OTHER_SUBDIR_CFLAGS) -I." $(MAKE) -C gsm lib/libgsm.a
$(LIBLPC10):
- @$(MAKE) -C lpc10 all
+ @CFLAGS="$(OTHER_SUBDIR_CFLAGS)" $(MAKE) -C lpc10 all
-codec_lpc10.so: $(LIBLPC10)
+$(codec_lpc10): $(LIBLPC10)
$(LIBILBC):
- @$(MAKE) -C ilbc all
+ @CFLAGS="$(OTHER_SUBDIR_CFLAGS)" $(MAKE) -C ilbc all
-codec_ilbc.so: $(LIBILBC)
+$(codec_ilbc): $(LIBILBC)
/*! \brief standard module glue */
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&ulawtoalaw);
res |= ast_unregister_translator(&alawtoulaw);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
int x;
+
for (x=0;x<256;x++) {
mu2a[x] = AST_LIN2A(AST_MULAW(x));
a2mu[x] = AST_LIN2MU(AST_ALAW(x));
}
- res = ast_register_translator(&alawtoulaw, mod);
+ res = ast_register_translator(&alawtoulaw);
if (!res)
- res = ast_register_translator(&ulawtoalaw, mod);
+ res = ast_register_translator(&ulawtoalaw);
else
ast_unregister_translator(&alawtoulaw);
- return res;
-}
-static const char *description(void)
-{
- return "A-law and Mulaw direct Coder/Decoder";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
+ return res;
}
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "A-law and Mulaw direct Coder/Decoder");
}
/*! \brief standard module glue */
-static int reload(void *mod)
+static int reload(void)
{
parse_config();
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&lintoadpcm);
res |= ast_unregister_translator(&adpcmtolin);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
+
parse_config();
- res = ast_register_translator(&adpcmtolin, mod);
+ res = ast_register_translator(&adpcmtolin);
if (!res)
- res = ast_register_translator(&lintoadpcm, mod);
+ res = ast_register_translator(&lintoadpcm);
else
ast_unregister_translator(&adpcmtolin);
- return res;
-}
-static const char *description(void)
-{
- return "Adaptive Differential PCM Coder/Decoder";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
+ return res;
}
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Adaptive Differential PCM Coder/Decoder",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
/*! \brief standard module stuff */
-static int reload(void *mod)
+static int reload(void)
{
parse_config();
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&lintoalaw);
res |= ast_unregister_translator(&alawtolin);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
+
parse_config();
- res = ast_register_translator(&alawtolin, mod);
+ res = ast_register_translator(&alawtolin);
if (!res)
- res = ast_register_translator(&lintoalaw, mod);
+ res = ast_register_translator(&lintoalaw);
else
ast_unregister_translator(&alawtolin);
- return res;
-}
-static const char *description(void)
-{
- return "A-law Coder/Decoder";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
+ return res;
}
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "A-law Coder/Decoder",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
ast_config_destroy(cfg);
}
-static int reload(void *mod)
+static int reload(void)
{
parse_config();
return 0;
}
-static int unload_module (void *mod)
+static int unload_module(void)
{
int res = 0;
return res;
}
-static int load_module (void *mod)
+static int load_module(void)
{
int res = 0;
+
parse_config();
- res |= ast_register_translator(&g726tolin, mod);
- res |= ast_register_translator(&lintog726, mod);
+ res |= ast_register_translator(&g726tolin);
+ res |= ast_register_translator(&lintog726);
- res |= ast_register_translator(&g726aal2tolin, mod);
- res |= ast_register_translator(&lintog726aal2, mod);
+ res |= ast_register_translator(&g726aal2tolin);
+ res |= ast_register_translator(&lintog726aal2);
- res |= ast_register_translator(&g726aal2tog726, mod);
- res |= ast_register_translator(&g726tog726aal2, mod);
+ res |= ast_register_translator(&g726aal2tog726);
+ res |= ast_register_translator(&g726tog726aal2);
if (res)
- unload_module(mod);
+ unload_module();
return res;
}
-static const char *description(void)
-{
- return "ITU G.726-32kbps G726 Transcoder";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "ITU G.726-32kbps G726 Transcoder",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
}
/*! \brief standard module glue */
-static int reload(void *mod)
+static int reload(void)
{
parse_config();
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&lintogsm);
if (!res)
res = ast_unregister_translator(&gsmtolin);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
+
parse_config();
- res = ast_register_translator(&gsmtolin, mod);
+ res = ast_register_translator(&gsmtolin);
if (!res)
- res=ast_register_translator(&lintogsm, mod);
+ res=ast_register_translator(&lintogsm);
else
ast_unregister_translator(&gsmtolin);
- return res;
-}
-static const char *description(void)
-{
- return "GSM/PCM16 (signed linear) Codec Translator";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
+ return res;
}
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "GSM Coder/Decoder",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
#define ILBC_SAMPLES 240 /* 30ms at 8000 hz */
#define BUFFER_SAMPLES 8000
-static char *tdesc = "iLBC/PCM16 (signed linear) Codec Translator";
-
struct ilbc_coder_pvt {
iLBC_Enc_Inst_t enc;
iLBC_Dec_Inst_t dec;
.buf_size = (BUFFER_SAMPLES * ILBC_FRAME_LEN + ILBC_SAMPLES - 1) / ILBC_SAMPLES,
};
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&lintoilbc);
res |= ast_unregister_translator(&ilbctolin);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
- res = ast_register_translator(&ilbctolin, mod);
+
+ res = ast_register_translator(&ilbctolin);
if (!res)
- res=ast_register_translator(&lintoilbc, mod);
+ res=ast_register_translator(&lintoilbc);
else
ast_unregister_translator(&ilbctolin);
- return res;
-}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
+ return res;
}
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "iLBC Coder/Decoder");
ast_config_destroy(cfg);
}
-static int reload(void *mod)
+static int reload(void)
{
parse_config();
+
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&lintolpc10);
res |= ast_unregister_translator(&lpc10tolin);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
+
parse_config();
- res=ast_register_translator(&lpc10tolin, mod);
+ res=ast_register_translator(&lpc10tolin);
if (!res)
- res=ast_register_translator(&lintolpc10, mod);
+ res=ast_register_translator(&lintolpc10);
else
ast_unregister_translator(&lpc10tolin);
- return res;
-}
-static const char *description(void)
-{
- return "LPC10 2.4kbps (signed linear) Voice Coder";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
+ return res;
}
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "LPC10 2.4kbps Coder/Decoder",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
ast_config_destroy(cfg);
}
-static int reload(void *mod)
+static int reload(void)
{
- /*
- * XXX reloading while there are active sessions is
- * somewhat silly because the old state presumably
- * wouldn't work anymore...
- * maybe we shuld do a standard hangup localusers ?
- */
- ast_mutex_lock(&__mod_desc->lock);
parse_config();
- ast_mutex_lock(&__mod_desc->lock);
+
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&lintospeex);
res |= ast_unregister_translator(&speextolin);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
+
parse_config();
- res=ast_register_translator(&speextolin, mod);
+ res=ast_register_translator(&speextolin);
if (!res)
- res=ast_register_translator(&lintospeex, mod);
+ res=ast_register_translator(&lintospeex);
else
ast_unregister_translator(&speextolin);
- return res;
-}
-static const char *description(void)
-{
- return "Speex/PCM16 (signed linear) Codec Translator";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
+ return res;
}
-STD_MOD(MOD_1, reload, NULL, NULL);
-
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Speex Coder/Decoder",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
ast_config_destroy(cfg);
}
-static int reload(void *mod)
+static int reload(void)
{
parse_config();
+
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&lintoulaw);
res |= ast_unregister_translator(&ulawtolin);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
+
parse_config();
- res = ast_register_translator(&ulawtolin, mod);
+ res = ast_register_translator(&ulawtolin);
if (!res)
- res = ast_register_translator(&lintoulaw, mod);
+ res = ast_register_translator(&lintoulaw);
else
ast_unregister_translator(&ulawtolin);
- return res;
-}
-
-/*
- * Return a description of this module.
- */
-static const char *description(void)
-{
- return "Mu-law Coder/Decoder";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
+ return res;
}
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "mu-Law Coder/Decoder",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
return &f;
}
-static int register_translator(int dst, int src, void *mod)
+static int register_translator(int dst, int src)
{
struct translator *zt;
int res;
zt->t.useplc = global_useplc;
zt->t.buf_size = BUFFER_SAMPLES * 2;
zt->t.desc_size = sizeof(struct pvt);
- if ((res = ast_register_translator(&zt->t, mod))) {
+ if ((res = ast_register_translator(&zt->t))) {
free(zt);
return -1;
}
ast_config_destroy(cfg);
}
-static void build_translators(void *mod, struct format_map *map, unsigned int dstfmts, unsigned int srcfmts)
+static void build_translators(struct format_map *map, unsigned int dstfmts, unsigned int srcfmts)
{
unsigned int src, dst;
if (global_format_map.map[dst][src])
continue;
- if (!register_translator(dst, src, mod))
+ if (!register_translator(dst, src))
map->map[dst][src] = 1;
}
}
}
-static int find_transcoders(void *mod)
+static int find_transcoders(void)
{
struct zt_transcode_info info = { 0, };
struct format_map map = { { { 0 } } };
for (info.tcnum = 0; !(res = ioctl(fd, ZT_TRANSCODE_OP, &info)); info.tcnum++) {
if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "Found transcoder '%s'.\n", info.name);
- build_translators(mod, &map, info.dstfmts, info.srcfmts);
+ build_translators(&map, info.dstfmts, info.srcfmts);
}
close(fd);
return 0;
}
-static int reload(void *mod)
+static int reload(void)
{
struct translator *cur;
parse_config();
- find_transcoders(mod);
+ find_transcoders();
AST_LIST_LOCK(&translators);
AST_LIST_TRAVERSE(&translators, cur, entry)
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
unregister_translators();
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
parse_config();
- find_transcoders(mod);
+ find_transcoders();
return 0;
}
-static const char *description(void)
-{
- return "Generic Zaptel Transcoder Codec Translator";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Generic Zaptel Transcoder Codec Translator",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
######### probably require gcc.
ifeq (, $(findstring $(OSARCH) , Darwin SunOS ))
-ifeq (, $(findstring $(PROC) , x86_64 amd64 ultrasparc sparc64 arm ppc ppc64 ia64 s390))
+ifeq (, $(findstring $(PROC) , x86_64 amd64 ultrasparc sparc64 arm ppc ppc64 ia64 s390 bfin ))
ifeq (, $(findstring $(shell uname -m) , ppc ppc64 alpha armv4l s390 ))
OPTIMIZE+=-march=$(PROC)
endif
# XXX should merge with GSM_OBJECTS
ifeq (${OSARCH},Linux)
ifeq (,$(findstring $(shell uname -m) , x86_64 amd64 ppc ppc64 alpha armv4l sparc64 parisc s390 ))
-ifeq (,$(findstring ${PROC} , arm ia64 s390 ))
+ifeq (,$(findstring ${PROC} , arm ia64 s390 bfin ))
GSM_SOURCES+= $(SRC)/k6opt.s
endif
endif
ifeq (${OSARCH},Linux)
ifeq (,$(findstring $(shell uname -m) , x86_64 amd64 ppc ppc64 alpha armv4l sparc64 parisc ))
-ifeq (,$(findstring ${PROC} , arm ia64 ))
+ifeq (,$(findstring ${PROC} , arm ia64 bfin ))
GSM_OBJECTS+= $(SRC)/k6opt.o
endif
endif
#! /bin/sh
-# From configure.ac Revision: 40335 .
+# From configure.ac Revision: 40597 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.60.
#
PACKAGE_BUGREPORT=
ac_unique_file="asterisk"
-ac_unique_file="asterisk.c"
+ac_unique_file="main/asterisk.c"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
host_cpu
host_vendor
host_os
-target
-target_cpu
-target_vendor
-target_os
-PBX_PLATFORM
-PBX_CPU
-PBX_VENDOR
-PBX_OS
+BUILD_PLATFORM
+BUILD_CPU
+BUILD_VENDOR
+BUILD_OS
+HOST_PLATFORM
+HOST_CPU
+HOST_VENDOR
+HOST_OS
UNAME
PBX_OSREV
-OSISWIN32
-PBX_OSTYPE
CC
CXX
+LD
RANLIB
AR
-NM
-WINDRES
-DLLWRAP
CFLAGS
LDFLAGS
CPPFLAGS
CURSES_LIB
CURSES_INCLUDE
PBX_CURSES
+GNUTLS_LIB
+GNUTLS_INCLUDE
+PBX_GNUTLS
GSM_LIB
GSM_INCLUDE
PBX_GSM
IMAP_TK_LIB
IMAP_TK_INCLUDE
PBX_IMAP_TK
+ISDNNET_LIB
+ISDNNET_INCLUDE
+PBX_ISDNNET
KDE_LIB
KDE_INCLUDE
PBX_KDE
+MISDN_LIB
+MISDN_INCLUDE
+PBX_MISDN
NBS_LIB
NBS_INCLUDE
PBX_NBS
SQLITE_LIB
SQLITE_INCLUDE
PBX_SQLITE
+SUPPSERV_LIB
+SUPPSERV_INCLUDE
+PBX_SUPPSERV
OPENSSL_LIB
OPENSSL_INCLUDE
PBX_OPENSSL
EGREP
LIBOBJS
POW_LIB
+GSM_INTERNAL
KDEINIT
KDEDIR
NETSNMP_CONFIG
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
- --target=TARGET configure for building compilers for TARGET [HOST]
_ACEOF
fi
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-asound=PATH use Advanced Linux Sound Architecture files in PATH
--with-curses=PATH use curses files in PATH
+ --with-gnutls=PATH use GNU TLS support (used for iksemel only) files in
+ PATH
--with-gsm=PATH use GSM files in PATH , or 'internal'
--with-iksemel=PATH use Iksemel Jabber Library files in PATH
--with-imap=PATH use UW IMAP Toolkit files in PATH
+ --with-isdnnet=PATH use ISDN4Linux Library files in PATH
--with-kde=PATH use KDE files in PATH
+ --with-misdn=PATH use mISDN User Library files in PATH
--with-nbs=PATH use Network Broadcast Sound files in PATH
--with-ncurses=PATH use ncurses files in PATH
--with-netsnmp=PATH use Net-SNMP files in PATH
--with-radius=PATH use Radius Client files in PATH
--with-speex=PATH use Speex files in PATH
--with-sqlite=PATH use SQLite files in PATH
+ --with-suppserv=PATH use mISDN Supplemental Services files in PATH
--with-ssl=PATH use OpenSSL files in PATH
--with-tds=PATH use FreeTDS files in PATH
--with-termcap=PATH use Termcap files in PATH
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-{ echo "$as_me:$LINENO: checking target system type" >&5
-echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
-if test "${ac_cv_target+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "x$target_alias" = x; then
- ac_cv_target=$ac_cv_host
-else
- ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
-echo "${ECHO_T}$ac_cv_target" >&6; }
-case $ac_cv_target in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
-echo "$as_me: error: invalid value of canonical target" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-target=$ac_cv_target
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_target
-shift
-target_cpu=$1
-target_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-target_os=$*
-IFS=$ac_save_IFS
-case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
-
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-test -n "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
# check existence of the package
-case "${host}" in
- *freebsd*)
+case "${host_os}" in
+ freebsd)
ac_default_prefix=/usr/local
;;
*)
localstatedir=/var
fi
-### ** Platform.
-
-cat >>confdefs.h <<_ACEOF
-#define PBX_PLATFORM "${host}"
-_ACEOF
-
+BUILD_PLATFORM=${build}
+BUILD_CPU=${build_cpu}
+BUILD_VENDOR=${build_vendor}
+BUILD_OS=${build_os}
-cat >>confdefs.h <<_ACEOF
-#define PBX_CPU "${host_cpu}"
-_ACEOF
-cat >>confdefs.h <<_ACEOF
-#define PBX_VENDOR "${host_vendor}"
-_ACEOF
-cat >>confdefs.h <<_ACEOF
-#define PBX_OS "${host_os}"
-_ACEOF
+HOST_PLATFORM=${host}
+HOST_CPU=${host_cpu}
+HOST_VENDOR=${host_vendor}
+HOST_OS=${host_os}
-# export some useful defines
-PBX_PLATFORM=${host}
-PBX_CPU=${host_cpu}
-PBX_VENDOR=${host_vendor}
-PBX_OS=${host_os}
fi
-# guest OS type
-case "${host}" in
- cygwin*|mingw*|windows*|winnt)
-
-cat >>confdefs.h <<\_ACEOF
-#define Win32 1
-_ACEOF
-
- PBX_OSTYPE="CYGWIN"
-# this is ugly - KPF
- OSISWIN32=1
-
- ;;
- *linux*)
-
-cat >>confdefs.h <<\_ACEOF
-#define Linux 1
-_ACEOF
-
- PBX_OSTYPE="Linux"
- ;;
- *netbsd*)
-
-cat >>confdefs.h <<\_ACEOF
-#define NetBSD 1
-_ACEOF
-
- PBX_OSTYPE="NetBSD"
- ;;
- *freebsd*)
-
-cat >>confdefs.h <<\_ACEOF
-#define FreeBSD 1
-_ACEOF
-
- PBX_OSTYPE="FreeBSD"
- # XXX temporary hack to let FreeBSD use the default paths
- # for local stuff. We need a better solution.
- if test x"${CPPFLAGS}" = x; then
- CPPFLAGS="-I/usr/local/include"
- fi
- if test x"${LDFLAGS}" = x; then
- LDFLAGS="-L/usr/local/lib"
- fi
- ;;
- *openbsd*)
-
-cat >>confdefs.h <<\_ACEOF
-#define OpenBSD 1
-_ACEOF
-
- PBX_OSTYPE="OpenBSD"
- ;;
- *sun*)
-
-cat >>confdefs.h <<\_ACEOF
-#define SunOS 1
-_ACEOF
-
- PBX_OSTYPE="SunOS"
- ;;
- *darwin*)
-
-cat >>confdefs.h <<\_ACEOF
-#define Darwin 1
-_ACEOF
-
- PBX_OSTYPE="Darwin"
- ;;
- *)
-
-cat >>confdefs.h <<\_ACEOF
-#define Unix 1
-_ACEOF
-
- PBX_OSTYPE="Unix"
- ;;
-esac
-
-
# This needs to be before any macros that use the C compiler
cat >>confdefs.h <<\_ACEOF
# cross-compile checks
-if test x"${build}" != x"${host}";
+if test "${cross_compiling}" = "yes";
then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
CXX="$ac_cv_prog_CXX"
fi
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ld; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$LD"; then
+ ac_cv_prog_LD="$LD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_LD="${ac_tool_prefix}ld"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+LD=$ac_cv_prog_LD
+if test -n "$LD"; then
+ { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LD"; then
+ ac_ct_LD=$LD
+ # Extract the first word of "ld", so it can be a program name with args.
+set dummy ld; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_LD"; then
+ ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_LD="ld"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LD=$ac_cv_prog_ac_ct_LD
+if test -n "$ac_ct_LD"; then
+ { echo "$as_me:$LINENO: result: $ac_ct_LD" >&5
+echo "${ECHO_T}$ac_ct_LD" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+ if test "x$ac_ct_LD" = x; then
+ LD=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ LD=$ac_ct_LD
+ fi
+else
+ LD="$ac_cv_prog_LD"
+fi
+
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
AR="$ac_cv_prog_AR"
fi
+fi
- if test x"${PBX_OSTYPE}" = xWin32;
- then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nm; ac_word=$2
+# Checks for programs.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_NM+set}" = set; then
+if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$NM"; then
- ac_cv_prog_NM="$NM" # Let the user override the test.
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_NM="${ac_tool_prefix}nm"
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
fi
fi
-NM=$ac_cv_prog_NM
-if test -n "$NM"; then
- { echo "$as_me:$LINENO: result: $NM" >&5
-echo "${ECHO_T}$NM" >&6; }
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
-if test -z "$ac_cv_prog_NM"; then
- ac_ct_NM=$NM
- # Extract the first word of "nm", so it can be a program name with args.
-set dummy nm; ac_word=$2
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_NM+set}" = set; then
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$ac_ct_NM"; then
- ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test.
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_NM="nm"
+ ac_cv_prog_ac_ct_CC="gcc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
fi
fi
-ac_ct_NM=$ac_cv_prog_ac_ct_NM
-if test -n "$ac_ct_NM"; then
- { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5
-echo "${ECHO_T}$ac_ct_NM" >&6; }
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
- if test "x$ac_ct_NM" = x; then
- NM=":"
+ if test "x$ac_ct_CC" = x; then
+ CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
esac
- NM=$ac_ct_NM
+ CC=$ac_ct_CC
fi
else
- NM="$ac_cv_prog_NM"
+ CC="$ac_cv_prog_CC"
fi
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
-set dummy ${ac_tool_prefix}windres; ac_word=$2
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_WINDRES+set}" = set; then
+if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$WINDRES"; then
- ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
fi
fi
-WINDRES=$ac_cv_prog_WINDRES
-if test -n "$WINDRES"; then
- { echo "$as_me:$LINENO: result: $WINDRES" >&5
-echo "${ECHO_T}$WINDRES" >&6; }
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
+ fi
fi
-if test -z "$ac_cv_prog_WINDRES"; then
- ac_ct_WINDRES=$WINDRES
- # Extract the first word of "windres", so it can be a program name with args.
-set dummy windres; ac_word=$2
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then
+if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$ac_ct_WINDRES"; then
- ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
else
+ ac_prog_rejected=no
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_WINDRES="windres"
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
IFS=$as_save_IFS
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
fi
fi
-ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
-if test -n "$ac_ct_WINDRES"; then
- { echo "$as_me:$LINENO: result: $ac_ct_WINDRES" >&5
-echo "${ECHO_T}$ac_ct_WINDRES" >&6; }
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
- if test "x$ac_ct_WINDRES" = x; then
- WINDRES=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- WINDRES=$ac_ct_WINDRES
- fi
-else
- WINDRES="$ac_cv_prog_WINDRES"
-fi
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dllwrap", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dllwrap; ac_word=$2
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_DLLWRAP+set}" = set; then
+if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$DLLWRAP"; then
- ac_cv_prog_DLLWRAP="$DLLWRAP" # Let the user override the test.
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_DLLWRAP="${ac_tool_prefix}dllwrap"
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
fi
fi
-DLLWRAP=$ac_cv_prog_DLLWRAP
-if test -n "$DLLWRAP"; then
- { echo "$as_me:$LINENO: result: $DLLWRAP" >&5
-echo "${ECHO_T}$DLLWRAP" >&6; }
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
+ test -n "$CC" && break
+ done
fi
-if test -z "$ac_cv_prog_DLLWRAP"; then
- ac_ct_DLLWRAP=$DLLWRAP
- # Extract the first word of "dllwrap", so it can be a program name with args.
-set dummy dllwrap; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_DLLWRAP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_DLLWRAP"; then
- ac_cv_prog_ac_ct_DLLWRAP="$ac_ct_DLLWRAP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_DLLWRAP="dllwrap"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DLLWRAP=$ac_cv_prog_ac_ct_DLLWRAP
-if test -n "$ac_ct_DLLWRAP"; then
- { echo "$as_me:$LINENO: result: $ac_ct_DLLWRAP" >&5
-echo "${ECHO_T}$ac_ct_DLLWRAP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_DLLWRAP" = x; then
- DLLWRAP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- DLLWRAP=$ac_ct_DLLWRAP
- fi
-else
- DLLWRAP="$ac_cv_prog_DLLWRAP"
-fi
-
- fi
- crossCompile="Yes"
-fi
-
-# Checks for programs.
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
+if test -z "$CC"; then
ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="gcc"
+ ac_cv_prog_ac_ct_CC="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
echo "${ECHO_T}no" >&6; }
fi
+
+ test -n "$ac_ct_CC" && break
+done
+
if test "x$ac_ct_CC" = x; then
CC=""
else
esac
CC=$ac_ct_CC
fi
-else
- CC="$ac_cv_prog_CC"
fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
fi
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
int
main ()
+GNUTLS_DESCRIP="GNU TLS support (used for iksemel only)"
+GNUTLS_OPTION="gnutls"
+
+# Check whether --with-gnutls was given.
+if test "${with_gnutls+set}" = set; then
+ withval=$with_gnutls;
+case ${withval} in
+ n|no)
+ USE_GNUTLS=no
+ ;;
+ y|ye|yes)
+ GNUTLS_MANDATORY="yes"
+ ;;
+ *)
+ GNUTLS_DIR="${withval}"
+ GNUTLS_MANDATORY="yes"
+ ;;
+esac
+
+fi
+
+PBX_GNUTLS=0
+
+
+
+
+
GSM_DESCRIP="GSM"
GSM_OPTION="gsm"
+ISDNNET_DESCRIP="ISDN4Linux Library"
+ISDNNET_OPTION="isdnnet"
+
+# Check whether --with-isdnnet was given.
+if test "${with_isdnnet+set}" = set; then
+ withval=$with_isdnnet;
+case ${withval} in
+ n|no)
+ USE_ISDNNET=no
+ ;;
+ y|ye|yes)
+ ISDNNET_MANDATORY="yes"
+ ;;
+ *)
+ ISDNNET_DIR="${withval}"
+ ISDNNET_MANDATORY="yes"
+ ;;
+esac
+
+fi
+
+PBX_ISDNNET=0
+
+
+
+
+
KDE_DESCRIP="KDE"
KDE_OPTION="kde"
+MISDN_DESCRIP="mISDN User Library"
+MISDN_OPTION="misdn"
+
+# Check whether --with-misdn was given.
+if test "${with_misdn+set}" = set; then
+ withval=$with_misdn;
+case ${withval} in
+ n|no)
+ USE_MISDN=no
+ ;;
+ y|ye|yes)
+ MISDN_MANDATORY="yes"
+ ;;
+ *)
+ MISDN_DIR="${withval}"
+ MISDN_MANDATORY="yes"
+ ;;
+esac
+
+fi
+
+PBX_MISDN=0
+
+
+
+
+
NBS_DESCRIP="Network Broadcast Sound"
NBS_OPTION="nbs"
+SUPPSERV_DESCRIP="mISDN Supplemental Services"
+SUPPSERV_OPTION="suppserv"
+
+# Check whether --with-suppserv was given.
+if test "${with_suppserv+set}" = set; then
+ withval=$with_suppserv;
+case ${withval} in
+ n|no)
+ USE_SUPPSERV=no
+ ;;
+ y|ye|yes)
+ SUPPSERV_MANDATORY="yes"
+ ;;
+ *)
+ SUPPSERV_DIR="${withval}"
+ SUPPSERV_MANDATORY="yes"
+ ;;
+esac
+
+fi
+
+PBX_SUPPSERV=0
+
+
+
+
+
OPENSSL_DESCRIP="OpenSSL"
OPENSSL_OPTION="ssl"
fi
fi
-
-for ac_header in stdlib.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+# XXX: these are commented out until we determine whether it matters if our malloc()
+# acts exactly like glibc's or not
+# AC_FUNC_MALLOC
+# AC_FUNC_REALLOC
+{ echo "$as_me:$LINENO: checking for working memcmp" >&5
+echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6; }
+if test "${ac_cv_func_memcmp_working+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5
-echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; }
-if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_func_malloc_0_nonnull=no
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#if STDC_HEADERS || HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *malloc ();
-#endif
-
-int
-main ()
-{
-return ! malloc (0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_malloc_0_nonnull=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_malloc_0_nonnull=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5
-echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; }
-if test $ac_cv_func_malloc_0_nonnull = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MALLOC 1
-_ACEOF
-
-else
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_MALLOC 0
-_ACEOF
-
- case " $LIBOBJS " in
- *" malloc.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
- ;;
-esac
-
-
-cat >>confdefs.h <<\_ACEOF
-#define malloc rpl_malloc
-_ACEOF
-
-fi
-
-
-
-{ echo "$as_me:$LINENO: checking for working memcmp" >&5
-echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6; }
-if test "${ac_cv_func_memcmp_working+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_func_memcmp_working=no
-else
- cat >conftest.$ac_ext <<_ACEOF
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_memcmp_working=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
rm -f conftest.mmap
-for ac_header in stdlib.h
+
+for ac_header in sys/select.h sys/socket.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
done
-{ echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5
-echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6; }
-if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then
+{ echo "$as_me:$LINENO: checking types of arguments for select" >&5
+echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6; }
+if test "${ac_cv_func_select_args+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test "$cross_compiling" = yes; then
- ac_cv_func_realloc_0_nonnull=no
-else
- cat >conftest.$ac_ext <<_ACEOF
+ for ac_arg234 in 'fd_set *' 'int *' 'void *'; do
+ for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do
+ for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#if STDC_HEADERS || HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *realloc ();
+$ac_includes_default
+#if HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
#endif
int
main ()
{
-return ! realloc (0, 0);
+extern int select ($ac_arg1,
+ $ac_arg234, $ac_arg234, $ac_arg234,
+ $ac_arg5);
;
return 0;
}
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_func_realloc_0_nonnull=yes
+ ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_realloc_0_nonnull=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5
-echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6; }
-if test $ac_cv_func_realloc_0_nonnull = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_REALLOC 1
-_ACEOF
-
-else
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_REALLOC 0
-_ACEOF
-
- case " $LIBOBJS " in
- *" realloc.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS realloc.$ac_objext"
- ;;
-esac
-
-
-cat >>confdefs.h <<\_ACEOF
-#define realloc rpl_realloc
-_ACEOF
-
-fi
-
-
-
-
-
-for ac_header in sys/select.h sys/socket.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-{ echo "$as_me:$LINENO: checking types of arguments for select" >&5
-echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6; }
-if test "${ac_cv_func_select_args+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- for ac_arg234 in 'fd_set *' 'int *' 'void *'; do
- for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do
- for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#if HAVE_SYS_SELECT_H
-# include <sys/select.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
-
-int
-main ()
-{
-extern int select ($ac_arg1,
- $ac_arg234, $ac_arg234, $ac_arg234,
- $ac_arg5);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3
-else
- echo "$as_me: failed program was:" >&5
+ echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-if test "${ac_cv_header_libkern_OSAtomic_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for libkern/OSAtomic.h" >&5
-echo $ECHO_N "checking for libkern/OSAtomic.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_libkern_OSAtomic_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_libkern_OSAtomic_h" >&5
-echo "${ECHO_T}$ac_cv_header_libkern_OSAtomic_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking libkern/OSAtomic.h usability" >&5
-echo $ECHO_N "checking libkern/OSAtomic.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking checking for res_ninit" >&5
+echo $ECHO_N "checking checking for res_ninit... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_includes_default
-#include <libkern/OSAtomic.h>
+#include <resolv.h>
+int
+main ()
+{
+int foo = res_ninit(NULL);
+ ;
+ return 0;
+}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+ (eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -s conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
-# Is the header present?
-{ echo "$as_me:$LINENO: checking libkern/OSAtomic.h presence" >&5
-echo $ECHO_N "checking libkern/OSAtomic.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <libkern/OSAtomic.h>
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_RES_NINIT 1
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
+
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: libkern/OSAtomic.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: libkern/OSAtomic.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: libkern/OSAtomic.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: libkern/OSAtomic.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: libkern/OSAtomic.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: libkern/OSAtomic.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: libkern/OSAtomic.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: libkern/OSAtomic.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for libkern/OSAtomic.h" >&5
-echo $ECHO_N "checking for libkern/OSAtomic.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_libkern_OSAtomic_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_libkern_OSAtomic_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_libkern_OSAtomic_h" >&5
-echo "${ECHO_T}$ac_cv_header_libkern_OSAtomic_h" >&6; }
-
-fi
-if test $ac_cv_header_libkern_OSAtomic_h = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_OSX_ATOMICS 1
-_ACEOF
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
-{ echo "$as_me:$LINENO: checking for int" >&5
-echo $ECHO_N "checking for int... $ECHO_C" >&6; }
-if test "${ac_cv_type_int+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
+{ echo "$as_me:$LINENO: checking checking for compiler 'attribute pure' support" >&5
+echo $ECHO_N "checking checking for compiler 'attribute pure' support... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_includes_default
-typedef int ac__type_new_;
+static int __attribute__((pure)) test(void) {}
int
main ()
{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
+
;
return 0;
}
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_type_int=yes
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ATTRIBUTE_pure 1
+_ACEOF
+
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_int=no
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
-echo "${ECHO_T}$ac_cv_type_int" >&6; }
-{ echo "$as_me:$LINENO: checking size of int" >&5
-echo $ECHO_N "checking size of int... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_int+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$ac_cv_type_int" = yes; then
- # The cast to long int works around a bug in the HP C Compiler
- # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
- # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
- # This bug is HP SR number 8606223364.
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
+
+{ echo "$as_me:$LINENO: checking checking for compiler 'attribute malloc' support" >&5
+echo $ECHO_N "checking checking for compiler 'attribute malloc' support... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
+static int __attribute__((malloc)) test(void) {}
int
main ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
;
return 0;
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ATTRIBUTE_malloc 1
+_ACEOF
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+{ echo "$as_me:$LINENO: checking checking for compiler 'attribute const' support" >&5
+echo $ECHO_N "checking checking for compiler 'attribute const' support... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
+static int __attribute__((const)) test(void) {}
int
main ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
;
return 0;
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_hi=$ac_mid; break
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ATTRIBUTE_const 1
+_ACEOF
+
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- cat >conftest.$ac_ext <<_ACEOF
+
+{ echo "$as_me:$LINENO: checking checking for compiler 'attribute unused' support" >&5
+echo $ECHO_N "checking checking for compiler 'attribute unused' support... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
+static int __attribute__((unused)) test(void) {}
int
main ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
;
return 0;
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ATTRIBUTE_unused 1
+_ACEOF
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+{ echo "$as_me:$LINENO: checking checking for compiler 'attribute always_inline' support" >&5
+echo $ECHO_N "checking checking for compiler 'attribute always_inline' support... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
+static int __attribute__((always_inline)) test(void) {}
int
main ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
;
return 0;
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_lo=$ac_mid; break
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ATTRIBUTE_always_inline 1
+_ACEOF
+
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
+
+
+if test "${ac_cv_header_libkern_OSAtomic_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for libkern/OSAtomic.h" >&5
+echo $ECHO_N "checking for libkern/OSAtomic.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_libkern_OSAtomic_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_libkern_OSAtomic_h" >&5
+echo "${ECHO_T}$ac_cv_header_libkern_OSAtomic_h" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking libkern/OSAtomic.h usability" >&5
+echo $ECHO_N "checking libkern/OSAtomic.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <libkern/OSAtomic.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_lo= ac_hi=
+ ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking libkern/OSAtomic.h presence" >&5
+echo $ECHO_N "checking libkern/OSAtomic.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <libkern/OSAtomic.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: libkern/OSAtomic.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: libkern/OSAtomic.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: libkern/OSAtomic.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: libkern/OSAtomic.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: libkern/OSAtomic.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: libkern/OSAtomic.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: libkern/OSAtomic.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libkern/OSAtomic.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: libkern/OSAtomic.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for libkern/OSAtomic.h" >&5
+echo $ECHO_N "checking for libkern/OSAtomic.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_libkern_OSAtomic_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_libkern_OSAtomic_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_libkern_OSAtomic_h" >&5
+echo "${ECHO_T}$ac_cv_header_libkern_OSAtomic_h" >&6; }
+
+fi
+if test $ac_cv_header_libkern_OSAtomic_h = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_OSX_ATOMICS 1
+_ACEOF
+
+fi
+
+
+
+{ echo "$as_me:$LINENO: checking for int" >&5
+echo $ECHO_N "checking for int... $ECHO_C" >&6; }
+if test "${ac_cv_type_int+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
- typedef int ac__type_sizeof_;
+typedef int ac__type_new_;
int
main ()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
;
return 0;
}
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_hi=$ac_mid
+ ac_cv_type_int=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_lo=`expr '(' $ac_mid ')' + 1`
+ ac_cv_type_int=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_int=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; } ;;
-esac
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
+echo "${ECHO_T}$ac_cv_type_int" >&6; }
+
+{ echo "$as_me:$LINENO: checking size of int" >&5
+echo $ECHO_N "checking size of int... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_int+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ if test "$ac_cv_type_int" = yes; then
+ # The cast to long int works around a bug in the HP C Compiler
+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+ # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+ # This bug is HP SR number 8606223364.
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
/* end confdefs.h. */
$ac_includes_default
typedef int ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
int
main ()
{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
;
return 0;
}
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_sizeof_int=`cat conftest.val`
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_int=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; } ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%lu\n", i);
+ }
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_int=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+else
+ ac_cv_sizeof_int=0
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+
+# do the package library checks now
+
+
+if test "${USE_ALSA}" != "no"; then
+ pbxlibdir=""
+ if test "x${ALSA_DIR}" != "x"; then
+ if test -d ${ALSA_DIR}/lib; then
+ pbxlibdir="-L${ALSA_DIR}/lib"
+ else
+ pbxlibdir="-L${ALSA_DIR}"
+ fi
+ fi
+ { echo "$as_me:$LINENO: checking for snd_spcm_init in -lasound" >&5
+echo $ECHO_N "checking for snd_spcm_init in -lasound... $ECHO_C" >&6; }
+if test "${ac_cv_lib_asound_snd_spcm_init+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lasound ${pbxlibdir} -lm -ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char snd_spcm_init ();
+int
+main ()
+{
+return snd_spcm_init ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_asound_snd_spcm_init=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_asound_snd_spcm_init=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_spcm_init" >&5
+echo "${ECHO_T}$ac_cv_lib_asound_snd_spcm_init" >&6; }
+if test $ac_cv_lib_asound_snd_spcm_init = yes; then
+ AST_ALSA_FOUND=yes
+else
+ AST_ALSA_FOUND=no
+fi
+
+
+ if test "${AST_ALSA_FOUND}" = "yes"; then
+ ALSA_LIB="-lasound -lm -ldl"
+ ALSA_HEADER_FOUND="1"
+ if test "x${ALSA_DIR}" != "x"; then
+ ALSA_LIB="${pbxlibdir} ${ALSA_LIB}"
+ ALSA_INCLUDE="-I${ALSA_DIR}/include"
+ if test "xalsa/asoundlib.h" != "x" ; then
+ as_ac_Header=`echo "ac_cv_header_${ALSA_DIR}/include/alsa/asoundlib.h" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for ${ALSA_DIR}/include/alsa/asoundlib.h" >&5
+echo $ECHO_N "checking for ${ALSA_DIR}/include/alsa/asoundlib.h... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking ${ALSA_DIR}/include/alsa/asoundlib.h usability" >&5
+echo $ECHO_N "checking ${ALSA_DIR}/include/alsa/asoundlib.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <${ALSA_DIR}/include/alsa/asoundlib.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking ${ALSA_DIR}/include/alsa/asoundlib.h presence" >&5
+echo $ECHO_N "checking ${ALSA_DIR}/include/alsa/asoundlib.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <${ALSA_DIR}/include/alsa/asoundlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for ${ALSA_DIR}/include/alsa/asoundlib.h" >&5
+echo $ECHO_N "checking for ${ALSA_DIR}/include/alsa/asoundlib.h... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ ALSA_HEADER_FOUND=1
+else
+ ALSA_HEADER_FOUND=0
+fi
+
+
+ fi
+ else
+ if test "xalsa/asoundlib.h" != "x" ; then
+ if test "${ac_cv_header_alsa_asoundlib_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for alsa/asoundlib.h" >&5
+echo $ECHO_N "checking for alsa/asoundlib.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_alsa_asoundlib_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_alsa_asoundlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_alsa_asoundlib_h" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking alsa/asoundlib.h usability" >&5
+echo $ECHO_N "checking alsa/asoundlib.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <alsa/asoundlib.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking alsa/asoundlib.h presence" >&5
+echo $ECHO_N "checking alsa/asoundlib.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <alsa/asoundlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: alsa/asoundlib.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: alsa/asoundlib.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: alsa/asoundlib.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: alsa/asoundlib.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for alsa/asoundlib.h" >&5
+echo $ECHO_N "checking for alsa/asoundlib.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_alsa_asoundlib_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_alsa_asoundlib_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_alsa_asoundlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_alsa_asoundlib_h" >&6; }
+
+fi
+if test $ac_cv_header_alsa_asoundlib_h = yes; then
+ ALSA_HEADER_FOUND=1
+else
+ ALSA_HEADER_FOUND=0
+fi
+
+
+ fi
+ fi
+ if test "x${ALSA_HEADER_FOUND}" = "x0" ; then
+ if test ! -z "${ALSA_MANDATORY}" ;
+ then
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** It appears that you do not have the asound development package installed." >&5
+echo "$as_me: *** It appears that you do not have the asound development package installed." >&6;}
+ { echo "$as_me:$LINENO: *** Please install it to include ${ALSA_DESCRIP} support" >&5
+echo "$as_me: *** Please install it to include ${ALSA_DESCRIP} support" >&or re-run configure;}
+ { echo "$as_me:$LINENO: *** without explicitly specifying --with-${ALSA_OPTION}" >&5
+echo "$as_me: *** without explicitly specifying --with-${ALSA_OPTION}" >&6;}
+ exit 1
+ fi
+ ALSA_LIB=""
+ ALSA_INCLUDE=""
+ PBX_ALSA=0
+ else
+ PBX_ALSA=1
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ALSA 1
+_ACEOF
+
+ fi
+ elif test ! -z "${ALSA_MANDATORY}";
+ then
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** The ${ALSA_DESCRIP} installation on this system appears to be broken." >&5
+echo "$as_me: *** The ${ALSA_DESCRIP} installation on this system appears to be broken." >&6;}
+ { echo "$as_me:$LINENO: *** Either correct the installation" >&5
+echo "$as_me: *** Either correct the installation" >&or run configure;}
+ { echo "$as_me:$LINENO: *** without explicitly specifying --with-${ALSA_OPTION}" >&5
+echo "$as_me: *** without explicitly specifying --with-${ALSA_OPTION}" >&6;}
+ exit 1
+ fi
+fi
+
+
+
+if test "${USE_CURSES}" != "no"; then
+ pbxlibdir=""
+ if test "x${CURSES_DIR}" != "x"; then
+ if test -d ${CURSES_DIR}/lib; then
+ pbxlibdir="-L${CURSES_DIR}/lib"
+ else
+ pbxlibdir="-L${CURSES_DIR}"
+ fi
+ fi
+ { echo "$as_me:$LINENO: checking for initscr in -lcurses" >&5
+echo $ECHO_N "checking for initscr in -lcurses... $ECHO_C" >&6; }
+if test "${ac_cv_lib_curses_initscr+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcurses ${pbxlibdir} $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char initscr ();
+int
+main ()
+{
+return initscr ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_curses_initscr=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_curses_initscr=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_initscr" >&5
+echo "${ECHO_T}$ac_cv_lib_curses_initscr" >&6; }
+if test $ac_cv_lib_curses_initscr = yes; then
+ AST_CURSES_FOUND=yes
+else
+ AST_CURSES_FOUND=no
+fi
+
+
+ if test "${AST_CURSES_FOUND}" = "yes"; then
+ CURSES_LIB="-lcurses "
+ CURSES_HEADER_FOUND="1"
+ if test "x${CURSES_DIR}" != "x"; then
+ CURSES_LIB="${pbxlibdir} ${CURSES_LIB}"
+ CURSES_INCLUDE="-I${CURSES_DIR}/include"
+ if test "xcurses.h" != "x" ; then
+ as_ac_Header=`echo "ac_cv_header_${CURSES_DIR}/include/curses.h" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for ${CURSES_DIR}/include/curses.h" >&5
+echo $ECHO_N "checking for ${CURSES_DIR}/include/curses.h... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking ${CURSES_DIR}/include/curses.h usability" >&5
+echo $ECHO_N "checking ${CURSES_DIR}/include/curses.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <${CURSES_DIR}/include/curses.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking ${CURSES_DIR}/include/curses.h presence" >&5
+echo $ECHO_N "checking ${CURSES_DIR}/include/curses.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <${CURSES_DIR}/include/curses.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for ${CURSES_DIR}/include/curses.h" >&5
+echo $ECHO_N "checking for ${CURSES_DIR}/include/curses.h... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ CURSES_HEADER_FOUND=1
+else
+ CURSES_HEADER_FOUND=0
+fi
+
+
+ fi
+ else
+ if test "xcurses.h" != "x" ; then
+ if test "${ac_cv_header_curses_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for curses.h" >&5
+echo $ECHO_N "checking for curses.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_curses_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_curses_h" >&5
+echo "${ECHO_T}$ac_cv_header_curses_h" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking curses.h usability" >&5
+echo $ECHO_N "checking curses.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <curses.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking curses.h presence" >&5
+echo $ECHO_N "checking curses.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <curses.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: curses.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: curses.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: curses.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: curses.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: curses.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: curses.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: curses.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: curses.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: curses.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: curses.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: curses.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: curses.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: curses.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: curses.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: curses.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: curses.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for curses.h" >&5
+echo $ECHO_N "checking for curses.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_curses_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_curses_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_curses_h" >&5
+echo "${ECHO_T}$ac_cv_header_curses_h" >&6; }
+
+fi
+if test $ac_cv_header_curses_h = yes; then
+ CURSES_HEADER_FOUND=1
+else
+ CURSES_HEADER_FOUND=0
+fi
+
+
+ fi
+ fi
+ if test "x${CURSES_HEADER_FOUND}" = "x0" ; then
+ if test ! -z "${CURSES_MANDATORY}" ;
+ then
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** It appears that you do not have the curses development package installed." >&5
+echo "$as_me: *** It appears that you do not have the curses development package installed." >&6;}
+ { echo "$as_me:$LINENO: *** Please install it to include ${CURSES_DESCRIP} support" >&5
+echo "$as_me: *** Please install it to include ${CURSES_DESCRIP} support" >&or re-run configure;}
+ { echo "$as_me:$LINENO: *** without explicitly specifying --with-${CURSES_OPTION}" >&5
+echo "$as_me: *** without explicitly specifying --with-${CURSES_OPTION}" >&6;}
+ exit 1
+ fi
+ CURSES_LIB=""
+ CURSES_INCLUDE=""
+ PBX_CURSES=0
+ else
+ PBX_CURSES=1
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CURSES 1
+_ACEOF
+
+ fi
+ elif test ! -z "${CURSES_MANDATORY}";
+ then
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** The ${CURSES_DESCRIP} installation on this system appears to be broken." >&5
+echo "$as_me: *** The ${CURSES_DESCRIP} installation on this system appears to be broken." >&6;}
+ { echo "$as_me:$LINENO: *** Either correct the installation" >&5
+echo "$as_me: *** Either correct the installation" >&or run configure;}
+ { echo "$as_me:$LINENO: *** without explicitly specifying --with-${CURSES_OPTION}" >&5
+echo "$as_me: *** without explicitly specifying --with-${CURSES_OPTION}" >&6;}
+ exit 1
+ fi
+fi
+
+
+GSM_INTERNAL="yes"
+
+GSM_SYSTEM="yes"
+if test "${USE_GSM}" != "no"; then
+ if test "${GSM_DIR}" = "internal"; then
+ GSM_SYSTEM="no"
+ elif test "${GSM_DIR}" != ""; then
+ GSM_INTERNAL="no"
+ fi
+ if test "${GSM_SYSTEM}" = "yes"; then
+ gsmlibdir=""
+ if test "x${GSM_DIR}" != "x"; then
+ if test -d ${GSM_DIR}/lib; then
+ gsmlibdir="-L${GSM_DIR}/lib"
+ else
+ gsmlibdir="-L${GSM_DIR}"
+ fi
+ fi
+ { echo "$as_me:$LINENO: checking for gsm_create in -lgsm" >&5
+echo $ECHO_N "checking for gsm_create in -lgsm... $ECHO_C" >&6; }
+if test "${ac_cv_lib_gsm_gsm_create+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgsm ${gsmlibdir} $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gsm_create ();
+int
+main ()
+{
+return gsm_create ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_gsm_gsm_create=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_gsm_gsm_create=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_gsm_gsm_create" >&5
+echo "${ECHO_T}$ac_cv_lib_gsm_gsm_create" >&6; }
+if test $ac_cv_lib_gsm_gsm_create = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_GSM 1
+_ACEOF
+
+fi
+
+ if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
+ GSM_LIB="-lgsm"
+ if test "x${GSM_DIR}" != "x"; then
+ GSM_LIB="${gsmlibdir} ${GSM_LIB}"
+ GSM_INCLUDE="-I${GSM_DIR}/include"
+ fi
+ PBX_GSM=1
+ GSM_INTERNAL="no"
+ fi
+ fi
+ if test "${GSM_INTERNAL}" = "yes"; then
+ PBX_GSM=1
+ fi
+fi
+
+
+if test "${USE_IKSEMEL}" != "no"; then
+ pbxlibdir=""
+ if test "x${IKSEMEL_DIR}" != "x"; then
+ if test -d ${IKSEMEL_DIR}/lib; then
+ pbxlibdir="-L${IKSEMEL_DIR}/lib"
+ else
+ pbxlibdir="-L${IKSEMEL_DIR}"
+ fi
+ fi
+ { echo "$as_me:$LINENO: checking for iks_start_sasl in -liksemel" >&5
+echo $ECHO_N "checking for iks_start_sasl in -liksemel... $ECHO_C" >&6; }
+if test "${ac_cv_lib_iksemel_iks_start_sasl+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-liksemel ${pbxlibdir} $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char iks_start_sasl ();
+int
+main ()
+{
+return iks_start_sasl ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_iksemel_iks_start_sasl=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_iksemel_iks_start_sasl=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_iksemel_iks_start_sasl" >&5
+echo "${ECHO_T}$ac_cv_lib_iksemel_iks_start_sasl" >&6; }
+if test $ac_cv_lib_iksemel_iks_start_sasl = yes; then
+ AST_IKSEMEL_FOUND=yes
+else
+ AST_IKSEMEL_FOUND=no
+fi
+
+
+ if test "${AST_IKSEMEL_FOUND}" = "yes"; then
+ IKSEMEL_LIB="-liksemel "
+ IKSEMEL_HEADER_FOUND="1"
+ if test "x${IKSEMEL_DIR}" != "x"; then
+ IKSEMEL_LIB="${pbxlibdir} ${IKSEMEL_LIB}"
+ IKSEMEL_INCLUDE="-I${IKSEMEL_DIR}/include"
+ if test "xiksemel.h" != "x" ; then
+ as_ac_Header=`echo "ac_cv_header_${IKSEMEL_DIR}/include/iksemel.h" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for ${IKSEMEL_DIR}/include/iksemel.h" >&5
+echo $ECHO_N "checking for ${IKSEMEL_DIR}/include/iksemel.h... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking ${IKSEMEL_DIR}/include/iksemel.h usability" >&5
+echo $ECHO_N "checking ${IKSEMEL_DIR}/include/iksemel.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <${IKSEMEL_DIR}/include/iksemel.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking ${IKSEMEL_DIR}/include/iksemel.h presence" >&5
+echo $ECHO_N "checking ${IKSEMEL_DIR}/include/iksemel.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <${IKSEMEL_DIR}/include/iksemel.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for ${IKSEMEL_DIR}/include/iksemel.h" >&5
+echo $ECHO_N "checking for ${IKSEMEL_DIR}/include/iksemel.h... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ IKSEMEL_HEADER_FOUND=1
+else
+ IKSEMEL_HEADER_FOUND=0
+fi
+
+
+ fi
+ else
+ if test "xiksemel.h" != "x" ; then
+ if test "${ac_cv_header_iksemel_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for iksemel.h" >&5
+echo $ECHO_N "checking for iksemel.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_iksemel_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_iksemel_h" >&5
+echo "${ECHO_T}$ac_cv_header_iksemel_h" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking iksemel.h usability" >&5
+echo $ECHO_N "checking iksemel.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <iksemel.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking iksemel.h presence" >&5
+echo $ECHO_N "checking iksemel.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <iksemel.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: iksemel.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: iksemel.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iksemel.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: iksemel.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: iksemel.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: iksemel.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iksemel.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: iksemel.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iksemel.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: iksemel.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iksemel.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: iksemel.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iksemel.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: iksemel.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: iksemel.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: iksemel.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for iksemel.h" >&5
+echo $ECHO_N "checking for iksemel.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_iksemel_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_iksemel_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_iksemel_h" >&5
+echo "${ECHO_T}$ac_cv_header_iksemel_h" >&6; }
+
+fi
+if test $ac_cv_header_iksemel_h = yes; then
+ IKSEMEL_HEADER_FOUND=1
+else
+ IKSEMEL_HEADER_FOUND=0
+fi
+
+
+ fi
+ fi
+ if test "x${IKSEMEL_HEADER_FOUND}" = "x0" ; then
+ if test ! -z "${IKSEMEL_MANDATORY}" ;
+ then
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** It appears that you do not have the iksemel development package installed." >&5
+echo "$as_me: *** It appears that you do not have the iksemel development package installed." >&6;}
+ { echo "$as_me:$LINENO: *** Please install it to include ${IKSEMEL_DESCRIP} support" >&5
+echo "$as_me: *** Please install it to include ${IKSEMEL_DESCRIP} support" >&or re-run configure;}
+ { echo "$as_me:$LINENO: *** without explicitly specifying --with-${IKSEMEL_OPTION}" >&5
+echo "$as_me: *** without explicitly specifying --with-${IKSEMEL_OPTION}" >&6;}
+ exit 1
+ fi
+ IKSEMEL_LIB=""
+ IKSEMEL_INCLUDE=""
+ PBX_IKSEMEL=0
+ else
+ PBX_IKSEMEL=1
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_IKSEMEL 1
+_ACEOF
+
+ fi
+ elif test ! -z "${IKSEMEL_MANDATORY}";
+ then
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** The ${IKSEMEL_DESCRIP} installation on this system appears to be broken." >&5
+echo "$as_me: *** The ${IKSEMEL_DESCRIP} installation on this system appears to be broken." >&6;}
+ { echo "$as_me:$LINENO: *** Either correct the installation" >&5
+echo "$as_me: *** Either correct the installation" >&or run configure;}
+ { echo "$as_me:$LINENO: *** without explicitly specifying --with-${IKSEMEL_OPTION}" >&5
+echo "$as_me: *** without explicitly specifying --with-${IKSEMEL_OPTION}" >&6;}
+ exit 1
+ fi
+fi
+
+
+if test "${PBX_IKSEMEL}" = 1; then
+
+if test "${USE_GNUTLS}" != "no"; then
+ pbxlibdir=""
+ if test "x${GNUTLS_DIR}" != "x"; then
+ if test -d ${GNUTLS_DIR}/lib; then
+ pbxlibdir="-L${GNUTLS_DIR}/lib"
+ else
+ pbxlibdir="-L${GNUTLS_DIR}"
+ fi
+ fi
+ { echo "$as_me:$LINENO: checking for gnutls_bye in -lgnutls" >&5
+echo $ECHO_N "checking for gnutls_bye in -lgnutls... $ECHO_C" >&6; }
+if test "${ac_cv_lib_gnutls_gnutls_bye+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgnutls ${pbxlibdir} $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gnutls_bye ();
+int
+main ()
+{
+return gnutls_bye ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_gnutls_gnutls_bye=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_gnutls_gnutls_bye=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_gnutls_gnutls_bye" >&5
+echo "${ECHO_T}$ac_cv_lib_gnutls_gnutls_bye" >&6; }
+if test $ac_cv_lib_gnutls_gnutls_bye = yes; then
+ AST_GNUTLS_FOUND=yes
+else
+ AST_GNUTLS_FOUND=no
+fi
+
+
+ if test "${AST_GNUTLS_FOUND}" = "yes"; then
+ GNUTLS_LIB="-lgnutls "
+ GNUTLS_HEADER_FOUND="1"
+ if test "x${GNUTLS_DIR}" != "x"; then
+ GNUTLS_LIB="${pbxlibdir} ${GNUTLS_LIB}"
+ GNUTLS_INCLUDE="-I${GNUTLS_DIR}/include"
+ if test "x" != "x" ; then
+ as_ac_Header=`echo "ac_cv_header_${GNUTLS_DIR}/include/" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for ${GNUTLS_DIR}/include/" >&5
+echo $ECHO_N "checking for ${GNUTLS_DIR}/include/... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking ${GNUTLS_DIR}/include/ usability" >&5
+echo $ECHO_N "checking ${GNUTLS_DIR}/include/ usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <${GNUTLS_DIR}/include/>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking ${GNUTLS_DIR}/include/ presence" >&5
+echo $ECHO_N "checking ${GNUTLS_DIR}/include/ presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <${GNUTLS_DIR}/include/>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for ${GNUTLS_DIR}/include/" >&5
+echo $ECHO_N "checking for ${GNUTLS_DIR}/include/... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ GNUTLS_HEADER_FOUND=1
+else
+ GNUTLS_HEADER_FOUND=0
+fi
+
+
+ fi
+ else
+ if test "x" != "x" ; then
+ if test "${ac_cv_header_+set}" = set; then
+ { echo "$as_me:$LINENO: checking for " >&5
+echo $ECHO_N "checking for ... $ECHO_C" >&6; }
+if test "${ac_cv_header_+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
+echo "${ECHO_T}$ac_cv_header_" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking usability" >&5
+echo $ECHO_N "checking usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+ echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ ac_header_compiler=no
fi
-rm -f conftest.val
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking presence" >&5
+echo $ECHO_N "checking presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- ac_cv_sizeof_int=0
+ ac_cpp_err=yes
fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
-_ACEOF
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5
+echo "$as_me: WARNING: : present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5
+echo "$as_me: WARNING: : see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;}
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for " >&5
+echo $ECHO_N "checking for ... $ECHO_C" >&6; }
+if test "${ac_cv_header_+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
+echo "${ECHO_T}$ac_cv_header_" >&6; }
-# do the package library checks now
+fi
+if test $ac_cv_header_ = yes; then
+ GNUTLS_HEADER_FOUND=1
+else
+ GNUTLS_HEADER_FOUND=0
+fi
-if test "${USE_ALSA}" != "no"; then
- pbxlibdir=""
- if test "x${ALSA_DIR}" != "x"; then
- if test -d ${ALSA_DIR}/lib; then
- pbxlibdir="-L${ALSA_DIR}/lib"
+ fi
+ fi
+ if test "x${GNUTLS_HEADER_FOUND}" = "x0" ; then
+ if test ! -z "${GNUTLS_MANDATORY}" ;
+ then
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** It appears that you do not have the gnutls development package installed." >&5
+echo "$as_me: *** It appears that you do not have the gnutls development package installed." >&6;}
+ { echo "$as_me:$LINENO: *** Please install it to include ${GNUTLS_DESCRIP} support" >&5
+echo "$as_me: *** Please install it to include ${GNUTLS_DESCRIP} support" >&or re-run configure;}
+ { echo "$as_me:$LINENO: *** without explicitly specifying --with-${GNUTLS_OPTION}" >&5
+echo "$as_me: *** without explicitly specifying --with-${GNUTLS_OPTION}" >&6;}
+ exit 1
+ fi
+ GNUTLS_LIB=""
+ GNUTLS_INCLUDE=""
+ PBX_GNUTLS=0
else
- pbxlibdir="-L${ALSA_DIR}"
+ PBX_GNUTLS=1
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_GNUTLS 1
+_ACEOF
+
fi
+ elif test ! -z "${GNUTLS_MANDATORY}";
+ then
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** The ${GNUTLS_DESCRIP} installation on this system appears to be broken." >&5
+echo "$as_me: *** The ${GNUTLS_DESCRIP} installation on this system appears to be broken." >&6;}
+ { echo "$as_me:$LINENO: *** Either correct the installation" >&5
+echo "$as_me: *** Either correct the installation" >&or run configure;}
+ { echo "$as_me:$LINENO: *** without explicitly specifying --with-${GNUTLS_OPTION}" >&5
+echo "$as_me: *** without explicitly specifying --with-${GNUTLS_OPTION}" >&6;}
+ exit 1
fi
- { echo "$as_me:$LINENO: checking for snd_spcm_init in -lasound" >&5
-echo $ECHO_N "checking for snd_spcm_init in -lasound... $ECHO_C" >&6; }
-if test "${ac_cv_lib_asound_snd_spcm_init+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lasound ${pbxlibdir} -lm -ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+fi
+
+ if test "${PBX_GNUTLS}" = 1; then
+ IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -ltasn1 -lz -lgcrypt -lnsl -lgpg-error"
+ fi
+fi
+
+if test "${USE_IMAP_TK}" != "no"; then
+ if test "${IMAP_TK_DIR}" = ""; then
+ IMAP_TK_DIR=`pwd`"/../imap-2004g"
+ fi
+ { echo "$as_me:$LINENO: checking checking for UW IMAP Toolkit c-client library" >&5
+echo $ECHO_N "checking checking for UW IMAP Toolkit c-client library... $ECHO_C" >&6; }
+ saved_cppflags="${CPPFLAGS}"
+ saved_libs="${LIBS}"
+ if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
+ imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
+ fi
+ CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
+ LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char snd_spcm_init ();
+#include "c-client.h"
+ void mm_searched (MAILSTREAM *stream,unsigned long number)
+ {
+ }
+ void mm_exists (MAILSTREAM *stream,unsigned long number)
+ {
+ }
+ void mm_expunged (MAILSTREAM *stream,unsigned long number)
+ {
+ }
+ void mm_flags (MAILSTREAM *stream,unsigned long number)
+ {
+ }
+ void mm_notify (MAILSTREAM *stream,char *string,long errflg)
+ {
+ }
+ void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
+ {
+ }
+ void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
+ {
+ }
+ void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
+ {
+ }
+ void mm_log (char *string,long errflg)
+ {
+ }
+ void mm_dlog (char *string)
+ {
+ }
+ void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
+ {
+ }
+ void mm_critical (MAILSTREAM *stream)
+ {
+ }
+ void mm_nocritical (MAILSTREAM *stream)
+ {
+ }
+ long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
+ {
+ }
+ void mm_fatal (char *string)
+ {
+ }
int
main ()
{
-return snd_spcm_init ();
+
+ MAILSTREAM *foo = mail_open(NULL, "", 0);
+
+
;
return 0;
}
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_lib_asound_snd_spcm_init=yes
+ ac_cv_imap_tk="yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_lib_asound_snd_spcm_init=no
+ ac_cv_imap_tk="no"
+
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_spcm_init" >&5
-echo "${ECHO_T}$ac_cv_lib_asound_snd_spcm_init" >&6; }
-if test $ac_cv_lib_asound_snd_spcm_init = yes; then
- AST_ALSA_FOUND=yes
-else
- AST_ALSA_FOUND=no
-fi
-
-
- if test "${AST_ALSA_FOUND}" = "yes"; then
- ALSA_LIB="-lasound -lm -ldl"
- ALSA_HEADER_FOUND="1"
- if test "x${ALSA_DIR}" != "x"; then
- ALSA_LIB="${pbxlibdir} ${ALSA_LIB}"
- ALSA_INCLUDE="-I${ALSA_DIR}/include"
- if test "xalsa/asoundlib.h" != "x" ; then
- as_ac_Header=`echo "ac_cv_header_${ALSA_DIR}/include/alsa/asoundlib.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for ${ALSA_DIR}/include/alsa/asoundlib.h" >&5
-echo $ECHO_N "checking for ${ALSA_DIR}/include/alsa/asoundlib.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${ALSA_DIR}/include/alsa/asoundlib.h usability" >&5
-echo $ECHO_N "checking ${ALSA_DIR}/include/alsa/asoundlib.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+ if test "${ac_cv_imap_tk}" = "yes"; then
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_includes_default
-#include <${ALSA_DIR}/include/alsa/asoundlib.h>
+#include "c-client.h"
+ void mm_searched (MAILSTREAM *stream,unsigned long number)
+ {
+ }
+ void mm_exists (MAILSTREAM *stream,unsigned long number)
+ {
+ }
+ void mm_expunged (MAILSTREAM *stream,unsigned long number)
+ {
+ }
+ void mm_flags (MAILSTREAM *stream,unsigned long number)
+ {
+ }
+ void mm_notify (MAILSTREAM *stream,char *string,long errflg)
+ {
+ }
+ void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
+ {
+ }
+ void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
+ {
+ }
+ void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
+ {
+ }
+ void mm_log (char *string,long errflg)
+ {
+ }
+ void mm_dlog (char *string)
+ {
+ }
+ void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
+ {
+ }
+ void mm_critical (MAILSTREAM *stream)
+ {
+ }
+ void mm_nocritical (MAILSTREAM *stream)
+ {
+ }
+ long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
+ {
+ }
+ void mm_fatal (char *string)
+ {
+ }
+int
+main ()
+{
+
+ long check = mail_expunge_full(NULL, "", 0);
+
+
+ ;
+ return 0;
+}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+ (eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -s conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_header_compiler=yes
+ ac_cv_imap_tk2006="yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_header_compiler=no
-fi
+ ac_cv_imap_tk2006="no"
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+fi
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${ALSA_DIR}/include/alsa/asoundlib.h presence" >&5
-echo $ECHO_N "checking ${ALSA_DIR}/include/alsa/asoundlib.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <${ALSA_DIR}/include/alsa/asoundlib.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ CPPFLAGS="${saved_cppflags}"
+ LIBS="${saved_libs}"
+ if test "${ac_cv_imap_tk}" = "yes"; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
+ IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
+ PBX_IMAP_TK=1
- ac_header_preproc=no
-fi
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IMAP_TK 1
+_ACEOF
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+ if test "${ac_cv_imap_tk2006}" = "yes"; then
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: in the future, the compiler will take precedence" >&2;}
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IMAP_TK2006 1
+_ACEOF
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${ALSA_DIR}/include/alsa/asoundlib.h" >&5
-echo $ECHO_N "checking for ${ALSA_DIR}/include/alsa/asoundlib.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ elif test ! -z "${IMAP_TK_MANDATORY}"; then
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** The UW IMAP Toolkit installation on this system appears to be broken." >&5
+echo "$as_me: *** The UW IMAP Toolkit installation on this system appears to be broken." >&6;}
+ { echo "$as_me:$LINENO: *** Either correct the installation" >&5
+echo "$as_me: *** Either correct the installation" >&or run configure;}
+ { echo "$as_me:$LINENO: *** including --without-imap." >&5
+echo "$as_me: *** including --without-imap." >&6;}
+ exit 1
+ else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ fi
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- ALSA_HEADER_FOUND=1
-else
- ALSA_HEADER_FOUND=0
-fi
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+if test "${USE_KDE}" != "no"; then
+ { echo "$as_me:$LINENO: checking checking for crashHandler in -lkdecore" >&5
+echo $ECHO_N "checking checking for crashHandler in -lkdecore... $ECHO_C" >&6; }
+ saved_libs="${LIBS}"
+ saved_cppflags="${CPPFLAGS}"
+ CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
+ if test -d ${KDE_DIR}/lib; then
+ kdelibdir="${KDE_DIR}/lib"
+ else
+ kdelibdir="${KDE_DIR}"
+ fi
+ LIBS="${LIBS} -L${kdelibdir} -lkdecore"
- fi
- else
- if test "xalsa/asoundlib.h" != "x" ; then
- if test "${ac_cv_header_alsa_asoundlib_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for alsa/asoundlib.h" >&5
-echo $ECHO_N "checking for alsa/asoundlib.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_alsa_asoundlib_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_alsa_asoundlib_h" >&5
-echo "${ECHO_T}$ac_cv_header_alsa_asoundlib_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking alsa/asoundlib.h usability" >&5
-echo $ECHO_N "checking alsa/asoundlib.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_includes_default
-#include <alsa/asoundlib.h>
+#include "kcrash.h"
+int
+main ()
+{
+KCrash::defaultCrashHandler(1);
+ ;
+ return 0;
+}
+
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+ (eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -s conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_header_compiler=yes
+ ac_cv_lib_kde_crash="yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_header_compiler=no
+ ac_cv_lib_kde_crash="no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
-# Is the header present?
-{ echo "$as_me:$LINENO: checking alsa/asoundlib.h presence" >&5
-echo $ECHO_N "checking alsa/asoundlib.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <alsa/asoundlib.h>
+ LIBS="${saved_libs}"
+ CPPFLAGS="${saved_cppflags}"
+
+ if test "${ac_cv_lib_kde_crash}" = "yes"; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ KDE_LIB="-lkdecore -lkdeui"
+ if test "${KDE_DIR}" != ""; then
+ KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
+ KDE_INCLUDE="-I${KDE_DIR}/include"
+ fi
+ PBX_KDE=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBKDE 1
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
+
+ elif test ! -z "${KDE_MANDATORY}"; then
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** The KDE installation on this system appears to be broken." >&5
+echo "$as_me: *** The KDE installation on this system appears to be broken." >&6;}
+ { echo "$as_me:$LINENO: *** Either correct the installation" >&5
+echo "$as_me: *** Either correct the installation" >&or run configure;}
+ { echo "$as_me:$LINENO: *** including --without-kde." >&5
+echo "$as_me: *** including --without-kde." >&6;}
+ exit 1
+ else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ fi
fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
+if test "${PBX_KDE}" = 1; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}kdeinit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}kdeinit; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_KDEINIT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ case $KDEINIT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_KDEINIT="$KDEINIT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_KDEINIT="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
- ac_header_preproc=no
+ ;;
+esac
+fi
+KDEINIT=$ac_cv_path_KDEINIT
+if test -n "$KDEINIT"; then
+ { echo "$as_me:$LINENO: result: $KDEINIT" >&5
+echo "${ECHO_T}$KDEINIT" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: alsa/asoundlib.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: alsa/asoundlib.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: alsa/asoundlib.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: alsa/asoundlib.h: in the future, the compiler will take precedence" >&2;}
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for alsa/asoundlib.h" >&5
-echo $ECHO_N "checking for alsa/asoundlib.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_alsa_asoundlib_h+set}" = set; then
+fi
+if test -z "$ac_cv_path_KDEINIT"; then
+ ac_pt_KDEINIT=$KDEINIT
+ # Extract the first word of "kdeinit", so it can be a program name with args.
+set dummy kdeinit; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ac_pt_KDEINIT+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_header_alsa_asoundlib_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_alsa_asoundlib_h" >&5
-echo "${ECHO_T}$ac_cv_header_alsa_asoundlib_h" >&6; }
+ case $ac_pt_KDEINIT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_KDEINIT="$ac_pt_KDEINIT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_ac_pt_KDEINIT="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+ ;;
+esac
fi
-if test $ac_cv_header_alsa_asoundlib_h = yes; then
- ALSA_HEADER_FOUND=1
+ac_pt_KDEINIT=$ac_cv_path_ac_pt_KDEINIT
+if test -n "$ac_pt_KDEINIT"; then
+ { echo "$as_me:$LINENO: result: $ac_pt_KDEINIT" >&5
+echo "${ECHO_T}$ac_pt_KDEINIT" >&6; }
else
- ALSA_HEADER_FOUND=0
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+ if test "x$ac_pt_KDEINIT" = x; then
+ KDEINIT="No"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ KDEINIT=$ac_pt_KDEINIT
+ fi
+else
+ KDEINIT="$ac_cv_path_KDEINIT"
+fi
- fi
- fi
- if test "x${ALSA_HEADER_FOUND}" = "x0" ; then
- if test ! -z "${ALSA_MANDATORY}" ;
- then
- { echo "$as_me:$LINENO: ***" >&5
-echo "$as_me: ***" >&6;}
- { echo "$as_me:$LINENO: *** It appears that you do not have the asound development package installed." >&5
-echo "$as_me: *** It appears that you do not have the asound development package installed." >&6;}
- { echo "$as_me:$LINENO: *** Please install it to include ${ALSA_DESCRIP} support" >&5
-echo "$as_me: *** Please install it to include ${ALSA_DESCRIP} support" >&or re-run configure;}
- { echo "$as_me:$LINENO: *** without explicitly specifying --with-${ALSA_OPTION}" >&5
-echo "$as_me: *** without explicitly specifying --with-${ALSA_OPTION}" >&6;}
- exit 1
- fi
- ALSA_LIB=""
- ALSA_INCLUDE=""
- PBX_ALSA=0
- else
- PBX_ALSA=1
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ALSA 1
-_ACEOF
-
- fi
- elif test ! -z "${ALSA_MANDATORY}";
- then
- { echo "$as_me:$LINENO: ***" >&5
-echo "$as_me: ***" >&6;}
- { echo "$as_me:$LINENO: *** The ${ALSA_DESCRIP} installation on this system appears to be broken." >&5
-echo "$as_me: *** The ${ALSA_DESCRIP} installation on this system appears to be broken." >&6;}
- { echo "$as_me:$LINENO: *** Either correct the installation" >&5
-echo "$as_me: *** Either correct the installation" >&or run configure;}
- { echo "$as_me:$LINENO: *** without explicitly specifying --with-${ALSA_OPTION}" >&5
-echo "$as_me: *** without explicitly specifying --with-${ALSA_OPTION}" >&6;}
- exit 1
+ if test ! x"${KDEINIT}" = xNo; then
+ KDEDIR=$(${DIRNAME} ${KDEINIT})
+ KDEDIR=$(${DIRNAME} ${KDEDIR})
fi
+
fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
-if test "${USE_CURSES}" != "no"; then
+if test "${USE_MISDN}" != "no"; then
pbxlibdir=""
- if test "x${CURSES_DIR}" != "x"; then
- if test -d ${CURSES_DIR}/lib; then
- pbxlibdir="-L${CURSES_DIR}/lib"
+ if test "x${MISDN_DIR}" != "x"; then
+ if test -d ${MISDN_DIR}/lib; then
+ pbxlibdir="-L${MISDN_DIR}/lib"
else
- pbxlibdir="-L${CURSES_DIR}"
+ pbxlibdir="-L${MISDN_DIR}"
fi
fi
- { echo "$as_me:$LINENO: checking for initscr in -lcurses" >&5
-echo $ECHO_N "checking for initscr in -lcurses... $ECHO_C" >&6; }
-if test "${ac_cv_lib_curses_initscr+set}" = set; then
+ { echo "$as_me:$LINENO: checking for mISDN_open in -lmISDN" >&5
+echo $ECHO_N "checking for mISDN_open in -lmISDN... $ECHO_C" >&6; }
+if test "${ac_cv_lib_mISDN_mISDN_open+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcurses ${pbxlibdir} $LIBS"
+LIBS="-lmISDN ${pbxlibdir} $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
#ifdef __cplusplus
extern "C"
#endif
-char initscr ();
+char mISDN_open ();
int
main ()
{
-return initscr ();
+return mISDN_open ();
;
return 0;
}
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_lib_curses_initscr=yes
+ ac_cv_lib_mISDN_mISDN_open=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_lib_curses_initscr=no
+ ac_cv_lib_mISDN_mISDN_open=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_initscr" >&5
-echo "${ECHO_T}$ac_cv_lib_curses_initscr" >&6; }
-if test $ac_cv_lib_curses_initscr = yes; then
- AST_CURSES_FOUND=yes
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_mISDN_mISDN_open" >&5
+echo "${ECHO_T}$ac_cv_lib_mISDN_mISDN_open" >&6; }
+if test $ac_cv_lib_mISDN_mISDN_open = yes; then
+ AST_MISDN_FOUND=yes
else
- AST_CURSES_FOUND=no
+ AST_MISDN_FOUND=no
fi
- if test "${AST_CURSES_FOUND}" = "yes"; then
- CURSES_LIB="-lcurses "
- CURSES_HEADER_FOUND="1"
- if test "x${CURSES_DIR}" != "x"; then
- CURSES_LIB="${pbxlibdir} ${CURSES_LIB}"
- CURSES_INCLUDE="-I${CURSES_DIR}/include"
- if test "xcurses.h" != "x" ; then
- as_ac_Header=`echo "ac_cv_header_${CURSES_DIR}/include/curses.h" | $as_tr_sh`
+ if test "${AST_MISDN_FOUND}" = "yes"; then
+ MISDN_LIB="-lmISDN "
+ MISDN_HEADER_FOUND="1"
+ if test "x${MISDN_DIR}" != "x"; then
+ MISDN_LIB="${pbxlibdir} ${MISDN_LIB}"
+ MISDN_INCLUDE="-I${MISDN_DIR}/include"
+ if test "xmISDNuser/mISDNlib.h" != "x" ; then
+ as_ac_Header=`echo "ac_cv_header_${MISDN_DIR}/include/mISDNuser/mISDNlib.h" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for ${CURSES_DIR}/include/curses.h" >&5
-echo $ECHO_N "checking for ${CURSES_DIR}/include/curses.h... $ECHO_C" >&6; }
+ { echo "$as_me:$LINENO: checking for ${MISDN_DIR}/include/mISDNuser/mISDNlib.h" >&5
+echo $ECHO_N "checking for ${MISDN_DIR}/include/mISDNuser/mISDNlib.h... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "${ECHO_T}$ac_res" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${CURSES_DIR}/include/curses.h usability" >&5
-echo $ECHO_N "checking ${CURSES_DIR}/include/curses.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${MISDN_DIR}/include/mISDNuser/mISDNlib.h usability" >&5
+echo $ECHO_N "checking ${MISDN_DIR}/include/mISDNuser/mISDNlib.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <${CURSES_DIR}/include/curses.h>
+#include <${MISDN_DIR}/include/mISDNuser/mISDNlib.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking ${CURSES_DIR}/include/curses.h presence" >&5
-echo $ECHO_N "checking ${CURSES_DIR}/include/curses.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${MISDN_DIR}/include/mISDNuser/mISDNlib.h presence" >&5
+echo $ECHO_N "checking ${MISDN_DIR}/include/mISDNuser/mISDNlib.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <${CURSES_DIR}/include/curses.h>
+#include <${MISDN_DIR}/include/mISDNuser/mISDNlib.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: in the future, the compiler will take precedence" >&2;}
;;
esac
-{ echo "$as_me:$LINENO: checking for ${CURSES_DIR}/include/curses.h" >&5
-echo $ECHO_N "checking for ${CURSES_DIR}/include/curses.h... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for ${MISDN_DIR}/include/mISDNuser/mISDNlib.h" >&5
+echo $ECHO_N "checking for ${MISDN_DIR}/include/mISDNuser/mISDNlib.h... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
- CURSES_HEADER_FOUND=1
+ MISDN_HEADER_FOUND=1
else
- CURSES_HEADER_FOUND=0
+ MISDN_HEADER_FOUND=0
fi
fi
else
- if test "xcurses.h" != "x" ; then
- if test "${ac_cv_header_curses_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for curses.h" >&5
-echo $ECHO_N "checking for curses.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_curses_h+set}" = set; then
+ if test "xmISDNuser/mISDNlib.h" != "x" ; then
+ if test "${ac_cv_header_mISDNuser_mISDNlib_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for mISDNuser/mISDNlib.h" >&5
+echo $ECHO_N "checking for mISDNuser/mISDNlib.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_mISDNuser_mISDNlib_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_curses_h" >&5
-echo "${ECHO_T}$ac_cv_header_curses_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_mISDNlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_mISDNuser_mISDNlib_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking curses.h usability" >&5
-echo $ECHO_N "checking curses.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking mISDNuser/mISDNlib.h usability" >&5
+echo $ECHO_N "checking mISDNuser/mISDNlib.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <curses.h>
+#include <mISDNuser/mISDNlib.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking curses.h presence" >&5
-echo $ECHO_N "checking curses.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking mISDNuser/mISDNlib.h presence" >&5
+echo $ECHO_N "checking mISDNuser/mISDNlib.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <curses.h>
+#include <mISDNuser/mISDNlib.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: curses.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: curses.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: curses.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: curses.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: mISDNuser/mISDNlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: mISDNuser/mISDNlib.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: curses.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: curses.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: curses.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: curses.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: curses.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: curses.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: curses.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: curses.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: curses.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: curses.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: curses.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: curses.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for curses.h" >&5
-echo $ECHO_N "checking for curses.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_curses_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_curses_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_curses_h" >&5
-echo "${ECHO_T}$ac_cv_header_curses_h" >&6; }
-
-fi
-if test $ac_cv_header_curses_h = yes; then
- CURSES_HEADER_FOUND=1
-else
- CURSES_HEADER_FOUND=0
-fi
-
-
- fi
- fi
- if test "x${CURSES_HEADER_FOUND}" = "x0" ; then
- if test ! -z "${CURSES_MANDATORY}" ;
- then
- { echo "$as_me:$LINENO: ***" >&5
-echo "$as_me: ***" >&6;}
- { echo "$as_me:$LINENO: *** It appears that you do not have the curses development package installed." >&5
-echo "$as_me: *** It appears that you do not have the curses development package installed." >&6;}
- { echo "$as_me:$LINENO: *** Please install it to include ${CURSES_DESCRIP} support" >&5
-echo "$as_me: *** Please install it to include ${CURSES_DESCRIP} support" >&or re-run configure;}
- { echo "$as_me:$LINENO: *** without explicitly specifying --with-${CURSES_OPTION}" >&5
-echo "$as_me: *** without explicitly specifying --with-${CURSES_OPTION}" >&6;}
- exit 1
- fi
- CURSES_LIB=""
- CURSES_INCLUDE=""
- PBX_CURSES=0
- else
- PBX_CURSES=1
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_CURSES 1
-_ACEOF
-
- fi
- elif test ! -z "${CURSES_MANDATORY}";
- then
- { echo "$as_me:$LINENO: ***" >&5
-echo "$as_me: ***" >&6;}
- { echo "$as_me:$LINENO: *** The ${CURSES_DESCRIP} installation on this system appears to be broken." >&5
-echo "$as_me: *** The ${CURSES_DESCRIP} installation on this system appears to be broken." >&6;}
- { echo "$as_me:$LINENO: *** Either correct the installation" >&5
-echo "$as_me: *** Either correct the installation" >&or run configure;}
- { echo "$as_me:$LINENO: *** without explicitly specifying --with-${CURSES_OPTION}" >&5
-echo "$as_me: *** without explicitly specifying --with-${CURSES_OPTION}" >&6;}
- exit 1
- fi
-fi
-
-
-GSM_INTERNAL="yes"
-GSM_SYSTEM="yes"
-if test "${USE_GSM}" != "no"; then
- if test "${GSM_DIR}" = "internal"; then
- GSM_SYSTEM="no"
- elif test "${GSM_DIR}" != ""; then
- GSM_INTERNAL="no"
- fi
- if test "${GSM_SYSTEM}" = "yes"; then
- gsmlibdir=""
- if test "x${GSM_DIR}" != "x"; then
- if test -d ${GSM_DIR}/lib; then
- gsmlibdir="-L${GSM_DIR}/lib"
- else
- gsmlibdir="-L${GSM_DIR}"
- fi
- fi
- { echo "$as_me:$LINENO: checking for gsm_create in -lgsm" >&5
-echo $ECHO_N "checking for gsm_create in -lgsm... $ECHO_C" >&6; }
-if test "${ac_cv_lib_gsm_gsm_create+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgsm ${gsmlibdir} $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gsm_create ();
-int
-main ()
-{
-return gsm_create ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_gsm_gsm_create=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: mISDNuser/mISDNlib.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: mISDNuser/mISDNlib.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: mISDNuser/mISDNlib.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: mISDNuser/mISDNlib.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: mISDNuser/mISDNlib.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: mISDNuser/mISDNlib.h: in the future, the compiler will take precedence" >&2;}
- ac_cv_lib_gsm_gsm_create=no
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for mISDNuser/mISDNlib.h" >&5
+echo $ECHO_N "checking for mISDNuser/mISDNlib.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_mISDNuser_mISDNlib_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_mISDNuser_mISDNlib_h=$ac_header_preproc
fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_mISDNlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_mISDNuser_mISDNlib_h" >&6; }
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_gsm_gsm_create" >&5
-echo "${ECHO_T}$ac_cv_lib_gsm_gsm_create" >&6; }
-if test $ac_cv_lib_gsm_gsm_create = yes; then
+if test $ac_cv_header_mISDNuser_mISDNlib_h = yes; then
+ MISDN_HEADER_FOUND=1
+else
+ MISDN_HEADER_FOUND=0
+fi
+
+
+ fi
+ fi
+ if test "x${MISDN_HEADER_FOUND}" = "x0" ; then
+ if test ! -z "${MISDN_MANDATORY}" ;
+ then
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** It appears that you do not have the mISDN development package installed." >&5
+echo "$as_me: *** It appears that you do not have the mISDN development package installed." >&6;}
+ { echo "$as_me:$LINENO: *** Please install it to include ${MISDN_DESCRIP} support" >&5
+echo "$as_me: *** Please install it to include ${MISDN_DESCRIP} support" >&or re-run configure;}
+ { echo "$as_me:$LINENO: *** without explicitly specifying --with-${MISDN_OPTION}" >&5
+echo "$as_me: *** without explicitly specifying --with-${MISDN_OPTION}" >&6;}
+ exit 1
+ fi
+ MISDN_LIB=""
+ MISDN_INCLUDE=""
+ PBX_MISDN=0
+ else
+ PBX_MISDN=1
cat >>confdefs.h <<_ACEOF
-#define HAVE_GSM 1
+#define HAVE_MISDN 1
_ACEOF
-fi
-
- if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
- GSM_LIB="-lgsm"
- if test "x${GSM_DIR}" != "x"; then
- GSM_LIB="${gsmlibdir} ${GSM_LIB}"
- GSM_INCLUDE="-I${GSM_DIR}/include"
- fi
- PBX_GSM=1
- GSM_INTERNAL="no"
fi
- fi
- if test "${GSM_INTERNAL}" = "yes"; then
- GSM_LIB="internal"
- PBX_GSM=1
+ elif test ! -z "${MISDN_MANDATORY}";
+ then
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** The ${MISDN_DESCRIP} installation on this system appears to be broken." >&5
+echo "$as_me: *** The ${MISDN_DESCRIP} installation on this system appears to be broken." >&6;}
+ { echo "$as_me:$LINENO: *** Either correct the installation" >&5
+echo "$as_me: *** Either correct the installation" >&or run configure;}
+ { echo "$as_me:$LINENO: *** without explicitly specifying --with-${MISDN_OPTION}" >&5
+echo "$as_me: *** without explicitly specifying --with-${MISDN_OPTION}" >&6;}
+ exit 1
fi
fi
-if test "${USE_IKSEMEL}" != "no"; then
+if test "${PBX_MISDN}" = 1; then
+
+if test "${USE_ISDNNET}" != "no"; then
pbxlibdir=""
- if test "x${IKSEMEL_DIR}" != "x"; then
- if test -d ${IKSEMEL_DIR}/lib; then
- pbxlibdir="-L${IKSEMEL_DIR}/lib"
+ if test "x${ISDNNET_DIR}" != "x"; then
+ if test -d ${ISDNNET_DIR}/lib; then
+ pbxlibdir="-L${ISDNNET_DIR}/lib"
else
- pbxlibdir="-L${IKSEMEL_DIR}"
+ pbxlibdir="-L${ISDNNET_DIR}"
fi
fi
- { echo "$as_me:$LINENO: checking for iks_start_sasl in -liksemel" >&5
-echo $ECHO_N "checking for iks_start_sasl in -liksemel... $ECHO_C" >&6; }
-if test "${ac_cv_lib_iksemel_iks_start_sasl+set}" = set; then
+ { echo "$as_me:$LINENO: checking for init_manager in -lisdnnet" >&5
+echo $ECHO_N "checking for init_manager in -lisdnnet... $ECHO_C" >&6; }
+if test "${ac_cv_lib_isdnnet_init_manager+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-liksemel ${pbxlibdir} $LIBS"
+LIBS="-lisdnnet ${pbxlibdir} -lmISDN -lpthread $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
#ifdef __cplusplus
extern "C"
#endif
-char iks_start_sasl ();
+char init_manager ();
int
main ()
{
-return iks_start_sasl ();
+return init_manager ();
;
return 0;
}
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_lib_iksemel_iks_start_sasl=yes
+ ac_cv_lib_isdnnet_init_manager=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_lib_iksemel_iks_start_sasl=no
+ ac_cv_lib_isdnnet_init_manager=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_iksemel_iks_start_sasl" >&5
-echo "${ECHO_T}$ac_cv_lib_iksemel_iks_start_sasl" >&6; }
-if test $ac_cv_lib_iksemel_iks_start_sasl = yes; then
- AST_IKSEMEL_FOUND=yes
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_isdnnet_init_manager" >&5
+echo "${ECHO_T}$ac_cv_lib_isdnnet_init_manager" >&6; }
+if test $ac_cv_lib_isdnnet_init_manager = yes; then
+ AST_ISDNNET_FOUND=yes
else
- AST_IKSEMEL_FOUND=no
+ AST_ISDNNET_FOUND=no
fi
- if test "${AST_IKSEMEL_FOUND}" = "yes"; then
- IKSEMEL_LIB="-liksemel "
- IKSEMEL_HEADER_FOUND="1"
- if test "x${IKSEMEL_DIR}" != "x"; then
- IKSEMEL_LIB="${pbxlibdir} ${IKSEMEL_LIB}"
- IKSEMEL_INCLUDE="-I${IKSEMEL_DIR}/include"
- if test "xiksemel.h" != "x" ; then
- as_ac_Header=`echo "ac_cv_header_${IKSEMEL_DIR}/include/iksemel.h" | $as_tr_sh`
+ if test "${AST_ISDNNET_FOUND}" = "yes"; then
+ ISDNNET_LIB="-lisdnnet -lmISDN -lpthread"
+ ISDNNET_HEADER_FOUND="1"
+ if test "x${ISDNNET_DIR}" != "x"; then
+ ISDNNET_LIB="${pbxlibdir} ${ISDNNET_LIB}"
+ ISDNNET_INCLUDE="-I${ISDNNET_DIR}/include"
+ if test "xmISDNuser/isdn_net.h" != "x" ; then
+ as_ac_Header=`echo "ac_cv_header_${ISDNNET_DIR}/include/mISDNuser/isdn_net.h" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for ${IKSEMEL_DIR}/include/iksemel.h" >&5
-echo $ECHO_N "checking for ${IKSEMEL_DIR}/include/iksemel.h... $ECHO_C" >&6; }
+ { echo "$as_me:$LINENO: checking for ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h" >&5
+echo $ECHO_N "checking for ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "${ECHO_T}$ac_res" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${IKSEMEL_DIR}/include/iksemel.h usability" >&5
-echo $ECHO_N "checking ${IKSEMEL_DIR}/include/iksemel.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h usability" >&5
+echo $ECHO_N "checking ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <${IKSEMEL_DIR}/include/iksemel.h>
+#include <${ISDNNET_DIR}/include/mISDNuser/isdn_net.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking ${IKSEMEL_DIR}/include/iksemel.h presence" >&5
-echo $ECHO_N "checking ${IKSEMEL_DIR}/include/iksemel.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h presence" >&5
+echo $ECHO_N "checking ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <${IKSEMEL_DIR}/include/iksemel.h>
+#include <${ISDNNET_DIR}/include/mISDNuser/isdn_net.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: in the future, the compiler will take precedence" >&2;}
;;
esac
-{ echo "$as_me:$LINENO: checking for ${IKSEMEL_DIR}/include/iksemel.h" >&5
-echo $ECHO_N "checking for ${IKSEMEL_DIR}/include/iksemel.h... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h" >&5
+echo $ECHO_N "checking for ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
- IKSEMEL_HEADER_FOUND=1
+ ISDNNET_HEADER_FOUND=1
else
- IKSEMEL_HEADER_FOUND=0
+ ISDNNET_HEADER_FOUND=0
fi
fi
else
- if test "xiksemel.h" != "x" ; then
- if test "${ac_cv_header_iksemel_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for iksemel.h" >&5
-echo $ECHO_N "checking for iksemel.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_iksemel_h+set}" = set; then
+ if test "xmISDNuser/isdn_net.h" != "x" ; then
+ if test "${ac_cv_header_mISDNuser_isdn_net_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for mISDNuser/isdn_net.h" >&5
+echo $ECHO_N "checking for mISDNuser/isdn_net.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_mISDNuser_isdn_net_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_iksemel_h" >&5
-echo "${ECHO_T}$ac_cv_header_iksemel_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_isdn_net_h" >&5
+echo "${ECHO_T}$ac_cv_header_mISDNuser_isdn_net_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking iksemel.h usability" >&5
-echo $ECHO_N "checking iksemel.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking mISDNuser/isdn_net.h usability" >&5
+echo $ECHO_N "checking mISDNuser/isdn_net.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <iksemel.h>
+#include <mISDNuser/isdn_net.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking iksemel.h presence" >&5
-echo $ECHO_N "checking iksemel.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking mISDNuser/isdn_net.h presence" >&5
+echo $ECHO_N "checking mISDNuser/isdn_net.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <iksemel.h>
+#include <mISDNuser/isdn_net.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: iksemel.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: iksemel.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: iksemel.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: iksemel.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: mISDNuser/isdn_net.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: mISDNuser/isdn_net.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: iksemel.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: iksemel.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: iksemel.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: iksemel.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: iksemel.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: iksemel.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: iksemel.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: iksemel.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: iksemel.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: iksemel.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: iksemel.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: iksemel.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: mISDNuser/isdn_net.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: mISDNuser/isdn_net.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: mISDNuser/isdn_net.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: mISDNuser/isdn_net.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: mISDNuser/isdn_net.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: mISDNuser/isdn_net.h: in the future, the compiler will take precedence" >&2;}
;;
esac
-{ echo "$as_me:$LINENO: checking for iksemel.h" >&5
-echo $ECHO_N "checking for iksemel.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_iksemel_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_iksemel_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_iksemel_h" >&5
-echo "${ECHO_T}$ac_cv_header_iksemel_h" >&6; }
-
-fi
-if test $ac_cv_header_iksemel_h = yes; then
- IKSEMEL_HEADER_FOUND=1
-else
- IKSEMEL_HEADER_FOUND=0
-fi
-
-
- fi
- fi
- if test "x${IKSEMEL_HEADER_FOUND}" = "x0" ; then
- if test ! -z "${IKSEMEL_MANDATORY}" ;
- then
- { echo "$as_me:$LINENO: ***" >&5
-echo "$as_me: ***" >&6;}
- { echo "$as_me:$LINENO: *** It appears that you do not have the iksemel development package installed." >&5
-echo "$as_me: *** It appears that you do not have the iksemel development package installed." >&6;}
- { echo "$as_me:$LINENO: *** Please install it to include ${IKSEMEL_DESCRIP} support" >&5
-echo "$as_me: *** Please install it to include ${IKSEMEL_DESCRIP} support" >&or re-run configure;}
- { echo "$as_me:$LINENO: *** without explicitly specifying --with-${IKSEMEL_OPTION}" >&5
-echo "$as_me: *** without explicitly specifying --with-${IKSEMEL_OPTION}" >&6;}
- exit 1
- fi
- IKSEMEL_LIB=""
- IKSEMEL_INCLUDE=""
- PBX_IKSEMEL=0
- else
- PBX_IKSEMEL=1
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_IKSEMEL 1
-_ACEOF
-
- fi
- elif test ! -z "${IKSEMEL_MANDATORY}";
- then
- { echo "$as_me:$LINENO: ***" >&5
-echo "$as_me: ***" >&6;}
- { echo "$as_me:$LINENO: *** The ${IKSEMEL_DESCRIP} installation on this system appears to be broken." >&5
-echo "$as_me: *** The ${IKSEMEL_DESCRIP} installation on this system appears to be broken." >&6;}
- { echo "$as_me:$LINENO: *** Either correct the installation" >&5
-echo "$as_me: *** Either correct the installation" >&or run configure;}
- { echo "$as_me:$LINENO: *** without explicitly specifying --with-${IKSEMEL_OPTION}" >&5
-echo "$as_me: *** without explicitly specifying --with-${IKSEMEL_OPTION}" >&6;}
- exit 1
- fi
-fi
-
-
-if test "${USE_IMAP_TK}" != "no"; then
- if test "${IMAP_TK_DIR}" = ""; then
- IMAP_TK_DIR=`pwd`"/../imap-2004g"
- fi
- { echo "$as_me:$LINENO: checking checking for UW IMAP Toolkit c-client library" >&5
-echo $ECHO_N "checking checking for UW IMAP Toolkit c-client library... $ECHO_C" >&6; }
- saved_cppflags="${CPPFLAGS}"
- saved_libs="${LIBS}"
- if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
- imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
- fi
- CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
- LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include "c-client.h"
- void mm_searched (MAILSTREAM *stream,unsigned long number)
- {
- }
- void mm_exists (MAILSTREAM *stream,unsigned long number)
- {
- }
- void mm_expunged (MAILSTREAM *stream,unsigned long number)
- {
- }
- void mm_flags (MAILSTREAM *stream,unsigned long number)
- {
- }
- void mm_notify (MAILSTREAM *stream,char *string,long errflg)
- {
- }
- void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
- {
- }
- void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
- {
- }
- void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
- {
- }
- void mm_log (char *string,long errflg)
- {
- }
- void mm_dlog (char *string)
- {
- }
- void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
- {
- }
- void mm_critical (MAILSTREAM *stream)
- {
- }
- void mm_nocritical (MAILSTREAM *stream)
- {
- }
- long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
- {
- }
- void mm_fatal (char *string)
- {
- }
-int
-main ()
-{
+{ echo "$as_me:$LINENO: checking for mISDNuser/isdn_net.h" >&5
+echo $ECHO_N "checking for mISDNuser/isdn_net.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_mISDNuser_isdn_net_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_mISDNuser_isdn_net_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_isdn_net_h" >&5
+echo "${ECHO_T}$ac_cv_header_mISDNuser_isdn_net_h" >&6; }
- MAILSTREAM *foo = mail_open(NULL, "", 0);
+fi
+if test $ac_cv_header_mISDNuser_isdn_net_h = yes; then
+ ISDNNET_HEADER_FOUND=1
+else
+ ISDNNET_HEADER_FOUND=0
+fi
+
+
+ fi
+ fi
+ if test "x${ISDNNET_HEADER_FOUND}" = "x0" ; then
+ if test ! -z "${ISDNNET_MANDATORY}" ;
+ then
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** It appears that you do not have the isdnnet development package installed." >&5
+echo "$as_me: *** It appears that you do not have the isdnnet development package installed." >&6;}
+ { echo "$as_me:$LINENO: *** Please install it to include ${ISDNNET_DESCRIP} support" >&5
+echo "$as_me: *** Please install it to include ${ISDNNET_DESCRIP} support" >&or re-run configure;}
+ { echo "$as_me:$LINENO: *** without explicitly specifying --with-${ISDNNET_OPTION}" >&5
+echo "$as_me: *** without explicitly specifying --with-${ISDNNET_OPTION}" >&6;}
+ exit 1
+ fi
+ ISDNNET_LIB=""
+ ISDNNET_INCLUDE=""
+ PBX_ISDNNET=0
+ else
+ PBX_ISDNNET=1
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ISDNNET 1
+_ACEOF
+
+ fi
+ elif test ! -z "${ISDNNET_MANDATORY}";
+ then
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** The ${ISDNNET_DESCRIP} installation on this system appears to be broken." >&5
+echo "$as_me: *** The ${ISDNNET_DESCRIP} installation on this system appears to be broken." >&6;}
+ { echo "$as_me:$LINENO: *** Either correct the installation" >&5
+echo "$as_me: *** Either correct the installation" >&or run configure;}
+ { echo "$as_me:$LINENO: *** without explicitly specifying --with-${ISDNNET_OPTION}" >&5
+echo "$as_me: *** without explicitly specifying --with-${ISDNNET_OPTION}" >&6;}
+ exit 1
+ fi
+fi
+if test "${USE_SUPPSERV}" != "no"; then
+ pbxlibdir=""
+ if test "x${SUPPSERV_DIR}" != "x"; then
+ if test -d ${SUPPSERV_DIR}/lib; then
+ pbxlibdir="-L${SUPPSERV_DIR}/lib"
+ else
+ pbxlibdir="-L${SUPPSERV_DIR}"
+ fi
+ fi
+ { echo "$as_me:$LINENO: checking for encodeFac in -lsuppserv" >&5
+echo $ECHO_N "checking for encodeFac in -lsuppserv... $ECHO_C" >&6; }
+if test "${ac_cv_lib_suppserv_encodeFac+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsuppserv ${pbxlibdir} $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char encodeFac ();
+int
+main ()
+{
+return encodeFac ();
;
return 0;
}
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_imap_tk="yes"
+ ac_cv_lib_suppserv_encodeFac=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_imap_tk="no"
-
+ ac_cv_lib_suppserv_encodeFac=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "${ac_cv_imap_tk}" = "yes"; then
- cat >conftest.$ac_ext <<_ACEOF
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_suppserv_encodeFac" >&5
+echo "${ECHO_T}$ac_cv_lib_suppserv_encodeFac" >&6; }
+if test $ac_cv_lib_suppserv_encodeFac = yes; then
+ AST_SUPPSERV_FOUND=yes
+else
+ AST_SUPPSERV_FOUND=no
+fi
+
+
+ if test "${AST_SUPPSERV_FOUND}" = "yes"; then
+ SUPPSERV_LIB="-lsuppserv "
+ SUPPSERV_HEADER_FOUND="1"
+ if test "x${SUPPSERV_DIR}" != "x"; then
+ SUPPSERV_LIB="${pbxlibdir} ${SUPPSERV_LIB}"
+ SUPPSERV_INCLUDE="-I${SUPPSERV_DIR}/include"
+ if test "xmISDNuser/suppserv.h" != "x" ; then
+ as_ac_Header=`echo "ac_cv_header_${SUPPSERV_DIR}/include/mISDNuser/suppserv.h" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h" >&5
+echo $ECHO_N "checking for ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h usability" >&5
+echo $ECHO_N "checking ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include "c-client.h"
- void mm_searched (MAILSTREAM *stream,unsigned long number)
- {
- }
- void mm_exists (MAILSTREAM *stream,unsigned long number)
- {
- }
- void mm_expunged (MAILSTREAM *stream,unsigned long number)
- {
- }
- void mm_flags (MAILSTREAM *stream,unsigned long number)
- {
- }
- void mm_notify (MAILSTREAM *stream,char *string,long errflg)
- {
- }
- void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
- {
- }
- void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
- {
- }
- void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
- {
- }
- void mm_log (char *string,long errflg)
- {
- }
- void mm_dlog (char *string)
- {
- }
- void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
- {
- }
- void mm_critical (MAILSTREAM *stream)
- {
- }
- void mm_nocritical (MAILSTREAM *stream)
- {
- }
- long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
- {
- }
- void mm_fatal (char *string)
- {
- }
-int
-main ()
-{
-
- long check = mail_expunge_full(NULL, "", 0);
-
-
- ;
- return 0;
-}
+$ac_includes_default
+#include <${SUPPSERV_DIR}/include/mISDNuser/suppserv.h>
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -s conftest.$ac_objext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_imap_tk2006="yes"
+ ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_imap_tk2006="no"
-
+ ac_header_compiler=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- fi
- CPPFLAGS="${saved_cppflags}"
- LIBS="${saved_libs}"
- if test "${ac_cv_imap_tk}" = "yes"; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
- IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
- PBX_IMAP_TK=1
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_IMAP_TK 1
+# Is the header present?
+{ echo "$as_me:$LINENO: checking ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h presence" >&5
+echo $ECHO_N "checking ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
-
- if test "${ac_cv_imap_tk2006}" = "yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_IMAP_TK2006 1
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <${SUPPSERV_DIR}/include/mISDNuser/suppserv.h>
_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- fi
- elif test ! -z "${IMAP_TK_MANDATORY}"; then
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- { echo "$as_me:$LINENO: ***" >&5
-echo "$as_me: ***" >&6;}
- { echo "$as_me:$LINENO: *** The UW IMAP Toolkit installation on this system appears to be broken." >&5
-echo "$as_me: *** The UW IMAP Toolkit installation on this system appears to be broken." >&6;}
- { echo "$as_me:$LINENO: *** Either correct the installation" >&5
-echo "$as_me: *** Either correct the installation" >&or run configure;}
- { echo "$as_me:$LINENO: *** including --without-imap." >&5
-echo "$as_me: *** including --without-imap." >&6;}
- exit 1
- else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- fi
+ ac_header_preproc=no
fi
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: in the future, the compiler will take precedence" >&2;}
-if test "${USE_KDE}" != "no"; then
- { echo "$as_me:$LINENO: checking checking for crashHandler in -lkdecore" >&5
-echo $ECHO_N "checking checking for crashHandler in -lkdecore... $ECHO_C" >&6; }
- saved_libs="${LIBS}"
- saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
- if test -d ${KDE_DIR}/lib; then
- kdelibdir="${KDE_DIR}/lib"
- else
- kdelibdir="${KDE_DIR}"
- fi
- LIBS="${LIBS} -L${kdelibdir} -lkdecore"
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h" >&5
+echo $ECHO_N "checking for ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ SUPPSERV_HEADER_FOUND=1
+else
+ SUPPSERV_HEADER_FOUND=0
+fi
+ fi
+ else
+ if test "xmISDNuser/suppserv.h" != "x" ; then
+ if test "${ac_cv_header_mISDNuser_suppserv_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for mISDNuser/suppserv.h" >&5
+echo $ECHO_N "checking for mISDNuser/suppserv.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_mISDNuser_suppserv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_suppserv_h" >&5
+echo "${ECHO_T}$ac_cv_header_mISDNuser_suppserv_h" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking mISDNuser/suppserv.h usability" >&5
+echo $ECHO_N "checking mISDNuser/suppserv.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include "kcrash.h"
-int
-main ()
-{
-KCrash::defaultCrashHandler(1);
- ;
- return 0;
-}
-
+$ac_includes_default
+#include <mISDNuser/suppserv.h>
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -s conftest.$ac_objext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_lib_kde_crash="yes"
+ ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_lib_kde_crash="no"
+ ac_header_compiler=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
- LIBS="${saved_libs}"
- CPPFLAGS="${saved_cppflags}"
-
- if test "${ac_cv_lib_kde_crash}" = "yes"; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- KDE_LIB="-lkdecore -lkdeui"
- if test "${KDE_DIR}" != ""; then
- KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
- KDE_INCLUDE="-I${KDE_DIR}/include"
- fi
- PBX_KDE=1
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBKDE 1
+# Is the header present?
+{ echo "$as_me:$LINENO: checking mISDNuser/suppserv.h presence" >&5
+echo $ECHO_N "checking mISDNuser/suppserv.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
-
- elif test ! -z "${KDE_MANDATORY}"; then
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- { echo "$as_me:$LINENO: ***" >&5
-echo "$as_me: ***" >&6;}
- { echo "$as_me:$LINENO: *** The KDE installation on this system appears to be broken." >&5
-echo "$as_me: *** The KDE installation on this system appears to be broken." >&6;}
- { echo "$as_me:$LINENO: *** Either correct the installation" >&5
-echo "$as_me: *** Either correct the installation" >&or run configure;}
- { echo "$as_me:$LINENO: *** including --without-kde." >&5
-echo "$as_me: *** including --without-kde." >&6;}
- exit 1
- else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- fi
-fi
-if test "${PBX_KDE}" = 1; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}kdeinit", so it can be a program name with args.
-set dummy ${ac_tool_prefix}kdeinit; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_KDEINIT+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $KDEINIT in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_KDEINIT="$KDEINIT" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_KDEINIT="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mISDNuser/suppserv.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
-KDEINIT=$ac_cv_path_KDEINIT
-if test -n "$KDEINIT"; then
- { echo "$as_me:$LINENO: result: $KDEINIT" >&5
-echo "${ECHO_T}$KDEINIT" >&6; }
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
fi
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
-fi
-if test -z "$ac_cv_path_KDEINIT"; then
- ac_pt_KDEINIT=$KDEINIT
- # Extract the first word of "kdeinit", so it can be a program name with args.
-set dummy kdeinit; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_ac_pt_KDEINIT+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $ac_pt_KDEINIT in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ac_pt_KDEINIT="$ac_pt_KDEINIT" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_ac_pt_KDEINIT="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: mISDNuser/suppserv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: mISDNuser/suppserv.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: mISDNuser/suppserv.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: mISDNuser/suppserv.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: mISDNuser/suppserv.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: mISDNuser/suppserv.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: mISDNuser/suppserv.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: mISDNuser/suppserv.h: in the future, the compiler will take precedence" >&2;}
- ;;
+ ;;
esac
-fi
-ac_pt_KDEINIT=$ac_cv_path_ac_pt_KDEINIT
-if test -n "$ac_pt_KDEINIT"; then
- { echo "$as_me:$LINENO: result: $ac_pt_KDEINIT" >&5
-echo "${ECHO_T}$ac_pt_KDEINIT" >&6; }
+{ echo "$as_me:$LINENO: checking for mISDNuser/suppserv.h" >&5
+echo $ECHO_N "checking for mISDNuser/suppserv.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_mISDNuser_suppserv_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ ac_cv_header_mISDNuser_suppserv_h=$ac_header_preproc
fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_suppserv_h" >&5
+echo "${ECHO_T}$ac_cv_header_mISDNuser_suppserv_h" >&6; }
- if test "x$ac_pt_KDEINIT" = x; then
- KDEINIT="No"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- KDEINIT=$ac_pt_KDEINIT
- fi
+fi
+if test $ac_cv_header_mISDNuser_suppserv_h = yes; then
+ SUPPSERV_HEADER_FOUND=1
else
- KDEINIT="$ac_cv_path_KDEINIT"
+ SUPPSERV_HEADER_FOUND=0
fi
- if test ! x"${KDEINIT}" = xNo; then
- KDEDIR=$(${DIRNAME} ${KDEINIT})
- KDEDIR=$(${DIRNAME} ${KDEDIR})
- fi
-fi
+ fi
+ fi
+ if test "x${SUPPSERV_HEADER_FOUND}" = "x0" ; then
+ if test ! -z "${SUPPSERV_MANDATORY}" ;
+ then
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** It appears that you do not have the suppserv development package installed." >&5
+echo "$as_me: *** It appears that you do not have the suppserv development package installed." >&6;}
+ { echo "$as_me:$LINENO: *** Please install it to include ${SUPPSERV_DESCRIP} support" >&5
+echo "$as_me: *** Please install it to include ${SUPPSERV_DESCRIP} support" >&or re-run configure;}
+ { echo "$as_me:$LINENO: *** without explicitly specifying --with-${SUPPSERV_OPTION}" >&5
+echo "$as_me: *** without explicitly specifying --with-${SUPPSERV_OPTION}" >&6;}
+ exit 1
+ fi
+ SUPPSERV_LIB=""
+ SUPPSERV_INCLUDE=""
+ PBX_SUPPSERV=0
+ else
+ PBX_SUPPSERV=1
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SUPPSERV 1
+_ACEOF
+
+ fi
+ elif test ! -z "${SUPPSERV_MANDATORY}";
+ then
+ { echo "$as_me:$LINENO: ***" >&5
+echo "$as_me: ***" >&6;}
+ { echo "$as_me:$LINENO: *** The ${SUPPSERV_DESCRIP} installation on this system appears to be broken." >&5
+echo "$as_me: *** The ${SUPPSERV_DESCRIP} installation on this system appears to be broken." >&6;}
+ { echo "$as_me:$LINENO: *** Either correct the installation" >&5
+echo "$as_me: *** Either correct the installation" >&or run configure;}
+ { echo "$as_me:$LINENO: *** without explicitly specifying --with-${SUPPSERV_OPTION}" >&5
+echo "$as_me: *** without explicitly specifying --with-${SUPPSERV_OPTION}" >&6;}
+ exit 1
+ fi
+fi
+fi
if test "${USE_NBS}" != "no"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lodbc ${pbxlibdir} $LIBS"
+LIBS="-lodbc ${pbxlibdir} -lltdl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
if test "${AST_UNIXODBC_FOUND}" = "yes"; then
- UNIXODBC_LIB="-lodbc "
+ UNIXODBC_LIB="-lodbc -lltdl"
UNIXODBC_HEADER_FOUND="1"
if test "x${UNIXODBC_DIR}" != "x"; then
UNIXODBC_LIB="${pbxlibdir} ${UNIXODBC_LIB}"
if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
- PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
+ PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz -lcrypt"
PGSQL_INCLUDE="-I${PGSQL_includedir}"
PBX_PGSQL=1
elif test ! -z "${PGSQL_MANDATORY}";
fi
-if test "${PBX_OSTYPE}" != "Linux" ; then
+if test "${host_os}" != "linux-gnu" ; then
tonezone_extra="-lm"
fi
if test ! x"${CURL}" = xNo; then
# check for version
- if test $PBX_OSTYPE = "SunOS"; then
+ if test "${host_os}" = "SunOS"; then
if [ 0x`curl-config --vernum` -ge 0x70907 ]; then
CURLLIB=$(${CURL} --libs)
PBX_CURL=1
host_cpu!$host_cpu$ac_delim
host_vendor!$host_vendor$ac_delim
host_os!$host_os$ac_delim
-target!$target$ac_delim
-target_cpu!$target_cpu$ac_delim
-target_vendor!$target_vendor$ac_delim
-target_os!$target_os$ac_delim
-PBX_PLATFORM!$PBX_PLATFORM$ac_delim
-PBX_CPU!$PBX_CPU$ac_delim
-PBX_VENDOR!$PBX_VENDOR$ac_delim
-PBX_OS!$PBX_OS$ac_delim
+BUILD_PLATFORM!$BUILD_PLATFORM$ac_delim
+BUILD_CPU!$BUILD_CPU$ac_delim
+BUILD_VENDOR!$BUILD_VENDOR$ac_delim
+BUILD_OS!$BUILD_OS$ac_delim
+HOST_PLATFORM!$HOST_PLATFORM$ac_delim
+HOST_CPU!$HOST_CPU$ac_delim
+HOST_VENDOR!$HOST_VENDOR$ac_delim
+HOST_OS!$HOST_OS$ac_delim
UNAME!$UNAME$ac_delim
PBX_OSREV!$PBX_OSREV$ac_delim
-OSISWIN32!$OSISWIN32$ac_delim
-PBX_OSTYPE!$PBX_OSTYPE$ac_delim
CC!$CC$ac_delim
CXX!$CXX$ac_delim
+LD!$LD$ac_delim
RANLIB!$RANLIB$ac_delim
AR!$AR$ac_delim
-NM!$NM$ac_delim
-WINDRES!$WINDRES$ac_delim
-DLLWRAP!$DLLWRAP$ac_delim
CFLAGS!$CFLAGS$ac_delim
LDFLAGS!$LDFLAGS$ac_delim
CPPFLAGS!$CPPFLAGS$ac_delim
CURSES_LIB!$CURSES_LIB$ac_delim
CURSES_INCLUDE!$CURSES_INCLUDE$ac_delim
PBX_CURSES!$PBX_CURSES$ac_delim
+GNUTLS_LIB!$GNUTLS_LIB$ac_delim
+GNUTLS_INCLUDE!$GNUTLS_INCLUDE$ac_delim
+PBX_GNUTLS!$PBX_GNUTLS$ac_delim
GSM_LIB!$GSM_LIB$ac_delim
GSM_INCLUDE!$GSM_INCLUDE$ac_delim
PBX_GSM!$PBX_GSM$ac_delim
+IKSEMEL_LIB!$IKSEMEL_LIB$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
-IKSEMEL_LIB!$IKSEMEL_LIB$ac_delim
IKSEMEL_INCLUDE!$IKSEMEL_INCLUDE$ac_delim
PBX_IKSEMEL!$PBX_IKSEMEL$ac_delim
IMAP_TK_LIB!$IMAP_TK_LIB$ac_delim
IMAP_TK_INCLUDE!$IMAP_TK_INCLUDE$ac_delim
PBX_IMAP_TK!$PBX_IMAP_TK$ac_delim
+ISDNNET_LIB!$ISDNNET_LIB$ac_delim
+ISDNNET_INCLUDE!$ISDNNET_INCLUDE$ac_delim
+PBX_ISDNNET!$PBX_ISDNNET$ac_delim
KDE_LIB!$KDE_LIB$ac_delim
KDE_INCLUDE!$KDE_INCLUDE$ac_delim
PBX_KDE!$PBX_KDE$ac_delim
+MISDN_LIB!$MISDN_LIB$ac_delim
+MISDN_INCLUDE!$MISDN_INCLUDE$ac_delim
+PBX_MISDN!$PBX_MISDN$ac_delim
NBS_LIB!$NBS_LIB$ac_delim
NBS_INCLUDE!$NBS_INCLUDE$ac_delim
PBX_NBS!$PBX_NBS$ac_delim
SQLITE_LIB!$SQLITE_LIB$ac_delim
SQLITE_INCLUDE!$SQLITE_INCLUDE$ac_delim
PBX_SQLITE!$PBX_SQLITE$ac_delim
+SUPPSERV_LIB!$SUPPSERV_LIB$ac_delim
+SUPPSERV_INCLUDE!$SUPPSERV_INCLUDE$ac_delim
+PBX_SUPPSERV!$PBX_SUPPSERV$ac_delim
OPENSSL_LIB!$OPENSSL_LIB$ac_delim
OPENSSL_INCLUDE!$OPENSSL_INCLUDE$ac_delim
PBX_OPENSSL!$PBX_OPENSSL$ac_delim
EGREP!$EGREP$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
POW_LIB!$POW_LIB$ac_delim
-KDEINIT!$KDEINIT$ac_delim
-KDEDIR!$KDEDIR$ac_delim
-NETSNMP_CONFIG!$NETSNMP_CONFIG$ac_delim
-PG_CONFIG!$PG_CONFIG$ac_delim
-QTMOC!$QTMOC$ac_delim
-EDITLINE_LIB!$EDITLINE_LIB$ac_delim
-PBX_H323!$PBX_H323$ac_delim
-PBX_IXJUSER!$PBX_IXJUSER$ac_delim
-GTKCONFIG!$GTKCONFIG$ac_delim
+GSM_INTERNAL!$GSM_INTERNAL$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
+KDEINIT!$KDEINIT$ac_delim
+KDEDIR!$KDEDIR$ac_delim
+NETSNMP_CONFIG!$NETSNMP_CONFIG$ac_delim
+PG_CONFIG!$PG_CONFIG$ac_delim
+QTMOC!$QTMOC$ac_delim
+EDITLINE_LIB!$EDITLINE_LIB$ac_delim
+PBX_H323!$PBX_H323$ac_delim
+PBX_IXJUSER!$PBX_IXJUSER$ac_delim
+GTKCONFIG!$GTKCONFIG$ac_delim
PBX_GTK!$PBX_GTK$ac_delim
GTK_INCLUDE!$GTK_INCLUDE$ac_delim
GTK_LIB!$GTK_LIB$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 7; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 16; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
{ echo "$as_me:$LINENO: Package configured for: " >&5
echo "$as_me: Package configured for: " >&6;}
-{ echo "$as_me:$LINENO: OS type : $PBX_OSTYPE" >&5
-echo "$as_me: OS type : $PBX_OSTYPE" >&6;}
+{ echo "$as_me:$LINENO: OS type : $host_os" >&5
+echo "$as_me: OS type : $host_os" >&6;}
{ echo "$as_me:$LINENO: Host CPU : $host_cpu" >&5
echo "$as_me: Host CPU : $host_cpu" >&6;}
-if test "x${crossCompile}" = xYes; then
- { echo "$as_me:$LINENO: " >&5
-echo "$as_me: " >&6;}
+if test "${cross_compiling}" = "yes"; then
{ echo "$as_me:$LINENO: Cross Compilation = YES" >&5
echo "$as_me: Cross Compilation = YES" >&6;}
- { echo "$as_me:$LINENO: Target = ${host}" >&5
-echo "$as_me: Target = ${host}" >&6;}
fi
if test ${GNU_MAKE_VERSION_MAJOR} -lt 3 || test ${GNU_MAKE_VERSION_MINOR} -lt 81 ; then
# cross-compile macros
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
-AC_CANONICAL_TARGET
# check existence of the package
-AC_CONFIG_SRCDIR([asterisk.c])
+AC_CONFIG_SRCDIR([main/asterisk.c])
# specify output header file
AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
AC_COPYRIGHT("Asterisk")
AC_REVISION($Revision$)
-case "${host}" in
- *freebsd*)
+case "${host_os}" in
+ freebsd)
ac_default_prefix=/usr/local
;;
*)
localstatedir=/var
fi
-### ** Platform.
-AC_DEFINE_UNQUOTED(PBX_PLATFORM, "${host}",
-[Define this to be the canonical name (cpu-vendor-os) of your system.])
-AC_DEFINE_UNQUOTED(PBX_CPU, "${host_cpu}",
-[Define this to be the name of the CPU of your system.])
-AC_DEFINE_UNQUOTED(PBX_VENDOR, "${host_vendor}",
-[Define this to be the name of the vendor of your system.])
-AC_DEFINE_UNQUOTED(PBX_OS, "${host_os}",
-[Define this to be the name of the OS of your system.])
-
-# export some useful defines
-PBX_PLATFORM=${host}
-PBX_CPU=${host_cpu}
-PBX_VENDOR=${host_vendor}
-PBX_OS=${host_os}
-AC_SUBST(PBX_PLATFORM)
-AC_SUBST(PBX_CPU)
-AC_SUBST(PBX_VENDOR)
-AC_SUBST(PBX_OS)
+BUILD_PLATFORM=${build}
+BUILD_CPU=${build_cpu}
+BUILD_VENDOR=${build_vendor}
+BUILD_OS=${build_os}
+
+AC_SUBST(BUILD_PLATFORM)
+AC_SUBST(BUILD_CPU)
+AC_SUBST(BUILD_VENDOR)
+AC_SUBST(BUILD_OS)
+
+HOST_PLATFORM=${host}
+HOST_CPU=${host_cpu}
+HOST_VENDOR=${host_vendor}
+HOST_OS=${host_os}
+
+AC_SUBST(HOST_PLATFORM)
+AC_SUBST(HOST_CPU)
+AC_SUBST(HOST_VENDOR)
+AC_SUBST(HOST_OS)
# check for uname
AC_PATH_TOOL([UNAME], [uname], No)
fi
AC_SUBST(PBX_OSREV)
-# guest OS type
-case "${host}" in
- cygwin*|mingw*|windows*|winnt)
- AC_DEFINE(Win32, 1,
- [Define according to your operating system type.])
- PBX_OSTYPE="CYGWIN"
-# this is ugly - KPF
- OSISWIN32=1
- AC_SUBST(OSISWIN32)
- ;;
- *linux*)
- AC_DEFINE(Linux, 1,
- [Define according to your operating system type.])
- PBX_OSTYPE="Linux"
- ;;
- *netbsd*)
- AC_DEFINE(NetBSD, 1,
- [Define according to your operating system type.])
- PBX_OSTYPE="NetBSD"
- ;;
- *freebsd*)
- AC_DEFINE(FreeBSD, 1,
- [Define according to your operating system type.])
- PBX_OSTYPE="FreeBSD"
- # XXX temporary hack to let FreeBSD use the default paths
- # for local stuff. We need a better solution.
- if test x"${CPPFLAGS}" = x; then
- CPPFLAGS="-I/usr/local/include"
- fi
- if test x"${LDFLAGS}" = x; then
- LDFLAGS="-L/usr/local/lib"
- fi
- ;;
- *openbsd*)
- AC_DEFINE(OpenBSD, 1,
- [Define according to your operating system type.])
- PBX_OSTYPE="OpenBSD"
- ;;
- *sun*)
- AC_DEFINE(SunOS, 1,
- [Define according to your operating system type.])
- PBX_OSTYPE="SunOS"
- ;;
- *darwin*)
- AC_DEFINE(Darwin, 1,
- [Define according to your operating system type.])
- PBX_OSTYPE="Darwin"
- ;;
- *)
- AC_DEFINE(Unix, 1,
- [Define according to your operating system type.])
- PBX_OSTYPE="Unix"
- ;;
-esac
-AC_SUBST(PBX_OSTYPE)
-
# This needs to be before any macros that use the C compiler
AC_GNU_SOURCE
)
# cross-compile checks
-if test x"${build}" != x"${host}";
+if test "${cross_compiling}" = "yes";
then
AC_CHECK_TOOL(CC, gcc, :)
AC_CHECK_TOOL(CXX, g++, :)
+ AC_CHECK_TOOL(LD, ld, :)
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(AR, ar, :)
-
- if test x"${PBX_OSTYPE}" = xWin32;
- then
- AC_CHECK_TOOL(NM, nm, :)
- AC_CHECK_TOOL(WINDRES, windres, :)
- AC_CHECK_TOOL(DLLWRAP, dllwrap, :)
- fi
- crossCompile="Yes"
fi
# Checks for programs.
AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
+AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
+AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
+AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
+AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
AC_FUNC_FORK
AC_FUNC_FSEEKO
AC_PROG_GCC_TRADITIONAL
-AC_FUNC_MALLOC
+# XXX: these are commented out until we determine whether it matters if our malloc()
+# acts exactly like glibc's or not
+# AC_FUNC_MALLOC
+# AC_FUNC_REALLOC
AC_FUNC_MEMCMP
AC_FUNC_MKTIME
AC_FUNC_MMAP
-AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_SETVBUF_REVERSED
AC_TYPE_SIGNAL
AC_MSG_RESULT(no)
)
+AC_MSG_CHECKING(checking for res_ninit)
+AC_LINK_IFELSE(
+ AC_LANG_PROGRAM([#include <resolv.h>],
+ [int foo = res_ninit(NULL);]),
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
+ AC_MSG_RESULT(no)
+)
+
+AST_GCC_ATTRIBUTE(pure)
+AST_GCC_ATTRIBUTE(malloc)
+AST_GCC_ATTRIBUTE(const)
+AST_GCC_ATTRIBUTE(unused)
+AST_GCC_ATTRIBUTE(always_inline)
+
AC_CHECK_HEADER([libkern/OSAtomic.h],
[AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
GSM_INTERNAL="yes"
+AC_SUBST(GSM_INTERNAL)
GSM_SYSTEM="yes"
if test "${USE_GSM}" != "no"; then
if test "${GSM_DIR}" = "internal"; then
fi
fi
if test "${GSM_INTERNAL}" = "yes"; then
- GSM_LIB="internal"
PBX_GSM=1
fi
fi
AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
+if test "${PBX_IKSEMEL}" = 1; then
+ AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye])
+ if test "${PBX_GNUTLS}" = 1; then
+ IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -ltasn1 -lz -lgcrypt -lnsl -lgpg-error"
+ fi
+fi
+
if test "${USE_IMAP_TK}" != "no"; then
if test "${IMAP_TK_DIR}" = ""; then
IMAP_TK_DIR=`pwd`"/../imap-2004g"
AC_LANG_POP
+AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
+
+if test "${PBX_MISDN}" = 1; then
+ AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
+ AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
+fi
+
AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
-AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h])
+AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
[Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
- PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
+ PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz -lcrypt"
PGSQL_INCLUDE="-I${PGSQL_includedir}"
PBX_PGSQL=1
elif test ! -z "${PGSQL_MANDATORY}";
AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
-if test "${PBX_OSTYPE}" != "Linux" ; then
+if test "${host_os}" != "linux-gnu" ; then
tonezone_extra="-lm"
fi
AC_PATH_TOOL([CURL], [curl-config], No)
if test ! x"${CURL}" = xNo; then
# check for version
- if test $PBX_OSTYPE = "SunOS"; then
+ if test "${host_os}" = "SunOS"; then
if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
CURLLIB=$(${CURL} --libs)
PBX_CURL=1
fi
AC_MSG_NOTICE(Package configured for: )
-AC_MSG_NOTICE( OS type : $PBX_OSTYPE)
+AC_MSG_NOTICE( OS type : $host_os)
AC_MSG_NOTICE( Host CPU : $host_cpu)
-if test "x${crossCompile}" = xYes; then
- AC_MSG_NOTICE()
+if test "${cross_compiling}" = "yes"; then
AC_MSG_NOTICE( Cross Compilation = YES)
- AC_MSG_NOTICE( Target = ${host})
fi
if test ${GNU_MAKE_VERSION_MAJOR} -lt 3 || test ${GNU_MAKE_VERSION_MINOR} -lt 81 ; then
+++ /dev/null
-OBJS=cygloader.o
-all: $(OBJS)
-$(OBJS) : %.o: %.c
- $(CC) $< -o asterisk.exe
-
-clean-depend:
-
-clean:
- rm -f asterisk.exe
+++ /dev/null
-#include <unistd.h>
-#include <dlfcn.h>
-#include <stdio.h>
-
-#define OK 0
-#define MODULE_NOT_FOUND 1
-#define INVALID_NUMBER_ARGUMENTS 2
-
-int main(int argc, char **argv) {
- /* Asterisk entry point */
- char* error = NULL;
- int (*ast_main)(int argc, char **argv);
-
- void *handle = dlopen ("asterisk.dll", RTLD_GLOBAL);
- if (handle == NULL) {
- fputs (dlerror(), stderr);
- fputs ("\r\n", stderr);
- return MODULE_NOT_FOUND;
- }
- printf("\r\nAsterisk module loaded successfully");
- ast_main = dlsym(handle, "main");
- if ((error = dlerror()) != NULL) {
- fputs("Asterisk main not found", stderr);
- fputs(error, stderr);
- exit(1);
- }
- printf("\r\nAsterisk entry point found");
- /* run asterisk main */
- (*ast_main)(argc, argv);
- dlclose(handle);
- printf("\r\nAsterisk stopped");
- return OK;
-}
# the GNU General Public License
#
-ifneq ($(wildcard ../menuselect.makeopts),)
+ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),)
include ../menuselect.makeopts
include ../menuselect.makedeps
endif
C_MODS:=$(filter-out $(MENUSELECT_FORMATS),$(patsubst %.c,%,$(wildcard format_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_FORMATS),$(patsubst %.cc,%,$(wildcard format_*.cc)))
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring formats,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
all: _all
.tell = g723_tell,
.read = g723_read,
.buf_size = G723_MAX_SIZE + AST_FRIENDLY_OFFSET,
- .module = &mod_data, /* XXX */
};
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_format_register(&g723_1_f);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_format_unregister(g723_1_f.name);
}
-static const char *description(void)
-{
- return "G.723.1 Simple Timestamp File Format";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD("G.723.1 Simple Timestamp File Format", ASTERISK_GPL_KEY);
.read = g726_read,
.buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET,
.desc_size = sizeof(struct g726_desc),
- .module = &mod_data, /* XXX */
},
{
.name = "g726-32",
.read = g726_read,
.buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET,
.desc_size = sizeof(struct g726_desc),
- .module = &mod_data, /* XXX */
},
{
.name = "g726-24",
.read = g726_read,
.buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET,
.desc_size = sizeof(struct g726_desc),
- .module = &mod_data, /* XXX */
},
{
.name = "g726-16",
.read = g726_read,
.buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET,
.desc_size = sizeof(struct g726_desc),
- .module = &mod_data, /* XXX */
},
{ .format = 0 } /* terminator */
};
-/*
- * Module interface (load_module, unload_module, usecount, description, key)
- */
-static int load_module(void *mod)
+static int load_module(void)
{
int i;
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int i;
return(0);
}
-static const char *description(void)
-{
- return "Raw G.726 (16/24/32/40kbps) data";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw G.726 (16/24/32/40kbps) data");
.tell = g729_tell,
.read = g729_read,
.buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET,
- .module = &mod_data, /* XXX */
};
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_format_register(&g729_f);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_format_unregister(g729_f.name);
}
-static const char *description(void)
-{
- return "Raw G729 data";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw G729 data");
.tell = gsm_tell,
.read = gsm_read,
.buf_size = 2*GSM_FRAME_SIZE + AST_FRIENDLY_OFFSET, /* 2 gsm frames */
- .module = &mod_data, /* XXX */
};
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_format_register(&gsm_f);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_format_unregister(gsm_f.name);
}
-static const char *description(void)
-{
- return "Raw GSM data";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw GSM data");
.read = h263_read,
.buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET,
.desc_size = sizeof(struct h263_desc),
- .module = &mod_data, /* XXX */
};
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_format_register(&h263_f);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_format_unregister(h263_f.name);
}
-static const char *description(void)
-{
- return "Raw h263 data";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw H.263 data");
.read = h264_read,
.buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET,
.desc_size = sizeof(struct h264_desc),
- .module = &mod_data, /* XXX */
};
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_format_register(&h264_f);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_format_unregister(h264_f.name);
}
-static const char *description(void)
-{
- return "Raw h264 data";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw H.264 data");
.tell = ilbc_tell,
.read = ilbc_read,
.buf_size = ILBC_BUF_SIZE + AST_FRIENDLY_OFFSET,
- .module = &mod_data, /* XXX */
};
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_format_register(&ilbc_f);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_format_unregister(ilbc_f.name);
}
-static const char *description(void)
-{
- return "Raw iLBC data";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw iLBC data");
#include "asterisk/lock.h"
#include "asterisk/endian.h"
-static char *desc = "JPEG (Joint Picture Experts Group) Image Format";
-
-
static struct ast_frame *jpeg_read_image(int fd, int len)
{
struct ast_frame fr;
jpeg_write_image,
};
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_image_register(&jpeg_format);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
ast_image_unregister(&jpeg_format);
+
return 0;
}
-static const char *description(void)
-{
- return desc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "JPEG (Joint Picture Experts Group) Image Format");
* \ingroup formats
*/
+/* the order of these dependencies is important... it also specifies
+ the link order of the libraries during linking
+*/
+
/*** MODULEINFO
<depend>vorbis</depend>
<depend>ogg</depend>
.close = ogg_vorbis_close,
.buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET,
.desc_size = sizeof(struct vorbis_desc),
- .module = &mod_data, /* XXX */
};
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_format_register(&vorbis_f);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_format_unregister(vorbis_f.name);
}
-static const char *description(void)
-{
- return "OGG/Vorbis audio";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "OGG/Vorbis audio");
.tell = pcm_tell,
.read = pcm_read,
.buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET,
- .module = &mod_data, /* XXX */
#ifdef REALTIME_WRITE
.open = pcma_open,
.rewrite = pcma_rewrite,
.tell = pcm_tell,
.read = pcm_read,
.buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET,
- .module = &mod_data, /* XXX */
};
static const struct ast_format au_f = {
.tell = au_tell,
.read = pcm_read,
.buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET, /* this many shorts */
- .module = &mod_data, /* XXX */
};
-static int load_module(void *mod)
+static int load_module(void)
{
int index;
|| ast_format_register(&au_f);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_format_unregister(pcm_f.name) || ast_format_unregister(alaw_f.name)
|| ast_format_unregister(au_f.name);
}
-static const char *description(void)
-{
- return "Raw/Sun uLaw/ALaw 8khz Audio support (PCM,PCMA,AU)";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw/Sun uLaw/ALaw 8khz Audio support (PCM,PCMA,AU)");
.tell = slinear_tell,
.read = slinear_read,
.buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET,
- .module = &mod_data, /* XXX */
};
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_format_register(&slin_f);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_format_unregister(slin_f.name);
}
-static const char *description(void)
-{
- return "Raw Signed Linear Audio support (SLN)";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw Signed Linear Audio support (SLN)");
.tell = vox_tell,
.read = vox_read,
.buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET,
- .module = &mod_data, /* XXX */
};
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_format_register(&vox_f);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_format_unregister(vox_f.name);
}
-static const char *description(void)
-{
- return "Dialogic VOX (ADPCM) File Format";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dialogic VOX (ADPCM) File Format");
.close = wav_close,
.buf_size = WAV_BUF_SIZE + AST_FRIENDLY_OFFSET,
.desc_size = sizeof(struct wav_desc),
- .module = &mod_data, /* XXX */
};
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_format_register(&wav_f);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_format_unregister(wav_f.name);
}
-static const char *description(void)
-{
- return "Microsoft WAV format (8000hz Signed Linear)";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Microsoft WAV format (8000Hz Signed Linear)");
.close = wav_close,
.buf_size = 2*GSM_FRAME_SIZE + AST_FRIENDLY_OFFSET,
.desc_size = sizeof(struct wavg_desc),
- .module = &mod_data, /* XXX */
};
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_format_register(&wav49_f);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_format_unregister(wav49_f.name);
}
-static const char *description(void)
-{
- return "Microsoft WAV format (Proprietary GSM)";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Microsoft WAV format (Proprietary GSM)");
# the GNU General Public License
#
-ifneq ($(wildcard ../menuselect.makeopts),)
+ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),)
include ../menuselect.makeopts
include ../menuselect.makedeps
endif
C_MODS:=$(filter-out $(MENUSELECT_FUNCS),$(patsubst %.c,%,$(wildcard func_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_FUNCS),$(patsubst %.cc,%,$(wildcard func_*.cc)))
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring funcs,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
all: _all
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
.read = base64_decode,
};
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_custom_function_unregister(&base64_encode_function) |
ast_custom_function_unregister(&base64_decode_function);
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_custom_function_register(&base64_encode_function) |
ast_custom_function_register(&base64_decode_function);
}
-static const char *description(void)
-{
- return "base64 encode/decode dialplan functions";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "base64 encode/decode dialplan functions");
.write = callerid_write,
};
-static char *tdesc = "Caller ID related dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_custom_function_unregister(&callerid_function);
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_custom_function_register(&callerid_function);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Caller ID related dialplan function");
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
" integral values.\n",
};
-static char *tdesc = "CDR dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_custom_function_unregister(&cdr_function);
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_custom_function_register(&cdr_function);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "CDR dialplan function");
.write = func_channel_write,
};
-static char *tdesc = "Channel information dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_custom_function_unregister(&channel_function);
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_custom_function_register(&channel_function);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Channel information dialplan function");
#include "asterisk/app.h"
#include "asterisk/utils.h"
-static char *tdesc = "Load external URL";
-
-LOCAL_USER_DECL;
-
struct MemoryStruct {
char *memory;
size_t size;
static int acf_curl_exec(struct ast_channel *chan, char *cmd, char *info, char *buf, size_t len)
{
- struct localuser *u;
+ struct ast_module_user *u;
struct MemoryStruct chunk = { NULL, 0 };
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(url);
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
AST_STANDARD_APP_ARGS(args, info);
ast_log(LOG_ERROR, "Cannot allocate curl structure\n");
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
.read = acf_curl_exec,
};
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
res = ast_custom_function_unregister(&acf_curl);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Load external URL");
/* Maximum length of any variable */
#define MAXRESULT 1024
-
-LOCAL_USER_DECL;
-
struct sortable_keys {
char *key;
float value;
static int acf_sort_exec(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
{
- struct localuser *u;
+ struct ast_module_user *u;
int ret = -1;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
switch (sort_internal(chan, data, buf, len)) {
case ERROR_NOARG:
default:
ast_log(LOG_ERROR, "Unknown internal error\n");
}
- LOCAL_USER_REMOVE(u);
+
+ ast_module_user_remove(u);
return ret;
}
static int acf_cut_exec(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
{
int ret = -1;
- struct localuser *u;
+ struct ast_module_user *u;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
switch (cut_internal(chan, data, buf, len)) {
case ERROR_NOARG:
default:
ast_log(LOG_ERROR, "Unknown internal error\n");
}
- LOCAL_USER_REMOVE(u);
+
+ ast_module_user_remove(u);
return ret;
}
.read = acf_cut_exec,
};
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res = 0;
res |= ast_custom_function_unregister(&acf_cut);
res |= ast_custom_function_unregister(&acf_sort);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
return res;
}
-static const char *description(void)
-{
- return "Cut out information from a string";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Cut out information from a string");
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
.read = function_db_delete,
};
-static char *tdesc = "Database (astdb) related dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res = 0;
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Database (astdb) related dialplan functions");
static char *synopsis = "Syntax: ENUMLOOKUP(number[|Method-type[|options[|record#[|zone-suffix]]]])\n";
-LOCAL_USER_DECL;
-
static int function_enum(struct ast_channel *chan, char *cmd, char *data,
char *buf, size_t len)
{
int res = 0;
char tech[80];
char dest[256] = "", tmp[2] = "", num[AST_MAX_EXTENSION] = "";
- struct localuser *u;
+ struct ast_module_user *u;
char *s, *p;
buf[0] = '\0';
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
ast_copy_string(tech, args.tech ? args.tech : "sip", sizeof(tech));
else
ast_copy_string(buf, dest, len);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
char tech[80];
char txt[256] = "";
char dest[80];
- struct localuser *u;
+ struct ast_module_user *u;
buf[0] = '\0';
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
res = ast_get_txt(chan, data, dest, sizeof(dest), tech, sizeof(tech), txt,
sizeof(txt));
if (!ast_strlen_zero(txt))
ast_copy_string(buf, txt, len);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
.read = function_txtcidname,
};
-static char *tdesc = "ENUM related dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res = 0;
res |= ast_custom_function_unregister(&enum_function);
res |= ast_custom_function_unregister(&txtcidname_function);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "ENUM related dialplan functions");
" M - Returns the epoch at which the file was last modified\n",
};
-
-static char *tdesc = "Environment/filesystem dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res = 0;
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Environment/filesystem dialplan functions");
.write = global_write,
};
-static char *tdesc = "Global variable dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res = 0;
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Global variable dialplan functions");
.write = NULL,
};
-static char *tdesc = "Channel group dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res = 0;
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Channel group dialplan functions");
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
.write = language_write,
};
-static char *tdesc = "Channel language dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_custom_function_unregister(&language_function);
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_custom_function_register(&language_function);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Channel language dialplan function");
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
.read = iftime,
};
-static char *tdesc = "Logical dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res = 0;
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Logical dialplan functions");
.read = math
};
-static char *tdesc = "Mathematical dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_custom_function_unregister(&math_function);
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_custom_function_register(&math_function);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
-
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Mathematical dialplan function");
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
.read = checkmd5,
};
-static char *tdesc = "MD5 digest dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_custom_function_unregister(&md5_function) |
ast_custom_function_unregister(&checkmd5_function);
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_custom_function_register(&md5_function) |
ast_custom_function_register(&checkmd5_function);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "MD5 digest dialplan functions");
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include <stdio.h>
#include <stdlib.h>
#include "asterisk/module.h"
.write = moh_write,
};
-static char *tdesc = "Music-on-hold dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_custom_function_unregister(&moh_function);
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_custom_function_register(&moh_function);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Music-on-hold dialplan function");
#include "asterisk/res_odbc.h"
#include "asterisk/app.h"
-static char *tdesc = "ODBC lookups";
-
static char *config = "func_odbc.conf";
enum {
return 0;
}
-static int reload(void *mod)
+static int reload(void)
{
int res = 0;
struct ast_config *cfg;
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return odbc_unload_module();
}
-static int load_module(void *mod)
+static int load_module(void)
{
return odbc_load_module();
}
-static const char *description(void)
-{
- return tdesc;
-}
-
/* XXX need to revise usecount - set if query_lock is set */
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "ODBC lookups",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
#include "asterisk/utils.h"
#include "asterisk/app.h"
-LOCAL_USER_DECL;
-
static int acf_rand_exec(struct ast_channel *chan, char *cmd,
char *parse, char *buffer, size_t buflen)
{
- struct localuser *u;
+ struct ast_module_user *u;
int min_int, response_int, max_int;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(min);
AST_APP_ARG(max);
);
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
AST_STANDARD_APP_ARGS(args, parse);
response_int, min_int, max_int);
snprintf(buffer, buflen, "%d", response_int);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
.read = acf_rand_exec,
};
-
-static char *tdesc = "Random number dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
ast_custom_function_unregister(&acf_rand);
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_custom_function_register(&acf_rand);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Random number dialplan function");
#include "asterisk/lock.h"
#include "asterisk/logger.h"
#include "asterisk/utils.h"
-#include "asterisk/module.h"
#include "asterisk/app.h"
-LOCAL_USER_DECL;
-
-static char *tdesc = "Read/Write values from a RealTime repository";
-
static int function_realtime_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
{
struct ast_variable *var, *head;
- struct localuser *u;
+ struct ast_module_user *u;
char *results;
size_t resultslen = 0;
-
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(family);
AST_APP_ARG(fieldmatch);
ast_log(LOG_WARNING, "Syntax: REALTIME(family|fieldmatch[|value[|delim1[|delim2]]]) - missing argument!\n");
return -1;
}
- LOCAL_USER_ADD(u);
+
+ u = ast_module_user_add(chan);
+
AST_STANDARD_APP_ARGS(args, data);
if (!args.delim1)
head = ast_load_realtime(args.family, args.fieldmatch, args.value, NULL);
if (!head) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
}
for (var = head; var; var = var->next)
ast_build_string(&results, &resultslen, "%s%s%s%s", var->name, args.delim2, var->value, args.delim1);
ast_copy_string(buf, results, len);
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
+
return 0;
}
static int function_realtime_write(struct ast_channel *chan, char *cmd, char *data, const char *value)
{
- struct localuser *u;
+ struct ast_module_user *u;
int res = 0;
-
-
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(family);
AST_APP_ARG(fieldmatch);
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
+
AST_STANDARD_APP_ARGS(args, data);
res = ast_update_realtime(args.family, args.fieldmatch, args.value, args.field, (char *)value, NULL);
ast_log(LOG_WARNING, "Failed to update. Check the debug log for possible data repository related entries.\n");
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
+
return 0;
}
.write = function_realtime_write,
};
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res = ast_custom_function_unregister(&realtime_function);
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = ast_custom_function_register(&realtime_function);
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Read/Write values from a RealTime repository");
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
" which is known as his hash\n",
};
-static char *tdesc = "SHA-1 computation dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_custom_function_unregister(&sha1_function);
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_custom_function_register(&sha1_function);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "SHA-1 computation dialplan function");
.desc = "Example: ${KEYPADHASH(Les)} returns \"537\"\n",
};
-static char *tdesc = "String handling dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res = 0;
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "String handling dialplan functions");
.write = timeout_write,
};
-static char *tdesc = "Channel timeout dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_custom_function_unregister(&timeout_function);
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_custom_function_register(&timeout_function);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Channel timeout dialplan functions");
.read = uriencode,
};
-static char *tdesc = "URI encode/decode dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_custom_function_unregister(&urldecode_function)
|| ast_custom_function_unregister(&urlencode_function);
}
-static int load_module(void *mod)
+static int load_module(void)
{
return ast_custom_function_register(&urldecode_function)
|| ast_custom_function_register(&urlencode_function);
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "URI encode/decode dialplan functions");
extern char ast_config_AST_SYSTEM_NAME[20];
int ast_set_priority(int); /*!< Provided by asterisk.c */
-int load_modules(const int preload_only); /*!< Provided by module.c */
+int load_modules(void); /*!< Provided by loader.c */
int load_pbx(void); /*!< Provided by pbx.c */
int init_logger(void); /*!< Provided by logger.c */
void close_logger(void); /*!< Provided by logger.c */
void dnsmgr_start_refresh(void); /*!< Provided by dnsmgr.c */
int dnsmgr_reload(void); /*!< Provided by dnsmgr.c */
+/* Many headers need 'ast_channel' to be defined */
+struct ast_channel;
+
+/* Many headers need 'ast_module' to be defined */
+struct ast_module;
+
/*!
* \brief Reload asterisk modules.
* \param name the name of the module to reload
struct ast_channel;
struct ast_frame;
-
/* Configuration flags */
enum {
AST_JB_ENABLED = (1 << 0),
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
-/* Define according to your operating system type. */
-#undef Darwin
-
-/* Define according to your operating system type. */
-#undef FreeBSD
-
/* Define to 1 if you have the `alarm' function. */
#undef HAVE_ALARM
/* Define to 1 if you have the `atexit' function. */
#undef HAVE_ATEXIT
+/* Define to 1 if your GCC C compiler supports the 'always_inline' attribute.
+ */
+#undef HAVE_ATTRIBUTE_always_inline
+
+/* Define to 1 if your GCC C compiler supports the 'const' attribute. */
+#undef HAVE_ATTRIBUTE_const
+
+/* Define to 1 if your GCC C compiler supports the 'malloc' attribute. */
+#undef HAVE_ATTRIBUTE_malloc
+
+/* Define to 1 if your GCC C compiler supports the 'pure' attribute. */
+#undef HAVE_ATTRIBUTE_pure
+
+/* Define to 1 if your GCC C compiler supports the 'unused' attribute. */
+#undef HAVE_ATTRIBUTE_unused
+
/* Define to 1 if you have the `bzero' function. */
#undef HAVE_BZERO
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
+/* Define to indicate the ${GNUTLS_DESCRIP} library */
+#undef HAVE_GNUTLS
+
/* Define to indicate the GSM library */
#undef HAVE_GSM
/* Define to 1 if you have the `isascii' function. */
#undef HAVE_ISASCII
+/* Define to indicate the ${ISDNNET_DESCRIP} library */
+#undef HAVE_ISDNNET
+
/* Define to 1 if you have the <libintl.h> header file. */
#undef HAVE_LIBINTL_H
/* Define to 1 if you have the `localtime_r' function. */
#undef HAVE_LOCALTIME_R
-/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
- to 0 otherwise. */
-#undef HAVE_MALLOC
-
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
+/* Define to indicate the ${MISDN_DESCRIP} library */
+#undef HAVE_MISDN
+
/* Define to 1 if you have the `mkdir' function. */
#undef HAVE_MKDIR
/* Define to indicate the ${RADIUS_DESCRIP} library */
#undef HAVE_RADIUS
-/* Define to 1 if your system has a GNU libc compatible `realloc' function,
- and to 0 otherwise. */
-#undef HAVE_REALLOC
-
/* Define to 1 if you have the `regcomp' function. */
#undef HAVE_REGCOMP
+/* Define to 1 if your system has the re-entrant resolver functions. */
+#undef HAVE_RES_NINIT
+
/* Define to 1 if you have the `re_comp' function. */
#undef HAVE_RE_COMP
/* Define to 1 if `st_blksize' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+/* Define to indicate the ${SUPPSERV_DESCRIP} library */
+#undef HAVE_SUPPSERV
+
/* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
-/* Define according to your operating system type. */
-#undef Linux
-
-/* Define according to your operating system type. */
-#undef NetBSD
-
-/* Define according to your operating system type. */
-#undef OpenBSD
-
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the version of this package. */
#undef PACKAGE_VERSION
-/* Define this to be the name of the CPU of your system. */
-#undef PBX_CPU
-
-/* Define this to be the name of the OS of your system. */
-#undef PBX_OS
-
-/* Define this to be the canonical name (cpu-vendor-os) of your system. */
-#undef PBX_PLATFORM
-
-/* Define this to be the name of the vendor of your system. */
-#undef PBX_VENDOR
-
/* Define to 1 if the C compiler supports function prototypes. */
#undef PROTOTYPES
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* Define according to your operating system type. */
-#undef SunOS
-
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
-/* Define according to your operating system type. */
-#undef Unix
-
-/* Define according to your operating system type. */
-#undef Win32
-
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
#undef inline
#endif
-/* Define to rpl_malloc if the replacement function should be used. */
-#undef malloc
-
/* Define to `int' if <sys/types.h> does not define. */
#undef mode_t
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
-/* Define to rpl_realloc if the replacement function should be used. */
-#undef realloc
-
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
#include "asterisk/channel.h"
#include "asterisk/utils.h"
-struct ast_channel;
-
/*! Responsible for call detail data */
struct ast_cdr {
/*! Caller*ID with text */
* Used to register a Call Detail Record handler.
* Returns -1 on error, 0 on success.
*/
-int ast_cdr_register(char *name, char *desc, ast_cdrbe be);
+int ast_cdr_register(const char *name, const char *desc, ast_cdrbe be);
/*! Unregister a CDR handling engine */
/*!
* \param name name of CDR handler to unregister
* Unregisters a CDR by it's name
*/
-void ast_cdr_unregister(char *name);
+void ast_cdr_unregister(const char *name);
/*! Start a call */
/*!
#ifndef _ASTERISK_COMPILER_H
#define _ASTERISK_COMPILER_H
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
-#define __builtin_expect(exp, c) (exp)
-#define force_inline inline
-#define attribute_pure
-#else
+#if HAVE_ATTRIBUTE_always_inline
#define force_inline inline __attribute__((always_inline))
+#else
+#define force_inline inline
+#endif
+
+#if HAVE_ATTRIBUTE_pure
#define attribute_pure __attribute__((pure))
+#else
+#define attribute_pure
#endif
+#if HAVE_ATTRIBUTE_const
#define attribute_const __attribute__((const))
+#else
+#define attribute_const
+#endif
+
+#if HAVE_ATTRIBUTE_unused
#define attribute_unused __attribute__((unused))
+#else
+#define attribute_unused
+#endif
+
+#if HAVE_ATTRIBUTE_malloc
+#define attribute_malloc __attribute__((malloc))
+#else
+#define attribute_malloc
+#endif
#endif /* _ASTERISK_COMPILER_H */
#ifndef _ASTERISK_DNS_H
#define _ASTERISK_DNS_H
-struct ast_channel;
-
/*! \brief Perform DNS lookup (used by DNS, enum and SRV lookups)
\param context
\param dname Domain name to lookup (host, SRV domain, TXT record name)
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
int buf_size; /*! size of frame buffer, if any, aligned to 8 bytes. */
int desc_size; /*! size of private descriptor, if any */
- struct module_symbols *module;
+ struct ast_module *module;
};
/*
#define SEEK_FORCECUR 10
/*! Register a new file format capability
- * Adds a format to asterisk's format abilities.
+ * Adds a format to Asterisk's format abilities.
* returns 0 on success, -1 on failure
*/
-int ast_format_register(const struct ast_format *f);
+int __ast_format_register(const struct ast_format *f, struct ast_module *mod);
+#define ast_format_register(f) __ast_format_register(f, ast_module_info->self)
/*! Unregisters a file format */
/*!
#include "asterisk/lock.h"
-/* forward reference */
-struct ast_channel;
-
struct tone_zone_sound {
struct tone_zone_sound *next; /* next element */
const char *name; /* Identifing name */
*/
/*!
- \brief Attempts to lock a list.
+ \brief Locks a list.
\param head This is a pointer to the list head structure
This macro attempts to place an exclusive lock in the
#define AST_LIST_LOCK(head) \
ast_mutex_lock(&(head)->lock)
+/*!
+ \brief Locks a list, without blocking if the list is locked.
+ \param head This is a pointer to the list head structure
+
+ This macro attempts to place an exclusive lock in the
+ list head structure pointed to by head.
+ Returns non-zero on success, 0 on failure
+*/
+#define AST_LIST_TRYLOCK(head) \
+ ast_mutex_trylock(&(head)->lock)
+
/*!
\brief Attempts to unlock a list.
\param head This is a pointer to the list head structure
/*!
\brief Returns the last entry contained in a list.
- \param head This is a pointer to the list tail structure
+ \param head This is a pointer to the list head structure
*/
#define AST_LIST_LAST(head) ((head)->last)
#define ast_channel_trylock(x) ast_mutex_trylock(&x->lock)
#else
-struct ast_channel;
-
/*! \brief Lock AST channel (and print debugging output)
\note You need to enable DEBUG_CHANNEL_LOCKS for this function */
int ast_channel_lock(struct ast_channel *chan);
* Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
+ * Kevin P. Fleming <kpfleming@digium.com>
+ * Luigi Rizzo <rizzo@icir.org>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
#ifndef _ASTERISK_MODULE_H
#define _ASTERISK_MODULE_H
-#ifdef STATIC_MODULE
-#error STATIC_MODULE should not be defined
-#endif
-#define STATIC_MODULE --- this is an error
-#define LOCAL_USER_DECL /* --- this is an error --- */
-
#include "asterisk/utils.h"
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
-
/*! \brief The text the key() function should return. */
#define ASTERISK_GPL_KEY \
"This paragraph is copyright (c) 2006 by Digium, Inc. \
#define AST_MODULE_CONFIG "modules.conf" /*!< \brief Module configuration file */
-enum unload_mode {
- AST_FORCE_SOFT = 0, /*! Softly unload a module, only if not in use */
- AST_FORCE_FIRM = 1, /*! Firmly unload a module, even if in use */
- AST_FORCE_HARD = 2, /*! as FIRM, plus dlclose() on the module. Not recommended
+enum ast_module_unload_mode {
+ AST_FORCE_SOFT = 0, /*!< Softly unload a module, only if not in use */
+ AST_FORCE_FIRM = 1, /*!< Firmly unload a module, even if in use */
+ AST_FORCE_HARD = 2, /*!< as FIRM, plus dlclose() on the module. Not recommended
as it may cause crashes */
};
+enum ast_module_load_result {
+ AST_MODULE_LOAD_SUCCESS = 0, /*!< Module loaded and configured */
+ AST_MODULE_LOAD_DECLINE = 1, /*!< Module is not configured */
+ AST_MODULE_LOAD_SKIP = 2, /*!< Module was skipped for some reason */
+ AST_MODULE_LOAD_FAILURE = -1, /*!< Module could not be loaded properly */
+};
+
/*!
* \brief Load a module.
- * \param resource_name The filename of the module to load.
+ * \param resource_name The name of the module to load.
*
* This function is run by the PBX to load the modules. It performs
* all loading and initilization tasks. Basically, to load a module, just
* give it the name of the module and it will do the rest.
*
- * \return Zero on success, -1 on error.
+ * \return See possible enum values for ast_module_load_result.
*/
-int ast_load_resource(const char *resource_name);
+enum ast_module_load_result ast_load_resource(const char *resource_name);
/*!
* \brief Unloads a module.
* This function unloads a module. It will only unload modules that are not in
* use (usecount not zero), unless #AST_FORCE_FIRM or #AST_FORCE_HARD is
* specified. Setting #AST_FORCE_FIRM or #AST_FORCE_HARD will unload the
- * module regardless of consequences (NOT_RECOMMENDED).
+ * module regardless of consequences (NOT RECOMMENDED).
*
* \return Zero on success, -1 on error.
*/
-int ast_unload_resource(const char *resource_name, enum unload_mode);
+int ast_unload_resource(const char *resource_name, enum ast_module_unload_mode);
/*!
* \brief Notify when usecount has been changed.
*/
char *ast_module_helper(const char *line, const char *word, int pos, int state, int rpos, int needsreload);
-/* Local user routines keep track of which channels are using a given module
- resource. They can help make removing modules safer, particularly if
- they're in use at the time they have been requested to be removed */
+/* Opaque type for module handles generated by the loader */
-struct localuser {
- struct localuser *next;
- struct ast_channel *chan;
-};
+struct ast_module;
-struct module_symbols; /* forward declaration */
-struct localuser *ast_localuser_add(struct module_symbols *, struct ast_channel *);
-void ast_localuser_remove(struct module_symbols *, struct localuser *);
-void ast_hangup_localusers(struct module_symbols *);
+/* User count routines keep track of which channels are using a given module
+ resource. They can help make removing modules safer, particularly if
+ they're in use at the time they have been requested to be removed */
-/* XXX deprecated macros, only for backward compatibility */
-#define LOCAL_USER_ADD(u) do { u = ast_localuser_add(__mod_desc, chan); } while (0)
-#define LOCAL_USER_REMOVE(u) ast_localuser_remove(__mod_desc, u)
-#define STANDARD_HANGUP_LOCALUSERS ast_hangup_localusers(__mod_desc)
+struct ast_module_user;
+struct ast_module_user_list;
/*! \page ModMngmnt The Asterisk Module management interface
- * \par The following is part of the new module management code.
*
* All modules must implement the module API (load, unload...)
* whose functions are exported through fields of a "struct module_symbol";
- *
- * Modules exporting extra symbols (data or functions), should list
- * them into an array of struct symbol_entry:
- * struct symbol_entry exported_symbols[]
- * of symbols, with a NULL name on the last entry
- *
- * Functions should be added with MOD_FUNC(name),
- * data structures with MOD_DATA(_name).
- * The array in turn is referenced by struct module_symbols.
- * (Typically, a module will export only a single symbol, which points
- * to a record containing all the methods. This is the API of the module,
- * and should be known to the module's clients as well.
- *
- * \par Connections to symbols in other modules
- * Modules that require symbols supplied by other modules should
- * provide an array
- * struct symbol_entry required_symbols[]
- * of symbols, with a NULL name on the last entry, containing the
- * name of the desired symbol.
- * For good measure, we also provide the size in both caller and calle
- * to figure out if there is a mismatch (not terribly useful because most
- * objects are a single word, but still... )
- * The symbol can be added to the array with MOD_WANT(symbol) macro.
- * required_symbols is also pointed by through struct module_symbols.
- *
- * Typically, the whole interface exported by a module should be
- * in a single structure named after the module, as follows.
- * Say the module high level name is 'foo', then we should have
- * - in include/asterisk/foo.h
- * struct foo_interface {
- * int (*f)(int, char *); -- first function exported
- * const char (*g)(int); -- second function exported
- * char *buf;
- * ... -- other fields
- * }
- * - in the module exporting the interface, e.g. res/res_foo.c
- * static int f(int, char *);
- * static const char *g(int);
- * const char buf[BUFSZ];
- * struct foo_interface foo = {
- * .f = f,
- * .g = g,
- * .buf = buf,
- * }
- *
- * \note NOTE: symbol names are 'global' in this module namespace, so it
- * will be wiser to name exported symbols with a prefix indicating the module
- * supplying it, e.g. foo_f, foo_g, foo_buf. Internally to the module,
- * symbols are still static so they can keep short and meaningful names.
- * The macros MOD_FIELD and METHOD_BASE() below help setting these entries.
- *
- * MOD_FIELD(f1), -- field and function name are the same
- * METHOD_BASE(foo_, f1), -- field and function name differ by a prefix
- * .f1 = function_name, -- generic case
- * }
- *
- * Note that the loader requires that no fields of exported_symbols
- * are NULL, because that is used as an indication of the end of the array.
- *
- * \par Module states
- * Modules can be in a number of different states, as below:
- * - \b MS_FAILED attempt to load failed. This is final.
- * - \b MS_NEW just added to the list, symbols unresolved.
- * - \b MS_RESOLVED all symbols resolved, but supplier modules not active yet.
- * - \b MS_CANLOAD all symbols resolved and suppliers are all active
- * (or we are in a cyclic dependency and we are breaking a loop)
- * - \b MS_ACTIVE load() returned successfully.
- *
- *
- * \par Module Types
- * For backward compatibility, we have 3 types of loadable modules:
- *
- * - \b MOD_0 these are the 'old style' modules, which export a number
- * of callbacks, and their full interface, as globally visible
- * symbols. The module needs to be loaded with RTLD_LAZY and
- * RTLD_GLOBAL to make symbols visible to other modules, and
- * to avoid load failures due to cross dependencies.
- *
- * - \b MOD_1 almost as above, but the generic callbacks are all into a
- * a structure, mod_data. Same load requirements as above.
- *
- * - \b MOD_2 this is the 'new style' format for modules. The module must
- * explictly declare which simbols are exported and which
- * symbols from other modules are used, and the code in this
- * loader will implement appropriate checks to load the modules
- * in the correct order. Also this allows to load modules
- * with RTLD_NOW and RTLD_LOCAL so there is no chance of run-time
- * bugs due to unresolved symbols or name conflicts.
*/
-struct symbol_entry {
- const char *name;
- void *value;
- int size;
- struct module *src; /* module sourcing it, filled by loader */
+enum ast_module_flags {
+ AST_MODFLAG_DEFAULT = 0,
+ AST_MODFLAG_GLOBAL_SYMBOLS = (1 << 0),
};
-/*
- * Constructors for symbol_entry values
- */
-#define MOD_FUNC(f) { .name = #f, .value = f, .size = sizeof(f) }
-#define MOD_DATA(d) { .name = #d, .value = &d, .size = sizeof(_name) }
-#define MOD_WANT(s) { .name = #s, .value = &s, 0 } /* required symbols */
+struct ast_module_info {
-/*
- * Constructors for fields of foo_interface
- */
-#define MOD_FIELD(f) . ## f = f
-#define METHOD_BASE(_base, _name) . ## _name = _base ## _name
+ /* The 'self' pointer for a module; it will be set by the loader before
+ it calls the module's load_module() entrypoint, and used by various
+ other macros that need to identify the module.
+ */
-/*
- * Each 'registerable' entity has a pointer in the
- * struct ast_registry, which points to an array of objects of
- * the same type. The ast_*_register() function will be able to
- * derive the size of these entries.
- */
-struct ast_registry {
- struct ast_cli_entry *clis;
-};
+ struct ast_module *self;
+ enum ast_module_load_result (*load)(void); /* register stuff etc. Optional. */
+ int (*reload)(void); /* config etc. Optional. */
+ int (*unload)(void); /* unload. called with the module locked */
+ const char *name; /* name of the module for loader reference and CLI commands */
+ const char *description; /* user friendly description of the module. */
-struct module_symbols {
- /* load, reload and unload receive as argument a pointer to a module descriptor
- * to be stored locally and used for local calls and so on.
- * They all return 0 on success, non zero (-1) on failure.
+ /*!
+ * This holds the ASTERISK_GPL_KEY, signifiying that you agree to the terms of
+ * the Asterisk license as stated in the ASTERISK_GPL_KEY. Your module will not
+ * load if it does not return the EXACT key string.
*/
- int (*load_module)(void *); /* register stuff etc. Optional. */
+ const char *key;
+ unsigned int flags;
+};
- int (*reload)(void *); /* reload config etc. Optional. */
+void ast_module_register(const struct ast_module_info *);
+void ast_module_unregister(const struct ast_module_info *);
- int (*unload_module)(void *); /* unload. called with the module locked */
+struct ast_module_user *__ast_module_user_add(struct ast_module *, struct ast_channel *);
+void __ast_module_user_remove(struct ast_module *, struct ast_module_user *);
+void __ast_module_user_hangup_all(struct ast_module *);
- const char *(*description)(void); /* textual id of the module. */
+#define ast_module_user_add(chan) __ast_module_user_add(ast_module_info->self, chan)
+#define ast_module_user_remove(user) __ast_module_user_remove(ast_module_info->self, user)
+#define ast_module_user_hangup_all() __ast_module_user_hangup_all(ast_module_info->self)
- /*!
- * This returns the ASTERISK_GPL_KEY, signifiying that you agree to the terms of
- * the GPL stated in the ASTERISK_GPL_KEY. Your module will not load if it does
- * not return the EXACT message:
- */
- const char *(*key)(void); /*! the asterisk key */
-
- enum module_flags {
- MOD_0 = 0x0, /* old module style */
- MOD_1 = 0x1, /* old style, but symbols here */
- MOD_2 = 0x2, /* new style, exported symbols */
- MOD_MASK = 0xf, /* mask for module types */
- NO_USECOUNT = 0x10, /* do not track usecount */
- NO_UNLOAD = 0x20, /* only forced unload allowed */
- DO_LOCALUSERS = 0x40, /* track localusers */
- } flags;
- /* the following two fields should go in the astobj. */
- ast_mutex_t lock;
- int usecnt; /* number of active clients */
-
- /* list of clients */
- struct localuser *lu_head;
- struct ast_registry *reg; /* list of things to register. */
- struct symbol_entry *exported_symbols;
- struct symbol_entry *required_symbols;
-};
-
-#ifndef MOD_LOADER /* the loader does not use these */
-struct module_symbols mod_data; /* forward declaration */
-static struct module_symbols *__mod_desc __attribute__ ((__unused__)) = &mod_data; /* used by localuser */
-
-#define STD_MOD(t, reload_fn, exp, req) \
-struct module_symbols mod_data = { \
- .load_module = load_module, \
- .unload_module = unload_module, \
- .description = description, \
- .key = key, \
- .reload = reload_fn, \
- .flags = t, \
- .exported_symbols = exp, \
- .required_symbols = req \
-};
+struct ast_module *ast_module_ref(struct ast_module *);
+void ast_module_unref(struct ast_module *);
-#define STD_MOD1 STD_MOD(MOD_1, NULL, NULL, NULL)
+#if defined(__cplusplus) || defined(c_plusplus)
+#define AST_MODULE_INFO(keystr, flags_to_set, desc, load_func, unload_func, reload_func) \
+ static struct ast_module_info __mod_info = { \
+ NULL, \
+ load_func, \
+ unload_func, \
+ reload_func, \
+ AST_MODULE, \
+ desc, \
+ keystr, \
+ flags_to_set \
+ }; \
+ static void __attribute__ ((constructor)) __reg_module(void) \
+ { \
+ ast_module_register(&__mod_info); \
+ } \
+ static void __attribute__ ((destructor)) __unreg_module(void) \
+ { \
+ ast_module_unregister(&__mod_info); \
+ } \
+ const static __attribute__((unused)) struct ast_module_info *ast_module_info = &__mod_info
+
+#define AST_MODULE_INFO_STANDARD(keystr, desc) \
+ AST_MODULE_INFO(keystr, AST_MODFLAG_DEFAULT, desc, \
+ load_module, \
+ unload_module, \
+ NULL \
+ )
+#else
+/* forward declare this pointer in modules, so that macro/function
+ calls that need it can get it, since it will actually be declared
+ and populated at the end of the module's source file... */
+const static __attribute__((unused)) struct ast_module_info *ast_module_info;
+
+#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...) \
+ static struct ast_module_info __mod_info = { \
+ .name = AST_MODULE, \
+ .flags = flags_to_set, \
+ .description = desc, \
+ .key = keystr, \
+ fields \
+ }; \
+ static void __attribute__ ((constructor)) __reg_module(void) \
+ { \
+ ast_module_register(&__mod_info); \
+ } \
+ static void __attribute__ ((destructor)) __unreg_module(void) \
+ { \
+ ast_module_unregister(&__mod_info); \
+ } \
+ const static struct ast_module_info *ast_module_info = &__mod_info
+
+#define AST_MODULE_INFO_STANDARD(keystr, desc) \
+ AST_MODULE_INFO(keystr, AST_MODFLAG_DEFAULT, desc, \
+ .load = load_module, \
+ .unload = unload_module, \
+ )
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#include "asterisk/channel.h"
-struct ast_channel;
-
enum AST_MONITORING_STATE {
AST_MONITOR_RUNNING,
AST_MONITOR_PAUSED
#ifndef _ASTERISK_SRV_H
#define _ASTERISK_SRV_H
-struct ast_channel;
-
/*!
\file srv.h
\brief Support for DNS SRV records, used in to locate SIP services.
*/
int buf_size;
- int desc_size; /*!< size of private descriptor in pvt->pvt, if any */
- int plc_samples; /*!< set to the plc block size if used, 0 otherwise */
- int useplc; /*!< current status of plc, changed at runtime */
+ int desc_size; /*!< size of private descriptor in pvt->pvt, if any */
+ int plc_samples; /*!< set to the plc block size if used, 0 otherwise */
+ int useplc; /*!< current status of plc, changed at runtime */
- void *module; /*!< opaque reference to the parent module */
+ struct ast_module *module; /* opaque reference to the parent module */
- int cost; /*!< Cost in milliseconds for encoding/decoding 1 second of sound */
+ int cost; /*!< Cost in milliseconds for encoding/decoding 1 second of sound */
AST_LIST_ENTRY(ast_translator) list; /*!< link field */
};
* \param module handle to the module that owns this translator
* \return 0 on success, -1 on failure
*/
-int ast_register_translator(struct ast_translator *t, void *module);
+int __ast_register_translator(struct ast_translator *t, struct ast_module *module);
+#define ast_register_translator(t) __ast_register_translator(t, ast_module_info->self)
/*!
* \brief Unregister a translator
_ast_malloc((len), __FILE__, __LINE__, __PRETTY_FUNCTION__)
AST_INLINE_API(
-void * __attribute__((malloc)) _ast_malloc(size_t len, const char *file, int lineno, const char *func),
+void * attribute_malloc _ast_malloc(size_t len, const char *file, int lineno, const char *func),
{
void *p;
_ast_calloc((num), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__)
AST_INLINE_API(
-void * __attribute__((malloc)) _ast_calloc(size_t num, size_t len, const char *file, int lineno, const char *func),
+void * attribute_malloc _ast_calloc(size_t num, size_t len, const char *file, int lineno, const char *func),
{
void *p;
_ast_realloc((p), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__)
AST_INLINE_API(
-void * __attribute__((malloc)) _ast_realloc(void *p, size_t len, const char *file, int lineno, const char *func),
+void * attribute_malloc _ast_realloc(void *p, size_t len, const char *file, int lineno, const char *func),
{
void *newp;
_ast_strdup((str), __FILE__, __LINE__, __PRETTY_FUNCTION__)
AST_INLINE_API(
-char * __attribute__((malloc)) _ast_strdup(const char *str, const char *file, int lineno, const char *func),
+char * attribute_malloc _ast_strdup(const char *str, const char *file, int lineno, const char *func),
{
char *newstr = NULL;
_ast_strndup((str), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__)
AST_INLINE_API(
-char * __attribute__((malloc)) _ast_strndup(const char *str, size_t len, const char *file, int lineno, const char *func),
+char * attribute_malloc _ast_strndup(const char *str, size_t len, const char *file, int lineno, const char *func),
{
char *newstr = NULL;
+++ /dev/null
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Copyright (C) 1999 - 2006, Digium, Inc.
- *
- * Mark Spencer <markster@digium.com>
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE file
- * at the top of the source tree.
- */
-
-/*! \file
- *
- * \brief Module Loader
- *
- * \author Mark Spencer <markster@digium.com>
- * - See ModMngMnt
- */
-
-#define MOD_LOADER /* prevent some module-specific stuff from being compiled */
-#include "asterisk.h"
-
-ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-
-#include <stdio.h>
-#include <dirent.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "asterisk/linkedlists.h"
-#include "asterisk/module.h"
-#include "asterisk/options.h"
-#include "asterisk/config.h"
-#include "asterisk/logger.h"
-#include "asterisk/channel.h"
-#include "asterisk/term.h"
-#include "asterisk/manager.h"
-#include "asterisk/cdr.h"
-#include "asterisk/enum.h"
-#include "asterisk/rtp.h"
-#include "asterisk/http.h"
-#include "asterisk/lock.h"
-#ifdef DLFCNCOMPAT
-#include "asterisk/dlfcn-compat.h"
-#else
-#include <dlfcn.h>
-#endif
-#include "asterisk/md5.h"
-#include "asterisk/utils.h"
-
-#ifndef RTLD_NOW
-#define RTLD_NOW 0
-#endif
-
-static int modlistver = 0; /* increase whenever the list changes, to protect reload */
-
-static unsigned char expected_key[] =
-{ 0x87, 0x76, 0x79, 0x35, 0x23, 0xea, 0x3a, 0xd3,
- 0x25, 0x2a, 0xbb, 0x35, 0x87, 0xe4, 0x22, 0x24 };
-
-/*
- * Modules can be in a number of different states, as below:
- * MS_FAILED attempt to load failed. This is final.
- * MS_NEW just added to the list, symbols unresolved.
- * MS_RESOLVED all symbols resolved, but supplier modules not active yet.
- * MS_CANLOAD all symbols resolved and suppliers are all active
- * (or we are in a cyclic dependency and we are breaking a loop)
- * MS_ACTIVE load() returned successfully.
- */
-enum st_t { /* possible states of a module */
- MS_FAILED = 0, /*!< cannot load */
- MS_NEW = 1, /*!< nothing known */
- MS_RESOLVED = 2, /*!< all required resolved */
- MS_CANLOAD = 3, /*!< as above, plus cyclic depend.*/
- MS_ACTIVE = 4, /*!< all done */
-};
-
-/*! \note
- * All module symbols are in module_symbols.
- * Modules are then linked in a list of struct module,
- * whereas updaters are in a list of struct loadupdate.
- *
- * Both lists (basically, the entire loader) are protected by
- * the lock in module_list.
- *
- * A second lock, reloadlock, is used to prevent concurrent reloads
- */
-struct module {
- AST_LIST_ENTRY(module) next;
- struct module_symbols *cb;
- void *lib; /* the shared lib */
- char resource[256];
-
- enum st_t state;
- int export_refcount; /* how many users of exported symbols */
-};
-
-struct loadupdate {
- AST_LIST_ENTRY(loadupdate) next;
- int (*updater)(void);
-};
-
-static AST_LIST_HEAD_STATIC(module_list, module);
-static AST_LIST_HEAD_STATIC(updaters, loadupdate);
-AST_MUTEX_DEFINE_STATIC(reloadlock);
-
-/*! \note
- * helper localuser routines.
- * All of these routines are extremely expensive, so the use of
- * macros is totally unnecessary from the point of view of performance:
- * the extra function call will be totally negligible in all cases.
- */
-
-struct localuser *ast_localuser_add(struct module_symbols *me,
- struct ast_channel *chan)
-{
- struct localuser *u = ast_calloc(1, sizeof(*u));
- if (u == NULL)
- return NULL;
- u->chan = chan;
- ast_mutex_lock(&me->lock);
- u->next = me->lu_head;
- me->lu_head = u;
- ast_mutex_unlock(&me->lock);
- ast_atomic_fetchadd_int(&me->usecnt, +1);
- ast_update_use_count();
- return u;
-}
-
-void ast_localuser_remove(struct module_symbols *me, struct localuser *u)
-{
- struct localuser *x, *prev = NULL;
- ast_mutex_lock(&me->lock);
- /* unlink from the list */
- for (x = me->lu_head; x; prev = x, x = x->next) {
- if (x == u) {
- if (prev)
- prev->next = x->next;
- else
- me->lu_head = x->next;
- break;
- }
- }
- ast_mutex_unlock(&me->lock);
- ast_atomic_fetchadd_int(&me->usecnt, -1);
- free(u);
- ast_update_use_count();
-}
-
-void ast_hangup_localusers(struct module_symbols *me)
-{
- struct localuser *u, *next;
- ast_mutex_lock(&me->lock);
- for (u = me->lu_head; u; u = next) {
- next = u->next;
- ast_softhangup(u->chan, AST_SOFTHANGUP_APPUNLOAD);
- ast_atomic_fetchadd_int(&me->usecnt, -1);
- free(u);
- }
- ast_mutex_unlock(&me->lock);
- ast_update_use_count();
-}
-
-/*--- new-style loader routines ---*/
-
-/*
- * For backward compatibility, we have 3 types of loadable modules:
- *
- * MOD_0 these are the 'old style' modules, which export a number
- * of callbacks, and their full interface, as globally visible
- * symbols. The module needs to be loaded with RTLD_LAZY and
- * RTLD_GLOBAL to make symbols visible to other modules, and
- * to avoid load failures due to cross dependencies.
- *
- * MOD_1 The generic callbacks are all into a structure, mod_data.
- *
- * MOD_2 this is the 'new style' format for modules. The module must
- * explictly declare which simbols are exported and which
- * symbols from other modules are used, and the code in this
- * loader will implement appropriate checks to load the modules
- * in the correct order. Also this allows to load modules
- * with RTLD_NOW and RTLD_LOCAL so there is no chance of run-time
- * bugs due to unresolved symbols or name conflicts.
- */
-
-/*
- * helper routine to print the symbolic name associated to a state
- */
-static const char *st_name(enum st_t state)
-{
- /* try to resolve required symbols */
- const char *st;
- switch (state) {
-#define ST(x) case x: st = # x; break;
- ST(MS_NEW);
- ST(MS_FAILED);
- ST(MS_RESOLVED);
- ST(MS_ACTIVE);
- ST(MS_CANLOAD);
- default:
- st = "unknown";
- }
- return st;
-#undef ST
-}
-
-/*! \brief
- * Fetch/release an exported symbol - modify export_refcount by delta
- * \param delta 1 to fetch a symbol, -1 to release it.
- * \return on success, return symbol value.
- * \note Note, modules in MS_FAIL will never match in a 'get' request.
- * If src is non-NULL, on exit *src points to the source module.
- *
- * Must be called with the lock held.
- */
-static void *module_symbol_helper(const char *name,
- int delta, struct module **src)
-{
- void *ret = NULL;
- struct module *m;
-
- AST_LIST_TRAVERSE(&module_list, m, next) {
- struct symbol_entry *es;
- if (delta > 0 && m->state == MS_FAILED)
- continue; /* cannot 'get' a symbol from a failed module */
- for (es = m->cb->exported_symbols; ret == NULL && es && es->name; es++) {
- if (!strcmp(es->name, name)) {
- ret = es->value;
- m->export_refcount += delta;
- if (src)
- *src = m;
- break;
- }
- }
- if (ret)
- break;
- }
- if (ret == NULL)
- ast_log(LOG_WARNING, "symbol %s not found\n", name);
- return ret;
-}
-
-static void *release_module_symbol(const char *name)
-{
- return module_symbol_helper(name, -1, NULL);
-}
-
-static void *get_module_symbol(const char *name, struct module **src)
-{
- return module_symbol_helper(name, +1, src);
-}
-
-/*!
- * \brief Release refcounts to all imported symbols,
- * and change module state to MS_FAILED.
- */
-static void release_module(struct module *m)
-{
- struct symbol_entry *s;
-
- for (s = m->cb->required_symbols; s && s->name != NULL; s++) {
- if (s->value != NULL) {
- release_module_symbol(s->name);
- s->value = NULL;
- }
- }
- m->state = MS_FAILED;
-}
-
-/*! \brief check that no NULL symbols are exported - the algorithms rely on that. */
-static int check_exported(struct module *m)
-{
- struct symbol_entry *es = m->cb->exported_symbols;
- int errors = 0;
-
- if (es == NULL)
- return 0;
- ast_log(LOG_WARNING, "module %s exports the following symbols\n",
- es->name);
- for (; es->name; es++) {
- void **p = es->value;
- int i;
-
- ast_log(LOG_WARNING, "\taddr %p size %8d %s\n",
- es->value, es->size, es->name);
- for (i = 0; i < es->size / sizeof(void *); i++, p++) {
- if (*p == NULL) {
- ast_log(LOG_WARNING, "\t *** null field at offset %d\n", i);
- errors++;
- }
- }
- }
- return errors;
-}
-
-/*!
- * \brief Resolve symbols and change state accordingly.
- * \return Return 1 if state changed, 0 otherwise.
- * \note If MS_FAILED, MS_ACTIVE or MS_CANLOAD there is nothing to do.
- * If a symbol cannot be resolved (no supplier or supplier in MS_FAIL),
- * move to MS_FAIL and release all symbols;
- * If all suppliers are MS_ACTIVE, move to MS_CANLOAD
- * otherwise move to MS_RESOLVED.
- */
-static int resolve(struct module *m)
-{
- struct symbol_entry *s;
-
- if (m->state == MS_FAILED || m->state == MS_ACTIVE || m->state == MS_CANLOAD)
- return 0; /* already decided what to do */
- /* now it's either MS_NEW or MS_RESOLVED.
- * Be optimistic and put it in MS_CANLOAD, then try to
- * resolve and verify symbols, and downgrade as appropriate.
- */
- m->state = MS_CANLOAD;
- for (s = m->cb->required_symbols; s && s->name != NULL; s++) {
- void **p = (void **)(s->value);
-
- if (*p == NULL) /* symbol not resolved yet */
- *p = get_module_symbol(s->name, &s->src);
- if (*p == NULL || s->src->state == MS_FAILED) { /* fail */
- ast_log(LOG_WARNING,
- "Unresolved symbol %s for module %s\n",
- s->name, m->resource);
- release_module(m); /* and set to MS_FAILED */
- break;
- }
- if (s->src->state != MS_ACTIVE)
- m->state = MS_RESOLVED; /* downgrade */
- }
- return 1;
-}
-
-/*!
- * \brief Fixup references and load modules according to their dependency order.
- * Called when new modules are added to the list.
- * The algorithm is as follows:
- * - all modules MS_FAILED are changed to MS_NEW, in case something
- * happened that could help them.
- * - first try to resolve symbols. If successful, change the
- * module's state to MS_RESOLVED otherwise to MS_FAILED
- * - repeat on all modules until there is progress:
- * - if it is MS_ACTIVE or MS_FAILED, continue (no progress)
- * - if one has all required modules in MS_ACTIVE, try to load it.
- * If successful it becomes MS_ACTIVE itself, otherwise
- * MS_FAILED and releases all symbols.
- * In any case, we have progress.
- * - if one of the dependencies is MS_FAILED, release and set to
- * MS_FAILED here too. We have progress.
- * - if we have no progress there is a cyclic dependency.
- * Take first and change to MS_CANLOAD, i.e. as if all required are
- * MS_ACTIVE. we have progress, so repeat.
- * \par NOTE:
- * - must be called with lock held
- * - recursive calls simply return success.
- */
-static int fixup(const char *caller)
-{
- struct module *m;
- int total = 0, new = 0, cycle = 0;
- static int in_fixup = 0; /* disable recursive calls */
-
- if (in_fixup)
- return 0;
- in_fixup++;
- AST_LIST_TRAVERSE(&module_list, m, next) {
- total++;
- if (m->state == MS_FAILED)
- m->state = MS_NEW;
- if (m->state == MS_NEW)
- new++;
- /* print some debugging info for new modules */
- if (m->state == MS_NEW &&
- (m->cb->exported_symbols || m->cb->required_symbols))
- ast_log(LOG_NOTICE,
- "module %-30s exports %p requires %p state %s(%d)\n",
- m->resource, m->cb->exported_symbols,
- m->cb->required_symbols,
- st_name(m->state), m->state);
- }
- ast_log(LOG_DEBUG, "---- fixup (%s): %d modules, %d new ---\n",
- caller, total, new);
- for (;;cycle++) {
- int again = 0; /* set if we need another round */
-
- ast_log(LOG_DEBUG, "---- fixup: cycle %d ---\n", cycle);
- AST_LIST_TRAVERSE(&module_list, m, next) {
- if (resolve(m))
- again = 1; /* something changed */
- if (m->state != MS_CANLOAD) /* for now, done with this module */
- continue;
- /* try to run the load routine */
- if (m->cb->load_module(m)) { /* error */
- ast_log(LOG_WARNING, "load_module %s fail\n",
- m->resource);
- release_module(m); /* and set to MS_FAIL */
- } else {
- ast_log(LOG_WARNING, "load_module %s success\n",
- m->resource);
- m->state = MS_ACTIVE;
- }
- again = 1; /* something has changed */
- }
- /* Modules in MS_RESOLVED mean a possible cyclic dependency.
- * Break the indecision by setting one to CANLOAD, and repeat.
- */
- AST_LIST_TRAVERSE(&module_list, m, next) {
- if (m->state == MS_RESOLVED) {
- m->state = MS_CANLOAD;
- again = 1;
- break;
- }
- }
- if (!again) /* we are done */
- break;
- }
- ast_log(LOG_DEBUG, "---- fixup complete ---\n");
- in_fixup--;
- return 0;
-}
-
-/* test routines to see which modules depend on global symbols
- * exported by other modules.
- */
-static void check_symbols(void)
-{
- struct dirent *d;
- DIR *mods = opendir(ast_config_AST_MODULE_DIR);
- void *lib;
- char buf[1024];
-
- ast_log(LOG_WARNING, "module dir <%s>\n", ast_config_AST_MODULE_DIR);
- if (!mods)
- return;
- while((d = readdir(mods))) {
- int ld = strlen(d->d_name);
- /* Must end in .so to load it. */
- if (ld <= 3 || strcasecmp(d->d_name + ld - 3, ".so"))
- continue;
- snprintf(buf, sizeof(buf), "%s/%s", ast_config_AST_MODULE_DIR, d->d_name);
- lib = dlopen(buf, RTLD_NOW | RTLD_LOCAL);
- if (lib == NULL) {
- ast_log(LOG_WARNING, "(notice only) module %s error %s\n", d->d_name, dlerror());
- }
- dlclose(lib);
- }
-}
-/*--- end new-style routines ---*/
-
-/*! \note
- * In addition to modules, the reload command handles some extra keywords
- * which are listed here together with the corresponding handlers.
- * This table is also used by the command completion code.
- */
-static struct reload_classes_t {
- const char *name;
- int (*reload_fn)(void);
-} reload_classes[] = { /* list in alpha order, longest match first */
- { "cdr", ast_cdr_engine_reload },
- { "dnsmgr", dnsmgr_reload },
- { "extconfig", read_config_maps },
- { "enum", ast_enum_reload },
- { "manager", reload_manager },
- { "rtp", ast_rtp_reload },
- { "http", ast_http_reload },
- { NULL, NULL }
-};
-
-static int printdigest(const unsigned char *d)
-{
- int x, pos;
- char buf[256]; /* large enough so we don't have to worry */
-
- for (pos = 0, x=0; x<16; x++)
- pos += sprintf(buf + pos, " %02x", *d++);
- ast_log(LOG_DEBUG, "Unexpected signature:%s\n", buf);
- return 0;
-}
-
-static int key_matches(const unsigned char *key1, const unsigned char *key2)
-{
- int x;
- for (x=0; x<16; x++) {
- if (key1[x] != key2[x]) /* mismatch - fail now. */
- return 0;
- }
- return 1;
-}
-
-static int verify_key(const unsigned char *key)
-{
- struct MD5Context c;
- unsigned char digest[16];
- MD5Init(&c);
- MD5Update(&c, key, strlen((char *)key));
- MD5Final(digest, &c);
- if (key_matches(expected_key, digest))
- return 0;
- printdigest(digest);
- return -1;
-}
-
-int ast_unload_resource(const char *resource_name, enum unload_mode force)
-{
- struct module *cur;
- int res = -1;
- int error = 0;
- if (AST_LIST_LOCK(&module_list)) /* XXX should fail here ? */
- ast_log(LOG_WARNING, "Failed to lock\n");
- AST_LIST_TRAVERSE_SAFE_BEGIN(&module_list, cur, next) {
- struct module_symbols *m = cur->cb;
-
- if (strcasecmp(cur->resource, resource_name)) /* not us */
- continue;
- if (m->usecnt > 0 || m->flags & NO_UNLOAD) {
- if (force)
- ast_log(LOG_WARNING, "Warning: Forcing removal of module %s with use count %d\n", resource_name, res);
- else {
- ast_log(LOG_WARNING, "Soft unload failed, '%s' has use count %d\n", resource_name, res);
- error = 1;
- break;
- }
- }
- ast_hangup_localusers(m);
- res = m->unload_module(m);
- if (res) {
- ast_log(LOG_WARNING, "Firm unload failed for %s\n", resource_name);
- if (force <= AST_FORCE_FIRM) {
- error = 1;
- break;
- } else
- ast_log(LOG_WARNING, "** Dangerous **: Unloading resource anyway, at user request\n");
- }
- release_module(cur); /* XXX */
- AST_LIST_REMOVE_CURRENT(&module_list, next);
- dlclose(cur->lib);
- free(cur);
- break;
- }
- AST_LIST_TRAVERSE_SAFE_END;
- if (!error)
- modlistver++;
- AST_LIST_UNLOCK(&module_list);
- if (!error) /* XXX maybe within the lock ? */
- ast_update_use_count();
- return res;
-}
-
-char *ast_module_helper(const char *line, const char *word, int pos, int state, int rpos, int needsreload)
-{
- struct module *cur;
- int i, which=0, l = strlen(word);
- char *ret = NULL;
-
- if (pos != rpos)
- return NULL;
- AST_LIST_LOCK(&module_list);
- AST_LIST_TRAVERSE(&module_list, cur, next) {
- if (!strncasecmp(word, cur->resource, l) && (cur->cb->reload || !needsreload) &&
- ++which > state) {
- ret = strdup(cur->resource);
- break;
- }
- }
- AST_LIST_UNLOCK(&module_list);
- if (!ret) {
- for (i=0; !ret && reload_classes[i].name; i++) {
- if (!strncasecmp(word, reload_classes[i].name, l) && ++which > state)
- ret = strdup(reload_classes[i].name);
- }
- }
- return ret;
-}
-
-int ast_module_reload(const char *name)
-{
- struct module *cur;
- int res = 0; /* return value. 0 = not found, others, see below */
- int i, oldversion;
-
- if (ast_mutex_trylock(&reloadlock)) {
- ast_verbose("The previous reload command didn't finish yet\n");
- return -1; /* reload already in progress */
- }
- /* Call "predefined" reload here first */
- for (i = 0; reload_classes[i].name; i++) {
- if (!name || !strcasecmp(name, reload_classes[i].name)) {
- reload_classes[i].reload_fn(); /* XXX should check error ? */
- res = 2; /* found and reloaded */
- }
- }
- ast_lastreloadtime = time(NULL);
-
- AST_LIST_LOCK(&module_list);
- oldversion = modlistver;
- AST_LIST_TRAVERSE(&module_list, cur, next) {
- struct module_symbols *m = cur->cb;
- if (name && strcasecmp(name, cur->resource)) /* not ours */
- continue;
- if (!m->reload) { /* cannot be reloaded */
- if (res < 1) /* store result if possible */
- res = 1; /* 1 = no reload() method */
- continue;
- }
- /* drop the lock and try a reload. if successful, break */
- AST_LIST_UNLOCK(&module_list);
- res = 2;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Reloading module '%s' (%s)\n", cur->resource, m->description());
- m->reload(m);
- AST_LIST_LOCK(&module_list);
- if (oldversion != modlistver) /* something changed, abort */
- break;
- }
- AST_LIST_UNLOCK(&module_list);
- ast_mutex_unlock(&reloadlock);
- return res;
-}
-
-static int resource_exists(const char *resource, int do_lock)
-{
- struct module *cur;
- if (do_lock && AST_LIST_LOCK(&module_list))
- ast_log(LOG_WARNING, "Failed to lock\n");
- AST_LIST_TRAVERSE(&module_list, cur, next) {
- if (!strcasecmp(resource, cur->resource))
- break;
- }
- if (do_lock)
- AST_LIST_UNLOCK(&module_list);
- return cur ? -1 : 0;
-}
-
-/* lookup a symbol with or without leading '_', accept either form in input */
-static void *find_symbol(struct module *m, const char *name, int verbose)
-{
- char *n1;
- void *s;
-
- if (name[0] == '_')
- name++;
- n1 = alloca(strlen(name) + 2); /* room for leading '_' and final '\0' */
- n1[0] = '_';
- strcpy(n1+1, name);
- s = dlsym(m->lib, n1+1); /* try without '_' */
- if (s == NULL)
- s = dlsym(m->lib, n1);
- if (verbose && s == NULL)
- ast_log(LOG_WARNING, "No symbol '%s' in module '%s\n",
- n1, m->resource);
- return s;
-}
-
-/* XXX cfg is only used for !res_* and #ifdef RTLD_GLOBAL */
-static struct module * __load_resource(const char *resource_name,
- const struct ast_config *cfg)
-{
- static char fn[256];
- int errors=0;
- int res;
- struct module *cur;
- struct module_symbols *m = NULL;
- int flags = RTLD_NOW;
- unsigned char *key;
- char tmp[80];
-
-#ifndef RTLD_GLOBAL
-#define RTLD_GLOBAL 0 /* so it is a No-op */
-#endif
- if (strncasecmp(resource_name, "res_", 4) && cfg) {
- char *val = ast_variable_retrieve(cfg, "global", resource_name);
- if (val && ast_true(val))
- flags |= RTLD_GLOBAL;
- } else {
- /* Resource modules are always loaded global and lazy */
- flags = (RTLD_GLOBAL | RTLD_LAZY);
- }
-
- if (AST_LIST_LOCK(&module_list))
- ast_log(LOG_WARNING, "Failed to lock\n");
- if (resource_exists(resource_name, 0)) {
- ast_log(LOG_WARNING, "Module '%s' already exists\n", resource_name);
- AST_LIST_UNLOCK(&module_list);
- return NULL;
- }
- if (!(cur = ast_calloc(1, sizeof(*cur)))) {
- AST_LIST_UNLOCK(&module_list);
- return NULL;
- }
- ast_copy_string(cur->resource, resource_name, sizeof(cur->resource));
- if (resource_name[0] == '/')
- ast_copy_string(fn, resource_name, sizeof(fn));
- else
- snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_MODULE_DIR, resource_name);
-
- /* open in a sane way */
- cur->lib = dlopen(fn, RTLD_NOW | RTLD_LOCAL);
- if (cur->lib &&
- ((m = find_symbol(cur, "mod_data", 0)) == NULL || (m->flags & MOD_MASK) == MOD_0)) {
- /* old-style module, close and reload with standard flags */
- dlclose(cur->lib);
- cur->lib = NULL;
- m = NULL;
- }
- if (cur->lib == NULL) /* try reopen with the old style */
- cur->lib = dlopen(fn, flags);
-
- if (!cur->lib) {
- ast_log(LOG_WARNING, "%s\n", dlerror());
- free(cur);
- AST_LIST_UNLOCK(&module_list);
- return NULL;
- }
- if (m == NULL) /* MOD_0 modules may still have a mod_data entry */
- m = find_symbol(cur, "mod_data", 0);
- if (m != NULL) { /* new style module */
- cur->cb = m; /* use the mod_data from the module itself */
- errors = check_exported(cur);
- } else {
- ast_log(LOG_WARNING, "missing mod_data for %s\n",
- resource_name);
- errors++;
- }
- if (!m->load_module)
- errors++;
- if (!m->unload_module && !(m->flags & NO_UNLOAD) )
- errors++;
- if (!m->description)
- errors++;
- if (!m->key)
- errors++;
- if (!m->key || !(key = (unsigned char *) m->key())) {
- ast_log(LOG_WARNING, "Key routine returned NULL in module %s\n", fn);
- key = NULL;
- errors++;
- }
- if (key && verify_key(key)) {
- ast_log(LOG_WARNING, "Unexpected key returned by module %s\n", fn);
- errors++;
- }
- if (errors) {
- ast_log(LOG_WARNING, "%d error%s loading module %s, aborted\n", errors, (errors != 1) ? "s" : "", fn);
- dlclose(cur->lib);
- free(cur);
- AST_LIST_UNLOCK(&module_list);
- return NULL;
- }
- /* init mutex and usecount */
- ast_mutex_init(&cur->cb->lock);
- cur->cb->lu_head = NULL;
-
- if (!ast_fully_booted) {
- if (option_verbose)
- ast_verbose( " => (%s)\n", term_color(tmp, m->description(), COLOR_BROWN, COLOR_BLACK, sizeof(tmp)));
- if (ast_opt_console && !option_verbose)
- ast_verbose( ".");
- } else {
- if (option_verbose)
- ast_verbose(VERBOSE_PREFIX_1 "Loaded %s => (%s)\n", fn, m->description());
- }
-
- AST_LIST_INSERT_TAIL(&module_list, cur, next);
- /* add module to end of module_list chain
- so reload commands will be issued in same order modules were loaded */
-
- modlistver++;
- if ( (m->flags & MOD_MASK) == MOD_2) {
- ast_log(LOG_WARNING, "new-style module %s, deferring load()\n",
- resource_name);
- cur->state = MS_NEW;
- } else
- cur->state = MS_CANLOAD;
- /* XXX make sure the usecount is 1 before releasing the lock */
- AST_LIST_UNLOCK(&module_list);
-
- if (cur->state == MS_CANLOAD && (res = m->load_module(m))) {
- ast_log(LOG_WARNING, "%s: load_module failed, returning %d\n", resource_name, res);
- ast_unload_resource(resource_name, 0);
- return NULL;
- }
- cur->state = MS_ACTIVE;
- ast_update_use_count();
- return cur;
-}
-
-/*!
- * \brief load a single module (API call).
- * (recursive calls from load_module() succeed.
- * \return Returns 0 on success, -1 on error.
- */
-int ast_load_resource(const char *resource_name)
-{
- int o = option_verbose;
- struct ast_config *cfg = NULL;
- struct module *m;
-
- option_verbose = 0; /* Keep the module file parsing silent */
- cfg = ast_config_load(AST_MODULE_CONFIG);
- option_verbose = o; /* restore verbosity */
- m = __load_resource(resource_name, cfg);
- if (cfg)
- ast_config_destroy(cfg);
- return m ? 0 : -1;
-}
-
-#if 0
-/*
- * load a single module (API call).
- * (recursive calls from load_module() succeed.
- */
-int ast_load_resource(const char *resource_name)
-{
- struct module *m;
- int ret;
-
- ast_mutex_lock(&modlock);
- m = __load_resource(resource_name, 0);
- fixup(resource_name);
- ret = (m->state == MS_FAILED) ? -1 : 0;
- ast_mutex_unlock(&modlock);
- return ret;
-}
-#endif
-
-/*! \brief if enabled, log and output on console the module's name, and try load it */
-static int print_and_load(const char *s, struct ast_config *cfg)
-{
- char tmp[80];
-
- if (option_debug && !option_verbose)
- ast_log(LOG_DEBUG, "Loading module %s\n", s);
- if (option_verbose) {
- ast_verbose(VERBOSE_PREFIX_1 "[%s]",
- term_color(tmp, s, COLOR_BRWHITE, 0, sizeof(tmp)));
- fflush(stdout);
- }
- if (__load_resource(s, cfg))
- return 0; /* success */
- ast_log(LOG_WARNING, "Loading module %s failed!\n", s);
- return -1;
-}
-
-static const char *loadorder[] =
-{
- "res_",
- "pbx_",
- "chan_",
- NULL,
-};
-
-int load_modules(const int preload_only)
-{
- struct ast_config *cfg;
- int x;
-
- if (option_verbose) {
- ast_verbose(preload_only ?
- "Asterisk Dynamic Loader loading preload modules:\n" :
- "Asterisk Dynamic Loader Starting:\n");
- }
-
- if (0)
- check_symbols();
-
- cfg = ast_config_load(AST_MODULE_CONFIG);
-
- if (cfg) {
- const char *cmd = preload_only ? "preload" : "load";
- struct ast_variable *v;
- /* Load explicitly defined modules */
- for (v = ast_variable_browse(cfg, "modules"); v; v = v->next) {
- if (strcasecmp(v->name, cmd)) /* not what we are looking for */
- continue;
- if (print_and_load(v->value, cfg)) { /* XXX really fatal ? */
- ast_config_destroy(cfg);
- return -1;
- }
- }
- }
-
- if (preload_only)
- goto done;
-
- if (cfg && !ast_true(ast_variable_retrieve(cfg, "modules", "autoload")))
- /* no autoload */
- goto done;
- /*
- * Load all modules. To help resolving dependencies, we load modules
- * in the order defined by loadorder[], with the final step for
- * all modules with other prefixes.
- * (XXX the new loader does not need this).
- */
-
- for (x=0; x<sizeof(loadorder) / sizeof(loadorder[0]); x++) {
- struct dirent *d;
- DIR *mods = opendir(ast_config_AST_MODULE_DIR);
- const char *base = loadorder[x];
- int lx = base ? strlen(base) : 0;
-
- if (!mods) {
- if (!ast_opt_quiet)
- ast_log(LOG_WARNING, "Unable to open modules directory %s.\n",
- ast_config_AST_MODULE_DIR);
- break; /* suffices to try once! */
- }
- while((d = readdir(mods))) {
- int ld = strlen(d->d_name);
- /* Must end in .so to load it. */
- if (ld > 3 && (!base || !strncasecmp(d->d_name, base, lx)) &&
- !strcasecmp(d->d_name + ld - 3, ".so") &&
- !resource_exists(d->d_name, 1)) {
- /* It's a shared library, check if we are allowed to load it
- * (very inefficient, but oh well).
- */
- if (cfg) {
- struct ast_variable *v;
- for (v = ast_variable_browse(cfg, "modules"); v; v = v->next) {
- if (!strcasecmp(v->name, "noload") &&
- !strcasecmp(v->value, d->d_name))
- break;
- }
- if (v) {
- if (option_verbose) {
- ast_verbose( VERBOSE_PREFIX_1 "[skipping %s]\n",
- d->d_name);
- fflush(stdout);
- }
- continue;
- }
-
- }
- if (print_and_load(d->d_name, cfg)) {
- ast_config_destroy(cfg);
- return -1;
- }
- }
- }
- closedir(mods);
- }
-done:
- fixup("load_modules");
- ast_config_destroy(cfg);
- return 0;
-}
-
-#include <errno.h> /* for errno... */
-
-void ast_update_use_count(void)
-{
- /* Notify any module monitors that the use count for a
- resource has changed */
- struct loadupdate *m;
- if (AST_LIST_LOCK(&module_list))
- ast_log(LOG_WARNING, "Failed to lock, errno %d\n", errno);
- AST_LIST_TRAVERSE(&updaters, m, next)
- m->updater();
- AST_LIST_UNLOCK(&module_list);
-}
-
-int ast_update_module_list(int (*modentry)(const char *module, const char *description, int usecnt, const char *like),
- const char *like)
-{
- struct module *cur;
- int unlock = -1;
- int total_mod_loaded = 0;
-
- if (ast_mutex_trylock(&module_list.lock))
- unlock = 0;
- AST_LIST_TRAVERSE(&module_list, cur, next) {
- total_mod_loaded += modentry(cur->resource, cur->cb->description(), cur->cb->usecnt, like);
- }
- if (unlock)
- AST_LIST_UNLOCK(&module_list);
-
- return total_mod_loaded;
-}
-
-int ast_loader_register(int (*v)(void))
-{
- /* XXX Should be more flexible here, taking > 1 verboser XXX */
- struct loadupdate *tmp;
- if (!(tmp = ast_malloc(sizeof(*tmp))))
- return -1;
- tmp->updater = v;
- if (AST_LIST_LOCK(&module_list))
- ast_log(LOG_WARNING, "Failed to lock\n");
- AST_LIST_INSERT_HEAD(&updaters, tmp, next);
- AST_LIST_UNLOCK(&module_list);
- return 0;
-}
-
-int ast_loader_unregister(int (*v)(void))
-{
- struct loadupdate *cur;
-
- if (AST_LIST_LOCK(&module_list))
- ast_log(LOG_WARNING, "Failed to lock\n");
- AST_LIST_TRAVERSE_SAFE_BEGIN(&updaters, cur, next) {
- if (cur->updater == v) {
- AST_LIST_REMOVE_CURRENT(&updaters, next);
- break;
- }
- }
- AST_LIST_TRAVERSE_SAFE_END;
- AST_LIST_UNLOCK(&module_list);
- return cur ? 0 : -1;
-}
--- /dev/null
+#
+# Asterisk -- A telephony toolkit for Linux.
+#
+# Makefile to build main Asterisk binary
+#
+# Copyright (C) 1999-2006, Digium, Inc.
+#
+# Mark Spencer <markster@digium.com>
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License
+#
+
+ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),)
+ include $(ASTTOPDIR)/menuselect.makeopts
+ include $(ASTTOPDIR)/menuselect.makedeps
+endif
+
+ifneq ($(wildcard $(ASTTOPDIR)/makeopts.embed_rules),)
+ include $(ASTTOPDIR)/makeopts.embed_rules
+endif
+
+all: asterisk
+
+include $(ASTTOPDIR)/Makefile.moddir_rules
+
+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 \
+ ulaw.o alaw.o callerid.o fskmodem.o image.o app.o \
+ cdr.o tdd.o acl.o rtp.o udptl.o manager.o asterisk.o \
+ dsp.o chanvars.o indications.o autoservice.o db.o privacy.o \
+ astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
+ utils.o plc.o jitterbuf.o dnsmgr.o devicestate.o \
+ netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \
+ cryptostub.o sha1.o http.o fixedjitterbuf.o abstract_jb.o
+
+# we need to link in the objects statically, not as a library, because
+# otherwise modules will not have them available if none of the static
+# objects use it.
+OBJS+=stdtime/localtime.o
+
+# At the moment say.o is an optional component which can be overridden
+# by a module.
+OBJS+=say.o
+
+ifeq ($(wildcard /usr/include/sys/poll.h),)
+ OBJS+=poll.o
+endif
+
+ifeq ($(wildcard /usr/include/dlfcn.h),)
+ OBJS+=dlfcn.o
+endif
+
+ifneq ($(findstring $(OSARCH), linux-gnu uclinux ),)
+ ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
+ AST_LIBS+=-ldl
+ endif
+ AST_LIBS+=-lpthread $(EDITLINE_LIB) -lm -lresolv
+else
+ AST_LIBS+=$(EDITLINE_LIB) -lm
+endif
+
+ifneq ($(findstring darwin,$(OSARCH)),)
+ AST_LIBS+=-lresolv
+ ASTLINK=-Wl,-dynamic
+ # Mac on Intel CoreDuo does not need poll compatibility layer
+ ifneq ($(PROC),i386)
+ OBJS+=poll.o
+ ASTCFLAGS+=-DPOLLCOMPAT
+ endif
+else
+# These are used for all but Darwin
+ ASTLINK=-Wl,-E
+ ifneq ($(findstring BSD,$(OSARCH)),)
+ LDFLAGS+=-L/usr/local/lib
+ endif
+endif
+
+ifeq ($(OSARCH),FreeBSD)
+ AST_LIBS+=-lcrypto
+endif
+
+ifeq ($(OSARCH),NetBSD)
+ AST_LIBS+=-lpthread -lcrypto -lm -L/usr/pkg/lib $(EDITLINE_LIB)
+endif
+
+ifeq ($(OSARCH),OpenBSD)
+ AST_LIBS+=-lcrypto -lpthread -lm $(EDITLINE_LIB)
+endif
+
+ifeq ($(OSARCH),SunOS)
+ AST_LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L/opt/ssl/lib -L/usr/local/ssl/lib
+ OBJS+=strcompat.o
+ ASTLINK=
+endif
+
+editline/libedit.a:
+ cd editline && unset CFLAGS AST_LIBS && test -f config.h || CFLAGS="$(OPTIMIZE)" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)
+ $(MAKE) -C editline libedit.a
+
+db1-ast/libdb1.a:
+ CFLAGS="$(ASTCFLAGS)" $(MAKE) -C db1-ast libdb1.a
+
+ast_expr2.c ast_expr2.h:
+ bison -o $@ -d --name-prefix=ast_yy ast_expr2.y
+
+ast_expr2f.c:
+ flex -o $@ --full ast_expr2.fl
+
+testexpr2: ast_expr2f.c ast_expr2.c ast_expr2.h
+ $(CC) -g -c -Iinclude -DSTANDALONE ast_expr2f.c
+ $(CC) -g -c -Iinclude -DSTANDALONE ast_expr2.c
+ $(CC) -g -o testexpr2 ast_expr2f.o ast_expr2.o
+ rm ast_expr2.o ast_expr2f.o
+
+channel.o: CFLAGS+=$(ZAPTEL_INCLUDE)
+
+AST_EMBED_LDSCRIPTS:=$(sort $(EMBED_LDSCRIPTS))
+AST_EMBED_LDFLAGS:=$(foreach dep,$(EMBED_LDFLAGS),$(value $(dep)))
+AST_EMBED_LIBS:=$(foreach dep,$(EMBED_LIBS),$(value $(dep)))
+OBJS:=$(sort $(OBJS))
+
+asterisk: $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS)
+ @$(ASTTOPDIR)/build_tools/make_build_h > $(ASTTOPDIR)/include/asterisk/build.h.tmp
+ @if cmp -s $(ASTTOPDIR)/include/asterisk/build.h.tmp $(ASTTOPDIR)/include/asterisk/build.h ; then echo ; else \
+ mv $(ASTTOPDIR)/include/asterisk/build.h.tmp $(ASTTOPDIR)/include/asterisk/build.h ; \
+ fi
+ @rm -f $(ASTTOPDIR)/include/asterisk/build.h.tmp
+ @$(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
+ $(ECHO_PREFIX) echo " [LD] $^ -> $@"
+ $(CMD_PREFIX) $(CXX) $(LDFLAGS) $(STATIC_BUILD) -o asterisk $(ASTLINK) $(AST_EMBED_LDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS)
+
+clean::
+ rm -f asterisk
+ rm -f .depend
+ @if [ -f editline/Makefile ]; then $(MAKE) -C editline distclean ; fi
+ @$(MAKE) -C db1-ast clean
+ @$(MAKE) -C stdtime clean
#include "asterisk.h"
#ifndef STANDALONE
-ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 40546 $")
#endif
#include <sys/types.h>
/** Setup the input buffer state to scan the given bytes. The next call to ast_yylex() will
* scan from a @e copy of @a bytes.
- * @param yybytes the byte buffer to scan
- * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
}
/** Set the current column.
- * @param column_no
+ * @param line_number
* @param yyscanner The scanner object.
*/
void ast_yyset_column (int column_no , yyscan_t yyscanner)
#include "asterisk/doxyref.h" /* Doxygen documentation */
-#include "defaults.h"
+#include "../defaults.h"
#ifndef AF_LOCAL
#define AF_LOCAL AF_UNIX
printf(term_quit());
exit(1);
}
- if (dnsmgr_init()) {
+ if (load_modules()) {
printf(term_quit());
exit(1);
}
- /* load 'preload' modules, required for access to Realtime-mapped configuration files */
- if (load_modules(1)) {
+
+ if (dnsmgr_init()) {
printf(term_quit());
exit(1);
}
+
ast_http_init();
+
ast_channels_init();
+
if (init_manager()) {
printf(term_quit());
exit(1);
}
+
if (ast_cdr_engine_init()) {
printf(term_quit());
exit(1);
}
+
if (ast_device_state_engine_init()) {
printf(term_quit());
exit(1);
}
+
ast_rtp_init();
+
ast_udptl_init();
+
if (ast_image_init()) {
printf(term_quit());
exit(1);
}
+
if (ast_file_init()) {
printf(term_quit());
exit(1);
}
+
if (load_pbx()) {
printf(term_quit());
exit(1);
}
- if (load_modules(0)) {
- printf(term_quit());
- exit(1);
- }
+
if (init_framer()) {
printf(term_quit());
exit(1);
}
+
if (astdb_init()) {
printf(term_quit());
exit(1);
}
+
if (ast_enum_init()) {
printf(term_quit());
exit(1);
dnsmgr_start_refresh();
-#if 0
- /* This should no longer be necessary */
- /* sync cust config and reload some internals in case a custom config handler binded to them */
- read_ast_cust_config();
- reload_logger(0);
- reload_manager();
- ast_enum_reload();
- ast_rtp_reload();
-#endif
-
/* We might have the option of showing a console, but for now just
do nothing... */
if (ast_opt_console && !option_verbose)
ast_verbose(term_color(tmp, "Asterisk Ready.\n", COLOR_BRWHITE, COLOR_BLACK, sizeof(tmp)));
if (ast_opt_no_fork)
consolethread = pthread_self();
+
ast_set_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED);
pthread_sigmask(SIG_UNBLOCK, &sigs, NULL);
+
#ifdef __AST_DEBUG_MALLOC
__ast_mm_init();
#endif
+
time(&ast_startuptime);
ast_cli_register_multiple(core_cli, sizeof(core_cli) / sizeof(core_cli[0]));
+
if (ast_opt_console) {
/* Console stuff now... */
/* Register our quit function */
/*! Register a CDR driver. Each registered CDR driver generates a CDR
\return 0 on success, -1 on failure
*/
-int ast_cdr_register(char *name, char *desc, ast_cdrbe be)
+int ast_cdr_register(const char *name, const char *desc, ast_cdrbe be)
{
struct ast_cdr_beitem *i;
}
/*! unregister a CDR driver */
-void ast_cdr_unregister(char *name)
+void ast_cdr_unregister(const char *name)
{
struct ast_cdr_beitem *i = NULL;
#include "asterisk/options.h"
#include "asterisk/cli.h"
#include "asterisk/linkedlists.h"
-#define MOD_LOADER
#include "asterisk/module.h"
#include "asterisk/pbx.h"
#include "asterisk/channel.h"
return ast_complete_channels(line, word, pos, state, 3);
}
+static char *complete_mod_2_nr(const char *line, const char *word, int pos, int state)
+{
+ return ast_module_helper(line, word, pos, state, 1, 0);
+}
+
static char *complete_mod_2(const char *line, const char *word, int pos, int state)
{
return ast_module_helper(line, word, pos, state, 1, 1);
{ { "debug", "level", NULL }, handle_debuglevel, "Set global debug level", debuglevel_help },
{ { "group", "show", "channels", NULL }, group_show_channels, "Show active channels with group(s)", group_show_channels_help},
{ { "help", NULL }, handle_help, "Display help list, or specific help on a command", help_help, complete_help },
- { { "load", NULL }, handle_load, "Load a dynamic module by name", load_help, complete_fn },
+ { { "load", NULL }, handle_load, "Load a module by name", load_help, complete_fn },
{ { "logger", "mute", NULL }, handle_logger_mute, "Toggle logging output to a console", logger_mute_help },
{ { "no", "debug", "channel", NULL }, handle_nodebugchan, "Disable debugging on a channel", nodebugchan_help, complete_ch_4 },
{ { "reload", NULL }, handle_reload, "Reload configuration", reload_help, complete_mod_2 },
{ { "show", "modules", "like", NULL }, handle_modlist, "List modules and info", modlist_help, complete_mod_4 },
{ { "show", "uptime", NULL }, handle_showuptime, "Show uptime information", uptime_help },
{ { "soft", "hangup", NULL }, handle_softhangup, "Request a hangup on a given channel", softhangup_help, complete_ch_3 },
- { { "unload", NULL }, handle_unload, "Unload a dynamic module by name", unload_help, complete_fn },
+ { { "unload", NULL }, handle_unload, "Unload a module by name", unload_help, complete_mod_2_nr },
{ { NULL }, NULL, NULL, NULL }
};
clean:
rm -f $(LIBDB) $(LIBDBSO) $(OBJS) $(SHOBJS)
-CFLAGS+=-Wall -c -D__DBINTERFACE_PRIVATE -I. -I.. -Iinclude -Ihash -Ibtree -Irecno
+CFLAGS+=-Wall -D__DBINTERFACE_PRIVATE -I. -I.. -Iinclude -Ihash -Ibtree -Irecno
OSTYPE=$(shell uname -s)
ifeq ($(OSTYPE),SunOS)
#include <db.h>
-#ifndef __APPLE__
-#define dbopen __dbopen
-#endif
-
DB *
dbopen(fname, flags, mode, type, openinfo)
const char *fname;
errno = EINVAL;
return (NULL);
}
-#ifndef __APPLE__
-#undef dbopen
-#define weak_alias(original, alias) \
- asm (".weak " #alias "\n" #alias " = " #original);
-weak_alias (__dbopen, dbopen)
-#endif
static int
__dberr __P((void))
return 0;
}
-#if defined(res_ninit)
-#define HAS_RES_NINIT
-#else
+#if !HAVE_RES_NINIT
AST_MUTEX_DEFINE_STATIC(res_lock);
-#if 0
-#warning "Warning, res_ninit is missing... Could have reentrancy issues"
-#endif
#endif
/*! \brief Lookup record in DNS
const char *dname, int class, int type,
int (*callback)(void *context, unsigned char *answer, int len, unsigned char *fullanswer))
{
-#ifdef HAS_RES_NINIT
+#if HAVE_RES_NINIT
struct __res_state dnsstate;
#endif
unsigned char answer[MAX_SIZE];
int res, ret = -1;
-#ifdef HAS_RES_NINIT
-#ifdef MAKE_VALGRIND_HAPPY
- memset(&dnsstate, 0, sizeof(dnsstate));
-#endif
+#if HAVE_RES_NINIT
res_ninit(&dnsstate);
res = res_nsearch(&dnsstate, dname, class, type, answer, sizeof(answer));
#else
else
ret = 1;
}
-#ifdef HAS_RES_NINIT
+#if HAVE_RES_NINIT
res_nclose(&dnsstate);
#else
#ifndef __APPLE__
#endif
ast_mutex_unlock(&res_lock);
#endif
+
return ret;
}
#include "asterisk/app.h"
#include "asterisk/pbx.h"
#include "asterisk/linkedlists.h"
-#define MOD_LOADER
#include "asterisk/module.h"
/*
static AST_LIST_HEAD_STATIC(formats, ast_format);
-int ast_format_register(const struct ast_format *f)
+int __ast_format_register(const struct ast_format *f, struct ast_module *mod)
{
struct ast_format *tmp;
- if (f->module == NULL) {
- ast_log(LOG_WARNING, "Missing module pointer, you need to supply one\n");
- return -1;
- }
if (AST_LIST_LOCK(&formats)) {
ast_log(LOG_WARNING, "Unable to lock format list\n");
return -1;
return -1;
}
}
- tmp = ast_calloc(1, sizeof(struct ast_format));
- if (!tmp) {
+ if (!(tmp = ast_calloc(1, sizeof(*tmp)))) {
AST_LIST_UNLOCK(&formats);
return -1;
}
*tmp = *f;
+ tmp->module = mod;
if (tmp->buf_size) {
/*
* Align buf_size properly, rounding up to the machine-specific
AST_LIST_UNLOCK(&formats);
if (option_verbose > 1)
ast_verbose( VERBOSE_PREFIX_2 "Registered file format %s, extension(s) %s\n", f->name, f->exts);
+
return 0;
}
ast_log(LOG_WARNING, "Unable to rewrite format %s\n", f->name);
else {
/* preliminary checks succeed. update usecount */
- ast_atomic_fetchadd_int(&f->module->usecnt, +1);
+ ast_module_ref(f->module);
ret = 0;
- ast_update_use_count();
}
return ret;
}
fclose(f->f);
if (f->vfs)
ast_closestream(f->vfs);
- ast_atomic_fetchadd_int(&f->fmt->module->usecnt, -1);
- ast_update_use_count();
+ ast_module_unref(f->fmt->module);
free(f);
return 0;
}
--- /dev/null
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 1999 - 2006, Digium, Inc.
+ *
+ * Mark Spencer <markster@digium.com>
+ * Kevin P. Fleming <kpfleming@digium.com>
+ * Luigi Rizzo <rizzo@icir.org>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*! \file
+ *
+ * \brief Module Loader
+ * \author Mark Spencer <markster@digium.com>
+ * \author Kevin P. Fleming <kpfleming@digium.com>
+ * \author Luigi Rizzo <rizzo@icir.org>
+ * - See ModMngMnt
+ */
+
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+#include <stdio.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+
+#include "asterisk/linkedlists.h"
+#include "asterisk/module.h"
+#include "asterisk/options.h"
+#include "asterisk/config.h"
+#include "asterisk/logger.h"
+#include "asterisk/channel.h"
+#include "asterisk/term.h"
+#include "asterisk/manager.h"
+#include "asterisk/cdr.h"
+#include "asterisk/enum.h"
+#include "asterisk/rtp.h"
+#include "asterisk/http.h"
+#include "asterisk/lock.h"
+
+#ifdef DLFCNCOMPAT
+#include "asterisk/dlfcn-compat.h"
+#else
+#include <dlfcn.h>
+#endif
+
+#include "asterisk/md5.h"
+#include "asterisk/utils.h"
+
+#ifndef RTLD_NOW
+#define RTLD_NOW 0
+#endif
+
+struct ast_module_user {
+ struct ast_channel *chan;
+ AST_LIST_ENTRY(ast_module_user) entry;
+};
+
+AST_LIST_HEAD(module_user_list, ast_module_user);
+
+static unsigned char expected_key[] =
+{ 0x87, 0x76, 0x79, 0x35, 0x23, 0xea, 0x3a, 0xd3,
+ 0x25, 0x2a, 0xbb, 0x35, 0x87, 0xe4, 0x22, 0x24 };
+
+static unsigned int embedding = 1; /* we always start out by registering embedded modules,
+ since they are here before we dlopen() any
+ */
+
+enum flags {
+ FLAG_RUNNING = (1 << 1), /* module successfully initialized */
+ FLAG_DECLINED = (1 << 2), /* module declined to initialize */
+};
+
+struct ast_module {
+ const struct ast_module_info *info;
+ void *lib; /* the shared lib, or NULL if embedded */
+ int usecount; /* the number of 'users' currently in this module */
+ struct module_user_list users; /* the list of users in the module */
+ unsigned int flags; /* flags for this module */
+ AST_LIST_ENTRY(ast_module) entry;
+ char resource[0];
+};
+
+static AST_LIST_HEAD_STATIC(module_list, ast_module);
+
+struct loadupdate {
+ int (*updater)(void);
+ AST_LIST_ENTRY(loadupdate) entry;
+};
+
+static AST_LIST_HEAD_STATIC(updaters, loadupdate);
+
+AST_MUTEX_DEFINE_STATIC(reloadlock);
+
+/* when dynamic modules are being loaded, ast_module_register() will
+ need to know what filename the module was loaded from while it
+ is being registered
+*/
+struct ast_module *resource_being_loaded;
+
+/* XXX: should we check for duplicate resource names here? */
+
+void ast_module_register(const struct ast_module_info *info)
+{
+ struct ast_module *mod;
+
+ if (embedding) {
+ if (!(mod = ast_calloc(1, sizeof(*mod) + strlen(info->name) + 1)))
+ return;
+ strcpy(mod->resource, info->name);
+ } else {
+ mod = resource_being_loaded;
+ }
+
+ mod->info = info;
+ AST_LIST_HEAD_INIT(&mod->users);
+
+ /* during startup, before the loader has been initialized,
+ there are no threads, so there is no need to take the lock
+ on this list to manipulate it. it is also possible that it
+ might be unsafe to use the list lock at that point... so
+ let's avoid it altogether
+ */
+ if (!embedding)
+ AST_LIST_LOCK(&module_list);
+
+ /* it is paramount that the new entry be placed at the tail of
+ the list, otherwise the code that uses dlopen() to load
+ dynamic modules won't be able to find out if the module it
+ just opened was registered or failed to load
+ */
+ AST_LIST_INSERT_TAIL(&module_list, mod, entry);
+
+ if (!embedding)
+ AST_LIST_UNLOCK(&module_list);
+
+ /* give the module a copy of its own handle, for later use in registrations and the like */
+ *((struct ast_module **) &(info->self)) = mod;
+}
+
+void ast_module_unregister(const struct ast_module_info *info)
+{
+ struct ast_module *mod = NULL;
+
+ /* it is assumed that the users list in the module structure
+ will already be empty, or we cannot have gotten to this
+ point
+ */
+ AST_LIST_LOCK(&module_list);
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&module_list, mod, entry) {
+ if (mod->info == info) {
+ AST_LIST_REMOVE_CURRENT(&module_list, entry);
+ break;
+ }
+ }
+ AST_LIST_TRAVERSE_SAFE_END;
+ AST_LIST_UNLOCK(&module_list);
+
+ if (mod) {
+ AST_LIST_HEAD_DESTROY(&mod->users);
+ free(mod);
+ }
+}
+
+struct ast_module_user *__ast_module_user_add(struct ast_module *mod,
+ struct ast_channel *chan)
+{
+ struct ast_module_user *u = ast_calloc(1, sizeof(*u));
+
+ if (!u)
+ return NULL;
+
+ u->chan = chan;
+
+ AST_LIST_LOCK(&mod->users);
+ AST_LIST_INSERT_HEAD(&mod->users, u, entry);
+ AST_LIST_UNLOCK(&mod->users);
+
+ ast_atomic_fetchadd_int(&mod->usecount, +1);
+
+ ast_update_use_count();
+
+ return u;
+}
+
+void __ast_module_user_remove(struct ast_module *mod, struct ast_module_user *u)
+{
+ AST_LIST_LOCK(&mod->users);
+ AST_LIST_REMOVE(&mod->users, u, entry);
+ AST_LIST_UNLOCK(&mod->users);
+ ast_atomic_fetchadd_int(&mod->usecount, -1);
+ free(u);
+
+ ast_update_use_count();
+}
+
+void __ast_module_user_hangup_all(struct ast_module *mod)
+{
+ struct ast_module_user *u;
+
+ AST_LIST_LOCK(&mod->users);
+ while ((u = AST_LIST_REMOVE_HEAD(&mod->users, entry))) {
+ ast_softhangup(u->chan, AST_SOFTHANGUP_APPUNLOAD);
+ ast_atomic_fetchadd_int(&mod->usecount, -1);
+ free(u);
+ }
+ AST_LIST_UNLOCK(&mod->users);
+
+ ast_update_use_count();
+}
+
+/*! \note
+ * In addition to modules, the reload command handles some extra keywords
+ * which are listed here together with the corresponding handlers.
+ * This table is also used by the command completion code.
+ */
+static struct reload_classes {
+ const char *name;
+ int (*reload_fn)(void);
+} reload_classes[] = { /* list in alpha order, longest match first for cli completion */
+ { "cdr", ast_cdr_engine_reload },
+ { "dnsmgr", dnsmgr_reload },
+ { "extconfig", read_config_maps },
+ { "enum", ast_enum_reload },
+ { "manager", reload_manager },
+ { "rtp", ast_rtp_reload },
+ { "http", ast_http_reload },
+ { NULL, NULL }
+};
+
+static int printdigest(const unsigned char *d)
+{
+ int x, pos;
+ char buf[256]; /* large enough so we don't have to worry */
+
+ for (pos = 0, x = 0; x < 16; x++)
+ pos += sprintf(buf + pos, " %02x", *d++);
+
+ ast_log(LOG_DEBUG, "Unexpected signature:%s\n", buf);
+
+ return 0;
+}
+
+static int key_matches(const unsigned char *key1, const unsigned char *key2)
+{
+ int x;
+
+ for (x = 0; x < 16; x++) {
+ if (key1[x] != key2[x])
+ return 0;
+ }
+
+ return 1;
+}
+
+static int verify_key(const unsigned char *key)
+{
+ struct MD5Context c;
+ unsigned char digest[16];
+
+ MD5Init(&c);
+ MD5Update(&c, key, strlen((char *)key));
+ MD5Final(digest, &c);
+
+ if (key_matches(expected_key, digest))
+ return 0;
+
+ printdigest(digest);
+
+ return -1;
+}
+
+static int resource_name_match(const char *name1_in, const char *name2_in)
+{
+ char *name1 = (char *) name1_in;
+ char *name2 = (char *) name2_in;
+
+ /* trim off any .so extensions */
+ if (!strcasecmp(name1 + strlen(name1) - 3, ".so")) {
+ name1 = ast_strdupa(name1);
+ name1[strlen(name1) - 3] = '\0';
+ }
+ if (!strcasecmp(name2 + strlen(name2) - 3, ".so")) {
+ name2 = ast_strdupa(name2);
+ name2[strlen(name2) - 3] = '\0';
+ }
+
+ return strcasecmp(name1, name2);
+}
+
+static struct ast_module *find_resource(const char *resource, int do_lock)
+{
+ struct ast_module *cur;
+
+ if (do_lock)
+ AST_LIST_LOCK(&module_list);
+
+ AST_LIST_TRAVERSE(&module_list, cur, entry) {
+ if (!resource_name_match(resource, cur->resource))
+ break;
+ }
+
+ if (do_lock)
+ AST_LIST_UNLOCK(&module_list);
+
+ return cur;
+}
+
+#if LOADABLE_MODULES
+static void unload_dynamic_module(struct ast_module *mod)
+{
+ if (mod->lib)
+ dlclose(mod->lib);
+ /* WARNING: the structure pointed to by mod is now gone! */
+}
+
+static struct ast_module *load_dynamic_module(const char *resource_in, unsigned int global_symbols_only)
+{
+ char fn[256];
+ void *lib;
+ struct ast_module *mod;
+ unsigned int load_global = global_symbols_only;
+ char *resource = (char *) resource_in;
+
+ if (strcasecmp(resource + strlen(resource) - 3, ".so")) {
+ resource = alloca(strlen(resource_in) + 3);
+ strcpy(resource, resource_in);
+ strcat(resource, ".so");
+ }
+
+ snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_MODULE_DIR, resource);
+
+tryload:
+ if (!(resource_being_loaded = ast_calloc(1, sizeof(*resource_being_loaded) + strlen(resource) + 1)))
+ return NULL;
+
+ strcpy(resource_being_loaded->resource, resource);
+
+ if (load_global)
+ lib = dlopen(fn, RTLD_LAZY | RTLD_GLOBAL);
+ else
+ lib = dlopen(fn, RTLD_NOW | RTLD_LOCAL);
+
+ if (!lib) {
+ ast_log(LOG_WARNING, "%s\n", dlerror());
+ free(resource_being_loaded);
+ return NULL;
+ }
+
+ /* the dlopen() succeeded, let's find out if the module
+ registered itself */
+ /* note that this will only work properly as long as
+ ast_module_register() (which is called by the module's
+ constructor) places the new module at the tail of the
+ module_list
+ */
+ if (resource_being_loaded != (mod = AST_LIST_LAST(&module_list))) {
+ /* no, it did not, so close it and return */
+ dlclose(lib);
+ free(resource_being_loaded);
+ return NULL;
+ }
+
+ resource_being_loaded = NULL;
+ mod->lib = lib;
+
+ /* if we are being asked only to load modules that provide global symbols,
+ and this one does not, then close it and return */
+ if (load_global && !ast_test_flag(mod->info, AST_MODFLAG_GLOBAL_SYMBOLS)) {
+ unload_dynamic_module(mod);
+ return NULL;
+ }
+
+ /* if we were not asked to load _only_ modules with global symbols, but
+ this module wants to provide some, then we have to close and re-open
+ in global mode
+ */
+ if (!load_global && ast_test_flag(mod->info, AST_MODFLAG_GLOBAL_SYMBOLS)) {
+ unload_dynamic_module(mod);
+ load_global = 1;
+ goto tryload;
+ }
+
+ return mod;
+}
+#endif
+
+int ast_unload_resource(const char *resource_name, enum ast_module_unload_mode force)
+{
+ struct ast_module *mod;
+ int res = -1;
+ int error = 0;
+
+ AST_LIST_LOCK(&module_list);
+
+ mod = find_resource(resource_name, 0);
+
+ if (!ast_test_flag(mod, FLAG_RUNNING | FLAG_DECLINED))
+ error = 1;
+
+ if (!error && (mod->usecount > 0)) {
+ if (force)
+ ast_log(LOG_WARNING, "Warning: Forcing removal of module '%s' with use count %d\n",
+ resource_name, mod->usecount);
+ else {
+ ast_log(LOG_WARNING, "Soft unload failed, '%s' has use count %d\n", resource_name,
+ mod->usecount);
+ error = 1;
+ }
+ }
+
+ if (!error) {
+ __ast_module_user_hangup_all(mod);
+ res = mod->info->unload();
+
+ if (res) {
+ ast_log(LOG_WARNING, "Firm unload failed for %s\n", resource_name);
+ if (force <= AST_FORCE_FIRM)
+ error = 1;
+ else
+ ast_log(LOG_WARNING, "** Dangerous **: Unloading resource anyway, at user request\n");
+ }
+ }
+
+ if (!error)
+ ast_clear_flag(mod, FLAG_RUNNING | FLAG_DECLINED);
+
+ AST_LIST_UNLOCK(&module_list);
+
+#if LOADABLE_MODULES
+ if (!error)
+ unload_dynamic_module(mod);
+#endif
+
+ if (!error)
+ ast_update_use_count();
+
+ return res;
+}
+
+char *ast_module_helper(const char *line, const char *word, int pos, int state, int rpos, int needsreload)
+{
+ struct ast_module *cur;
+ int i, which=0, l = strlen(word);
+ char *ret = NULL;
+
+ if (pos != rpos)
+ return NULL;
+
+ AST_LIST_LOCK(&module_list);
+ AST_LIST_TRAVERSE(&module_list, cur, entry) {
+ if (!strncasecmp(word, cur->resource, l) &&
+ (cur->info->reload || !needsreload) &&
+ ++which > state) {
+ ret = strdup(cur->resource);
+ break;
+ }
+ }
+ AST_LIST_UNLOCK(&module_list);
+
+ if (!ret) {
+ for (i=0; !ret && reload_classes[i].name; i++) {
+ if (!strncasecmp(word, reload_classes[i].name, l) && ++which > state)
+ ret = strdup(reload_classes[i].name);
+ }
+ }
+
+ return ret;
+}
+
+int ast_module_reload(const char *name)
+{
+ struct ast_module *cur;
+ int res = 0; /* return value. 0 = not found, others, see below */
+ int i;
+
+ if (ast_mutex_trylock(&reloadlock)) {
+ ast_verbose("The previous reload command didn't finish yet\n");
+ return -1; /* reload already in progress */
+ }
+
+ /* Call "predefined" reload here first */
+ for (i = 0; reload_classes[i].name; i++) {
+ if (!name || !strcasecmp(name, reload_classes[i].name)) {
+ reload_classes[i].reload_fn(); /* XXX should check error ? */
+ res = 2; /* found and reloaded */
+ }
+ }
+ ast_lastreloadtime = time(NULL);
+
+ if (name && res)
+ return res;
+
+ AST_LIST_LOCK(&module_list);
+ AST_LIST_TRAVERSE(&module_list, cur, entry) {
+ const struct ast_module_info *info = cur->info;
+
+ if (name && resource_name_match(name, cur->resource))
+ continue;
+
+ if (!ast_test_flag(cur, FLAG_RUNNING | FLAG_DECLINED))
+ continue;
+
+ if (!info->reload) { /* cannot be reloaded */
+ if (res < 1) /* store result if possible */
+ res = 1; /* 1 = no reload() method */
+ continue;
+ }
+
+ res = 2;
+ if (option_verbose > 2)
+ ast_verbose(VERBOSE_PREFIX_3 "Reloading module '%s' (%s)\n", cur->resource, info->description);
+ info->reload();
+ }
+ AST_LIST_UNLOCK(&module_list);
+
+ ast_mutex_unlock(&reloadlock);
+
+ return res;
+}
+
+static unsigned int inspect_module(const struct ast_module *mod)
+{
+ if (!mod->info->description) {
+ ast_log(LOG_WARNING, "Module '%s' does not provide a description.\n", mod->resource);
+ return 1;
+ }
+
+ if (!mod->info->key) {
+ ast_log(LOG_WARNING, "Module '%s' does not provide a license key.\n", mod->resource);
+ return 1;
+ }
+
+ if (verify_key((unsigned char *) mod->info->key)) {
+ ast_log(LOG_WARNING, "Module '%s' did not provide a valid license key.\n", mod->resource);
+ return 1;
+ }
+
+ return 0;
+}
+
+static enum ast_module_load_result load_resource(const char *resource_name, unsigned int global_symbols_only)
+{
+ struct ast_module *mod;
+ enum ast_module_load_result res = AST_MODULE_LOAD_SUCCESS;
+ char tmp[256];
+
+ if ((mod = find_resource(resource_name, 0))) {
+ if (ast_test_flag(mod, FLAG_RUNNING)) {
+ ast_log(LOG_WARNING, "Module '%s' already exists.\n", resource_name);
+ return AST_MODULE_LOAD_DECLINE;
+ }
+ if (global_symbols_only && !ast_test_flag(mod->info, AST_MODFLAG_GLOBAL_SYMBOLS))
+ return AST_MODULE_LOAD_SKIP;
+#if LOADABLE_MODULES
+ } else {
+ if (!(mod = load_dynamic_module(resource_name, global_symbols_only))) {
+ /* don't generate a warning message during load_modules() */
+ if (!global_symbols_only) {
+ ast_log(LOG_WARNING, "Module '%s' could not be loaded.\n", resource_name);
+ return AST_MODULE_LOAD_DECLINE;
+ } else {
+ return AST_MODULE_LOAD_SKIP;
+ }
+ }
+#endif
+ }
+
+ if (inspect_module(mod)) {
+ ast_log(LOG_WARNING, "Module '%s' could not be loaded.\n", resource_name);
+#if LOADABLE_MODULES
+ unload_dynamic_module(mod);
+#endif
+ return AST_MODULE_LOAD_DECLINE;
+ }
+
+ ast_clear_flag(mod, FLAG_DECLINED);
+
+ if (mod->info->load)
+ res = mod->info->load();
+
+ switch (res) {
+ case AST_MODULE_LOAD_SUCCESS:
+ if (!ast_fully_booted) {
+ if (option_verbose)
+ ast_verbose( " => (%s)\n", term_color(tmp, mod->info->description, COLOR_BROWN, COLOR_BLACK, sizeof(tmp)));
+ if (ast_opt_console && !option_verbose)
+ ast_verbose( ".");
+ } else {
+ if (option_verbose)
+ ast_verbose(VERBOSE_PREFIX_1 "Loaded %s => (%s)\n", resource_name, mod->info->description);
+ }
+
+ ast_set_flag(mod, FLAG_RUNNING);
+
+ ast_update_use_count();
+ break;
+ case AST_MODULE_LOAD_DECLINE:
+ ast_set_flag(mod, FLAG_DECLINED);
+ break;
+ case AST_MODULE_LOAD_FAILURE:
+ break;
+ case AST_MODULE_LOAD_SKIP:
+ /* modules should never return this value */
+ break;
+ }
+
+ return res;
+}
+
+int ast_load_resource(const char *resource_name)
+{
+ AST_LIST_LOCK(&module_list);
+ load_resource(resource_name, 0);
+ AST_LIST_UNLOCK(&module_list);
+
+ return 0;
+}
+
+struct load_order_entry {
+ char *resource;
+ unsigned int embedded;
+ AST_LIST_ENTRY(load_order_entry) entry;
+};
+
+AST_LIST_HEAD_NOLOCK(load_order, load_order_entry);
+
+static struct load_order_entry *add_to_load_order(const char *resource, struct load_order *load_order)
+{
+ struct load_order_entry *order;
+
+ AST_LIST_TRAVERSE(load_order, order, entry) {
+ if (!resource_name_match(order->resource, resource))
+ return NULL;
+ }
+
+ if (!(order = ast_calloc(1, sizeof(*order))))
+ return NULL;
+
+ order->resource = ast_strdup(resource);
+ AST_LIST_INSERT_TAIL(load_order, order, entry);
+
+ return order;
+}
+
+int load_modules(void)
+{
+ struct ast_config *cfg;
+ struct dirent *dirent;
+ DIR *dir;
+ struct ast_module *mod;
+ struct load_order_entry *order;
+ struct ast_variable *v;
+ unsigned int load_count;
+ struct load_order load_order;
+ int res = 0;
+
+ /* all embedded modules have registered themselves by now */
+ embedding = 0;
+
+ if (option_verbose)
+ ast_verbose("Asterisk Dynamic Loader Starting:\n");
+
+ AST_LIST_TRAVERSE(&module_list, mod, entry) {
+ if (option_debug > 1)
+ ast_log(LOG_DEBUG, "Embedded module found: %s\n", mod->resource);
+ }
+
+ if (!(cfg = ast_config_load(AST_MODULE_CONFIG))) {
+ ast_log(LOG_WARNING, "No '%s' found, no modules will be loaded.\n", AST_MODULE_CONFIG);
+ return 0;
+ }
+
+ AST_LIST_HEAD_INIT_NOLOCK(&load_order);
+
+ /* first, find all the modules we have been explicitly requested to load */
+ for (v = ast_variable_browse(cfg, "modules"); v; v = v->next) {
+ if (!strcasecmp(v->name, "load"))
+ add_to_load_order(v->value, &load_order);
+ }
+
+ /* check if 'autoload' is on */
+ if (ast_true(ast_variable_retrieve(cfg, "modules", "autoload"))) {
+ /* if so, first add all the embedded modules to the load order */
+ AST_LIST_TRAVERSE(&module_list, mod, entry) {
+ order = add_to_load_order(mod->resource, &load_order);
+
+ if (order)
+ order->embedded = 1;
+ }
+
+ /* if we are allowed to load dynamic modules, scan the directory for
+ for all available modules and add them as well */
+#if LOADABLE_MODULES
+ if ((dir = opendir(ast_config_AST_MODULE_DIR))) {
+ while ((dirent = readdir(dir))) {
+ int ld = strlen(dirent->d_name);
+
+ /* Must end in .so to load it. */
+
+ if (ld < 4)
+ continue;
+
+ if (strcasecmp(dirent->d_name + ld - 3, ".so"))
+ continue;
+
+ add_to_load_order(dirent->d_name, &load_order);
+
+ }
+
+ closedir(dir);
+ } else {
+ if (!ast_opt_quiet)
+ ast_log(LOG_WARNING, "Unable to open modules directory '%s'.\n",
+ ast_config_AST_MODULE_DIR);
+ }
+#endif
+ }
+
+ /* now scan the config for any modules we are prohibited from loading and
+ remove them from the load order */
+ for (v = ast_variable_browse(cfg, "modules"); v; v = v->next) {
+ if (strcasecmp(v->name, "noload"))
+ continue;
+
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&load_order, order, entry) {
+ if (!resource_name_match(order->resource, v->value)) {
+ AST_LIST_REMOVE_CURRENT(&load_order, entry);
+ free(order->resource);
+ free(order);
+ }
+ }
+ AST_LIST_TRAVERSE_SAFE_END;
+ }
+
+ /* we are done with the config now, all the information we need is in the
+ load_order list */
+ ast_config_destroy(cfg);
+
+ load_count = 0;
+ AST_LIST_TRAVERSE(&load_order, order, entry)
+ load_count++;
+
+ ast_log(LOG_NOTICE, "%d modules will be loaded.\n", load_count);
+
+ /* first, load only modules that provide global symbols */
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&load_order, order, entry) {
+ switch (load_resource(order->resource, 1)) {
+ case AST_MODULE_LOAD_SUCCESS:
+ case AST_MODULE_LOAD_DECLINE:
+ AST_LIST_REMOVE_CURRENT(&load_order, entry);
+ free(order->resource);
+ free(order);
+ break;
+ case AST_MODULE_LOAD_FAILURE:
+ res = -1;
+ goto done;
+ case AST_MODULE_LOAD_SKIP:
+ /* try again later */
+ break;
+ }
+ }
+ AST_LIST_TRAVERSE_SAFE_END;
+
+ /* now load everything else */
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&load_order, order, entry) {
+ switch (load_resource(order->resource, 0)) {
+ case AST_MODULE_LOAD_SUCCESS:
+ case AST_MODULE_LOAD_DECLINE:
+ AST_LIST_REMOVE_CURRENT(&load_order, entry);
+ free(order->resource);
+ free(order);
+ break;
+ case AST_MODULE_LOAD_FAILURE:
+ res = -1;
+ goto done;
+ case AST_MODULE_LOAD_SKIP:
+ /* should not happen */
+ break;
+ }
+ }
+ AST_LIST_TRAVERSE_SAFE_END;
+
+done:
+ while ((order = AST_LIST_REMOVE_HEAD(&load_order, entry))) {
+ free(order->resource);
+ free(order);
+ }
+
+ return res;
+}
+
+void ast_update_use_count(void)
+{
+ /* Notify any module monitors that the use count for a
+ resource has changed */
+ struct loadupdate *m;
+
+ AST_LIST_LOCK(&module_list);
+ AST_LIST_TRAVERSE(&updaters, m, entry)
+ m->updater();
+ AST_LIST_UNLOCK(&module_list);
+}
+
+int ast_update_module_list(int (*modentry)(const char *module, const char *description, int usecnt, const char *like),
+ const char *like)
+{
+ struct ast_module *cur;
+ int unlock = -1;
+ int total_mod_loaded = 0;
+
+ if (AST_LIST_TRYLOCK(&module_list))
+ unlock = 0;
+
+ AST_LIST_TRAVERSE(&module_list, cur, entry) {
+ total_mod_loaded += modentry(cur->resource, cur->info->description, cur->usecount, like);
+ }
+
+ if (unlock)
+ AST_LIST_UNLOCK(&module_list);
+
+ return total_mod_loaded;
+}
+
+int ast_loader_register(int (*v)(void))
+{
+ struct loadupdate *tmp;
+
+ if (!(tmp = ast_malloc(sizeof(*tmp))))
+ return -1;
+
+ tmp->updater = v;
+ AST_LIST_LOCK(&module_list);
+ AST_LIST_INSERT_HEAD(&updaters, tmp, entry);
+ AST_LIST_UNLOCK(&module_list);
+
+ return 0;
+}
+
+int ast_loader_unregister(int (*v)(void))
+{
+ struct loadupdate *cur;
+
+ AST_LIST_LOCK(&module_list);
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&updaters, cur, entry) {
+ if (cur->updater == v) {
+ AST_LIST_REMOVE_CURRENT(&updaters, entry);
+ break;
+ }
+ }
+ AST_LIST_TRAVERSE_SAFE_END;
+ AST_LIST_UNLOCK(&module_list);
+
+ return cur ? 0 : -1;
+}
+
+struct ast_module *ast_module_ref(struct ast_module *mod)
+{
+ ast_atomic_fetchadd_int(&mod->usecount, +1);
+ ast_update_use_count();
+
+ return mod;
+}
+
+void ast_module_unref(struct ast_module *mod)
+{
+ ast_atomic_fetchadd_int(&mod->usecount, -1);
+ ast_update_use_count();
+}
* \author Mark Spencer <markster@digium.com>
*/
-#define MOD_LOADER /* not really a module */
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
int len;
int useplc = t->plc_samples > 0 && t->useplc; /* cache, because it can change on the fly */
char *ofs;
- struct module_symbols *ms = t->module;
/*
* compute the required size adding private descriptor,
free(pvt);
return NULL;
}
- ast_atomic_fetchadd_int(&ms->usecnt, +1);
- ast_update_use_count();
+ ast_module_ref(t->module);
return pvt;
}
static void destroy(struct ast_trans_pvt *pvt)
{
struct ast_translator *t = pvt->t;
- struct module_symbols *ms = t->module;
if (t->destroy)
t->destroy(pvt);
free(pvt);
- ast_atomic_fetchadd_int(&ms->usecnt, -1);
- ast_update_use_count();
+ ast_module_unref(t->module);
}
/*! \brief framein wrapper, deals with plc and bound checks. */
{ { "show", "translation", NULL }, show_translation, "Display translation matrix", show_trans_usage };
/*! \brief register codec translator */
-int ast_register_translator(struct ast_translator *t, void *module)
+int __ast_register_translator(struct ast_translator *t, struct ast_module *mod)
{
static int added_cli = 0;
- if (module == NULL) {
+ if (!mod) {
ast_log(LOG_WARNING, "Missing module pointer, you need to supply one\n");
return -1;
}
- t->module = module;
- if (t->buf_size == 0) {
+
+ if (!t->buf_size) {
ast_log(LOG_WARNING, "empty buf size, you need to supply one\n");
return -1;
}
+
+ t->module = mod;
if (t->plc_samples) {
if (t->buffer_samples < t->plc_samples) {
ast_log(LOG_WARNING, "plc_samples %d buffer_samples %d\n",
# dependencies in menuselect for the same package.
CC=@CC@
-HOST_CC=@CC@
+HOST_CC=cc
CXX=@CXX@
INSTALL=@INSTALL@
QTMOC=@QTMOC@
DOT=@DOT@
-CROSS_ARCH=@PBX_OSTYPE@
-CROSS_PROC=@PBX_CPU@
-PROC=@PBX_CPU@
-OSARCH=@PBX_OSTYPE@
+BUILD_PLATFORM=@BUILD_PLATFORM@
+BUILD_CPU=@BUILD_CPU@
+BUILD_VENDOR=@BUILD_VENDOR@
+BUILD_OS=@BUILD_OS@
+
+HOST_PLATFORM=@HOST_PLATFORM@
+HOST_CPU=@HOST_CPU@
+HOST_VENDOR=@HOST_VENDOR@
+HOST_OS=@HOST_OS@
+
+PROC=@HOST_CPU@
+OSARCH=@HOST_OS@
OSREV=@PBX_OSREV@
prefix = @prefix@
FREETDS_INCLUDE=@FREETDS_INCLUDE@
FREETDS_LIB=@FREETDS_LIB@
+GSM_INTERNAL=@GSM_INTERNAL@
GSM_INCLUDE=@GSM_INCLUDE@
GSM_LIB=@GSM_LIB@
ZLIB_INCLUDE=@ZLIB_INCLUDE@
ZLIB_LIB=@ZLIB_LIB@
+
+ISDNNET_INCLUDE=@ISDNNET_INCLUDE@
+ISDNNET_LIB=@ISDNNET_LIB@
+
+MISDN_INCLUDE=@MISDN_INCLUDE@
+MISDN_LIB=@MISDN_LIB@
+
+SUPPSERV_INCLUDE=@SUPPSERV_INCLUDE@
+SUPPSERV_LIB=@SUPPSERV_LIB@
# the GNU General Public License
#
-ifneq ($(wildcard ../menuselect.makeopts),)
+ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),)
include ../menuselect.makeopts
include ../menuselect.makedeps
endif
C_MODS:=$(filter-out $(MENUSELECT_PBX),$(patsubst %.c,%,$(wildcard pbx_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_PBX),$(patsubst %.cc,%,$(wildcard pbx_*.cc)))
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring pbx,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
all: _all
$(eval $(call ast_make_o_c,ael/aelbison.o,ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h))
ael/aelbison.o: CFLAGS+=-I.
-pbx_ael.so: ael/aelbison.o ael/aelflex.o
+$(pbx_ael): ael/aelbison.o ael/aelflex.o
ael/ael_lex.c:
(cd ael; flex ael.flex; sed -i -e "/begin standard C headers/i#include \"asterisk.h\"" ael_lex.c)
ael/ael.tab.c ael/ael.tab.h:
(cd ael; bison -v -d ael.y)
-$(eval $(call ast_make_o_c,dundi-parser.o,dundi-parser.c dundi-parser.h))
+dundi-parser.o: dundi-parser.h
dundi-parser.o: CFLAGS+=-I.
-pbx_dundi.so: dundi-parser.o
+$(pbx_dundi): dundi-parser.o
#define DEBUG_MACROS (1 << 2)
#define DEBUG_CONTEXTS (1 << 3)
-static int aeldebug = 0;
-
-static char *dtext = "Asterisk Extension Language Compiler v2";
static char *config = "extensions.ael";
static char *registrar = "pbx_ael";
static pval *current_db;
static pval *current_context;
static pval *current_extension;
-static const char *description(void);
-static const char *key(void);
static const char *match_context;
static const char *match_exten;
}
}
+#ifndef STANDALONE_AEL
static void ael2_semantic_check(pval *item, int *arg_errs, int *arg_warns, int *arg_notes)
{
*arg_warns = warns;
*arg_notes = notes;
}
+#endif
/* =============================================================================================== */
/* "CODE" GENERATOR -- Convert the AEL representation to asterisk extension language */
}
+#ifndef STANDALONE_AEL
+static int aeldebug = 0;
+
/* interface stuff */
static int pbx_load_module(void)
{ { "ael", "no", "debug", NULL }, ael2_no_debug, "Disable AEL debug messages"},
};
-/*
- * Standard module functions ...
- */
-static int unload_module(void *mod)
+static int unload_module(void)
{
ast_context_destroy(NULL, registrar);
ast_cli_unregister_multiple(ael_cli, sizeof(ael_cli)/ sizeof(ael_cli[0]));
return 0;
}
-
-static int load_module(void *mod)
+static int load_module(void)
{
ast_cli_register_multiple(ael_cli, sizeof(ael_cli)/ sizeof(ael_cli[0]));
return (pbx_load_module());
}
-static int reload(void *mod)
+static int reload(void)
{
ast_context_destroy(NULL, registrar);
return pbx_load_module();
}
-static const char *description(void)
-{
- return dtext;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Asterisk Extension Language Compiler",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
+#endif
/* DESTROY the PVAL tree ============================================================================ */
/*!
* Standard module functions ...
*/
-static int unload_module(void *mod)
+static int unload_module(void)
{
ast_cli_unregister(&context_add_extension_cli);
if (static_config && !write_protect_config)
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
if (pbx_load_module())
return -1;
return 0;
}
-static int reload(void *mod)
+static int reload(void)
{
if (clearglobalvars_config)
pbx_builtin_clear_globals();
return 0;
}
-static const char *description(void)
-{
- return "Text Extension Configuration";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-/* XXX really no usecount ? */
-STD_MOD(MOD_1 | NO_USECOUNT, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Text Extension Configuration",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
static struct ast_cli_entry cli_queryeid =
{ { "dundi", "query", NULL }, dundi_do_query, "Query a DUNDi EID", query_usage };
-LOCAL_USER_DECL;
-
static struct dundi_transaction *create_transaction(struct dundi_peer *p)
{
struct dundi_transaction *trans;
int results;
int x;
int bypass = 0;
- struct localuser *u;
+ struct ast_module_user *u;
struct dundi_result dr[MAX_RESULTS];
buf[0] = '\0';
return -1;
}
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
context = strchr(num, '|');
if (context) {
}
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
ast_cli_unregister(&cli_debug);
ast_cli_unregister(&cli_store_history);
return 0;
}
-static int reload(void *mod)
+static int reload(void)
{
struct sockaddr_in sin;
set_config("dundi.conf",&sin);
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
struct sockaddr_in sin;
- __mod_desc = mod;
dundi_set_output(dundi_debug_output);
dundi_set_error(dundi_error_output);
return res;
}
-static const char *description(void)
-{
- return "Distributed Universal Number Discovery (DUNDi)";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT | NO_UNLOAD, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Distributed Universal Number Discovery (DUNDi)",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
static struct ast_switch loopback_switch =
{
name: "Loopback",
- description: "Loopback Dialplan Switch",
+ description: "Loopback Dialplan Switch",
exists: loopback_exists,
canmatch: loopback_canmatch,
exec: loopback_exec,
matchmore: loopback_matchmore,
};
-static const char *description(void)
-{
- return "Loopback Switch";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
ast_unregister_switch(&loopback_switch);
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
ast_register_switch(&loopback_switch);
return 0;
}
-/* XXX really no unload ? */
-STD_MOD(MOD_1 | NO_USECOUNT | NO_UNLOAD, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Loopback Switch");
static struct ast_switch realtime_switch =
{
name: "Realtime",
- description: "Realtime Dialplan Switch",
+ description: "Realtime Dialplan Switch",
exists: realtime_exists,
canmatch: realtime_canmatch,
exec: realtime_exec,
matchmore: realtime_matchmore,
};
-static const char *description(void)
-{
- return "Realtime Switch";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static int unload_module(void *mod)
+static int unload_module(void)
{
ast_unregister_switch(&realtime_switch);
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
ast_register_switch(&realtime_switch);
return 0;
}
-STD_MOD(MOD_1 | NO_USECOUNT | NO_UNLOAD, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Realtime Switch");
return NULL;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return -1;
}
-static int load_module(void *mod)
+static int load_module(void)
{
pthread_t thread;
pthread_attr_t attr;
return 0;
}
-static const char *description(void)
-{
- return "Outgoing Spool Support";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT | NO_UNLOAD, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Outgoing Spool Support");
# the GNU General Public License
#
-ifneq ($(wildcard ../menuselect.makeopts),)
+ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),)
include ../menuselect.makeopts
include ../menuselect.makedeps
endif
C_MODS:=$(filter-out $(MENUSELECT_RES),$(patsubst %.c,%,$(wildcard res_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_RES),$(patsubst %.cc,%,$(wildcard res_*.cc)))
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring res,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
all: _all
include $(ASTTOPDIR)/Makefile.moddir_rules
-res_snmp.so: snmp/agent.o
+$(res_snmp): snmp/agent.o
clean::
rm -f snmp/*.o
}
}
-static int reload(void *mod)
+static int reload(void)
{
adsi_load();
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
adsi_load();
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
/* Can't unload this once we're loaded */
return -1;
}
-static const char *description(void)
-{
- return "ADSI Resource";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0 | NO_USECOUNT | NO_UNLOAD, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "ADSI Resource",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
static int agidebug = 0;
-struct module_symbols *me;
-
#define TONE_BLOCK_SIZE 200
/* Max time to connect to an AGI remote host */
static int agi_exec_full(struct ast_channel *chan, void *data, int enhanced, int dead)
{
enum agi_result res;
- struct localuser *u;
+ struct ast_module_user *u;
char *argv[MAX_ARGS];
char buf[2048]="";
char *tmp = (char *)buf;
argv[argc++] = stringp;
argv[argc] = NULL;
- u = ast_localuser_add(me, chan);
+ u = ast_module_user_add(chan);
#if 0
/* Answer if need be */
if (chan->_state != AST_STATE_UP) {
close(efd);
ast_unreplace_sigchld();
}
- ast_localuser_remove(me, u);
+ ast_module_user_remove(u);
switch (res) {
case AGI_RESULT_SUCCESS:
static struct ast_cli_entry dumpagihtml =
{ { "dump", "agihtml", NULL }, handle_dumpagihtml, "Dumps a list of agi command in html format", dumpagihtml_help };
-static int unload_module(void *mod)
+static int unload_module(void)
{
- ast_hangup_localusers(mod);
+ ast_module_user_hangup_all();
ast_cli_unregister(&showagi);
ast_cli_unregister(&dumpagihtml);
ast_cli_unregister(&cli_debug);
return ast_unregister_application(app);
}
-static int load_module(void *mod)
+static int load_module(void)
{
- me = mod;
ast_cli_register(&showagi);
ast_cli_register(&dumpagihtml);
ast_cli_register(&cli_debug);
return ast_register_application(app, agi_exec, synopsis, descrip);
}
-static const char *description(void)
-{
- return "Asterisk Gateway Interface (AGI)";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Asterisk Gateway Interface (AGI)");
/*! The timeout for originated calls, in seconds */
#define TIMEOUT 30
-static struct module_symbols *me;
-
static char orig_help[] =
" There are two ways to use this command. A call can be originated between a\n"
"channel and a specific application, or between a channel and an extension in\n"
if (ast_strlen_zero(argv[1]) || ast_strlen_zero(argv[2]))
return RESULT_SHOWUSAGE;
- ast_atomic_fetchadd_int(&me->usecnt, +1);
+ /* ugly, can be removed when CLI entries have ast_module pointers */
+ ast_module_ref(ast_module_info->self);
if (!strcasecmp("application", argv[2])) {
res = orig_app(fd, argv[1], argv[3], argv[4]);
} else
res = RESULT_SHOWUSAGE;
- ast_atomic_fetchadd_int(&me->usecnt, -1);
+ ast_module_unref(ast_module_info->self);
return res;
}
if (pos != 2)
return NULL;
- ast_atomic_fetchadd_int(&me->usecnt, +1);
+ /* ugly, can be removed when CLI entries have ast_module pointers */
+ ast_module_ref(ast_module_info->self);
ret = ast_cli_complete(word, choices, state);
- ast_atomic_fetchadd_int(&me->usecnt, -1);
+ ast_module_unref(ast_module_info->self);
return ret;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_cli_unregister(&cli_orig);
}
-static int load_module(void *mod)
+static int load_module(void)
{
- me = mod;
return ast_cli_register(&cli_orig);
}
-static const char *description(void)
-{
- return "Call origination from the CLI";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Call origination from the CLI");
#include "asterisk/res_odbc.h"
#include "asterisk/utils.h"
-LOCAL_USER_DECL;
-
static struct ast_variable *realtime_odbc(const char *database, const char *table, va_list ap)
{
struct odbc_obj *obj;
.update_func = update_odbc
};
-static int unload_module (void *mod)
+static int unload_module (void)
{
- ast_hangup_localusers(mod);
+ ast_module_user_hangup_all();
ast_config_engine_deregister(&odbc_engine);
if (option_verbose)
ast_verbose("res_config_odbc unloaded.\n");
return 0;
}
-static int load_module (void *mod)
+static int load_module (void)
{
ast_config_engine_register(&odbc_engine);
if (option_verbose)
return 0;
}
-static const char *description(void)
-{
- return "ODBC Configuration";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0 | NO_USECOUNT | NO_UNLOAD, NULL, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "ODBC Configuration",
+ .load = load_module,
+ .unload = unload_module,
+ );
static int pgsql_reconnect(const char *database);
static int realtime_pgsql_status(int fd, int argc, char **argv);
-LOCAL_USER_DECL;
-
static char cli_realtime_pgsql_status_usage[] =
"Usage: realtime pgsql status\n"
" Shows connection information for the Postgresql RealTime driver\n";
.update_func = update_pgsql
};
-static int load_module(void *mod)
+static int load_module(void)
{
parse_config();
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
/* Aquire control before doing anything to the module itself. */
ast_mutex_lock(&pgsql_lock);
ast_verbose("Postgresql RealTime unloaded.\n");
}
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
/* Unlock so something else can destroy the lock. */
ast_mutex_unlock(&pgsql_lock);
return 0;
}
-static int reload(void *mod)
+static int reload(void)
{
/* Aquire control before doing anything to the module itself. */
ast_mutex_lock(&pgsql_lock);
return 1;
}
-static const char *description(void)
-{
- return "Postgresql RealTime Configuration Driver";
-
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
static int pgsql_reconnect(const char *database)
{
char my_database[50];
}
}
-STD_MOD(MOD_0, reload, NULL, NULL);
+/* needs usecount semantics defined */
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "PostgreSQL RealTime Configuration Driver",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload
+ );
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 2005, Digium, Inc.
+ * Copyright (C) 2005, 2006, Digium, Inc.
*
* redice li <redice_li@yahoo.com>
* Russell Bryant <russell@digium.com>
#include "asterisk/cli.h"
#include "asterisk/file.h"
-struct module_symbols *me;
-
/*! \brief Split the filename to basename and extension */
static int split_ext(char *filename, char **name, char **ext)
{
char *file_in = NULL, *file_out = NULL;
char *name_in, *ext_in, *name_out, *ext_out;
- ast_atomic_fetchadd_int(&me->usecnt, +1);
-
+ /* ugly, can be removed when CLI entries have ast_module pointers */
+ ast_module_ref(ast_module_info->self);
+
if (argc != 3 || ast_strlen_zero(argv[1]) || ast_strlen_zero(argv[2])) {
ret = RESULT_SHOWUSAGE;
goto fail_out;
if (fs_in)
ast_closestream(fs_in);
- ast_atomic_fetchadd_int(&me->usecnt, -1);
-
+ ast_module_unref(ast_module_info->self);
+
return ret;
}
{ "convert" , NULL }, cli_audio_convert, "Convert audio files", usage_audio_convert
};
-static int unload_module(void *mod)
+static int unload_module(void)
{
return ast_cli_unregister(&audio_convert_cli);
}
-static int load_module(void *mod)
+static int load_module(void)
{
- me = mod;
return ast_cli_register(&audio_convert_cli);
}
-static const char *description(void)
-{
- return "File format conversion CLI command";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "File format conversion CLI command");
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
return 0;
}
-static int reload(void *mod)
+static int reload(void)
{
crypto_load(-1, -1);
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
crypto_init();
if (ast_opt_init_keys)
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
/* Can't unload this once we're loaded */
return -1;
}
-static const char *description(void)
-{
- return "Cryptographic Digital Signatures";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0 | NO_USECOUNT | NO_UNLOAD, reload, NULL, NULL);
-
+/* needs usecount semantics defined */
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Cryptographic Digital Signatures",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload
+ );
{
struct ast_channel *parker;
struct ast_channel *parkee;
+ int res = 0;
+ struct ast_module_user *u;
- int res=0;
- struct localuser *u;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
set_peers(&parker, &parkee, peer, chan, sense);
/* Setup the exten/priority to be s/1 since we don't know
res = ast_safe_sleep(chan, 1000);
if (!res)
res = ast_park_call(parkee, parker, 0, NULL);
- LOCAL_USER_REMOVE(u);
+
+ ast_module_user_remove(u);
+
if (!res) {
if (sense == FEATURE_SENSE_CHAN)
res = AST_PBX_NO_HANGUP_PEER;
{
/* Data is unused at the moment but could contain a parking
lot context eventually */
- int res=0;
- struct localuser *u;
- LOCAL_USER_ADD(u);
+ int res = 0;
+ struct ast_module_user *u;
+
+ u = ast_module_user_add(chan);
+
/* Setup the exten/priority to be s/1 since we don't know
where this call should return */
strcpy(chan->exten, "s");
/* Park the call */
if (!res)
res = ast_park_call(chan, chan, 0, NULL);
- LOCAL_USER_REMOVE(u);
- if (!res)
- res = AST_PBX_KEEPALIVE;
- return res;
+
+ ast_module_user_remove(u);
+
+ return !res ? AST_PBX_KEEPALIVE : res;
}
/*! \brief Pickup parked call */
static int park_exec(struct ast_channel *chan, void *data)
{
- int res=0;
- struct localuser *u;
+ int res = 0;
+ struct ast_module_user *u;
struct ast_channel *peer=NULL;
struct parkeduser *pu, *pl=NULL;
struct ast_context *con;
ast_log(LOG_WARNING, "Parkedcall requires an argument (extension number)\n");
return -1;
}
- LOCAL_USER_ADD(u);
+
+ u = ast_module_user_add(chan);
+
park = atoi((char *)data);
ast_mutex_lock(&parking_lock);
pu = parkinglot;
ast_verbose(VERBOSE_PREFIX_3 "Channel %s tried to talk to nonexistent parked call %d\n", chan->name, park);
res = -1;
}
- LOCAL_USER_REMOVE(u);
+
+ ast_module_user_remove(u);
+
return res;
}
}
-static int reload(void *mod)
+static int reload(void)
{
return load_config();
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
- __mod_desc = mod;
memset(parking_ext, 0, sizeof(parking_ext));
memset(parking_con, 0, sizeof(parking_con));
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
- STANDARD_HANGUP_LOCALUSERS;
+ ast_module_user_hangup_all();
ast_manager_unregister("ParkedCalls");
ast_manager_unregister("Park");
return ast_unregister_application(parkedcall);
}
-static const char *description(void)
-{
- return "Call Features Resource";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0 | NO_UNLOAD, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Call Features Resource",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
/*
* Standard module functions ...
*/
-static int unload_module(void *mod)
+static int unload_module(void)
{
/* remove the registed indications... */
ast_unregister_indication_country(NULL);
}
-static int load_module(void *mod)
+static int load_module(void)
{
if (ind_load_module())
return -1;
return 0;
}
-static int reload(void *mod)
+static int reload(void)
{
/* remove the registed indications... */
ast_unregister_indication_country(NULL);
return ind_load_module();
}
-static const char *description(void)
-{
- return "Indications Configuration";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0 | NO_USECOUNT, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Indications Resource",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
{{ "jabber", "test", NULL}, aji_test, "Shows roster, but is genearlly used for mog's debugging.", test_usage },
};
-static const char *tdesc = "AJI - Asterisk Jabber Interface";
-
static char *app_ajisend = "JabberSend";
static char *ajisend_synopsis = "JabberSend(jabber,screenname,message)";
}
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
ast_cli_unregister_multiple(aji_cli, sizeof(aji_cli) / sizeof(aji_cli[0]));
ast_unregister_application(app_ajisend);
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
ASTOBJ_CONTAINER_INIT(&clients);
aji_reload();
return 0;
}
-static int reload(void *mod)
+static int reload(void)
{
aji_reload();
return 0;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "AJI - Asterisk Jabber Interface",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
}
-static int load_module(void *mod)
+static int load_module(void)
{
ast_register_application("Monitor", start_monitor_exec, monitor_synopsis, monitor_descrip);
ast_register_application("StopMonitor", stop_monitor_exec, stopmonitor_synopsis, stopmonitor_descrip);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
ast_unregister_application("Monitor");
ast_unregister_application("StopMonitor");
return 0;
}
-static const char *description(void)
-{
- return "Call Monitoring Resource";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0 | NO_USECOUNT | NO_UNLOAD, NULL, NULL, NULL); /* MOD_0 because it exports some symbols */
+/* usecount semantics need to be defined */
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Call Monitoring Resource",
+ .load = load_module,
+ .unload = unload_module,
+ );
return 1;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
return 0;
}
-static int reload(void *mod)
+static int reload(void)
{
if (init_classes(1))
ast_install_music_functions(local_ast_moh_start, local_ast_moh_stop, local_ast_moh_cleanup);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return -1;
}
-static const char *description(void)
-{
- return "Music On Hold Resource";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0 | NO_USECOUNT | NO_UNLOAD, reload, NULL, NULL);
-
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Music On Hold Resource",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
return ODBC_SUCCESS;
}
-LOCAL_USER_DECL;
-
-static int reload(void *mod)
+static int reload(void)
{
static char *cfg = "res_odbc.conf";
struct ast_config *config;
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
/* Prohibit unloading */
return -1;
}
-static int load_module(void *mod)
+static int load_module(void)
{
load_odbc_config();
ast_cli_register(&odbc_show_struct);
return 0;
}
-static const char *description(void)
-{
- return "ODBC Resource";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "ODBC Resource",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
ASTOBJ_CONTAINER_DESTROY(&iface->mwi_q);
free(iface);
- ast_atomic_fetchadd_int(&me->usecnt, -1);
+ ast_module_unref(ast_module_info->self);
}
/*!
ASTOBJ_CONTAINER_LINK(&smdi_ifaces, iface);
ASTOBJ_UNREF(iface, ast_smdi_interface_destroy);
- ast_atomic_fetchadd_int(&me->usecnt, +1);
+ ast_module_ref(ast_module_info->self);
} else {
ast_log(LOG_NOTICE, "Ignoring unknown option %s in %s\n", v->name, config_file);
}
return res;
}
-
-static const char *description(void)
-{
- return "Asterisk Simplified Message Desk Interface (SMDI) Module";
-}
-
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
- me = mod;
/* initialize our containers */
memset(&smdi_ifaces, 0, sizeof(smdi_ifaces));
ASTOBJ_CONTAINER_INIT(&smdi_ifaces);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
/* this destructor stops any running smdi_read threads */
ASTOBJ_CONTAINER_DESTROYALL(&smdi_ifaces, ast_smdi_interface_destroy);
return 0;
}
-static int reload(void *mod)
+static int reload(void)
{
int res;
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Simplified Message Desk Interface (SMDI) Resource",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
load_config();
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
ast_verbose(VERBOSE_PREFIX_1 "Unloading [Sub]Agent Module\n");
return pthread_join(thread, NULL);
}
-static int reload(void *mod)
+static int reload(void)
{
ast_verbose(VERBOSE_PREFIX_1 "Reloading [Sub]Agent Module\n");
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return MODULE_DESCRIPTION;
-}
-
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "SNMP [Sub]Agent for Asterisk",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
/* We can not be unloaded */
return -1;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
return res;
}
-static const char *description(void)
-{
- return "Generic Speech Recognition API";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0 | NO_USECOUNT | NO_UNLOAD, NULL, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Generic Speech Recognition API",
+ .load = load_module,
+ .unload = unload_module,
+ );
+++ /dev/null
-;Sound Files and Sound Scripts
-
-;Note: All .gsm files are in the following format: 8.000 kHz, Mono 1 kb/sec
-
-;sounds directory - File Name Sound File Script
-
-%agent-alreadyon.gsm%That agent is already logged on. Please enter your agent number followed by the pound key.
-
-%agent-incorrect.gsm%Login incorrect. Please enter your agent number followed by the pound key.
-
-%agent-newlocation.gsm%Please enter a new extension, followed by pound.
-
-%agent-loggedoff.gsm%Agent Logged off.
-
-%agent-loginok.gsm%Agent logged in.
-
-%agent-pass.gsm%Please enter your password followed by the pound key.
-
-%agent-user.gsm%Agent login. Please enter your agent number followed by the pound key.
-
-%auth-incorrect.gsm%Password incorrect. Please enter your password followed by the pound key.
-
-%auth-thankyou.gsm%Thank you.
-
-%beep.gsm%[this is a simple beep tone]
-
-%beeperr.gsm%[this is an error beep tone]
-
-%conf-hasleft.gsm%has left the conference.
-
-%conf-hasjoin.gsm%is now in the conference.
-
-%conf-getconfno.gsm%Please enter your conference number followed by the pound key.
-
-%conf-getchannel.gsm%Please enter the channel number followed by the pound key.
-
-%conf-getpin.gsm%Please enter the conference pin number.
-
-%conf-invalid.gsm%That is not a valid conference number. Please try again.
-
-%conf-invalidpin.gsm%That pin is invalid for this conference.
-
-%conf-onlyperson.gsm%You are currently the only person in this conference.
-
-%conf-noempty.gsm%No empty conferences currently exist.
-
-%conf-enteringno.gsm%You are entering conference number
-
-%demo-abouttotry.gsm%I am about to attempt an Inter-Asterisk Exchange connection to a demonstration server located at Digium. In order for this to work you must already be connected to the Internet. Please wait a moment while I attempt to make the connection.
-
-%demo-congrats.gsm%Congratulations. You have successfully installed and executed the Asterisk open source PBX. You have also installed a set of sample sounds and configuration files that should help you to get started. Like a normal PBX you will navigate this demonstration by dialing digits. If you are using a console channel driver instead of a real phone you can use the dial, answer, and hang up commands to simulate the actions of a standard telephone.
-
-%demo-echodone.gsm%The echo test has been completed.
-
-%demo-echotest.gsm%You are about to enter an echo test. In this mode everything you say will be repeated back to you just as soon as it is received. The purpose of this test is to give you an audible sense of the latency between you and the machine that is running the echo test application. You may end the test by hanging up or by pressing the pound key.
-
-%demo-enterkeywords.gsm%Please enter one or more keywords separated by * and then press the pound key.
-
-%demo-nomatch.gsm%I'm sorry there are no matches for those keywords
-
-%demo-instruct.gsm%If you would like to learn more technical information about Asterisk dial 2 now. If you'd like to test out the voice over IP capabilities of Asterisk you can dial 500 to attempt an Inter-Asterisk Exchange or IAX connection to a demonstration server at Digium. In order for this test to work you will need to be connected to the Internet and have at least a 28.8 kilobit modem. To execute an echo test dial 600. This test is most useful when you have connected to this Asterisk server from a remote location. The sample configuration also has a single user with extension 1234 and password 4242. That user is configured to ring the console when their extension is dialed. If you dial 1234 you can try to ring the console. If the console is busy or unavailable you will be given the option to leave voicemail. To check voice mail for the user dial extension 8500 to enter the voicemail system. Finally, you can press the pound key to disconnect from the PBX.
-
-%demo-moreinfo.gsm%Asterisk is an Open Source full-featured PBX and IVR platform that runs on the linux operating system. For more information, visit www.asterisk.org.
-
-%demo-nogo.gsm%I am afraid I was unable to create a connection to the Digium demonstration Asterisk server. You may find some helpful debugging information on the Asterisk console.
-
-%demo-thanks.gsm%Goodbye. Thank you for trying out the Asterisk Open Source PBX.
-
-%dir-instr.gsm%If this is the person you are looking for press 1 now, otherwise please press star now.
-
-%dir-intro.gsm%Welcome to the directory. Please enter the first three letters of your party's last name using your touch tone keypad. Use the 7 key for Q and the 9 key for Z.
-
-%dir-intro-fn.gsm%Welcome to the directory. Please enter the first three letters of your party's first name using your touch tone keypad. Use the 7 key for Q and the 9 key for Z.
-
-%dir-nomatch.gsm%No directory entries match your search.
-
-%dir-nomore.gsm%There are no more compatible entries in the directory.
-
-%hello-world.gsm%Hello world.
-
-%invalid.gsm%I am sorry, that's not a valid extension. Please try again.
-
-%pbx-invalid.gsm%I am sorry, that's not a valid extension. Please try again.
-
-%pbx-invalidpark.gsm%I am sorry, there is no call parked on that extension. Please try again.
-
-%pbx-transfer.gsm%Transfer.
-
-%queue-periodic-announce.gsm%All of our represenatives are currently busy. Please stay on the line and your call will be answered by the next available representative.
-
-%queue-callswaiting.gsm%Waiting to speak with a representative
-
-%queue-holdtime.gsm%The estimated hold time is currently
-
-%queue-reporthold.gsm%Hold time
-
-%queue-minutes.gsm%Minutes
-
-%queue-seconds.gsm%Seconds
-
-%queue-thankyou.gsm%Thank you for your patience
-
-%queue-thereare.gsm%You are currently caller number
-
-%queue-youarenext.gsm%Your call is now first in line and will be answered by the next available representative.
-
-%ss-noservice.gsm%The number you have dialed is not in service. Please check the number and try again.
-
-%transfer.gsm%Please hold while I try that extension.
-
-%vm-forward.gsm%Press 1 to enter an extension, press 2 to use the directory
-
-%vm-Cust1.gsm%folder 5
-
-%vm-Cust2.gsm%folder 6
-
-%vm-Cust3.gsm%folder 7
-
-%vm-Cust4.gsm%folder 8
-
-%vm-Cust5.gsm%folder 9
-
-%vm-and.gsm%and
-
-%vm-changeto.gsm%Change to which folder?
-
-%vm-delete.gsm%Press 7 to delete this message.
-
-%vm-deleted.gsm%Message deleted.
-
-%vm-extension.gsm%extension
-
-%vm-Family.gsm%family
-
-%vm-first.gsm%first
-
-%vm-for.gsm%for
-
-%vm-Friends.gsm%friends
-
-%vm-goodbye.gsm%Goodbye
-
-%vm-helpexit.gsm%Press star for help or pound to exit.
-
-%vm-INBOX.gsm%new
-
-%vm-minutes.gsm%minutes
-
-%vm-incorrect-mailbox.gsm%Login incorrect. Mailbox?
-
-%vm-incorrect.gsm%Login incorrect.
-
-%vm-instructions.gsm%To look into your messages press 1 now. You may quit voicemail at any time by pressing the pound key.
-
-%vm-intro.gsm%Please leave your message after the tone. When done hang up or press the pound key. (simple tone sound plays)
-
-%vm-isonphone.gsm%is on the phone
-
-%vm-isunavail.gsm%is unavailable
-
-%vm-last.gsm%last
-
-%vm-login.gsm%Comedian Mail. Mailbox?
-
-%vm-message.gsm%message
-
-%vm-messages.gsm%messages
-
-%vm-mismatch.gsm%The passwords you entered and re-entered did not match. Please try again.
-
-%vm-msginstruct.gsm%To hear the next message press 6, to repeat this message press 5, to hear the previous message press 4, to delete or undelete this message press zero, to quit voicemail press pound.
-
-%vm-msgsaved.gsm%Your message has been saved.
-
-%vm-newpassword.gsm%Please enter your new password followed by the pound key.
-
-%vm-next.gsm%Press 6 to play the next message.
-
-%vm-no.gsm%no
-
-%vm-nobodyavail.gsm%Nobody is available to take your call at the moment
-
-%vm-nomore.gsm%No more messages.
-
-%vm-Old.gsm%old
-
-%vm-onefor.gsm%Press 1 for
-
-%vm-options.gsm%Press 1 to record your unavailable message, press 2 to record your busy message, press 3 to record your name, press 4 to record your temporary greeting, press 5 to change your password, press star to return to the main menu.
-
-%vm-opts.gsm%Press 2 to change folders, press 3 for advanced options, press zero for mailbox options.
-
-%vm-passchanged.gsm%Your passwords have been changed.
-
-%vm-password.gsm%password
-
-%vm-press.gsm%press
-
-%vm-prev.gsm%Press 4 for the previous message
-
-%vm-rec-busy.gsm%After the tone say your busy message and then press the pound key.
-
-%vm-rec-name.gsm%After the tone say your name and then press the pound key.
-
-%vm-rec-unv.gsm%After the tone say your unavailable message and then press the pound key.
-
-%vm-rec-temp.gsm%After the tone, say your temporary message, and then press the pound key.
-
-%vm-reenterpassword.gsm%Please re-enter your password followed by the pound key.
-
-%vm-repeat.gsm%Press 5 to repeat the current message.
-
-%vm-saved.gsm%saved
-
-%vm-savedto.gsm%saved to
-
-%vm-savefolder.gsm%Which folder should I save the message to?
-
-%vm-savemessage.gsm%or 9 to save this message
-
-%vm-sorry.gsm%I'm sorry I did not understand your response.
-
-%vm-tempgreetactive.gsm%Your temporary greeting is currently active
-
-%vm-tempgreeting.gsm%press 1 to record your temporary greeting
-
-%vm-tempgreeting2.gsm%press 1 to record your temporary greeting, or press 2 to erase your temporary greeting
-
-%vm-tempremoved.gsm%Your temporary greeting has been removed
-
-%vm-theperson.gsm%The person at extension
-
-%vm-tocancel.gsm%or pound to cancel.
-
-%vm-toforward.gsm%Press 8 to forward the message to another user
-
-%vm-undelete.gsm%Press 7 to undelete this message
-
-%vm-undeleted.gsm%Message undeleted.
-
-%vm-whichbox.gsm%To leave a message, please enter a mailbox number.
-
-%vm-Work.gsm%work
-
-%vm-youhave.gsm%you have
-
-%vm-newuser.gsm%Welcome to Comedian Mail. First, I will guide you through a short setup process.
-
-%priv-callee-options.gsm%Dial 1 if you wish this caller to reach you directly now, and in the future. Dial 2 if you wish to send this caller to voicemail now and forevermore. Dial 3 to send this caller to the torture menus, now and forevermore. Dial 4 to send this caller to a polite "don't call" menu, now and forevermore. Dial 5 to allow this caller to come straight thru to you in the future, but just this once, send them to voicemail.
-
-%screen-callee-options.gsm%You have these options: Dial 1 if you wish to immediately connect to the incoming call. Dial 2 if you wish to send this caller to voicemail. Dial 3 to send this caller to the torture menus. Dial 4 to send this caller to a polite "don't call" menu.
-
-%priv-introsaved.gsm%Thank you. Please hold, while I attempt to connect you with your party!
-
-%priv-recordintro.gsm%At the tone, please say your name.
-
-%priv-callpending.gsm%I have a caller waiting, who introduces themselves as:
-
-%privacy-unident.gsm%The party you are trying to reach does not accept unidentified calls.
-
-%privacy-prompt.gsm%Please enter your phone number, starting with the area code.
-
-%privacy-incorrect.gsm%I'm sorry, that number is not valid.
-
-%privacy-thankyou.gsm%Thank you.
-
-%tt-allbusy.gsm%All representatives of the household are currently assisting other telemarketers. Please hold and your call will be answered in the order it was received.
-
-%tt-monkeysintro.gsm%They have been carried away by monkeys
-
-%tt-monkeys.gsm%[sound of monkeys screaming]
-
-%tt-somethingwrong.gsm%Something is terribly wrong
-
-%tt-weasels.gsm%Weasels have eaten our phone system
-
-;dictate directory - app_dictate
-
-%both_help.gsm%press * to toggle pause, press # to enter a new dictation filename
-
-%enter_filename.gsm%Enter a numeric dictation filename followed by # or just # to exit
-
-%forhelp.gsm%press 0 for help
-
-%pause.gsm%pause
-
-%paused.gsm%paused
-
-%play_help.gsm%press 1 to switch to record mode, press 2 to toggle fast playback, press 7 to jump backwards, press 8 to jump forwards
-
-%playback.gsm%playback
-
-%playback_mode.gsm%playback mode
-
-%record.gsm%record
-
-%record_help.gsm%press 1 to switch to playback mode, press 8 to truncate the file and start over
-
-%record_mode.gsm%record mode
-
-%truncating_audio.gsm%truncating audio
-
-;digits directory - File Name Sound File Script
-
-%minus.gsm%minus
-
-%0.gsm%zero
-
-%1.gsm%one
-
-%2.gsm%two
-
-%3.gsm%three
-
-%4.gsm%four
-
-%5.gsm%five
-
-%6.gsm%six
-
-%7.gsm%seven
-
-%8.gsm%eight
-
-%9.gsm%nine
-
-%10.gsm%ten
-
-%11.gsm%eleven
-
-%12.gsm%twelve
-
-%13.gsm%thirteen
-
-%14.gsm%fourteen
-
-%15.gsm%fifteen
-
-%16.gsm%sixteen
-
-%17.gsm%seventeen
-
-%18.gsm%eighteen
-
-%19.gsm%nineteen
-
-%20.gsm%twenty
-
-%30.gsm%thirty
-
-%40.gsm%forty
-
-%50.gsm%fifty
-
-%60.gsm%sixty
-
-%70.gsm%seventy
-
-%80.gsm%eighty
-
-%90.gsm%ninety
-
-%a-m.gsm%A.M.
-
-%day-0.gsm%Sunday
-
-%day-1.gsm%Monday
-
-%day-2.gsm%Tuesday
-
-%day-3.gsm%Wednesday
-
-%day-4.gsm%Thursday
-
-%day-5.gsm%Friday
-
-%day-6.gsm%Saturday
-
-%dollars.gsm%dollars
-
-%hundred.gsm%hundred
-
-%million.gsm%million
-
-%mon-0.gsm%January
-
-%mon-1.gsm%February
-
-%mon-2.gsm%March
-
-%mon-3.gsm%April
-
-%mon-4.gsm%May
-
-%mon-5.gsm%June
-
-%mon-6.gsm%July
-
-%mon-7.gsm%August
-
-%mon-8.gsm%September
-
-%mon-9.gsm%October
-
-%mon-10.gsm%November
-
-%mon-11.gsm%December
-
-%oclock.gsm%o'clock
-
-%oh.gsm%oh
-
-%p-m.gsm%P.M.
-
-%pound.gsm%pound
-
-%seconds.gsm%seconds
-
-%star.gsm%star
-
-%thousand.gsm%thousand
-
-%h-1.gsm%first
-
-%h-2.gsm%second
-
-%h-3.gsm%third
-
-%h-4.gsm%fourth
-
-%h-5.gsm%fifth
-
-%h-6.gsm%sixth
-
-%h-7.gsm%seventh
-
-%h-8.gsm%eighth
-
-%h-9.gsm%ninth
-
-%h-10.gsm%tenth
-
-%h-11.gsm%eleventh
-
-%h-12.gsm%twelfth
-
-%h-13.gsm%thirteenth
-
-%h-14.gsm%fourteenth
-
-%h-15.gsm%fifteenth
-
-%h-16.gsm%sixteenth
-
-%h-17.gsm%seventeenth
-
-%h-18.gsm%eighteenth
-
-%h-19.gsm%nineteenth
-
-%h-20.gsm%twentieth
-
-%h-30.gsm%thirtieth
-
-%today.gsm%today
-
-%tomorrow.gsm%tomorrow
-
-%yesterday.gsm%yesterday
-
-%vm-received.gsm%received
-
-%hours.gsm%hours
-
-%minutes.gsm%minutes
-
-%vm-forwardoptions.gsm%press 1 to prepend a message or 2 to forward the
- message without prepending
-
-%vm-mailboxfull.gsm%sorry but the user's mail box can't accept more messages
-
-%vm-tocancelmsg.gsm%press star to cancel this message
-
-%vm-from.gsm%from
-
-%vm-from-extension.gsm%message from extension
-
-%vm-from-phonenumber.gsm%message from phone number
-
-%vm-unknown-caller.gsm%from an unknown caller
-
-%vm-advopts.gsm%press 3 for advanced options
-
-%vm-saveoper.gsm%press 1 to accept this recording, otherwise, please continue to hold
-
-%vm-toreply.gsm%press 1 to send a reply
-
-%vm-tocallback.gsm%press 2 to call the person who sent this message
-
-%vm-tohearenv.gsm%press 3 to hear the message envelope
-
-%vm-tomakecall.gsm%press 4 to place an outgoing call
-
-%vm-starmain.gsm%press star to return to the main menu
-
-%vm-dialout.gsm%please wait while i connect your call
-
-%vm-enter-num-to-call.gsm%please enter the number you wish to call
-
-%vm-then-pound.gsm%then press pound
-
-%vm-star-cancel.gsm%press star to cancel
-
-%vm-num-i-have.gsm%the number i have is
-
-%vm-tocallnum.gsm%press 1 to call this number
-
-%vm-calldiffnum.gsm%press 2 to enter a different number
-
-%vm-nonumber.gsm%i'm afraid i don't know who sent this message
-
-%vm-toenternumber.gsm%press 1 to enter a number
-
-%vm-nobox.gsm%you cannot reply to this message because the sender does not have a mailbox
-
-%vm-review.gsm%press 1 to accept this recording press 2 to listen to it press 3 to rerecord your message
-
-%vm-torerecord.gsm%press 3 to rerecord your message
-
-%vm-reachoper.gsm%press 0 to reach an operator
-
-%vm-tooshort.gsm%your message is too short
-
-%9_p.gsm%niner
-
-%a.gsm%a
-
-%b.gsm%b
-
-%c.gsm%c
-
-%d.gsm%d
-
-%e.gsm%e
-
-%f.gsm%f
-
-%g.gsm%g
-
-%h.gsm%h
-
-%i.gsm%i
-
-%j.gsm%j
-
-%k.gsm%k
-
-%l.gsm%l
-
-%m.gsm%m
-
-%n.gsm%n
-
-%o.gsm%o
-
-%p.gsm%p
-
-%q.gsm%q
-
-%r.gsm%r
-
-%s.gsm%s
-
-%t.gsm%t
-
-%u.gsm%u
-
-%v.gsm%v
-
-%w.gsm%w
-
-%x.gsm%x
-
-%y.gsm%y
-
-%z.gsm%z
-
-%zed.gsm%zed
-
-%a_p.gsm%alpha
-
-%b_p.gsm%bravo
-
-%c_p.gsm%charlie
-
-%d_p.gsm%delta
-
-%e_p.gsm%echo
-
-%f_p.gsm%foxtrot
-
-%g_p.gsm%golf
-
-%h_p.gsm%hotel
-
-%i_p.gsm%india
-
-%j_p.gsm%juliet
-
-%k_p.gsm%kilo
-
-%l_p.gsm%lima
-
-%m_p.gsm%mike
-
-%n_p.gsm%november
-
-%o_p.gsm%oscar
-
-%p_p.gsm%papa
-
-%q_p.gsm%quebec
-
-%r_p.gsm%romeo
-
-%s_p.gsm%sierra
-
-%t_p.gsm%tango
-
-%u_p.gsm%uniform
-
-%v_p.gsm%victor
-
-%w_p.gsm%whiskey
-
-%x_p.gsm%xray
-
-%y_p.gsm%yankee
-
-%z_p.gsm%zulu
-
-%niner.gsm%niner
-
-; Misc
-
-%plus.gsm%plus [+]
-
-%exclaimation-point.gsm%exclaimation-point [!]
-
-%at.gsm%at [@]
-
-%dollar.gsm%dollar [$]
-
-%dash.gsm%dash [-]
-
-%dot.gsm%dot [.]
-
-%slash.gsm%slash [/]
-
-%space.gsm%space [ ]
-
-%equals.gsm%equals [=]
-
-%conf-locked.gsm%This conference is locked!
-
-%conf-kicked.gsm%You have been kicked from this conference
-
-%conf-adminmenu.gsm%Please press 1 to mute or unmute yourself, 2 to lock or unlock the conference, 3 to eject the last user, 4 or 6 to decrease or increase the conference volume, 7 or 9 to decrease or increase your volume, or 8 to exit
-
-%conf-usermenu.gsm%Please press 1 to mute or unmute yourself, 4 or 6 to decrease or increase the conference volume, 7 or 9 to decrease or increase your volume, or 8 to exit
-
-%conf-errormenu.gsm%Invalid Choice
-
-%conf-muted.gsm%You are now muted
-
-%conf-unmuted.gsm%You are now unmuted
-
-%conf-lockednow.gsm%The conference is now locked
-
-%conf-unlockednow.gsm%The conference is now unlocked
-
-%vm-leavemsg.gsm% Press 5 to leave a message
-
-%queue-less-than.gsm%less than
-
-%conf-waitforleader.gsm%The conference will begin when the leader arrives.
-
-%conf-userwilljoin.gsm%user will join the conference.
-
-%conf-userswilljoin.gsm%users will join the conference.
-
-%conf-leaderhasleft.gsm%The leader has left the conference.
-
-%conf-placeintoconf.gsm%You will now be placed into the conference.
-
-%conf-thereare.gsm%There are currently
-
-%conf-otherinparty.gsm%other participants in the conference
-
-%conf-onlyone.gsm%There is currently one other participant in the conference.
-
-
-%spy-agent.gsm%Agent
-
-%spy-h323.gsm%H.323
-
-%spy-iax.gsm%IAX
-
-%spy-iax2.gsm%IAX (note: does not say "2")
-
-%spy-mgcp.gsm%MGCP
-
-%spy-sip.gsm%SIP
-
-%spy-skinny.gsm%Skinny
-
-%spy-zap.gsm%Zap
-
.PHONY: dist-clean all uninstall
-ifneq ($(wildcard ../menuselect.makeopts),)
- include ../menuselect.makeopts
+ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),)
+ include $(ASTTOPDIR)/menuselect.makeopts
endif
PWD:=$(shell pwd)
UTILS:=astman smsq stereorize streamplayer aelparse
ifeq (${OSARCH},SunOS)
- LIBS+=../strcompat.o -lsocket -lnsl
+ LIBS+=../main/strcompat.o -lsocket -lnsl
endif
ifeq ($(POPT_LIB),)
clean: clean-depend
rm -f *.o $(UTILS) check_expr
-$(eval $(call ast_make_final,astman,astman.o ../md5.o))
-astman: LIBS+=-lnewt
+$(eval $(call ast_make_final,astman,astman.o ../main/md5.o))
+astman: LIBS+=-lnewt -lslang -ldl
$(eval $(call ast_make_final,stereorize,stereorize.o frame.o))
stereorize: LIBS+=-lm
-../ast_expr2.c:
- @echo " [BISON] ../ast_expr2.y -> $@"
- @bison -o $@ -d --name-prefix=ast_yy ../ast_expr2.y
+../main/ast_expr2.c:
+ @echo " [BISON] ../main/ast_expr2.y -> $@"
+ @bison -o $@ -d --name-prefix=ast_yy ../main/ast_expr2.y
-../ast_expr2f.c:
- @echo " [FLEX] ../ast_expr2.fl -> $@"
- @flex -o $@ --full ../ast_expr2.fl
+../main/ast_expr2f.c:
+ @echo " [FLEX] ../main/ast_expr2.fl -> $@"
+ @flex -o $@ --full ../main/ast_expr2.fl
-$(eval $(call ast_make_o_c,ast_expr2.o,../ast_expr2.c))
+$(eval $(call ast_make_o_c,ast_expr2.o,../main/ast_expr2.c))
-$(eval $(call ast_make_o_c,ast_expr2f.o,../ast_expr2f.c))
+$(eval $(call ast_make_o_c,ast_expr2f.o,../main/ast_expr2f.c))
ast_expr2f.o: CFLAGS+=-DSTANDALONE
$(eval $(call ast_make_final,check_expr,check_expr.c ast_expr2.o ast_expr2f.o))
aelbison.o: CFLAGS+=-I../pbx
$(eval $(call ast_make_o_c,pbx_ael.o,../pbx/pbx_ael.c))
+pbx_ael.o: CFLAGS+=-DSTANDALONE_AEL
$(eval $(call ast_make_final,aelparse,aelflex.o aelbison.o pbx_ael.o ael_main.o ast_expr2f.o ast_expr2.o))
$(eval $(call ast_make_o_c,ael_main.o,ael_main.c ../include/asterisk/ael_structs.h))
-testexpr2s: ../ast_expr2f.c ../ast_expr2.c ../ast_expr2.h
- $(CC) -g -c -I../include -DSTANDALONE ../ast_expr2f.c -o ast_expr2f.o
- $(CC) -g -c -I../include -DSTANDALONE ../ast_expr2.c -o ast_expr2.o
+testexpr2s: ../main/ast_expr2f.c ../main/ast_expr2.c ../main/ast_expr2.h
+ $(CC) -g -c -I../include -DSTANDALONE ../main/ast_expr2f.c -o ast_expr2f.o
+ $(CC) -g -c -I../include -DSTANDALONE ../main/ast_expr2.c -o ast_expr2.o
$(CC) -g -o testexpr2s ast_expr2f.o ast_expr2.o
rm ast_expr2.o ast_expr2f.o
./testexpr2s expr2.testinput
smsq: smsq.o
-smsq: LIBS+=-lpopt
+smsq: LIBS+=$(POPT_LIB)
streamplayer: streamplayer.o
+muted: muted.o
+muted: LIBS+=$(AUDIO_LIBS)
+
ifneq ($(wildcard .depend),)
include .depend
endif
#include <limits.h>
#include "asterisk/ast_expr.h"
+#include "asterisk/channel.h"
#include "asterisk/module.h"
+#include "asterisk/app.h"
#include "asterisk/ael_structs.h"
struct namelist
FIRST_TIME = 1;
- mod_data.load_module(0);
+ ast_module_info->load();
ast_log(4, "ael2_parse", __LINE__, "main", "%d contexts, %d extensions, %d priorities\n", conts, extens, priors);