added chan_lcr and Makefile.am fixes by Matthias
authorAndreas Eversberg <andreas@eversberg.eu>
Thu, 23 Oct 2008 19:26:44 +0000 (21:26 +0200)
committerAndreas Eversberg <andreas@eversberg.eu>
Thu, 23 Oct 2008 19:26:44 +0000 (21:26 +0200)
minor improvements for lcradmin

modified:   Makefile.am
modified:   Makefile.in
modified:   chan_lcr.c
modified:   configure
modified:   configure.ac
modified:   lcradmin.c

Makefile.am
Makefile.in
chan_lcr.c
configure
configure.ac
lcradmin.c

index 8eebb53..844c2d8 100644 (file)
 ##    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ##    Boston, MA 02110-1301, USA.
 
 ##    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ##    Boston, MA 02110-1301, USA.
 
-#INSTALLATION_DEFINES = \
-# -DCONFIG_DATA="\"$(pkgsysconfdir)\"" \
-# -DSHARE_DATA="\"$(pkgdatadir)\"" \
-# -DLOG_DIR="\"$(pkglogdir)\"" \
-# -DEXTENSION_DATA="\"$(localstatedir)/lib/lcr\""
+INSTALLdir = $(DESTDIR)/usr/local/lcr
 
 
-INSTALLdir = /usr/local/lcr
+pkglogdir=$(localstatedir)/log/@PACKAGE@
+pkgsysconfdir=$(sysconfdir)/@PACKAGE@
+
+#CONFIGdir=$(DESTDIR)$(pkgsysconfdir)
+#SHAREdir=$(DESTDIR)$(pkgdatadir)
+#LOGdir=$(DESTDIR)$(pkglogdir)
+#EXTENSIONdir=$(DESTDIR)$(localstatedir)/lib/lcr
 
 
-astmoddir = /usr/lib/asterisk/modules
+CONFIGdir=$(INSTALLdir)
+SHAREdir=$(INSTALLdir)
+LOGdir=$(INSTALLdir)
+EXTENSIONdir=$(INSTALLdir)/extensions
+
+astmoddir = $(DESTDIR)/usr/lib/asterisk/modules
 
 INSTALLATION_DEFINES = \
 
 INSTALLATION_DEFINES = \
- -DCONFIG_DATA="\"$(INSTALLdir)\"" \
- -DSHARE_DATA="\"$(INSTALLdir)\"" \
- -DLOG_DIR="\"$(INSTALLdir)\"" \
- -DEXTENSION_DATA="\"$(INSTALLdir)/extensions\""
+ -DCONFIG_DATA="\"$(CONFIGdir)\"" \
+ -DSHARE_DATA="\"$(SHAREdir)\"" \
+ -DLOG_DIR="\"$(LOGdir)\"" \
+ -DEXTENSION_DATA="\"$(EXTENSIONdir)/extensions\""
 
 INCLUDES = $(all_includes) -I/usr/include/mISDNuser $(INSTALLATION_DEFINES) 
 
 
 bin_PROGRAMS = lcradmin gentones genwave
 
 
 INCLUDES = $(all_includes) -I/usr/include/mISDNuser $(INSTALLATION_DEFINES) 
 
 
 bin_PROGRAMS = lcradmin gentones genwave
 
+sbin_PROGRAMS = lcr genrc genextension
+
 if ENABLE_ASTERISK_CHANNEL_DRIVER
 if ENABLE_ASTERISK_CHANNEL_DRIVER
-sbin_PROGRAMS = lcr genrc genextension chan_lcr.so
-chan_lcr_so_SOURCES = 
+noinst_PROGRAMS = chan_lcr.so
+chan_lcr_so_SOURCES =
 chan_lcr_so_LDFLAGS = -shared
 chan_lcr_so_LDFLAGS = -shared
-chan_lcr_so_LDADD = chan_lcr.o bchannel.o options.o
+chan_lcr_so_LDADD = chan_lcr.po bchannel.po options.po callerid.po
+
+chan_lcr.po: chan_lcr.c chan_lcr.h
+       $(CC) $(INCLUDES) -D_GNU_SOURCE -fPIC -c chan_lcr.c -o chan_lcr.po
 
 
-chan_lcr.o: chan_lcr.c chan_lcr.h
-       $(CC) $(INCLUDES) -D_GNU_SOURCE -c chan_lcr.c
+bchannel.po: bchannel.c bchannel.h
+       $(CC) $(INCLUDES) -D_GNU_SOURCE -fPIC -c bchannel.c -o bchannel.po
 
 
-bchannel.o: bchannel.c bchannel.h
-       $(CC) $(INCLUDES) -D_GNU_SOURCE -c bchannel.c
+callerid.po: callerid.c callerid.h
+       $(CC) $(INCLUDES) -D_GNU_SOURCE -fPIC -c callerid.c -o callerid.po
 
 
-else
-sbin_PROGRAMS = lcr genrc genextension 
+options.po: options.c options.h
+       $(CC) $(INCLUDES) -D_GNU_SOURCE -fPIC -c options.c -o options.po
+
+install-exec-hook:
+       mkdir -p $(astmoddir)
+       $(INSTALL) -d $(astmoddir)
+       $(INSTALL) chan_lcr.so $(astmoddir)
 endif
 
 lcr_SOURCES = action.cpp       mISDN.cpp        tones.c \
 endif
 
 lcr_SOURCES = action.cpp       mISDN.cpp        tones.c \
@@ -81,43 +98,41 @@ install-data-hook:
        @sh -c 'grep -n strncat *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use strncat, use makro instead." ; exit -1 ; fi'
        @sh -c 'grep -n sprintf *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use sprintf, use makro instead." ; exit -1 ; fi'
        @sh -c 'grep -n snprintf *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use snprintf, use makro instead." ; exit -1 ; fi'
        @sh -c 'grep -n strncat *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use strncat, use makro instead." ; exit -1 ; fi'
        @sh -c 'grep -n sprintf *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use sprintf, use makro instead." ; exit -1 ; fi'
        @sh -c 'grep -n snprintf *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use snprintf, use makro instead." ; exit -1 ; fi'
-       mkdir -p $(INSTALLdir)
-       mkdir -p $(INSTALLdir)/extensions
-       @if test -a $(INSTALLdir)/options.conf ; then \
+       mkdir -p $(CONFIGdir)
+       mkdir -p $(SHAREdir)
+       mkdir -p $(LOGdir)
+       mkdir -p $(EXTENSIONdir)
+       @if test -a $(CONFIGdir)/options.conf ; then \
                echo "NOTE: options.conf already exists, not changed." ; else \
                echo "NOTE: options.conf already exists, not changed." ; else \
-               cp -v default/options.conf $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/interface.conf ; then \
+               cp -v default/options.conf $(CONFIGdir) ; fi
+       @if test -a $(CONFIGdir)/interface.conf ; then \
                echo "NOTE: interface.conf already exists, not changed." ; else \
                echo "NOTE: interface.conf already exists, not changed." ; else \
-               cp -v default/interface.conf $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/routing.conf ; then \
+               cp -v default/interface.conf $(CONFIGdir) ; fi
+       @if test -a $(CONFIGdir)/routing.conf ; then \
                echo "NOTE: routing.conf already exists, not changed." ; else \
                echo "NOTE: routing.conf already exists, not changed." ; else \
-               cp -v default/routing.conf $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/numbering_int.conf ; then \
+               cp -v default/routing.conf $(CONFIGdir) ; fi
+       @if test -a $(CONFIGdir)/numbering_int.conf ; then \
                echo "NOTE: numbering_int.conf is obsolete, please use routing." ; fi
                echo "NOTE: numbering_int.conf is obsolete, please use routing." ; fi
-       @if test -a $(INSTALLdir)/numbering_ext.conf ; then \
+       @if test -a $(CONFIGdir)/numbering_ext.conf ; then \
                echo "NOTE: numbering_ext.conf is obsolete, please use routing." ; fi
                echo "NOTE: numbering_ext.conf is obsolete, please use routing." ; fi
-       @if test -a $(INSTALLdir)/directory.list ; then \
+       @if test -a $(CONFIGdir)/directory.list ; then \
                echo "NOTE: directory.list already exists, not changed." ; else \
                echo "NOTE: directory.list already exists, not changed." ; else \
-               cp -v default/directory.list $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/tones_american ; then \
+               cp -v default/directory.list $(CONFIGdir) ; fi
+       @if test -a $(SHAREdir)/tones_american ; then \
                echo "NOTE: american tones already exists, not overwritten." ; else \
                echo "NOTE: american tones already exists, not overwritten." ; else \
-               cp -a tones_american $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/tones_german ; then \
+               cp -a tones_american $(SHAREdir) ; fi
+       @if test -a $(SHAREdir)/tones_german ; then \
                echo "NOTE: german tones already exists, not overwritten." ; else \
                echo "NOTE: german tones already exists, not overwritten." ; else \
-               cp -a tones_german $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/vbox_german ; then \
+               cp -a tones_german $(SHAREdir) ; fi
+       @if test -a $(SHAREdir)/vbox_german ; then \
                echo "NOTE: german vbox tones already exists, not overwritten." ; else \
                echo "NOTE: german vbox tones already exists, not overwritten." ; else \
-               cp -a vbox_german $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/vbox_english ; then \
+               cp -a vbox_german $(SHAREdir) ; fi
+       @if test -a $(SHAREdir)/vbox_english ; then \
                echo "NOTE: english vbox tones already exists, not overwritten." ; else \
                echo "NOTE: english vbox tones already exists, not overwritten." ; else \
-               cp -a vbox_english $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/tones_efi ; then \
+               cp -a vbox_english $(SHAREdir) ; fi
+       @if test -a $(SHAREdir)/tones_efi ; then \
                echo "NOTE: special efi tones already exists, not overwritten." ; else \
                echo "NOTE: special efi tones already exists, not overwritten." ; else \
-               cp -a tones_efi $(INSTALLdir) ; fi
-if ENABLE_ASTERISK_CHANNEL_DRIVER
-       @echo "Moving chan_lcr.so (if it fails, do it manually)"
-       mv $(sbindir)/chan_lcr.so $(astmoddir)
-endif
+               cp -a tones_efi $(SHAREdir) ; fi
 
 # test rule, nothing important
 #echo:
 
 # test rule, nothing important
 #echo:
@@ -129,7 +144,4 @@ endif
 COMPILE=$(CXXCOMPILE)
 LINK=$(CXXLINK)
 
 COMPILE=$(CXXCOMPILE)
 LINK=$(CXXLINK)
 
-pkglogdir=$(localstatedir)/log/@PACKAGE@
-pkgsysconfdir=$(sysconfdir)/@PACKAGE@
-
 
 
index bbe9f66..929550d 100644 (file)
 
 @SET_MAKE@
 
 
 @SET_MAKE@
 
-#INSTALLATION_DEFINES = \
-# -DCONFIG_DATA="\"$(pkgsysconfdir)\"" \
-# -DSHARE_DATA="\"$(pkgdatadir)\"" \
-# -DLOG_DIR="\"$(pkglogdir)\"" \
-# -DEXTENSION_DATA="\"$(localstatedir)/lib/lcr\""
-
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = @srcdir@
@@ -41,12 +35,8 @@ NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = lcradmin$(EXEEXT) gentones$(EXEEXT) genwave$(EXEEXT)
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = lcradmin$(EXEEXT) gentones$(EXEEXT) genwave$(EXEEXT)
-@ENABLE_ASTERISK_CHANNEL_DRIVER_FALSE@sbin_PROGRAMS = lcr$(EXEEXT) \
-@ENABLE_ASTERISK_CHANNEL_DRIVER_FALSE@ genrc$(EXEEXT) \
-@ENABLE_ASTERISK_CHANNEL_DRIVER_FALSE@ genextension$(EXEEXT)
-@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@sbin_PROGRAMS = lcr$(EXEEXT) \
-@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  genrc$(EXEEXT) \
-@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  genextension$(EXEEXT) \
+sbin_PROGRAMS = lcr$(EXEEXT) genrc$(EXEEXT) genextension$(EXEEXT)
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@noinst_PROGRAMS =  \
 @ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  chan_lcr.so$(EXEEXT)
 subdir = .
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 @ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  chan_lcr.so$(EXEEXT)
 subdir = .
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
@@ -66,12 +56,12 @@ CONFIG_CLEAN_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS)
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) $(sbin_PROGRAMS)
 am_chan_lcr_so_OBJECTS =
 chan_lcr_so_OBJECTS = $(am_chan_lcr_so_OBJECTS)
 @ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@chan_lcr_so_DEPENDENCIES =  \
 am_chan_lcr_so_OBJECTS =
 chan_lcr_so_OBJECTS = $(am_chan_lcr_so_OBJECTS)
 @ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@chan_lcr_so_DEPENDENCIES =  \
-@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  chan_lcr.o bchannel.o \
-@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  options.o
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  chan_lcr.po bchannel.po \
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  options.po callerid.po
 am_genextension_OBJECTS = genext.$(OBJEXT) options.$(OBJEXT) \
        extension.$(OBJEXT)
 genextension_OBJECTS = $(am_genextension_OBJECTS)
 am_genextension_OBJECTS = genext.$(OBJEXT) options.$(OBJEXT) \
        extension.$(OBJEXT)
 genextension_OBJECTS = $(am_genextension_OBJECTS)
@@ -215,18 +205,29 @@ sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
-INSTALLdir = /usr/local/lcr
-astmoddir = /usr/lib/asterisk/modules
+INSTALLdir = $(DESTDIR)/usr/local/lcr
+pkglogdir = $(localstatedir)/log/@PACKAGE@
+pkgsysconfdir = $(sysconfdir)/@PACKAGE@
+
+#CONFIGdir=$(DESTDIR)$(pkgsysconfdir)
+#SHAREdir=$(DESTDIR)$(pkgdatadir)
+#LOGdir=$(DESTDIR)$(pkglogdir)
+#EXTENSIONdir=$(DESTDIR)$(localstatedir)/lib/lcr
+CONFIGdir = $(INSTALLdir)
+SHAREdir = $(INSTALLdir)
+LOGdir = $(INSTALLdir)
+EXTENSIONdir = $(INSTALLdir)/extensions
+astmoddir = $(DESTDIR)/usr/lib/asterisk/modules
 INSTALLATION_DEFINES = \
 INSTALLATION_DEFINES = \
- -DCONFIG_DATA="\"$(INSTALLdir)\"" \
- -DSHARE_DATA="\"$(INSTALLdir)\"" \
- -DLOG_DIR="\"$(INSTALLdir)\"" \
- -DEXTENSION_DATA="\"$(INSTALLdir)/extensions\""
+ -DCONFIG_DATA="\"$(CONFIGdir)\"" \
+ -DSHARE_DATA="\"$(SHAREdir)\"" \
+ -DLOG_DIR="\"$(LOGdir)\"" \
+ -DEXTENSION_DATA="\"$(EXTENSIONdir)/extensions\""
 
 INCLUDES = $(all_includes) -I/usr/include/mISDNuser $(INSTALLATION_DEFINES) 
 @ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@chan_lcr_so_SOURCES = 
 @ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@chan_lcr_so_LDFLAGS = -shared
 
 INCLUDES = $(all_includes) -I/usr/include/mISDNuser $(INSTALLATION_DEFINES) 
 @ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@chan_lcr_so_SOURCES = 
 @ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@chan_lcr_so_LDFLAGS = -shared
-@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@chan_lcr_so_LDADD = chan_lcr.o bchannel.o options.o
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@chan_lcr_so_LDADD = chan_lcr.po bchannel.po options.po callerid.po
 lcr_SOURCES = action.cpp       mISDN.cpp        tones.c \
        action_efi.cpp   crypt.cpp        mail.c           trace.c \
        action_vbox.cpp  dss1.cpp         main.c           \
 lcr_SOURCES = action.cpp       mISDN.cpp        tones.c \
        action_efi.cpp   crypt.cpp        mail.c           trace.c \
        action_vbox.cpp  dss1.cpp         main.c           \
@@ -249,8 +250,6 @@ genextension_SOURCES = genext.c options.c extension.c
 # This should better be removed and all .c files renamed to .cpp
 COMPILE = $(CXXCOMPILE)
 LINK = $(CXXLINK)
 # This should better be removed and all .c files renamed to .cpp
 COMPILE = $(CXXCOMPILE)
 LINK = $(CXXLINK)
-pkglogdir = $(localstatedir)/log/@PACKAGE@
-pkgsysconfdir = $(sysconfdir)/@PACKAGE@
 all: config.h
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
 all: config.h
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -329,6 +328,9 @@ uninstall-binPROGRAMS:
 
 clean-binPROGRAMS:
        -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
 
 clean-binPROGRAMS:
        -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+clean-noinstPROGRAMS:
+       -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
 install-sbinPROGRAMS: $(sbin_PROGRAMS)
        @$(NORMAL_INSTALL)
        test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
 install-sbinPROGRAMS: $(sbin_PROGRAMS)
        @$(NORMAL_INSTALL)
        test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
@@ -647,10 +649,11 @@ distclean-generic:
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
+@ENABLE_ASTERISK_CHANNEL_DRIVER_FALSE@install-exec-hook:
 clean: clean-am
 
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic clean-sbinPROGRAMS \
-       mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \
+       clean-sbinPROGRAMS mostlyclean-am
 
 distclean: distclean-am
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
 
 distclean: distclean-am
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
@@ -674,6 +677,8 @@ install-data-am:
        $(MAKE) $(AM_MAKEFLAGS) install-data-hook
 
 install-exec-am: install-binPROGRAMS install-sbinPROGRAMS
        $(MAKE) $(AM_MAKEFLAGS) install-data-hook
 
 install-exec-am: install-binPROGRAMS install-sbinPROGRAMS
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 
 install-info: install-info-am
 
 
 install-info: install-info-am
 
@@ -704,26 +709,39 @@ uninstall-am: uninstall-binPROGRAMS uninstall-info-am \
        uninstall-sbinPROGRAMS
 
 .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
        uninstall-sbinPROGRAMS
 
 .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
-       clean-binPROGRAMS clean-generic clean-sbinPROGRAMS ctags dist \
-       dist-all dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip \
-       distcheck distclean distclean-compile distclean-generic \
-       distclean-hdr distclean-tags distcleancheck distdir \
-       distuninstallcheck dvi dvi-am html html-am info info-am \
-       install install-am install-binPROGRAMS install-data \
-       install-data-am install-data-hook install-exec install-exec-am \
-       install-info install-info-am install-man install-sbinPROGRAMS \
-       install-strip installcheck installcheck-am installdirs \
-       maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-binPROGRAMS \
-       uninstall-info-am uninstall-sbinPROGRAMS
-
-
-@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@chan_lcr.o: chan_lcr.c chan_lcr.h
-@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  $(CC) $(INCLUDES) -D_GNU_SOURCE -c chan_lcr.c
-
-@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@bchannel.o: bchannel.c bchannel.h
-@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  $(CC) $(INCLUDES) -D_GNU_SOURCE -c bchannel.c
+       clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \
+       clean-sbinPROGRAMS ctags dist dist-all dist-bzip2 dist-gzip \
+       dist-shar dist-tarZ dist-zip distcheck distclean \
+       distclean-compile distclean-generic distclean-hdr \
+       distclean-tags distcleancheck distdir distuninstallcheck dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-binPROGRAMS install-data install-data-am \
+       install-data-hook install-exec install-exec-am \
+       install-exec-hook install-info install-info-am install-man \
+       install-sbinPROGRAMS install-strip installcheck \
+       installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-binPROGRAMS uninstall-info-am \
+       uninstall-sbinPROGRAMS
+
+
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@chan_lcr.po: chan_lcr.c chan_lcr.h
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  $(CC) $(INCLUDES) -D_GNU_SOURCE -fPIC -c chan_lcr.c -o chan_lcr.po
+
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@bchannel.po: bchannel.c bchannel.h
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  $(CC) $(INCLUDES) -D_GNU_SOURCE -fPIC -c bchannel.c -o bchannel.po
+
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@callerid.po: callerid.c callerid.h
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  $(CC) $(INCLUDES) -D_GNU_SOURCE -fPIC -c callerid.c -o callerid.po
+
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@options.po: options.c options.h
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  $(CC) $(INCLUDES) -D_GNU_SOURCE -fPIC -c options.c -o options.po
+
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@install-exec-hook:
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  mkdir -p $(astmoddir)
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  $(INSTALL) -d $(astmoddir)
+@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  $(INSTALL) chan_lcr.so $(astmoddir)
 
 # Special install function to preserve existing configs.
 # Optimization with equivalen results are welcome
 
 # Special install function to preserve existing configs.
 # Optimization with equivalen results are welcome
@@ -735,41 +753,41 @@ install-data-hook:
        @sh -c 'grep -n strncat *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use strncat, use makro instead." ; exit -1 ; fi'
        @sh -c 'grep -n sprintf *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use sprintf, use makro instead." ; exit -1 ; fi'
        @sh -c 'grep -n snprintf *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use snprintf, use makro instead." ; exit -1 ; fi'
        @sh -c 'grep -n strncat *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use strncat, use makro instead." ; exit -1 ; fi'
        @sh -c 'grep -n sprintf *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use sprintf, use makro instead." ; exit -1 ; fi'
        @sh -c 'grep -n snprintf *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use snprintf, use makro instead." ; exit -1 ; fi'
-       mkdir -p $(INSTALLdir)
-       mkdir -p $(INSTALLdir)/extensions
-       @if test -a $(INSTALLdir)/options.conf ; then \
+       mkdir -p $(CONFIGdir)
+       mkdir -p $(SHAREdir)
+       mkdir -p $(LOGdir)
+       mkdir -p $(EXTENSIONdir)
+       @if test -a $(CONFIGdir)/options.conf ; then \
                echo "NOTE: options.conf already exists, not changed." ; else \
                echo "NOTE: options.conf already exists, not changed." ; else \
-               cp -v default/options.conf $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/interface.conf ; then \
+               cp -v default/options.conf $(CONFIGdir) ; fi
+       @if test -a $(CONFIGdir)/interface.conf ; then \
                echo "NOTE: interface.conf already exists, not changed." ; else \
                echo "NOTE: interface.conf already exists, not changed." ; else \
-               cp -v default/interface.conf $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/routing.conf ; then \
+               cp -v default/interface.conf $(CONFIGdir) ; fi
+       @if test -a $(CONFIGdir)/routing.conf ; then \
                echo "NOTE: routing.conf already exists, not changed." ; else \
                echo "NOTE: routing.conf already exists, not changed." ; else \
-               cp -v default/routing.conf $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/numbering_int.conf ; then \
+               cp -v default/routing.conf $(CONFIGdir) ; fi
+       @if test -a $(CONFIGdir)/numbering_int.conf ; then \
                echo "NOTE: numbering_int.conf is obsolete, please use routing." ; fi
                echo "NOTE: numbering_int.conf is obsolete, please use routing." ; fi
-       @if test -a $(INSTALLdir)/numbering_ext.conf ; then \
+       @if test -a $(CONFIGdir)/numbering_ext.conf ; then \
                echo "NOTE: numbering_ext.conf is obsolete, please use routing." ; fi
                echo "NOTE: numbering_ext.conf is obsolete, please use routing." ; fi
-       @if test -a $(INSTALLdir)/directory.list ; then \
+       @if test -a $(CONFIGdir)/directory.list ; then \
                echo "NOTE: directory.list already exists, not changed." ; else \
                echo "NOTE: directory.list already exists, not changed." ; else \
-               cp -v default/directory.list $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/tones_american ; then \
+               cp -v default/directory.list $(CONFIGdir) ; fi
+       @if test -a $(SHAREdir)/tones_american ; then \
                echo "NOTE: american tones already exists, not overwritten." ; else \
                echo "NOTE: american tones already exists, not overwritten." ; else \
-               cp -a tones_american $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/tones_german ; then \
+               cp -a tones_american $(SHAREdir) ; fi
+       @if test -a $(SHAREdir)/tones_german ; then \
                echo "NOTE: german tones already exists, not overwritten." ; else \
                echo "NOTE: german tones already exists, not overwritten." ; else \
-               cp -a tones_german $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/vbox_german ; then \
+               cp -a tones_german $(SHAREdir) ; fi
+       @if test -a $(SHAREdir)/vbox_german ; then \
                echo "NOTE: german vbox tones already exists, not overwritten." ; else \
                echo "NOTE: german vbox tones already exists, not overwritten." ; else \
-               cp -a vbox_german $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/vbox_english ; then \
+               cp -a vbox_german $(SHAREdir) ; fi
+       @if test -a $(SHAREdir)/vbox_english ; then \
                echo "NOTE: english vbox tones already exists, not overwritten." ; else \
                echo "NOTE: english vbox tones already exists, not overwritten." ; else \
-               cp -a vbox_english $(INSTALLdir) ; fi
-       @if test -a $(INSTALLdir)/tones_efi ; then \
+               cp -a vbox_english $(SHAREdir) ; fi
+       @if test -a $(SHAREdir)/tones_efi ; then \
                echo "NOTE: special efi tones already exists, not overwritten." ; else \
                echo "NOTE: special efi tones already exists, not overwritten." ; else \
-               cp -a tones_efi $(INSTALLdir) ; fi
-@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  @echo "Moving chan_lcr.so (if it fails, do it manually)"
-@ENABLE_ASTERISK_CHANNEL_DRIVER_TRUE@  mv $(sbindir)/chan_lcr.so $(astmoddir)
+               cp -a tones_efi $(SHAREdir) ; fi
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index ee5ae6b..cfd3c61 100644 (file)
@@ -649,21 +649,24 @@ static void lcr_start_pbx(struct chan_call *call, struct ast_channel *ast, int c
 {
        int cause, ret;
        union parameter newparam;
 {
        int cause, ret;
        union parameter newparam;
+       char *exten = ast->exten;
+       if (!*exten)
+               exten = "s";
 
 
-       CDEBUG(call, ast, "Try to start pbx. (exten=%s context=%s complete=%s)\n", ast->exten, ast->context, complete?"yes":"no");
+       CDEBUG(call, ast, "Try to start pbx. (exten=%s context=%s complete=%s)\n", exten, ast->context, complete?"yes":"no");
        
        if (complete)
        {
                /* if not match */
        
        if (complete)
        {
                /* if not match */
-               if (!ast_canmatch_extension(ast, ast->context, ast->exten, 1, call->oad))
+               if (!ast_canmatch_extension(ast, ast->context, exten, 1, call->oad))
                {
                {
-                       CDEBUG(call, ast, "Got 'sending complete', but extension '%s' will not match at context '%s' - releasing.\n", ast->exten, ast->context);
+                       CDEBUG(call, ast, "Got 'sending complete', but extension '%s' will not match at context '%s' - releasing.\n", exten, ast->context);
                        cause = 1;
                        goto release;
                }
                        cause = 1;
                        goto release;
                }
-               if (!ast_exists_extension(ast, ast->context, ast->exten, 1, call->oad))
+               if (!ast_exists_extension(ast, ast->context, exten, 1, call->oad))
                {
                {
-                       CDEBUG(call, ast, "Got 'sending complete', but extension '%s' would match at context '%s', if more digits would be dialed - releasing.\n", ast->exten, ast->context);
+                       CDEBUG(call, ast, "Got 'sending complete', but extension '%s' would match at context '%s', if more digits would be dialed - releasing.\n", exten, ast->context);
                        cause = 28;
                        goto release;
                }
                        cause = 28;
                        goto release;
                }
@@ -678,7 +681,7 @@ static void lcr_start_pbx(struct chan_call *call, struct ast_channel *ast, int c
                goto start;
        }
 
                goto start;
        }
 
-       if (ast_canmatch_extension(ast, ast->context, ast->exten, 1, call->oad))
+       if (ast_canmatch_extension(ast, ast->context, exten, 1, call->oad))
        {
                /* send setup acknowledge to lcr */
                if (call->state != CHAN_LCR_STATE_IN_DIALING) {
        {
                /* send setup acknowledge to lcr */
                if (call->state != CHAN_LCR_STATE_IN_DIALING) {
@@ -690,7 +693,7 @@ static void lcr_start_pbx(struct chan_call *call, struct ast_channel *ast, int c
                call->state = CHAN_LCR_STATE_IN_DIALING;
 
                /* if match, start pbx */
                call->state = CHAN_LCR_STATE_IN_DIALING;
 
                /* if match, start pbx */
-               if (ast_exists_extension(ast, ast->context, ast->exten, 1, call->oad)) {
+               if (ast_exists_extension(ast, ast->context, exten, 1, call->oad)) {
                        CDEBUG(call, ast, "Extensions matches.\n");
                        goto start;
                }
                        CDEBUG(call, ast, "Extensions matches.\n");
                        goto start;
                }
@@ -724,11 +727,7 @@ static void lcr_start_pbx(struct chan_call *call, struct ast_channel *ast, int c
                goto release;
        }
        call->pbx_started = 1;
                goto release;
        }
        call->pbx_started = 1;
-//     if (call->state == CHAN_LCR_STATE_IN_DIALING)
-               ast_setstate(ast, AST_STATE_RINGING);
-//     else
-//             ast_setstate(ast, AST_STATE_RINGING);
-//     return;
+               ast_setstate(ast, AST_STATE_RING);
 }
 
 /*
 }
 
 /*
@@ -1961,6 +1960,7 @@ static int lcr_hangup(struct ast_channel *ast)
                        /* during prepare, we change to release state */
                        CDEBUG(call, ast, "We must wait until we received our ref, until we can free call instance.\n");
                        call->state = CHAN_LCR_STATE_RELEASE;
                        /* during prepare, we change to release state */
                        CDEBUG(call, ast, "We must wait until we received our ref, until we can free call instance.\n");
                        call->state = CHAN_LCR_STATE_RELEASE;
+                       call->ast = NULL;
                }
        } 
        if (!pthread_equal(tid, chan_tid))
                }
        } 
        if (!pthread_equal(tid, chan_tid))
@@ -2125,10 +2125,9 @@ static int lcr_indicate(struct ast_channel *ast, int cond, const void *data, siz
                        ast_moh_stop(ast);
                        call->on_hold = 0;
                        break;
                        ast_moh_stop(ast);
                        call->on_hold = 0;
                        break;
-#ifdef AST_CONTROL_SRCUPDATE
+#if ASTERISK_VERSION_NUM >= 10600
                case AST_CONTROL_SRCUPDATE:
                case AST_CONTROL_SRCUPDATE:
-                       CDEBUG(call, ast, "Received indicate AST_CONTROL_SRCUPDATE from Asterisk.\n");
-                        res = -1;
+                       CDEBUG(call, ast, "Received AST_CONTROL_SRCUPDATE from Asterisk.\n");
                         break;
 #endif
                 default:
                         break;
 #endif
                 default:
index bd966c4..a0a90f8 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for lcr 1.2.
+# Generated by GNU Autoconf 2.63 for lcr 1.3.
 #
 # Report bugs to <andreas@eversberg.eu>.
 #
 #
 # Report bugs to <andreas@eversberg.eu>.
 #
@@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='lcr'
 PACKAGE_TARNAME='lcr'
 # Identity of this package.
 PACKAGE_NAME='lcr'
 PACKAGE_TARNAME='lcr'
-PACKAGE_VERSION='1.2'
-PACKAGE_STRING='lcr 1.2'
+PACKAGE_VERSION='1.3'
+PACKAGE_STRING='lcr 1.3'
 PACKAGE_BUGREPORT='andreas@eversberg.eu'
 
 ac_unique_file="main.c"
 PACKAGE_BUGREPORT='andreas@eversberg.eu'
 
 ac_unique_file="main.c"
@@ -1297,7 +1297,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures lcr 1.2 to adapt to many kinds of systems.
+\`configure' configures lcr 1.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1363,7 +1363,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of lcr 1.2:";;
+     short | recursive ) echo "Configuration of lcr 1.3:";;
    esac
   cat <<\_ACEOF
 
    esac
   cat <<\_ACEOF
 
@@ -1461,7 +1461,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-lcr configure 1.2
+lcr configure 1.3
 generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1475,7 +1475,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by lcr $as_me 1.2, which was
+It was created by lcr $as_me 1.3, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
@@ -4033,7 +4033,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=lcr
 
 # Define the identity of the package.
  PACKAGE=lcr
- VERSION=1.2
+ VERSION=1.3
 
 
 cat >>confdefs.h <<_ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
@@ -10078,7 +10078,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by lcr $as_me 1.2, which was
+This file was extended by lcr $as_me 1.3, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -10141,7 +10141,7 @@ Report bugs to <bug-autoconf@gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-lcr config.status 1.2
+lcr config.status 1.3
 configured by $0, generated by GNU Autoconf 2.63,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
 configured by $0, generated by GNU Autoconf 2.63,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
index 672bf71..ef76a4e 100644 (file)
@@ -24,7 +24,7 @@ dnl    Boston, MA 02110-1301, USA.
 dnl This keeps being the first instruction.
 dnl Change the 2nd argument if the version increases
 dnl 1st + 2nd argument is used for distribution package name
 dnl This keeps being the first instruction.
 dnl Change the 2nd argument if the version increases
 dnl 1st + 2nd argument is used for distribution package name
-AC_INIT(lcr, 1.2, andreas@eversberg.eu)
+AC_INIT(lcr, 1.3, andreas@eversberg.eu)
 AC_PREREQ(2.59)
 AC_CONFIG_SRCDIR([main.c])
 AM_CONFIG_HEADER(config.h)
 AC_PREREQ(2.59)
 AC_CONFIG_SRCDIR([main.c])
 AM_CONFIG_HEADER(config.h)
@@ -32,7 +32,7 @@ AM_CONFIG_HEADER(config.h)
 # fix warnings from autoconf + automake
 AC_GNU_SOURCE
 # AC_USE_SYSTEM_EXTENSIONS
 # fix warnings from autoconf + automake
 AC_GNU_SOURCE
 # AC_USE_SYSTEM_EXTENSIONS
-AM_INIT_AUTOMAKE(lcr,1.2)
+AM_INIT_AUTOMAKE(lcr,1.3)
 
 
 
 
 
 
index 1459aeb..a351fbf 100644 (file)
@@ -1656,7 +1656,7 @@ int main(int argc, char *argv[])
                printf("dial <extension> <number> - Tell LCR the next number to dial for extension.\n");
                printf("release <number> - Tell LCR to release endpoint with given number.\n");
                printf("block <port> - Block given port.\n");
                printf("dial <extension> <number> - Tell LCR the next number to dial for extension.\n");
                printf("release <number> - Tell LCR to release endpoint with given number.\n");
                printf("block <port> - Block given port.\n");
-               printf("unblock <port> - Unblock given port.\n");
+               printf("unblock/load <port> - Unblock given port.\n");
                printf("unload <port> - Unload port. To load port use 'block' or 'unblock'.\n");
                printf("testcall [options] <interface> <callerid> <number> [present|restrict [<capability>]] - Testcall\n");
                printf(" -> options = --setup-timeout <seconds> --proceeding-timeout <seconds>\n");
                printf("unload <port> - Unload port. To load port use 'block' or 'unblock'.\n");
                printf("testcall [options] <interface> <callerid> <number> [present|restrict [<capability>]] - Testcall\n");
                printf(" -> options = --setup-timeout <seconds> --proceeding-timeout <seconds>\n");
@@ -1693,7 +1693,8 @@ int main(int argc, char *argv[])
                        goto usage;
                mode = MODE_RELEASE;
        } else
                        goto usage;
                mode = MODE_RELEASE;
        } else
-       if (!(strcasecmp(argv[1],"unblock")))
+       if (!(strcasecmp(argv[1],"unblock"))
+        || !(strcasecmp(argv[1],"load")))
        {
                if (argc <= 2)
                        goto usage;
        {
                if (argc <= 2)
                        goto usage;