skypiax: nothin to see here

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16618 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Giovanni Maruzzelli 2010-02-12 09:28:19 +00:00
parent c6d10622a0
commit 67228dbd3c
32 changed files with 31343 additions and 28 deletions

View File

@ -0,0 +1,610 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# src/mod/endpoints/mod_skypiax/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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.
srcdir = .
top_srcdir = ../../../..
pkgdatadir = $(datadir)/libfreeswitch
pkglibdir = $(libdir)/libfreeswitch
pkgincludedir = $(includedir)/libfreeswitch
top_builddir = ../../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/install -c
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 = i686-redhat-linux-gnu
host_triplet = i686-redhat-linux-gnu
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/build/modmake.rulesam
subdir = src/mod/endpoints/mod_skypiax
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(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)/build/config/ax_lib_mysql.m4 \
$(top_srcdir)/build/config/ax_check_java.m4 \
$(top_srcdir)/build/config/erlang.m4 \
$(top_srcdir)/build/config/odbc.m4 \
$(top_srcdir)/build/config/sched_setaffinity.m4 \
$(top_srcdir)/libs/apr/build/apr_common.m4 \
$(top_srcdir)/libs/sofia-sip/m4/sac-pkg-config.m4 \
$(top_srcdir)/libs/sofia-sip/m4/sac-openssl.m4 \
$(top_srcdir)/build/config/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 \
$(top_builddir)/libs/xmlrpc-c/xmlrpc_amconfig.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(moddir)"
modLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(mod_LTLIBRARIES)
mod_skypiax_la_DEPENDENCIES = $(switch_builddir)/libfreeswitch.la
am_mod_skypiax_la_OBJECTS = mod_skypiax_la-mod_skypiax.lo \
mod_skypiax_la-skypiax_protocol.lo
mod_skypiax_la_OBJECTS = $(am_mod_skypiax_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include -I$(top_builddir)/libs/xmlrpc-c
depcomp = $(SHELL) $(top_srcdir)/build/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(mod_skypiax_la_SOURCES)
DIST_SOURCES = $(mod_skypiax_la_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /usr/src/freeswitch/build/config/missing --run aclocal-1.9
AMDEP_FALSE = #
AMDEP_TRUE =
AMTAR = ${SHELL} /usr/src/freeswitch/build/config/missing --run tar
AM_MAKEFLAGS = `test -n "$(VERBOSE)" || echo -s`
AR = ar
ATTR_UNUSED = __attribute__((__unused__))
AUTOCONF = ${SHELL} /usr/src/freeswitch/build/config/missing --run autoconf
AUTOHEADER = ${SHELL} /usr/src/freeswitch/build/config/missing --run autoheader
AUTOMAKE = ${SHELL} /usr/src/freeswitch/build/config/missing --run automake-1.9
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CONF_DISABLED_MODULES = $$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed -e "s|^.*/||" | sort | uniq )
CONF_MODULES = $$(grep -v "\#" $(switch_builddir)/modules.conf | sed -e "s|^.*/||" | sort | uniq )
CPP = gcc -E
CPPFLAGS =
CURL = /usr/bin/curl
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DIRECTORY_SEPARATOR = /
DYNAMIC_LIB_EXTEN = so
ECHO = echo
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = grep -E
ENABLE_CPP_FALSE = #
ENABLE_CPP_TRUE =
ENABLE_ZRTP_FALSE =
ENABLE_ZRTP_TRUE = #
ERLANG = no
ERLANG_CFLAGS =
ERLANG_LDFLAGS =
ESL_LDFLAGS =
EXEEXT =
GETLIB = cd /usr/src/freeswitch/libs && /bin/sh /usr/src/freeswitch/build/getlib.sh
GETSOUNDS = /bin/sh /usr/src/freeswitch/build/getsounds.sh
HAVE_LIBEDIT_FALSE = #
HAVE_LIBEDIT_TRUE =
HAVE_LIBWWW_SSL_DEFINE = 0
HAVE_MYSQL_FALSE =
HAVE_MYSQL_TRUE = #
HAVE_ODBC_FALSE =
HAVE_ODBC_TRUE = #
HAVE_TLS_FALSE =
HAVE_TLS_TRUE = #
HAVE_WCHAR_H_DEFINE = 1
HasJava_FALSE =
HasJava_TRUE = #
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
IS64BITLINUX_FALSE =
IS64BITLINUX_TRUE = #
ISLINUX_FALSE = #
ISLINUX_TRUE =
ISMAC_FALSE =
ISMAC_TRUE = #
JACK_CFLAGS =
JACK_LIBS =
JAVA_FLAGS =
JAVA_HOME =
LDFLAGS =
LIBCURL = ${switch_builddir}/libs/curl/lib/libcurl.la
LIBCURL_CPPFLAGS = -I${switch_srcdir}/libs/curl/include
LIBCURL_DEPS = ${switch_builddir}/libs/curl/lib/libcurl.la
LIBOBJS =
# Dirty trick to override the link output
LIBS = -lncurses > $(MODNAME).log || error="yes";if test -n "$(VERBOSE)" \
-o "$$error" = "yes";then cat $(MODNAME).log;fi;if test \
"$$error" = "yes";then exit 1;fi
#we should set all these vars from configure, no reason to have these in each Makefile.am
LIBTOOL = echo "`link=\`echo $@|grep .la;echo $@|grep .so;echo $@|grep .dll\`;if test -n "$$link"; then echo Creating $@;fi`";`if test -z "$(VERBOSE)" ; \
then echo $(SHELL) $(switch_builddir)/quiet_libtool ;else echo $(SHELL) $(switch_builddir)/libtool; fi`
LIBTOOL_LIB_EXTEN = so
LIB_JAVA =
LIB_SUBDIR = lib
LN_S = ln -s
LTLIBOBJS =
MAKEINFO = ${SHELL} /usr/src/freeswitch/build/config/missing --run makeinfo
OBJEXT = o
ODBC_INC_DIR =
ODBC_INC_FLAGS =
ODBC_LIB_DIR =
ODBC_LIB_FLAGS =
OUR_CLEAN_MODS = $$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )
OUR_DISABLED_CLEAN_MODS = $$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )
OUR_DISABLED_INSTALL_MODS = $$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )
OUR_DISABLED_MODS = $$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )
OUR_DISABLED_UNINSTALL_MODS = $$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )
OUR_INSTALL_MODS = $$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )
OUR_MODS = $$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )
OUR_UNINSTALL_MODS = $$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )
PACKAGE = libfreeswitch
PACKAGE_BUGREPORT = BUG-REPORT-ADDRESS
PACKAGE_NAME = freeswitch
PACKAGE_STRING = freeswitch 1.0.trunk
PACKAGE_TARNAME = freeswitch
PACKAGE_VERSION = 1.0.trunk
PATH_SEPARATOR = :
PA_LIBS =
PKG_CONFIG = no
PLATFORM_CORE_DEPLIBS =
PRTDIAG =
PYTHON = /usr/bin/python
PYTHON_CFLAGS = -I/usr/include/python2.4 -I/usr/include/python2.4 -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC
PYTHON_LDFLAGS = -lpthread -ldl -lutil -lm -lpython2.4
PYTHON_SITE_DIR = /usr/lib/python2.4/site-packages
RANLIB = ranlib
SED = /bin/sed
SET_MAKE =
SHELL = /bin/sh
SOLINK = -shared -Xlinker -x
STRIP = strip
SWITCH_AM_CFLAGS = -I/usr/src/freeswitch/src/include -I/usr/src/freeswitch/src/include -I/usr/src/freeswitch/libs/libteletone/src -fPIC -Werror -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -g -ggdb
SWITCH_AM_CXXFLAGS = -I/usr/src/freeswitch/src/include -I/usr/src/freeswitch/src/include -I/usr/src/freeswitch/libs/libteletone/src -fPIC -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1
SWITCH_AM_LDFLAGS = -lm
SWITCH_ANSI_CFLAGS = -Wall -std=c99 -pedantic -Wdeclaration-after-statement
SWITCH_VERSION_MAJOR = 1
SWITCH_VERSION_MICRO = trunk
SWITCH_VERSION_MINOR = 0
TAR = /bin/gtar
TOUCH_TARGET = if test -f "$@";then touch "$@";fi;
VA_LIST_IS_ARRAY_DEFINE = 0
VERSION = 0.1
WANT_DEBUG_FALSE = #
WANT_DEBUG_TRUE =
WGET = /usr/bin/wget
ZCAT = /bin/gunzip
_libcurl_config =
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_CXX = g++
ac_ct_RANLIB = ranlib
ac_ct_STRIP = strip
am__fastdepCC_FALSE = #
am__fastdepCC_TRUE =
am__fastdepCXX_FALSE = #
am__fastdepCXX_TRUE =
am__include = include
am__leading_dot = .
am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build = i686-redhat-linux-gnu
build_alias =
build_cpu = i686
build_os = linux-gnu
build_vendor = redhat
confdir = /usr/local/freeswitch/conf
datadir = ${prefix}/share
dbdir = /usr/local/freeswitch/db
exec_prefix = ${prefix}
grammardir = /usr/local/freeswitch/grammar
host = i686-redhat-linux-gnu
host_alias =
host_cpu = i686
host_os = linux-gnu
host_vendor = redhat
htdocsdir = /usr/local/freeswitch/htdocs
includedir = ${prefix}/include
infodir = ${prefix}/info
install_sh = /usr/src/freeswitch/build/config/install-sh
int64_t_fmt = #define SWITCH_INT64_T_FMT "lld"
int64_value = long long
int_value = int
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localstatedir = ${prefix}/var
logfiledir = /usr/local/freeswitch/log
long_value = long long
mandir = ${prefix}/man
mkdir_p = mkdir -p --
modulesdir = /usr/local/freeswitch/mod
oldincludedir = /usr/include
openssl_CFLAGS =
openssl_LIBS =
prefix = /usr/local/freeswitch
program_transform_name = s,x,x,
recordingsdir = /usr/local/freeswitch/recordings
runtimedir = /usr/local/freeswitch/run
sbindir = ${exec_prefix}/sbin
scriptdir = /usr/local/freeswitch/scripts
sharedstatedir = ${prefix}/com
short_value = short
size_t_fmt = #define SWITCH_SIZE_T_FMT "d"
size_t_value = size_t
soundsdir = /usr/local/freeswitch/sounds
ssize_t_fmt = #define SWITCH_SSIZE_T_FMT "d"
ssize_t_value = ssize_t
subdirs = libs/srtp libs/sqlite libs/libedit libs/pcre libs/apr libs/apr-util libs/ilbc libs/curl libs/iksemel libs/js/nsprpub libs/js libs/libdingaling libs/libsndfile libs/sofia-sip libs/speex libs/portaudio libs/openzap libs/unimrcp libs/tiff-3.8.2 libs/spandsp libs/broadvoice libs/libg722_1
switch_builddir = /usr/src/freeswitch
switch_srcdir = /usr/src/freeswitch
sysconfdir = /usr/local/freeswitch/conf
target_alias =
uint64_t_fmt = #define SWITCH_UINT64_T_FMT "llu"
voidp_size = 4
AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS)
AM_CPPFLAGS = $(SWITCH_AM_CXXFLAGS)
AM_LDFLAGS = $(SWITCH_AM_LDFLAGS)
moddir = /usr/local/freeswitch/mod
MODNAME = mod_skypiax
mod_LTLIBRARIES = mod_skypiax.la
mod_skypiax_la_SOURCES = mod_skypiax.c skypiax_protocol.c
mod_skypiax_la_CFLAGS = $(AM_CFLAGS) -DSKYPIAX_SVN_VERSION=\"`cat $(switch_builddir)/.version`\"
mod_skypiax_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_skypiax_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lX11
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/build/modmake.rulesam $(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/mod/endpoints/mod_skypiax/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/mod/endpoints/mod_skypiax/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
install-modLTLIBRARIES: $(mod_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(moddir)" || $(mkdir_p) "$(DESTDIR)$(moddir)"
@list='$(mod_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(modLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(moddir)/$$f'"; \
$(LIBTOOL) --mode=install $(modLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(moddir)/$$f"; \
else :; fi; \
done
uninstall-modLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@set -x; list='$(mod_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(moddir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(moddir)/$$p"; \
done
clean-modLTLIBRARIES:
-test -z "$(mod_LTLIBRARIES)" || rm -f $(mod_LTLIBRARIES)
@list='$(mod_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
mod_skypiax.la: $(mod_skypiax_la_OBJECTS) $(mod_skypiax_la_DEPENDENCIES)
$(LINK) -rpath $(moddir) $(mod_skypiax_la_LDFLAGS) $(mod_skypiax_la_OBJECTS) $(mod_skypiax_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/mod_skypiax_la-mod_skypiax.Plo
include ./$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Plo
.c.o:
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c $<
.c.obj:
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=yes \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(LTCOMPILE) -c -o $@ $<
mod_skypiax_la-mod_skypiax.lo: mod_skypiax.c
if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -MT mod_skypiax_la-mod_skypiax.lo -MD -MP -MF "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo" -c -o mod_skypiax_la-mod_skypiax.lo `test -f 'mod_skypiax.c' || echo '$(srcdir)/'`mod_skypiax.c; \
then mv -f "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo" "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Plo"; else rm -f "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo"; exit 1; fi
# source='mod_skypiax.c' object='mod_skypiax_la-mod_skypiax.lo' libtool=yes \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -c -o mod_skypiax_la-mod_skypiax.lo `test -f 'mod_skypiax.c' || echo '$(srcdir)/'`mod_skypiax.c
mod_skypiax_la-skypiax_protocol.lo: skypiax_protocol.c
if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -MT mod_skypiax_la-skypiax_protocol.lo -MD -MP -MF "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo" -c -o mod_skypiax_la-skypiax_protocol.lo `test -f 'skypiax_protocol.c' || echo '$(srcdir)/'`skypiax_protocol.c; \
then mv -f "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo" "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Plo"; else rm -f "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo"; exit 1; fi
# source='skypiax_protocol.c' object='mod_skypiax_la-skypiax_protocol.lo' libtool=yes \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -c -o mod_skypiax_la-skypiax_protocol.lo `test -f 'skypiax_protocol.c' || echo '$(srcdir)/'`skypiax_protocol.c
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
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: $(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; }'`; \
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: $(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)
$(mkdir_p) $(distdir)/../../../../build
@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
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(moddir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
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-am
clean-am: clean-generic clean-libtool clean-modLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-modLTLIBRARIES
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-modLTLIBRARIES
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-modLTLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-libtool \
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-modLTLIBRARIES install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-modLTLIBRARIES
all-modules: all
depend-modules: depend
clean-modules: clean
install-modules: install
uninstall-modules: uninstall
distclean-modules: distclean
extraclean-modules: extraclean
# 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:

View File

@ -0,0 +1,964 @@
/*
* Dummy soundcard
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <sound/driver.h> //giova
#include <linux/init.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/jiffies.h>
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/wait.h>
#include <linux/moduleparam.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/tlv.h>
#include <sound/pcm.h>
#include <sound/rawmidi.h>
#include <sound/initval.h>
MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
MODULE_DESCRIPTION("Dummy soundcard (/dev/null)");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{ALSA,Dummy soundcard}}");
#define GIOVAMULTI 1
#define MAX_PCM_DEVICES 4
#define MAX_PCM_SUBSTREAMS 128
#define MAX_MIDI_DEVICES 2
#if 0 /* emu10k1 emulation */
#define MAX_BUFFER_SIZE (128 * 1024)
static int emu10k1_playback_constraints(struct snd_pcm_runtime *runtime)
{
int err;
err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
if (err < 0)
return err;
err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256, UINT_MAX);
if (err < 0)
return err;
return 0;
}
#define add_playback_constraints emu10k1_playback_constraints
#endif
#if 0 /* RME9652 emulation */
#define MAX_BUFFER_SIZE (26 * 64 * 1024)
#define USE_FORMATS SNDRV_PCM_FMTBIT_S32_LE
#define USE_CHANNELS_MIN 26
#define USE_CHANNELS_MAX 26
#define USE_PERIODS_MIN 2
#define USE_PERIODS_MAX 2
#endif
#if 0 /* ICE1712 emulation */
#define MAX_BUFFER_SIZE (256 * 1024)
#define USE_FORMATS SNDRV_PCM_FMTBIT_S32_LE
#define USE_CHANNELS_MIN 10
#define USE_CHANNELS_MAX 10
#define USE_PERIODS_MIN 1
#define USE_PERIODS_MAX 1024
#endif
#if 0 /* UDA1341 emulation */
#define MAX_BUFFER_SIZE (16380)
#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE
#define USE_CHANNELS_MIN 2
#define USE_CHANNELS_MAX 2
#define USE_PERIODS_MIN 2
#define USE_PERIODS_MAX 255
#endif
#if 0 /* simple AC97 bridge (intel8x0) with 48kHz AC97 only codec */
#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE
#define USE_CHANNELS_MIN 2
#define USE_CHANNELS_MAX 2
#define USE_RATE SNDRV_PCM_RATE_48000
#define USE_RATE_MIN 48000
#define USE_RATE_MAX 48000
#endif
#if 0 /* CA0106 */
#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE
#define USE_CHANNELS_MIN 2
#define USE_CHANNELS_MAX 2
#define USE_RATE (SNDRV_PCM_RATE_48000|SNDRV_PCM_RATE_96000|SNDRV_PCM_RATE_192000)
#define USE_RATE_MIN 48000
#define USE_RATE_MAX 192000
#define MAX_BUFFER_SIZE ((65536-64)*8)
#define MAX_PERIOD_SIZE (65536-64)
#define USE_PERIODS_MIN 2
#define USE_PERIODS_MAX 8
#endif
/* defaults */
#ifndef MAX_BUFFER_SIZE
//#define MAX_BUFFER_SIZE (64*1024)
#define MAX_BUFFER_SIZE (256*1024)
#endif
#ifndef MAX_PERIOD_SIZE
#define MAX_PERIOD_SIZE MAX_BUFFER_SIZE
#endif
#ifndef USE_FORMATS
//#define USE_FORMATS (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE)
#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE
#endif
#ifndef USE_RATE
//#define USE_RATE SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000
#define USE_RATE SNDRV_PCM_RATE_8000
//#define USE_RATE_MIN 5500
#define USE_RATE_MIN 8000
//#define USE_RATE_MAX 48000
#define USE_RATE_MAX 8000
#endif
#ifndef USE_CHANNELS_MIN
#define USE_CHANNELS_MIN 1
#endif
#ifndef USE_CHANNELS_MAX
#define USE_CHANNELS_MAX 2
#endif
#ifndef USE_PERIODS_MIN
#define USE_PERIODS_MIN 1
#endif
#ifndef USE_PERIODS_MAX
#define USE_PERIODS_MAX 1024
#endif
#ifndef add_playback_constraints
#define add_playback_constraints(x) 0
#endif
#ifndef add_capture_constraints
#define add_capture_constraints(x) 0
#endif
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = { 1,[1 ... (SNDRV_CARDS - 1)] = 0 };
static int pcm_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1 };
static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 128 };
//static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for dummy soundcard.");
module_param_array(id, charp, NULL, 0444);
MODULE_PARM_DESC(id, "ID string for dummy soundcard.");
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable this dummy soundcard.");
module_param_array(pcm_devs, int, NULL, 0444);
MODULE_PARM_DESC(pcm_devs, "PCM devices # (0-4) for dummy driver.");
module_param_array(pcm_substreams, int, NULL, 0444);
MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-64) for dummy driver.");
//module_param_array(midi_devs, int, NULL, 0444);
//MODULE_PARM_DESC(midi_devs, "MIDI devices # (0-2) for dummy driver.");
static struct platform_device *devices[SNDRV_CARDS];
static struct timer_list giovatimer; //giova
static int giovastarted = 0;
static int giovaindex = 0;
static spinlock_t giovalock;
struct giovadpcm {
struct snd_pcm_substream *substream;
struct snd_dummy_pcm *dpcm;
int started;
};
static struct giovadpcm giovadpcms[MAX_PCM_SUBSTREAMS];
#define MIXER_ADDR_MASTER 0
#define MIXER_ADDR_LINE 1
#define MIXER_ADDR_MIC 2
#define MIXER_ADDR_SYNTH 3
#define MIXER_ADDR_CD 4
#define MIXER_ADDR_LAST 4
static void snd_card_dummy_pcm_timer_function(unsigned long data);
struct snd_dummy {
struct snd_card *card;
struct snd_pcm *pcm;
spinlock_t mixer_lock;
int mixer_volume[MIXER_ADDR_LAST + 1][2];
int capture_source[MIXER_ADDR_LAST + 1][2];
};
struct snd_dummy_pcm {
struct snd_dummy *dummy;
spinlock_t lock;
struct timer_list timer;
unsigned int pcm_buffer_size;
unsigned int pcm_period_size;
unsigned int pcm_bps; /* bytes per second */
unsigned int pcm_hz; /* HZ */
unsigned int pcm_irq_pos; /* IRQ position */
unsigned int pcm_buf_pos; /* position in buffer */
struct snd_pcm_substream *substream;
};
static inline void snd_card_dummy_pcm_timer_start(struct snd_dummy_pcm *dpcm)
{
int i;
int found = 0;
//printk("giova: 1 timer_start %d %p\n", __LINE__, dpcm);
for (i = 0; i < giovaindex + 1; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
if (giovadpcms[i].dpcm == dpcm) {
giovadpcms[i].started = 1;
found = 1;
}
}
if (!found) {
printk("skypiax: start, NOT found?\n");
}
//printk("giova: 2 timer_start %d %p\n", __LINE__, dpcm);
}
static inline void snd_card_dummy_pcm_timer_stop(struct snd_dummy_pcm *dpcm)
{
//del_timer(&dpcm->timer);
int i;
int found = 0;
//printk("giova: 1 timer_stop %d %p\n", __LINE__, dpcm);
for (i = 0; i < giovaindex + 1; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
if (giovadpcms[i].dpcm == dpcm) {
giovadpcms[i].started = 0;
found = 1;
}
}
if (!found) {
//printk("skypiax: stop, NOT found?\n");
} else {
//printk("skypiax: stop, YES found!\n");
}
//printk("giova: 2 timer_stop %d %p\n", __LINE__, dpcm);
}
static int snd_card_dummy_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm = runtime->private_data;
int err = 0;
//spin_lock(&dpcm->lock, flags);
spin_lock_bh(&giovalock);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
//printk("giova: trigger timer_start %d %p\n", __LINE__, dpcm);
snd_card_dummy_pcm_timer_start(dpcm);
break;
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
//printk("giova: trigger timer_stop %d %p\n", __LINE__, dpcm);
snd_card_dummy_pcm_timer_stop(dpcm);
break;
default:
err = -EINVAL;
break;
}
//spin_unlock(&dpcm->lock, flags);
spin_unlock_bh(&giovalock);
return 0;
}
static int snd_card_dummy_pcm_prepare(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm = runtime->private_data;
int bps;
bps = snd_pcm_format_width(runtime->format) * runtime->rate * runtime->channels / 8;
if (bps <= 0)
return -EINVAL;
dpcm->pcm_bps = bps;
dpcm->pcm_hz = HZ;
dpcm->pcm_buffer_size = snd_pcm_lib_buffer_bytes(substream);
dpcm->pcm_period_size = snd_pcm_lib_period_bytes(substream);
dpcm->pcm_irq_pos = 0;
dpcm->pcm_buf_pos = 0;
snd_pcm_format_set_silence(runtime->format, runtime->dma_area, bytes_to_samples(runtime, runtime->dma_bytes));
//printk("giova: prepare %d %p\n", __LINE__, dpcm);
return 0;
}
static void snd_card_dummy_pcm_timer_function(unsigned long data)
{
//struct snd_dummy_pcm *dpcm = (struct snd_dummy_pcm *)data;
struct snd_dummy_pcm *dpcm = NULL;
//unsigned long flags;
int i;
giovatimer.expires = (HZ/100 * (GIOVAMULTI)) + jiffies;
add_timer(&giovatimer);
for (i = 0; i < giovaindex + 1; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
//printk("giova: timer_func %d i=%d\n", __LINE__, i);
if (giovadpcms[i].started != 1)
continue;
dpcm = giovadpcms[i].dpcm;
if (dpcm == NULL) {
printk("giova: timer_func %d %d NULL: continue\n", __LINE__, i);
continue;
}
//spin_lock_bh(&dpcm->lock);
//if (in_irq())
//printk("giova: timer_func %d %d we are in HARDWARE IRQ\n", __LINE__, i);
//if(in_softirq())
//printk("giova: timer_func %d %d we are in SOFT IRQ\n", __LINE__, i);
//printk("giova: timer_func %d %d\n", __LINE__, i);
//spin_lock_irqsave(&dpcm->lock, flags);
//LOCK spin_lock_bh(&dpcm->lock);
//CICOPET printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
//dpcm->pcm_irq_pos += dpcm->pcm_bps * ((HZ / 100) * GIOVAMULTI);
//dpcm->pcm_irq_pos += (dpcm->pcm_bps * ((HZ / 100) * GIOVAMULTI));
dpcm->pcm_irq_pos += (dpcm->pcm_bps * ( (HZ / 100) * GIOVAMULTI));
//CICOPET printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
//dpcm->pcm_buf_pos += (dpcm->pcm_bps * ((HZ / 100) * GIOVAMULTI));
dpcm->pcm_buf_pos += (dpcm->pcm_bps * ( (HZ / 100) * GIOVAMULTI));
//CICOPET printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
//dpcm->pcm_buf_pos %= (dpcm->pcm_buffer_size * dpcm->pcm_hz * GIOVAMULTI);
dpcm->pcm_buf_pos %= (dpcm->pcm_buffer_size * dpcm->pcm_hz );
//BUONI printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u (dpcm->pcm_period_size * dpcm->pcm_hz)=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos, (dpcm->pcm_period_size * dpcm->pcm_hz));
if (dpcm->pcm_irq_pos >= (dpcm->pcm_period_size * dpcm->pcm_hz)) {
//CICOPET printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
dpcm->pcm_irq_pos %= (dpcm->pcm_period_size * dpcm->pcm_hz);
//BUONI printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u PASSATO!\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
//spin_unlock_irqrestore(&dpcm->lock, flags);
//spin_unlock_bh(&dpcm->lock);
snd_pcm_period_elapsed(dpcm->substream);
} else {
//spin_unlock_irqrestore(&dpcm->lock, flags);
//spin_unlock_bh(&dpcm->lock);
}
}
}
static snd_pcm_uframes_t snd_card_dummy_pcm_pointer(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm = runtime->private_data;
snd_pcm_uframes_t ciapa=0;
//spin_lock_bh(&dpcm->lock);
//ciapa = (dpcm->pcm_buf_pos / dpcm->pcm_hz) / (dpcm->pcm_bps/8000);
//ciapa = bytes_to_frames(runtime, (dpcm->pcm_buf_pos / (dpcm->pcm_hz ))) / GIOVAMULTI;
//printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u, ciapa=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos, ciapa);
ciapa = bytes_to_frames(runtime, (dpcm->pcm_buf_pos / (dpcm->pcm_hz )));
//spin_unlock_bh(&dpcm->lock);
//printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u, ciapa=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos, (unsigned int)ciapa);
return ciapa;
//return bytes_to_frames(runtime, (dpcm->pcm_buf_pos / (dpcm->pcm_hz )) / GIOVAMULTI);
//return (dpcm->pcm_buf_pos / dpcm->pcm_hz) / (dpcm->pcm_bps/8000);
}
static struct snd_pcm_hardware snd_card_dummy_playback = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID),
.formats = USE_FORMATS,
.rates = USE_RATE,
.rate_min = USE_RATE_MIN,
.rate_max = USE_RATE_MAX,
.channels_min = USE_CHANNELS_MIN,
.channels_max = USE_CHANNELS_MAX,
.buffer_bytes_max = MAX_BUFFER_SIZE,
.period_bytes_min = 64,
.period_bytes_max = MAX_PERIOD_SIZE,
.periods_min = USE_PERIODS_MIN,
.periods_max = USE_PERIODS_MAX,
.fifo_size = 0,
};
static struct snd_pcm_hardware snd_card_dummy_capture = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID),
.formats = USE_FORMATS,
.rates = USE_RATE,
.rate_min = USE_RATE_MIN,
.rate_max = USE_RATE_MAX,
.channels_min = USE_CHANNELS_MIN,
.channels_max = USE_CHANNELS_MAX,
.buffer_bytes_max = MAX_BUFFER_SIZE,
.period_bytes_min = 64,
.period_bytes_max = MAX_PERIOD_SIZE,
.periods_min = USE_PERIODS_MIN,
.periods_max = USE_PERIODS_MAX,
.fifo_size = 0,
};
static void snd_card_dummy_runtime_free(struct snd_pcm_runtime *runtime)
{
int i;
//int found=0;
//printk("snd_card_dummy_runtime_free giova 1 giovaindex=%d dpcm=%p runtime=%p\n", giovaindex, runtime->private_data, runtime);
spin_lock_bh(&giovalock);
for (i = 0; i < giovaindex; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d \n", __FILE__, __LINE__, i, giovaindex);
}
//if((giovadpcms[i].substream == substream) && (giovadpcms[i].dpcm == dpcm)){
if ((giovadpcms[i].dpcm == runtime->private_data)) {
//printk("giova, %s:%d, i=%d, giovaindex=%d %p==%p YES I AM!!!!\n", __FILE__, __LINE__, i, giovaindex, giovadpcms[i].dpcm , runtime->private_data);
//giovadpcms[i].dpcm = NULL;
//giovadpcms[i].substream = NULL;
giovadpcms[i].started = 0;
//break;
} else {
//printk("giova, %s:%d, i=%d, giovaindex=%d %p!=%p NOT ME\n", __FILE__, __LINE__, i, giovaindex, giovadpcms[i].dpcm , runtime->private_data);
}
}
spin_unlock_bh(&giovalock);
kfree(runtime->private_data);
}
static int snd_card_dummy_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params)
{
return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
}
static int snd_card_dummy_hw_free(struct snd_pcm_substream *substream)
{
return snd_pcm_lib_free_pages(substream);
}
static struct snd_dummy_pcm *new_pcm_stream(struct snd_pcm_substream *substream)
{
struct snd_dummy_pcm *dpcm;
int i;
int found = 0;
//printk("giova, %s:%d, i=%d, giovaindex=%d %p==%p YES I AM!!!!\n", __FILE__, __LINE__, i, giovaindex, giovadpcms[i].dpcm , runtime->private_data);
//printk("giova, %s:%d, giovaindex=%d\n", __FILE__, __LINE__, giovaindex);
dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL);
//printk("giova, %s:%d, giovaindex=%d\n", __FILE__, __LINE__, giovaindex);
if (!dpcm) {
//spin_unlock_bh(&giovalock);
printk("giova, %s:%d, giovaindex=%d NO MEMORY!!!!\n", __FILE__, __LINE__, giovaindex);
return dpcm;
}
//printk("giova, %s:%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, giovaindex, dpcm);
init_timer(&dpcm->timer);
//dpcm->timer.data = (unsigned long) dpcm;
//dpcm->timer.function = snd_card_dummy_pcm_timer_function;
spin_lock_init(&dpcm->lock);
dpcm->substream = substream;
spin_lock_bh(&giovalock);
//printk("giova 1 giovaindex=%d dpcm=%p substream=%p sizeof=%lu\n", giovaindex, dpcm, substream, sizeof(*dpcm));
for (i = 0; i < giovaindex; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
//if((giovadpcms[i].substream == substream) && (giovadpcms[i].dpcm == dpcm))
if ((giovadpcms[i].substream == substream)) {
found = 1;
break;
}
}
if (!found) {
giovadpcms[giovaindex].substream = substream;
giovaindex++;
//printk("giova 2 giovaindex=%d dpcm=%p substream=%p\n", giovaindex, dpcm, substream);
}
found = 0;
for (i = 0; i < giovaindex; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
if (giovadpcms[i].substream == substream) {
giovadpcms[i].dpcm = dpcm;
giovadpcms[i].started = 0;
found = 1;
//printk("giova 3 giovaindex=%d dpcm=%p substream=%p\n", giovaindex, dpcm, substream);
break;
}
}
spin_unlock_bh(&giovalock);
if (!found) {
printk("skypiax giovaindex=%d NOT found????\n", giovaindex);
}
//printk("giova, %s:%d, giovaindex=%d\n", __FILE__, __LINE__, giovaindex);
return dpcm;
}
static int snd_card_dummy_playback_open(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm;
int err;
if ((dpcm = new_pcm_stream(substream)) == NULL)
return -ENOMEM;
//printk("giova, %s:%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, giovaindex, dpcm);
runtime->private_data = dpcm;
/* makes the infrastructure responsible for freeing dpcm */
runtime->private_free = snd_card_dummy_runtime_free;
runtime->hw = snd_card_dummy_playback;
if (substream->pcm->device & 1) {
runtime->hw.info &= ~SNDRV_PCM_INFO_INTERLEAVED;
runtime->hw.info |= SNDRV_PCM_INFO_NONINTERLEAVED;
}
if (substream->pcm->device & 2)
runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID);
err = add_playback_constraints(runtime);
if (err < 0)
return err;
return 0;
}
static int snd_card_dummy_capture_open(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm;
int err;
if ((dpcm = new_pcm_stream(substream)) == NULL)
return -ENOMEM;
//printk("giova, %s:%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, giovaindex, dpcm);
runtime->private_data = dpcm;
/* makes the infrastructure responsible for freeing dpcm */
runtime->private_free = snd_card_dummy_runtime_free;
runtime->hw = snd_card_dummy_capture;
if (substream->pcm->device == 1) {
runtime->hw.info &= ~SNDRV_PCM_INFO_INTERLEAVED;
runtime->hw.info |= SNDRV_PCM_INFO_NONINTERLEAVED;
}
if (substream->pcm->device & 2)
runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID);
err = add_capture_constraints(runtime);
if (err < 0)
return err;
return 0;
}
static int snd_card_dummy_playback_close(struct snd_pcm_substream *substream)
{
//printk("play giova 1 giovaindex=%d dpcm=%p substream=%p\n", giovaindex, substream->private_data, substream);
snd_card_dummy_pcm_timer_stop(substream->private_data);
return 0;
}
static int snd_card_dummy_capture_close(struct snd_pcm_substream *substream)
{
//printk("capt giova 2 giovaindex=%d dpcm=%p substream=%p\n", giovaindex, substream->private_data, substream);
snd_card_dummy_pcm_timer_stop(substream->private_data);
return 0;
}
static struct snd_pcm_ops snd_card_dummy_playback_ops = {
.open = snd_card_dummy_playback_open,
.close = snd_card_dummy_playback_close,
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_card_dummy_hw_params,
.hw_free = snd_card_dummy_hw_free,
.prepare = snd_card_dummy_pcm_prepare,
.trigger = snd_card_dummy_pcm_trigger,
.pointer = snd_card_dummy_pcm_pointer,
};
static struct snd_pcm_ops snd_card_dummy_capture_ops = {
.open = snd_card_dummy_capture_open,
.close = snd_card_dummy_capture_close,
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_card_dummy_hw_params,
.hw_free = snd_card_dummy_hw_free,
.prepare = snd_card_dummy_pcm_prepare,
.trigger = snd_card_dummy_pcm_trigger,
.pointer = snd_card_dummy_pcm_pointer,
};
static int __devinit snd_card_dummy_pcm(struct snd_dummy *dummy, int device, int substreams)
{
struct snd_pcm *pcm;
int err;
err = snd_pcm_new(dummy->card, "Dummy PCM", device, substreams, substreams, &pcm);
if (err < 0)
return err;
dummy->pcm = pcm;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_card_dummy_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_card_dummy_capture_ops);
pcm->private_data = dummy;
pcm->info_flags = 0;
strcpy(pcm->name, "Dummy PCM");
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS, snd_dma_continuous_data(GFP_KERNEL), 128 * 1024, 1024 * 1024);
return 0;
}
#define DUMMY_VOLUME(xname, xindex, addr) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
.name = xname, .index = xindex, \
.info = snd_dummy_volume_info, \
.get = snd_dummy_volume_get, .put = snd_dummy_volume_put, \
.private_value = addr, \
.tlv = { .p = db_scale_dummy } }
static int snd_dummy_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integer.min = -50;
uinfo->value.integer.max = 100;
return 0;
}
static int snd_dummy_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int addr = kcontrol->private_value;
//unsigned long flags;
if (in_irq())
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
//printk("giova: volume get %d %d\n", __LINE__, addr);
//spin_lock_irq(&dummy->mixer_lock);
//spin_lock_irqsave(&dummy->mixer_lock, flags);
spin_lock_bh(&dummy->mixer_lock);
ucontrol->value.integer.value[0] = dummy->mixer_volume[addr][0];
ucontrol->value.integer.value[1] = dummy->mixer_volume[addr][1];
//spin_unlock_irqrestore(&dummy->mixer_lock, flags);
spin_unlock_bh(&dummy->mixer_lock);
return 0;
}
static int snd_dummy_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int change, addr = kcontrol->private_value;
int left, right;
//unsigned long flags;
if (in_irq())
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
left = ucontrol->value.integer.value[0];
if (left < -50)
left = -50;
if (left > 100)
left = 100;
right = ucontrol->value.integer.value[1];
if (right < -50)
right = -50;
if (right > 100)
right = 100;
//printk("giova: volume put %d %d\n", __LINE__, addr);
//spin_lock_irq(&dummy->mixer_lock);
//spin_lock_irqsave(&dummy->mixer_lock, flags);
spin_lock_bh(&dummy->mixer_lock);
change = dummy->mixer_volume[addr][0] != left || dummy->mixer_volume[addr][1] != right;
dummy->mixer_volume[addr][0] = left;
dummy->mixer_volume[addr][1] = right;
//spin_unlock_irq(&dummy->mixer_lock);
//spin_unlock_irqrestore(&dummy->mixer_lock, flags);
spin_unlock_bh(&dummy->mixer_lock);
return change;
}
static const DECLARE_TLV_DB_SCALE(db_scale_dummy, -4500, 30, 0);
#define DUMMY_CAPSRC(xname, xindex, addr) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
.info = snd_dummy_capsrc_info, \
.get = snd_dummy_capsrc_get, .put = snd_dummy_capsrc_put, \
.private_value = addr }
#define snd_dummy_capsrc_info snd_ctl_boolean_stereo_info
static int snd_dummy_capsrc_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int addr = kcontrol->private_value;
//unsigned long flags;
if (in_irq())
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
//spin_lock_irq(&dummy->mixer_lock);
//spin_lock_irqsave(&dummy->mixer_lock, flags);
spin_lock_bh(&dummy->mixer_lock);
ucontrol->value.integer.value[0] = dummy->capture_source[addr][0];
ucontrol->value.integer.value[1] = dummy->capture_source[addr][1];
//spin_unlock_irq(&dummy->mixer_lock);
//spin_unlock_irqrestore(&dummy->mixer_lock, flags);
spin_unlock_bh(&dummy->mixer_lock);
//printk("giova: capsrc_get %d %d\n", __LINE__, addr);
return 0;
}
static int snd_dummy_capsrc_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int change, addr = kcontrol->private_value;
int left, right;
//unsigned long flags;
if (in_irq())
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
left = ucontrol->value.integer.value[0] & 1;
right = ucontrol->value.integer.value[1] & 1;
//spin_lock_irq(&dummy->mixer_lock);
//spin_lock_irqsave(&dummy->mixer_lock, flags);
spin_lock_bh(&dummy->mixer_lock);
change = dummy->capture_source[addr][0] != left && dummy->capture_source[addr][1] != right;
dummy->capture_source[addr][0] = left;
dummy->capture_source[addr][1] = right;
//spin_unlock_irq(&dummy->mixer_lock);
//spin_unlock_irqrestore(&dummy->mixer_lock, flags);
spin_unlock_bh(&dummy->mixer_lock);
//printk("giova: capsrc_put %d %d\n", __LINE__, addr);
return change;
}
static struct snd_kcontrol_new snd_dummy_controls[] = {
DUMMY_VOLUME("Master Volume", 0, MIXER_ADDR_MASTER),
DUMMY_CAPSRC("Master Capture Switch", 0, MIXER_ADDR_MASTER),
DUMMY_VOLUME("Synth Volume", 0, MIXER_ADDR_SYNTH),
DUMMY_CAPSRC("Synth Capture Switch", 0, MIXER_ADDR_SYNTH),
DUMMY_VOLUME("Line Volume", 0, MIXER_ADDR_LINE),
DUMMY_CAPSRC("Line Capture Switch", 0, MIXER_ADDR_LINE),
DUMMY_VOLUME("Mic Volume", 0, MIXER_ADDR_MIC),
DUMMY_CAPSRC("Mic Capture Switch", 0, MIXER_ADDR_MIC),
DUMMY_VOLUME("CD Volume", 0, MIXER_ADDR_CD),
DUMMY_CAPSRC("CD Capture Switch", 0, MIXER_ADDR_CD)
};
static int __devinit snd_card_dummy_new_mixer(struct snd_dummy *dummy)
{
struct snd_card *card = dummy->card;
unsigned int idx;
int err;
//giova if (snd_BUG_ON(!dummy))
//giova return -EINVAL;
spin_lock_init(&dummy->mixer_lock);
strcpy(card->mixername, "Dummy Mixer");
//printk("giova: new_mixer %d\n", __LINE__);
return 0; //giova no mixer
for (idx = 0; idx < ARRAY_SIZE(snd_dummy_controls); idx++) {
err = snd_ctl_add(card, snd_ctl_new1(&snd_dummy_controls[idx], dummy));
if (err < 0)
return err;
}
return 0;
}
static int __devinit snd_dummy_probe(struct platform_device *devptr)
{
struct snd_card *card;
struct snd_dummy *dummy;
int idx, err;
int dev = devptr->id;
card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct snd_dummy));
if (card == NULL)
return -ENOMEM;
//giova err = snd_card_create(index[dev], id[dev], THIS_MODULE,
//giova sizeof(struct snd_dummy), &card);
//giova if (err < 0)
//giova return err;
dummy = card->private_data;
dummy->card = card;
for (idx = 0; idx < MAX_PCM_DEVICES && idx < pcm_devs[dev]; idx++) {
if (pcm_substreams[dev] < 1)
pcm_substreams[dev] = 1;
if (pcm_substreams[dev] > MAX_PCM_SUBSTREAMS)
pcm_substreams[dev] = MAX_PCM_SUBSTREAMS;
err = snd_card_dummy_pcm(dummy, idx, pcm_substreams[dev]);
if (err < 0)
goto __nodev;
}
err = snd_card_dummy_new_mixer(dummy);
if (err < 0)
goto __nodev;
strcpy(card->driver, "Dummy");
strcpy(card->shortname, "Dummy");
sprintf(card->longname, "Dummy %i", dev + 1);
snd_card_set_dev(card, &devptr->dev);
err = snd_card_register(card);
if (err == 0) {
platform_set_drvdata(devptr, card);
return 0;
}
__nodev:
snd_card_free(card);
return err;
}
static int __devexit snd_dummy_remove(struct platform_device *devptr)
{
del_timer(&giovatimer);
snd_card_free(platform_get_drvdata(devptr));
platform_set_drvdata(devptr, NULL);
return 0;
}
#ifdef CONFIG_PM
static int snd_dummy_suspend(struct platform_device *pdev, pm_message_t state)
{
struct snd_card *card = platform_get_drvdata(pdev);
struct snd_dummy *dummy = card->private_data;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(dummy->pcm);
return 0;
}
static int snd_dummy_resume(struct platform_device *pdev)
{
struct snd_card *card = platform_get_drvdata(pdev);
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
#endif
#define SND_DUMMY_DRIVER "snd_dummy"
static struct platform_driver snd_dummy_driver = {
.probe = snd_dummy_probe,
.remove = __devexit_p(snd_dummy_remove),
#ifdef CONFIG_PM
.suspend = snd_dummy_suspend,
.resume = snd_dummy_resume,
#endif
.driver = {
.name = SND_DUMMY_DRIVER},
};
static void snd_dummy_unregister_all(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(devices); ++i)
platform_device_unregister(devices[i]);
platform_driver_unregister(&snd_dummy_driver);
}
static int __init alsa_card_dummy_init(void)
{
int i, cards, err;
err = platform_driver_register(&snd_dummy_driver);
if (err < 0)
return err;
if (!giovastarted) {
giovastarted = 1;
spin_lock_init(&giovalock);
spin_lock_bh(&giovalock);
for (i = 0; i < MAX_PCM_SUBSTREAMS; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d \n", __FILE__, __LINE__, i, giovaindex);
}
giovadpcms[i].substream = NULL;
giovadpcms[i].dpcm = NULL;
giovadpcms[i].started = 0;
}
init_timer(&giovatimer);
//giovatimer.data = (unsigned long) dpcm;
giovatimer.data = (unsigned long) &giovadpcms;
giovatimer.function = snd_card_dummy_pcm_timer_function;
giovatimer.expires = ((HZ / 1000) *GIOVAMULTI)+ jiffies;
add_timer(&giovatimer);
printk("003 snd-dummy skypiax driver, %s:%d working on a machine with %dHZ kernel\n", __FILE__, __LINE__, HZ);
spin_unlock_bh(&giovalock);
}
cards = 0;
for (i = 0; i < SNDRV_CARDS; i++) {
struct platform_device *device;
if (!enable[i])
continue;
device = platform_device_register_simple(SND_DUMMY_DRIVER, i, NULL, 0);
if (IS_ERR(device))
continue;
if (!platform_get_drvdata(device)) {
platform_device_unregister(device);
continue;
}
devices[i] = device;
cards++;
}
if (!cards) {
#ifdef MODULE
printk(KERN_ERR "Dummy soundcard not found or device busy\n");
#endif
snd_dummy_unregister_all();
return -ENODEV;
}
return 0;
}
static void __exit alsa_card_dummy_exit(void)
{
del_timer(&giovatimer);
snd_dummy_unregister_all();
}
module_init(alsa_card_dummy_init)
module_exit(alsa_card_dummy_exit)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,332 @@
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005/2006, Anthony Minessale II <anthmct@yahoo.com>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthmct@yahoo.com>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* This module (mod_skypiax) has been contributed by:
*
* Giovanni Maruzzelli (gmaruzz@gmail.com)
*
*
* Further Contributors:
*
*
*
* mod_skypiax.c -- Skype compatible Endpoint Module
*
*/
#include <switch.h>
#include <switch_version.h>
#ifndef WIN32
#include <sys/time.h>
#include <X11/Xlib.h>
#include <X11/Xlibint.h>
#include <X11/Xatom.h>
#endif //WIN32
#ifdef _MSC_VER
//Windows macro for FD_SET includes a warning C4127: conditional expression is constant
#pragma warning(push)
#pragma warning(disable:4127)
#endif
#define MY_EVENT_INCOMING_CHATMESSAGE "skypiax::incoming_chatmessage"
#define SAMPLERATE_SKYPIAX 16000
#define SAMPLES_PER_FRAME SAMPLERATE_SKYPIAX/50
#ifndef SKYPIAX_SVN_VERSION
#define SKYPIAX_SVN_VERSION SWITCH_VERSION_REVISION
#endif /* SKYPIAX_SVN_VERSION */
typedef enum {
TFLAG_IO = (1 << 0),
TFLAG_INBOUND = (1 << 1),
TFLAG_OUTBOUND = (1 << 2),
TFLAG_DTMF = (1 << 3),
TFLAG_VOICE = (1 << 4),
TFLAG_HANGUP = (1 << 5),
TFLAG_LINEAR = (1 << 6),
TFLAG_CODEC = (1 << 7),
TFLAG_BREAK = (1 << 8)
} TFLAGS;
typedef enum {
GFLAG_MY_CODEC_PREFS = (1 << 0)
} GFLAGS;
#define DEBUGA_SKYPE(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_SKYPE %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define DEBUGA_CALL(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_CALL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define DEBUGA_PBX(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_PBX %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define ERRORA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][ERRORA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][WARNINGA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][NOTICA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define SKYPIAX_P_LOG NULL, (unsigned long)55, __LINE__, tech_pvt ? tech_pvt->name ? tech_pvt->name : "none" : "none", -1, tech_pvt ? tech_pvt->interface_state : -1, tech_pvt ? tech_pvt->skype_callflow : -1
/*********************************/
#define SKYPIAX_CAUSE_NORMAL 1
/*********************************/
#define SKYPIAX_FRAME_DTMF 1
/*********************************/
#define SKYPIAX_CONTROL_RINGING 1
#define SKYPIAX_CONTROL_ANSWER 2
/*********************************/
#define SKYPIAX_STATE_IDLE 0
#define SKYPIAX_STATE_DOWN 1
#define SKYPIAX_STATE_RING 2
#define SKYPIAX_STATE_DIALING 3
#define SKYPIAX_STATE_BUSY 4
#define SKYPIAX_STATE_UP 5
#define SKYPIAX_STATE_RINGING 6
#define SKYPIAX_STATE_PRERING 7
#define SKYPIAX_STATE_ERROR_DOUBLE_CALL 8
#define SKYPIAX_STATE_SELECTED 9
#define SKYPIAX_STATE_HANGUP_REQUESTED 10
#define SKYPIAX_STATE_PREANSWER 11
/*********************************/
/* call flow from the device */
#define CALLFLOW_CALL_IDLE 0
#define CALLFLOW_CALL_DOWN 1
#define CALLFLOW_INCOMING_RING 2
#define CALLFLOW_CALL_DIALING 3
#define CALLFLOW_CALL_LINEBUSY 4
#define CALLFLOW_CALL_ACTIVE 5
#define CALLFLOW_INCOMING_HANGUP 6
#define CALLFLOW_CALL_RELEASED 7
#define CALLFLOW_CALL_NOCARRIER 8
#define CALLFLOW_CALL_INFLUX 9
#define CALLFLOW_CALL_INCOMING 10
#define CALLFLOW_CALL_FAILED 11
#define CALLFLOW_CALL_NOSERVICE 12
#define CALLFLOW_CALL_OUTGOINGRESTRICTED 13
#define CALLFLOW_CALL_SECURITYFAIL 14
#define CALLFLOW_CALL_NOANSWER 15
#define CALLFLOW_STATUS_FINISHED 16
#define CALLFLOW_STATUS_CANCELLED 17
#define CALLFLOW_STATUS_FAILED 18
#define CALLFLOW_STATUS_REFUSED 19
#define CALLFLOW_STATUS_RINGING 20
#define CALLFLOW_STATUS_INPROGRESS 21
#define CALLFLOW_STATUS_UNPLACED 22
#define CALLFLOW_STATUS_ROUTING 23
#define CALLFLOW_STATUS_EARLYMEDIA 24
#define CALLFLOW_INCOMING_CALLID 25
#define CALLFLOW_STATUS_REMOTEHOLD 26
/*********************************/
#define SKYPIAX_MAX_INTERFACES 64
#ifndef WIN32
struct SkypiaxHandles {
Window skype_win;
Display *disp;
Window win;
int currentuserhandle;
int api_connected;
int fdesc[2];
};
#else //WIN32
struct SkypiaxHandles {
HWND win32_hInit_MainWindowHandle;
HWND win32_hGlobal_SkypeAPIWindowHandle;
HINSTANCE win32_hInit_ProcessHandle;
char win32_acInit_WindowClassName[128];
UINT win32_uiGlobal_MsgID_SkypeControlAPIAttach;
UINT win32_uiGlobal_MsgID_SkypeControlAPIDiscover;
int currentuserhandle;
int api_connected;
switch_file_t *fdesc[2];
};
#endif //WIN32
#define MAX_CHATS 10
struct chat {
char chatname[256];
char dialog_partner[256];
};
typedef struct chat chat_t;
#define MAX_CHATMESSAGES 10
struct chatmessage {
char id[256];
char type[256];
char chatname[256];
char from_handle[256];
char from_dispname[256];
char body[512];
};
typedef struct chatmessage chatmessage_t;
struct private_object {
unsigned int flags;
switch_codec_t read_codec;
switch_codec_t write_codec;
switch_frame_t read_frame;
unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE];
char session_uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
switch_caller_profile_t *caller_profile;
switch_mutex_t *mutex;
switch_mutex_t *flag_mutex;
switch_mutex_t *flag_audio_cli_mutex;
switch_mutex_t *flag_audio_srv_mutex;
char interface_id[80];
char name[80];
char dialplan[80];
char context[80];
char dial_regex[256];
char fail_dial_regex[256];
char hold_music[256];
char type[256];
char X11_display[256];
#ifdef WIN32
unsigned short tcp_cli_port;
unsigned short tcp_srv_port;
#else
int tcp_cli_port;
int tcp_srv_port;
#endif
struct SkypiaxHandles SkypiaxHandles;
int interface_state; /*!< \brief 'state' of the interface (channel) */
char language[80]; /*!< \brief default Asterisk dialplan language for this interface */
char exten[80]; /*!< \brief default Asterisk dialplan extension for this interface */
int skypiax_sound_rate; /*!< \brief rate of the sound device, in Hz, eg: 8000 */
char callid_name[50];
char callid_number[50];
double playback_boost;
double capture_boost;
int stripmsd;
char skype_call_id[512];
int skype_call_ongoing;
char skype_friends[4096];
char skype_fullname[512];
char skype_displayname[512];
int skype_callflow; /*!< \brief 'callflow' of the skype interface (as opposed to phone interface) */
int skype; /*!< \brief config flag, bool, Skype support on this interface (0 if false, -1 if true) */
int control_to_send;
#ifdef WIN32
switch_file_t *audiopipe_srv[2];
switch_file_t *audiopipe_cli[2];
switch_file_t *skypiax_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */
#else /* WIN32 */
int audiopipe_srv[2];
int audiopipe_cli[2];
int skypiax_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */
#endif /* WIN32 */
switch_thread_t *tcp_srv_thread;
switch_thread_t *tcp_cli_thread;
switch_thread_t *skypiax_signaling_thread;
switch_thread_t *skypiax_api_thread;
short audiobuf[SAMPLES_PER_FRAME];
int audiobuf_is_loaded;
short audiobuf_cli[SAMPLES_PER_FRAME];
switch_mutex_t *mutex_audio_cli;
int flag_audio_cli;
short audiobuf_srv[SAMPLES_PER_FRAME];
switch_mutex_t *mutex_audio_srv;
int flag_audio_srv;
//int phonebook_listing;
//int phonebook_querying;
//int phonebook_listing_received_calls;
//int phonebook_first_entry;
//int phonebook_last_entry;
//int phonebook_number_lenght;
//int phonebook_text_lenght;
FILE *phonebook_writing_fp;
int skypiax_dir_entry_extension_prefix;
char skype_user[256];
char skype_password[256];
char destination[256];
struct timeval answer_time;
struct timeval transfer_time;
char transfer_callid_number[50];
char skype_transfer_call_id[512];
int running;
uint32_t ib_calls;
uint32_t ob_calls;
uint32_t ib_failed_calls;
uint32_t ob_failed_calls;
chatmessage_t chatmessages[MAX_CHATMESSAGES];
chat_t chats[MAX_CHATS];
uint32_t report_incoming_chatmessages;
switch_timer_t timer_read;
switch_timer_t timer_write;
unsigned int writefd;
unsigned int readfd;
};
typedef struct private_object private_t;
void *SWITCH_THREAD_FUNC skypiax_api_thread_func(switch_thread_t * thread, void *obj);
int skypiax_audio_read(private_t * tech_pvt);
int skypiax_audio_init(private_t * tech_pvt);
int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype);
int skypiax_signaling_read(private_t * tech_pvt);
int skypiax_call(private_t * tech_pvt, char *idest, int timeout);
int skypiax_senddigit(private_t * tech_pvt, char digit);
void *skypiax_do_tcp_srv_thread_func(void *obj);
void *SWITCH_THREAD_FUNC skypiax_do_tcp_srv_thread(switch_thread_t * thread, void *obj);
void *skypiax_do_tcp_cli_thread_func(void *obj);
void *SWITCH_THREAD_FUNC skypiax_do_tcp_cli_thread(switch_thread_t * thread, void *obj);
void *skypiax_do_skypeapi_thread_func(void *obj);
void *SWITCH_THREAD_FUNC skypiax_do_skypeapi_thread(switch_thread_t * thread, void *obj);
int dtmf_received(private_t * tech_pvt, char *value);
int start_audio_threads(private_t * tech_pvt);
int new_inbound_channel(private_t * tech_pvt);
int outbound_channel_answered(private_t * tech_pvt);
int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype);
#if defined(WIN32) && !defined(__CYGWIN__)
int skypiax_pipe_read(switch_file_t * pipe, short *buf, int howmany);
int skypiax_pipe_write(switch_file_t * pipe, short *buf, int howmany);
/* Visual C do not have strsep ? */
char *strsep(char **stringp, const char *delim);
#else
int skypiax_pipe_read(int pipe, short *buf, int howmany);
int skypiax_pipe_write(int pipe, short *buf, int howmany);
#endif /* WIN32 */
int skypiax_close_socket(unsigned int fd);
private_t *find_available_skypiax_interface_rr(private_t * tech_pvt_calling);
int remote_party_is_ringing(private_t * tech_pvt);
int remote_party_is_early_media(private_t * tech_pvt);
int skypiax_answer(private_t * tech_pvt, char *id, char *value);
int skypiax_transfer(private_t * tech_pvt, char *id, char *value);
#ifndef WIN32
int skypiax_socket_create_and_bind(private_t * tech_pvt, int *which_port);
#else
int skypiax_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_port);
#endif //WIN32
int incoming_chatmessage(private_t * tech_pvt, int which);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,55 @@
Index: skypiax_protocol.c
===================================================================
--- skypiax_protocol.c (revision 16583)
+++ skypiax_protocol.c (working copy)
@@ -1040,22 +1040,35 @@
fdselect = fd;
FD_SET(fdselect, &fs);
+#if 1
//FIXME rt = select(fdselect + 1, NULL, &fs, NULL, &to);
while (tech_pvt->flag_audio_cli == 0) {
#ifdef WIN32
skypiax_sleep(100); //0.1 millisec
#else
- skypiax_sleep(1000); //1 millisec
+ skypiax_sleep(10000); //10 millisec
#endif //WIN32
//WARNINGA("write now is 0\n", SKYPIAX_P_LOG);
}
//ERRORA("write is now 1\n", SKYPIAX_P_LOG);
rt = 1;
+#endif //0
+ //rt = select(fdselect + 1, NULL, &fs, NULL, NULL);
if (rt > 0) {
int counter;
-
+#if 0
+ while (tech_pvt->flag_audio_cli == 0) {
+#ifdef WIN32
+ skypiax_sleep(100); //0.1 millisec
+#else
+ skypiax_sleep(10000); //10 millisec
+#endif //WIN32
+ WARNINGA("write now is 0\n", SKYPIAX_P_LOG);
+ }
+#endif //0
+
/* until we drained the pipe to empty */
//for (counter = 0; counter < 10; counter++) {
for (counter = 0; counter < 1; counter++) {
@@ -1155,10 +1168,10 @@
#ifdef WIN32
skypiax_sleep(100); //0.1 millisec
#else
- skypiax_sleep(1000); //1 millisec
+ skypiax_sleep(10000); //10 millisec
#endif //WIN32
- //WARNINGA("read now is 0\n", SKYPIAX_P_LOG);
+ WARNINGA("read now is 0\n", SKYPIAX_P_LOG);
}
//ERRORA("read is now 1\n", SKYPIAX_P_LOG);
//samples = skypiax_pipe_read(tech_pvt->audiopipe_srv[0], tech_pvt->read_frame.data, SAMPLES_PER_FRAME * sizeof(short));

View File

@ -0,0 +1,610 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# src/mod/endpoints/mod_skypiax/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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.
srcdir = .
top_srcdir = ../../../..
pkgdatadir = $(datadir)/libfreeswitch
pkglibdir = $(libdir)/libfreeswitch
pkgincludedir = $(includedir)/libfreeswitch
top_builddir = ../../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/install -c
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 = i686-redhat-linux-gnu
host_triplet = i686-redhat-linux-gnu
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/build/modmake.rulesam
subdir = src/mod/endpoints/mod_skypiax
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(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)/build/config/ax_lib_mysql.m4 \
$(top_srcdir)/build/config/ax_check_java.m4 \
$(top_srcdir)/build/config/erlang.m4 \
$(top_srcdir)/build/config/odbc.m4 \
$(top_srcdir)/build/config/sched_setaffinity.m4 \
$(top_srcdir)/libs/apr/build/apr_common.m4 \
$(top_srcdir)/libs/sofia-sip/m4/sac-pkg-config.m4 \
$(top_srcdir)/libs/sofia-sip/m4/sac-openssl.m4 \
$(top_srcdir)/build/config/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 \
$(top_builddir)/libs/xmlrpc-c/xmlrpc_amconfig.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(moddir)"
modLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(mod_LTLIBRARIES)
mod_skypiax_la_DEPENDENCIES = $(switch_builddir)/libfreeswitch.la
am_mod_skypiax_la_OBJECTS = mod_skypiax_la-mod_skypiax.lo \
mod_skypiax_la-skypiax_protocol.lo
mod_skypiax_la_OBJECTS = $(am_mod_skypiax_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include -I$(top_builddir)/libs/xmlrpc-c
depcomp = $(SHELL) $(top_srcdir)/build/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(mod_skypiax_la_SOURCES)
DIST_SOURCES = $(mod_skypiax_la_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /usr/src/freeswitch/build/config/missing --run aclocal-1.9
AMDEP_FALSE = #
AMDEP_TRUE =
AMTAR = ${SHELL} /usr/src/freeswitch/build/config/missing --run tar
AM_MAKEFLAGS = `test -n "$(VERBOSE)" || echo -s`
AR = ar
ATTR_UNUSED = __attribute__((__unused__))
AUTOCONF = ${SHELL} /usr/src/freeswitch/build/config/missing --run autoconf
AUTOHEADER = ${SHELL} /usr/src/freeswitch/build/config/missing --run autoheader
AUTOMAKE = ${SHELL} /usr/src/freeswitch/build/config/missing --run automake-1.9
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CONF_DISABLED_MODULES = $$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed -e "s|^.*/||" | sort | uniq )
CONF_MODULES = $$(grep -v "\#" $(switch_builddir)/modules.conf | sed -e "s|^.*/||" | sort | uniq )
CPP = gcc -E
CPPFLAGS =
CURL = /usr/bin/curl
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DIRECTORY_SEPARATOR = /
DYNAMIC_LIB_EXTEN = so
ECHO = echo
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = grep -E
ENABLE_CPP_FALSE = #
ENABLE_CPP_TRUE =
ENABLE_ZRTP_FALSE =
ENABLE_ZRTP_TRUE = #
ERLANG = no
ERLANG_CFLAGS =
ERLANG_LDFLAGS =
ESL_LDFLAGS =
EXEEXT =
GETLIB = cd /usr/src/freeswitch/libs && /bin/sh /usr/src/freeswitch/build/getlib.sh
GETSOUNDS = /bin/sh /usr/src/freeswitch/build/getsounds.sh
HAVE_LIBEDIT_FALSE = #
HAVE_LIBEDIT_TRUE =
HAVE_LIBWWW_SSL_DEFINE = 0
HAVE_MYSQL_FALSE =
HAVE_MYSQL_TRUE = #
HAVE_ODBC_FALSE =
HAVE_ODBC_TRUE = #
HAVE_TLS_FALSE =
HAVE_TLS_TRUE = #
HAVE_WCHAR_H_DEFINE = 1
HasJava_FALSE =
HasJava_TRUE = #
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
IS64BITLINUX_FALSE =
IS64BITLINUX_TRUE = #
ISLINUX_FALSE = #
ISLINUX_TRUE =
ISMAC_FALSE =
ISMAC_TRUE = #
JACK_CFLAGS =
JACK_LIBS =
JAVA_FLAGS =
JAVA_HOME =
LDFLAGS =
LIBCURL = ${switch_builddir}/libs/curl/lib/libcurl.la
LIBCURL_CPPFLAGS = -I${switch_srcdir}/libs/curl/include
LIBCURL_DEPS = ${switch_builddir}/libs/curl/lib/libcurl.la
LIBOBJS =
# Dirty trick to override the link output
LIBS = -lncurses > $(MODNAME).log || error="yes";if test -n "$(VERBOSE)" \
-o "$$error" = "yes";then cat $(MODNAME).log;fi;if test \
"$$error" = "yes";then exit 1;fi
#we should set all these vars from configure, no reason to have these in each Makefile.am
LIBTOOL = echo "`link=\`echo $@|grep .la;echo $@|grep .so;echo $@|grep .dll\`;if test -n "$$link"; then echo Creating $@;fi`";`if test -z "$(VERBOSE)" ; \
then echo $(SHELL) $(switch_builddir)/quiet_libtool ;else echo $(SHELL) $(switch_builddir)/libtool; fi`
LIBTOOL_LIB_EXTEN = so
LIB_JAVA =
LIB_SUBDIR = lib
LN_S = ln -s
LTLIBOBJS =
MAKEINFO = ${SHELL} /usr/src/freeswitch/build/config/missing --run makeinfo
OBJEXT = o
ODBC_INC_DIR =
ODBC_INC_FLAGS =
ODBC_LIB_DIR =
ODBC_LIB_FLAGS =
OUR_CLEAN_MODS = $$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )
OUR_DISABLED_CLEAN_MODS = $$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )
OUR_DISABLED_INSTALL_MODS = $$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )
OUR_DISABLED_MODS = $$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )
OUR_DISABLED_UNINSTALL_MODS = $$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )
OUR_INSTALL_MODS = $$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )
OUR_MODS = $$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )
OUR_UNINSTALL_MODS = $$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )
PACKAGE = libfreeswitch
PACKAGE_BUGREPORT = BUG-REPORT-ADDRESS
PACKAGE_NAME = freeswitch
PACKAGE_STRING = freeswitch 1.0.trunk
PACKAGE_TARNAME = freeswitch
PACKAGE_VERSION = 1.0.trunk
PATH_SEPARATOR = :
PA_LIBS =
PKG_CONFIG = no
PLATFORM_CORE_DEPLIBS =
PRTDIAG =
PYTHON = /usr/bin/python
PYTHON_CFLAGS = -I/usr/include/python2.4 -I/usr/include/python2.4 -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC
PYTHON_LDFLAGS = -lpthread -ldl -lutil -lm -lpython2.4
PYTHON_SITE_DIR = /usr/lib/python2.4/site-packages
RANLIB = ranlib
SED = /bin/sed
SET_MAKE =
SHELL = /bin/sh
SOLINK = -shared -Xlinker -x
STRIP = strip
SWITCH_AM_CFLAGS = -I/usr/src/freeswitch/src/include -I/usr/src/freeswitch/src/include -I/usr/src/freeswitch/libs/libteletone/src -fPIC -Werror -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -g -ggdb
SWITCH_AM_CXXFLAGS = -I/usr/src/freeswitch/src/include -I/usr/src/freeswitch/src/include -I/usr/src/freeswitch/libs/libteletone/src -fPIC -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1
SWITCH_AM_LDFLAGS = -lm
SWITCH_ANSI_CFLAGS = -Wall -std=c99 -pedantic -Wdeclaration-after-statement
SWITCH_VERSION_MAJOR = 1
SWITCH_VERSION_MICRO = trunk
SWITCH_VERSION_MINOR = 0
TAR = /bin/gtar
TOUCH_TARGET = if test -f "$@";then touch "$@";fi;
VA_LIST_IS_ARRAY_DEFINE = 0
VERSION = 0.1
WANT_DEBUG_FALSE = #
WANT_DEBUG_TRUE =
WGET = /usr/bin/wget
ZCAT = /bin/gunzip
_libcurl_config =
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_CXX = g++
ac_ct_RANLIB = ranlib
ac_ct_STRIP = strip
am__fastdepCC_FALSE = #
am__fastdepCC_TRUE =
am__fastdepCXX_FALSE = #
am__fastdepCXX_TRUE =
am__include = include
am__leading_dot = .
am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build = i686-redhat-linux-gnu
build_alias =
build_cpu = i686
build_os = linux-gnu
build_vendor = redhat
confdir = /usr/local/freeswitch/conf
datadir = ${prefix}/share
dbdir = /usr/local/freeswitch/db
exec_prefix = ${prefix}
grammardir = /usr/local/freeswitch/grammar
host = i686-redhat-linux-gnu
host_alias =
host_cpu = i686
host_os = linux-gnu
host_vendor = redhat
htdocsdir = /usr/local/freeswitch/htdocs
includedir = ${prefix}/include
infodir = ${prefix}/info
install_sh = /usr/src/freeswitch/build/config/install-sh
int64_t_fmt = #define SWITCH_INT64_T_FMT "lld"
int64_value = long long
int_value = int
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localstatedir = ${prefix}/var
logfiledir = /usr/local/freeswitch/log
long_value = long long
mandir = ${prefix}/man
mkdir_p = mkdir -p --
modulesdir = /usr/local/freeswitch/mod
oldincludedir = /usr/include
openssl_CFLAGS =
openssl_LIBS =
prefix = /usr/local/freeswitch
program_transform_name = s,x,x,
recordingsdir = /usr/local/freeswitch/recordings
runtimedir = /usr/local/freeswitch/run
sbindir = ${exec_prefix}/sbin
scriptdir = /usr/local/freeswitch/scripts
sharedstatedir = ${prefix}/com
short_value = short
size_t_fmt = #define SWITCH_SIZE_T_FMT "d"
size_t_value = size_t
soundsdir = /usr/local/freeswitch/sounds
ssize_t_fmt = #define SWITCH_SSIZE_T_FMT "d"
ssize_t_value = ssize_t
subdirs = libs/srtp libs/sqlite libs/libedit libs/pcre libs/apr libs/apr-util libs/ilbc libs/curl libs/iksemel libs/js/nsprpub libs/js libs/libdingaling libs/libsndfile libs/sofia-sip libs/speex libs/portaudio libs/openzap libs/unimrcp libs/tiff-3.8.2 libs/spandsp libs/broadvoice libs/libg722_1
switch_builddir = /usr/src/freeswitch
switch_srcdir = /usr/src/freeswitch
sysconfdir = /usr/local/freeswitch/conf
target_alias =
uint64_t_fmt = #define SWITCH_UINT64_T_FMT "llu"
voidp_size = 4
AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS)
AM_CPPFLAGS = $(SWITCH_AM_CXXFLAGS)
AM_LDFLAGS = $(SWITCH_AM_LDFLAGS)
moddir = /usr/local/freeswitch/mod
MODNAME = mod_skypiax
mod_LTLIBRARIES = mod_skypiax.la
mod_skypiax_la_SOURCES = mod_skypiax.c skypiax_protocol.c
mod_skypiax_la_CFLAGS = $(AM_CFLAGS) -DSKYPIAX_SVN_VERSION=\"`cat $(switch_builddir)/.version`\"
mod_skypiax_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_skypiax_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lX11
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/build/modmake.rulesam $(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/mod/endpoints/mod_skypiax/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/mod/endpoints/mod_skypiax/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
install-modLTLIBRARIES: $(mod_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(moddir)" || $(mkdir_p) "$(DESTDIR)$(moddir)"
@list='$(mod_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(modLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(moddir)/$$f'"; \
$(LIBTOOL) --mode=install $(modLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(moddir)/$$f"; \
else :; fi; \
done
uninstall-modLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@set -x; list='$(mod_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(moddir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(moddir)/$$p"; \
done
clean-modLTLIBRARIES:
-test -z "$(mod_LTLIBRARIES)" || rm -f $(mod_LTLIBRARIES)
@list='$(mod_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
mod_skypiax.la: $(mod_skypiax_la_OBJECTS) $(mod_skypiax_la_DEPENDENCIES)
$(LINK) -rpath $(moddir) $(mod_skypiax_la_LDFLAGS) $(mod_skypiax_la_OBJECTS) $(mod_skypiax_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/mod_skypiax_la-mod_skypiax.Plo
include ./$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Plo
.c.o:
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c $<
.c.obj:
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=yes \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(LTCOMPILE) -c -o $@ $<
mod_skypiax_la-mod_skypiax.lo: mod_skypiax.c
if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -MT mod_skypiax_la-mod_skypiax.lo -MD -MP -MF "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo" -c -o mod_skypiax_la-mod_skypiax.lo `test -f 'mod_skypiax.c' || echo '$(srcdir)/'`mod_skypiax.c; \
then mv -f "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo" "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Plo"; else rm -f "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo"; exit 1; fi
# source='mod_skypiax.c' object='mod_skypiax_la-mod_skypiax.lo' libtool=yes \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -c -o mod_skypiax_la-mod_skypiax.lo `test -f 'mod_skypiax.c' || echo '$(srcdir)/'`mod_skypiax.c
mod_skypiax_la-skypiax_protocol.lo: skypiax_protocol.c
if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -MT mod_skypiax_la-skypiax_protocol.lo -MD -MP -MF "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo" -c -o mod_skypiax_la-skypiax_protocol.lo `test -f 'skypiax_protocol.c' || echo '$(srcdir)/'`skypiax_protocol.c; \
then mv -f "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo" "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Plo"; else rm -f "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo"; exit 1; fi
# source='skypiax_protocol.c' object='mod_skypiax_la-skypiax_protocol.lo' libtool=yes \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -c -o mod_skypiax_la-skypiax_protocol.lo `test -f 'skypiax_protocol.c' || echo '$(srcdir)/'`skypiax_protocol.c
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
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: $(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; }'`; \
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: $(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)
$(mkdir_p) $(distdir)/../../../../build
@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
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(moddir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
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-am
clean-am: clean-generic clean-libtool clean-modLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-modLTLIBRARIES
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-modLTLIBRARIES
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-modLTLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-libtool \
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-modLTLIBRARIES install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-modLTLIBRARIES
all-modules: all
depend-modules: depend
clean-modules: clean
install-modules: install
uninstall-modules: uninstall
distclean-modules: distclean
extraclean-modules: extraclean
# 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:

View File

@ -0,0 +1,7 @@
include $(top_srcdir)/build/modmake.rulesam
MODNAME=mod_skypiax
mod_LTLIBRARIES = mod_skypiax.la
mod_skypiax_la_SOURCES = mod_skypiax.c skypiax_protocol.c
mod_skypiax_la_CFLAGS = $(AM_CFLAGS) -DSKYPIAX_SVN_VERSION=\"`cat $(switch_builddir)/.version`\"
mod_skypiax_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_skypiax_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lX11

View File

@ -0,0 +1,610 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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@
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/build/modmake.rulesam
subdir = src/mod/endpoints/mod_skypiax
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(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)/build/config/ax_lib_mysql.m4 \
$(top_srcdir)/build/config/ax_check_java.m4 \
$(top_srcdir)/build/config/erlang.m4 \
$(top_srcdir)/build/config/odbc.m4 \
$(top_srcdir)/build/config/sched_setaffinity.m4 \
$(top_srcdir)/libs/apr/build/apr_common.m4 \
$(top_srcdir)/libs/sofia-sip/m4/sac-pkg-config.m4 \
$(top_srcdir)/libs/sofia-sip/m4/sac-openssl.m4 \
$(top_srcdir)/build/config/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 \
$(top_builddir)/libs/xmlrpc-c/xmlrpc_amconfig.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(moddir)"
modLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(mod_LTLIBRARIES)
mod_skypiax_la_DEPENDENCIES = $(switch_builddir)/libfreeswitch.la
am_mod_skypiax_la_OBJECTS = mod_skypiax_la-mod_skypiax.lo \
mod_skypiax_la-skypiax_protocol.lo
mod_skypiax_la_OBJECTS = $(am_mod_skypiax_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include -I$(top_builddir)/libs/xmlrpc-c
depcomp = $(SHELL) $(top_srcdir)/build/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(mod_skypiax_la_SOURCES)
DIST_SOURCES = $(mod_skypiax_la_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AM_MAKEFLAGS = `test -n "$(VERBOSE)" || echo -s`
AR = @AR@
ATTR_UNUSED = @ATTR_UNUSED@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONF_DISABLED_MODULES = @CONF_DISABLED_MODULES@
CONF_MODULES = @CONF_MODULES@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CURL = @CURL@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DIRECTORY_SEPARATOR = @DIRECTORY_SEPARATOR@
DYNAMIC_LIB_EXTEN = @DYNAMIC_LIB_EXTEN@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_CPP_FALSE = @ENABLE_CPP_FALSE@
ENABLE_CPP_TRUE = @ENABLE_CPP_TRUE@
ENABLE_ZRTP_FALSE = @ENABLE_ZRTP_FALSE@
ENABLE_ZRTP_TRUE = @ENABLE_ZRTP_TRUE@
ERLANG = @ERLANG@
ERLANG_CFLAGS = @ERLANG_CFLAGS@
ERLANG_LDFLAGS = @ERLANG_LDFLAGS@
ESL_LDFLAGS = @ESL_LDFLAGS@
EXEEXT = @EXEEXT@
GETLIB = @GETLIB@
GETSOUNDS = @GETSOUNDS@
HAVE_LIBEDIT_FALSE = @HAVE_LIBEDIT_FALSE@
HAVE_LIBEDIT_TRUE = @HAVE_LIBEDIT_TRUE@
HAVE_LIBWWW_SSL_DEFINE = @HAVE_LIBWWW_SSL_DEFINE@
HAVE_MYSQL_FALSE = @HAVE_MYSQL_FALSE@
HAVE_MYSQL_TRUE = @HAVE_MYSQL_TRUE@
HAVE_ODBC_FALSE = @HAVE_ODBC_FALSE@
HAVE_ODBC_TRUE = @HAVE_ODBC_TRUE@
HAVE_TLS_FALSE = @HAVE_TLS_FALSE@
HAVE_TLS_TRUE = @HAVE_TLS_TRUE@
HAVE_WCHAR_H_DEFINE = @HAVE_WCHAR_H_DEFINE@
HasJava_FALSE = @HasJava_FALSE@
HasJava_TRUE = @HasJava_TRUE@
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@
JACK_CFLAGS = @JACK_CFLAGS@
JACK_LIBS = @JACK_LIBS@
JAVA_FLAGS = @JAVA_FLAGS@
JAVA_HOME = @JAVA_HOME@
LDFLAGS = @LDFLAGS@
LIBCURL = @LIBCURL@
LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
LIBCURL_DEPS = @LIBCURL_DEPS@
LIBOBJS = @LIBOBJS@
# Dirty trick to override the link output
LIBS = @LIBS@ > $(MODNAME).log || error="yes";if test -n "$(VERBOSE)" \
-o "$$error" = "yes";then cat $(MODNAME).log;fi;if test \
"$$error" = "yes";then exit 1;fi
#we should set all these vars from configure, no reason to have these in each Makefile.am
LIBTOOL = echo "`link=\`echo $@|grep .la;echo $@|grep .so;echo $@|grep .dll\`;if test -n "$$link"; then echo Creating $@;fi`";`if test -z "$(VERBOSE)" ; \
then echo $(SHELL) $(switch_builddir)/quiet_libtool ;else echo $(SHELL) $(switch_builddir)/libtool; fi`
LIBTOOL_LIB_EXTEN = @LIBTOOL_LIB_EXTEN@
LIB_JAVA = @LIB_JAVA@
LIB_SUBDIR = @LIB_SUBDIR@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
ODBC_INC_DIR = @ODBC_INC_DIR@
ODBC_INC_FLAGS = @ODBC_INC_FLAGS@
ODBC_LIB_DIR = @ODBC_LIB_DIR@
ODBC_LIB_FLAGS = @ODBC_LIB_FLAGS@
OUR_CLEAN_MODS = @OUR_CLEAN_MODS@
OUR_DISABLED_CLEAN_MODS = @OUR_DISABLED_CLEAN_MODS@
OUR_DISABLED_INSTALL_MODS = @OUR_DISABLED_INSTALL_MODS@
OUR_DISABLED_MODS = @OUR_DISABLED_MODS@
OUR_DISABLED_UNINSTALL_MODS = @OUR_DISABLED_UNINSTALL_MODS@
OUR_INSTALL_MODS = @OUR_INSTALL_MODS@
OUR_MODS = @OUR_MODS@
OUR_UNINSTALL_MODS = @OUR_UNINSTALL_MODS@
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@
PA_LIBS = @PA_LIBS@
PKG_CONFIG = @PKG_CONFIG@
PLATFORM_CORE_DEPLIBS = @PLATFORM_CORE_DEPLIBS@
PRTDIAG = @PRTDIAG@
PYTHON = @PYTHON@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
PYTHON_SITE_DIR = @PYTHON_SITE_DIR@
RANLIB = @RANLIB@
SED = @SED@
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@
SWITCH_ANSI_CFLAGS = @SWITCH_ANSI_CFLAGS@
SWITCH_VERSION_MAJOR = @SWITCH_VERSION_MAJOR@
SWITCH_VERSION_MICRO = @SWITCH_VERSION_MICRO@
SWITCH_VERSION_MINOR = @SWITCH_VERSION_MINOR@
TAR = @TAR@
TOUCH_TARGET = @TOUCH_TARGET@
VA_LIST_IS_ARRAY_DEFINE = @VA_LIST_IS_ARRAY_DEFINE@
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_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@
confdir = @confdir@
datadir = @datadir@
dbdir = @dbdir@
exec_prefix = @exec_prefix@
grammardir = @grammardir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htdocsdir = @htdocsdir@
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@
logfiledir = @logfiledir@
long_value = @long_value@
mandir = @mandir@
mkdir_p = @mkdir_p@
modulesdir = @modulesdir@
oldincludedir = @oldincludedir@
openssl_CFLAGS = @openssl_CFLAGS@
openssl_LIBS = @openssl_LIBS@
prefix = @prefix@
program_transform_name = @program_transform_name@
recordingsdir = @recordingsdir@
runtimedir = @runtimedir@
sbindir = @sbindir@
scriptdir = @scriptdir@
sharedstatedir = @sharedstatedir@
short_value = @short_value@
size_t_fmt = @size_t_fmt@
size_t_value = @size_t_value@
soundsdir = @soundsdir@
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@
AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS)
AM_CPPFLAGS = $(SWITCH_AM_CXXFLAGS)
AM_LDFLAGS = $(SWITCH_AM_LDFLAGS)
moddir = @modulesdir@
MODNAME = mod_skypiax
mod_LTLIBRARIES = mod_skypiax.la
mod_skypiax_la_SOURCES = mod_skypiax.c skypiax_protocol.c
mod_skypiax_la_CFLAGS = $(AM_CFLAGS) -DSKYPIAX_SVN_VERSION=\"`cat $(switch_builddir)/.version`\"
mod_skypiax_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_skypiax_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lX11
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/build/modmake.rulesam $(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/mod/endpoints/mod_skypiax/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/mod/endpoints/mod_skypiax/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
install-modLTLIBRARIES: $(mod_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(moddir)" || $(mkdir_p) "$(DESTDIR)$(moddir)"
@list='$(mod_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(modLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(moddir)/$$f'"; \
$(LIBTOOL) --mode=install $(modLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(moddir)/$$f"; \
else :; fi; \
done
uninstall-modLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@set -x; list='$(mod_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(moddir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(moddir)/$$p"; \
done
clean-modLTLIBRARIES:
-test -z "$(mod_LTLIBRARIES)" || rm -f $(mod_LTLIBRARIES)
@list='$(mod_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
mod_skypiax.la: $(mod_skypiax_la_OBJECTS) $(mod_skypiax_la_DEPENDENCIES)
$(LINK) -rpath $(moddir) $(mod_skypiax_la_LDFLAGS) $(mod_skypiax_la_OBJECTS) $(mod_skypiax_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_skypiax_la-mod_skypiax.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mod_skypiax_la-mod_skypiax.lo: mod_skypiax.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -MT mod_skypiax_la-mod_skypiax.lo -MD -MP -MF "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo" -c -o mod_skypiax_la-mod_skypiax.lo `test -f 'mod_skypiax.c' || echo '$(srcdir)/'`mod_skypiax.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo" "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Plo"; else rm -f "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_skypiax.c' object='mod_skypiax_la-mod_skypiax.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -c -o mod_skypiax_la-mod_skypiax.lo `test -f 'mod_skypiax.c' || echo '$(srcdir)/'`mod_skypiax.c
mod_skypiax_la-skypiax_protocol.lo: skypiax_protocol.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -MT mod_skypiax_la-skypiax_protocol.lo -MD -MP -MF "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo" -c -o mod_skypiax_la-skypiax_protocol.lo `test -f 'skypiax_protocol.c' || echo '$(srcdir)/'`skypiax_protocol.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo" "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Plo"; else rm -f "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='skypiax_protocol.c' object='mod_skypiax_la-skypiax_protocol.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -c -o mod_skypiax_la-skypiax_protocol.lo `test -f 'skypiax_protocol.c' || echo '$(srcdir)/'`skypiax_protocol.c
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
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: $(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; }'`; \
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: $(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)
$(mkdir_p) $(distdir)/../../../../build
@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
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(moddir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
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-am
clean-am: clean-generic clean-libtool clean-modLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-modLTLIBRARIES
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-modLTLIBRARIES
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-modLTLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-libtool \
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-modLTLIBRARIES install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-modLTLIBRARIES
all-modules: all
depend-modules: depend
clean-modules: clean
install-modules: install
uninstall-modules: uninstall
distclean-modules: distclean
extraclean-modules: extraclean
# 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:

View File

@ -0,0 +1,9 @@
Skypiax, Skype Endpoint and Trunk
All documentation on compiling, using, configuring,
tricks and tweaks, possible problems at:
http://wiki.freeswitch.org/wiki/Skypiax_Skype_Endpoint_and_Trunk
< gmaruzz at gmail dot com >

View File

@ -0,0 +1,964 @@
/*
* Dummy soundcard
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <sound/driver.h> //giova
#include <linux/init.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/jiffies.h>
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/wait.h>
#include <linux/moduleparam.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/tlv.h>
#include <sound/pcm.h>
#include <sound/rawmidi.h>
#include <sound/initval.h>
MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
MODULE_DESCRIPTION("Dummy soundcard (/dev/null)");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{ALSA,Dummy soundcard}}");
#define GIOVAMULTI 1
#define MAX_PCM_DEVICES 4
#define MAX_PCM_SUBSTREAMS 128
#define MAX_MIDI_DEVICES 2
#if 0 /* emu10k1 emulation */
#define MAX_BUFFER_SIZE (128 * 1024)
static int emu10k1_playback_constraints(struct snd_pcm_runtime *runtime)
{
int err;
err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
if (err < 0)
return err;
err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256, UINT_MAX);
if (err < 0)
return err;
return 0;
}
#define add_playback_constraints emu10k1_playback_constraints
#endif
#if 0 /* RME9652 emulation */
#define MAX_BUFFER_SIZE (26 * 64 * 1024)
#define USE_FORMATS SNDRV_PCM_FMTBIT_S32_LE
#define USE_CHANNELS_MIN 26
#define USE_CHANNELS_MAX 26
#define USE_PERIODS_MIN 2
#define USE_PERIODS_MAX 2
#endif
#if 0 /* ICE1712 emulation */
#define MAX_BUFFER_SIZE (256 * 1024)
#define USE_FORMATS SNDRV_PCM_FMTBIT_S32_LE
#define USE_CHANNELS_MIN 10
#define USE_CHANNELS_MAX 10
#define USE_PERIODS_MIN 1
#define USE_PERIODS_MAX 1024
#endif
#if 0 /* UDA1341 emulation */
#define MAX_BUFFER_SIZE (16380)
#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE
#define USE_CHANNELS_MIN 2
#define USE_CHANNELS_MAX 2
#define USE_PERIODS_MIN 2
#define USE_PERIODS_MAX 255
#endif
#if 0 /* simple AC97 bridge (intel8x0) with 48kHz AC97 only codec */
#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE
#define USE_CHANNELS_MIN 2
#define USE_CHANNELS_MAX 2
#define USE_RATE SNDRV_PCM_RATE_48000
#define USE_RATE_MIN 48000
#define USE_RATE_MAX 48000
#endif
#if 0 /* CA0106 */
#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE
#define USE_CHANNELS_MIN 2
#define USE_CHANNELS_MAX 2
#define USE_RATE (SNDRV_PCM_RATE_48000|SNDRV_PCM_RATE_96000|SNDRV_PCM_RATE_192000)
#define USE_RATE_MIN 48000
#define USE_RATE_MAX 192000
#define MAX_BUFFER_SIZE ((65536-64)*8)
#define MAX_PERIOD_SIZE (65536-64)
#define USE_PERIODS_MIN 2
#define USE_PERIODS_MAX 8
#endif
/* defaults */
#ifndef MAX_BUFFER_SIZE
//#define MAX_BUFFER_SIZE (64*1024)
#define MAX_BUFFER_SIZE (256*1024)
#endif
#ifndef MAX_PERIOD_SIZE
#define MAX_PERIOD_SIZE MAX_BUFFER_SIZE
#endif
#ifndef USE_FORMATS
//#define USE_FORMATS (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE)
#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE
#endif
#ifndef USE_RATE
//#define USE_RATE SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000
#define USE_RATE SNDRV_PCM_RATE_8000
//#define USE_RATE_MIN 5500
#define USE_RATE_MIN 8000
//#define USE_RATE_MAX 48000
#define USE_RATE_MAX 8000
#endif
#ifndef USE_CHANNELS_MIN
#define USE_CHANNELS_MIN 1
#endif
#ifndef USE_CHANNELS_MAX
#define USE_CHANNELS_MAX 2
#endif
#ifndef USE_PERIODS_MIN
#define USE_PERIODS_MIN 1
#endif
#ifndef USE_PERIODS_MAX
#define USE_PERIODS_MAX 1024
#endif
#ifndef add_playback_constraints
#define add_playback_constraints(x) 0
#endif
#ifndef add_capture_constraints
#define add_capture_constraints(x) 0
#endif
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = { 1,[1 ... (SNDRV_CARDS - 1)] = 0 };
static int pcm_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1 };
static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 128 };
//static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for dummy soundcard.");
module_param_array(id, charp, NULL, 0444);
MODULE_PARM_DESC(id, "ID string for dummy soundcard.");
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable this dummy soundcard.");
module_param_array(pcm_devs, int, NULL, 0444);
MODULE_PARM_DESC(pcm_devs, "PCM devices # (0-4) for dummy driver.");
module_param_array(pcm_substreams, int, NULL, 0444);
MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-64) for dummy driver.");
//module_param_array(midi_devs, int, NULL, 0444);
//MODULE_PARM_DESC(midi_devs, "MIDI devices # (0-2) for dummy driver.");
static struct platform_device *devices[SNDRV_CARDS];
static struct timer_list giovatimer; //giova
static int giovastarted = 0;
static int giovaindex = 0;
static spinlock_t giovalock;
struct giovadpcm {
struct snd_pcm_substream *substream;
struct snd_dummy_pcm *dpcm;
int started;
};
static struct giovadpcm giovadpcms[MAX_PCM_SUBSTREAMS];
#define MIXER_ADDR_MASTER 0
#define MIXER_ADDR_LINE 1
#define MIXER_ADDR_MIC 2
#define MIXER_ADDR_SYNTH 3
#define MIXER_ADDR_CD 4
#define MIXER_ADDR_LAST 4
static void snd_card_dummy_pcm_timer_function(unsigned long data);
struct snd_dummy {
struct snd_card *card;
struct snd_pcm *pcm;
spinlock_t mixer_lock;
int mixer_volume[MIXER_ADDR_LAST + 1][2];
int capture_source[MIXER_ADDR_LAST + 1][2];
};
struct snd_dummy_pcm {
struct snd_dummy *dummy;
spinlock_t lock;
struct timer_list timer;
unsigned int pcm_buffer_size;
unsigned int pcm_period_size;
unsigned int pcm_bps; /* bytes per second */
unsigned int pcm_hz; /* HZ */
unsigned int pcm_irq_pos; /* IRQ position */
unsigned int pcm_buf_pos; /* position in buffer */
struct snd_pcm_substream *substream;
};
static inline void snd_card_dummy_pcm_timer_start(struct snd_dummy_pcm *dpcm)
{
int i;
int found = 0;
//printk("giova: 1 timer_start %d %p\n", __LINE__, dpcm);
for (i = 0; i < giovaindex + 1; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
if (giovadpcms[i].dpcm == dpcm) {
giovadpcms[i].started = 1;
found = 1;
}
}
if (!found) {
printk("skypiax: start, NOT found?\n");
}
//printk("giova: 2 timer_start %d %p\n", __LINE__, dpcm);
}
static inline void snd_card_dummy_pcm_timer_stop(struct snd_dummy_pcm *dpcm)
{
//del_timer(&dpcm->timer);
int i;
int found = 0;
//printk("giova: 1 timer_stop %d %p\n", __LINE__, dpcm);
for (i = 0; i < giovaindex + 1; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
if (giovadpcms[i].dpcm == dpcm) {
giovadpcms[i].started = 0;
found = 1;
}
}
if (!found) {
//printk("skypiax: stop, NOT found?\n");
} else {
//printk("skypiax: stop, YES found!\n");
}
//printk("giova: 2 timer_stop %d %p\n", __LINE__, dpcm);
}
static int snd_card_dummy_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm = runtime->private_data;
int err = 0;
//spin_lock(&dpcm->lock, flags);
spin_lock_bh(&giovalock);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
//printk("giova: trigger timer_start %d %p\n", __LINE__, dpcm);
snd_card_dummy_pcm_timer_start(dpcm);
break;
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
//printk("giova: trigger timer_stop %d %p\n", __LINE__, dpcm);
snd_card_dummy_pcm_timer_stop(dpcm);
break;
default:
err = -EINVAL;
break;
}
//spin_unlock(&dpcm->lock, flags);
spin_unlock_bh(&giovalock);
return 0;
}
static int snd_card_dummy_pcm_prepare(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm = runtime->private_data;
int bps;
bps = snd_pcm_format_width(runtime->format) * runtime->rate * runtime->channels / 8;
if (bps <= 0)
return -EINVAL;
dpcm->pcm_bps = bps;
dpcm->pcm_hz = HZ;
dpcm->pcm_buffer_size = snd_pcm_lib_buffer_bytes(substream);
dpcm->pcm_period_size = snd_pcm_lib_period_bytes(substream);
dpcm->pcm_irq_pos = 0;
dpcm->pcm_buf_pos = 0;
snd_pcm_format_set_silence(runtime->format, runtime->dma_area, bytes_to_samples(runtime, runtime->dma_bytes));
//printk("giova: prepare %d %p\n", __LINE__, dpcm);
return 0;
}
static void snd_card_dummy_pcm_timer_function(unsigned long data)
{
//struct snd_dummy_pcm *dpcm = (struct snd_dummy_pcm *)data;
struct snd_dummy_pcm *dpcm = NULL;
//unsigned long flags;
int i;
giovatimer.expires = (HZ/100 * (GIOVAMULTI)) + jiffies;
add_timer(&giovatimer);
for (i = 0; i < giovaindex + 1; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
//printk("giova: timer_func %d i=%d\n", __LINE__, i);
if (giovadpcms[i].started != 1)
continue;
dpcm = giovadpcms[i].dpcm;
if (dpcm == NULL) {
printk("giova: timer_func %d %d NULL: continue\n", __LINE__, i);
continue;
}
//spin_lock_bh(&dpcm->lock);
//if (in_irq())
//printk("giova: timer_func %d %d we are in HARDWARE IRQ\n", __LINE__, i);
//if(in_softirq())
//printk("giova: timer_func %d %d we are in SOFT IRQ\n", __LINE__, i);
//printk("giova: timer_func %d %d\n", __LINE__, i);
//spin_lock_irqsave(&dpcm->lock, flags);
//LOCK spin_lock_bh(&dpcm->lock);
//CICOPET printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
//dpcm->pcm_irq_pos += dpcm->pcm_bps * ((HZ / 100) * GIOVAMULTI);
//dpcm->pcm_irq_pos += (dpcm->pcm_bps * ((HZ / 100) * GIOVAMULTI));
dpcm->pcm_irq_pos += (dpcm->pcm_bps * ( (HZ / 100) * GIOVAMULTI));
//CICOPET printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
//dpcm->pcm_buf_pos += (dpcm->pcm_bps * ((HZ / 100) * GIOVAMULTI));
dpcm->pcm_buf_pos += (dpcm->pcm_bps * ( (HZ / 100) * GIOVAMULTI));
//CICOPET printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
//dpcm->pcm_buf_pos %= (dpcm->pcm_buffer_size * dpcm->pcm_hz * GIOVAMULTI);
dpcm->pcm_buf_pos %= (dpcm->pcm_buffer_size * dpcm->pcm_hz );
//BUONI printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u (dpcm->pcm_period_size * dpcm->pcm_hz)=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos, (dpcm->pcm_period_size * dpcm->pcm_hz));
if (dpcm->pcm_irq_pos >= (dpcm->pcm_period_size * dpcm->pcm_hz)) {
//CICOPET printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
dpcm->pcm_irq_pos %= (dpcm->pcm_period_size * dpcm->pcm_hz);
//BUONI printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u PASSATO!\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
//spin_unlock_irqrestore(&dpcm->lock, flags);
//spin_unlock_bh(&dpcm->lock);
snd_pcm_period_elapsed(dpcm->substream);
} else {
//spin_unlock_irqrestore(&dpcm->lock, flags);
//spin_unlock_bh(&dpcm->lock);
}
}
}
static snd_pcm_uframes_t snd_card_dummy_pcm_pointer(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm = runtime->private_data;
snd_pcm_uframes_t ciapa=0;
//spin_lock_bh(&dpcm->lock);
//ciapa = (dpcm->pcm_buf_pos / dpcm->pcm_hz) / (dpcm->pcm_bps/8000);
//ciapa = bytes_to_frames(runtime, (dpcm->pcm_buf_pos / (dpcm->pcm_hz ))) / GIOVAMULTI;
//printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u, ciapa=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos, ciapa);
ciapa = bytes_to_frames(runtime, (dpcm->pcm_buf_pos / (dpcm->pcm_hz )));
//spin_unlock_bh(&dpcm->lock);
//printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u, ciapa=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos, (unsigned int)ciapa);
return ciapa;
//return bytes_to_frames(runtime, (dpcm->pcm_buf_pos / (dpcm->pcm_hz )) / GIOVAMULTI);
//return (dpcm->pcm_buf_pos / dpcm->pcm_hz) / (dpcm->pcm_bps/8000);
}
static struct snd_pcm_hardware snd_card_dummy_playback = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID),
.formats = USE_FORMATS,
.rates = USE_RATE,
.rate_min = USE_RATE_MIN,
.rate_max = USE_RATE_MAX,
.channels_min = USE_CHANNELS_MIN,
.channels_max = USE_CHANNELS_MAX,
.buffer_bytes_max = MAX_BUFFER_SIZE,
.period_bytes_min = 64,
.period_bytes_max = MAX_PERIOD_SIZE,
.periods_min = USE_PERIODS_MIN,
.periods_max = USE_PERIODS_MAX,
.fifo_size = 0,
};
static struct snd_pcm_hardware snd_card_dummy_capture = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID),
.formats = USE_FORMATS,
.rates = USE_RATE,
.rate_min = USE_RATE_MIN,
.rate_max = USE_RATE_MAX,
.channels_min = USE_CHANNELS_MIN,
.channels_max = USE_CHANNELS_MAX,
.buffer_bytes_max = MAX_BUFFER_SIZE,
.period_bytes_min = 64,
.period_bytes_max = MAX_PERIOD_SIZE,
.periods_min = USE_PERIODS_MIN,
.periods_max = USE_PERIODS_MAX,
.fifo_size = 0,
};
static void snd_card_dummy_runtime_free(struct snd_pcm_runtime *runtime)
{
int i;
//int found=0;
//printk("snd_card_dummy_runtime_free giova 1 giovaindex=%d dpcm=%p runtime=%p\n", giovaindex, runtime->private_data, runtime);
spin_lock_bh(&giovalock);
for (i = 0; i < giovaindex; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d \n", __FILE__, __LINE__, i, giovaindex);
}
//if((giovadpcms[i].substream == substream) && (giovadpcms[i].dpcm == dpcm)){
if ((giovadpcms[i].dpcm == runtime->private_data)) {
//printk("giova, %s:%d, i=%d, giovaindex=%d %p==%p YES I AM!!!!\n", __FILE__, __LINE__, i, giovaindex, giovadpcms[i].dpcm , runtime->private_data);
//giovadpcms[i].dpcm = NULL;
//giovadpcms[i].substream = NULL;
giovadpcms[i].started = 0;
//break;
} else {
//printk("giova, %s:%d, i=%d, giovaindex=%d %p!=%p NOT ME\n", __FILE__, __LINE__, i, giovaindex, giovadpcms[i].dpcm , runtime->private_data);
}
}
spin_unlock_bh(&giovalock);
kfree(runtime->private_data);
}
static int snd_card_dummy_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params)
{
return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
}
static int snd_card_dummy_hw_free(struct snd_pcm_substream *substream)
{
return snd_pcm_lib_free_pages(substream);
}
static struct snd_dummy_pcm *new_pcm_stream(struct snd_pcm_substream *substream)
{
struct snd_dummy_pcm *dpcm;
int i;
int found = 0;
//printk("giova, %s:%d, i=%d, giovaindex=%d %p==%p YES I AM!!!!\n", __FILE__, __LINE__, i, giovaindex, giovadpcms[i].dpcm , runtime->private_data);
//printk("giova, %s:%d, giovaindex=%d\n", __FILE__, __LINE__, giovaindex);
dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL);
//printk("giova, %s:%d, giovaindex=%d\n", __FILE__, __LINE__, giovaindex);
if (!dpcm) {
//spin_unlock_bh(&giovalock);
printk("giova, %s:%d, giovaindex=%d NO MEMORY!!!!\n", __FILE__, __LINE__, giovaindex);
return dpcm;
}
//printk("giova, %s:%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, giovaindex, dpcm);
init_timer(&dpcm->timer);
//dpcm->timer.data = (unsigned long) dpcm;
//dpcm->timer.function = snd_card_dummy_pcm_timer_function;
spin_lock_init(&dpcm->lock);
dpcm->substream = substream;
spin_lock_bh(&giovalock);
//printk("giova 1 giovaindex=%d dpcm=%p substream=%p sizeof=%lu\n", giovaindex, dpcm, substream, sizeof(*dpcm));
for (i = 0; i < giovaindex; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
//if((giovadpcms[i].substream == substream) && (giovadpcms[i].dpcm == dpcm))
if ((giovadpcms[i].substream == substream)) {
found = 1;
break;
}
}
if (!found) {
giovadpcms[giovaindex].substream = substream;
giovaindex++;
//printk("giova 2 giovaindex=%d dpcm=%p substream=%p\n", giovaindex, dpcm, substream);
}
found = 0;
for (i = 0; i < giovaindex; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
if (giovadpcms[i].substream == substream) {
giovadpcms[i].dpcm = dpcm;
giovadpcms[i].started = 0;
found = 1;
//printk("giova 3 giovaindex=%d dpcm=%p substream=%p\n", giovaindex, dpcm, substream);
break;
}
}
spin_unlock_bh(&giovalock);
if (!found) {
printk("skypiax giovaindex=%d NOT found????\n", giovaindex);
}
//printk("giova, %s:%d, giovaindex=%d\n", __FILE__, __LINE__, giovaindex);
return dpcm;
}
static int snd_card_dummy_playback_open(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm;
int err;
if ((dpcm = new_pcm_stream(substream)) == NULL)
return -ENOMEM;
//printk("giova, %s:%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, giovaindex, dpcm);
runtime->private_data = dpcm;
/* makes the infrastructure responsible for freeing dpcm */
runtime->private_free = snd_card_dummy_runtime_free;
runtime->hw = snd_card_dummy_playback;
if (substream->pcm->device & 1) {
runtime->hw.info &= ~SNDRV_PCM_INFO_INTERLEAVED;
runtime->hw.info |= SNDRV_PCM_INFO_NONINTERLEAVED;
}
if (substream->pcm->device & 2)
runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID);
err = add_playback_constraints(runtime);
if (err < 0)
return err;
return 0;
}
static int snd_card_dummy_capture_open(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm;
int err;
if ((dpcm = new_pcm_stream(substream)) == NULL)
return -ENOMEM;
//printk("giova, %s:%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, giovaindex, dpcm);
runtime->private_data = dpcm;
/* makes the infrastructure responsible for freeing dpcm */
runtime->private_free = snd_card_dummy_runtime_free;
runtime->hw = snd_card_dummy_capture;
if (substream->pcm->device == 1) {
runtime->hw.info &= ~SNDRV_PCM_INFO_INTERLEAVED;
runtime->hw.info |= SNDRV_PCM_INFO_NONINTERLEAVED;
}
if (substream->pcm->device & 2)
runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID);
err = add_capture_constraints(runtime);
if (err < 0)
return err;
return 0;
}
static int snd_card_dummy_playback_close(struct snd_pcm_substream *substream)
{
//printk("play giova 1 giovaindex=%d dpcm=%p substream=%p\n", giovaindex, substream->private_data, substream);
snd_card_dummy_pcm_timer_stop(substream->private_data);
return 0;
}
static int snd_card_dummy_capture_close(struct snd_pcm_substream *substream)
{
//printk("capt giova 2 giovaindex=%d dpcm=%p substream=%p\n", giovaindex, substream->private_data, substream);
snd_card_dummy_pcm_timer_stop(substream->private_data);
return 0;
}
static struct snd_pcm_ops snd_card_dummy_playback_ops = {
.open = snd_card_dummy_playback_open,
.close = snd_card_dummy_playback_close,
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_card_dummy_hw_params,
.hw_free = snd_card_dummy_hw_free,
.prepare = snd_card_dummy_pcm_prepare,
.trigger = snd_card_dummy_pcm_trigger,
.pointer = snd_card_dummy_pcm_pointer,
};
static struct snd_pcm_ops snd_card_dummy_capture_ops = {
.open = snd_card_dummy_capture_open,
.close = snd_card_dummy_capture_close,
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_card_dummy_hw_params,
.hw_free = snd_card_dummy_hw_free,
.prepare = snd_card_dummy_pcm_prepare,
.trigger = snd_card_dummy_pcm_trigger,
.pointer = snd_card_dummy_pcm_pointer,
};
static int __devinit snd_card_dummy_pcm(struct snd_dummy *dummy, int device, int substreams)
{
struct snd_pcm *pcm;
int err;
err = snd_pcm_new(dummy->card, "Dummy PCM", device, substreams, substreams, &pcm);
if (err < 0)
return err;
dummy->pcm = pcm;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_card_dummy_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_card_dummy_capture_ops);
pcm->private_data = dummy;
pcm->info_flags = 0;
strcpy(pcm->name, "Dummy PCM");
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS, snd_dma_continuous_data(GFP_KERNEL), 128 * 1024, 1024 * 1024);
return 0;
}
#define DUMMY_VOLUME(xname, xindex, addr) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
.name = xname, .index = xindex, \
.info = snd_dummy_volume_info, \
.get = snd_dummy_volume_get, .put = snd_dummy_volume_put, \
.private_value = addr, \
.tlv = { .p = db_scale_dummy } }
static int snd_dummy_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integer.min = -50;
uinfo->value.integer.max = 100;
return 0;
}
static int snd_dummy_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int addr = kcontrol->private_value;
//unsigned long flags;
if (in_irq())
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
//printk("giova: volume get %d %d\n", __LINE__, addr);
//spin_lock_irq(&dummy->mixer_lock);
//spin_lock_irqsave(&dummy->mixer_lock, flags);
spin_lock_bh(&dummy->mixer_lock);
ucontrol->value.integer.value[0] = dummy->mixer_volume[addr][0];
ucontrol->value.integer.value[1] = dummy->mixer_volume[addr][1];
//spin_unlock_irqrestore(&dummy->mixer_lock, flags);
spin_unlock_bh(&dummy->mixer_lock);
return 0;
}
static int snd_dummy_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int change, addr = kcontrol->private_value;
int left, right;
//unsigned long flags;
if (in_irq())
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
left = ucontrol->value.integer.value[0];
if (left < -50)
left = -50;
if (left > 100)
left = 100;
right = ucontrol->value.integer.value[1];
if (right < -50)
right = -50;
if (right > 100)
right = 100;
//printk("giova: volume put %d %d\n", __LINE__, addr);
//spin_lock_irq(&dummy->mixer_lock);
//spin_lock_irqsave(&dummy->mixer_lock, flags);
spin_lock_bh(&dummy->mixer_lock);
change = dummy->mixer_volume[addr][0] != left || dummy->mixer_volume[addr][1] != right;
dummy->mixer_volume[addr][0] = left;
dummy->mixer_volume[addr][1] = right;
//spin_unlock_irq(&dummy->mixer_lock);
//spin_unlock_irqrestore(&dummy->mixer_lock, flags);
spin_unlock_bh(&dummy->mixer_lock);
return change;
}
static const DECLARE_TLV_DB_SCALE(db_scale_dummy, -4500, 30, 0);
#define DUMMY_CAPSRC(xname, xindex, addr) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
.info = snd_dummy_capsrc_info, \
.get = snd_dummy_capsrc_get, .put = snd_dummy_capsrc_put, \
.private_value = addr }
#define snd_dummy_capsrc_info snd_ctl_boolean_stereo_info
static int snd_dummy_capsrc_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int addr = kcontrol->private_value;
//unsigned long flags;
if (in_irq())
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
//spin_lock_irq(&dummy->mixer_lock);
//spin_lock_irqsave(&dummy->mixer_lock, flags);
spin_lock_bh(&dummy->mixer_lock);
ucontrol->value.integer.value[0] = dummy->capture_source[addr][0];
ucontrol->value.integer.value[1] = dummy->capture_source[addr][1];
//spin_unlock_irq(&dummy->mixer_lock);
//spin_unlock_irqrestore(&dummy->mixer_lock, flags);
spin_unlock_bh(&dummy->mixer_lock);
//printk("giova: capsrc_get %d %d\n", __LINE__, addr);
return 0;
}
static int snd_dummy_capsrc_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int change, addr = kcontrol->private_value;
int left, right;
//unsigned long flags;
if (in_irq())
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
left = ucontrol->value.integer.value[0] & 1;
right = ucontrol->value.integer.value[1] & 1;
//spin_lock_irq(&dummy->mixer_lock);
//spin_lock_irqsave(&dummy->mixer_lock, flags);
spin_lock_bh(&dummy->mixer_lock);
change = dummy->capture_source[addr][0] != left && dummy->capture_source[addr][1] != right;
dummy->capture_source[addr][0] = left;
dummy->capture_source[addr][1] = right;
//spin_unlock_irq(&dummy->mixer_lock);
//spin_unlock_irqrestore(&dummy->mixer_lock, flags);
spin_unlock_bh(&dummy->mixer_lock);
//printk("giova: capsrc_put %d %d\n", __LINE__, addr);
return change;
}
static struct snd_kcontrol_new snd_dummy_controls[] = {
DUMMY_VOLUME("Master Volume", 0, MIXER_ADDR_MASTER),
DUMMY_CAPSRC("Master Capture Switch", 0, MIXER_ADDR_MASTER),
DUMMY_VOLUME("Synth Volume", 0, MIXER_ADDR_SYNTH),
DUMMY_CAPSRC("Synth Capture Switch", 0, MIXER_ADDR_SYNTH),
DUMMY_VOLUME("Line Volume", 0, MIXER_ADDR_LINE),
DUMMY_CAPSRC("Line Capture Switch", 0, MIXER_ADDR_LINE),
DUMMY_VOLUME("Mic Volume", 0, MIXER_ADDR_MIC),
DUMMY_CAPSRC("Mic Capture Switch", 0, MIXER_ADDR_MIC),
DUMMY_VOLUME("CD Volume", 0, MIXER_ADDR_CD),
DUMMY_CAPSRC("CD Capture Switch", 0, MIXER_ADDR_CD)
};
static int __devinit snd_card_dummy_new_mixer(struct snd_dummy *dummy)
{
struct snd_card *card = dummy->card;
unsigned int idx;
int err;
//giova if (snd_BUG_ON(!dummy))
//giova return -EINVAL;
spin_lock_init(&dummy->mixer_lock);
strcpy(card->mixername, "Dummy Mixer");
//printk("giova: new_mixer %d\n", __LINE__);
return 0; //giova no mixer
for (idx = 0; idx < ARRAY_SIZE(snd_dummy_controls); idx++) {
err = snd_ctl_add(card, snd_ctl_new1(&snd_dummy_controls[idx], dummy));
if (err < 0)
return err;
}
return 0;
}
static int __devinit snd_dummy_probe(struct platform_device *devptr)
{
struct snd_card *card;
struct snd_dummy *dummy;
int idx, err;
int dev = devptr->id;
card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct snd_dummy));
if (card == NULL)
return -ENOMEM;
//giova err = snd_card_create(index[dev], id[dev], THIS_MODULE,
//giova sizeof(struct snd_dummy), &card);
//giova if (err < 0)
//giova return err;
dummy = card->private_data;
dummy->card = card;
for (idx = 0; idx < MAX_PCM_DEVICES && idx < pcm_devs[dev]; idx++) {
if (pcm_substreams[dev] < 1)
pcm_substreams[dev] = 1;
if (pcm_substreams[dev] > MAX_PCM_SUBSTREAMS)
pcm_substreams[dev] = MAX_PCM_SUBSTREAMS;
err = snd_card_dummy_pcm(dummy, idx, pcm_substreams[dev]);
if (err < 0)
goto __nodev;
}
err = snd_card_dummy_new_mixer(dummy);
if (err < 0)
goto __nodev;
strcpy(card->driver, "Dummy");
strcpy(card->shortname, "Dummy");
sprintf(card->longname, "Dummy %i", dev + 1);
snd_card_set_dev(card, &devptr->dev);
err = snd_card_register(card);
if (err == 0) {
platform_set_drvdata(devptr, card);
return 0;
}
__nodev:
snd_card_free(card);
return err;
}
static int __devexit snd_dummy_remove(struct platform_device *devptr)
{
del_timer(&giovatimer);
snd_card_free(platform_get_drvdata(devptr));
platform_set_drvdata(devptr, NULL);
return 0;
}
#ifdef CONFIG_PM
static int snd_dummy_suspend(struct platform_device *pdev, pm_message_t state)
{
struct snd_card *card = platform_get_drvdata(pdev);
struct snd_dummy *dummy = card->private_data;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(dummy->pcm);
return 0;
}
static int snd_dummy_resume(struct platform_device *pdev)
{
struct snd_card *card = platform_get_drvdata(pdev);
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
#endif
#define SND_DUMMY_DRIVER "snd_dummy"
static struct platform_driver snd_dummy_driver = {
.probe = snd_dummy_probe,
.remove = __devexit_p(snd_dummy_remove),
#ifdef CONFIG_PM
.suspend = snd_dummy_suspend,
.resume = snd_dummy_resume,
#endif
.driver = {
.name = SND_DUMMY_DRIVER},
};
static void snd_dummy_unregister_all(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(devices); ++i)
platform_device_unregister(devices[i]);
platform_driver_unregister(&snd_dummy_driver);
}
static int __init alsa_card_dummy_init(void)
{
int i, cards, err;
err = platform_driver_register(&snd_dummy_driver);
if (err < 0)
return err;
if (!giovastarted) {
giovastarted = 1;
spin_lock_init(&giovalock);
spin_lock_bh(&giovalock);
for (i = 0; i < MAX_PCM_SUBSTREAMS; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d \n", __FILE__, __LINE__, i, giovaindex);
}
giovadpcms[i].substream = NULL;
giovadpcms[i].dpcm = NULL;
giovadpcms[i].started = 0;
}
init_timer(&giovatimer);
//giovatimer.data = (unsigned long) dpcm;
giovatimer.data = (unsigned long) &giovadpcms;
giovatimer.function = snd_card_dummy_pcm_timer_function;
giovatimer.expires = ((HZ / 1000) *GIOVAMULTI)+ jiffies;
add_timer(&giovatimer);
printk("003 snd-dummy skypiax driver, %s:%d working on a machine with %dHZ kernel\n", __FILE__, __LINE__, HZ);
spin_unlock_bh(&giovalock);
}
cards = 0;
for (i = 0; i < SNDRV_CARDS; i++) {
struct platform_device *device;
if (!enable[i])
continue;
device = platform_device_register_simple(SND_DUMMY_DRIVER, i, NULL, 0);
if (IS_ERR(device))
continue;
if (!platform_get_drvdata(device)) {
platform_device_unregister(device);
continue;
}
devices[i] = device;
cards++;
}
if (!cards) {
#ifdef MODULE
printk(KERN_ERR "Dummy soundcard not found or device busy\n");
#endif
snd_dummy_unregister_all();
return -ENODEV;
}
return 0;
}
static void __exit alsa_card_dummy_exit(void)
{
del_timer(&giovatimer);
snd_dummy_unregister_all();
}
module_init(alsa_card_dummy_init)
module_exit(alsa_card_dummy_exit)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,164 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="mod_skypiax"
ProjectGUID="{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}"
RootNamespace="mod_skypiax"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
ConfigurationType="2"
InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
WarningLevel="4"
WarnAsError="false"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="rpcrt4.lib "
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
ConfigurationType="2"
InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="rpcrt4.lib "
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="..\mod_skypiax\mod_skypiax.c"
>
</File>
<File
RelativePath=".\skypiax.h"
>
</File>
<File
RelativePath=".\skypiax_protocol.c"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
gcc -shared .libs/mod_skypiax_la-mod_skypiax.o .libs/mod_skypiax_la-skypiax_protocol.o -Wl,--rpath -Wl,/usr/src/freeswitch/.libs -Wl,--rpath -Wl,/usr/local/freeswitch/lib -lm -lX11 /usr/src/freeswitch/.libs/libfreeswitch.so -L/usr/src/freeswitch/libs/apr-util/xml/expat/lib -L/usr/src/freeswitch/libs/apr-util/xml/expat/lib/.libs -L/usr/src/freeswitch/libs/apr/.libs -L/usr/src/freeswitch/libs/srtp -lncurses -Wl,-soname -Wl,mod_skypiax.so -o .libs/mod_skypiax.so
ar cru .libs/mod_skypiax.a mod_skypiax_la-mod_skypiax.o mod_skypiax_la-skypiax_protocol.o
ranlib .libs/mod_skypiax.a
creating mod_skypiax.la
(cd .libs && rm -f mod_skypiax.la && ln -s ../mod_skypiax.la mod_skypiax.la)

View File

@ -0,0 +1,332 @@
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005/2006, Anthony Minessale II <anthmct@yahoo.com>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthmct@yahoo.com>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* This module (mod_skypiax) has been contributed by:
*
* Giovanni Maruzzelli (gmaruzz@gmail.com)
*
*
* Further Contributors:
*
*
*
* mod_skypiax.c -- Skype compatible Endpoint Module
*
*/
#include <switch.h>
#include <switch_version.h>
#ifndef WIN32
#include <sys/time.h>
#include <X11/Xlib.h>
#include <X11/Xlibint.h>
#include <X11/Xatom.h>
#endif //WIN32
#ifdef _MSC_VER
//Windows macro for FD_SET includes a warning C4127: conditional expression is constant
#pragma warning(push)
#pragma warning(disable:4127)
#endif
#define MY_EVENT_INCOMING_CHATMESSAGE "skypiax::incoming_chatmessage"
#define SAMPLERATE_SKYPIAX 16000
#define SAMPLES_PER_FRAME SAMPLERATE_SKYPIAX/50
#ifndef SKYPIAX_SVN_VERSION
#define SKYPIAX_SVN_VERSION SWITCH_VERSION_REVISION
#endif /* SKYPIAX_SVN_VERSION */
typedef enum {
TFLAG_IO = (1 << 0),
TFLAG_INBOUND = (1 << 1),
TFLAG_OUTBOUND = (1 << 2),
TFLAG_DTMF = (1 << 3),
TFLAG_VOICE = (1 << 4),
TFLAG_HANGUP = (1 << 5),
TFLAG_LINEAR = (1 << 6),
TFLAG_CODEC = (1 << 7),
TFLAG_BREAK = (1 << 8)
} TFLAGS;
typedef enum {
GFLAG_MY_CODEC_PREFS = (1 << 0)
} GFLAGS;
#define DEBUGA_SKYPE(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_SKYPE %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define DEBUGA_CALL(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_CALL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define DEBUGA_PBX(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_PBX %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define ERRORA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][ERRORA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][WARNINGA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][NOTICA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define SKYPIAX_P_LOG NULL, (unsigned long)55, __LINE__, tech_pvt ? tech_pvt->name ? tech_pvt->name : "none" : "none", -1, tech_pvt ? tech_pvt->interface_state : -1, tech_pvt ? tech_pvt->skype_callflow : -1
/*********************************/
#define SKYPIAX_CAUSE_NORMAL 1
/*********************************/
#define SKYPIAX_FRAME_DTMF 1
/*********************************/
#define SKYPIAX_CONTROL_RINGING 1
#define SKYPIAX_CONTROL_ANSWER 2
/*********************************/
#define SKYPIAX_STATE_IDLE 0
#define SKYPIAX_STATE_DOWN 1
#define SKYPIAX_STATE_RING 2
#define SKYPIAX_STATE_DIALING 3
#define SKYPIAX_STATE_BUSY 4
#define SKYPIAX_STATE_UP 5
#define SKYPIAX_STATE_RINGING 6
#define SKYPIAX_STATE_PRERING 7
#define SKYPIAX_STATE_ERROR_DOUBLE_CALL 8
#define SKYPIAX_STATE_SELECTED 9
#define SKYPIAX_STATE_HANGUP_REQUESTED 10
#define SKYPIAX_STATE_PREANSWER 11
/*********************************/
/* call flow from the device */
#define CALLFLOW_CALL_IDLE 0
#define CALLFLOW_CALL_DOWN 1
#define CALLFLOW_INCOMING_RING 2
#define CALLFLOW_CALL_DIALING 3
#define CALLFLOW_CALL_LINEBUSY 4
#define CALLFLOW_CALL_ACTIVE 5
#define CALLFLOW_INCOMING_HANGUP 6
#define CALLFLOW_CALL_RELEASED 7
#define CALLFLOW_CALL_NOCARRIER 8
#define CALLFLOW_CALL_INFLUX 9
#define CALLFLOW_CALL_INCOMING 10
#define CALLFLOW_CALL_FAILED 11
#define CALLFLOW_CALL_NOSERVICE 12
#define CALLFLOW_CALL_OUTGOINGRESTRICTED 13
#define CALLFLOW_CALL_SECURITYFAIL 14
#define CALLFLOW_CALL_NOANSWER 15
#define CALLFLOW_STATUS_FINISHED 16
#define CALLFLOW_STATUS_CANCELLED 17
#define CALLFLOW_STATUS_FAILED 18
#define CALLFLOW_STATUS_REFUSED 19
#define CALLFLOW_STATUS_RINGING 20
#define CALLFLOW_STATUS_INPROGRESS 21
#define CALLFLOW_STATUS_UNPLACED 22
#define CALLFLOW_STATUS_ROUTING 23
#define CALLFLOW_STATUS_EARLYMEDIA 24
#define CALLFLOW_INCOMING_CALLID 25
#define CALLFLOW_STATUS_REMOTEHOLD 26
/*********************************/
#define SKYPIAX_MAX_INTERFACES 64
#ifndef WIN32
struct SkypiaxHandles {
Window skype_win;
Display *disp;
Window win;
int currentuserhandle;
int api_connected;
int fdesc[2];
};
#else //WIN32
struct SkypiaxHandles {
HWND win32_hInit_MainWindowHandle;
HWND win32_hGlobal_SkypeAPIWindowHandle;
HINSTANCE win32_hInit_ProcessHandle;
char win32_acInit_WindowClassName[128];
UINT win32_uiGlobal_MsgID_SkypeControlAPIAttach;
UINT win32_uiGlobal_MsgID_SkypeControlAPIDiscover;
int currentuserhandle;
int api_connected;
switch_file_t *fdesc[2];
};
#endif //WIN32
#define MAX_CHATS 10
struct chat {
char chatname[256];
char dialog_partner[256];
};
typedef struct chat chat_t;
#define MAX_CHATMESSAGES 10
struct chatmessage {
char id[256];
char type[256];
char chatname[256];
char from_handle[256];
char from_dispname[256];
char body[512];
};
typedef struct chatmessage chatmessage_t;
struct private_object {
unsigned int flags;
switch_codec_t read_codec;
switch_codec_t write_codec;
switch_frame_t read_frame;
unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE];
char session_uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
switch_caller_profile_t *caller_profile;
switch_mutex_t *mutex;
switch_mutex_t *flag_mutex;
switch_mutex_t *flag_audio_cli_mutex;
switch_mutex_t *flag_audio_srv_mutex;
char interface_id[80];
char name[80];
char dialplan[80];
char context[80];
char dial_regex[256];
char fail_dial_regex[256];
char hold_music[256];
char type[256];
char X11_display[256];
#ifdef WIN32
unsigned short tcp_cli_port;
unsigned short tcp_srv_port;
#else
int tcp_cli_port;
int tcp_srv_port;
#endif
struct SkypiaxHandles SkypiaxHandles;
int interface_state; /*!< \brief 'state' of the interface (channel) */
char language[80]; /*!< \brief default Asterisk dialplan language for this interface */
char exten[80]; /*!< \brief default Asterisk dialplan extension for this interface */
int skypiax_sound_rate; /*!< \brief rate of the sound device, in Hz, eg: 8000 */
char callid_name[50];
char callid_number[50];
double playback_boost;
double capture_boost;
int stripmsd;
char skype_call_id[512];
int skype_call_ongoing;
char skype_friends[4096];
char skype_fullname[512];
char skype_displayname[512];
int skype_callflow; /*!< \brief 'callflow' of the skype interface (as opposed to phone interface) */
int skype; /*!< \brief config flag, bool, Skype support on this interface (0 if false, -1 if true) */
int control_to_send;
#ifdef WIN32
switch_file_t *audiopipe_srv[2];
switch_file_t *audiopipe_cli[2];
switch_file_t *skypiax_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */
#else /* WIN32 */
int audiopipe_srv[2];
int audiopipe_cli[2];
int skypiax_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */
#endif /* WIN32 */
switch_thread_t *tcp_srv_thread;
switch_thread_t *tcp_cli_thread;
switch_thread_t *skypiax_signaling_thread;
switch_thread_t *skypiax_api_thread;
short audiobuf[SAMPLES_PER_FRAME];
int audiobuf_is_loaded;
short audiobuf_cli[SAMPLES_PER_FRAME];
switch_mutex_t *mutex_audio_cli;
int flag_audio_cli;
short audiobuf_srv[SAMPLES_PER_FRAME];
switch_mutex_t *mutex_audio_srv;
int flag_audio_srv;
//int phonebook_listing;
//int phonebook_querying;
//int phonebook_listing_received_calls;
//int phonebook_first_entry;
//int phonebook_last_entry;
//int phonebook_number_lenght;
//int phonebook_text_lenght;
FILE *phonebook_writing_fp;
int skypiax_dir_entry_extension_prefix;
char skype_user[256];
char skype_password[256];
char destination[256];
struct timeval answer_time;
struct timeval transfer_time;
char transfer_callid_number[50];
char skype_transfer_call_id[512];
int running;
uint32_t ib_calls;
uint32_t ob_calls;
uint32_t ib_failed_calls;
uint32_t ob_failed_calls;
chatmessage_t chatmessages[MAX_CHATMESSAGES];
chat_t chats[MAX_CHATS];
uint32_t report_incoming_chatmessages;
switch_timer_t timer_read;
switch_timer_t timer_write;
unsigned int writefd;
unsigned int readfd;
};
typedef struct private_object private_t;
void *SWITCH_THREAD_FUNC skypiax_api_thread_func(switch_thread_t * thread, void *obj);
int skypiax_audio_read(private_t * tech_pvt);
int skypiax_audio_init(private_t * tech_pvt);
int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype);
int skypiax_signaling_read(private_t * tech_pvt);
int skypiax_call(private_t * tech_pvt, char *idest, int timeout);
int skypiax_senddigit(private_t * tech_pvt, char digit);
void *skypiax_do_tcp_srv_thread_func(void *obj);
void *SWITCH_THREAD_FUNC skypiax_do_tcp_srv_thread(switch_thread_t * thread, void *obj);
void *skypiax_do_tcp_cli_thread_func(void *obj);
void *SWITCH_THREAD_FUNC skypiax_do_tcp_cli_thread(switch_thread_t * thread, void *obj);
void *skypiax_do_skypeapi_thread_func(void *obj);
void *SWITCH_THREAD_FUNC skypiax_do_skypeapi_thread(switch_thread_t * thread, void *obj);
int dtmf_received(private_t * tech_pvt, char *value);
int start_audio_threads(private_t * tech_pvt);
int new_inbound_channel(private_t * tech_pvt);
int outbound_channel_answered(private_t * tech_pvt);
int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype);
#if defined(WIN32) && !defined(__CYGWIN__)
int skypiax_pipe_read(switch_file_t * pipe, short *buf, int howmany);
int skypiax_pipe_write(switch_file_t * pipe, short *buf, int howmany);
/* Visual C do not have strsep ? */
char *strsep(char **stringp, const char *delim);
#else
int skypiax_pipe_read(int pipe, short *buf, int howmany);
int skypiax_pipe_write(int pipe, short *buf, int howmany);
#endif /* WIN32 */
int skypiax_close_socket(unsigned int fd);
private_t *find_available_skypiax_interface_rr(private_t * tech_pvt_calling);
int remote_party_is_ringing(private_t * tech_pvt);
int remote_party_is_early_media(private_t * tech_pvt);
int skypiax_answer(private_t * tech_pvt, char *id, char *value);
int skypiax_transfer(private_t * tech_pvt, char *id, char *value);
#ifndef WIN32
int skypiax_socket_create_and_bind(private_t * tech_pvt, int *which_port);
#else
int skypiax_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_port);
#endif //WIN32
int incoming_chatmessage(private_t * tech_pvt, int which);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,55 @@
Index: skypiax_protocol.c
===================================================================
--- skypiax_protocol.c (revision 16583)
+++ skypiax_protocol.c (working copy)
@@ -1040,22 +1040,35 @@
fdselect = fd;
FD_SET(fdselect, &fs);
+#if 1
//FIXME rt = select(fdselect + 1, NULL, &fs, NULL, &to);
while (tech_pvt->flag_audio_cli == 0) {
#ifdef WIN32
skypiax_sleep(100); //0.1 millisec
#else
- skypiax_sleep(1000); //1 millisec
+ skypiax_sleep(10000); //10 millisec
#endif //WIN32
//WARNINGA("write now is 0\n", SKYPIAX_P_LOG);
}
//ERRORA("write is now 1\n", SKYPIAX_P_LOG);
rt = 1;
+#endif //0
+ //rt = select(fdselect + 1, NULL, &fs, NULL, NULL);
if (rt > 0) {
int counter;
-
+#if 0
+ while (tech_pvt->flag_audio_cli == 0) {
+#ifdef WIN32
+ skypiax_sleep(100); //0.1 millisec
+#else
+ skypiax_sleep(10000); //10 millisec
+#endif //WIN32
+ WARNINGA("write now is 0\n", SKYPIAX_P_LOG);
+ }
+#endif //0
+
/* until we drained the pipe to empty */
//for (counter = 0; counter < 10; counter++) {
for (counter = 0; counter < 1; counter++) {
@@ -1155,10 +1168,10 @@
#ifdef WIN32
skypiax_sleep(100); //0.1 millisec
#else
- skypiax_sleep(1000); //1 millisec
+ skypiax_sleep(10000); //10 millisec
#endif //WIN32
- //WARNINGA("read now is 0\n", SKYPIAX_P_LOG);
+ WARNINGA("read now is 0\n", SKYPIAX_P_LOG);
}
//ERRORA("read is now 1\n", SKYPIAX_P_LOG);
//samples = skypiax_pipe_read(tech_pvt->audiopipe_srv[0], tech_pvt->read_frame.data, SAMPLES_PER_FRAME * sizeof(short));

View File

@ -0,0 +1,610 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# src/mod/endpoints/mod_skypiax/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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.
srcdir = .
top_srcdir = ../../../..
pkgdatadir = $(datadir)/libfreeswitch
pkglibdir = $(libdir)/libfreeswitch
pkgincludedir = $(includedir)/libfreeswitch
top_builddir = ../../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/install -c
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 = i686-redhat-linux-gnu
host_triplet = i686-redhat-linux-gnu
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/build/modmake.rulesam
subdir = src/mod/endpoints/mod_skypiax
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(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)/build/config/ax_lib_mysql.m4 \
$(top_srcdir)/build/config/ax_check_java.m4 \
$(top_srcdir)/build/config/erlang.m4 \
$(top_srcdir)/build/config/odbc.m4 \
$(top_srcdir)/build/config/sched_setaffinity.m4 \
$(top_srcdir)/libs/apr/build/apr_common.m4 \
$(top_srcdir)/libs/sofia-sip/m4/sac-pkg-config.m4 \
$(top_srcdir)/libs/sofia-sip/m4/sac-openssl.m4 \
$(top_srcdir)/build/config/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 \
$(top_builddir)/libs/xmlrpc-c/xmlrpc_amconfig.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(moddir)"
modLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(mod_LTLIBRARIES)
mod_skypiax_la_DEPENDENCIES = $(switch_builddir)/libfreeswitch.la
am_mod_skypiax_la_OBJECTS = mod_skypiax_la-mod_skypiax.lo \
mod_skypiax_la-skypiax_protocol.lo
mod_skypiax_la_OBJECTS = $(am_mod_skypiax_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include -I$(top_builddir)/libs/xmlrpc-c
depcomp = $(SHELL) $(top_srcdir)/build/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(mod_skypiax_la_SOURCES)
DIST_SOURCES = $(mod_skypiax_la_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /usr/src/freeswitch/build/config/missing --run aclocal-1.9
AMDEP_FALSE = #
AMDEP_TRUE =
AMTAR = ${SHELL} /usr/src/freeswitch/build/config/missing --run tar
AM_MAKEFLAGS = `test -n "$(VERBOSE)" || echo -s`
AR = ar
ATTR_UNUSED = __attribute__((__unused__))
AUTOCONF = ${SHELL} /usr/src/freeswitch/build/config/missing --run autoconf
AUTOHEADER = ${SHELL} /usr/src/freeswitch/build/config/missing --run autoheader
AUTOMAKE = ${SHELL} /usr/src/freeswitch/build/config/missing --run automake-1.9
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CONF_DISABLED_MODULES = $$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed -e "s|^.*/||" | sort | uniq )
CONF_MODULES = $$(grep -v "\#" $(switch_builddir)/modules.conf | sed -e "s|^.*/||" | sort | uniq )
CPP = gcc -E
CPPFLAGS =
CURL = /usr/bin/curl
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DIRECTORY_SEPARATOR = /
DYNAMIC_LIB_EXTEN = so
ECHO = echo
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = grep -E
ENABLE_CPP_FALSE = #
ENABLE_CPP_TRUE =
ENABLE_ZRTP_FALSE =
ENABLE_ZRTP_TRUE = #
ERLANG = no
ERLANG_CFLAGS =
ERLANG_LDFLAGS =
ESL_LDFLAGS =
EXEEXT =
GETLIB = cd /usr/src/freeswitch/libs && /bin/sh /usr/src/freeswitch/build/getlib.sh
GETSOUNDS = /bin/sh /usr/src/freeswitch/build/getsounds.sh
HAVE_LIBEDIT_FALSE = #
HAVE_LIBEDIT_TRUE =
HAVE_LIBWWW_SSL_DEFINE = 0
HAVE_MYSQL_FALSE =
HAVE_MYSQL_TRUE = #
HAVE_ODBC_FALSE =
HAVE_ODBC_TRUE = #
HAVE_TLS_FALSE =
HAVE_TLS_TRUE = #
HAVE_WCHAR_H_DEFINE = 1
HasJava_FALSE =
HasJava_TRUE = #
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
IS64BITLINUX_FALSE =
IS64BITLINUX_TRUE = #
ISLINUX_FALSE = #
ISLINUX_TRUE =
ISMAC_FALSE =
ISMAC_TRUE = #
JACK_CFLAGS =
JACK_LIBS =
JAVA_FLAGS =
JAVA_HOME =
LDFLAGS =
LIBCURL = ${switch_builddir}/libs/curl/lib/libcurl.la
LIBCURL_CPPFLAGS = -I${switch_srcdir}/libs/curl/include
LIBCURL_DEPS = ${switch_builddir}/libs/curl/lib/libcurl.la
LIBOBJS =
# Dirty trick to override the link output
LIBS = -lncurses > $(MODNAME).log || error="yes";if test -n "$(VERBOSE)" \
-o "$$error" = "yes";then cat $(MODNAME).log;fi;if test \
"$$error" = "yes";then exit 1;fi
#we should set all these vars from configure, no reason to have these in each Makefile.am
LIBTOOL = echo "`link=\`echo $@|grep .la;echo $@|grep .so;echo $@|grep .dll\`;if test -n "$$link"; then echo Creating $@;fi`";`if test -z "$(VERBOSE)" ; \
then echo $(SHELL) $(switch_builddir)/quiet_libtool ;else echo $(SHELL) $(switch_builddir)/libtool; fi`
LIBTOOL_LIB_EXTEN = so
LIB_JAVA =
LIB_SUBDIR = lib
LN_S = ln -s
LTLIBOBJS =
MAKEINFO = ${SHELL} /usr/src/freeswitch/build/config/missing --run makeinfo
OBJEXT = o
ODBC_INC_DIR =
ODBC_INC_FLAGS =
ODBC_LIB_DIR =
ODBC_LIB_FLAGS =
OUR_CLEAN_MODS = $$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )
OUR_DISABLED_CLEAN_MODS = $$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )
OUR_DISABLED_INSTALL_MODS = $$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )
OUR_DISABLED_MODS = $$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )
OUR_DISABLED_UNINSTALL_MODS = $$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )
OUR_INSTALL_MODS = $$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )
OUR_MODS = $$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )
OUR_UNINSTALL_MODS = $$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )
PACKAGE = libfreeswitch
PACKAGE_BUGREPORT = BUG-REPORT-ADDRESS
PACKAGE_NAME = freeswitch
PACKAGE_STRING = freeswitch 1.0.trunk
PACKAGE_TARNAME = freeswitch
PACKAGE_VERSION = 1.0.trunk
PATH_SEPARATOR = :
PA_LIBS =
PKG_CONFIG = no
PLATFORM_CORE_DEPLIBS =
PRTDIAG =
PYTHON = /usr/bin/python
PYTHON_CFLAGS = -I/usr/include/python2.4 -I/usr/include/python2.4 -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC
PYTHON_LDFLAGS = -lpthread -ldl -lutil -lm -lpython2.4
PYTHON_SITE_DIR = /usr/lib/python2.4/site-packages
RANLIB = ranlib
SED = /bin/sed
SET_MAKE =
SHELL = /bin/sh
SOLINK = -shared -Xlinker -x
STRIP = strip
SWITCH_AM_CFLAGS = -I/usr/src/freeswitch/src/include -I/usr/src/freeswitch/src/include -I/usr/src/freeswitch/libs/libteletone/src -fPIC -Werror -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -g -ggdb
SWITCH_AM_CXXFLAGS = -I/usr/src/freeswitch/src/include -I/usr/src/freeswitch/src/include -I/usr/src/freeswitch/libs/libteletone/src -fPIC -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1
SWITCH_AM_LDFLAGS = -lm
SWITCH_ANSI_CFLAGS = -Wall -std=c99 -pedantic -Wdeclaration-after-statement
SWITCH_VERSION_MAJOR = 1
SWITCH_VERSION_MICRO = trunk
SWITCH_VERSION_MINOR = 0
TAR = /bin/gtar
TOUCH_TARGET = if test -f "$@";then touch "$@";fi;
VA_LIST_IS_ARRAY_DEFINE = 0
VERSION = 0.1
WANT_DEBUG_FALSE = #
WANT_DEBUG_TRUE =
WGET = /usr/bin/wget
ZCAT = /bin/gunzip
_libcurl_config =
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_CXX = g++
ac_ct_RANLIB = ranlib
ac_ct_STRIP = strip
am__fastdepCC_FALSE = #
am__fastdepCC_TRUE =
am__fastdepCXX_FALSE = #
am__fastdepCXX_TRUE =
am__include = include
am__leading_dot = .
am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build = i686-redhat-linux-gnu
build_alias =
build_cpu = i686
build_os = linux-gnu
build_vendor = redhat
confdir = /usr/local/freeswitch/conf
datadir = ${prefix}/share
dbdir = /usr/local/freeswitch/db
exec_prefix = ${prefix}
grammardir = /usr/local/freeswitch/grammar
host = i686-redhat-linux-gnu
host_alias =
host_cpu = i686
host_os = linux-gnu
host_vendor = redhat
htdocsdir = /usr/local/freeswitch/htdocs
includedir = ${prefix}/include
infodir = ${prefix}/info
install_sh = /usr/src/freeswitch/build/config/install-sh
int64_t_fmt = #define SWITCH_INT64_T_FMT "lld"
int64_value = long long
int_value = int
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localstatedir = ${prefix}/var
logfiledir = /usr/local/freeswitch/log
long_value = long long
mandir = ${prefix}/man
mkdir_p = mkdir -p --
modulesdir = /usr/local/freeswitch/mod
oldincludedir = /usr/include
openssl_CFLAGS =
openssl_LIBS =
prefix = /usr/local/freeswitch
program_transform_name = s,x,x,
recordingsdir = /usr/local/freeswitch/recordings
runtimedir = /usr/local/freeswitch/run
sbindir = ${exec_prefix}/sbin
scriptdir = /usr/local/freeswitch/scripts
sharedstatedir = ${prefix}/com
short_value = short
size_t_fmt = #define SWITCH_SIZE_T_FMT "d"
size_t_value = size_t
soundsdir = /usr/local/freeswitch/sounds
ssize_t_fmt = #define SWITCH_SSIZE_T_FMT "d"
ssize_t_value = ssize_t
subdirs = libs/srtp libs/sqlite libs/libedit libs/pcre libs/apr libs/apr-util libs/ilbc libs/curl libs/iksemel libs/js/nsprpub libs/js libs/libdingaling libs/libsndfile libs/sofia-sip libs/speex libs/portaudio libs/openzap libs/unimrcp libs/tiff-3.8.2 libs/spandsp libs/broadvoice libs/libg722_1
switch_builddir = /usr/src/freeswitch
switch_srcdir = /usr/src/freeswitch
sysconfdir = /usr/local/freeswitch/conf
target_alias =
uint64_t_fmt = #define SWITCH_UINT64_T_FMT "llu"
voidp_size = 4
AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS)
AM_CPPFLAGS = $(SWITCH_AM_CXXFLAGS)
AM_LDFLAGS = $(SWITCH_AM_LDFLAGS)
moddir = /usr/local/freeswitch/mod
MODNAME = mod_skypiax
mod_LTLIBRARIES = mod_skypiax.la
mod_skypiax_la_SOURCES = mod_skypiax.c skypiax_protocol.c
mod_skypiax_la_CFLAGS = $(AM_CFLAGS) -DSKYPIAX_SVN_VERSION=\"`cat $(switch_builddir)/.version`\"
mod_skypiax_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_skypiax_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lX11
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/build/modmake.rulesam $(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/mod/endpoints/mod_skypiax/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/mod/endpoints/mod_skypiax/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
install-modLTLIBRARIES: $(mod_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(moddir)" || $(mkdir_p) "$(DESTDIR)$(moddir)"
@list='$(mod_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(modLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(moddir)/$$f'"; \
$(LIBTOOL) --mode=install $(modLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(moddir)/$$f"; \
else :; fi; \
done
uninstall-modLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@set -x; list='$(mod_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(moddir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(moddir)/$$p"; \
done
clean-modLTLIBRARIES:
-test -z "$(mod_LTLIBRARIES)" || rm -f $(mod_LTLIBRARIES)
@list='$(mod_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
mod_skypiax.la: $(mod_skypiax_la_OBJECTS) $(mod_skypiax_la_DEPENDENCIES)
$(LINK) -rpath $(moddir) $(mod_skypiax_la_LDFLAGS) $(mod_skypiax_la_OBJECTS) $(mod_skypiax_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/mod_skypiax_la-mod_skypiax.Plo
include ./$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Plo
.c.o:
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c $<
.c.obj:
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=yes \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(LTCOMPILE) -c -o $@ $<
mod_skypiax_la-mod_skypiax.lo: mod_skypiax.c
if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -MT mod_skypiax_la-mod_skypiax.lo -MD -MP -MF "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo" -c -o mod_skypiax_la-mod_skypiax.lo `test -f 'mod_skypiax.c' || echo '$(srcdir)/'`mod_skypiax.c; \
then mv -f "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo" "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Plo"; else rm -f "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo"; exit 1; fi
# source='mod_skypiax.c' object='mod_skypiax_la-mod_skypiax.lo' libtool=yes \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -c -o mod_skypiax_la-mod_skypiax.lo `test -f 'mod_skypiax.c' || echo '$(srcdir)/'`mod_skypiax.c
mod_skypiax_la-skypiax_protocol.lo: skypiax_protocol.c
if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -MT mod_skypiax_la-skypiax_protocol.lo -MD -MP -MF "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo" -c -o mod_skypiax_la-skypiax_protocol.lo `test -f 'skypiax_protocol.c' || echo '$(srcdir)/'`skypiax_protocol.c; \
then mv -f "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo" "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Plo"; else rm -f "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo"; exit 1; fi
# source='skypiax_protocol.c' object='mod_skypiax_la-skypiax_protocol.lo' libtool=yes \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -c -o mod_skypiax_la-skypiax_protocol.lo `test -f 'skypiax_protocol.c' || echo '$(srcdir)/'`skypiax_protocol.c
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
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: $(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; }'`; \
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: $(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)
$(mkdir_p) $(distdir)/../../../../build
@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
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(moddir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
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-am
clean-am: clean-generic clean-libtool clean-modLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-modLTLIBRARIES
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-modLTLIBRARIES
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-modLTLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-libtool \
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-modLTLIBRARIES install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-modLTLIBRARIES
all-modules: all
depend-modules: depend
clean-modules: clean
install-modules: install
uninstall-modules: uninstall
distclean-modules: distclean
extraclean-modules: extraclean
# 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:

View File

@ -0,0 +1,7 @@
include $(top_srcdir)/build/modmake.rulesam
MODNAME=mod_skypiax
mod_LTLIBRARIES = mod_skypiax.la
mod_skypiax_la_SOURCES = mod_skypiax.c skypiax_protocol.c
mod_skypiax_la_CFLAGS = $(AM_CFLAGS) -DSKYPIAX_SVN_VERSION=\"`cat $(switch_builddir)/.version`\"
mod_skypiax_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_skypiax_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lX11

View File

@ -0,0 +1,610 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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@
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/build/modmake.rulesam
subdir = src/mod/endpoints/mod_skypiax
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(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)/build/config/ax_lib_mysql.m4 \
$(top_srcdir)/build/config/ax_check_java.m4 \
$(top_srcdir)/build/config/erlang.m4 \
$(top_srcdir)/build/config/odbc.m4 \
$(top_srcdir)/build/config/sched_setaffinity.m4 \
$(top_srcdir)/libs/apr/build/apr_common.m4 \
$(top_srcdir)/libs/sofia-sip/m4/sac-pkg-config.m4 \
$(top_srcdir)/libs/sofia-sip/m4/sac-openssl.m4 \
$(top_srcdir)/build/config/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 \
$(top_builddir)/libs/xmlrpc-c/xmlrpc_amconfig.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(moddir)"
modLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(mod_LTLIBRARIES)
mod_skypiax_la_DEPENDENCIES = $(switch_builddir)/libfreeswitch.la
am_mod_skypiax_la_OBJECTS = mod_skypiax_la-mod_skypiax.lo \
mod_skypiax_la-skypiax_protocol.lo
mod_skypiax_la_OBJECTS = $(am_mod_skypiax_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include -I$(top_builddir)/libs/xmlrpc-c
depcomp = $(SHELL) $(top_srcdir)/build/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(mod_skypiax_la_SOURCES)
DIST_SOURCES = $(mod_skypiax_la_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AM_MAKEFLAGS = `test -n "$(VERBOSE)" || echo -s`
AR = @AR@
ATTR_UNUSED = @ATTR_UNUSED@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONF_DISABLED_MODULES = @CONF_DISABLED_MODULES@
CONF_MODULES = @CONF_MODULES@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CURL = @CURL@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DIRECTORY_SEPARATOR = @DIRECTORY_SEPARATOR@
DYNAMIC_LIB_EXTEN = @DYNAMIC_LIB_EXTEN@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_CPP_FALSE = @ENABLE_CPP_FALSE@
ENABLE_CPP_TRUE = @ENABLE_CPP_TRUE@
ENABLE_ZRTP_FALSE = @ENABLE_ZRTP_FALSE@
ENABLE_ZRTP_TRUE = @ENABLE_ZRTP_TRUE@
ERLANG = @ERLANG@
ERLANG_CFLAGS = @ERLANG_CFLAGS@
ERLANG_LDFLAGS = @ERLANG_LDFLAGS@
ESL_LDFLAGS = @ESL_LDFLAGS@
EXEEXT = @EXEEXT@
GETLIB = @GETLIB@
GETSOUNDS = @GETSOUNDS@
HAVE_LIBEDIT_FALSE = @HAVE_LIBEDIT_FALSE@
HAVE_LIBEDIT_TRUE = @HAVE_LIBEDIT_TRUE@
HAVE_LIBWWW_SSL_DEFINE = @HAVE_LIBWWW_SSL_DEFINE@
HAVE_MYSQL_FALSE = @HAVE_MYSQL_FALSE@
HAVE_MYSQL_TRUE = @HAVE_MYSQL_TRUE@
HAVE_ODBC_FALSE = @HAVE_ODBC_FALSE@
HAVE_ODBC_TRUE = @HAVE_ODBC_TRUE@
HAVE_TLS_FALSE = @HAVE_TLS_FALSE@
HAVE_TLS_TRUE = @HAVE_TLS_TRUE@
HAVE_WCHAR_H_DEFINE = @HAVE_WCHAR_H_DEFINE@
HasJava_FALSE = @HasJava_FALSE@
HasJava_TRUE = @HasJava_TRUE@
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@
JACK_CFLAGS = @JACK_CFLAGS@
JACK_LIBS = @JACK_LIBS@
JAVA_FLAGS = @JAVA_FLAGS@
JAVA_HOME = @JAVA_HOME@
LDFLAGS = @LDFLAGS@
LIBCURL = @LIBCURL@
LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
LIBCURL_DEPS = @LIBCURL_DEPS@
LIBOBJS = @LIBOBJS@
# Dirty trick to override the link output
LIBS = @LIBS@ > $(MODNAME).log || error="yes";if test -n "$(VERBOSE)" \
-o "$$error" = "yes";then cat $(MODNAME).log;fi;if test \
"$$error" = "yes";then exit 1;fi
#we should set all these vars from configure, no reason to have these in each Makefile.am
LIBTOOL = echo "`link=\`echo $@|grep .la;echo $@|grep .so;echo $@|grep .dll\`;if test -n "$$link"; then echo Creating $@;fi`";`if test -z "$(VERBOSE)" ; \
then echo $(SHELL) $(switch_builddir)/quiet_libtool ;else echo $(SHELL) $(switch_builddir)/libtool; fi`
LIBTOOL_LIB_EXTEN = @LIBTOOL_LIB_EXTEN@
LIB_JAVA = @LIB_JAVA@
LIB_SUBDIR = @LIB_SUBDIR@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
ODBC_INC_DIR = @ODBC_INC_DIR@
ODBC_INC_FLAGS = @ODBC_INC_FLAGS@
ODBC_LIB_DIR = @ODBC_LIB_DIR@
ODBC_LIB_FLAGS = @ODBC_LIB_FLAGS@
OUR_CLEAN_MODS = @OUR_CLEAN_MODS@
OUR_DISABLED_CLEAN_MODS = @OUR_DISABLED_CLEAN_MODS@
OUR_DISABLED_INSTALL_MODS = @OUR_DISABLED_INSTALL_MODS@
OUR_DISABLED_MODS = @OUR_DISABLED_MODS@
OUR_DISABLED_UNINSTALL_MODS = @OUR_DISABLED_UNINSTALL_MODS@
OUR_INSTALL_MODS = @OUR_INSTALL_MODS@
OUR_MODS = @OUR_MODS@
OUR_UNINSTALL_MODS = @OUR_UNINSTALL_MODS@
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@
PA_LIBS = @PA_LIBS@
PKG_CONFIG = @PKG_CONFIG@
PLATFORM_CORE_DEPLIBS = @PLATFORM_CORE_DEPLIBS@
PRTDIAG = @PRTDIAG@
PYTHON = @PYTHON@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
PYTHON_SITE_DIR = @PYTHON_SITE_DIR@
RANLIB = @RANLIB@
SED = @SED@
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@
SWITCH_ANSI_CFLAGS = @SWITCH_ANSI_CFLAGS@
SWITCH_VERSION_MAJOR = @SWITCH_VERSION_MAJOR@
SWITCH_VERSION_MICRO = @SWITCH_VERSION_MICRO@
SWITCH_VERSION_MINOR = @SWITCH_VERSION_MINOR@
TAR = @TAR@
TOUCH_TARGET = @TOUCH_TARGET@
VA_LIST_IS_ARRAY_DEFINE = @VA_LIST_IS_ARRAY_DEFINE@
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_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@
confdir = @confdir@
datadir = @datadir@
dbdir = @dbdir@
exec_prefix = @exec_prefix@
grammardir = @grammardir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htdocsdir = @htdocsdir@
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@
logfiledir = @logfiledir@
long_value = @long_value@
mandir = @mandir@
mkdir_p = @mkdir_p@
modulesdir = @modulesdir@
oldincludedir = @oldincludedir@
openssl_CFLAGS = @openssl_CFLAGS@
openssl_LIBS = @openssl_LIBS@
prefix = @prefix@
program_transform_name = @program_transform_name@
recordingsdir = @recordingsdir@
runtimedir = @runtimedir@
sbindir = @sbindir@
scriptdir = @scriptdir@
sharedstatedir = @sharedstatedir@
short_value = @short_value@
size_t_fmt = @size_t_fmt@
size_t_value = @size_t_value@
soundsdir = @soundsdir@
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@
AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS)
AM_CPPFLAGS = $(SWITCH_AM_CXXFLAGS)
AM_LDFLAGS = $(SWITCH_AM_LDFLAGS)
moddir = @modulesdir@
MODNAME = mod_skypiax
mod_LTLIBRARIES = mod_skypiax.la
mod_skypiax_la_SOURCES = mod_skypiax.c skypiax_protocol.c
mod_skypiax_la_CFLAGS = $(AM_CFLAGS) -DSKYPIAX_SVN_VERSION=\"`cat $(switch_builddir)/.version`\"
mod_skypiax_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_skypiax_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lX11
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/build/modmake.rulesam $(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/mod/endpoints/mod_skypiax/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/mod/endpoints/mod_skypiax/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
install-modLTLIBRARIES: $(mod_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(moddir)" || $(mkdir_p) "$(DESTDIR)$(moddir)"
@list='$(mod_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(modLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(moddir)/$$f'"; \
$(LIBTOOL) --mode=install $(modLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(moddir)/$$f"; \
else :; fi; \
done
uninstall-modLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@set -x; list='$(mod_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(moddir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(moddir)/$$p"; \
done
clean-modLTLIBRARIES:
-test -z "$(mod_LTLIBRARIES)" || rm -f $(mod_LTLIBRARIES)
@list='$(mod_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
mod_skypiax.la: $(mod_skypiax_la_OBJECTS) $(mod_skypiax_la_DEPENDENCIES)
$(LINK) -rpath $(moddir) $(mod_skypiax_la_LDFLAGS) $(mod_skypiax_la_OBJECTS) $(mod_skypiax_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_skypiax_la-mod_skypiax.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mod_skypiax_la-mod_skypiax.lo: mod_skypiax.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -MT mod_skypiax_la-mod_skypiax.lo -MD -MP -MF "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo" -c -o mod_skypiax_la-mod_skypiax.lo `test -f 'mod_skypiax.c' || echo '$(srcdir)/'`mod_skypiax.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo" "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Plo"; else rm -f "$(DEPDIR)/mod_skypiax_la-mod_skypiax.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_skypiax.c' object='mod_skypiax_la-mod_skypiax.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -c -o mod_skypiax_la-mod_skypiax.lo `test -f 'mod_skypiax.c' || echo '$(srcdir)/'`mod_skypiax.c
mod_skypiax_la-skypiax_protocol.lo: skypiax_protocol.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -MT mod_skypiax_la-skypiax_protocol.lo -MD -MP -MF "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo" -c -o mod_skypiax_la-skypiax_protocol.lo `test -f 'skypiax_protocol.c' || echo '$(srcdir)/'`skypiax_protocol.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo" "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Plo"; else rm -f "$(DEPDIR)/mod_skypiax_la-skypiax_protocol.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='skypiax_protocol.c' object='mod_skypiax_la-skypiax_protocol.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_skypiax_la_CFLAGS) $(CFLAGS) -c -o mod_skypiax_la-skypiax_protocol.lo `test -f 'skypiax_protocol.c' || echo '$(srcdir)/'`skypiax_protocol.c
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
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: $(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; }'`; \
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: $(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)
$(mkdir_p) $(distdir)/../../../../build
@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
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(moddir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
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-am
clean-am: clean-generic clean-libtool clean-modLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-modLTLIBRARIES
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-modLTLIBRARIES
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-modLTLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-libtool \
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-modLTLIBRARIES install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-modLTLIBRARIES
all-modules: all
depend-modules: depend
clean-modules: clean
install-modules: install
uninstall-modules: uninstall
distclean-modules: distclean
extraclean-modules: extraclean
# 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:

View File

@ -0,0 +1,9 @@
Skypiax, Skype Endpoint and Trunk
All documentation on compiling, using, configuring,
tricks and tweaks, possible problems at:
http://wiki.freeswitch.org/wiki/Skypiax_Skype_Endpoint_and_Trunk
< gmaruzz at gmail dot com >

View File

@ -0,0 +1,964 @@
/*
* Dummy soundcard
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <sound/driver.h> //giova
#include <linux/init.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/jiffies.h>
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/wait.h>
#include <linux/moduleparam.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/tlv.h>
#include <sound/pcm.h>
#include <sound/rawmidi.h>
#include <sound/initval.h>
MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
MODULE_DESCRIPTION("Dummy soundcard (/dev/null)");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{ALSA,Dummy soundcard}}");
#define GIOVAMULTI 1
#define MAX_PCM_DEVICES 4
#define MAX_PCM_SUBSTREAMS 128
#define MAX_MIDI_DEVICES 2
#if 0 /* emu10k1 emulation */
#define MAX_BUFFER_SIZE (128 * 1024)
static int emu10k1_playback_constraints(struct snd_pcm_runtime *runtime)
{
int err;
err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
if (err < 0)
return err;
err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256, UINT_MAX);
if (err < 0)
return err;
return 0;
}
#define add_playback_constraints emu10k1_playback_constraints
#endif
#if 0 /* RME9652 emulation */
#define MAX_BUFFER_SIZE (26 * 64 * 1024)
#define USE_FORMATS SNDRV_PCM_FMTBIT_S32_LE
#define USE_CHANNELS_MIN 26
#define USE_CHANNELS_MAX 26
#define USE_PERIODS_MIN 2
#define USE_PERIODS_MAX 2
#endif
#if 0 /* ICE1712 emulation */
#define MAX_BUFFER_SIZE (256 * 1024)
#define USE_FORMATS SNDRV_PCM_FMTBIT_S32_LE
#define USE_CHANNELS_MIN 10
#define USE_CHANNELS_MAX 10
#define USE_PERIODS_MIN 1
#define USE_PERIODS_MAX 1024
#endif
#if 0 /* UDA1341 emulation */
#define MAX_BUFFER_SIZE (16380)
#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE
#define USE_CHANNELS_MIN 2
#define USE_CHANNELS_MAX 2
#define USE_PERIODS_MIN 2
#define USE_PERIODS_MAX 255
#endif
#if 0 /* simple AC97 bridge (intel8x0) with 48kHz AC97 only codec */
#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE
#define USE_CHANNELS_MIN 2
#define USE_CHANNELS_MAX 2
#define USE_RATE SNDRV_PCM_RATE_48000
#define USE_RATE_MIN 48000
#define USE_RATE_MAX 48000
#endif
#if 0 /* CA0106 */
#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE
#define USE_CHANNELS_MIN 2
#define USE_CHANNELS_MAX 2
#define USE_RATE (SNDRV_PCM_RATE_48000|SNDRV_PCM_RATE_96000|SNDRV_PCM_RATE_192000)
#define USE_RATE_MIN 48000
#define USE_RATE_MAX 192000
#define MAX_BUFFER_SIZE ((65536-64)*8)
#define MAX_PERIOD_SIZE (65536-64)
#define USE_PERIODS_MIN 2
#define USE_PERIODS_MAX 8
#endif
/* defaults */
#ifndef MAX_BUFFER_SIZE
//#define MAX_BUFFER_SIZE (64*1024)
#define MAX_BUFFER_SIZE (256*1024)
#endif
#ifndef MAX_PERIOD_SIZE
#define MAX_PERIOD_SIZE MAX_BUFFER_SIZE
#endif
#ifndef USE_FORMATS
//#define USE_FORMATS (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE)
#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE
#endif
#ifndef USE_RATE
//#define USE_RATE SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000
#define USE_RATE SNDRV_PCM_RATE_8000
//#define USE_RATE_MIN 5500
#define USE_RATE_MIN 8000
//#define USE_RATE_MAX 48000
#define USE_RATE_MAX 8000
#endif
#ifndef USE_CHANNELS_MIN
#define USE_CHANNELS_MIN 1
#endif
#ifndef USE_CHANNELS_MAX
#define USE_CHANNELS_MAX 2
#endif
#ifndef USE_PERIODS_MIN
#define USE_PERIODS_MIN 1
#endif
#ifndef USE_PERIODS_MAX
#define USE_PERIODS_MAX 1024
#endif
#ifndef add_playback_constraints
#define add_playback_constraints(x) 0
#endif
#ifndef add_capture_constraints
#define add_capture_constraints(x) 0
#endif
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = { 1,[1 ... (SNDRV_CARDS - 1)] = 0 };
static int pcm_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1 };
static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 128 };
//static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for dummy soundcard.");
module_param_array(id, charp, NULL, 0444);
MODULE_PARM_DESC(id, "ID string for dummy soundcard.");
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable this dummy soundcard.");
module_param_array(pcm_devs, int, NULL, 0444);
MODULE_PARM_DESC(pcm_devs, "PCM devices # (0-4) for dummy driver.");
module_param_array(pcm_substreams, int, NULL, 0444);
MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-64) for dummy driver.");
//module_param_array(midi_devs, int, NULL, 0444);
//MODULE_PARM_DESC(midi_devs, "MIDI devices # (0-2) for dummy driver.");
static struct platform_device *devices[SNDRV_CARDS];
static struct timer_list giovatimer; //giova
static int giovastarted = 0;
static int giovaindex = 0;
static spinlock_t giovalock;
struct giovadpcm {
struct snd_pcm_substream *substream;
struct snd_dummy_pcm *dpcm;
int started;
};
static struct giovadpcm giovadpcms[MAX_PCM_SUBSTREAMS];
#define MIXER_ADDR_MASTER 0
#define MIXER_ADDR_LINE 1
#define MIXER_ADDR_MIC 2
#define MIXER_ADDR_SYNTH 3
#define MIXER_ADDR_CD 4
#define MIXER_ADDR_LAST 4
static void snd_card_dummy_pcm_timer_function(unsigned long data);
struct snd_dummy {
struct snd_card *card;
struct snd_pcm *pcm;
spinlock_t mixer_lock;
int mixer_volume[MIXER_ADDR_LAST + 1][2];
int capture_source[MIXER_ADDR_LAST + 1][2];
};
struct snd_dummy_pcm {
struct snd_dummy *dummy;
spinlock_t lock;
struct timer_list timer;
unsigned int pcm_buffer_size;
unsigned int pcm_period_size;
unsigned int pcm_bps; /* bytes per second */
unsigned int pcm_hz; /* HZ */
unsigned int pcm_irq_pos; /* IRQ position */
unsigned int pcm_buf_pos; /* position in buffer */
struct snd_pcm_substream *substream;
};
static inline void snd_card_dummy_pcm_timer_start(struct snd_dummy_pcm *dpcm)
{
int i;
int found = 0;
//printk("giova: 1 timer_start %d %p\n", __LINE__, dpcm);
for (i = 0; i < giovaindex + 1; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
if (giovadpcms[i].dpcm == dpcm) {
giovadpcms[i].started = 1;
found = 1;
}
}
if (!found) {
printk("skypiax: start, NOT found?\n");
}
//printk("giova: 2 timer_start %d %p\n", __LINE__, dpcm);
}
static inline void snd_card_dummy_pcm_timer_stop(struct snd_dummy_pcm *dpcm)
{
//del_timer(&dpcm->timer);
int i;
int found = 0;
//printk("giova: 1 timer_stop %d %p\n", __LINE__, dpcm);
for (i = 0; i < giovaindex + 1; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
if (giovadpcms[i].dpcm == dpcm) {
giovadpcms[i].started = 0;
found = 1;
}
}
if (!found) {
//printk("skypiax: stop, NOT found?\n");
} else {
//printk("skypiax: stop, YES found!\n");
}
//printk("giova: 2 timer_stop %d %p\n", __LINE__, dpcm);
}
static int snd_card_dummy_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm = runtime->private_data;
int err = 0;
//spin_lock(&dpcm->lock, flags);
spin_lock_bh(&giovalock);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
//printk("giova: trigger timer_start %d %p\n", __LINE__, dpcm);
snd_card_dummy_pcm_timer_start(dpcm);
break;
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
//printk("giova: trigger timer_stop %d %p\n", __LINE__, dpcm);
snd_card_dummy_pcm_timer_stop(dpcm);
break;
default:
err = -EINVAL;
break;
}
//spin_unlock(&dpcm->lock, flags);
spin_unlock_bh(&giovalock);
return 0;
}
static int snd_card_dummy_pcm_prepare(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm = runtime->private_data;
int bps;
bps = snd_pcm_format_width(runtime->format) * runtime->rate * runtime->channels / 8;
if (bps <= 0)
return -EINVAL;
dpcm->pcm_bps = bps;
dpcm->pcm_hz = HZ;
dpcm->pcm_buffer_size = snd_pcm_lib_buffer_bytes(substream);
dpcm->pcm_period_size = snd_pcm_lib_period_bytes(substream);
dpcm->pcm_irq_pos = 0;
dpcm->pcm_buf_pos = 0;
snd_pcm_format_set_silence(runtime->format, runtime->dma_area, bytes_to_samples(runtime, runtime->dma_bytes));
//printk("giova: prepare %d %p\n", __LINE__, dpcm);
return 0;
}
static void snd_card_dummy_pcm_timer_function(unsigned long data)
{
//struct snd_dummy_pcm *dpcm = (struct snd_dummy_pcm *)data;
struct snd_dummy_pcm *dpcm = NULL;
//unsigned long flags;
int i;
giovatimer.expires = (HZ/100 * (GIOVAMULTI)) + jiffies;
add_timer(&giovatimer);
for (i = 0; i < giovaindex + 1; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
//printk("giova: timer_func %d i=%d\n", __LINE__, i);
if (giovadpcms[i].started != 1)
continue;
dpcm = giovadpcms[i].dpcm;
if (dpcm == NULL) {
printk("giova: timer_func %d %d NULL: continue\n", __LINE__, i);
continue;
}
//spin_lock_bh(&dpcm->lock);
//if (in_irq())
//printk("giova: timer_func %d %d we are in HARDWARE IRQ\n", __LINE__, i);
//if(in_softirq())
//printk("giova: timer_func %d %d we are in SOFT IRQ\n", __LINE__, i);
//printk("giova: timer_func %d %d\n", __LINE__, i);
//spin_lock_irqsave(&dpcm->lock, flags);
//LOCK spin_lock_bh(&dpcm->lock);
//CICOPET printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
//dpcm->pcm_irq_pos += dpcm->pcm_bps * ((HZ / 100) * GIOVAMULTI);
//dpcm->pcm_irq_pos += (dpcm->pcm_bps * ((HZ / 100) * GIOVAMULTI));
dpcm->pcm_irq_pos += (dpcm->pcm_bps * ( (HZ / 100) * GIOVAMULTI));
//CICOPET printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
//dpcm->pcm_buf_pos += (dpcm->pcm_bps * ((HZ / 100) * GIOVAMULTI));
dpcm->pcm_buf_pos += (dpcm->pcm_bps * ( (HZ / 100) * GIOVAMULTI));
//CICOPET printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
//dpcm->pcm_buf_pos %= (dpcm->pcm_buffer_size * dpcm->pcm_hz * GIOVAMULTI);
dpcm->pcm_buf_pos %= (dpcm->pcm_buffer_size * dpcm->pcm_hz );
//BUONI printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u (dpcm->pcm_period_size * dpcm->pcm_hz)=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos, (dpcm->pcm_period_size * dpcm->pcm_hz));
if (dpcm->pcm_irq_pos >= (dpcm->pcm_period_size * dpcm->pcm_hz)) {
//CICOPET printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
dpcm->pcm_irq_pos %= (dpcm->pcm_period_size * dpcm->pcm_hz);
//BUONI printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u PASSATO!\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos);
//spin_unlock_irqrestore(&dpcm->lock, flags);
//spin_unlock_bh(&dpcm->lock);
snd_pcm_period_elapsed(dpcm->substream);
} else {
//spin_unlock_irqrestore(&dpcm->lock, flags);
//spin_unlock_bh(&dpcm->lock);
}
}
}
static snd_pcm_uframes_t snd_card_dummy_pcm_pointer(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm = runtime->private_data;
snd_pcm_uframes_t ciapa=0;
//spin_lock_bh(&dpcm->lock);
//ciapa = (dpcm->pcm_buf_pos / dpcm->pcm_hz) / (dpcm->pcm_bps/8000);
//ciapa = bytes_to_frames(runtime, (dpcm->pcm_buf_pos / (dpcm->pcm_hz ))) / GIOVAMULTI;
//printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u, ciapa=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos, ciapa);
ciapa = bytes_to_frames(runtime, (dpcm->pcm_buf_pos / (dpcm->pcm_hz )));
//spin_unlock_bh(&dpcm->lock);
//printk("%d %s, dpcm=%p, dpcm->pcm_irq_pos=%u\t\t dpcm->pcm_bps=%u\t\t dpcm->pcm_buf_pos=%u, ciapa=%u\n", __LINE__, __FILE__, dpcm, dpcm->pcm_irq_pos, dpcm->pcm_bps, dpcm->pcm_buf_pos, (unsigned int)ciapa);
return ciapa;
//return bytes_to_frames(runtime, (dpcm->pcm_buf_pos / (dpcm->pcm_hz )) / GIOVAMULTI);
//return (dpcm->pcm_buf_pos / dpcm->pcm_hz) / (dpcm->pcm_bps/8000);
}
static struct snd_pcm_hardware snd_card_dummy_playback = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID),
.formats = USE_FORMATS,
.rates = USE_RATE,
.rate_min = USE_RATE_MIN,
.rate_max = USE_RATE_MAX,
.channels_min = USE_CHANNELS_MIN,
.channels_max = USE_CHANNELS_MAX,
.buffer_bytes_max = MAX_BUFFER_SIZE,
.period_bytes_min = 64,
.period_bytes_max = MAX_PERIOD_SIZE,
.periods_min = USE_PERIODS_MIN,
.periods_max = USE_PERIODS_MAX,
.fifo_size = 0,
};
static struct snd_pcm_hardware snd_card_dummy_capture = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID),
.formats = USE_FORMATS,
.rates = USE_RATE,
.rate_min = USE_RATE_MIN,
.rate_max = USE_RATE_MAX,
.channels_min = USE_CHANNELS_MIN,
.channels_max = USE_CHANNELS_MAX,
.buffer_bytes_max = MAX_BUFFER_SIZE,
.period_bytes_min = 64,
.period_bytes_max = MAX_PERIOD_SIZE,
.periods_min = USE_PERIODS_MIN,
.periods_max = USE_PERIODS_MAX,
.fifo_size = 0,
};
static void snd_card_dummy_runtime_free(struct snd_pcm_runtime *runtime)
{
int i;
//int found=0;
//printk("snd_card_dummy_runtime_free giova 1 giovaindex=%d dpcm=%p runtime=%p\n", giovaindex, runtime->private_data, runtime);
spin_lock_bh(&giovalock);
for (i = 0; i < giovaindex; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d \n", __FILE__, __LINE__, i, giovaindex);
}
//if((giovadpcms[i].substream == substream) && (giovadpcms[i].dpcm == dpcm)){
if ((giovadpcms[i].dpcm == runtime->private_data)) {
//printk("giova, %s:%d, i=%d, giovaindex=%d %p==%p YES I AM!!!!\n", __FILE__, __LINE__, i, giovaindex, giovadpcms[i].dpcm , runtime->private_data);
//giovadpcms[i].dpcm = NULL;
//giovadpcms[i].substream = NULL;
giovadpcms[i].started = 0;
//break;
} else {
//printk("giova, %s:%d, i=%d, giovaindex=%d %p!=%p NOT ME\n", __FILE__, __LINE__, i, giovaindex, giovadpcms[i].dpcm , runtime->private_data);
}
}
spin_unlock_bh(&giovalock);
kfree(runtime->private_data);
}
static int snd_card_dummy_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params)
{
return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
}
static int snd_card_dummy_hw_free(struct snd_pcm_substream *substream)
{
return snd_pcm_lib_free_pages(substream);
}
static struct snd_dummy_pcm *new_pcm_stream(struct snd_pcm_substream *substream)
{
struct snd_dummy_pcm *dpcm;
int i;
int found = 0;
//printk("giova, %s:%d, i=%d, giovaindex=%d %p==%p YES I AM!!!!\n", __FILE__, __LINE__, i, giovaindex, giovadpcms[i].dpcm , runtime->private_data);
//printk("giova, %s:%d, giovaindex=%d\n", __FILE__, __LINE__, giovaindex);
dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL);
//printk("giova, %s:%d, giovaindex=%d\n", __FILE__, __LINE__, giovaindex);
if (!dpcm) {
//spin_unlock_bh(&giovalock);
printk("giova, %s:%d, giovaindex=%d NO MEMORY!!!!\n", __FILE__, __LINE__, giovaindex);
return dpcm;
}
//printk("giova, %s:%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, giovaindex, dpcm);
init_timer(&dpcm->timer);
//dpcm->timer.data = (unsigned long) dpcm;
//dpcm->timer.function = snd_card_dummy_pcm_timer_function;
spin_lock_init(&dpcm->lock);
dpcm->substream = substream;
spin_lock_bh(&giovalock);
//printk("giova 1 giovaindex=%d dpcm=%p substream=%p sizeof=%lu\n", giovaindex, dpcm, substream, sizeof(*dpcm));
for (i = 0; i < giovaindex; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
//if((giovadpcms[i].substream == substream) && (giovadpcms[i].dpcm == dpcm))
if ((giovadpcms[i].substream == substream)) {
found = 1;
break;
}
}
if (!found) {
giovadpcms[giovaindex].substream = substream;
giovaindex++;
//printk("giova 2 giovaindex=%d dpcm=%p substream=%p\n", giovaindex, dpcm, substream);
}
found = 0;
for (i = 0; i < giovaindex; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
}
if (giovadpcms[i].substream == substream) {
giovadpcms[i].dpcm = dpcm;
giovadpcms[i].started = 0;
found = 1;
//printk("giova 3 giovaindex=%d dpcm=%p substream=%p\n", giovaindex, dpcm, substream);
break;
}
}
spin_unlock_bh(&giovalock);
if (!found) {
printk("skypiax giovaindex=%d NOT found????\n", giovaindex);
}
//printk("giova, %s:%d, giovaindex=%d\n", __FILE__, __LINE__, giovaindex);
return dpcm;
}
static int snd_card_dummy_playback_open(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm;
int err;
if ((dpcm = new_pcm_stream(substream)) == NULL)
return -ENOMEM;
//printk("giova, %s:%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, giovaindex, dpcm);
runtime->private_data = dpcm;
/* makes the infrastructure responsible for freeing dpcm */
runtime->private_free = snd_card_dummy_runtime_free;
runtime->hw = snd_card_dummy_playback;
if (substream->pcm->device & 1) {
runtime->hw.info &= ~SNDRV_PCM_INFO_INTERLEAVED;
runtime->hw.info |= SNDRV_PCM_INFO_NONINTERLEAVED;
}
if (substream->pcm->device & 2)
runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID);
err = add_playback_constraints(runtime);
if (err < 0)
return err;
return 0;
}
static int snd_card_dummy_capture_open(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_dummy_pcm *dpcm;
int err;
if ((dpcm = new_pcm_stream(substream)) == NULL)
return -ENOMEM;
//printk("giova, %s:%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, giovaindex, dpcm);
runtime->private_data = dpcm;
/* makes the infrastructure responsible for freeing dpcm */
runtime->private_free = snd_card_dummy_runtime_free;
runtime->hw = snd_card_dummy_capture;
if (substream->pcm->device == 1) {
runtime->hw.info &= ~SNDRV_PCM_INFO_INTERLEAVED;
runtime->hw.info |= SNDRV_PCM_INFO_NONINTERLEAVED;
}
if (substream->pcm->device & 2)
runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID);
err = add_capture_constraints(runtime);
if (err < 0)
return err;
return 0;
}
static int snd_card_dummy_playback_close(struct snd_pcm_substream *substream)
{
//printk("play giova 1 giovaindex=%d dpcm=%p substream=%p\n", giovaindex, substream->private_data, substream);
snd_card_dummy_pcm_timer_stop(substream->private_data);
return 0;
}
static int snd_card_dummy_capture_close(struct snd_pcm_substream *substream)
{
//printk("capt giova 2 giovaindex=%d dpcm=%p substream=%p\n", giovaindex, substream->private_data, substream);
snd_card_dummy_pcm_timer_stop(substream->private_data);
return 0;
}
static struct snd_pcm_ops snd_card_dummy_playback_ops = {
.open = snd_card_dummy_playback_open,
.close = snd_card_dummy_playback_close,
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_card_dummy_hw_params,
.hw_free = snd_card_dummy_hw_free,
.prepare = snd_card_dummy_pcm_prepare,
.trigger = snd_card_dummy_pcm_trigger,
.pointer = snd_card_dummy_pcm_pointer,
};
static struct snd_pcm_ops snd_card_dummy_capture_ops = {
.open = snd_card_dummy_capture_open,
.close = snd_card_dummy_capture_close,
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_card_dummy_hw_params,
.hw_free = snd_card_dummy_hw_free,
.prepare = snd_card_dummy_pcm_prepare,
.trigger = snd_card_dummy_pcm_trigger,
.pointer = snd_card_dummy_pcm_pointer,
};
static int __devinit snd_card_dummy_pcm(struct snd_dummy *dummy, int device, int substreams)
{
struct snd_pcm *pcm;
int err;
err = snd_pcm_new(dummy->card, "Dummy PCM", device, substreams, substreams, &pcm);
if (err < 0)
return err;
dummy->pcm = pcm;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_card_dummy_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_card_dummy_capture_ops);
pcm->private_data = dummy;
pcm->info_flags = 0;
strcpy(pcm->name, "Dummy PCM");
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS, snd_dma_continuous_data(GFP_KERNEL), 128 * 1024, 1024 * 1024);
return 0;
}
#define DUMMY_VOLUME(xname, xindex, addr) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
.name = xname, .index = xindex, \
.info = snd_dummy_volume_info, \
.get = snd_dummy_volume_get, .put = snd_dummy_volume_put, \
.private_value = addr, \
.tlv = { .p = db_scale_dummy } }
static int snd_dummy_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integer.min = -50;
uinfo->value.integer.max = 100;
return 0;
}
static int snd_dummy_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int addr = kcontrol->private_value;
//unsigned long flags;
if (in_irq())
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
//printk("giova: volume get %d %d\n", __LINE__, addr);
//spin_lock_irq(&dummy->mixer_lock);
//spin_lock_irqsave(&dummy->mixer_lock, flags);
spin_lock_bh(&dummy->mixer_lock);
ucontrol->value.integer.value[0] = dummy->mixer_volume[addr][0];
ucontrol->value.integer.value[1] = dummy->mixer_volume[addr][1];
//spin_unlock_irqrestore(&dummy->mixer_lock, flags);
spin_unlock_bh(&dummy->mixer_lock);
return 0;
}
static int snd_dummy_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int change, addr = kcontrol->private_value;
int left, right;
//unsigned long flags;
if (in_irq())
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
left = ucontrol->value.integer.value[0];
if (left < -50)
left = -50;
if (left > 100)
left = 100;
right = ucontrol->value.integer.value[1];
if (right < -50)
right = -50;
if (right > 100)
right = 100;
//printk("giova: volume put %d %d\n", __LINE__, addr);
//spin_lock_irq(&dummy->mixer_lock);
//spin_lock_irqsave(&dummy->mixer_lock, flags);
spin_lock_bh(&dummy->mixer_lock);
change = dummy->mixer_volume[addr][0] != left || dummy->mixer_volume[addr][1] != right;
dummy->mixer_volume[addr][0] = left;
dummy->mixer_volume[addr][1] = right;
//spin_unlock_irq(&dummy->mixer_lock);
//spin_unlock_irqrestore(&dummy->mixer_lock, flags);
spin_unlock_bh(&dummy->mixer_lock);
return change;
}
static const DECLARE_TLV_DB_SCALE(db_scale_dummy, -4500, 30, 0);
#define DUMMY_CAPSRC(xname, xindex, addr) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
.info = snd_dummy_capsrc_info, \
.get = snd_dummy_capsrc_get, .put = snd_dummy_capsrc_put, \
.private_value = addr }
#define snd_dummy_capsrc_info snd_ctl_boolean_stereo_info
static int snd_dummy_capsrc_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int addr = kcontrol->private_value;
//unsigned long flags;
if (in_irq())
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
//spin_lock_irq(&dummy->mixer_lock);
//spin_lock_irqsave(&dummy->mixer_lock, flags);
spin_lock_bh(&dummy->mixer_lock);
ucontrol->value.integer.value[0] = dummy->capture_source[addr][0];
ucontrol->value.integer.value[1] = dummy->capture_source[addr][1];
//spin_unlock_irq(&dummy->mixer_lock);
//spin_unlock_irqrestore(&dummy->mixer_lock, flags);
spin_unlock_bh(&dummy->mixer_lock);
//printk("giova: capsrc_get %d %d\n", __LINE__, addr);
return 0;
}
static int snd_dummy_capsrc_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
int change, addr = kcontrol->private_value;
int left, right;
//unsigned long flags;
if (in_irq())
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
left = ucontrol->value.integer.value[0] & 1;
right = ucontrol->value.integer.value[1] & 1;
//spin_lock_irq(&dummy->mixer_lock);
//spin_lock_irqsave(&dummy->mixer_lock, flags);
spin_lock_bh(&dummy->mixer_lock);
change = dummy->capture_source[addr][0] != left && dummy->capture_source[addr][1] != right;
dummy->capture_source[addr][0] = left;
dummy->capture_source[addr][1] = right;
//spin_unlock_irq(&dummy->mixer_lock);
//spin_unlock_irqrestore(&dummy->mixer_lock, flags);
spin_unlock_bh(&dummy->mixer_lock);
//printk("giova: capsrc_put %d %d\n", __LINE__, addr);
return change;
}
static struct snd_kcontrol_new snd_dummy_controls[] = {
DUMMY_VOLUME("Master Volume", 0, MIXER_ADDR_MASTER),
DUMMY_CAPSRC("Master Capture Switch", 0, MIXER_ADDR_MASTER),
DUMMY_VOLUME("Synth Volume", 0, MIXER_ADDR_SYNTH),
DUMMY_CAPSRC("Synth Capture Switch", 0, MIXER_ADDR_SYNTH),
DUMMY_VOLUME("Line Volume", 0, MIXER_ADDR_LINE),
DUMMY_CAPSRC("Line Capture Switch", 0, MIXER_ADDR_LINE),
DUMMY_VOLUME("Mic Volume", 0, MIXER_ADDR_MIC),
DUMMY_CAPSRC("Mic Capture Switch", 0, MIXER_ADDR_MIC),
DUMMY_VOLUME("CD Volume", 0, MIXER_ADDR_CD),
DUMMY_CAPSRC("CD Capture Switch", 0, MIXER_ADDR_CD)
};
static int __devinit snd_card_dummy_new_mixer(struct snd_dummy *dummy)
{
struct snd_card *card = dummy->card;
unsigned int idx;
int err;
//giova if (snd_BUG_ON(!dummy))
//giova return -EINVAL;
spin_lock_init(&dummy->mixer_lock);
strcpy(card->mixername, "Dummy Mixer");
//printk("giova: new_mixer %d\n", __LINE__);
return 0; //giova no mixer
for (idx = 0; idx < ARRAY_SIZE(snd_dummy_controls); idx++) {
err = snd_ctl_add(card, snd_ctl_new1(&snd_dummy_controls[idx], dummy));
if (err < 0)
return err;
}
return 0;
}
static int __devinit snd_dummy_probe(struct platform_device *devptr)
{
struct snd_card *card;
struct snd_dummy *dummy;
int idx, err;
int dev = devptr->id;
card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct snd_dummy));
if (card == NULL)
return -ENOMEM;
//giova err = snd_card_create(index[dev], id[dev], THIS_MODULE,
//giova sizeof(struct snd_dummy), &card);
//giova if (err < 0)
//giova return err;
dummy = card->private_data;
dummy->card = card;
for (idx = 0; idx < MAX_PCM_DEVICES && idx < pcm_devs[dev]; idx++) {
if (pcm_substreams[dev] < 1)
pcm_substreams[dev] = 1;
if (pcm_substreams[dev] > MAX_PCM_SUBSTREAMS)
pcm_substreams[dev] = MAX_PCM_SUBSTREAMS;
err = snd_card_dummy_pcm(dummy, idx, pcm_substreams[dev]);
if (err < 0)
goto __nodev;
}
err = snd_card_dummy_new_mixer(dummy);
if (err < 0)
goto __nodev;
strcpy(card->driver, "Dummy");
strcpy(card->shortname, "Dummy");
sprintf(card->longname, "Dummy %i", dev + 1);
snd_card_set_dev(card, &devptr->dev);
err = snd_card_register(card);
if (err == 0) {
platform_set_drvdata(devptr, card);
return 0;
}
__nodev:
snd_card_free(card);
return err;
}
static int __devexit snd_dummy_remove(struct platform_device *devptr)
{
del_timer(&giovatimer);
snd_card_free(platform_get_drvdata(devptr));
platform_set_drvdata(devptr, NULL);
return 0;
}
#ifdef CONFIG_PM
static int snd_dummy_suspend(struct platform_device *pdev, pm_message_t state)
{
struct snd_card *card = platform_get_drvdata(pdev);
struct snd_dummy *dummy = card->private_data;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(dummy->pcm);
return 0;
}
static int snd_dummy_resume(struct platform_device *pdev)
{
struct snd_card *card = platform_get_drvdata(pdev);
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
#endif
#define SND_DUMMY_DRIVER "snd_dummy"
static struct platform_driver snd_dummy_driver = {
.probe = snd_dummy_probe,
.remove = __devexit_p(snd_dummy_remove),
#ifdef CONFIG_PM
.suspend = snd_dummy_suspend,
.resume = snd_dummy_resume,
#endif
.driver = {
.name = SND_DUMMY_DRIVER},
};
static void snd_dummy_unregister_all(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(devices); ++i)
platform_device_unregister(devices[i]);
platform_driver_unregister(&snd_dummy_driver);
}
static int __init alsa_card_dummy_init(void)
{
int i, cards, err;
err = platform_driver_register(&snd_dummy_driver);
if (err < 0)
return err;
if (!giovastarted) {
giovastarted = 1;
spin_lock_init(&giovalock);
spin_lock_bh(&giovalock);
for (i = 0; i < MAX_PCM_SUBSTREAMS; i++) {
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
printk("giova, %s:%d, i=%d, giovaindex=%d \n", __FILE__, __LINE__, i, giovaindex);
}
giovadpcms[i].substream = NULL;
giovadpcms[i].dpcm = NULL;
giovadpcms[i].started = 0;
}
init_timer(&giovatimer);
//giovatimer.data = (unsigned long) dpcm;
giovatimer.data = (unsigned long) &giovadpcms;
giovatimer.function = snd_card_dummy_pcm_timer_function;
giovatimer.expires = ((HZ / 1000) *GIOVAMULTI)+ jiffies;
add_timer(&giovatimer);
printk("003 snd-dummy skypiax driver, %s:%d working on a machine with %dHZ kernel\n", __FILE__, __LINE__, HZ);
spin_unlock_bh(&giovalock);
}
cards = 0;
for (i = 0; i < SNDRV_CARDS; i++) {
struct platform_device *device;
if (!enable[i])
continue;
device = platform_device_register_simple(SND_DUMMY_DRIVER, i, NULL, 0);
if (IS_ERR(device))
continue;
if (!platform_get_drvdata(device)) {
platform_device_unregister(device);
continue;
}
devices[i] = device;
cards++;
}
if (!cards) {
#ifdef MODULE
printk(KERN_ERR "Dummy soundcard not found or device busy\n");
#endif
snd_dummy_unregister_all();
return -ENODEV;
}
return 0;
}
static void __exit alsa_card_dummy_exit(void)
{
del_timer(&giovatimer);
snd_dummy_unregister_all();
}
module_init(alsa_card_dummy_init)
module_exit(alsa_card_dummy_exit)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,164 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="mod_skypiax"
ProjectGUID="{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}"
RootNamespace="mod_skypiax"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
ConfigurationType="2"
InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
WarningLevel="4"
WarnAsError="false"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="rpcrt4.lib "
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
ConfigurationType="2"
InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="rpcrt4.lib "
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="..\mod_skypiax\mod_skypiax.c"
>
</File>
<File
RelativePath=".\skypiax.h"
>
</File>
<File
RelativePath=".\skypiax_protocol.c"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
gcc -shared .libs/mod_skypiax_la-mod_skypiax.o .libs/mod_skypiax_la-skypiax_protocol.o -Wl,--rpath -Wl,/usr/src/freeswitch/.libs -Wl,--rpath -Wl,/usr/local/freeswitch/lib -lm -lX11 /usr/src/freeswitch/.libs/libfreeswitch.so -L/usr/src/freeswitch/libs/apr-util/xml/expat/lib -L/usr/src/freeswitch/libs/apr-util/xml/expat/lib/.libs -L/usr/src/freeswitch/libs/apr/.libs -L/usr/src/freeswitch/libs/srtp -lncurses -Wl,-soname -Wl,mod_skypiax.so -o .libs/mod_skypiax.so
ar cru .libs/mod_skypiax.a mod_skypiax_la-mod_skypiax.o mod_skypiax_la-skypiax_protocol.o
ranlib .libs/mod_skypiax.a
creating mod_skypiax.la
(cd .libs && rm -f mod_skypiax.la && ln -s ../mod_skypiax.la mod_skypiax.la)

View File

@ -0,0 +1,332 @@
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005/2006, Anthony Minessale II <anthmct@yahoo.com>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthmct@yahoo.com>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* This module (mod_skypiax) has been contributed by:
*
* Giovanni Maruzzelli (gmaruzz@gmail.com)
*
*
* Further Contributors:
*
*
*
* mod_skypiax.c -- Skype compatible Endpoint Module
*
*/
#include <switch.h>
#include <switch_version.h>
#ifndef WIN32
#include <sys/time.h>
#include <X11/Xlib.h>
#include <X11/Xlibint.h>
#include <X11/Xatom.h>
#endif //WIN32
#ifdef _MSC_VER
//Windows macro for FD_SET includes a warning C4127: conditional expression is constant
#pragma warning(push)
#pragma warning(disable:4127)
#endif
#define MY_EVENT_INCOMING_CHATMESSAGE "skypiax::incoming_chatmessage"
#define SAMPLERATE_SKYPIAX 16000
#define SAMPLES_PER_FRAME SAMPLERATE_SKYPIAX/50
#ifndef SKYPIAX_SVN_VERSION
#define SKYPIAX_SVN_VERSION SWITCH_VERSION_REVISION
#endif /* SKYPIAX_SVN_VERSION */
typedef enum {
TFLAG_IO = (1 << 0),
TFLAG_INBOUND = (1 << 1),
TFLAG_OUTBOUND = (1 << 2),
TFLAG_DTMF = (1 << 3),
TFLAG_VOICE = (1 << 4),
TFLAG_HANGUP = (1 << 5),
TFLAG_LINEAR = (1 << 6),
TFLAG_CODEC = (1 << 7),
TFLAG_BREAK = (1 << 8)
} TFLAGS;
typedef enum {
GFLAG_MY_CODEC_PREFS = (1 << 0)
} GFLAGS;
#define DEBUGA_SKYPE(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_SKYPE %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define DEBUGA_CALL(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_CALL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define DEBUGA_PBX(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_PBX %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define ERRORA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][ERRORA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][WARNINGA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][NOTICA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
#define SKYPIAX_P_LOG NULL, (unsigned long)55, __LINE__, tech_pvt ? tech_pvt->name ? tech_pvt->name : "none" : "none", -1, tech_pvt ? tech_pvt->interface_state : -1, tech_pvt ? tech_pvt->skype_callflow : -1
/*********************************/
#define SKYPIAX_CAUSE_NORMAL 1
/*********************************/
#define SKYPIAX_FRAME_DTMF 1
/*********************************/
#define SKYPIAX_CONTROL_RINGING 1
#define SKYPIAX_CONTROL_ANSWER 2
/*********************************/
#define SKYPIAX_STATE_IDLE 0
#define SKYPIAX_STATE_DOWN 1
#define SKYPIAX_STATE_RING 2
#define SKYPIAX_STATE_DIALING 3
#define SKYPIAX_STATE_BUSY 4
#define SKYPIAX_STATE_UP 5
#define SKYPIAX_STATE_RINGING 6
#define SKYPIAX_STATE_PRERING 7
#define SKYPIAX_STATE_ERROR_DOUBLE_CALL 8
#define SKYPIAX_STATE_SELECTED 9
#define SKYPIAX_STATE_HANGUP_REQUESTED 10
#define SKYPIAX_STATE_PREANSWER 11
/*********************************/
/* call flow from the device */
#define CALLFLOW_CALL_IDLE 0
#define CALLFLOW_CALL_DOWN 1
#define CALLFLOW_INCOMING_RING 2
#define CALLFLOW_CALL_DIALING 3
#define CALLFLOW_CALL_LINEBUSY 4
#define CALLFLOW_CALL_ACTIVE 5
#define CALLFLOW_INCOMING_HANGUP 6
#define CALLFLOW_CALL_RELEASED 7
#define CALLFLOW_CALL_NOCARRIER 8
#define CALLFLOW_CALL_INFLUX 9
#define CALLFLOW_CALL_INCOMING 10
#define CALLFLOW_CALL_FAILED 11
#define CALLFLOW_CALL_NOSERVICE 12
#define CALLFLOW_CALL_OUTGOINGRESTRICTED 13
#define CALLFLOW_CALL_SECURITYFAIL 14
#define CALLFLOW_CALL_NOANSWER 15
#define CALLFLOW_STATUS_FINISHED 16
#define CALLFLOW_STATUS_CANCELLED 17
#define CALLFLOW_STATUS_FAILED 18
#define CALLFLOW_STATUS_REFUSED 19
#define CALLFLOW_STATUS_RINGING 20
#define CALLFLOW_STATUS_INPROGRESS 21
#define CALLFLOW_STATUS_UNPLACED 22
#define CALLFLOW_STATUS_ROUTING 23
#define CALLFLOW_STATUS_EARLYMEDIA 24
#define CALLFLOW_INCOMING_CALLID 25
#define CALLFLOW_STATUS_REMOTEHOLD 26
/*********************************/
#define SKYPIAX_MAX_INTERFACES 64
#ifndef WIN32
struct SkypiaxHandles {
Window skype_win;
Display *disp;
Window win;
int currentuserhandle;
int api_connected;
int fdesc[2];
};
#else //WIN32
struct SkypiaxHandles {
HWND win32_hInit_MainWindowHandle;
HWND win32_hGlobal_SkypeAPIWindowHandle;
HINSTANCE win32_hInit_ProcessHandle;
char win32_acInit_WindowClassName[128];
UINT win32_uiGlobal_MsgID_SkypeControlAPIAttach;
UINT win32_uiGlobal_MsgID_SkypeControlAPIDiscover;
int currentuserhandle;
int api_connected;
switch_file_t *fdesc[2];
};
#endif //WIN32
#define MAX_CHATS 10
struct chat {
char chatname[256];
char dialog_partner[256];
};
typedef struct chat chat_t;
#define MAX_CHATMESSAGES 10
struct chatmessage {
char id[256];
char type[256];
char chatname[256];
char from_handle[256];
char from_dispname[256];
char body[512];
};
typedef struct chatmessage chatmessage_t;
struct private_object {
unsigned int flags;
switch_codec_t read_codec;
switch_codec_t write_codec;
switch_frame_t read_frame;
unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE];
char session_uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
switch_caller_profile_t *caller_profile;
switch_mutex_t *mutex;
switch_mutex_t *flag_mutex;
switch_mutex_t *flag_audio_cli_mutex;
switch_mutex_t *flag_audio_srv_mutex;
char interface_id[80];
char name[80];
char dialplan[80];
char context[80];
char dial_regex[256];
char fail_dial_regex[256];
char hold_music[256];
char type[256];
char X11_display[256];
#ifdef WIN32
unsigned short tcp_cli_port;
unsigned short tcp_srv_port;
#else
int tcp_cli_port;
int tcp_srv_port;
#endif
struct SkypiaxHandles SkypiaxHandles;
int interface_state; /*!< \brief 'state' of the interface (channel) */
char language[80]; /*!< \brief default Asterisk dialplan language for this interface */
char exten[80]; /*!< \brief default Asterisk dialplan extension for this interface */
int skypiax_sound_rate; /*!< \brief rate of the sound device, in Hz, eg: 8000 */
char callid_name[50];
char callid_number[50];
double playback_boost;
double capture_boost;
int stripmsd;
char skype_call_id[512];
int skype_call_ongoing;
char skype_friends[4096];
char skype_fullname[512];
char skype_displayname[512];
int skype_callflow; /*!< \brief 'callflow' of the skype interface (as opposed to phone interface) */
int skype; /*!< \brief config flag, bool, Skype support on this interface (0 if false, -1 if true) */
int control_to_send;
#ifdef WIN32
switch_file_t *audiopipe_srv[2];
switch_file_t *audiopipe_cli[2];
switch_file_t *skypiax_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */
#else /* WIN32 */
int audiopipe_srv[2];
int audiopipe_cli[2];
int skypiax_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */
#endif /* WIN32 */
switch_thread_t *tcp_srv_thread;
switch_thread_t *tcp_cli_thread;
switch_thread_t *skypiax_signaling_thread;
switch_thread_t *skypiax_api_thread;
short audiobuf[SAMPLES_PER_FRAME];
int audiobuf_is_loaded;
short audiobuf_cli[SAMPLES_PER_FRAME];
switch_mutex_t *mutex_audio_cli;
int flag_audio_cli;
short audiobuf_srv[SAMPLES_PER_FRAME];
switch_mutex_t *mutex_audio_srv;
int flag_audio_srv;
//int phonebook_listing;
//int phonebook_querying;
//int phonebook_listing_received_calls;
//int phonebook_first_entry;
//int phonebook_last_entry;
//int phonebook_number_lenght;
//int phonebook_text_lenght;
FILE *phonebook_writing_fp;
int skypiax_dir_entry_extension_prefix;
char skype_user[256];
char skype_password[256];
char destination[256];
struct timeval answer_time;
struct timeval transfer_time;
char transfer_callid_number[50];
char skype_transfer_call_id[512];
int running;
uint32_t ib_calls;
uint32_t ob_calls;
uint32_t ib_failed_calls;
uint32_t ob_failed_calls;
chatmessage_t chatmessages[MAX_CHATMESSAGES];
chat_t chats[MAX_CHATS];
uint32_t report_incoming_chatmessages;
switch_timer_t timer_read;
switch_timer_t timer_write;
unsigned int writefd;
unsigned int readfd;
};
typedef struct private_object private_t;
void *SWITCH_THREAD_FUNC skypiax_api_thread_func(switch_thread_t * thread, void *obj);
int skypiax_audio_read(private_t * tech_pvt);
int skypiax_audio_init(private_t * tech_pvt);
int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype);
int skypiax_signaling_read(private_t * tech_pvt);
int skypiax_call(private_t * tech_pvt, char *idest, int timeout);
int skypiax_senddigit(private_t * tech_pvt, char digit);
void *skypiax_do_tcp_srv_thread_func(void *obj);
void *SWITCH_THREAD_FUNC skypiax_do_tcp_srv_thread(switch_thread_t * thread, void *obj);
void *skypiax_do_tcp_cli_thread_func(void *obj);
void *SWITCH_THREAD_FUNC skypiax_do_tcp_cli_thread(switch_thread_t * thread, void *obj);
void *skypiax_do_skypeapi_thread_func(void *obj);
void *SWITCH_THREAD_FUNC skypiax_do_skypeapi_thread(switch_thread_t * thread, void *obj);
int dtmf_received(private_t * tech_pvt, char *value);
int start_audio_threads(private_t * tech_pvt);
int new_inbound_channel(private_t * tech_pvt);
int outbound_channel_answered(private_t * tech_pvt);
int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype);
#if defined(WIN32) && !defined(__CYGWIN__)
int skypiax_pipe_read(switch_file_t * pipe, short *buf, int howmany);
int skypiax_pipe_write(switch_file_t * pipe, short *buf, int howmany);
/* Visual C do not have strsep ? */
char *strsep(char **stringp, const char *delim);
#else
int skypiax_pipe_read(int pipe, short *buf, int howmany);
int skypiax_pipe_write(int pipe, short *buf, int howmany);
#endif /* WIN32 */
int skypiax_close_socket(unsigned int fd);
private_t *find_available_skypiax_interface_rr(private_t * tech_pvt_calling);
int remote_party_is_ringing(private_t * tech_pvt);
int remote_party_is_early_media(private_t * tech_pvt);
int skypiax_answer(private_t * tech_pvt, char *id, char *value);
int skypiax_transfer(private_t * tech_pvt, char *id, char *value);
#ifndef WIN32
int skypiax_socket_create_and_bind(private_t * tech_pvt, int *which_port);
#else
int skypiax_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_port);
#endif //WIN32
int incoming_chatmessage(private_t * tech_pvt, int which);

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,12 @@
#include "skypiax.h" #include "skypiax.h"
#define MDL_CHAT_PROTO "skype" #define MDL_CHAT_PROTO "skype"
#undef TIMERS_ON
#ifdef TIMERS_ON
#define TIMER_WRITE #define TIMER_WRITE
#else
#undef TIMER_WRITE
#endif
#ifdef WIN32 #ifdef WIN32
/***************/ /***************/
@ -258,6 +263,7 @@ switch_status_t skypiax_tech_init(private_t * tech_pvt, switch_core_session_t *s
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
#ifdef TIMERS_ON
if (switch_core_timer_init(&tech_pvt->timer_read, "soft", 20, tech_pvt->read_codec.implementation->samples_per_packet, skypiax_module_pool) != if (switch_core_timer_init(&tech_pvt->timer_read, "soft", 20, tech_pvt->read_codec.implementation->samples_per_packet, skypiax_module_pool) !=
SWITCH_STATUS_SUCCESS) { SWITCH_STATUS_SUCCESS) {
ERRORA("setup timer failed\n", SKYPIAX_P_LOG); ERRORA("setup timer failed\n", SKYPIAX_P_LOG);
@ -265,6 +271,7 @@ switch_status_t skypiax_tech_init(private_t * tech_pvt, switch_core_session_t *s
} }
switch_core_timer_sync(&tech_pvt->timer_read); switch_core_timer_sync(&tech_pvt->timer_read);
#endif// TIMERS_ON
#ifdef TIMER_WRITE #ifdef TIMER_WRITE
if (switch_core_timer_init(&tech_pvt->timer_write, "soft", 20, tech_pvt->write_codec.implementation->samples_per_packet, skypiax_module_pool) != if (switch_core_timer_init(&tech_pvt->timer_write, "soft", 20, tech_pvt->write_codec.implementation->samples_per_packet, skypiax_module_pool) !=
@ -482,7 +489,9 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
switch_core_codec_destroy(&tech_pvt->write_codec); switch_core_codec_destroy(&tech_pvt->write_codec);
} }
#ifdef TIMERS_ON
switch_core_timer_destroy(&tech_pvt->timer_read); switch_core_timer_destroy(&tech_pvt->timer_read);
#endif// TIMERS_ON
#ifdef TIMER_WRITE #ifdef TIMER_WRITE
switch_core_timer_destroy(&tech_pvt->timer_write); switch_core_timer_destroy(&tech_pvt->timer_write);
@ -675,6 +684,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL; private_t *tech_pvt = NULL;
switch_byte_t *data; switch_byte_t *data;
//unsigned int len;
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
switch_assert(channel != NULL); switch_assert(channel != NULL);
@ -693,7 +703,14 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
//switch_core_timer_next(&tech_pvt->timer_read); //switch_core_timer_next(&tech_pvt->timer_read);
if (!skypiax_audio_read(tech_pvt)) { if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
tech_pvt->read_frame.datalen = recv(tech_pvt->readfd, (char *) tech_pvt->read_frame.data, 320, 0); //seems that Skype only sends 320 bytes at time
} else {
tech_pvt->read_frame.datalen = 0;
}
//if (!skypiax_audio_read(tech_pvt)) {
if (!tech_pvt->read_frame.datalen) {
ERRORA("skypiax_audio_read ERROR\n", SKYPIAX_P_LOG); ERRORA("skypiax_audio_read ERROR\n", SKYPIAX_P_LOG);
@ -719,7 +736,9 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
DEBUGA_SKYPE("CHANNEL READ CONTINUE\n", SKYPIAX_P_LOG); DEBUGA_SKYPE("CHANNEL READ CONTINUE\n", SKYPIAX_P_LOG);
continue; continue;
} }
#ifdef TIMERS_ON
switch_core_timer_check(&tech_pvt->timer_read, SWITCH_TRUE); switch_core_timer_check(&tech_pvt->timer_read, SWITCH_TRUE);
#endif// TIMERS_ON
*frame = &tech_pvt->read_frame; *frame = &tech_pvt->read_frame;
#if SWITCH_BYTE_ORDER == __BIG_ENDIAN #if SWITCH_BYTE_ORDER == __BIG_ENDIAN
if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) {
@ -752,7 +771,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
{ {
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL; private_t *tech_pvt = NULL;
unsigned int sent; unsigned int sent=0;
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
switch_assert(channel != NULL); switch_assert(channel != NULL);
@ -771,26 +790,50 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
} }
#endif #endif
#if 0
sent = frame->datalen; sent = frame->datalen;
#ifdef WIN32 #ifdef WIN32
//switch_file_write(tech_pvt->audiopipe_cli[1], frame->data, &sent); //switch_file_write(tech_pvt->audiopipe_cli[1], frame->data, &sent);
#else /* WIN32 */ #else /* WIN32 */
//sent = write(tech_pvt->audiopipe_cli[1], frame->data, sent); //sent = write(tech_pvt->audiopipe_cli[1], frame->data, sent);
#endif /* WIN32 */ #endif /* WIN32 */
if (tech_pvt->flag_audio_cli == 1) { //if (tech_pvt->flag_audio_cli == 0) {
switch_sleep(1000); //1 millisec
}
if (tech_pvt->flag_audio_cli == 0) {
#ifdef TIMER_WRITE #ifdef TIMER_WRITE
switch_core_timer_next(&tech_pvt->timer_write); switch_core_timer_next(&tech_pvt->timer_write);
#endif // TIMER_WRITE #endif // TIMER_WRITE
//while (tech_pvt->flag_audio_cli == 1) {
//switch_sleep(1000); //10 millisec
//WARNINGA("write now is 1\n", SKYPIAX_P_LOG);
//}
switch_mutex_lock(tech_pvt->flag_audio_cli_mutex);
memcpy(tech_pvt->audiobuf_cli, frame->data, frame->datalen); memcpy(tech_pvt->audiobuf_cli, frame->data, frame->datalen);
tech_pvt->flag_audio_cli = 1; tech_pvt->flag_audio_cli = 1;
} switch_mutex_unlock(tech_pvt->flag_audio_cli_mutex);
//}
//NOTICA("write \n", SKYPIAX_P_LOG); //NOTICA("write \n", SKYPIAX_P_LOG);
#endif //0
#ifdef TIMER_WRITE
/* NONBLOCKING ? */
//switch_core_timer_next(&tech_pvt->timer_write);
//switch_core_timer_check(&tech_pvt->timer_write, SWITCH_TRUE);
#endif // TIMER_WRITE
/* send the 16khz frame to the Skype client waiting for incoming audio to be sent to the remote party */
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
sent = send(tech_pvt->writefd, (char *) frame->data, frame->datalen, 0);
if (sent == -1) {
ERRORA("EXIT? sent=%d\n", SKYPIAX_P_LOG, sent);
} else if (sent != frame->datalen) {
ERRORA("sent=%d\n", SKYPIAX_P_LOG, sent);
}
}
#ifdef TIMER_WRITE
/* BLOCKING ? */
//switch_core_timer_check(&tech_pvt->timer_write, SWITCH_TRUE);
#endif // TIMER_WRITE
if (sent != frame->datalen && sent != -1) { if (sent != frame->datalen && sent != -1) {
DEBUGA_SKYPE("CLI PIPE write %d\n", SKYPIAX_P_LOG, sent); DEBUGA_SKYPE("CLI PIPE write %d\n", SKYPIAX_P_LOG, sent);
} }
@ -831,7 +874,9 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
{ {
DEBUGA_SKYPE("MSG_ID=%d, TO BE ANSWERED!\n", SKYPIAX_P_LOG, msg->message_id); DEBUGA_SKYPE("MSG_ID=%d, TO BE ANSWERED!\n", SKYPIAX_P_LOG, msg->message_id);
#ifdef TIMERS_ON
switch_core_timer_sync(&tech_pvt->timer_read); switch_core_timer_sync(&tech_pvt->timer_read);
#endif// TIMERS_ON
#ifdef TIMER_WRITE #ifdef TIMER_WRITE
switch_core_timer_sync(&tech_pvt->timer_write); switch_core_timer_sync(&tech_pvt->timer_write);
#endif // TIMER_WRITE #endif // TIMER_WRITE
@ -842,7 +887,9 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
DEBUGA_SKYPE("%s CHANNEL got SWITCH_MESSAGE_INDICATE_AUDIO_SYNC\n", SKYPIAX_P_LOG, switch_channel_get_name(channel)); DEBUGA_SKYPE("%s CHANNEL got SWITCH_MESSAGE_INDICATE_AUDIO_SYNC\n", SKYPIAX_P_LOG, switch_channel_get_name(channel));
#ifdef TIMERS_ON
switch_core_timer_sync(&tech_pvt->timer_read); switch_core_timer_sync(&tech_pvt->timer_read);
#endif// TIMERS_ON
#ifdef TIMER_WRITE #ifdef TIMER_WRITE
switch_core_timer_sync(&tech_pvt->timer_write); switch_core_timer_sync(&tech_pvt->timer_write);
#endif // TIMER_WRITE #endif // TIMER_WRITE
@ -850,7 +897,9 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
default: default:
{ {
#ifdef TIMERS_ON
switch_core_timer_sync(&tech_pvt->timer_read); switch_core_timer_sync(&tech_pvt->timer_read);
#endif// TIMERS_ON
#ifdef TIMER_WRITE #ifdef TIMER_WRITE
switch_core_timer_sync(&tech_pvt->timer_write); switch_core_timer_sync(&tech_pvt->timer_write);
@ -1395,6 +1444,8 @@ static switch_status_t load_config(int reload_type)
skypiax_audio_init(&globals.SKYPIAX_INTERFACES[interface_id]); skypiax_audio_init(&globals.SKYPIAX_INTERFACES[interface_id]);
switch_mutex_init(&globals.SKYPIAX_INTERFACES[interface_id].flag_audio_srv_mutex, SWITCH_MUTEX_NESTED, skypiax_module_pool);
switch_mutex_init(&globals.SKYPIAX_INTERFACES[interface_id].flag_audio_cli_mutex, SWITCH_MUTEX_NESTED, skypiax_module_pool);
NOTICA NOTICA
("WAITING roughly 10 seconds to find a running Skype client and connect to its SKYPE API for interface_id=%d\n", ("WAITING roughly 10 seconds to find a running Skype client and connect to its SKYPE API for interface_id=%d\n",
SKYPIAX_P_LOG, interface_id); SKYPIAX_P_LOG, interface_id);

View File

@ -192,6 +192,8 @@ struct private_object {
switch_caller_profile_t *caller_profile; switch_caller_profile_t *caller_profile;
switch_mutex_t *mutex; switch_mutex_t *mutex;
switch_mutex_t *flag_mutex; switch_mutex_t *flag_mutex;
switch_mutex_t *flag_audio_cli_mutex;
switch_mutex_t *flag_audio_srv_mutex;
char interface_id[80]; char interface_id[80];
char name[80]; char name[80];
@ -279,6 +281,8 @@ struct private_object {
uint32_t report_incoming_chatmessages; uint32_t report_incoming_chatmessages;
switch_timer_t timer_read; switch_timer_t timer_read;
switch_timer_t timer_write; switch_timer_t timer_write;
unsigned int writefd;
unsigned int readfd;
}; };
typedef struct private_object private_t; typedef struct private_object private_t;

View File

@ -55,8 +55,9 @@ int skypiax_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_p
start_port = *which_port; start_port = *which_port;
my_addr.sin_port = htons(start_port); my_addr.sin_port = htons(start_port);
/* NONBLOCKING ? */
//fcntl(s, F_SETFL, O_NONBLOCK); //fcntl(s, F_SETFL, O_NONBLOCK);
//tech_pvt->tcp_cli_port = start_port;
*which_port = start_port; *which_port = start_port;
while (bind(s, (struct sockaddr *) &my_addr, sizeof(struct sockaddr)) < 0) { while (bind(s, (struct sockaddr *) &my_addr, sizeof(struct sockaddr)) < 0) {
DEBUGA_SKYPE("*which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port, tech_pvt->tcp_cli_port, DEBUGA_SKYPE("*which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port, tech_pvt->tcp_cli_port,
@ -723,22 +724,22 @@ void *skypiax_do_tcp_srv_thread_func(void *obj)
private_t *tech_pvt = obj; private_t *tech_pvt = obj;
int s; int s;
unsigned int len; unsigned int len;
unsigned int i; //unsigned int i;
unsigned int a; //unsigned int a;
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(WIN32) && !defined(__CYGWIN__)
int sin_size; int sin_size;
#else /* WIN32 */ #else /* WIN32 */
unsigned int sin_size; unsigned int sin_size;
#endif /* WIN32 */ #endif /* WIN32 */
unsigned int fd; unsigned int fd;
short srv_in[SAMPLES_PER_FRAME]; //short srv_in[SAMPLES_PER_FRAME];
short srv_out[SAMPLES_PER_FRAME / 2]; //short srv_out[SAMPLES_PER_FRAME / 2];
//struct sockaddr_in my_addr; //struct sockaddr_in my_addr;
struct sockaddr_in remote_addr; struct sockaddr_in remote_addr;
//int exit = 0; //int exit = 0;
unsigned int kill_cli_size; unsigned int kill_cli_size;
short kill_cli_buff[SAMPLES_PER_FRAME]; short kill_cli_buff[SAMPLES_PER_FRAME];
short totalbuf[SAMPLES_PER_FRAME]; //short totalbuf[SAMPLES_PER_FRAME];
int sockbufsize = 0; int sockbufsize = 0;
unsigned int size = sizeof(int); unsigned int size = sizeof(int);
@ -798,6 +799,13 @@ void *skypiax_do_tcp_srv_thread_func(void *obj)
|| tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA || tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
|| tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) { || tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) {
tech_pvt->readfd = fd;
WARNINGA("read HERE\n", SKYPIAX_P_LOG);
skypiax_sleep(100000);
#ifdef NOLOOP
unsigned int fdselect; unsigned int fdselect;
int rt; int rt;
fd_set fs; fd_set fs;
@ -867,13 +875,16 @@ void *skypiax_do_tcp_srv_thread_func(void *obj)
howmany = SAMPLES_PER_FRAME * sizeof(short); howmany = SAMPLES_PER_FRAME * sizeof(short);
if (tech_pvt->flag_audio_srv == 1) { //while (tech_pvt->flag_audio_srv == 1) {
switch_sleep(1000); //1 millisec //switch_sleep(1000); //10 millisec
} //WARNINGA("read now is 1\n", SKYPIAX_P_LOG);
if (tech_pvt->flag_audio_srv == 0) { //}
//if (tech_pvt->flag_audio_srv == 0) {
switch_mutex_lock(tech_pvt->flag_audio_srv_mutex);
memcpy(tech_pvt->audiobuf_srv, totalbuf, SAMPLES_PER_FRAME * sizeof(short)); memcpy(tech_pvt->audiobuf_srv, totalbuf, SAMPLES_PER_FRAME * sizeof(short));
tech_pvt->flag_audio_srv = 1; tech_pvt->flag_audio_srv = 1;
} switch_mutex_unlock(tech_pvt->flag_audio_srv_mutex);
//}
//NOTICA("read \n", SKYPIAX_P_LOG); //NOTICA("read \n", SKYPIAX_P_LOG);
if (howmany != SAMPLES_PER_FRAME * sizeof(short)) { if (howmany != SAMPLES_PER_FRAME * sizeof(short)) {
ERRORA("howmany is %d, but was expected to be %d\n", SKYPIAX_P_LOG, ERRORA("howmany is %d, but was expected to be %d\n", SKYPIAX_P_LOG,
@ -895,6 +906,7 @@ void *skypiax_do_tcp_srv_thread_func(void *obj)
skypiax_sleep(10000); skypiax_sleep(10000);
} }
#endif// NOLOOP
} }
/* let's send some frame in the pipes, so both tcp_cli and tcp_srv will have an occasion to die */ /* let's send some frame in the pipes, so both tcp_cli and tcp_srv will have an occasion to die */
@ -919,6 +931,7 @@ void *skypiax_do_tcp_srv_thread_func(void *obj)
skypiax_sleep(2000); skypiax_sleep(2000);
DEBUGA_SKYPE("Skype incoming audio GONE\n", SKYPIAX_P_LOG); DEBUGA_SKYPE("Skype incoming audio GONE\n", SKYPIAX_P_LOG);
skypiax_close_socket(fd); skypiax_close_socket(fd);
break;
} }
} }
} }
@ -935,13 +948,15 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
int s; int s;
//struct sockaddr_in my_addr; //struct sockaddr_in my_addr;
struct sockaddr_in remote_addr; struct sockaddr_in remote_addr;
#ifdef NOVARS
unsigned int got; unsigned int got;
unsigned int len; unsigned int len;
unsigned int i; unsigned int i;
unsigned int a; unsigned int a;
unsigned int fd;
short cli_out[SAMPLES_PER_FRAME * 2]; short cli_out[SAMPLES_PER_FRAME * 2];
short cli_in[SAMPLES_PER_FRAME]; short cli_in[SAMPLES_PER_FRAME];
#endif// NOVARS
unsigned int fd;
#ifdef WIN32 #ifdef WIN32
int sin_size; int sin_size;
#else #else
@ -1010,10 +1025,19 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
if (!(running && tech_pvt->running)) if (!(running && tech_pvt->running))
break; break;
while (tech_pvt->interface_state != SKYPIAX_STATE_DOWN while (tech_pvt->interface_state != SKYPIAX_STATE_DOWN
&& (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS && (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS
|| tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA || tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
|| tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) { || tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) {
tech_pvt->writefd = fd;
NOTICA("write HERE\n", SKYPIAX_P_LOG);
skypiax_sleep(100000);
#if 0
#ifdef NOVARS
unsigned int fdselect; unsigned int fdselect;
int rt; int rt;
fd_set fs; fd_set fs;
@ -1040,32 +1064,46 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
fdselect = fd; fdselect = fd;
FD_SET(fdselect, &fs); FD_SET(fdselect, &fs);
//FIXME rt = select(fdselect + 1, NULL, &fs, NULL, &to); #endif// NOVARS
#if 0
rt = select(fdselect + 1, NULL, &fs, NULL, NULL);
while (tech_pvt->flag_audio_cli == 0) { while (tech_pvt->flag_audio_cli == 0) {
#ifdef WIN32 #ifdef WIN32
skypiax_sleep(100); //0.1 millisec skypiax_sleep(100); //0.1 millisec
#else #else
skypiax_sleep(1000); //1 millisec skypiax_sleep(1000); //10 millisec
#endif //WIN32 #endif //WIN32
//WARNINGA("write now is 0\n", SKYPIAX_P_LOG); NOTICA("write now is 0\n", SKYPIAX_P_LOG);
} }
//ERRORA("write is now 1\n", SKYPIAX_P_LOG); //ERRORA("write is now 1\n", SKYPIAX_P_LOG);
rt = 1; rt = 1;
#endif //0
//rt = select(fdselect + 1, NULL, &fs, NULL, NULL);
#ifdef NOLOOP
if (rt > 0) { if (rt > 0) {
int counter; int counter;
#if 0
while (tech_pvt->flag_audio_cli == 0) {
#ifdef WIN32
skypiax_sleep(100); //0.1 millisec
#else
skypiax_sleep(10000); //10 millisec
#endif //WIN32
WARNINGA("write now is 0\n", SKYPIAX_P_LOG);
}
#endif //0
/* until we drained the pipe to empty */ /* until we drained the pipe to empty */
//for (counter = 0; counter < 10; counter++) {
for (counter = 0; counter < 1; counter++) { for (counter = 0; counter < 1; counter++) {
/* read from the pipe the audio frame we are supposed to send out */ /* read from the pipe the audio frame we are supposed to send out */
//got = skypiax_pipe_read(tech_pvt->audiopipe_cli[0], cli_in, SAMPLES_PER_FRAME * sizeof(short)); //got = skypiax_pipe_read(tech_pvt->audiopipe_cli[0], cli_in, SAMPLES_PER_FRAME * sizeof(short));
got = SAMPLES_PER_FRAME * sizeof(short); got = SAMPLES_PER_FRAME * sizeof(short);
switch_mutex_lock(tech_pvt->flag_audio_cli_mutex);
memcpy(cli_in, tech_pvt->audiobuf_cli, SAMPLES_PER_FRAME * sizeof(short)); memcpy(cli_in, tech_pvt->audiobuf_cli, SAMPLES_PER_FRAME * sizeof(short));
tech_pvt->flag_audio_cli = 0;
@ -1101,6 +1139,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
/* send the 16khz frame to the Skype client waiting for incoming audio to be sent to the remote party */ /* send the 16khz frame to the Skype client waiting for incoming audio to be sent to the remote party */
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) { if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
len = send(fd, (char *) cli_out, got, 0); len = send(fd, (char *) cli_out, got, 0);
tech_pvt->flag_audio_cli = 0;
//skypiax_sleep(5000); //5 msec //skypiax_sleep(5000); //5 msec
if (len == -1) { if (len == -1) {
@ -1112,6 +1151,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
} }
} }
switch_mutex_unlock(tech_pvt->flag_audio_cli_mutex);
} else { } else {
WARNINGA("got is %d, but was expected to be %d\n", SKYPIAX_P_LOG, got, (int) (SAMPLES_PER_FRAME * sizeof(short))); WARNINGA("got is %d, but was expected to be %d\n", SKYPIAX_P_LOG, got, (int) (SAMPLES_PER_FRAME * sizeof(short)));
@ -1134,9 +1174,12 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
skypiax_sleep(1000); skypiax_sleep(1000);
} }
#endif// NOLOOP
#endif// 0
} }
DEBUGA_SKYPE("Skype outbound audio GONE\n", SKYPIAX_P_LOG); DEBUGA_SKYPE("Skype outbound audio GONE\n", SKYPIAX_P_LOG);
skypiax_close_socket(fd); skypiax_close_socket(fd);
break;
} }
} }
} }
@ -1151,20 +1194,24 @@ int skypiax_audio_read(private_t * tech_pvt)
{ {
unsigned int samples; unsigned int samples;
#if 0
while (tech_pvt->flag_audio_srv == 0) { while (tech_pvt->flag_audio_srv == 0) {
#ifdef WIN32 #ifdef WIN32
skypiax_sleep(100); //0.1 millisec skypiax_sleep(100); //0.1 millisec
#else #else
skypiax_sleep(1000); //1 millisec skypiax_sleep(1000); //10 millisec
#endif //WIN32 #endif //WIN32
//WARNINGA("read now is 0\n", SKYPIAX_P_LOG); WARNINGA("read now is 0\n", SKYPIAX_P_LOG);
} }
#endif //0
//ERRORA("read is now 1\n", SKYPIAX_P_LOG); //ERRORA("read is now 1\n", SKYPIAX_P_LOG);
//samples = skypiax_pipe_read(tech_pvt->audiopipe_srv[0], tech_pvt->read_frame.data, SAMPLES_PER_FRAME * sizeof(short)); //samples = skypiax_pipe_read(tech_pvt->audiopipe_srv[0], tech_pvt->read_frame.data, SAMPLES_PER_FRAME * sizeof(short));
samples = SAMPLES_PER_FRAME * sizeof(short); samples = SAMPLES_PER_FRAME * sizeof(short);
switch_mutex_lock(tech_pvt->flag_audio_srv_mutex);
memcpy(tech_pvt->read_frame.data, tech_pvt->audiobuf_srv, SAMPLES_PER_FRAME * sizeof(short)); memcpy(tech_pvt->read_frame.data, tech_pvt->audiobuf_srv, SAMPLES_PER_FRAME * sizeof(short));
tech_pvt->flag_audio_srv = 0; tech_pvt->flag_audio_srv = 0;
switch_mutex_unlock(tech_pvt->flag_audio_srv_mutex);
if (samples != SAMPLES_PER_FRAME * sizeof(short)) { if (samples != SAMPLES_PER_FRAME * sizeof(short)) {
if (samples) if (samples)