Freeswitch-svn
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
March 2007
- 6 participants
- 392 discussions
Author: mikej
Date: Fri Mar 16 15:20:24 2007
New Revision: 4617
Added:
freeswitch/trunk/src/Makefile.am
freeswitch/trunk/src/Makefile.in
Modified:
freeswitch/trunk/Makefile.am
freeswitch/trunk/Makefile.in
freeswitch/trunk/configure
freeswitch/trunk/configure.in
freeswitch/trunk/src/ (props changed)
freeswitch/trunk/src/mod/Makefile.am
freeswitch/trunk/src/mod/Makefile.in
Log:
Fix bootstrap with automake 1.7
fix generation of modules.conf from modules.conf.in on first build
some more steps towards removing gmake specific stuff from our makefiles.
Modified: freeswitch/trunk/Makefile.am
==============================================================================
--- freeswitch/trunk/Makefile.am (original)
+++ freeswitch/trunk/Makefile.am Fri Mar 16 15:20:24 2007
@@ -1,5 +1,5 @@
EXTRA_DIST =
-SUBDIRS = . src/mod
+SUBDIRS = . src
AUTOMAKE_OPTS = foreign
NAME=freeswitch
PREFIX=$(prefix)
@@ -8,7 +8,7 @@
AM_CPPFLAGS = $(SWITCH_AM_CXXFLAGS)
AM_LDFLAGS = $(SWITCH_AM_LDFLAGS)
BASE = $(switch_srcdir)
-OSARCH=$(shell uname -s)
+OSARCH=`uname -s`
LIBTOOL=$(switch_builddir)/libtool
LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
@@ -65,8 +65,8 @@
src/include/switch_log.h\
src/include/switch_xml.h
-CORE_CFLAGS = $(shell $(switch_srcdir)/libs/apr/apr-1-config --cflags --cppflags --includes)
-CORE_CFLAGS += $(shell $(switch_srcdir)/libs/apr-util/apu-1-config --includes)
+CORE_CFLAGS = `$(switch_srcdir)/libs/apr/apr-1-config --cflags --cppflags --includes`
+CORE_CFLAGS += `$(switch_srcdir)/libs/apr-util/apu-1-config --includes`
CORE_CFLAGS += -I$(switch_srcdir)/libs/sqlite
CORE_CFLAGS += -I$(switch_srcdir)/libs/pcre
CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/include
@@ -85,7 +85,7 @@
libfreeswitch_la_LIBADD = $(CORE_LIBS)
nodist_libfreeswitch_la_SOURCES = src/include/switch_version.h
-$(libfreeswitch_la_SOURCES): $(CORE_LIBS)
+$(libfreeswitch_la_SOURCES): $(CORE_LIBS) $(library_include_HEADERS)
MOD_LINK = $(BASE)/libfreeswitch.la
@@ -153,7 +153,7 @@
cd libs/libresample && $(MAKE)
cd libs/libteletone && $(MAKE)
-core: deps libfreeswitch.la
+core: $(CORE_LIBS) libfreeswitch.la
install_core: install-libLTLIBRARIES
Modified: freeswitch/trunk/Makefile.in
==============================================================================
--- freeswitch/trunk/Makefile.in (original)
+++ freeswitch/trunk/Makefile.in Fri Mar 16 15:20:24 2007
@@ -289,7 +289,7 @@
uint64_t_fmt = @uint64_t_fmt@
voidp_size = @voidp_size@
EXTRA_DIST =
-SUBDIRS = . src/mod
+SUBDIRS = . src
AUTOMAKE_OPTS = foreign
NAME = freeswitch
PREFIX = $(prefix)
@@ -297,7 +297,7 @@
AM_CPPFLAGS = $(SWITCH_AM_CXXFLAGS)
AM_LDFLAGS = $(SWITCH_AM_LDFLAGS)
BASE = $(switch_srcdir)
-OSARCH = $(shell uname -s)
+OSARCH = `uname -s`
LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
libfreeswitch_la_SOURCES = \
src/switch_apr.c \
@@ -346,9 +346,9 @@
src/include/switch_log.h\
src/include/switch_xml.h
-CORE_CFLAGS = $(shell $(switch_srcdir)/libs/apr/apr-1-config --cflags \
- --cppflags --includes) $(shell \
- $(switch_srcdir)/libs/apr-util/apu-1-config --includes) \
+CORE_CFLAGS = `$(switch_srcdir)/libs/apr/apr-1-config --cflags \
+ --cppflags --includes` \
+ `$(switch_srcdir)/libs/apr-util/apu-1-config --includes` \
-I$(switch_srcdir)/libs/sqlite -I$(switch_srcdir)/libs/pcre \
-I$(switch_srcdir)/libs/srtp/include \
-I$(switch_srcdir)/libs/srtp/crypto/include \
@@ -1085,7 +1085,7 @@
uninstall-libLTLIBRARIES uninstall-library_includeHEADERS
-$(libfreeswitch_la_SOURCES): $(CORE_LIBS)
+$(libfreeswitch_la_SOURCES): $(CORE_LIBS) $(library_include_HEADERS)
install-data-local:
@echo Installing $(NAME)
@@ -1142,7 +1142,7 @@
cd libs/libresample && $(MAKE)
cd libs/libteletone && $(MAKE)
-core: deps libfreeswitch.la
+core: $(CORE_LIBS) libfreeswitch.la
install_core: install-libLTLIBRARIES
Modified: freeswitch/trunk/configure
==============================================================================
--- freeswitch/trunk/configure (original)
+++ freeswitch/trunk/configure Fri Mar 16 15:20:24 2007
@@ -25769,7 +25769,7 @@
fi
- ac_config_files="$ac_config_files Makefile src/mod/Makefile src/include/switch_am_config.h build/getlib.sh build/modmake.rules"
+ ac_config_files="$ac_config_files Makefile src/Makefile src/mod/Makefile src/include/switch_am_config.h build/getlib.sh build/modmake.rules"
@@ -26493,6 +26493,7 @@
case "$ac_config_target" in
# Handling of arguments.
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"src/mod/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/mod/Makefile" ;;
"src/include/switch_am_config.h" ) CONFIG_FILES="$CONFIG_FILES src/include/switch_am_config.h" ;;
"build/getlib.sh" ) CONFIG_FILES="$CONFIG_FILES build/getlib.sh" ;;
Modified: freeswitch/trunk/configure.in
==============================================================================
--- freeswitch/trunk/configure.in (original)
+++ freeswitch/trunk/configure.in Fri Mar 16 15:20:24 2007
@@ -291,6 +291,7 @@
AM_CONDITIONAL([CRASHPROT],[test "x$enable_crash_prot" != "xno"])
AC_CONFIG_FILES([Makefile
+ src/Makefile
src/mod/Makefile
src/include/switch_am_config.h
build/getlib.sh
Added: freeswitch/trunk/src/Makefile.am
==============================================================================
--- (empty file)
+++ freeswitch/trunk/src/Makefile.am Fri Mar 16 15:20:24 2007
@@ -0,0 +1,3 @@
+SUBDIRS = mod
+
+
Added: freeswitch/trunk/src/Makefile.in
==============================================================================
--- (empty file)
+++ freeswitch/trunk/src/Makefile.in Fri Mar 16 15:20:24 2007
@@ -0,0 +1,503 @@
+# Makefile.in generated by automake 1.9.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = \
+ $(top_srcdir)/build/config/ax_compiler_vendor.m4 \
+ $(top_srcdir)/build/config/ax_cflags_warn_all_ansi.m4 \
+ $(top_srcdir)/build/config/ax_cc_maxopt.m4 \
+ $(top_srcdir)/build/config/ax_check_compiler_flags.m4 \
+ $(top_srcdir)/build/config/ac_gcc_archflag.m4 \
+ $(top_srcdir)/build/config/ac_gcc_x86_cpuid.m4 \
+ $(top_srcdir)/libs/apr/build/apr_common.m4 \
+ $(top_srcdir)/libs/curl/docs/libcurl/libcurl.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/include/switch_private.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CRASHPROT_FALSE = @CRASHPROT_FALSE@
+CRASHPROT_TRUE = @CRASHPROT_TRUE@
+CURL = @CURL@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DYNAMIC_LIB_EXTEN = @DYNAMIC_LIB_EXTEN@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GETLIB = @GETLIB@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IS64BITLINUX_FALSE = @IS64BITLINUX_FALSE@
+IS64BITLINUX_TRUE = @IS64BITLINUX_TRUE@
+ISLINUX_FALSE = @ISLINUX_FALSE@
+ISLINUX_TRUE = @ISLINUX_TRUE@
+ISMAC_FALSE = @ISMAC_FALSE@
+ISMAC_TRUE = @ISMAC_TRUE@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBCURL_DEPS = @LIBCURL_DEPS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PRTDIAG = @PRTDIAG@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOLINK = @SOLINK@
+STRIP = @STRIP@
+SWITCH_AM_CFLAGS = @SWITCH_AM_CFLAGS@
+SWITCH_AM_CXXFLAGS = @SWITCH_AM_CXXFLAGS@
+SWITCH_AM_LDFLAGS = @SWITCH_AM_LDFLAGS@
+TAR = @TAR@
+VERSION = @VERSION@
+WANT_DEBUG_FALSE = @WANT_DEBUG_FALSE@
+WANT_DEBUG_TRUE = @WANT_DEBUG_TRUE@
+WGET = @WGET@
+ZCAT = @ZCAT@
+_libcurl_config = @_libcurl_config@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+int64_t_fmt = @int64_t_fmt@
+int64_value = @int64_value@
+int_value = @int_value@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+long_value = @long_value@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+moddir = @moddir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+short_value = @short_value@
+size_t_fmt = @size_t_fmt@
+size_t_value = @size_t_value@
+ssize_t_fmt = @ssize_t_fmt@
+ssize_t_value = @ssize_t_value@
+subdirs = @subdirs@
+switch_builddir = @switch_builddir@
+switch_srcdir = @switch_srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+uint64_t_fmt = @uint64_t_fmt@
+voidp_size = @voidp_size@
+SUBDIRS = mod
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @set fnord $$MAKEFLAGS; amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $$MAKEFLAGS; amf=$$2; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-libtool clean-recursive ctags \
+ ctags-recursive distclean distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-generic mostlyclean-libtool \
+ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-info-am
+
+# 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:
Modified: freeswitch/trunk/src/mod/Makefile.am
==============================================================================
--- freeswitch/trunk/src/mod/Makefile.am (original)
+++ freeswitch/trunk/src/mod/Makefile.am Fri Mar 16 15:20:24 2007
@@ -1,15 +1,16 @@
-CONF_MODULES=$(shell grep -v "\#" $(switch_builddir)/modules.conf)
-FOUND_MODULES=$(shell find . -type d -name mod_\*)
-OUR_MODULES=`if test -z "$(MODULES)" ; then echo $(CONF_MODULES) ; else echo $(MODULES) ; fi ;`
-OUR_CLEAN_MODULES=`if test -z "$(MODULES)" ; then echo $(CONF_MODULES) $(FOUND_MODULES) ; else echo $(MODULES) ; fi ;`
+CONF_MODULES=if test ! -f $(switch_builddir)/modules.conf ; then cp $(switch_builddir)/modules.conf.in $(switch_builddir)/modules.conf ; fi ; conf_modules=`grep -v "\#" $(switch_builddir)/modules.conf` ;
+FOUND_MODULES=found_modules=`find . -type d -name mod_\*` ;
+OUR_MODULES=if test -z "$(MODULES)" ; then our_modules=$$conf_modules ; else our_modules=$(MODULES) ; fi ;
+OUR_CLEAN_MODULES=if test -z "$(MODULES)" ; then our_clean_modules=`echo $$conf_modules $$found_modules` ; else our_clean_modules=$(MODULES) ; fi ;
MOD_NAME=`echo $$i | sed -e 's|^.*/||'`
MOD_DIR=`if test -d $(switch_srcdir)/src/mod/$$i ; then echo $(switch_srcdir)/src/mod/$$i ; else echo $$i ; fi;`
all:
- @if [ ! -f $(switch_builddir)/modules.conf ] ; then cp $(switch_builddir)/modules.conf.in $(switch_builddir)/modules.conf ; fi
- @echo making modules
- @for i in $(OUR_MODULES) ; do \
+ @$(CONF_MODULES) \
+ $(OUR_MODULES) \
+ echo making modules ; \
+ for i in $$our_modules ; do \
echo making $$i ; \
moddir=$(MOD_DIR); \
if test -f $$moddir/Makefile ; then \
@@ -19,7 +20,11 @@
done
clean:
- @for i in $(OUR_CLEAN_MODULES) ; do \
+ @$(CONF_MODULES) \
+ $(FOUND_MODULES) \
+ $(OUR_CLEAN_MODULES) \
+ echo making clean modules ; \
+ for i in $$our_clean_modules ; do \
echo making clean $$i ; \
moddir=$(MOD_DIR); \
if test -f $$moddir/Makefile ; then \
@@ -29,8 +34,10 @@
done
install:
- @echo Installing Modules
- @for i in $(OUR_MODULES) ; do \
+ @$(CONF_MODULES) \
+ $(OUR_MODULES) \
+ echo Installing Modules ; \
+ for i in $$our_modules ; do \
echo making install $$i ; \
moddir=$(MOD_DIR); \
if test -f $$moddir/Makefile ; then \
@@ -41,8 +48,10 @@
@echo done
uninstall:
- @echo Uninstalling Modules
- @for i in $(OUR_MODULES) ; do \
+ @$(CONF_MODULES) \
+ $(OUR_MODULES) \
+ echo Uninstalling Modules ; \
+ for i in $$our_modules ; do \
echo making uninstall $$i ; \
moddir=$(MOD_DIR); \
if test -f $$moddir/Makefile ; then \
Modified: freeswitch/trunk/src/mod/Makefile.in
==============================================================================
--- freeswitch/trunk/src/mod/Makefile.in (original)
+++ freeswitch/trunk/src/mod/Makefile.in Fri Mar 16 15:20:24 2007
@@ -165,10 +165,10 @@
target_alias = @target_alias@
uint64_t_fmt = @uint64_t_fmt@
voidp_size = @voidp_size@
-CONF_MODULES = $(shell grep -v "\#" $(switch_builddir)/modules.conf)
-FOUND_MODULES = $(shell find . -type d -name mod_\*)
-OUR_MODULES = `if test -z "$(MODULES)" ; then echo $(CONF_MODULES) ; else echo $(MODULES) ; fi ;`
-OUR_CLEAN_MODULES = `if test -z "$(MODULES)" ; then echo $(CONF_MODULES) $(FOUND_MODULES) ; else echo $(MODULES) ; fi ;`
+CONF_MODULES = if test ! -f $(switch_builddir)/modules.conf ; then cp $(switch_builddir)/modules.conf.in $(switch_builddir)/modules.conf ; fi ; conf_modules=`grep -v "\#" $(switch_builddir)/modules.conf` ;
+FOUND_MODULES = found_modules=`find . -type d -name mod_\*` ;
+OUR_MODULES = if test -z "$(MODULES)" ; then our_modules=$$conf_modules ; else our_modules=$(MODULES) ; fi ;
+OUR_CLEAN_MODULES = if test -z "$(MODULES)" ; then our_clean_modules=`echo $$conf_modules $$found_modules` ; else our_clean_modules=$(MODULES) ; fi ;
MOD_NAME = `echo $$i | sed -e 's|^.*/||'`
MOD_DIR = `if test -d $(switch_srcdir)/src/mod/$$i ; then echo $(switch_srcdir)/src/mod/$$i ; else echo $$i ; fi;`
all: all-am
@@ -319,9 +319,10 @@
all:
- @if [ ! -f $(switch_builddir)/modules.conf ] ; then cp $(switch_builddir)/modules.conf.in $(switch_builddir)/modules.conf ; fi
- @echo making modules
- @for i in $(OUR_MODULES) ; do \
+ @$(CONF_MODULES) \
+ $(OUR_MODULES) \
+ echo making modules ; \
+ for i in $$our_modules ; do \
echo making $$i ; \
moddir=$(MOD_DIR); \
if test -f $$moddir/Makefile ; then \
@@ -331,7 +332,11 @@
done
clean:
- @for i in $(OUR_CLEAN_MODULES) ; do \
+ @$(CONF_MODULES) \
+ $(FOUND_MODULES) \
+ $(OUR_CLEAN_MODULES) \
+ echo making clean modules ; \
+ for i in $$our_clean_modules ; do \
echo making clean $$i ; \
moddir=$(MOD_DIR); \
if test -f $$moddir/Makefile ; then \
@@ -341,8 +346,10 @@
done
install:
- @echo Installing Modules
- @for i in $(OUR_MODULES) ; do \
+ @$(CONF_MODULES) \
+ $(OUR_MODULES) \
+ echo Installing Modules ; \
+ for i in $$our_modules ; do \
echo making install $$i ; \
moddir=$(MOD_DIR); \
if test -f $$moddir/Makefile ; then \
@@ -353,8 +360,10 @@
@echo done
uninstall:
- @echo Uninstalling Modules
- @for i in $(OUR_MODULES) ; do \
+ @$(CONF_MODULES) \
+ $(OUR_MODULES) \
+ echo Uninstalling Modules ; \
+ for i in $$our_modules ; do \
echo making uninstall $$i ; \
moddir=$(MOD_DIR); \
if test -f $$moddir/Makefile ; then \
1
0
[commit] r4616 - in freeswitch/trunk/src: include mod mod/applications/mod_conference mod/formats/mod_shout
by Freeswitch SVN 16 Mar '07
by Freeswitch SVN 16 Mar '07
16 Mar '07
Author: anthm
Date: Fri Mar 16 13:19:44 2007
New Revision: 4616
Modified:
freeswitch/trunk/src/include/switch_private.h.in
freeswitch/trunk/src/mod/Makefile.in
freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c
Log:
update
Modified: freeswitch/trunk/src/include/switch_private.h.in
==============================================================================
--- freeswitch/trunk/src/include/switch_private.h.in (original)
+++ freeswitch/trunk/src/include/switch_private.h.in Fri Mar 16 13:19:44 2007
@@ -7,9 +7,6 @@
*/
#undef HAVE_DIRENT_H
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
/* Define to 1 if you have the `gethostname' function. */
#undef HAVE_GETHOSTNAME
Modified: freeswitch/trunk/src/mod/Makefile.in
==============================================================================
--- freeswitch/trunk/src/mod/Makefile.in (original)
+++ freeswitch/trunk/src/mod/Makefile.in Fri Mar 16 13:19:44 2007
@@ -33,8 +33,6 @@
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
subdir = src/mod
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -60,7 +58,6 @@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
-AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -73,22 +70,15 @@
CRASHPROT_FALSE = @CRASHPROT_FALSE@
CRASHPROT_TRUE = @CRASHPROT_TRUE@
CURL = @CURL@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DYNAMIC_LIB_EXTEN = @DYNAMIC_LIB_EXTEN@
-ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
GETLIB = @GETLIB@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -106,8 +96,6 @@
LIBCURL_DEPS = @LIBCURL_DEPS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
@@ -119,7 +107,6 @@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PRTDIAG = @PRTDIAG@
-RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOLINK = @SOLINK@
@@ -134,34 +121,20 @@
WGET = @WGET@
ZCAT = @ZCAT@
_libcurl_config = @_libcurl_config@
-ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
-build = @build@
build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
-host = @host@
host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@@ -230,15 +203,6 @@
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
uninstall-info-am:
tags: TAGS
TAGS:
@@ -300,11 +264,11 @@
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-clean-am: clean-generic clean-libtool mostlyclean-am
+clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool
+distclean-am: clean-am distclean-generic
dvi: dvi-am
@@ -332,7 +296,7 @@
mostlyclean: mostlyclean-am
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+mostlyclean-am: mostlyclean-generic
pdf: pdf-am
@@ -344,14 +308,13 @@
uninstall-am: uninstall-info-am
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- distclean distclean-generic distclean-libtool distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-exec install-exec-am \
- install-info install-info-am install-man install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Fri Mar 16 13:19:44 2007
@@ -731,7 +731,6 @@
}
/* If a file or speech event is being played */
if (conference->fnode) {
- switch_mutex_lock(conference->mutex);
/* Lead in time */
if (conference->fnode->leadin) {
conference->fnode->leadin--;
@@ -759,8 +758,6 @@
}
}
has_file_data = 1;
-
- switch_mutex_unlock(conference->mutex);
} else {
has_file_data = 0;
}
@@ -1751,16 +1748,9 @@
return NULL;
}
- if (switch_core_timer_init(&timer, conference->timer_name, conference->interval, samples, rec->pool) == SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "setup timer success interval: %u samples: %u\n", conference->interval, samples);
- } else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer Setup Failed. Conference Cannot Start\n");
- return NULL;
- }
-
switch_mutex_lock(globals.hash_mutex);
globals.threads++;
- switch_mutex_unlock(globals.hash_mutex);
+ switch_mutex_unlock(globals.hash_mutex);
member = &smember;
@@ -1805,11 +1795,21 @@
goto end;
}
+
+ if (switch_core_timer_init(&timer, conference->timer_name, conference->interval, samples, rec->pool) == SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "setup timer success interval: %u samples: %u\n", conference->interval, samples);
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer Setup Failed. Conference Cannot Start\n");
+ goto end;
+ }
+
if ((vval = switch_mprintf("Conference %s", conference->name))) {
switch_core_file_set_string(&fh, SWITCH_AUDIO_COL_STR_TITLE, vval);
switch_safe_free(vval);
}
+ switch_core_file_set_string(&fh, SWITCH_AUDIO_COL_STR_ARTIST, "FreeSWITCH mod_conference Software Conference Module");
+
while(switch_test_flag(member, MFLAG_RUNNING) && switch_test_flag(conference, CFLAG_RUNNING) && conference->count) {
mux_used = (uint32_t) switch_buffer_inuse(member->mux_buffer);
@@ -1832,7 +1832,8 @@
if (!switch_test_flag((&fh), SWITCH_FILE_PAUSE)) {
switch_size_t len = (switch_size_t) rlen / sizeof(int16_t);
if (switch_core_file_write(&fh, data, &len) != SWITCH_STATUS_SUCCESS) {
- goto end;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write Failed\n");
+ switch_clear_flag_locked(member, MFLAG_RUNNING);
}
}
}
Modified: freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c Fri Mar 16 13:19:44 2007
@@ -530,8 +530,9 @@
{
shout_context_t *context;
char *host, *file;
- char *username, *password;
+ char *username, *password, *port;
char *err = NULL;
+ int portno = 0;
if ((context = switch_core_alloc(handle->memory_pool, sizeof(*context))) == 0) {
return SWITCH_STATUS_MEMERR;
@@ -610,6 +611,17 @@
goto error;
}
+ if ((port = strchr(host, ':'))) {
+ *port++ = '\0';
+ if (port) {
+ portno = atoi(port);
+ }
+ }
+
+ if (!portno) {
+ portno = 8000;
+ }
+
if (!(context->shout = shout_new())) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not allocate shout_t\n");
goto error;
@@ -625,7 +637,7 @@
goto error;
}
- if (shout_set_port(context->shout, 8000) != SHOUTERR_SUCCESS) {
+ if (shout_set_port(context->shout, portno) != SHOUTERR_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error setting port: %s\n", shout_get_error(context->shout));
goto error;
}
@@ -650,6 +662,11 @@
goto error;
}
+ if (shout_set_description(context->shout, "FreeSWITCH mod_shout Broadcasting Module") != SHOUTERR_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error setting name: %s\n", shout_get_error(context->shout));
+ goto error;
+ }
+
if (shout_set_audio_info(context->shout, "bitrate", "64000") != SHOUTERR_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error setting user: %s\n", shout_get_error(context->shout));
goto error;
@@ -818,6 +835,11 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error setting name: %s\n", shout_get_error(context->shout));
}
break;
+ case SWITCH_AUDIO_COL_STR_ARTIST:
+ if (shout_set_description(context->shout, string) != SHOUTERR_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error setting name: %s\n", shout_get_error(context->shout));
+ }
+ break;
default:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Value Ignored\n");
break;
1
0
16 Mar '07
Author: anthm
Date: Thu Mar 15 21:38:29 2007
New Revision: 4615
Modified:
freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
Log:
update
Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Thu Mar 15 21:38:29 2007
@@ -147,6 +147,7 @@
switch_speech_handle_t sh;
node_type_t type;
uint8_t done;
+ uint8_t async;
switch_memory_pool_t *pool;
uint32_t leadin;
struct conference_file_node *next;
@@ -197,6 +198,7 @@
conference_member_t *members;
switch_mutex_t *member_mutex;
conference_file_node_t *fnode;
+ conference_file_node_t *async_fnode;
switch_memory_pool_t *pool;
switch_thread_rwlock_t *rwlock;
uint32_t count;
@@ -279,7 +281,7 @@
static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *obj);
static void conference_loop_output(conference_member_t *member);
static uint32_t conference_stop_file(conference_obj_t *conference, file_stop_t stop);
-static switch_status_t conference_play_file(conference_obj_t *conference, char *file, uint32_t leadin, switch_channel_t *channel);
+static switch_status_t conference_play_file(conference_obj_t *conference, char *file, uint32_t leadin, switch_channel_t *channel, uint8_t async);
static switch_status_t conference_say(conference_obj_t *conference, const char *text, uint32_t leadin);
static void conference_list(conference_obj_t *conference, switch_stream_handle_t *stream, char *delim);
static switch_status_t conf_api_main(char *buf, switch_core_session_t *session, switch_stream_handle_t *stream);
@@ -509,7 +511,7 @@
}
if (conference->count > 1 && conference->enter_sound) {
- conference_play_file(conference, conference->enter_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session));
+ conference_play_file(conference, conference->enter_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session), 0);
}
// anounce the total number of members in the conference
@@ -518,7 +520,7 @@
conference_member_say(member, msg, CONF_DEFAULT_LEADIN);
} else if (conference->count == 1) {
if (conference->alone_sound) {
- conference_play_file(conference, conference->alone_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session));
+ conference_play_file(conference, conference->alone_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session), 0);
} else {
snprintf(msg, sizeof(msg), "You are currently the only person in this conference.", conference->count);
conference_member_say(member, msg, CONF_DEFAULT_LEADIN);
@@ -619,10 +621,10 @@
switch_set_flag(conference, CFLAG_DESTRUCT);
} else {
if (conference->exit_sound) {
- conference_play_file(conference, conference->exit_sound, 0, switch_core_session_get_channel(member->session));
+ conference_play_file(conference, conference->exit_sound, 0, switch_core_session_get_channel(member->session), 0);
}
if (conference->count == 1 && conference->alone_sound) {
- conference_play_file(conference, conference->alone_sound, 0, switch_core_session_get_channel(member->session));
+ conference_play_file(conference, conference->alone_sound, 0, switch_core_session_get_channel(member->session), 0);
}
}
@@ -657,6 +659,12 @@
uint8_t ready = 0;
switch_timer_t timer = {0};
switch_event_t *event;
+ uint8_t *file_frame;
+ uint8_t *async_file_frame;
+
+ file_frame = switch_core_alloc(conference->pool, CONF_BUFFER_SIZE);
+ async_file_frame = switch_core_alloc(conference->pool, CONF_BUFFER_SIZE);
+
if (switch_core_timer_init(&timer, conference->timer_name, conference->interval, samples, conference->pool) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "setup timer success interval: %u samples: %u\n", conference->interval, samples);
@@ -670,9 +678,9 @@
switch_mutex_unlock(globals.hash_mutex);
while(globals.running && !switch_test_flag(conference, CFLAG_DESTRUCT)) {
- uint8_t file_frame[CONF_BUFFER_SIZE] = {0};
switch_size_t file_sample_len = samples;
switch_size_t file_data_len = samples * 2;
+ int has_file_data = 0;
/* Sync the conference to a single timing source */
if (switch_core_timer_next(&timer) != SWITCH_STATUS_SUCCESS) {
@@ -723,6 +731,7 @@
}
/* If a file or speech event is being played */
if (conference->fnode) {
+ switch_mutex_lock(conference->mutex);
/* Lead in time */
if (conference->fnode->leadin) {
conference->fnode->leadin--;
@@ -749,13 +758,44 @@
conference->fnode->done++;
}
}
+ has_file_data = 1;
+
+ switch_mutex_unlock(conference->mutex);
+ } else {
+ has_file_data = 0;
+ }
+
+ if (conference->async_fnode) {
+ switch_core_file_read(&conference->async_fnode->fh, async_file_frame, &file_sample_len);
+
+ if (file_sample_len <= 0) {
+ conference->async_fnode->done++;
+ } else {
+ if (has_file_data) {
+ int x;
+ for (x = 0; x < file_sample_len; x++) {
+ int32_t z;
+ int16_t *bptr, *muxed;
+
+ muxed = (int16_t *) file_frame;
+ bptr = (int16_t *) async_file_frame;
+ z = muxed[x] + bptr[x];
+ switch_normalize_to_16bit(z);
+ muxed[x] = (int16_t)z;
+ }
+ } else {
+ memcpy(file_frame, async_file_frame, file_sample_len * 2);
+ has_file_data = 1;
+ }
+ }
+
}
if (ready) {
/* Build a muxed frame for every member that contains the mixed audio of everyone else */
for (omember = conference->members; omember; omember = omember->next) {
omember->len = bytes;
- if (conference->fnode) {
+ if (has_file_data) {
memcpy(omember->mux_frame, file_frame, file_sample_len * 2);
} else {
memset(omember->mux_frame, 255, bytes);
@@ -822,6 +862,14 @@
}
}
+ if (conference->async_fnode && conference->async_fnode->done) {
+ switch_memory_pool_t *pool;
+ switch_core_file_close(&conference->async_fnode->fh);
+ pool = conference->async_fnode->pool;
+ conference->async_fnode = NULL;
+ switch_core_destroy_memory_pool(&pool);
+ }
+
if (conference->fnode && conference->fnode->done) {
conference_file_node_t *fnode;
switch_memory_pool_t *pool;
@@ -1835,6 +1883,10 @@
nptr->done++;
count++;
}
+ if (conference->async_fnode) {
+ conference->async_fnode->done++;
+ count++;
+ }
} else {
if (conference->fnode) {
conference->fnode->done++;
@@ -1876,10 +1928,10 @@
}
/* Play a file in the conference room */
-static switch_status_t conference_play_file(conference_obj_t *conference, char *file, uint32_t leadin, switch_channel_t *channel)
+static switch_status_t conference_play_file(conference_obj_t *conference, char *file, uint32_t leadin, switch_channel_t *channel, uint8_t async)
{
switch_status_t status = SWITCH_STATUS_SUCCESS;
- conference_file_node_t *fnode, *nptr;
+ conference_file_node_t *fnode, *nptr = NULL;
switch_memory_pool_t *pool;
uint32_t count;
char *dfile = NULL, *expanded = NULL;
@@ -1953,16 +2005,31 @@
}
fnode->pool = pool;
-
+ fnode->async = async;
/* Queue the node */
switch_mutex_lock(conference->mutex);
- for (nptr = conference->fnode; nptr && nptr->next; nptr = nptr->next);
- if (nptr) {
- nptr->next = fnode;
- } else {
- conference->fnode = fnode;
- }
+ if (async) {
+ if (conference->async_fnode) {
+ nptr = conference->async_fnode;
+ }
+ conference->async_fnode = fnode;
+
+ if (nptr) {
+ switch_speech_flag_t flags = SWITCH_SPEECH_FLAG_NONE;
+ switch_core_speech_close(&conference->fnode->sh, &flags);
+ }
+
+ } else {
+ for (nptr = conference->fnode; nptr && nptr->next; nptr = nptr->next);
+
+ if (nptr) {
+ nptr->next = fnode;
+ } else {
+ conference->fnode = fnode;
+ }
+ }
+
switch_mutex_unlock(conference->mutex);
done:
@@ -2686,13 +2753,18 @@
{
int ret_status = SWITCH_STATUS_GENERR;
switch_event_t *event;
+ uint8_t async = 0;
assert(conference != NULL);
assert(stream != NULL);
-
+ if ((argc == 4 && !strcasecmp(argv[3], "async")) || (argc == 5 && !strcasecmp(argv[4], "async"))) {
+ argc--;
+ async++;
+ }
+
if (argc == 3) {
- if (conference_play_file(conference, argv[2], 0, NULL) == SWITCH_STATUS_SUCCESS) {
+ if (conference_play_file(conference, argv[2], 0, NULL, async) == SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "(play) Playing file %s\n", argv[2]);
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", conference->name);
@@ -2934,7 +3006,7 @@
assert(stream != NULL);
if (conference->is_locked_sound) {
- conference_play_file(conference, conference->is_locked_sound, CONF_DEFAULT_LEADIN, NULL);
+ conference_play_file(conference, conference->is_locked_sound, CONF_DEFAULT_LEADIN, NULL, 0);
}
switch_set_flag_locked(conference, CFLAG_LOCKED);
@@ -2956,7 +3028,7 @@
assert(stream != NULL);
if (conference->is_unlocked_sound) {
- conference_play_file(conference, conference->is_unlocked_sound, CONF_DEFAULT_LEADIN, NULL);
+ conference_play_file(conference, conference->is_unlocked_sound, CONF_DEFAULT_LEADIN, NULL, 0);
}
switch_clear_flag_locked(conference, CFLAG_LOCKED);
1
0
16 Mar '07
Author: anthm
Date: Thu Mar 15 20:10:10 2007
New Revision: 4614
Modified:
freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
Log:
update
Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Thu Mar 15 20:10:10 2007
@@ -52,9 +52,6 @@
#define MIN(a, b) ((a)<(b)?(a):(b))
#endif
-/* this doesn't work correctly yet, don't bother trying! */
-//#define OPTION_IVR_MENU_SUPPORT */
-
typedef enum {
FILE_STOP_CURRENT,
FILE_STOP_ALL
@@ -87,21 +84,25 @@
CALLER_CONTROL_HANGUP,
CALLER_CONTROL_MENU,
CALLER_CONTROL_DIAL,
+ CALLER_CONTROL_EVENT
} caller_control_t;
/* forward declaration for conference_obj and caller_control */
struct conference_member;
typedef struct conference_member conference_member_t;
+struct caller_control_actions;
+
typedef struct caller_control_fn_table {
char *key;
char *digits;
caller_control_t action;
- void (*handler)(conference_member_t *, void *);
+ void (*handler)(conference_member_t *, struct caller_control_actions *);
} caller_control_fn_table_t;
typedef struct caller_control_actions {
caller_control_fn_table_t *fndesc;
+ char *binded_dtmf;
void *data;
} caller_control_action_t;
@@ -155,9 +156,6 @@
typedef struct conf_xml_cfg {
switch_xml_t profile;
switch_xml_t controls;
-#ifdef OPTION_IVR_MENU_SUPPORT
- switch_xml_t menus;
-#endif
} conf_xml_cfg_t;
/* Conference Object */
@@ -936,7 +934,7 @@
return NULL;
}
-static void conference_loop_fn_mute_toggle(conference_member_t *member, void *data)
+static void conference_loop_fn_mute_toggle(conference_member_t *member, caller_control_action_t *action)
{
if (member != NULL) {
if (switch_test_flag(member, MFLAG_CAN_SPEAK)) {
@@ -950,7 +948,7 @@
}
}
-static void conference_loop_fn_deafmute_toggle(conference_member_t *member, void *data)
+static void conference_loop_fn_deafmute_toggle(conference_member_t *member, caller_control_action_t *action)
{
if (member != NULL) {
if (switch_test_flag(member, MFLAG_CAN_SPEAK)) {
@@ -967,7 +965,7 @@
}
}
-static void conference_loop_fn_energy_up(conference_member_t *member, void *data)
+static void conference_loop_fn_energy_up(conference_member_t *member, caller_control_action_t *action)
{
if (member != NULL) {
char msg[512];
@@ -996,7 +994,7 @@
}
}
-static void conference_loop_fn_energy_equ_conf(conference_member_t *member, void *data)
+static void conference_loop_fn_energy_equ_conf(conference_member_t *member, caller_control_action_t *action)
{
if (member!= NULL) {
char msg[512];
@@ -1022,7 +1020,7 @@
}
}
-static void conference_loop_fn_energy_dn(conference_member_t *member, void *data)
+static void conference_loop_fn_energy_dn(conference_member_t *member, caller_control_action_t *action)
{
if (member!= NULL) {
char msg[512];
@@ -1051,7 +1049,7 @@
}
}
-static void conference_loop_fn_volume_talk_up(conference_member_t *member, void *data)
+static void conference_loop_fn_volume_talk_up(conference_member_t *member, caller_control_action_t *action)
{
if (member!= NULL) {
char msg[512];
@@ -1078,7 +1076,7 @@
}
}
-static void conference_loop_fn_volume_talk_zero(conference_member_t *member, void *data)
+static void conference_loop_fn_volume_talk_zero(conference_member_t *member, caller_control_action_t *action)
{
if (member!= NULL) {
char msg[512];
@@ -1104,7 +1102,7 @@
}
}
-static void conference_loop_fn_volume_talk_dn(conference_member_t *member, void *data)
+static void conference_loop_fn_volume_talk_dn(conference_member_t *member, caller_control_action_t *action)
{
if (member!= NULL) {
char msg[512];
@@ -1131,7 +1129,7 @@
}
}
-static void conference_loop_fn_volume_listen_up(conference_member_t *member, void *data)
+static void conference_loop_fn_volume_listen_up(conference_member_t *member, caller_control_action_t *action)
{
if (member!= NULL) {
char msg[512];
@@ -1158,7 +1156,7 @@
}
}
-static void conference_loop_fn_volume_listen_zero(conference_member_t *member, void *data)
+static void conference_loop_fn_volume_listen_zero(conference_member_t *member, caller_control_action_t *action)
{
if (member!= NULL) {
char msg[512];
@@ -1184,7 +1182,7 @@
}
}
-static void conference_loop_fn_volume_listen_dn(conference_member_t *member, void *data)
+static void conference_loop_fn_volume_listen_dn(conference_member_t *member, caller_control_action_t *action)
{
if (member!= NULL) {
char msg[512];
@@ -1211,62 +1209,26 @@
}
}
-static void conference_loop_fn_hangup(conference_member_t *member, void *data)
-{
- switch_clear_flag_locked(member, MFLAG_RUNNING);
-}
-
-#ifdef OPTION_IVR_MENU_SUPPORT
-typedef struct caller_control_menu_ctx {
- switch_ivr_menu_xml_ctx_t *xml_ctx;
- switch_ivr_menu_t *menu_stack;
- char *name;
-} caller_control_menu_ctx_t;
-
-static void conference_loop_fn_menu(conference_member_t *member, void *data)
+static void conference_loop_fn_event(conference_member_t *member, caller_control_action_t *action)
{
- if (member != NULL && data != NULL) {
- caller_control_menu_ctx_t *menu_ctx = (caller_control_menu_ctx_t *)data;
+ switch_event_t *event;
+ if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
+ switch_channel_t *channel = switch_core_session_get_channel(member->session);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "conference_loop_fn_menu handler '%s'\n", menu_ctx->name);
- if (menu_ctx->menu_stack != NULL && menu_ctx->xml_ctx != NULL) {
- switch_ivr_menu_execute(member->session, menu_ctx->menu_stack, menu_ctx->name, member);
- } else {
- if (menu_ctx->menu_stack == NULL)
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "conference_loop_fn_menu handler NULL menu_stack\n");
- if (menu_ctx->xml_ctx == NULL)
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "conference_loop_fn_menu handler NULL xml_ctx\n");
- }
+ switch_channel_event_set_data(channel, event);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "dtmf");
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "DTMF-Key", "%s", action->binded_dtmf);
+ switch_event_fire(&event);
}
}
-#endif
-static void conference_loop_fn_dial(conference_member_t *member, void *data)
+static void conference_loop_fn_hangup(conference_member_t *member, caller_control_action_t *action)
{
- if (member != NULL && data != NULL) {
- char *lbuf = strdup(data);
- char *argv[4];
- int argc = 0;
-
- if (lbuf != NULL) {
- memset(argv, 0, sizeof(argv));
- argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "dial argc %u 1 '%s' 2 '%s' 3 '%s' 4 '%s'\n",
- argc, argv[0], argv[1], argv[2], argv[3]);
- if (argc >= 4) {
- switch_call_cause_t cause;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "executing conference outcall\n");
- conference_outcall(member->conference, NULL, NULL, argv[0], atoi(argv[1]), NULL, argv[3], argv[2], &cause);
- } else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "conference outcall not executed\n");
- }
-
- free(lbuf);
- }
- }
+ switch_clear_flag_locked(member, MFLAG_RUNNING);
}
-
/* marshall frames from the call leg to the conference thread for muxing to other call legs */
static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *obj)
{
@@ -1417,22 +1379,19 @@
}
static caller_control_fn_table_t ccfntbl[] = {
- {"mute", "0", CALLER_CONTROL_MUTE, conference_loop_fn_mute_toggle},
- {"deaf mute", "*", CALLER_CONTROL_DEAF_MUTE, conference_loop_fn_deafmute_toggle},
- {"energy up", "9", CALLER_CONTROL_ENERGY_UP, conference_loop_fn_energy_up},
- {"energy equ", "8", CALLER_CONTROL_ENERGY_EQU_CONF, conference_loop_fn_energy_equ_conf},
- {"energy dn", "7", CALLER_CONTROL_ENERGEY_DN, conference_loop_fn_energy_dn},
- {"vol talk up", "3", CALLER_CONTROL_VOL_TALK_UP, conference_loop_fn_volume_talk_up},
- {"vol talk zero", "2", CALLER_CONTROL_VOL_TALK_ZERO, conference_loop_fn_volume_talk_zero},
- {"vol talk dn", "1", CALLER_CONTROL_VOL_TALK_DN, conference_loop_fn_volume_talk_dn},
- {"vol listen up", "6", CALLER_CONTROL_VOL_LISTEN_UP, conference_loop_fn_volume_listen_up},
- {"vol listen zero", "5", CALLER_CONTROL_VOL_LISTEN_ZERO, conference_loop_fn_volume_listen_zero},
- {"vol listen dn", "4", CALLER_CONTROL_VOL_LISTEN_DN, conference_loop_fn_volume_listen_dn},
- {"hangup", "#", CALLER_CONTROL_HANGUP, conference_loop_fn_hangup},
-#ifdef OPTION_IVR_MENU_SUPPORT
- {"menu", NULL, CALLER_CONTROL_MENU, conference_loop_fn_menu},
-#endif
- {"dial", NULL, CALLER_CONTROL_DIAL, conference_loop_fn_dial},
+ {"mute", "0", CALLER_CONTROL_MUTE, conference_loop_fn_mute_toggle},
+ {"deaf mute", "*", CALLER_CONTROL_DEAF_MUTE, conference_loop_fn_deafmute_toggle},
+ {"energy up", "9", CALLER_CONTROL_ENERGY_UP, conference_loop_fn_energy_up},
+ {"energy equ", "8", CALLER_CONTROL_ENERGY_EQU_CONF, conference_loop_fn_energy_equ_conf},
+ {"energy dn", "7", CALLER_CONTROL_ENERGEY_DN, conference_loop_fn_energy_dn},
+ {"vol talk up", "3", CALLER_CONTROL_VOL_TALK_UP, conference_loop_fn_volume_talk_up},
+ {"vol talk zero", "2", CALLER_CONTROL_VOL_TALK_ZERO, conference_loop_fn_volume_talk_zero},
+ {"vol talk dn", "1", CALLER_CONTROL_VOL_TALK_DN, conference_loop_fn_volume_talk_dn},
+ {"vol listen up", "6", CALLER_CONTROL_VOL_LISTEN_UP, conference_loop_fn_volume_listen_up},
+ {"vol listen zero", "5", CALLER_CONTROL_VOL_LISTEN_ZERO, conference_loop_fn_volume_listen_zero},
+ {"vol listen dn", "4", CALLER_CONTROL_VOL_LISTEN_DN, conference_loop_fn_volume_listen_dn},
+ {"hangup", "#", CALLER_CONTROL_HANGUP, conference_loop_fn_hangup},
+ {"event", NULL, CALLER_CONTROL_EVENT, conference_loop_fn_event}
};
#define CCFNTBL_QTY (sizeof(ccfntbl)/sizeof(ccfntbl[0]))
@@ -1547,14 +1506,15 @@
/* if a caller action has been detected, handle it */
if (caller_action != NULL && caller_action->fndesc != NULL && caller_action->fndesc->handler != NULL) {
- switch_channel_t *channel = switch_core_session_get_channel(member->session);
- switch_caller_profile_t *profile = switch_channel_get_caller_profile(channel);
+ //switch_channel_t *channel = switch_core_session_get_channel(member->session);
+ //switch_caller_profile_t *profile = switch_channel_get_caller_profile(channel);
char *param = NULL;
if (caller_action->fndesc->action != CALLER_CONTROL_MENU) {
param = caller_action->data;
}
+#ifdef INTENSE_DEBUG
switch_log_printf(SWITCH_CHANNEL_LOG,
SWITCH_LOG_INFO,
"executing caller control '%s' param '%s' on call '%u, %s, %s, %s'\n",
@@ -1565,7 +1525,9 @@
profile->caller_id_name,
profile->caller_id_number
);
- caller_action->fndesc->handler(member, caller_action->data);
+#endif
+
+ caller_action->fndesc->handler(member, caller_action);
/* set up for next pass */
caller_action = NULL;
@@ -3119,9 +3081,6 @@
}
xml_cfg.controls = switch_xml_child(cfg, "caller-controls");
-#ifdef OPTION_IVR_MENU_SUPPORT
- xml_cfg.menus = switch_xml_child(cfg, "menus");
-#endif
/* Release the config registry handle */
if (cxml) {
@@ -3187,6 +3146,7 @@
assert(stream != NULL);
if (argc > 2) {
+ stream->write_function(stream, "Record file %s\n", argv[2]);
launch_conference_record_thread(conference, argv[2]);
} else {
ret_status = SWITCH_STATUS_GENERR;
@@ -3204,7 +3164,8 @@
if (argc > 2) {
int all = (strcasecmp(argv[2], "all") == 0 );
-
+ stream->write_function(stream, "Stop recording file %s\n", argv[2]);
+
if (!conference_record_stop(conference, all ? NULL : argv[2]) && !all) {
stream->write_function(stream, "non-existant recording '%s'\n", argv[2]);
}
@@ -3834,10 +3795,6 @@
}
xml_cfg.controls = switch_xml_child(cfg, "caller-controls");
-#ifdef OPTION_IVR_MENU_SUPPORT
- xml_cfg.menus = switch_xml_child(cfg, "menus");
-#endif
-
/* if this is a bridging call, and it's not a duplicate, build a */
/* conference object, and skip pin handling, and locked checking */
@@ -4308,143 +4265,6 @@
/*.chat_interface */ &conference_chat_interface
};
-#ifdef OPTION_IVR_MENU_SUPPORT
-static switch_ivr_action_t conference_caller_control_menu_handler(switch_ivr_menu_t *menu, char *param, char *buf, size_t buflen, void *obj)
-{
- switch_ivr_action_t action = SWITCH_IVR_ACTION_NOOP;
-
- if (!switch_strlen_zero(param)) {
- if (obj != NULL) {
- int i, found;
- char *action_name = strdup(param);
-
- if (action_name != NULL) {
- char *sep = (action_name != NULL ? strchr(action_name, ' ') : NULL);
-
- /* split the action from any parameters */
- if (sep != NULL) {
- *sep = '\0';
- }
-
- /* find and execute the caller control handler */
- for(i = 0, found = 0; !found && i<CCFNTBL_QTY; i++) {
- found = (ccfntbl[i].action != CALLER_CONTROL_MENU && strcasecmp(ccfntbl[i].key, action_name) == 0);
- if (found) {
- if (obj != NULL) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "invoking caller control menu action '%s'\n", ccfntbl[i].key);
- ccfntbl[i].handler((conference_member_t *)obj, (sep != NULL ? sep+1 : NULL));
- if (ccfntbl[i].action == CALLER_CONTROL_HANGUP) {
- action = SWITCH_IVR_ACTION_DIE;
- }
- }
- }
- }
-
- free(action_name);
- }
-
- if (!found) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "unknown caller control menu action '%s'\n", param);
- }
- } else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "unable to invoke caller control menu action '%s', NULL member!\n", param);
- }
- } else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "NULL or empty param!\n");
- }
-
- return action;
-}
-
-/*
- static switch_status_t ivr_menu_callback_play_file(char *file, uint32_t leadin, void *member)
- {
- switch_status_t status;
-
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "ivr_menu_callback_play_file\n");
- status = conference_member_play_file((conference_member_t *)member, file, leadin);
- if (status != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ivr_menu_callback_play_file ERROR\n");
- }
-
- return status;
- }
-
- static switch_status_t ivr_menu_callback_say(char *file, uint32_t leadin, void *member)
- {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "ivr_menu_callback_say\n");
- return conference_member_say((conference_member_t *)member, file, leadin);
- }
-*/
-
-static switch_status_t conference_caller_control_menu_build(caller_control_menu_ctx_t **ctx,
- conference_obj_t *conference,
- switch_xml_t menu_group,
- char *menu_name)
-{
- switch_status_t status = SWITCH_STATUS_FALSE;
- switch_xml_t xml_menus;
- switch_xml_t xml_menu;
-
- assert(conference != NULL);
- assert(ctx != NULL);
- assert(menu_group != NULL);
- assert(menu_name != NULL);
- assert(xml_menus != NULL);
-
- xml_menus = switch_xml_child(menu_group, "menus");
- xml_menu = (xml_menus != NULL ? switch_xml_find_child(xml_menus, "menu", "name", menu_name) : NULL);
-
-
-
- /* if we found the requested menu in our menu_group */
- if (xml_menu != NULL && xml_menu != NULL) {
- *ctx = (caller_control_menu_ctx_t *)switch_core_alloc(conference->pool, sizeof(caller_control_menu_ctx_t));
-
- if (*ctx != NULL) {
- memset(*ctx, 0, sizeof(caller_control_menu_ctx_t));
-
- /* setup an xml parser context, and a menu stack context for the specified menu in our memory pool */
- status = switch_ivr_menu_stack_xml_init(&(*ctx)->xml_ctx, conference->pool);
- if (status == SWITCH_STATUS_SUCCESS) {
- (*ctx)->name = switch_core_strdup(conference->pool, menu_name);
-
- /* add our xml menu handler to the xml stack parser */
- status = switch_ivr_menu_stack_xml_add_custom((*ctx)->xml_ctx, "control", &conference_caller_control_menu_handler);
- if (status != SWITCH_STATUS_SUCCESS)
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "unable to add custom xml handler\n");
-
- /* parse the xml stack to build the menu stack */
- status = switch_ivr_menu_stack_xml_build((*ctx)->xml_ctx, &(*ctx)->menu_stack, xml_menus, xml_menu, conference->timer_name);
- if (status != SWITCH_STATUS_SUCCESS)
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "unable to build xml menu stack\n");
-
- /*
- // instruct ivr menu to use our file play and tts routines
- status = switch_ivr_menu_set_fileplay_callback((*ctx)->menu_stack, &ivr_menu_callback_play_file);
- if (status != SWITCH_STATUS_SUCCESS)
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "unable to set file play calback\n");
- status = switch_ivr_menu_set_tts_callback((*ctx)->menu_stack, &ivr_menu_callback_say);
- if (status != SWITCH_STATUS_SUCCESS)
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "unable to set tts calback\n");
- */
- } else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "unable to init xml menu context\n");
- }
- if (status != SWITCH_STATUS_SUCCESS)
- *ctx = NULL;
- }
- } else {
- if (xml_menus == NULL)
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "caller control menu unable to find xml menus\n");
- if (xml_menu == NULL)
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "caller control menu unable to find xml menu '%s'\n", menu_name);
- }
-
- return status;
-}
-#endif
-
static switch_status_t conf_default_controls(conference_obj_t *conference)
{
switch_status_t status = SWITCH_STATUS_FALSE;
@@ -4498,55 +4318,22 @@
for(i = 0, status = SWITCH_STATUS_NOOP; i<CCFNTBL_QTY && status == SWITCH_STATUS_NOOP; i++) {
if (strcasecmp(ccfntbl[i].key, key) == 0) {
- status = SWITCH_STATUS_SUCCESS;
-#ifdef OPTION_IVR_MENU_SUPPORT
- if (xml_menus != NULL && ccfntbl[i].action == CALLER_CONTROL_MENU) {
- char *menu_group_name = strdup(data);
- char *menu_name = (menu_group_name != NULL ? strchr(menu_group_name, '/') : NULL);
-
- /* format: "menu_group_name/menu_name" */
- /* separate the menu name from the menu group */
- if (menu_name != NULL) {
- *(menu_name++) = '\0';
- }
- /* if there is a menu name, build the menu */
- if (menu_name != NULL) {
- caller_control_menu_ctx_t *menu_ctx = NULL;
- switch_xml_t menu_group = switch_xml_find_child(xml_menus, "group", "name", menu_group_name);
-
- status = conference_caller_control_menu_build(&menu_ctx, conference, menu_group, menu_name);
- data = (char *)menu_ctx;
- } else {
- status = SWITCH_STATUS_FALSE;
- }
-
- if (status != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "unable to build menu '%s' bound to '%s'\n", data, val);
- }
-
- /* clean up */
- if (menu_group_name != NULL) {
- free(menu_group_name);
- }
- }
-#endif
-
- if (status == SWITCH_STATUS_SUCCESS) {
- caller_control_action_t *action;
+
+ caller_control_action_t *action;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Installing caller control action '%s' bound to '%s'.\n", key, val);
- action = (caller_control_action_t *)switch_core_alloc(conference->pool, sizeof(caller_control_action_t));
- if (action != NULL) {
- action->fndesc = &ccfntbl[i];
- action->data = (void *)switch_core_strdup(conference->pool, data);
- status = switch_ivr_digit_stream_parser_set_event(conference->dtmf_parser, val, action);
- } else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "unable to alloc memory for caller control binding '%s' to '%s'\n", ccfntbl[i].key, ccfntbl[i].digits);
- status = SWITCH_STATUS_MEMERR;
- }
- }
- }
- }
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Installing caller control action '%s' bound to '%s'.\n", key, val);
+ action = (caller_control_action_t *)switch_core_alloc(conference->pool, sizeof(caller_control_action_t));
+ if (action != NULL) {
+ action->fndesc = &ccfntbl[i];
+ action->data = (void *)switch_core_strdup(conference->pool, data);
+ action->binded_dtmf = switch_core_strdup(conference->pool, val);
+ status = switch_ivr_digit_stream_parser_set_event(conference->dtmf_parser, val, action);
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "unable to alloc memory for caller control binding '%s' to '%s'\n", ccfntbl[i].key, ccfntbl[i].digits);
+ status = SWITCH_STATUS_MEMERR;
+ }
+ }
+ }
if (status == SWITCH_STATUS_NOOP) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid caller control action name '%s'.\n", key);
}
@@ -4846,11 +4633,8 @@
} else if (strcasecmp(caller_controls, "none") != 0) {
/* try to build caller control if the group has been specified and != "none" */
switch_xml_t xml_controls = switch_xml_find_child(cfg.controls, "group", "name", caller_controls);
-#ifdef OPTION_IVR_MENU_SUPPORT
- status = conference_new_install_caller_controls_custom(conference, xml_controls, cfg.menus);
-#else
status = conference_new_install_caller_controls_custom(conference, xml_controls, NULL);
-#endif
+
if (status != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to install caller controls group '%s'\n", caller_controls);
}
1
0
[commit] r4613 - in freeswitch/trunk/src: . include mod/applications/mod_conference
by Freeswitch SVN 15 Mar '07
by Freeswitch SVN 15 Mar '07
15 Mar '07
Author: anthm
Date: Thu Mar 15 18:49:58 2007
New Revision: 4613
Modified:
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
freeswitch/trunk/src/switch_core.c
Log:
update
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Thu Mar 15 18:49:58 2007
@@ -732,6 +732,7 @@
SWITCH_FILE_PAUSE = (1 << 8) - Pause
SWITCH_FILE_NATIVE = (1 << 9) - File is in native format (no transcoding)
SWITCH_FILE_SEEK = (1 << 10) - File has done a seek
+SWITCH_FILE_OPEN = (1 << 11) - File is open
</pre>
*/
typedef enum {
@@ -745,7 +746,8 @@
SWITCH_FILE_DATA_RAW = (1 << 7),
SWITCH_FILE_PAUSE = (1 << 8),
SWITCH_FILE_NATIVE = (1 << 9),
- SWITCH_FILE_SEEK = (1 << 10)
+ SWITCH_FILE_SEEK = (1 << 10),
+ SWITCH_FILE_OPEN = (1 << 11)
} switch_file_flag_t;
typedef enum {
Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Thu Mar 15 18:49:58 2007
@@ -1724,22 +1724,30 @@
/* Sub-Routine called by a record entity inside a conference */
static void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, void *obj)
{
- switch_frame_t write_frame = {0};
uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE];
switch_file_handle_t fh = {0};
conference_member_t smember = {0}, *member;
conference_record_t *rec = (conference_record_t *) obj;
conference_obj_t *conference = rec->conference;
uint32_t samples = switch_bytes_per_frame(conference->rate, conference->interval);
- uint32_t bytes = samples * 2;
- uint32_t mux_used;
+ //uint32_t bytes = samples * 2;
+ uint32_t low_count = 0, mux_used;
char *vval;
+ switch_timer_t timer = {0};
+ uint32_t rlen;
if (switch_thread_rwlock_tryrdlock(conference->rwlock) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Read Lock Fail\n");
return NULL;
}
+ if (switch_core_timer_init(&timer, conference->timer_name, conference->interval, samples, rec->pool) == SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "setup timer success interval: %u samples: %u\n", conference->interval, samples);
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer Setup Failed. Conference Cannot Start\n");
+ return NULL;
+ }
+
switch_mutex_lock(globals.hash_mutex);
globals.threads++;
switch_mutex_unlock(globals.hash_mutex);
@@ -1748,9 +1756,6 @@
member->flags = MFLAG_CAN_HEAR | MFLAG_NOCHANNEL | MFLAG_RUNNING;
- write_frame.data = data;
- write_frame.buflen = sizeof(data);
-
member->conference = conference;
member->native_rate = conference->rate;
member->rec_path = rec->path;
@@ -1796,29 +1801,45 @@
}
while(switch_test_flag(member, MFLAG_RUNNING) && switch_test_flag(conference, CFLAG_RUNNING) && conference->count) {
- if ((mux_used = (uint32_t) switch_buffer_inuse(member->mux_buffer)) >= bytes) {
+ mux_used = (uint32_t) switch_buffer_inuse(member->mux_buffer);
+
+ if (switch_test_flag(member, MFLAG_FLUSH_BUFFER)) {
+ if (mux_used) {
+ switch_mutex_lock(member->audio_out_mutex);
+ switch_buffer_zero(member->mux_buffer);
+ switch_mutex_unlock(member->audio_out_mutex);
+ mux_used = 0;
+ }
+ switch_clear_flag_locked(member, MFLAG_FLUSH_BUFFER);
+ }
+
+ if (mux_used) {
/* Flush the output buffer and write all the data (presumably muxed) to the file */
switch_mutex_lock(member->audio_out_mutex);
- write_frame.data = data;
- while ((write_frame.datalen = (uint32_t)switch_buffer_read(member->mux_buffer, write_frame.data, mux_used))) {
+ low_count = 0;
+
+ if ((rlen = (uint32_t)switch_buffer_read(member->mux_buffer, data, sizeof(data)))) {
if (!switch_test_flag((&fh), SWITCH_FILE_PAUSE)) {
- switch_size_t len = (switch_size_t) mux_used / 2;
- switch_core_file_write(&fh, write_frame.data, &len);
+ switch_size_t len = (switch_size_t) rlen / sizeof(int16_t);
+ if (switch_core_file_write(&fh, data, &len) != SWITCH_STATUS_SUCCESS) {
+ goto end;
+ }
}
}
switch_mutex_unlock(member->audio_out_mutex);
} else {
- switch_yield(20000);
+ switch_core_timer_next(&timer);
}
} /* Rinse ... Repeat */
end:
+ switch_core_timer_destroy(&timer);
conference_del_member(conference, member);
switch_buffer_destroy(&member->audio_buffer);
switch_buffer_destroy(&member->mux_buffer);
switch_clear_flag_locked(member, MFLAG_RUNNING);
- if (fh.fd) {
+ if (switch_test_flag((&fh), SWITCH_FILE_OPEN)) {
switch_core_file_close(&fh);
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Recording Stopped\n");
@@ -2293,7 +2314,6 @@
uint32_t count = 0;
if (switch_test_flag(member, MFLAG_NOCHANNEL)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "continue\n");
continue;
}
Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c (original)
+++ freeswitch/trunk/src/switch_core.c Thu Mar 15 18:49:58 2007
@@ -1025,7 +1025,7 @@
switch_status_t status;
char stream_name[128] = "";
char *rhs = NULL;
-
+
if ((rhs = strstr(file_path, SWITCH_URL_SEPARATOR))) {
switch_copy_string(stream_name, file_path, (rhs+1) - file_path);
ext = stream_name;
@@ -1069,7 +1069,11 @@
fh->channels = 1;
}
- return fh->file_interface->file_open(fh, file_path);
+ if ((status = fh->file_interface->file_open(fh, file_path)) == SWITCH_STATUS_SUCCESS) {
+ switch_set_flag(fh, SWITCH_FILE_OPEN);
+ }
+
+ return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_file_read(switch_file_handle_t *fh, void *data, switch_size_t *len)
@@ -1113,7 +1117,9 @@
SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh)
{
+ switch_clear_flag(fh, SWITCH_FILE_OPEN);
return fh->file_interface->file_close(fh);
+
}
SWITCH_DECLARE(switch_status_t) switch_core_directory_open(switch_directory_handle_t *dh,
1
0
Author: anthm
Date: Thu Mar 15 18:38:25 2007
New Revision: 4612
Modified:
freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c
Log:
add stream write thread
Modified: freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c Thu Mar 15 18:38:25 2007
@@ -64,6 +64,7 @@
FILE *fp;
int samplerate;
uint8_t thread_running;
+ uint8_t shout_init;
};
typedef struct shout_context shout_context_t;
@@ -421,7 +422,7 @@
#define MY_BUF_LEN 1024 * 32
#define MY_BLOCK_SIZE MY_BUF_LEN
-static void *SWITCH_THREAD_FUNC stream_thread(switch_thread_t *thread, void *obj)
+static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void *obj)
{
CURL *curl_handle = NULL;
shout_context_t *context = (shout_context_t *) obj;
@@ -441,7 +442,7 @@
return NULL;
}
-static void launch_stream_thread(shout_context_t *context)
+static void launch_read_stream_thread(shout_context_t *context)
{
switch_thread_t *thread;
switch_threadattr_t *thd_attr = NULL;
@@ -454,7 +455,75 @@
switch_threadattr_create(&thd_attr, context->memory_pool);
switch_threadattr_detach_set(thd_attr, 1);
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
- switch_thread_create(&thread, thd_attr, stream_thread, context, context->memory_pool);
+ switch_thread_create(&thread, thd_attr, read_stream_thread, context, context->memory_pool);
+}
+
+static void *SWITCH_THREAD_FUNC write_stream_thread(switch_thread_t *thread, void *obj)
+{
+ shout_context_t *context = (shout_context_t *) obj;
+
+ while(!context->err && context->thread_running) {
+ unsigned char mp3buf[8192] = "";
+ unsigned char audio[8192] = "";
+ switch_size_t audio_read = 0;
+ int rlen;
+ long ret = 0;
+
+ switch_mutex_lock(context->audio_mutex);
+ if (context->audio_buffer) {
+ audio_read = switch_buffer_read(context->audio_buffer, audio, sizeof(audio));
+ } else {
+ context->err++;
+ }
+ switch_mutex_unlock(context->audio_mutex);
+
+ error_check();
+
+ if (!audio_read) {
+ audio_read = sizeof(audio);
+ memset(audio, 255, sizeof(audio));
+ }
+
+ if ((rlen = lame_encode_buffer(context->gfp, (void *) audio, NULL, audio_read / sizeof(int16_t), mp3buf, sizeof(mp3buf))) < 0) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "MP3 encode error %d!\n", rlen);
+ goto error;
+ }
+
+ if (rlen) {
+ ret = shout_send(context->shout, mp3buf, rlen);
+ if (ret != SHOUTERR_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Send error: %s\n", shout_get_error(context->shout));
+ goto error;
+ }
+ } else {
+ memset(mp3buf, 0, 128);
+ ret = shout_send(context->shout, mp3buf, 128);
+ }
+
+ shout_sync(context->shout);
+ switch_yield(100000);
+ }
+
+ error:
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Thread Done\n");
+ context->thread_running = 0;
+ return NULL;
+}
+
+static void launch_write_stream_thread(shout_context_t *context)
+{
+ switch_thread_t *thread;
+ switch_threadattr_t *thd_attr = NULL;
+
+ if (context->err) {
+ return;
+ }
+
+ context->thread_running = 1;
+ switch_threadattr_create(&thd_attr, context->memory_pool);
+ switch_threadattr_detach_set(thd_attr, 1);
+ switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
+ switch_thread_create(&thread, thd_attr, write_stream_thread, context, context->memory_pool);
}
static switch_status_t shout_file_open(switch_file_handle_t *handle, char *path)
@@ -485,7 +554,7 @@
InitMP3(&context->mp, OUTSCALE, context->samplerate);
if (handle->handler) {
context->stream_url = switch_core_sprintf(context->memory_pool, "http://%s", path);
- launch_stream_thread(context);
+ launch_read_stream_thread(context);
} else {
if (switch_file_open(&context->fd, path, SWITCH_FOPEN_READ,
SWITCH_FPROT_UREAD|SWITCH_FPROT_UWRITE, handle->memory_pool) != SWITCH_STATUS_SUCCESS) {
@@ -513,6 +582,11 @@
lame_print_config(context->gfp);
if (handle->handler) {
+ if (switch_buffer_create_dynamic(&context->audio_buffer, MY_BLOCK_SIZE, MY_BUF_LEN, 0) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
+ goto error;
+ }
+ switch_mutex_init(&context->audio_mutex, SWITCH_MUTEX_NESTED, context->memory_pool);
lame_set_bWriteVbrTag(context->gfp, 0);
lame_mp3_tags_fid(context->gfp, NULL);
@@ -571,7 +645,7 @@
goto error;
}
- if (shout_set_url(context->shout, "mod_shout") != SHOUTERR_SUCCESS) {
+ if (shout_set_url(context->shout, "http://www.freeswitch.org") != SHOUTERR_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error setting name: %s\n", shout_get_error(context->shout));
goto error;
}
@@ -586,10 +660,6 @@
goto error;
}
- if (shout_open(context->shout) != SHOUTERR_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening stream: %s\n", shout_get_error(context->shout));
- goto error;
- }
} else {
handle->seekable = 1;
/* lame being lame and all has FILE * coded into it's API for some functions so we gotta use it */
@@ -689,31 +759,45 @@
{
shout_context_t *context = handle->private_info;
unsigned char mp3buf[2048] = "";
- long ret = 0;
int rlen;
int16_t *audio = data;
int nsamples = *len;
- assert(context->gfp);
- if ((rlen = lame_encode_buffer(context->gfp, audio, NULL, nsamples, mp3buf, sizeof(mp3buf))) < 0) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "MP3 encode error %d!\n", rlen);
- return SWITCH_STATUS_FALSE;
+ if (context->shout && !context->shout_init) {
+ context->shout_init++;
+ if (shout_open(context->shout) != SHOUTERR_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening stream: %s\n", shout_get_error(context->shout));
+ context->err++;
+ return SWITCH_STATUS_FALSE;
+ }
+ launch_write_stream_thread(context);
}
if (handle->handler) {
- if (rlen) {
- ret = shout_send(context->shout, mp3buf, rlen);
- if (ret != SHOUTERR_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Send error: %s\n", shout_get_error(context->shout));
- return SWITCH_STATUS_FALSE;
+ switch_mutex_lock(context->audio_mutex);
+ if (context->audio_buffer) {
+ if (!switch_buffer_write(context->audio_buffer, data, nsamples * sizeof(int16_t))) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Buffer error\n");
+ context->err++;
}
+ } else {
+ context->err++;
+ }
+ switch_mutex_unlock(context->audio_mutex);
+ if (context->err) {
+ return SWITCH_STATUS_FALSE;
}
- shout_sync(context->shout);
} else {
- if (fwrite(mp3buf, 1, rlen, context->fp) < 0) {
+ if ((rlen = lame_encode_buffer(context->gfp, audio, NULL, nsamples, mp3buf, sizeof(mp3buf))) < 0) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "MP3 encode error %d!\n", rlen);
return SWITCH_STATUS_FALSE;
}
+ if (rlen) {
+ if (fwrite(mp3buf, 1, rlen, context->fp) < 0) {
+ return SWITCH_STATUS_FALSE;
+ }
+ }
}
return SWITCH_STATUS_SUCCESS;
1
0
[commit] r4611 - freeswitch/branches/anthonyl/fs-branch/src/mod/endpoints/mod_sofia
by Freeswitch SVN 15 Mar '07
by Freeswitch SVN 15 Mar '07
15 Mar '07
Author: anthonyl
Date: Thu Mar 15 17:39:15 2007
New Revision: 4611
Modified:
freeswitch/branches/anthonyl/fs-branch/src/mod/endpoints/mod_sofia/mod_sofia.c
Log:
2 switch_log_printf's ... boring ;)
Modified: freeswitch/branches/anthonyl/fs-branch/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/anthonyl/fs-branch/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/branches/anthonyl/fs-branch/src/mod/endpoints/mod_sofia/mod_sofia.c Thu Mar 15 17:39:15 2007
@@ -2234,7 +2234,9 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find a c= line in the sdp!\n");
return 0;
}
-
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "c=%s\n", sdp->sdp_connection);
+
if ((tech_pvt->origin = switch_core_session_strdup(session, (char *) sdp->sdp_origin->o_username))) {
if (strstr(tech_pvt->origin, "CiscoSystemsSIP-GW-UserAgent")) {
switch_set_flag_locked(tech_pvt, TFLAG_BUGGY_2833);
@@ -4065,6 +4067,8 @@
char *from_port;
char uri[1024];
+ /* just a little debugging statment for following the whole sofiasip flow */
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "inside sip_i_invite()\n");
if ((profile->pflags & PFLAG_AUTH_CALLS)) {
if (handle_register(nua, profile, nh, sip, REG_INVITE, key, sizeof(key))) {
1
0
Author: anthm
Date: Thu Mar 15 15:39:18 2007
New Revision: 4610
Modified:
freeswitch/trunk/src/mod/formats/mod_shout/Makefile
Log:
fix build
Modified: freeswitch/trunk/src/mod/formats/mod_shout/Makefile
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_shout/Makefile (original)
+++ freeswitch/trunk/src/mod/formats/mod_shout/Makefile Thu Mar 15 15:39:18 2007
@@ -34,7 +34,7 @@
$(SHOUT_DIR)/Makefile:
$(GETLIB) $(SHOUT).tar.gz
- cd $(SHOUT_DIR) && ./configure $(DEFAULT_ARGS)
+ cd $(SHOUT_DIR) && ./configure $(DEFAULT_ARGS) --with-speex=no
$(SHOUTLA): $(SHOUT_DIR)/Makefile
cd $(SHOUT_DIR) && $(MAKE)
1
0
Author: mikej
Date: Thu Mar 15 15:05:54 2007
New Revision: 4609
Modified:
freeswitch/trunk/libs/js/Makefile.in
Log:
don't wipe out the DESTDIR
Modified: freeswitch/trunk/libs/js/Makefile.in
==============================================================================
--- freeswitch/trunk/libs/js/Makefile.in (original)
+++ freeswitch/trunk/libs/js/Makefile.in Thu Mar 15 15:05:54 2007
@@ -32,7 +32,6 @@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
-DESTDIR =
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
1
0
Author: anthm
Date: Thu Mar 15 15:00:49 2007
New Revision: 4608
Modified:
freeswitch/trunk/modules.conf.in
Log:
update default configs
Modified: freeswitch/trunk/modules.conf.in
==============================================================================
--- freeswitch/trunk/modules.conf.in (original)
+++ freeswitch/trunk/modules.conf.in Thu Mar 15 15:00:49 2007
@@ -40,6 +40,7 @@
#event_handlers/mod_zeroconf
formats/mod_native_file
formats/mod_sndfile
+#formats/mod_shout
#languages/mod_perl
#languages/mod_spidermonkey
#languages/mod_spidermonkey_teletone
1
0