mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-17 16:54:13 +00:00
This updates mod_portaudio to use the new v19 api and also contains
major behavioural changes. This initial check-in should be tested to find
any obscure use cases that lead to crashes etc...
All of the old api interface commands are now depricated and any attempt to
use them should cause a polite warning asking you to try the new single "pa" command.
New Features:
*) Mulitiple calls with hold/call switching.
*) Inbound calls can play a ring file on specified device. (global and per call)
*) Optional hold music for backgrounded calls. (global and per call)
Example dialplan usage:
<extension name="2000">
<condition field="destination_number" expression="^2000$">
<!--if the next 3 lines are omitted the defaults will be used from portaudio.conf-->
<action application="set" data="pa_ring_file=/sounds/myring.wav"/>
<action application="set" data="pa_hold_file=/sounds/myhold.wav"/>
<action application="set" data="export_vars=pa_ring_file,pa_hold_file"/>
<action application="bridge" data="portaudio"/>
</condition>
</extension>
Example API interface usage:
call extension 1000
> pa call 1000
call extension 1001 putting the other call on hold
> pa call 1001
swap the calls between hold and active
> pa switch
view the current calls
> pa list
forground the call with id 1
> pa switch 1
background all calls
> pa switch none
send a dtmf string (1234) to the current call
> pa dtmf 1234
answer the oldest unanswered inbound call
> pa answer
answer the call with id 1
> pa answer 1
hangup the active call
> pa hangup
hangup the call with id 1
> pa hangup 1
get device info
> pa dump
print usage summary
> pa help
USAGE:
--------------------------------------------------------------------------------
pa help
pa dump
pa call <dest> [<dialplan> <cid_name> <cid_num> <rate>]
pa answer [<call_id>]
pa hangup [<call_id>]
pa list
pa switch [<call_id>|none]
pa_dtmf <digit string>
--------------------------------------------------------------------------------
The source of the portaudio v19 library will also be checked in for the
sake of the build system.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3981 d0543943-73ff-0310-b7d9-9358b9ac24b2
223 lines
6.3 KiB
Makefile
223 lines
6.3 KiB
Makefile
#
|
|
# PortAudio V19 Makefile.darwin
|
|
#
|
|
# Bjorn Roche of XO Audio (www.xoaudio.com)
|
|
# Based on autoconf's makefile, created from Makefile generated by
|
|
# autoconf. Autoconf files written by by Dominic Mazzoni with modifications
|
|
# by Mikael Magnusson.
|
|
#
|
|
|
|
top_srcdir = .
|
|
srcdir = .
|
|
|
|
top_builddir = .
|
|
OPT_LEVEL := -O2
|
|
PREFIX = /usr/local
|
|
prefix = $(PREFIX)
|
|
exec_prefix = ${prefix}
|
|
bindir = ${exec_prefix}/bin
|
|
libdir = ${exec_prefix}/lib
|
|
includedir = ${prefix}/include
|
|
CC = gcc
|
|
CFLAGS = -g -std=gnu99 -Werror -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.3 $(OPT_LEVEL) -Wall -pedantic -pipe -fPIC -DPA_BIG_ENDIAN -Ipa_common -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DPA_USE_COREAUDIO=1 -Iinclude -Isrc/common
|
|
LIBS = -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon
|
|
AR = /usr/bin/ar
|
|
RANLIB = ranlib
|
|
LIBTOOL = $(SHELL) $(top_builddir)/libtool
|
|
INSTALL = /usr/bin/install -c
|
|
INSTALL_DATA = ${INSTALL} -m 644
|
|
SHARED_FLAGS = -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -dynamiclib -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.3
|
|
DLL_LIBS =
|
|
CXXFLAGS = -g $(OPT_LEVEL)
|
|
NASM =
|
|
NASMOPT =
|
|
LN_S = ln -s
|
|
LT_RELEASE=@LT_RELEASE@
|
|
LT_CURRENT=2
|
|
LT_REVISION=0
|
|
LT_AGE=0
|
|
|
|
|
|
OTHER_OBJS = src/os/mac_osx/pa_mac_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/pa_mac_core_utilities.o src/hostapi/coreaudio/pa_mac_core_blocking.o
|
|
|
|
PALIB = libportaudio.a
|
|
PADLL = libportaudio
|
|
PADLLV_MIN = 19
|
|
PADLLV = 0.0.19
|
|
PADLLEXT = .dylib
|
|
PASHLIBNAME = $(PADLL).$(PADLLV)$(PADLLEXT)
|
|
PAINC = include/portaudio.h
|
|
PA_LDFLAGS = $(LDFLAGS) $(SHARED_FLAGS) -rpath $(libdir) -no-undefined -export -symbols-regex "Pa_.*" -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
|
|
|
COMMON_OBJS = \
|
|
src/common/pa_allocation.o \
|
|
src/common/pa_converters.o \
|
|
src/common/pa_cpuload.o \
|
|
src/common/pa_debugprint.o \
|
|
src/common/pa_dither.o \
|
|
src/common/pa_front.o \
|
|
src/common/pa_process.o \
|
|
src/common/pa_ringbuffer.o \
|
|
src/common/pa_skeleton.o \
|
|
src/common/pa_stream.o \
|
|
src/common/pa_trace.o
|
|
|
|
TESTS = \
|
|
bin/paqa_devs \
|
|
bin/paqa_errs \
|
|
bin/patest1 \
|
|
bin/patest_buffer \
|
|
bin/patest_callbackstop \
|
|
bin/patest_clip \
|
|
bin/patest_dither \
|
|
bin/patest_hang \
|
|
bin/patest_in_overflow \
|
|
bin/patest_latency \
|
|
bin/patest_leftright \
|
|
bin/patest_longsine \
|
|
bin/patest_many \
|
|
bin/patest_maxsines \
|
|
bin/patest_multi_sine \
|
|
bin/patest_out_underflow \
|
|
bin/patest_pink \
|
|
bin/patest_prime \
|
|
bin/patest_read_record \
|
|
bin/patest_read_write_wire \
|
|
bin/patest_record \
|
|
bin/patest_ringmix \
|
|
bin/patest_saw \
|
|
bin/patest_sine8 \
|
|
bin/patest_sine \
|
|
bin/patest_sine_formats \
|
|
bin/patest_sine_time \
|
|
bin/patest_start_stop \
|
|
bin/patest_stop \
|
|
bin/patest_sync \
|
|
bin/patest_timing \
|
|
bin/patest_toomanysines \
|
|
bin/patest_underflow \
|
|
bin/patest_wire \
|
|
bin/patest_write_sine \
|
|
bin/patest_write_stop \
|
|
bin/pa_devs \
|
|
bin/pa_fuzz \
|
|
bin/pa_minlat
|
|
|
|
# Most of these don't compile yet. Put them in TESTS, above, if
|
|
# you want to try to compile them...
|
|
ALL_TESTS = \
|
|
$(TESTS) \
|
|
bin/debug_convert \
|
|
bin/debug_dither_calc \
|
|
bin/debug_dual \
|
|
bin/debug_multi_in \
|
|
bin/debug_multi_out \
|
|
bin/debug_record \
|
|
bin/debug_record_reuse \
|
|
bin/debug_sine_amp \
|
|
bin/debug_sine \
|
|
bin/debug_sine_formats \
|
|
bin/debug_srate \
|
|
bin/debug_test1 \
|
|
bin/pa_devs \
|
|
bin/pa_fuzz \
|
|
bin/pa_minlat \
|
|
bin/paqa_devs \
|
|
bin/paqa_errs \
|
|
bin/patest1 \
|
|
bin/patest_buffer \
|
|
bin/patest_clip \
|
|
bin/patest_dither \
|
|
bin/patest_hang \
|
|
bin/patest_in_overflow \
|
|
bin/patest_latency \
|
|
bin/patest_leftright \
|
|
bin/patest_longsine \
|
|
bin/patest_many \
|
|
bin/patest_maxsines \
|
|
bin/patest_multi_sine \
|
|
bin/patest_out_underflow \
|
|
bin/patest_pink \
|
|
bin/patest_read_record \
|
|
bin/patest_record \
|
|
bin/patest_ringmix \
|
|
bin/patest_saw \
|
|
bin/patest_sine8 \
|
|
bin/patest_sine \
|
|
bin/patest_sine_formats \
|
|
bin/patest_sine_time \
|
|
bin/patest_start_stop \
|
|
bin/patest_stop \
|
|
bin/patest_sync \
|
|
bin/patest_timing \
|
|
bin/patest_toomanysines \
|
|
bin/patest_underflow \
|
|
bin/patest_wire \
|
|
bin/patest_write_sine
|
|
|
|
OBJS = $(COMMON_OBJS) $(OTHER_OBJS)
|
|
|
|
#LTOBJS:= $(OBJS:.o=.lo)
|
|
|
|
all: lib/$(PALIB) lib/$(PASHLIBNAME) tests
|
|
|
|
tests: bin/ $(TESTS)
|
|
|
|
lib/$(PALIB): lib/ $(OBJS) Makefile.darwin $(PAINC)
|
|
-rm lib/$(PALIB)
|
|
$(AR) ruv lib/$(PALIB) $(OBJS)
|
|
$(RANLIB) lib/$(PALIB)
|
|
|
|
lib/$(PASHLIBNAME): lib/ $(OBJS) Makefile.darwin $(PAINC)
|
|
$(CC) $(SHARED_FLAGS) -o lib/$(PASHLIBNAME) $(OBJS) $(DLL_LIBS) -install_name $(PREFIX)/lib/$(PASHLIBNAME) -compatibility_version $(PADLLV) -current_version $(PADLLV)
|
|
|
|
$(TESTS): bin/%: lib/$(PALIB) Makefile.darwin $(PAINC) test/%.c
|
|
$(CC) -o $@ $(CFLAGS) test/$*.c lib/$(PALIB) $(LIBS)
|
|
|
|
install: lib/$(PALIB) lib/$(PASHLIBNAME) portaudio-2.0.pc
|
|
$(INSTALL) -d $(PREFIX)/lib
|
|
$(INSTALL) -m 644 lib/$(PASHLIBNAME) $(PREFIX)/lib/$(PASHLIBNAME)
|
|
$(INSTALL) -m 644 lib/$(PALIB) $(PREFIX)/lib/$(PALIB)
|
|
cd $(PREFIX)/lib && rm -f $(PADLL)$(PADLLEXT) && ln -s $(PASHLIBNAME) $(PADLL)$(PADLLEXT)
|
|
$(INSTALL) -d $(PREFIX)/include
|
|
$(INSTALL) -m 644 include/portaudio.h $(PREFIX)/include/portaudio.h
|
|
$(INSTALL) -d $(PREFIX)/lib/pkgconfig
|
|
$(INSTALL) -m 644 portaudio-2.0.pc $(PREFIX)/lib/pkgconfig/portaudio-2.0.pc
|
|
@echo ""
|
|
@echo "------------------------------------------------------------"
|
|
@echo "PortAudio was successfully installed."
|
|
@echo ""
|
|
@echo "On some systems (e.g. Linux) you should run 'ldconfig' now"
|
|
@echo "to make the shared object available. You may also need to"
|
|
@echo "modify your LD_LIBRARY_PATH environment variable to include"
|
|
@echo "the directory $(PREFIX)/lib"
|
|
@echo "------------------------------------------------------------"
|
|
@echo ""
|
|
|
|
uninstall:
|
|
rm -f $(PREFIX)/lib/$(PASHLIBNAME)
|
|
rm -f $(PREFIX)/lib/$(PALIB)
|
|
rm -f $(PREFIX)/lib/$(PADLL)$(PADLLEXT)
|
|
rm -f $(PREFIX)/include/portaudio.h
|
|
|
|
clean:
|
|
rm -f $(OBJS) $(TESTS) lib/$(PALIB) lib/$(PASHLIBNAME)
|
|
|
|
%.o: %.c Makefile.darwin $(PAINC)
|
|
$(CC) -c $(CFLAGS) $< -o $@
|
|
|
|
%.o: %.cpp Makefile.darwin $(PAINC)
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
%.o: %.asm
|
|
$(NASM) $(NASMOPT) -o $@ $<
|
|
|
|
bin:
|
|
mkdir bin
|
|
|
|
lib:
|
|
mkdir lib
|
|
|
|
|
|
|