sofaswitch-svn
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
March 2008
- 1 participants
- 6 discussions
Author: derek
Date: Sun Mar 30 18:04:17 2008
New Revision: 401
Removed:
sofaswitch/trunk/sofa/Makefile
Log:
Take this file off revision control...
This file is auto generated from Makefile.in
1
0
30 Mar '08
Author: derek
Date: Sun Mar 30 18:02:56 2008
New Revision: 400
Removed:
sofaswitch/trunk/Makefile.in
sofaswitch/trunk/configure.ac
sofaswitch/trunk/install-sh
sofaswitch/trunk/sofa_inc.mak.in
Modified:
sofaswitch/trunk/sofa/Makefile
sofaswitch/trunk/sofa/sofa_inc.mak.in
sofaswitch/trunk/voip/Makefile
Log:
Get it to build voip,am,mcu etc.
Modified: sofaswitch/trunk/sofa/Makefile
==============================================================================
--- sofaswitch/trunk/sofa/Makefile (original)
+++ sofaswitch/trunk/sofa/Makefile Sun Mar 30 18:02:56 2008
@@ -1,10 +1,9 @@
#
# Makefile
#
-# Make file for Sofa Switch library
+# Make file for SofaSwitch
#
-# Copyright (c) 2000 Equivalence pty. Ltd.
-# Copyright (c) 2006 Indranet Technologies Ltd.
+# Copyright (c) 2001 Equivalence Pty. Ltd.
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
@@ -16,30 +15,39 @@
# the License for the specific language governing rights and limitations
# under the License.
#
-# The Original Code is the Sofa Switch Library.
+# The Original Code is Open Phone Abstraction Library.
#
# The Initial Developer of the Original Code is Equivalence Pty. Ltd.
#
# Contributor(s): ______________________________________.
-# Shamlessly stolen and modified from the OPAL project by Derek J Smithies
-#
-#
-#
#
+# $Revision: 19747 $
+# $Author: rjongbloed $
+# $Date: 2008-03-14 16:19:22 +1300 (Fri, 14 Mar 2008) $
#
+export SOFADIR=/users/derek/sofa/sofaswitch/sofa
INSTALL=/usr/bin/install -c
+OS_NAME=$(shell uname -s)
+ifeq ($(OS_NAME),SunOS)
+ override SHELL=/usr/bin/bash
+endif
default :: optshared
all :: bothdepend both
+update:
+ svn update
+ $(MAKE) all
+
+
SUBDIRS :=
LIBRARY_MAKEFILE:=1
-include $(SOFADIR)/../sofa_inc.mak
+include $(SOFADIR)/sofa_inc.mak
PREFIX=/usr/local/
exec_prefix = ${PREFIX}
@@ -53,9 +61,6 @@
endif
SOFA_OBJDIR = $(SOFA_LIBDIR)/$(PT_OBJBASE)
-ifdef NOTRACE
-SOFA_OBJDIR += n
-endif
OBJDIR = $(SOFA_OBJDIR)
LIBDIR = $(SOFA_LIBDIR)
@@ -72,9 +77,11 @@
VPATH_CXX := $(SOFA_SRCDIR)
-SOURCES := $(SOFA_SRCDIR)/messages.cxx $(SOFA_SRCDIR)/messlist.cxx
-
+########################################
+# Source files for library
+SOURCES := $(SOFA_SRCDIR)/messages.cxx \
+ $(SOFA_SRCDIR)/messlist.cxx
#
# Files to be cleaned during make clean
@@ -85,177 +92,44 @@
####################################################
-include $(PWLIBDIR)/make/common.mak
+include /home/derek/opalvoip/ptlib/make/common.mak
-####################################################
-# replace lib.mak
+LIB_FILENAME=$(SOFA_FILE)
+SYSLIBS += -L$(PT_LIBDIR) -l$(PTLIB_BASE)$(LIB_TYPE)
-ifneq ($(OSTYPE),Darwin)
- LIBNAME_MAJ = $(SOFA_FILE).$(MAJOR_VERSION)
- LIBNAME_MIN = $(LIBNAME_MAJ).$(MINOR_VERSION)
- ifeq ($(BUILD_TYPE),.)
- LIBNAME_PAT = $(LIBNAME_MIN).$(BUILD_NUMBER)
- else
- LIBNAME_PAT = $(LIBNAME_MIN)-$(BUILD_TYPE)$(BUILD_NUMBER)
- endif
-else
- LIBNAME_MAJ = $(subst .$(LIB_SUFFIX),.$(MAJOR_VERSION).$(LIB_SUFFIX),$(SOFA_FILE))
- LIBNAME_MIN = $(subst .$(LIB_SUFFIX),.$(MAJOR_VERSION).$(MINOR_VERSION).$(LIB_SUFFIX),$(SOFA_FILE))
- ifeq ($(BUILD_TYPE),.)
- LIBNAME_PAT = $(subst .$(LIB_SUFFIX),.$(MAJOR_VERSION).$(MINOR_VERSION).$(BUILD_NUMBER).$(LIB_SUFFIX),$(SOFA_FILE))
- else
- LIBNAME_PAT = $(subst .$(LIB_SUFFIX),.$(MAJOR_VERSION).$(MINOR_VERSION)-$(BUILD_TYPE)$(BUILD_NUMBER).$(LIB_SUFFIX),$(SOFA_FILE))
- endif
-endif
-
-LIB_SONAME = $(LIBNAME_MAJ)
+include /home/derek/opalvoip/ptlib/make/lib.mak
-CLEAN_FILES += $(LIBDIR)/$(LIBNAME_PAT) $(LIBDIR)/$(SOFA_FILE) $(LIBDIR)/$(LIBNAME_MAJ) $(LIBDIR)/$(LIBNAME_MIN)
-
-ifneq ($(P_SHAREDLIB),1)
- STATIC_LIB_FILE = $(LIBDIR)/$(SOFA_FILE)
-else
- STATIC_LIB_FILE = $(LIBDIR)/$(subst .$(LIB_SUFFIX),_s.$(STATICLIBEXT),$(SOFA_FILE))
-endif
-
-$(LIBDIR)/$(SOFA_FILE) : $(TARGETLIB)
-
-ifeq ($(P_SHAREDLIB),1)
-
- ifeq ($(OSTYPE),beos)
- # BeOS requires different options when building shared libraries
- # Also, when building a shared library x that references symbols in libraries y,
- # the y libraries need to be added to the linker command
- LDSOOPTS = -nostdlib -nostart
- EXTLIBS = -lstdc++.r4
- SYSLIBS += -L$(PW_LIBDIR) -l$(PTLIB_BASE)$(LIB_TYPE)
- else
- ifeq ($(OSTYPE),Darwin)
- LDSOOPTS = -dynamiclib
- SYSLIBS += -l$(PTLIB_BASE)$(LIB_TYPE)
- else
- LDSOOPTS = -shared
- endif
- endif
-
- ENDLDLIBS := $(SYSLIBS) $(ENDLDLIBS)
-
- ifeq ($(OSTYPE),rtems)
- EXTLIBS = -lstdc++
- endif
-
- ifneq ($(OSTYPE), QNX)
- ifneq (,$(findstring $(OSTYPE),FreeBSD OpenBSDs))
- ifdef P_PTHREADS
- EXTLIBS += -pthread
- endif
- else
- ifdef P_PTHREADS
- EXTLIBS += -lpthread
- endif
- endif
- endif
-
- # Solaris loader doesn't grok -soname (sees it as -s -oname)
- # We could use -Wl,-h,$(LIB_BASENAME).1 but then we find that the arglist
- # to gcc is 2900+ bytes long and it will barf. I fix this by invoking ld
- # directly and passing it the equivalent arguments...jpd(a)louisiana.edu
- ifeq ($(OSTYPE),solaris)
- LDSOOPTS = -Bdynamic -G -h $(LIB_SONAME)
- LD = $(CPLUS)
- else
- ifeq ($(OSTYPE),mingw)
- LDSOOPTS += -Wl,--kill-at
- else
- ifneq ($(OSTYPE),Darwin)
- LDSOOPTS += -Wl,-soname,$(LIB_SONAME)
- endif
- endif
- LD = $(CPLUS)
- endif
-
- $(LIBDIR)/$(SOFA_FILE): $(LIBDIR)/$(LIBNAME_PAT)
- cd $(LIBDIR) ; rm -f $(SOFA_FILE) ; ln -sf $(LIBNAME_PAT) $(SOFA_FILE)
- cd $(LIBDIR) ; rm -f $(LIBNAME_MAJ) ; ln -sf $(LIBNAME_PAT) $(LIBNAME_MAJ)
- cd $(LIBDIR) ; rm -f $(LIBNAME_MIN) ; ln -sf $(LIBNAME_PAT) $(LIBNAME_MIN)
-
- $(LIBDIR)/$(LIBNAME_PAT): $(STATIC_LIB_FILE)
- @echo EXTLIBS = $(EXTLIBS)
- @echo SYSLIBS = $(SYSLIBS)
- @if [ ! -d $(LIBDIR) ] ; then mkdir $(LIBDIR) ; fi
- $(LD) $(LDSOOPTS) -o $(LIBDIR)/$(LIBNAME_PAT) $(LDFLAGS) $(EXTLIBS) $(OBJS) $(ENDLDLIBS)
-
-endif # P_SHAREDLIB
-
-$(STATIC_LIB_FILE): $(OBJS)
- @if [ ! -d $(LIBDIR) ] ; then mkdir $(LIBDIR) ; fi
- $(ARCHIVE) $(STATIC_LIB_FILE) $(OBJS)
-ifeq ($(P_USE_RANLIB),1)
- $(RANLIB) $(STATIC_LIB_FILE)
-endif
####################################################
notrace::
$(MAKE) NOTRACE=1 opt
+
###############################################################################
#### Subdirectories
-$(STANDARD_TARGETS) ::
- set -e; $(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) $@;)
+$(subst tagbuild,,$(STANDARD_TARGETS)) ::
+ @set -e; $(foreach dir,$(SUBDIRS),if test -e $(dir) ; then $(MAKE) -C $(dir) $@; fi ;)
+
+
+$(STANDARD_TARGETS) :: Makefile
+
+Makefile: Makefile.in configure
+ @echo
+ @echo "*******************************************************"
+ @echo Makefile is not up to date, is a ./configure necessary?
+ @echo "*******************************************************"
+ @false
#### Install targets
-install:
+install ::
mkdir -p $(DESTDIR)${exec_prefix}/lib
- ( for dir in $(DESTDIR)${exec_prefix}/lib \
- $(DESTDIR)$(PREFIX)/include/opal/asn \
- $(DESTDIR)$(PREFIX)/include/opal/codec \
- $(DESTDIR)$(PREFIX)/include/opal/h323 \
- $(DESTDIR)$(PREFIX)/include/opal/iax2 \
- $(DESTDIR)$(PREFIX)/include/opal/lids \
- $(DESTDIR)$(PREFIX)/include/opal/opal \
- $(DESTDIR)$(PREFIX)/include/opal/rtp \
- $(DESTDIR)$(PREFIX)/include/opal/sip \
- $(DESTDIR)$(PREFIX)/include/opal/t120 \
- $(DESTDIR)$(PREFIX)/include/opal/t38 \
- $(DESTDIR)$(PREFIX)/share/opal ;\
- do mkdir -p $$dir ; chmod 755 $$dir ; \
- done)
- $(INSTALL) -m 755 lib/$(LIBNAME_PAT) $(DESTDIR)${exec_prefix}/lib
- ln -snf $(LIBNAME_PAT) \
- $(DESTDIR)${exec_prefix}/lib/$(SOFA_FILE).$(MAJOR_VERSION).$(MINOR_VERSION)
- ln -snf $(LIBNAME_PAT) \
- $(DESTDIR)${exec_prefix}/lib/$(SOFA_FILE).$(MAJOR_VERSION)
- ln -snf $(LIBNAME_PAT) \
- $(DESTDIR)${exec_prefix}/lib/$(SOFA_FILE)
- ln -snf $(LIBNAME_PAT) \
- $(DESTDIR)${exec_prefix}/lib/libsofa.so
- $(INSTALL) -m 644 opal_inc.mak $(DESTDIR)$(PREFIX)/share/sofa
-
-uninstall:
- rm -rf $(DESTDIR)$(PREFIX)/include/sofa \
- $(DESTDIR)$(PREFIX)/share/sofa
- rm -f $(DESTDIR)${exec_prefix}/lib/$(SOFA_FILE) \
- $(DESTDIR)${exec_prefix}/lib/libsofa.so \
- $(DESTDIR)${exec_prefix}/lib/$(SOFA_FILE).$(MAJOR_VERSION).$(MINOR_VERSION) \
- $(DESTDIR)${exec_prefix}/lib/$(SOFA_FILE).$(MAJOR_VERSION) \
- $(DESTDIR)${exec_prefix}/lib/$(LIBNAME_PAT)
-docs:
- doxygen docs.cfg
-
-
-distclean:
- @find . -name \*~ | xargs rm -f
- @find . -name core\* | xargs rm -f
- @find . -name obj\* | xargs rm -fr
- @find . -name html | xargs rm -fr
- @find . -name log\* | xargs rm -fr
- @find . -name lib | xargs rm -fr
- @echo " "
- @echo "removing all editor backup files, core files, obj files, and doc files"
- @echo " "
+docs: FORCE
+ doxygen sofa_cfg.dxy
+FORCE:
+
# End of file #################################################################
Modified: sofaswitch/trunk/sofa/sofa_inc.mak.in
==============================================================================
--- sofaswitch/trunk/sofa/sofa_inc.mak.in (original)
+++ sofaswitch/trunk/sofa/sofa_inc.mak.in Sun Mar 30 18:02:56 2008
@@ -37,8 +37,10 @@
ifdef NOTRACE
OBJDIR_SUFFIX := n
endif
+ifndef OPAL_ENABLED
include $(PTLIBDIR)/make/ptlib.mak
endif
+endif
SOFA_SRCDIR = $(SOFADIR)/src
SOFA_INCDIR = $(SOFADIR)/include
Modified: sofaswitch/trunk/voip/Makefile
==============================================================================
--- sofaswitch/trunk/voip/Makefile (original)
+++ sofaswitch/trunk/voip/Makefile Sun Mar 30 18:02:56 2008
@@ -70,7 +70,7 @@
include $(OPALDIR)/opal_inc.mak
endif
-OPALENABLED=TRUE
+OPAL_ENABLED=TRUE
ifndef SOFADIR
@@ -85,15 +85,6 @@
abort now.
endif
-
-
-
-
-
-
-
-
-
##################################################
distclean:
1
0
Author: derek
Date: Sun Mar 30 17:52:10 2008
New Revision: 399
Modified:
sofaswitch/trunk/mcu/supervisor.cxx
sofaswitch/trunk/mcu/supervisor.h
Log:
Get it to compile with the new ptlib/opal combo.
Modified: sofaswitch/trunk/mcu/supervisor.cxx
==============================================================================
--- sofaswitch/trunk/mcu/supervisor.cxx (original)
+++ sofaswitch/trunk/mcu/supervisor.cxx Sun Mar 30 17:52:10 2008
@@ -55,6 +55,11 @@
PTRACE(3, "end of this supervisor ");
}
+void Supervisor::ProcessAnswer(PStringArray &cmds, PString & sender)
+{
+ PAssertAlways("ProcessAnswer Should not called in the context of an MCU");
+}
+
void Supervisor::OnTermination()
{
PTRACE(3, "Supervisor thread has ended");
Modified: sofaswitch/trunk/mcu/supervisor.h
==============================================================================
--- sofaswitch/trunk/mcu/supervisor.h (original)
+++ sofaswitch/trunk/mcu/supervisor.h Sun Mar 30 17:52:10 2008
@@ -60,6 +60,12 @@
~Supervisor();
protected:
+ /**we have received a command advising us how to answer to the incoming
+ call, so we act as required and reply accordingly. The mcu does not
+ actually handle this at the moment. We are required to declare this
+ method, as ProcessAnswer is pure, in the ancestor.*/
+ virtual void ProcessAnswer(PStringArray &cmds, PString & sender);
+
/**The supervisor has completed. This method is called when this
supervisor instance terminates. Since there is only one
Supervisor instance, this method is only every called once. */
1
0
Author: derek
Date: Sun Mar 30 17:37:41 2008
New Revision: 398
Added:
sofaswitch/trunk/sofa/Makefile.in
sofaswitch/trunk/sofa/configure.ac
sofaswitch/trunk/sofa/install-sh (contents, props changed)
sofaswitch/trunk/sofa/sofa_inc.mak.in
Log:
Add these files, and get them to build the library correctly
Added: sofaswitch/trunk/sofa/Makefile.in
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/sofa/Makefile.in Sun Mar 30 17:37:41 2008
@@ -0,0 +1,135 @@
+#
+# Makefile
+#
+# Make file for SofaSwitch
+#
+# Copyright (c) 2001 Equivalence Pty. Ltd.
+#
+# The contents of this file are subject to the Mozilla Public License
+# Version 1.0 (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 Open Phone Abstraction Library.
+#
+# The Initial Developer of the Original Code is Equivalence Pty. Ltd.
+#
+# Contributor(s): ______________________________________.
+#
+# $Revision: 19747 $
+# $Author: rjongbloed $
+# $Date: 2008-03-14 16:19:22 +1300 (Fri, 14 Mar 2008) $
+#
+
+export SOFADIR=@SOFADIR@
+
+INSTALL=@INSTALL@
+OS_NAME=$(shell uname -s)
+ifeq ($(OS_NAME),SunOS)
+ override SHELL=/usr/bin/bash
+endif
+
+default :: optshared
+
+all :: bothdepend both
+
+update:
+ svn update
+ $(MAKE) all
+
+
+SUBDIRS :=
+
+LIBRARY_MAKEFILE:=1
+
+include $(SOFADIR)/sofa_inc.mak
+
+PREFIX=@INSTALLPREFIX@/
+exec_prefix = ${PREFIX}
+
+ifndef PREFIX
+PREFIX=/usr/local
+endif
+
+ifeq ($(USE_GCC),yes)
+ANSI_FLAG = -ansi
+endif
+
+SOFA_OBJDIR = $(SOFA_LIBDIR)/$(PT_OBJBASE)
+
+OBJDIR = $(SOFA_OBJDIR)
+LIBDIR = $(SOFA_LIBDIR)
+TARGET = $(SOFA_LIBDIR)/$(SOFA_FILE)
+
+STDCCFLAGS += @STDCCFLAGS@
+
+ifdef NOTRACE
+STDCCFLAGS += -DPASN_NOPRINTON
+else
+STDCCFLAGS += -DPTRACING
+endif
+
+VPATH_CXX := $(SOFA_SRCDIR)
+
+
+########################################
+# Source files for library
+
+SOURCES := $(SOFA_SRCDIR)/messages.cxx \
+ $(SOFA_SRCDIR)/messlist.cxx
+
+#
+# Files to be cleaned during make clean
+#
+
+CLEAN_FILES = $(SOFA_LIB)
+
+
+####################################################
+
+include @PTLIBDIR@/make/common.mak
+
+LIB_FILENAME=$(SOFA_FILE)
+SYSLIBS += -L$(PT_LIBDIR) -l$(PTLIB_BASE)$(LIB_TYPE)
+
+include @PTLIBDIR@/make/lib.mak
+
+
+####################################################
+
+notrace::
+ $(MAKE) NOTRACE=1 opt
+
+
+###############################################################################
+#### Subdirectories
+$(subst tagbuild,,$(STANDARD_TARGETS)) ::
+ @set -e; $(foreach dir,$(SUBDIRS),if test -e $(dir) ; then $(MAKE) -C $(dir) $@; fi ;)
+
+
+$(STANDARD_TARGETS) :: Makefile
+
+Makefile: Makefile.in configure
+ @echo
+ @echo "*******************************************************"
+ @echo Makefile is not up to date, is a ./configure necessary?
+ @echo "*******************************************************"
+ @false
+
+
+#### Install targets
+install ::
+ mkdir -p $(DESTDIR)@LIBDIR@
+
+docs: FORCE
+ doxygen sofa_cfg.dxy
+
+FORCE:
+
+
+# End of file #################################################################
Added: sofaswitch/trunk/sofa/configure.ac
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/sofa/configure.ac Sun Mar 30 17:37:41 2008
@@ -0,0 +1,160 @@
+dnl ########################################################################
+dnl OPAL configuration
+dnl
+dnl $Revision: 19674 $
+dnl $Author: dsandras $
+dnl $Date: 2008-03-06 09:37:40 +1300 (Thu, 06 Mar 2008) $
+dnl
+
+AC_INIT()
+
+AC_PROG_CC
+AC_PROG_CXX
+dnl this must be updated for every minor revision, and for
+dnl builds when and as necessary
+REQUIRED_PTLIB_MAJOR=2
+REQUIRED_PTLIB_MINOR=0
+REQUIRED_PTLIB_BUILD=0
+
+dnl ########################################################################
+dnl set the SOFA directory to the current directory
+
+SOFADIR=`pwd`
+AC_SUBST(SOFADIR)
+
+dnl ########################################################################
+dnl set the PREFIX accordingly
+if test "x$prefix" = "xNONE"; then
+ INSTALLPREFIX="/usr/local"
+else
+ INSTALLPREFIX="${prefix}"
+fi
+
+AC_SUBST(INSTALLPREFIX)
+
+dnl ########################################################################
+dnl set LIBDIR accordingly
+LIBDIR="${libdir}"
+
+AC_SUBST(LIBDIR)
+
+dnl ########################################################################
+dnl extract the SOFA version
+
+dnl MSWIN_DISPLAY version,Version
+dnl MSWIN_VERSION version,SOFA_MAJOR=MAJOR_VERSION
+dnl MSWIN_VERSION version,SOFA_MINOR=MINOR_VERSION
+dnl MSWIN_VERSION version,SOFA_BUILD=BUILD_NUMBER
+dnl MSWIN_VERSION version,SOFA_VERSION=VERSION
+
+MAJOR_VERSION=`cat ${SOFADIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' '`
+MINOR_VERSION=`cat ${SOFADIR}/version.h | grep MINOR_VERSION | cut -f3 -d' '`
+BUILD_NUMBER=`cat ${SOFADIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' '`
+SOFA_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_NUMBER}"
+BUILD_TYPE=`cat ${SOFADIR}/version.h | grep BUILD_TYPE | cut -f 3 -d ' ' | sed 's/BetaCode/-beta/' | sed 's/AlphaCode/-alpha/' | sed 's/ReleaseCode/\./'`
+
+AC_DEFINE_UNQUOTED(SOFA_MAJOR, ${MAJOR_VERSION})
+AC_DEFINE_UNQUOTED(SOFA_MINOR, ${MINOR_VERSION})
+AC_DEFINE_UNQUOTED(SOFA_BUILD, ${BUILD_NUMBER})
+AC_DEFINE_UNQUOTED(SOFA_VERSION, "$SOFA_VERSION")
+
+AC_MSG_NOTICE(Sofa version is ${SOFA_VERSION});
+
+#use to set the version in sofa.pc
+AC_SUBST(SOFA_VERSION)
+AC_SUBST(BUILD_TYPE)
+
+dnl ########################################################################
+dnl look for ptlib, use a preference order of explicit PTLIBDIR, directory
+dnl at same level, home directory, /usr/local or /usr.
+
+if test "${PTLIBDIR:-unset}" = "unset" -a "${PWLIBDIR:-unset}" != "unset" ; then
+ PTLIBDIR=$PWLIBDIR
+fi
+if test "${PTLIBDIR:-unset}" = "unset" -o ! -r "${PTLIBDIR}/version.h"; then
+ if test -r "/home/derek/opalvoip/ptlib/include/ptlib.h"; then
+ AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /home/derek/opalvoip/ptlib/make)
+ elif test -r "${PTLIBDIR}/include/ptlib.h"; then
+ AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , ${PTLIBDIR}/bin)
+ elif test -r "${SOFADIR}/../ptlib/version.h"; then
+ PTLIBDIR="${SOFADIR}/../ptlib"
+ elif test -r "${HOME}/ptlib/include/ptlib.h"; then
+ PTLIBDIR="${HOME}/ptlib"
+ elif test -r /usr/local/include/ptlib.h; then
+ AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/bin)
+ elif test -r /usr/include/ptlib.h; then
+ AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/share/ptlib/make/)
+ elif test -r "${prefix}/include/ptlib.h"; then
+ AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , ${prefix}/bin)
+ else
+ AC_MSG_ERROR("Cannot find PTLib - please install or set PTLIBDIR and try again")
+ fi
+fi
+
+if test "${PTLIBDIR:-unset}" = "unset" ; then
+ if test "${PTLIB_CONFIG:-unset}" = "unset" ; then
+ AC_MSG_ERROR("Cannot find ptlib-config - please install and try again")
+ fi
+ PTLIBDIR=`$PTLIB_CONFIG --prefix`
+fi
+
+if test -d "${PTLIBDIR}/share/ptlib/"; then
+ PTLIBDIR="${PTLIBDIR}/share/ptlib/"
+fi
+AC_SUBST(PTLIBDIR)
+
+echo "PTLib prefix set to.... $PTLIBDIR"
+
+if test "${PTLIBDIR:-unset}" = "unset" ; then
+ PWVERSION=`$PTLIB_CONFIG --version`
+ PW_MAJOR_VERSION=`echo $PW_VERSION | cut -d'.' -f1`
+ PW_MINOR_VERSION=`echo $PW_VERSION | cut -d'.' -f2`
+ PW_BUILD_NUMBER=`echo $PW_VERSION | cut -d'.' -f3`
+
+else
+ PW_MAJOR_VERSION=`cat ${PTLIBDIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' '`
+ PW_MINOR_VERSION=`cat ${PTLIBDIR}/version.h | grep MINOR_VERSION | cut -f3 -d' '`
+ PW_BUILD_NUMBER=`cat ${PTLIBDIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' '`
+ PWVERSION="${PW_MAJOR_VERSION}.${PW_MINOR_VERSION}.${PW_BUILD_NUMBER}"
+fi
+
+
+dnl ########################################################################
+dnl get the gcc version
+
+if test x$GXX = xyes ; then
+ USE_GCC=yes
+ gcc_version=`$CXX -dumpversion`
+ AC_MSG_NOTICE(gcc version is $gcc_version);
+ GXX_MAJOR=`echo $gcc_version | sed 's/\..*$//'`
+ GXX_MINOR=[`echo $gcc_version | sed -e 's/[0-9][0-9]*\.//' -e 's/\..*$//'`]
+ GXX_PATCH=[`echo $gcc_version | sed -e 's/[0-9][0-9]*\.[0-9][0-9]*\.//' -e 's/\..*$//'`]
+
+ dnl cannot compile for less than gcc 3
+ AC_MSG_CHECKING(checking if gcc version is valid)
+ if test ${GXX_MAJOR} -lt 3 ; then
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([SOFA requires gcc version 3 or later])
+ else
+ AC_MSG_RESULT(yes)
+ fi
+fi
+
+
+
+dnl ########################################################################
+dnl output make directives
+
+AC_SUBST(STDCCFLAGS)
+AC_SUBST(LDFLAGS)
+AC_SUBST(ENDLDLIBS)
+AC_PROG_INSTALL
+
+
+dnl ########################################################################
+dnl output header file
+
+AC_CONFIG_FILES(sofa_inc.mak)
+AC_CONFIG_FILES(Makefile)
+
+AC_OUTPUT()
Added: sofaswitch/trunk/sofa/install-sh
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/sofa/install-sh Sun Mar 30 17:37:41 2008
@@ -0,0 +1,295 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2003-09-24.23
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=
+transform_arg=
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+
+usage="Usage: $0 [OPTION]... SRCFILE DSTFILE
+ or: $0 -d DIR1 DIR2...
+
+In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
+In the second, create the directory path DIR.
+
+Options:
+-b=TRANSFORMBASENAME
+-c copy source (using $cpprog) instead of moving (using $mvprog).
+-d create directories instead of installing files.
+-g GROUP $chgrp installed files to GROUP.
+-m MODE $chmod installed files to MODE.
+-o USER $chown installed files to USER.
+-s strip installed files (using $stripprog).
+-t=TRANSFORM
+--help display this help and exit.
+--version display version info and exit.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+ case $1 in
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ -c) instcmd=$cpprog
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ --help) echo "$usage"; exit 0;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ --version) echo "$0 $scriptversion"; exit 0;;
+
+ *) if test -z "$src"; then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if test -z "$src"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+fi
+
+# Protect names starting with `-'.
+case $src in
+ -*) src=./$src ;;
+esac
+
+if test -n "$dir_arg"; then
+ dst=$src
+ src=
+
+ if test -d "$dst"; then
+ instcmd=:
+ chmodcmd=
+ else
+ instcmd=$mkdirprog
+ fi
+else
+ # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst ;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ dst=$dst/`basename "$src"`
+ fi
+fi
+
+# This sed command emulates the dirname command.
+dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+
+# Skip lots of stat calls in the usual case.
+if test ! -d "$dstdir"; then
+ defaultIFS='
+ '
+ IFS="${IFS-$defaultIFS}"
+
+ oIFS=$IFS
+ # Some sh's can't handle IFS=/ for some reason.
+ IFS='%'
+ set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+ IFS=$oIFS
+
+ pathcomp=
+
+ while test $# -ne 0 ; do
+ pathcomp=$pathcomp$1
+ shift
+ test -d "$pathcomp" || $mkdirprog "$pathcomp"
+ pathcomp=$pathcomp/
+ done
+fi
+
+if test -n "$dir_arg"; then
+ $doit $instcmd "$dst" \
+ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+else
+ # If we're going to rename the final executable, determine the name now.
+ if test -z "$transformarg"; then
+ dstfile=`basename "$dst"`
+ else
+ dstfile=`basename "$dst" $transformbasename \
+ | sed $transformarg`$transformbasename
+ fi
+
+ # don't allow the sed command to completely eliminate the filename.
+ test -z "$dstfile" && dstfile=`basename "$dst"`
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Move or copy the file name to the temp name
+ $doit $instcmd "$src" "$dsttmp" &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $instcmd $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+ # Now remove or move aside any old file at destination location. We
+ # try this two ways since rm can't unlink itself on some systems and
+ # the destination file might be busy for other reasons. In this case,
+ # the final cleanup might fail but the new file should still install
+ # successfully.
+ {
+ if test -f "$dstdir/$dstfile"; then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+ || {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit
+ }
+ else
+ :
+ fi
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+fi &&
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+ (exit 0); exit
+}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
Added: sofaswitch/trunk/sofa/sofa_inc.mak.in
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/sofa/sofa_inc.mak.in Sun Mar 30 17:37:41 2008
@@ -0,0 +1,86 @@
+#
+# sofa_inc.mak
+#
+# Make symbols include file for Open Phone Abstraction library
+#
+# Copyright (c) 2001 Equivalence Pty. Ltd.
+#
+# The contents of this file are subject to the Mozilla Public License
+# Version 1.0 (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 Open Phone Abstraction library.
+#
+# The Initial Developer of the Original Code is Equivalence Pty. Ltd.
+#
+# Contributor(s): ______________________________________.
+#
+# $Revision: 19674 $
+# $Author: dsandras $
+# $Date: 2008-03-06 09:37:40 +1300 (Thu, 06 Mar 2008) $
+#
+
+SOFADIR=@SOFADIR@
+PTLIBDIR=@PTLIBDIR@
+
+LIBDIRS += $(SOFADIR)
+
+ifdef LIBRARY_MAKEFILE
+include $(PTLIBDIR)/make/unix.mak
+else
+ifdef NOTRACE
+OBJDIR_SUFFIX := n
+endif
+include $(PTLIBDIR)/make/ptlib.mak
+endif
+
+SOFA_SRCDIR = $(SOFADIR)/src
+SOFA_INCDIR = $(SOFADIR)/include
+SOFA_LIBDIR = $(SOFADIR)/lib
+
+
+ifdef NOTRACE
+STDCCFLAGS += -DPASN_NOPRINTON -DPASN_LEANANDMEAN
+SOFA_SUFFIX = n
+else
+STDCCFLAGS += -DPTRACING
+RCFLAGS += -DPTRACING
+SOFA_SUFFIX = $(OBJ_SUFFIX)
+endif
+
+
+SOFA_BASE = sofa_$(PLATFORM_TYPE)_$(SOFA_SUFFIX)
+SOFA_FILE = lib$(SOFA_BASE)$(LIB_TYPE).$(LIB_SUFFIX)
+
+LDFLAGS += -L$(SOFA_LIBDIR)
+LDLIBS := -l$(SOFA_BASE)$(LIB_TYPE) $(LDLIBS)
+
+STDCCFLAGS += -I$(SOFA_INCDIR)
+
+$(TARGET) : $(SOFA_LIBDIR)/$(SOFA_FILE)
+
+ifndef LIBRARY_MAKEFILE
+
+ifdef DEBUG
+$(SOFA_LIBDIR)/$(SOFA_FILE):
+ echo "make " $(SOFADIR) " and debug"
+ $(MAKE) -C $(SOFADIR) debug
+else
+$(SOFA_LIBDIR)/$(SOFA_FILE):
+ echo "make " $(SOFADIR) " and opt"
+ $(MAKE) -C $(SOFADIR) opt
+endif
+
+libs :: $(SOFA_LIBDIR)/$(SOFA_FILE)
+
+endif
+
+
+# End of file
+
1
0
[Sofaswitch-svn] [commit] r397 - in sofaswitch/trunk: . am callflow/src console mcu server sofa sofa/include/sofa sound voip
by SofaSWITCH SVN 28 Mar '08
by SofaSWITCH SVN 28 Mar '08
28 Mar '08
Author: derek
Date: Thu Mar 27 22:11:53 2008
New Revision: 397
Added:
sofaswitch/trunk/Makefile.in
sofaswitch/trunk/configure.ac
sofaswitch/trunk/install-sh (contents, props changed)
sofaswitch/trunk/sofa_inc.mak.in
Removed:
sofaswitch/trunk/sofa/sofa_inc.mak
Modified:
sofaswitch/trunk/Makefile
sofaswitch/trunk/am/audio.h
sofaswitch/trunk/am/comms.h
sofaswitch/trunk/am/manager.h
sofaswitch/trunk/am/supervisor.cxx
sofaswitch/trunk/am/supervisor.h
sofaswitch/trunk/callflow/src/dnd.h
sofaswitch/trunk/callflow/src/joinblocks.h
sofaswitch/trunk/console/main.h
sofaswitch/trunk/mcu/audio.h
sofaswitch/trunk/mcu/comms.h
sofaswitch/trunk/mcu/manager.h
sofaswitch/trunk/mcu/member.h
sofaswitch/trunk/mcu/participant.h
sofaswitch/trunk/mcu/supervisor.h
sofaswitch/trunk/server/main.h
sofaswitch/trunk/sofa/Makefile
sofaswitch/trunk/sofa/include/sofa/messages.h
sofaswitch/trunk/sofa/include/sofa/messlist.h
sofaswitch/trunk/sound/audio.h
sofaswitch/trunk/sound/comms.h
sofaswitch/trunk/sound/main.h
sofaswitch/trunk/voip/comms.h
sofaswitch/trunk/voip/jocall.h
sofaswitch/trunk/voip/mymanager.h
sofaswitch/trunk/voip/supervisor.h
sofaswitch/trunk/voip/udpconnection.h
sofaswitch/trunk/voip/udpep.h
sofaswitch/trunk/voip/udpsound.h
Log:
Move away from BOOL, TRUE, FALSE.
start working on a configure script to build the library.
Modified: sofaswitch/trunk/Makefile
==============================================================================
--- sofaswitch/trunk/Makefile (original)
+++ sofaswitch/trunk/Makefile Thu Mar 27 22:11:53 2008
@@ -1,10 +1,9 @@
#
# Makefile
#
-# Make file for everything in sofa
+# Make file for SofaSwitch.
#
-# Copyright (c) 2000 Equivalence pty. Ltd.
-# Copyright (c) 2006 Indranet Technologies Ltd.
+# Copyright (c) 2001 Equivalence Pty. Ltd.
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
@@ -16,93 +15,106 @@
# the License for the specific language governing rights and limitations
# under the License.
#
-# The Original Code is the Sofa Switch Library.
+# The Original Code is Open Phone Abstraction Library.
#
# The Initial Developer of the Original Code is Equivalence Pty. Ltd.
#
# Contributor(s): ______________________________________.
#
+# $Revision: 19747 $
+# $Author: rjongbloed $
+# $Date: 2008-03-14 16:19:22 +1300 (Fri, 14 Mar 2008) $
#
-#
-#
-#
+
+export SOFADIR=/users/derek/sofa/sofaswitch
+
+INSTALL=/usr/bin/install -c
+OS_NAME=$(shell uname -s)
+ifeq ($(OS_NAME),SunOS)
+ override SHELL=/usr/bin/bash
+endif
+
+default :: optshared
+
+all :: bothdepend both
+
+update:
+ svn update
+ $(MAKE) all
+
+
+SUBDIRS :=
+
+LIBRARY_MAKEFILE:=1
+
+include $(SOFADIR)/sofa_inc.mak
+
+PREFIX=/usr/local/
+exec_prefix = ${PREFIX}
+
+ifndef PREFIX
+PREFIX=/usr/local
+endif
+
+ifeq ($(USE_GCC),yes)
+ANSI_FLAG = -ansi
+endif
+
+SOFA_OBJDIR = $(SOFA_LIBDIR)/$(PT_OBJBASE)
+
+OBJDIR = $(SOFA_OBJDIR)
+LIBDIR = $(SOFA_LIBDIR)
+TARGET = $(SOFA_LIBDIR)/$(SOFA_FILE)
+
+STDCCFLAGS +=
+
+ifdef NOTRACE
+STDCCFLAGS += -DPASN_NOPRINTON
+else
+STDCCFLAGS += -DPTRACING
+endif
+
+VPATH_CXX := $(SOFA_SRCDIR)/sofa/src
+
+
+########################################
+# Source files for library
+
+SOURCES := $(SOFA_SRCDIR)/sofa/src
+
+HEADER_FILES += $(SOFADIR)/sofa/include/sofa/messages.h \
+ $(SOFADIR)/sofa/include/sofa/messlist.h
+
+
+####################################################
+
+include /home/derek/opalvoip/ptlib/make/common.mak
+
+LIB_FILENAME=$(SOFA_FILE)
+SYSLIBS += -L$(PT_LIBDIR) -l$(PTLIB_BASE)$(LIB_TYPE)
+
+include /home/derek/opalvoip/ptlib/make/lib.mak
+
+
+####################################################
+
+notrace::
+ $(MAKE) NOTRACE=1 opt
-all:
- @cd sofa ; make both
- @cd am ; make both
- @cd callflow; make both
- @cd mcu ; make both
- @cd server ; make both
- @cd sound ; make both
- @cd voip ; make both
-
-all2:
- @cd sofa ; make -j 2 both
- @cd am ; make -j 2 both
- @cd callflow; make both
- @cd mcu ; make -j 2 both
- @cd server ; make -j 2 both
- @cd sound ; make -j 2 both
- @cd voip ; make -j 2 both
-
-
-
-doc:
- @rm -fR $(HOME)/sofa_docs
- @rm -fR html
- @doxygen docs.cfg
- @cd am ; doxygen docs.cfg
- @cd callflow ; doxygen docs.cfg
- @cd mcu ; doxygen docs.cfg
- @cd server ; doxygen docs.cfg
- @cd sofa ; doxygen docs.cfg
- @cd sound ; doxygen docs.cfg
- @cd voip ; doxygen docs.cfg
- @mv am/html html/am
- @mv callflow/html html/callflow
- @mv mcu/html html/mcu
- @mv server/html html/server
- @mv sofa/html html/sofa
- @mv sound/html html/sound
- @mv voip/html html/voip
- @mv html $(HOME)/sofa_docs
-
-
-docs: doc
-
-
-help:
- @echo " Available global targets are "
- @echo " ----------------------------"
- @echo "all rebuild all entities in the sofa suite"
- @echo " "
- @echo "clean remove all built and doc files"
- @echo " "
- @echo "distclean remove all obj, html, editor, core files"
- @echo " "
- @echo "doc build the documents"
- @echo "docs build the documents"
- @echo " "
- @echo "help provide this information"
- @echo " "
-
-clean:
- @cd sofa ; make clean
- @cd am ; make clean
- @cd mcu ; make clean
- @cd server ; make clean
- @cd sound ; make clean
- @cd voip ; make clean
-
-
-distclean: clean
- @find . -name html\* -exec rm -fR \{\} \;
- @find . -name \*~ -exec rm -f \{\} \;
- @find . -name obj_linux\* -exec rm -fR \{\} \;
- @find . -name core.\* -exec rm -f \{\} \;
- @find . -name lib\*.a -exec rm -f \{\} \;
+$(STANDARD_TARGETS) :: Makefile
+Makefile: Makefile.in configure
+ @echo
+ @echo "*******************************************************"
+ @echo Makefile is not up to date, is a ./configure necessary?
+ @echo "*******************************************************"
+ @false
+docs: FORCE
+ doxygen opal_cfg.dxy
+FORCE:
+
+# End of file #################################################################
Added: sofaswitch/trunk/Makefile.in
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/Makefile.in Thu Mar 27 22:11:53 2008
@@ -0,0 +1,120 @@
+#
+# Makefile
+#
+# Make file for SofaSwitch.
+#
+# Copyright (c) 2001 Equivalence Pty. Ltd.
+#
+# The contents of this file are subject to the Mozilla Public License
+# Version 1.0 (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 Open Phone Abstraction Library.
+#
+# The Initial Developer of the Original Code is Equivalence Pty. Ltd.
+#
+# Contributor(s): ______________________________________.
+#
+# $Revision: 19747 $
+# $Author: rjongbloed $
+# $Date: 2008-03-14 16:19:22 +1300 (Fri, 14 Mar 2008) $
+#
+
+export SOFADIR=@SOFADIR@
+
+INSTALL=@INSTALL@
+OS_NAME=$(shell uname -s)
+ifeq ($(OS_NAME),SunOS)
+ override SHELL=/usr/bin/bash
+endif
+
+default :: optshared
+
+all :: bothdepend both
+
+update:
+ svn update
+ $(MAKE) all
+
+
+SUBDIRS :=
+
+LIBRARY_MAKEFILE:=1
+
+include $(SOFADIR)/sofa_inc.mak
+
+PREFIX=@INSTALLPREFIX@/
+exec_prefix = ${PREFIX}
+
+ifndef PREFIX
+PREFIX=/usr/local
+endif
+
+ifeq ($(USE_GCC),yes)
+ANSI_FLAG = -ansi
+endif
+
+SOFA_OBJDIR = $(SOFA_LIBDIR)/$(PT_OBJBASE)
+
+OBJDIR = $(SOFA_OBJDIR)
+LIBDIR = $(SOFA_LIBDIR)
+TARGET = $(SOFA_LIBDIR)/$(SOFA_FILE)
+
+STDCCFLAGS += @STDCCFLAGS@
+
+ifdef NOTRACE
+STDCCFLAGS += -DPASN_NOPRINTON
+else
+STDCCFLAGS += -DPTRACING
+endif
+
+VPATH_CXX := $(SOFA_SRCDIR)/sofa/src
+
+
+########################################
+# Source files for library
+
+SOURCES := $(SOFA_SRCDIR)/sofa/src
+
+HEADER_FILES += $(SOFADIR)/sofa/include/sofa/messages.h \
+ $(SOFADIR)/sofa/include/sofa/messlist.h
+
+
+####################################################
+
+include @PTLIBDIR@/make/common.mak
+
+LIB_FILENAME=$(SOFA_FILE)
+SYSLIBS += -L$(PT_LIBDIR) -l$(PTLIB_BASE)$(LIB_TYPE)
+
+include @PTLIBDIR@/make/lib.mak
+
+
+####################################################
+
+notrace::
+ $(MAKE) NOTRACE=1 opt
+
+
+$(STANDARD_TARGETS) :: Makefile
+
+Makefile: Makefile.in configure
+ @echo
+ @echo "*******************************************************"
+ @echo Makefile is not up to date, is a ./configure necessary?
+ @echo "*******************************************************"
+ @false
+
+docs: FORCE
+ doxygen opal_cfg.dxy
+
+FORCE:
+
+
+# End of file #################################################################
Modified: sofaswitch/trunk/am/audio.h
==============================================================================
--- sofaswitch/trunk/am/audio.h (original)
+++ sofaswitch/trunk/am/audio.h Thu Mar 27 22:11:53 2008
@@ -53,7 +53,7 @@
void Initialise(Comms * _comms,
PUDPSocket * _socket,
PString fileName,
- BOOL isReadDir);
+ bool isReadDir);
/**Destructor */
virtual ~AudioBase();
@@ -73,26 +73,26 @@
/**Report True if this class has been initialised, and is ready to go */
- BOOL IsInitialised() { return !fileName.IsEmpty(); }
+ bool IsInitialised() { return !fileName.IsEmpty(); }
protected:
/**open a new wav file for reading/writing. This method has two
significant side effects:: a) opens the wav file,and b)sets the
class variable fileName */
- BOOL OpenWavFile(PString & newName);
+ bool OpenWavFile(PString & newName);
/**Test the incoming filename, and see if it has changed. If it has,
close the current file, and open the new file. This is all
carried out while the audio file is locked.
- return FALSE if there was no change in the source file.
+ return false if there was no change in the source file.
- return TRUE if there was a change in the source file.
+ return true if there was a change in the source file.
set the incoming file name to be blank on completion
made virtual, so descendant class can do things on file changing.*/
- virtual BOOL EnactFileChange();
+ virtual bool EnactFileChange();
/**Set all variables to NULL etc */
void ZeroValues();
@@ -123,7 +123,7 @@
PString incomingFile;
/**The particular direction of this class. */
- BOOL isReadDir;
+ bool isReadDir;
/**The descriptive label of this direction */
PString dirString;
@@ -150,11 +150,11 @@
protected:
/**Clear the sentEndOfFile flag on changing file */
- virtual BOOL EnactFileChange();
+ virtual bool EnactFileChange();
/**Flag to indicate we have read to the end of the current file. If the file is changed,
this flag has to be reset */
- BOOL sentEndOfFile;
+ bool sentEndOfFile;
};
/**Override of AudioBase. This will read audio from a socket, and put it into a file. This class will therefore record the words spoken by the remote person. */
Modified: sofaswitch/trunk/am/comms.h
==============================================================================
--- sofaswitch/trunk/am/comms.h (original)
+++ sofaswitch/trunk/am/comms.h Thu Mar 27 22:11:53 2008
@@ -82,7 +82,7 @@
void AdviseCallCreation(const PString & remoteCont);
/**Report the current file for audio read/writeing*/
- PString GetAudioFile(BOOL isReadFile);
+ PString GetAudioFile(bool isReadFile);
/**Close this comms instance down */
void CloseCommsDown() { SilentlyEndAll(); }
@@ -137,9 +137,9 @@
incoming call, so we act as required and reply accordingly*/
virtual void ProcessAnswer(PStringArray &cmds, PString & sender);
- /**Send this dtmf string to the remote node. Returns TRUE on
- success, FALSE on failure. */
- virtual BOOL SendDtmf(const PString & dtmfVals);
+ /**Send this dtmf string to the remote node. Returns true on
+ success, false on failure. */
+ virtual bool SendDtmf(const PString & dtmfVals);
/**Actually set the file this application reads data from. An
application will override this method, if it is allowed to grab
@@ -159,7 +159,7 @@
This virtual method says we can hangup, cause we are one
channel of a conference call. This instance of the comms
should close on receiving a hangup */
- virtual BOOL OkToHangup() { return TRUE; }
+ virtual bool OkToHangup() { return true; }
/**Get information for this call on status */
PString GetStatusInfo();
@@ -203,7 +203,7 @@
/**Flag to indicate that the media is flowing from this comms instance.
It is turned on by the first transferUDP command.*/
- BOOL mediaStreamsStarted;
+ bool mediaStreamsStarted;
/**The time at which this call started */
PTime createdAt;
Modified: sofaswitch/trunk/am/manager.h
==============================================================================
--- sofaswitch/trunk/am/manager.h (original)
+++ sofaswitch/trunk/am/manager.h Thu Mar 27 22:11:53 2008
@@ -96,7 +96,7 @@
/**Return the send to address that is stored in this class instance*/
- BOOL GetSendToAddress(const PString &SsAmToken, PIPSocket::Address & address, PINDEX & portNo);
+ bool GetSendToAddress(const PString &SsAmToken, PIPSocket::Address & address, PINDEX & portNo);
/**Return a reference to the pyython launcher for this program */
LaunchNewId & GetLaunchNewId() { return lid; }
@@ -125,7 +125,7 @@
/**Wait (up to 1 second) to see if the supervisor is installed and
connected OK. */
- BOOL WaitUntilSupervisorOk();
+ bool WaitUntilSupervisorOk();
/**Wait until the supervisor has finished */
void WaitForSupervisorEnd();
Modified: sofaswitch/trunk/am/supervisor.cxx
==============================================================================
--- sofaswitch/trunk/am/supervisor.cxx (original)
+++ sofaswitch/trunk/am/supervisor.cxx Thu Mar 27 22:11:53 2008
@@ -59,6 +59,12 @@
PTRACE(3, "end of this supervisor ");
}
+void Supervisor::ProcessAnswer(PStringArray &cmds, PString & sender)
+{
+ PTRACE(0, "Should not called in the context of an AM");
+}
+
+
void Supervisor::OnTermination()
{
Manager *mgr = AmProcess::Current().GetManager();
Modified: sofaswitch/trunk/am/supervisor.h
==============================================================================
--- sofaswitch/trunk/am/supervisor.h (original)
+++ sofaswitch/trunk/am/supervisor.h Thu Mar 27 22:11:53 2008
@@ -61,6 +61,10 @@
~Supervisor();
protected:
+ /**we have received a command advising us how to answer to the
+ incoming call, so we act as required and reply accordingly*/
+ virtual void ProcessAnswer(PStringArray &cmds, PString & sender);
+
/**The supervisor has completed. This method is called when this
supervisor instance terminates. Since there is only one
Supervisor instance, this method is only every called once. */
@@ -92,7 +96,7 @@
/**Some MessageFrame instances do not have the permission to quit
now. This virtual method determines if this instance is permitted to
exit the program. This supervisor has permision to end all. */
- virtual BOOL OkToQuitNow() { return TRUE; }
+ virtual bool OkToQuitNow() { return true; }
/**Some MessageFrame instances do not obey the hangup command. This
virtual method determines if this command has meaning, and if this
@@ -100,7 +104,7 @@
Since a hangup closes down this current comms instance, hanging
up here will be fatal.*/
- virtual BOOL OkToHangup() { return FALSE; }
+ virtual bool OkToHangup() { return false; }
/**We have a comms error, so just close everything right now. Send
no message to the remote node - just end end end. */
Modified: sofaswitch/trunk/callflow/src/dnd.h
==============================================================================
--- sofaswitch/trunk/callflow/src/dnd.h (original)
+++ sofaswitch/trunk/callflow/src/dnd.h Thu Mar 27 22:11:53 2008
@@ -132,7 +132,7 @@
the list of type "MyExtendedShapes"*/
bool LinksToShape();
- /**Report TRUE if this point is linked to two other shapes */
+ /**Report true if this point is linked to two other shapes */
bool MultipleLinks();
/**Report the distance from the supplied point to this point */
@@ -252,7 +252,7 @@
rounding is done, false is returned. */
bool GravityPoint(wxPoint & srcPoint);
- /**Go through this list of points. report TRUE if any of them is linked
+ /**Go through this list of points. report true if any of them is linked
twice. This method is used to test for when an output pint is linked
to two other nodes */
bool OneToMany();
@@ -376,11 +376,11 @@
across the canvas */
virtual void AdjustPosition(wxPoint &moveSize);
- /**Return TRUE if any part of this shape is inside the supplied
+ /**Return true if any part of this shape is inside the supplied
rectangle */
virtual bool Intersects(const wxRect & testRectangle) const;
- /**Return TRUE if the specified point is inside this particular shape */
+ /**Return true if the specified point is inside this particular shape */
virtual bool Intersects(const wxPoint & testPoint) const;
/**Set the flag to indicate this shape as having been selected by
Modified: sofaswitch/trunk/callflow/src/joinblocks.h
==============================================================================
--- sofaswitch/trunk/callflow/src/joinblocks.h (original)
+++ sofaswitch/trunk/callflow/src/joinblocks.h Thu Mar 27 22:11:53 2008
@@ -62,11 +62,11 @@
empty, return false. */
bool GetLastPoint(wxPoint & coord);
- /**Return TRUE if any part of this shape is inside the supplied
+ /**Return true if any part of this shape is inside the supplied
rectangle */
virtual bool Intersects(const wxRect & testRectangle) const;
- /**Return TRUE if the specified point is inside this particular shape */
+ /**Return true if the specified point is inside this particular shape */
virtual bool Intersects(const wxPoint & testPoint) const;
/**Write the code generic to this shape */
Added: sofaswitch/trunk/configure.ac
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/configure.ac Thu Mar 27 22:11:53 2008
@@ -0,0 +1,162 @@
+dnl ########################################################################
+dnl SOFA configuration
+dnl
+dnl $Revision: 19674 $
+dnl $Author: dsandras $
+dnl $Date: 2008-03-06 09:37:40 +1300 (Thu, 06 Mar 2008) $
+dnl
+
+AC_INIT()
+dnl Was Ac_INIT(include/opal/manager.h)
+
+AC_PROG_CC
+AC_PROG_CXX
+
+
+dnl this must be updated for every minor revision, and for
+dnl builds when and as necessary
+REQUIRED_PTLIB_MAJOR=2
+REQUIRED_PTLIB_MINOR=0
+REQUIRED_PTLIB_BUILD=0
+
+dnl ########################################################################
+dnl set the OPAL directory to the current directory
+
+SOFADIR=`pwd`
+AC_SUBST(SOFADIR)
+
+dnl ########################################################################
+dnl set the PREFIX accordingly
+if test "x$prefix" = "xNONE"; then
+ INSTALLPREFIX="/usr/local"
+else
+ INSTALLPREFIX="${prefix}"
+fi
+
+AC_SUBST(INSTALLPREFIX)
+
+dnl ########################################################################
+dnl set LIBDIR accordingly
+LIBDIR="${libdir}"
+
+AC_SUBST(LIBDIR)
+
+dnl ########################################################################
+dnl extract the OPAL version
+
+dnl MSWIN_DISPLAY version,Version
+dnl MSWIN_VERSION version,OPAL_MAJOR=MAJOR_VERSION
+dnl MSWIN_VERSION version,OPAL_MINOR=MINOR_VERSION
+dnl MSWIN_VERSION version,OPAL_BUILD=BUILD_NUMBER
+dnl MSWIN_VERSION version,OPAL_VERSION=VERSION
+
+MAJOR_VERSION=`cat ${OPALDIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' '`
+MINOR_VERSION=`cat ${OPALDIR}/version.h | grep MINOR_VERSION | cut -f3 -d' '`
+BUILD_NUMBER=`cat ${OPALDIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' '`
+OPAL_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_NUMBER}"
+BUILD_TYPE=`cat ${OPALDIR}/version.h | grep BUILD_TYPE | cut -f 3 -d ' ' | sed 's/BetaCode/-beta/' | sed 's/AlphaCode/-alpha/' | sed 's/ReleaseCode/\./'`
+
+AC_DEFINE_UNQUOTED(OPAL_MAJOR, ${MAJOR_VERSION})
+AC_DEFINE_UNQUOTED(OPAL_MINOR, ${MINOR_VERSION})
+AC_DEFINE_UNQUOTED(OPAL_BUILD, ${BUILD_NUMBER})
+AC_DEFINE_UNQUOTED(OPAL_VERSION, "$OPAL_VERSION")
+
+AC_MSG_NOTICE(Opal version is ${OPAL_VERSION});
+
+#use to set the version in opal.pc
+AC_SUBST(OPAL_VERSION)
+AC_SUBST(BUILD_TYPE)
+
+dnl ########################################################################
+dnl look for ptlib, use a preference order of explicit PTLIBDIR, directory
+dnl at same level, home directory, /usr/local or /usr.
+
+if test "${PTLIBDIR:-unset}" = "unset" -a "${PWLIBDIR:-unset}" != "unset" ; then
+ PTLIBDIR=$PWLIBDIR
+fi
+if test "${PTLIBDIR:-unset}" = "unset" -o ! -r "${PTLIBDIR}/version.h"; then
+ if test -r "${PTLIBDIR}/include/ptlib.h"; then
+ AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , ${PTLIBDIR}/bin)
+ elif test -r "${OPALDIR}/../ptlib/version.h"; then
+ PTLIBDIR="${OPALDIR}/../ptlib"
+ elif test -r "${HOME}/ptlib/include/ptlib.h"; then
+ PTLIBDIR="${HOME}/ptlib"
+ elif test -r /usr/local/include/ptlib.h; then
+ AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/bin)
+ elif test -r /usr/include/ptlib.h; then
+ AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/share/ptlib/make/)
+ elif test -r "${prefix}/include/ptlib.h"; then
+ AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , ${prefix}/bin)
+ elif test -r "$/home/derek/opalvoip/ptlib/include/ptlib.h"; then
+ AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , ${prefix}/bin)
+ else
+ AC_MSG_ERROR("Cannot find PTLib - please install or set PTLIBDIR and try again")
+ fi
+fi
+
+if test "${PTLIBDIR:-unset}" = "unset" ; then
+ if test "${PTLIB_CONFIG:-unset}" = "unset" ; then
+ AC_MSG_ERROR("Cannot find ptlib-config - please install and try again")
+ fi
+ PTLIBDIR=`$PTLIB_CONFIG --prefix`
+fi
+
+if test -d "${PTLIBDIR}/share/ptlib/"; then
+ PTLIBDIR="${PTLIBDIR}/share/ptlib/"
+fi
+AC_SUBST(PTLIBDIR)
+
+echo "PTLib prefix set to.... $PTLIBDIR"
+
+if test "${PTLIBDIR:-unset}" = "unset" ; then
+ PWVERSION=`$PTLIB_CONFIG --version`
+ PW_MAJOR_VERSION=`echo $PW_VERSION | cut -d'.' -f1`
+ PW_MINOR_VERSION=`echo $PW_VERSION | cut -d'.' -f2`
+ PW_BUILD_NUMBER=`echo $PW_VERSION | cut -d'.' -f3`
+
+else
+ PW_MAJOR_VERSION=`cat ${PTLIBDIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' '`
+ PW_MINOR_VERSION=`cat ${PTLIBDIR}/version.h | grep MINOR_VERSION | cut -f3 -d' '`
+ PW_BUILD_NUMBER=`cat ${PTLIBDIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' '`
+ PWVERSION="${PW_MAJOR_VERSION}.${PW_MINOR_VERSION}.${PW_BUILD_NUMBER}"
+fi
+
+AC_ARG_ENABLE(versioncheck,
+ [ --disable-versioncheck disable PTLib version check],
+ PTLIB_VERSION_CHECK=$enableval)
+
+AC_MSG_CHECKING(Checking PTLib version ${PWVERSION})
+if test "${PTLIB_VERSION_CHECK}x" = "nox" ; then
+ AC_MSG_RESULT(check disabled)
+else
+ if test $PW_MAJOR_VERSION -lt $REQUIRED_PTLIB_MAJOR ; then
+ AC_MSG_ERROR(Major version less than required $REQUIRED_PTLIB_MAJOR)
+ fi
+ if test $PW_MINOR_VERSION -lt $REQUIRED_PTLIB_MINOR ; then
+ AC_MSG_ERROR(Minor version less than required $REQUIRED_PTLIB_MINOR)
+ fi
+ if test $PW_BUILD_NUMBER -lt $REQUIRED_PTLIB_BUILD ; then
+ AC_MSG_ERROR(Build version less than required $REQUIRED_PTLIB_BUILD)
+ fi
+ AC_MSG_RESULT(ok)
+fi
+
+AC_SUBST(PTLIBDIR)
+
+dnl ########################################################################
+dnl output make directives
+
+AC_SUBST(STDCCFLAGS)
+AC_SUBST(LDFLAGS)
+AC_SUBST(ENDLDLIBS)
+AC_PROG_INSTALL
+
+
+dnl ########################################################################
+dnl output header file
+
+AC_CONFIG_FILES(sofa_inc.mak)
+AC_CONFIG_FILES(Makefile)
+
+AC_OUTPUT()
+
Modified: sofaswitch/trunk/console/main.h
==============================================================================
--- sofaswitch/trunk/console/main.h (original)
+++ sofaswitch/trunk/console/main.h Thu Mar 27 22:11:53 2008
@@ -35,7 +35,7 @@
LaunchNewId & lid;
- BOOL keepGoing;
+ bool keepGoing;
PSyncPoint delay;
@@ -50,7 +50,7 @@
public:
UserInterface(LaunchNewId &_lid)
: PThread(1000, NoAutoDeleteThread), lid(_lid)
- { endNow = FALSE; Resume(); }
+ { endNow = false; Resume(); }
void Main();
@@ -65,7 +65,7 @@
PTime startTime;
- BOOL endNow;
+ bool endNow;
};
////////////////////////////////////////////////////////////////////////////////
Added: sofaswitch/trunk/install-sh
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/install-sh Thu Mar 27 22:11:53 2008
@@ -0,0 +1,295 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2003-09-24.23
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=
+transform_arg=
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+
+usage="Usage: $0 [OPTION]... SRCFILE DSTFILE
+ or: $0 -d DIR1 DIR2...
+
+In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
+In the second, create the directory path DIR.
+
+Options:
+-b=TRANSFORMBASENAME
+-c copy source (using $cpprog) instead of moving (using $mvprog).
+-d create directories instead of installing files.
+-g GROUP $chgrp installed files to GROUP.
+-m MODE $chmod installed files to MODE.
+-o USER $chown installed files to USER.
+-s strip installed files (using $stripprog).
+-t=TRANSFORM
+--help display this help and exit.
+--version display version info and exit.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+ case $1 in
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ -c) instcmd=$cpprog
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ --help) echo "$usage"; exit 0;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ --version) echo "$0 $scriptversion"; exit 0;;
+
+ *) if test -z "$src"; then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if test -z "$src"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+fi
+
+# Protect names starting with `-'.
+case $src in
+ -*) src=./$src ;;
+esac
+
+if test -n "$dir_arg"; then
+ dst=$src
+ src=
+
+ if test -d "$dst"; then
+ instcmd=:
+ chmodcmd=
+ else
+ instcmd=$mkdirprog
+ fi
+else
+ # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst ;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ dst=$dst/`basename "$src"`
+ fi
+fi
+
+# This sed command emulates the dirname command.
+dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+
+# Skip lots of stat calls in the usual case.
+if test ! -d "$dstdir"; then
+ defaultIFS='
+ '
+ IFS="${IFS-$defaultIFS}"
+
+ oIFS=$IFS
+ # Some sh's can't handle IFS=/ for some reason.
+ IFS='%'
+ set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+ IFS=$oIFS
+
+ pathcomp=
+
+ while test $# -ne 0 ; do
+ pathcomp=$pathcomp$1
+ shift
+ test -d "$pathcomp" || $mkdirprog "$pathcomp"
+ pathcomp=$pathcomp/
+ done
+fi
+
+if test -n "$dir_arg"; then
+ $doit $instcmd "$dst" \
+ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+else
+ # If we're going to rename the final executable, determine the name now.
+ if test -z "$transformarg"; then
+ dstfile=`basename "$dst"`
+ else
+ dstfile=`basename "$dst" $transformbasename \
+ | sed $transformarg`$transformbasename
+ fi
+
+ # don't allow the sed command to completely eliminate the filename.
+ test -z "$dstfile" && dstfile=`basename "$dst"`
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Move or copy the file name to the temp name
+ $doit $instcmd "$src" "$dsttmp" &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $instcmd $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+ # Now remove or move aside any old file at destination location. We
+ # try this two ways since rm can't unlink itself on some systems and
+ # the destination file might be busy for other reasons. In this case,
+ # the final cleanup might fail but the new file should still install
+ # successfully.
+ {
+ if test -f "$dstdir/$dstfile"; then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+ || {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit
+ }
+ else
+ :
+ fi
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+fi &&
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+ (exit 0); exit
+}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
Modified: sofaswitch/trunk/mcu/audio.h
==============================================================================
--- sofaswitch/trunk/mcu/audio.h (original)
+++ sofaswitch/trunk/mcu/audio.h Thu Mar 27 22:11:53 2008
@@ -52,13 +52,13 @@
public:
/**Constructor, given the socket and device name that comms happen over */
- AudioBase(BOOL isReadDir);
+ AudioBase(bool isReadDir);
/**Assign the initial values*/
void Initialise(Manager * _mgr, PUDPSocket *_socket, PString _memberId);
/**Report if this thread has been initialised*/
- BOOL IsInitialised();
+ bool IsInitialised();
/**Destructor */
virtual ~AudioBase();
@@ -78,13 +78,13 @@
/**Flag to indicate we have to keep going, and is used when
terminating this thread */
- BOOL keepGoing;
+ bool keepGoing;
/** A count of the number of packets that have passed by */
PINDEX countPackets;
/**The particular direction of this class. */
- BOOL isReadDir;
+ bool isReadDir;
/**The descriptive label of this direction */
PString dirString;
Modified: sofaswitch/trunk/mcu/comms.h
==============================================================================
--- sofaswitch/trunk/mcu/comms.h (original)
+++ sofaswitch/trunk/mcu/comms.h Thu Mar 27 22:11:53 2008
@@ -142,15 +142,15 @@
incoming call, so we act as required and reply accordingly*/
virtual void ProcessAnswer(PStringArray &cmds, PString & sender);
- /**Send this dtmf string to the remote node. Returns TRUE on
- success, FALSE on failure. */
- virtual BOOL SendDtmf(const PString & dtmfVals);
+ /**Send this dtmf string to the remote node. Returns true on
+ success, false on failure. */
+ virtual bool SendDtmf(const PString & dtmfVals);
/**Some MessageFrame instances do not obey the hangup command.
This virtual method says we can hangup, cause we are one
channel of a conference call. This instance of the comms
should close on receiving a hangup */
- virtual BOOL OkToHangup() { return TRUE; }
+ virtual bool OkToHangup() { return true; }
/**Reference back to the most important class of all */
Manager & manager;
@@ -174,7 +174,7 @@
AudioWrite audioWriteThread;
/**Flag to indicate if the medis streams are running */
- BOOL mediaStreamsStarted;
+ bool mediaStreamsStarted;
//@}
};
Modified: sofaswitch/trunk/mcu/manager.h
==============================================================================
--- sofaswitch/trunk/mcu/manager.h (original)
+++ sofaswitch/trunk/mcu/manager.h Thu Mar 27 22:11:53 2008
@@ -91,7 +91,7 @@
/**Return the send to address that is stored in this class instance*/
- BOOL GetSendToAddress(const PString &McuToken, PIPSocket::Address & address, PINDEX & portNo);
+ bool GetSendToAddress(const PString &McuToken, PIPSocket::Address & address, PINDEX & portNo);
/**Return a reference to the pyython launcher for this program */
LaunchNewId & GetLaunchNewId() { return lid; }
@@ -125,7 +125,7 @@
/**Wait (up to 1 second) to see if the supervisor is installed and
connected OK. */
- BOOL WaitUntilSupervisorOk();
+ bool WaitUntilSupervisorOk();
/**Get the supervisor to start processing messages */
void StartSupervisor();
Modified: sofaswitch/trunk/mcu/member.h
==============================================================================
--- sofaswitch/trunk/mcu/member.h (original)
+++ sofaswitch/trunk/mcu/member.h Thu Mar 27 22:11:53 2008
@@ -128,9 +128,9 @@
The other Member who has called this method, keeps track of how far
through the buffer he is, via the the currentReadIndex variable.
- If this method returns FALSE/TRUE, depending on if this member is
+ If this method returns false/true, depending on if this member is
still alive and active..*/
- BOOL ReadAndMixAudio(BYTE * ptr, PINDEX amount, PINDEX & currentReadIndex);
+ bool ReadAndMixAudio(BYTE * ptr, PINDEX amount, PINDEX & currentReadIndex);
/**Get information about how long this member has been created for */
PString GetDurationInfo();
@@ -168,7 +168,7 @@
#endif
/**Flag to indicate we are still active and running in this room */
- BOOL keepGoing;
+ bool keepGoing;
/**The id of the conference room we are joined to */
PString roomId;
@@ -224,7 +224,7 @@
PMutex clearMutex;
/**Flag to indicate we are being cleared, or have been cleared */
- BOOL isClearing;
+ bool isClearing;
Modified: sofaswitch/trunk/mcu/participant.h
==============================================================================
--- sofaswitch/trunk/mcu/participant.h (original)
+++ sofaswitch/trunk/mcu/participant.h Thu Mar 27 22:11:53 2008
@@ -109,7 +109,7 @@
dictionary does not appear to be shutting down on its own accord.
*/
- void EmptyParticipantDict(BOOL doForce = FALSE);
+ void EmptyParticipantDict(bool doForce = false);
/**Wait for this class to go totally empty, with zero entries in it. */
void WaitForTotallyEmpty();
@@ -139,7 +139,7 @@
/**Flag to indicate we are closing this participant dictionary, so prevent t
he
adding of more members to this dictionary */
- BOOL shuttingDown;
+ bool shuttingDown;
/**The flag used to time the tests of the garbage collector, and to signal
* its demise */
@@ -213,7 +213,7 @@
return value indicates if the associated memmber is still alive
and active */
- BOOL ReadAndMixAudio(BYTE * ptr, PINDEX amount);
+ bool ReadAndMixAudio(BYTE * ptr, PINDEX amount);
/**Get the id used by the Member class that this Participant is held by */
PString GetSrcMemberId() { return srcMemberId; }
@@ -323,7 +323,7 @@
/**Flag to indicate we are being cleared, or have been cleared. Thus, if
two threads call Clear at the same time, only one thread is created to
do the clearing. */
- BOOL isClearing;
+ bool isClearing;
};
Modified: sofaswitch/trunk/mcu/supervisor.h
==============================================================================
--- sofaswitch/trunk/mcu/supervisor.h (original)
+++ sofaswitch/trunk/mcu/supervisor.h Thu Mar 27 22:11:53 2008
@@ -97,7 +97,7 @@
/**Some MessageFrame instances do not have the permission to quit
now. This virtual method determines if this instance is permitted to
exit the program. This supervisor has permision to end all. */
- virtual BOOL OkToQuitNow() { return TRUE; }
+ virtual bool OkToQuitNow() { return true; }
/**We have a comms error, so just close everything right now. Send
no message to the remote node - just end end end. */
Modified: sofaswitch/trunk/server/main.h
==============================================================================
--- sofaswitch/trunk/server/main.h (original)
+++ sofaswitch/trunk/server/main.h Thu Mar 27 22:11:53 2008
@@ -58,7 +58,7 @@
void StartRunning();
/**Managing thread is alive */
- BOOL IsRunning();
+ bool IsRunning();
/**Pretty print this connection */
void PrintOn(ostream & strm) const;
@@ -114,11 +114,11 @@
node. Instead, these messages are commands to this server. Commands to
this server are processed here.
- return TRUE If the supplied text is a command to this server,
+ return true If the supplied text is a command to this server,
- return FALSE if the supplied text is to be passsed on another node.
+ return false if the supplied text is to be passsed on another node.
(typical case) */
- BOOL ProcessedAsServerCommand(const PString & text);
+ bool ProcessedAsServerCommand(const PString & text);
/**Send the supplied message to the node on this socket */
void SendThisMessage(PBYTEArray & msg);
@@ -185,16 +185,16 @@
PMutex clearMutex;
/**Flag to indicate we are being cleared, or have been cleared */
- BOOL isClearing;
+ bool isClearing;
/**Flag to control if we should write messages read in to the console */
- BOOL reportReadMessages;
+ bool reportReadMessages;
/**Flag to control if we should write messages sent to the console.
This differs to reportReadMessages, cause if there is no matching
destination, nothing will be sent (or printed). This flag allows
you to know if the incoming message was sent out.*/
- BOOL reportSentMessages;
+ bool reportSentMessages;
/**Temporary buffer, which we use to store the current incoming
message. We preallocate it here, so that no work is spent
@@ -275,7 +275,7 @@
PMutex mutexNewTcpConnections;
/**Flag to say end the creation process, which kills the createNewTcpconnections thread */
- BOOL endNow;
+ bool endNow;
};
////////////////////////////////////////////////////////////////////////////////
@@ -332,7 +332,7 @@
void GetListConnectedNodes(PStringArray & nodes);
/**Report if the manager is to continue processing incoming connection requests */
- BOOL KeepRunning() { return keepRunning; }
+ bool KeepRunning() { return keepRunning; }
/**Callback for removing a connection from the list of active
connections */
@@ -388,10 +388,10 @@
TcpConnectionList availableTcpConnections;
/**Flag that specifies that this Manager is to continue processing commands */
- BOOL keepRunning;
+ bool keepRunning;
/**Flag to indicate we are in close down mode */
- BOOL isQuitting;
+ bool isQuitting;
/**Mutex to protect access tothe close down flag */
PMutex quitNowMutex;
@@ -421,10 +421,10 @@
{ return (ServerProcess &)PProcess::Current(); }
/**Report if we should write messages read in to the console */
- BOOL ReportReadMessages() { return reportReadMessages; }
+ bool ReportReadMessages() { return reportReadMessages; }
/**Report if we should messages that we send to the console */
- BOOL ReportSentMessages() { return reportSentMessages; }
+ bool ReportSentMessages() { return reportSentMessages; }
/**Get a reference back to this manager */
Manager & GetManager() { return localManager; }
@@ -435,13 +435,13 @@
Manager localManager;
/**Flag to control if we should write messages read in to the console */
- BOOL reportReadMessages;
+ bool reportReadMessages;
/**Flag to control if we should write messages sent to the console.
This differs to reportReadMessages, cause if there is no matching
destination, nothing will be sent (or printed). This flag allows
you to know if the incoming message was sent out.*/
- BOOL reportSentMessages;
+ bool reportSentMessages;
};
/////////////////////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/sofa/Makefile
==============================================================================
--- sofaswitch/trunk/sofa/Makefile (original)
+++ sofaswitch/trunk/sofa/Makefile Thu Mar 27 22:11:53 2008
@@ -39,7 +39,7 @@
LIBRARY_MAKEFILE:=1
-include $(SOFADIR)/sofa_inc.mak
+include $(SOFADIR)/../sofa_inc.mak
PREFIX=/usr/local/
exec_prefix = ${PREFIX}
Modified: sofaswitch/trunk/sofa/include/sofa/messages.h
==============================================================================
--- sofaswitch/trunk/sofa/include/sofa/messages.h (original)
+++ sofaswitch/trunk/sofa/include/sofa/messages.h Thu Mar 27 22:11:53 2008
@@ -65,9 +65,9 @@
/**Wait until the messaging subsystem reports it is
initialised. Wait no more than 1 second. If not initialised,
- return FALSE. return TRUE immediately on discovering we are
+ return false. return true immediately on discovering we are
initialised */
- BOOL WaitUntilInitialised();
+ bool WaitUntilInitialised();
/**Multiple flavours of sending messages, which send a message to
the remote node */
@@ -124,9 +124,9 @@
/**Report the name of the remote controller.*/
PString GetRemoteController() { return remoteController; }
- /**Report TRUE/FALSE if this message frame instance is in the
+ /**Report true/false if this message frame instance is in the
process of closing down */
- BOOL IsTerminating() { return !keepGoing; }
+ bool IsTerminating() { return !keepGoing; }
protected:
@@ -258,50 +258,50 @@
file*/
virtual void SetReadFile(const PString & newReadFile);
- /**Send this dtmf string to the remote node. Returns TRUE on
- success, FALSE on failure.
+ /**Send this dtmf string to the remote node. Returns true on
+ success, false on failure.
An application will override this method, to actually do the work of
sending. */
- virtual BOOL SendDtmf(const PString & dtmfVals);
+ virtual bool SendDtmf(const PString & dtmfVals);
/**Report the first address in the interface table that is not a loop
back entry. Grab also the address the internal socket.
- Return values are:: FALSE if it fails, TRUE on success. */
- BOOL GetLocalAddress(PIPSocket::Address & addr, PINDEX &portNo);
+ Return values are:: false if it fails, true on success. */
+ bool GetLocalAddress(PIPSocket::Address & addr, PINDEX &portNo);
/**The overrirde of this class will define this function, which is used by
several of the message processing functions.
Get the address of this socket, which receives data.*/
- virtual BOOL QueryLocalAddress(PIPSocket::Address & addr, PINDEX & portNo);
+ virtual bool QueryLocalAddress(PIPSocket::Address & addr, PINDEX & portNo);
/**The overrirde of this class will define this function, which is used by
several of the message processing functions.
Get the address that we are currently sending data to */
- virtual BOOL QuerySendToAddress(PIPSocket::Address & addr,
+ virtual bool QuerySendToAddress(PIPSocket::Address & addr,
PINDEX & portNo);
/**The overrirde of this class will define this function, which is used by
several of the message processing functions.
Set the address that we are currently sending data to */
- virtual BOOL SetSendToAddress(PIPSocket::Address & addr, PINDEX & portNo);
+ virtual bool SetSendToAddress(PIPSocket::Address & addr, PINDEX & portNo);
/**Report the address and port we are sending udp data to */
- BOOL GetSendToAddress(PIPSocket::Address & addr, PINDEX & port);
+ bool GetSendToAddress(PIPSocket::Address & addr, PINDEX & port);
/**Some MessageFrame instances do not have the permission to quit
now. This virtual method determines if this instance is permitted to
exit the program */
- virtual BOOL OkToQuitNow() { return FALSE; }
+ virtual bool OkToQuitNow() { return false; }
/**Some MessageFrame instances do not obey the hangup command. This
virtual method determines if this command has meaning, and if this
instance of the comms should close on receiving a hangup */
- virtual BOOL OkToHangup() { return FALSE; }
+ virtual bool OkToHangup() { return false; }
/**We have a comms error, so just close everything right now. Send
no message to the remote node - just end end end. */
@@ -372,7 +372,7 @@
/**Flag to indicate it is time to end this thread. It is only set by
the MessageFrame::Terminate() method */
- BOOL keepGoing;
+ bool keepGoing;
};
////////////////////////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/sofa/include/sofa/messlist.h
==============================================================================
--- sofaswitch/trunk/sofa/include/sofa/messlist.h (original)
+++ sofaswitch/trunk/sofa/include/sofa/messlist.h Thu Mar 27 22:11:53 2008
@@ -63,8 +63,8 @@
void AddRequest(PString & newString /*!<String to add to the list. */
);
- /**Remove the last request from this list, in a thread safe fashion. Return TRUE if succesfull*/
- BOOL GetRequest(PString & nextString /*!< resultant string. */
+ /**Remove the last request from this list, in a thread safe fashion. Return true if succesfull*/
+ bool GetRequest(PString & nextString /*!< resultant string. */
);
//@}
@@ -103,7 +103,7 @@
virtual void AddNewMessageFrame(MessageFrame *src);
/**True if this frame list is empty*/
- BOOL Empty() { return GetSize() == 0; }
+ bool Empty() { return GetSize() == 0; }
/**Return the first available MessageFrame structure, which will
have any ID. Repeated calls to this will empty this list.
@@ -193,7 +193,7 @@
PSyncPoint makeAnother;
/**A flag to indicate it is time to end this thread */
- BOOL keepGoing;
+ bool keepGoing;
/**Reference to the LaunchNewId class, which is required for building
Comms classes */
@@ -253,7 +253,7 @@
PSyncPoint removeAnother;
/**A flag to indicate it is time to end this thread */
- BOOL keepGoing;
+ bool keepGoing;
/**The time (in ms) that this list is checked for old/dead frames */
PINDEX delayPurgePeriod;
Added: sofaswitch/trunk/sofa_inc.mak.in
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/sofa_inc.mak.in Thu Mar 27 22:11:53 2008
@@ -0,0 +1,86 @@
+#
+# sofa_inc.mak
+#
+# Make symbols include file for SofaSwitch
+#
+# Copyright (c) 2001 Equivalence Pty. Ltd.
+#
+# The contents of this file are subject to the Mozilla Public License
+# Version 1.0 (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 Open Phone Abstraction library.
+#
+# The Initial Developer of the Original Code is Equivalence Pty. Ltd.
+#
+# Contributor(s): ______________________________________.
+#
+# $Revision: 19674 $
+# $Author: dsandras $
+# $Date: 2008-03-06 09:37:40 +1300 (Thu, 06 Mar 2008) $
+#
+
+SOFADIR=@SOFADIR@
+PTLIBDIR=@PTLIBDIR@
+
+LIBDIRS += $(SOFADIR)
+
+ifdef LIBRARY_MAKEFILE
+include $(PTLIBDIR)/make/unix.mak
+else
+ifdef NOTRACE
+OBJDIR_SUFFIX := n
+endif
+include $(PTLIBDIR)/make/ptlib.mak
+endif
+
+SOFA_SRCDIR = $(SOFADIR)/sofa/src
+SOFA_INCDIR = $(SOFADIR)/sofa/include
+SOFA_LIBDIR = $(SOFADIR)/sofa/lib
+
+
+ifdef NOTRACE
+STDCCFLAGS += -DPASN_NOPRINTON -DPASN_LEANANDMEAN
+OPAL_SUFFIX = n
+else
+STDCCFLAGS += -DPTRACING
+RCFLAGS += -DPTRACING
+OPAL_SUFFIX = $(OBJ_SUFFIX)
+endif
+
+
+SOFA_BASE = sofa_$(PLATFORM_TYPE)_$(SOFA_SUFFIX)
+SOFA_FILE = lib$(SOFA_BASE)$(LIB_TYPE).$(LIB_SUFFIX)
+
+LDFLAGS += -L$(SOFA_LIBDIR)
+LDLIBS := -l$(SOFA_BASE)$(LIB_TYPE) $(LDLIBS)
+
+STDCCFLAGS += -I$(SOFA_INCDIR)
+
+
+$(TARGET) : $(SOFA_LIBDIR)/$(SOFA_FILE)
+
+ifndef LIBRARY_MAKEFILE
+
+ifdef DEBUG
+$(SOFA_LIBDIR)/$(SOFA_FILE):
+ $(MAKE) -C $(SOFADIR) debug
+else
+$(SOFA_LIBDIR)/$(SOFA_FILE):
+ $(MAKE) -C $(SOFADIR) opt
+endif
+
+libs :: $(SOFA_LIBDIR)/$(SOFA_FILE)
+
+
+endif
+
+
+# End of file
+
Modified: sofaswitch/trunk/sound/audio.h
==============================================================================
--- sofaswitch/trunk/sound/audio.h (original)
+++ sofaswitch/trunk/sound/audio.h Thu Mar 27 22:11:53 2008
@@ -62,7 +62,7 @@
/**Flag to indicate we have to keep going, and is used when
terminating this thread */
- BOOL keepGoing;
+ bool keepGoing;
/** A count of the number of packets that have passed by */
PINDEX countPackets;
Modified: sofaswitch/trunk/sound/comms.h
==============================================================================
--- sofaswitch/trunk/sound/comms.h (original)
+++ sofaswitch/trunk/sound/comms.h Thu Mar 27 22:11:53 2008
@@ -68,10 +68,10 @@
virtual void WaitForTermination();
/**Report if we were stopped by hangup */
- BOOL StoppedByHangup() { return stopByHangup; }
+ bool StoppedByHangup() { return stopByHangup; }
/**Report if we were stopped by a shutdown request */
- BOOL StoppedByExit() { return stopByExit; }
+ bool StoppedByExit() { return stopByExit; }
/**Get the information that is replied when a status query happens. There
are two sources of a status query - the remote controller or the
@@ -81,20 +81,20 @@
/**Raise the volume for the specified sound device. Return a
string describing the new volume */
PString RaiseVolume(PSoundChannel::Directions dir)
- { return AlterVolume(dir, TRUE); }
+ { return AlterVolume(dir, true); }
/**Lower the volume for the specified sound device. Return a
string describing the new volume */
PString LowerVolume(PSoundChannel::Directions dir)
- { return AlterVolume(dir, FALSE); }
+ { return AlterVolume(dir, false); }
protected:
/**Increase or decrease the volume on the specified device */
- PString AlterVolume(PSoundChannel::Directions dir, BOOL doRaise);
+ PString AlterVolume(PSoundChannel::Directions dir, bool doRaise);
/**We have a DTMF string from our current master. Display this DTMF on the console.
- We always return TRUE, cause we can always do this right. */
- virtual BOOL SendDtmf(const PString & dtmfVals);
+ We always return true, cause we can always do this right. */
+ virtual bool SendDtmf(const PString & dtmfVals);
/**we have received a command asking us to provide the id of a new
communications nodes, that will be controlled only by the remote
@@ -138,7 +138,7 @@
/**Some MessageFrame instances do not have the permission to quit
now. This virtual method determines if this instance is permitted to
exit the program. This supervisor has permision to end all. */
- virtual BOOL OkToQuitNow() { return TRUE; }
+ virtual bool OkToQuitNow() { return true; }
/**We have a comms error, so just close everything right now. Send
no message to the remote node - just end end end. */
@@ -154,10 +154,10 @@
//@}
/**The terminating condition was */
- BOOL stopByHangup;
+ bool stopByHangup;
/**The terminating condition was */
- BOOL stopByExit;
+ bool stopByExit;
};
#endif
Modified: sofaswitch/trunk/sound/main.h
==============================================================================
--- sofaswitch/trunk/sound/main.h (original)
+++ sofaswitch/trunk/sound/main.h Thu Mar 27 22:11:53 2008
@@ -54,7 +54,7 @@
PSoundChannel & recorder;
/**Variable used to indicate it is time to finish */
- BOOL endNow;
+ bool endNow;
};
/////////////////////////////////////////////////////////////////////////////
@@ -89,7 +89,7 @@
PString devName;
/**Open the sound device before we use it, and leave it open */
- BOOL OpenSoundDevice(PSoundChannel &device, PSoundChannel::Directions dir);
+ bool OpenSoundDevice(PSoundChannel &device, PSoundChannel::Directions dir);
/**Device for recording audio */
PSoundChannel soundRecorder;
Modified: sofaswitch/trunk/voip/comms.h
==============================================================================
--- sofaswitch/trunk/voip/comms.h (original)
+++ sofaswitch/trunk/voip/comms.h Thu Mar 27 22:11:53 2008
@@ -146,13 +146,13 @@
incoming call, so we act as required and reply accordingly*/
virtual void ProcessAnswer(PStringArray &cmds, PString & sender);
- /**Send this dtmf string to the remote node. Returns TRUE on
- success, FALSE on failure. */
- virtual BOOL SendDtmf(const PString & dtmfVals);
+ /**Send this dtmf string to the remote node. Returns true on
+ success, false on failure. */
+ virtual bool SendDtmf(const PString & dtmfVals);
/**Some MessageFrame instances do not obey the hangup command. This
Comms structure lives or dies on the hangup command */
- virtual BOOL OkToHangup() { return TRUE; }
+ virtual bool OkToHangup() { return true; }
/**We have a comms error, so just close everything right now. Send
no message to the remote node - just end end end. */
Modified: sofaswitch/trunk/voip/jocall.h
==============================================================================
--- sofaswitch/trunk/voip/jocall.h (original)
+++ sofaswitch/trunk/voip/jocall.h Thu Mar 27 22:11:53 2008
@@ -84,7 +84,7 @@
The default behaviour is to call SetUpConnection() on all the other
connections in the call.
*/
- virtual BOOL OnSetUp(
+ virtual bool OnSetUp(
OpalConnection & connection /// Connection that indicates it is alerting
);
@@ -93,7 +93,7 @@
The default behaviour is to call SetAlerting() on all the other
connections in the call.
*/
- virtual BOOL OnAlerting(
+ virtual bool OnAlerting(
OpalConnection & connection /// Connection that indicates it is alerting
);
@@ -102,14 +102,14 @@
is the endpoint received acknowledgement via whatever protocol it uses
that the connection may now start media streams.
*/
- virtual BOOL OnConnected(
+ virtual bool OnConnected(
OpalConnection & connection /// Connection that indicates it is alerting
);
/**This indicates that a connection to an endpoint was connected and that
media streams are opened.
*/
- virtual BOOL OnEstablished(
+ virtual bool OnEstablished(
OpalConnection & connection /// Connection that indicates it is alerting
);
@@ -143,7 +143,7 @@
call. This will move the status of the incoming call to
connecting/releasing
*/
- void AcceptThisCall(BOOL doAccept ///<True to indicate we accept the call.
+ void AcceptThisCall(bool doAccept ///<True to indicate we accept the call.
);
/**Send a request to the remote controller, asking them if we can answer
@@ -198,11 +198,11 @@
/**Flag to indicate we have advised the controller that this call is
established. In other words, only tell the remote controller once
that we have been established.*/
- BOOL sentEstablishedMessage;
+ bool sentEstablishedMessage;
/**Simple short lived flag which is used so the thread (which answers the
call) can correctly answer yes/no */
- BOOL acceptingThisCall;
+ bool acceptingThisCall;
};
Modified: sofaswitch/trunk/voip/mymanager.h
==============================================================================
--- sofaswitch/trunk/voip/mymanager.h (original)
+++ sofaswitch/trunk/voip/mymanager.h Thu Mar 27 22:11:53 2008
@@ -75,7 +75,7 @@
void EndEverything();
/**Given the command line args, set this class up */
- BOOL Initialise(PArgList & args);
+ bool Initialise(PArgList & args);
/**Where we sit, while waiting for commands & events */
void Main(PArgList & args);
@@ -84,12 +84,12 @@
This function is used for an application to control the answering of
incoming calls.
- If TRUE is returned then the connection continues. If FALSE then the
+ If true is returned then the connection continues. If false then the
connection is aborted.
Note this function should not block for any length of time.
*/
- virtual BOOL OnIncomingConnection(
+ virtual bool OnIncomingConnection(
OpalConnection & connection, ///< Connection that is calling
unsigned options, ///< options for new connection
OpalConnection::StringOptions * stringOptions
@@ -106,7 +106,7 @@
);
/**Create a new media stream for them to use */
- virtual BOOL OnOpenMediaStream(
+ virtual bool OnOpenMediaStream(
OpalConnection & connection, /// Connection that owns the media stream
OpalMediaStream & stream /// New media stream being opened
);
@@ -186,13 +186,13 @@
The default action is to accept this call.
If the doAccept arguement is false, the call is rejected.*/
- void AcceptThisCall(const PString & uniqueCallId, BOOL doAccept = TRUE);
+ void AcceptThisCall(const PString & uniqueCallId, bool doAccept = true);
/**Advise the manager to reject this call, which has a particular callId */
void RejectThisCall(const PString & uniqueCallId);
/**Request manager to send the supplied dtmf string to the remote endpoint */
- BOOL SendThisDtmf(const PString & token, const PString & dtmfValue);
+ bool SendThisDtmf(const PString & token, const PString & dtmfValue);
/**Return a reference to the pyython launcher for this program */
Modified: sofaswitch/trunk/voip/supervisor.h
==============================================================================
--- sofaswitch/trunk/voip/supervisor.h (original)
+++ sofaswitch/trunk/voip/supervisor.h Thu Mar 27 22:11:53 2008
@@ -99,7 +99,7 @@
/**Some MessageFrame instances do not have the permission to quit
now. This virtual method determines if this instance is permitted to
exit the program. This is the supervisor, so we can cause a shutdown. */
- virtual BOOL OkToQuitNow() { return TRUE; }
+ virtual bool OkToQuitNow() { return true; }
/**We have a comms error, so just close everything right now. Send
no message to the remote node - just end end end. */
Modified: sofaswitch/trunk/voip/udpconnection.h
==============================================================================
--- sofaswitch/trunk/voip/udpconnection.h (original)
+++ sofaswitch/trunk/voip/udpconnection.h Thu Mar 27 22:11:53 2008
@@ -77,7 +77,7 @@
The default behaviour does.
*/
- virtual BOOL SetUpConnection();
+ virtual bool SetUpConnection();
/**Indicate to remote endpoint an alert is in progress.
If this is an incoming connection and the AnswerCallResponse is in a
@@ -89,9 +89,9 @@
The default behaviour does nothing.
*/
- virtual BOOL SetAlerting(
+ virtual bool SetAlerting(
const PString & calleeName, /// Name of endpoint being alerted.
- BOOL withMedia /// Open media with alerting
+ bool withMedia /// Open media with alerting
);
/**Called at the end of the call setup process. Audio is happening now */
@@ -101,7 +101,7 @@
The default behaviour does nothing.
*/
- virtual BOOL SetConnected();
+ virtual bool SetConnected();
/**Get the destination address of an incoming connection.
The default behaviour collects a DTMF number terminated with a '#' or
@@ -137,7 +137,7 @@
virtual OpalMediaStream * CreateMediaStream(
const OpalMediaFormat & mediaFormat, /// Media format for stream
unsigned sessionID, /// Session number for stream
- BOOL isSource /// Is a source stream
+ bool isSource /// Is a source stream
);
/**Call back when opening a media stream.
@@ -152,7 +152,7 @@
The default behaviour calls the ancestor and adds a PCM silence
detector filter.
*/
- virtual BOOL OnOpenMediaStream(
+ virtual bool OnOpenMediaStream(
OpalMediaStream & stream /// New media stream being opened
);
@@ -161,7 +161,7 @@
Since this connection goes to the udp audio socket, we take all
user input strings and drop them.
*/
- virtual BOOL SendUserInputString(
+ virtual bool SendUserInputString(
const PString & value /// String value of indication
);
@@ -179,7 +179,7 @@
/**Create an PSoundChannel based media stream.
*/
virtual PSoundChannel * CreateSoundChannel(
- BOOL isSource // Direction for channel
+ bool isSource // Direction for channel
);
/**Release the current connection.
Modified: sofaswitch/trunk/voip/udpep.h
==============================================================================
--- sofaswitch/trunk/voip/udpep.h (original)
+++ sofaswitch/trunk/voip/udpep.h Thu Mar 27 22:11:53 2008
@@ -87,12 +87,12 @@
The proto field is optional when passed to a specific endpoint. If it
is present, however, it must agree with the endpoints protocol name or
- FALSE is returned.
+ false is returned.
This function usually returns almost immediately with the connection
continuing to occur in a new background thread.
- If FALSE is returned then the connection could not be established. For
+ If false is returned then the connection could not be established. For
example if a PSTN endpoint is used and the assiciated line is engaged
then it may return immediately. Returning a non-NULL value does not
mean that the connection will succeed, only that an attempt is being
@@ -100,7 +100,7 @@
The default behaviour is pure.
*/
- virtual BOOL MakeConnection(
+ virtual bool MakeConnection(
OpalCall & call, ///< Owner of connection
const PString & party, ///< Remote party to call
void * userData = NULL, ///< Arbitrary data to pass to connection
@@ -145,7 +145,7 @@
);
/**Call back to get the destination for outgoing call.
- If FALSE is returned the call is aborted.
+ If false is returned the call is aborted.
The default implementation is pure.
*/
@@ -154,36 +154,36 @@
);
/**Call back to indicate that remote is ringing.
- If FALSE is returned the call is aborted.
+ If false is returned the call is aborted.
The default implementation is pure.
*/
- virtual BOOL OnShowIncoming(
+ virtual bool OnShowIncoming(
const OpalUdpSsConnection & connection /// Connection having event
);
/**Accept the incoming connection.
*/
- virtual BOOL AcceptIncomingConnection(
+ virtual bool AcceptIncomingConnection(
const PString & connectionToken /// Token of connection to accept call
);
/**Call back to indicate that remote is ringing.
- If FALSE is returned the call is aborted.
+ If false is returned the call is aborted.
The default implementation is pure.
*/
- virtual BOOL OnShowOutgoing(
+ virtual bool OnShowOutgoing(
const OpalUdpSsConnection & connection /// Connection having event
);
/**Call back to indicate that the remote user has indicated something.
- If FALSE is returned the call is aborted.
+ If false is returned the call is aborted.
The default implementation does nothing.
*/
- virtual BOOL OnShowUserInput(
+ virtual bool OnShowUserInput(
const OpalUdpSsConnection & connection, /// Connection having event
const PString & indication
);
Modified: sofaswitch/trunk/voip/udpsound.h
==============================================================================
--- sofaswitch/trunk/voip/udpsound.h (original)
+++ sofaswitch/trunk/voip/udpsound.h Thu Mar 27 22:11:53 2008
@@ -68,7 +68,7 @@
~AudioDelay();
/**Delay for this many milliseconds */
- BOOL Delay(int time);
+ bool Delay(int time);
/**Restart the iterative counts */
void Restart();
@@ -81,7 +81,7 @@
PTime previousTime;
/**Has this class ever run before */
- BOOL firstTime;
+ bool firstTime;
/** discrepency between required delay time and actual time */
int error;
@@ -95,31 +95,31 @@
public:
/**Constructor */
- UdpSoundChannel(MyOpalCall & myOpalCall, BOOL isSource);
+ UdpSoundChannel(MyOpalCall & myOpalCall, bool isSource);
/**Destructor */
virtual ~UdpSoundChannel();
/**Send audio from the connection to the socket */
- virtual BOOL Write(const void * buffer, PINDEX amount);
+ virtual bool Write(const void * buffer, PINDEX amount);
/**pull audio of the socket */
- virtual BOOL Read(void * buffer, PINDEX amount);
+ virtual bool Read(void * buffer, PINDEX amount);
/**Set the buffer to null, as we have no sound */
void CreateSilence(void * buffer, PINDEX amount);
/**Close the socket down */
- virtual BOOL Close();
+ virtual bool Close();
/**Get the port number used by the socket on this channel */
PINDEX GetPortNumber();
/**Report if the UDPSocket used for comms is open */
- virtual BOOL IsOpen() const;
+ virtual bool IsOpen() const;
/**Open the sound device for use */
- virtual BOOL Open (const PString &device, Directions dir, unsigned numChannels=1, unsigned sampleRate=8000, unsigned bitsPerSample=16);
+ virtual bool Open (const PString &device, Directions dir, unsigned numChannels=1, unsigned sampleRate=8000, unsigned bitsPerSample=16);
/**Set the format for play/record. Note that linear PCM data is the only
one supported at this time.
@@ -128,13 +128,13 @@
by information in the file being played.
@return
- TRUE if the format is valid.
+ true if the format is valid.
*/
- virtual BOOL SetFormat(unsigned /*numChannels = 1*/, /// Number of channels eg mono/stereo
+ virtual bool SetFormat(unsigned /*numChannels = 1*/, /// Number of channels eg mono/stereo
unsigned /*sampleRate = 8000*/, /// Samples per second
unsigned /*bitsPerSample = 16*/ /// Number of bits per sample
)
- { return TRUE; }
+ { return true; }
/// Get the number of channels (mono/stereo) in the sound.
virtual unsigned GetChannels() const
@@ -154,46 +154,46 @@
power of two, so 20000 => 32768.
@return
- TRUE if the sound device is valid for playing/recording.
+ true if the sound device is valid for playing/recording.
*/
- virtual BOOL SetBuffers(
+ virtual bool SetBuffers(
PINDEX size, /// Size of each buffer
PINDEX count = 2 /// Number of buffers
)
- { bufSize = size; bufCount = count; return TRUE; }
+ { bufSize = size; bufCount = count; return true; }
/**Get the internal buffers for the sound channel I/O.
@return
- TRUE if the buffer size were obtained.
+ true if the buffer size were obtained.
*/
- virtual BOOL GetBuffers(
+ virtual bool GetBuffers(
PINDEX & size, // Size of each buffer
PINDEX & count // Number of buffers
)
- { size = bufSize; count = bufCount; return TRUE; }
+ { size = bufSize; count = bufCount; return true; }
/**Set the volume of the play/read process.
The volume range is 0 == quiet. 100 == LOUD.
@return
- TRUE if there were no errors.
+ true if there were no errors.
*/
- virtual BOOL SetVolume(
+ virtual bool SetVolume(
unsigned /*volume*/ /// New volume level
)
- { return TRUE; }
+ { return true; }
/**Get the volume of the play/read process.
The volume range is 0 == quiet. 100 == LOUD.
@return
- TRUE if there were no errors.
+ true if there were no errors.
*/
- virtual BOOL GetVolume(
+ virtual bool GetVolume(
unsigned & volume /// Variable to receive volume level.
)
- { volume = MaxVolume; return TRUE; }
+ { volume = MaxVolume; return true; }
/**Standard stream print function.
@@ -224,7 +224,7 @@
/**Flag to say if we generate data, or receive data */
- BOOL isSource;
+ bool isSource;
/**Interactive the delay */
1
0
[Sofaswitch-svn] [commit] r396 - in sofaswitch/trunk: am console mcu server sofa/src sound voip
by SofaSWITCH SVN 27 Mar '08
by SofaSWITCH SVN 27 Mar '08
27 Mar '08
Author: derek
Date: Thu Mar 27 18:33:08 2008
New Revision: 396
Modified:
sofaswitch/trunk/am/audio.cxx
sofaswitch/trunk/am/comms.cxx
sofaswitch/trunk/am/main.cxx
sofaswitch/trunk/am/manager.cxx
sofaswitch/trunk/console/main.cxx
sofaswitch/trunk/mcu/audio.cxx
sofaswitch/trunk/mcu/comms.cxx
sofaswitch/trunk/mcu/main.cxx
sofaswitch/trunk/mcu/manager.cxx
sofaswitch/trunk/mcu/member.cxx
sofaswitch/trunk/mcu/participant.cxx
sofaswitch/trunk/server/main.cxx
sofaswitch/trunk/sofa/src/messages.cxx
sofaswitch/trunk/sofa/src/messlist.cxx
sofaswitch/trunk/sound/audio.cxx
sofaswitch/trunk/sound/comms.cxx
sofaswitch/trunk/sound/main.cxx
sofaswitch/trunk/voip/comms.cxx
sofaswitch/trunk/voip/jocall.cxx
sofaswitch/trunk/voip/jocall.h
sofaswitch/trunk/voip/main.cxx
sofaswitch/trunk/voip/mymanager.cxx
sofaswitch/trunk/voip/udpconnection.cxx
sofaswitch/trunk/voip/udpep.cxx
sofaswitch/trunk/voip/udpsound.cxx
Log:
Move to the new ptlib/opal layout, with bool, and not BOOL, and true,
(but not TRUE) and false (but not FALSE).
Modified: sofaswitch/trunk/am/audio.cxx
==============================================================================
--- sofaswitch/trunk/am/audio.cxx (original)
+++ sofaswitch/trunk/am/audio.cxx Thu Mar 27 18:33:08 2008
@@ -43,7 +43,7 @@
AudioRead::AudioRead()
:AudioBase("%X Audio reader")
{
- sentEndOfFile = FALSE;
+ sentEndOfFile = false;
PTRACE(3, "Reader\tConstruct thread for reading " );
}
@@ -51,7 +51,7 @@
PUDPSocket *_socket,
PString _fileName)
{
- AudioBase::Initialise(_comms, _socket, _fileName, TRUE);
+ AudioBase::Initialise(_comms, _socket, _fileName, true);
PTRACE(3, "Reader\tInitialise thread for reading " );
}
@@ -61,7 +61,7 @@
data.SetSize(480);
while (socket->IsOpen()) {
- BOOL doThisRead = TRUE;
+ bool doThisRead = true;
PINDEX delayTime = 30; //Default, delay 30ms.
PINDEX lastReadCount = 0;
@@ -70,16 +70,16 @@
EnactFileChange();
if (!audioFile.IsOpen()) {
- doThisRead = FALSE;
+ doThisRead = false;
}
if (doThisRead) {
if (audioFile.GetPosition() > (audioFile.GetDataLength() - 480)) {
- doThisRead = FALSE;
+ doThisRead = false;
if (!sentEndOfFile) {
PTRACE(1, "Send end of file as we hav read the end of this file." << fileName);
comms->SendEndOfFile();
- sentEndOfFile = TRUE;
+ sentEndOfFile = true;
PTRACE(4, "End of this file, currently at " << audioFile.GetPosition() <<
" index, of a total of " <<audioFile.GetDataLength() << " bytes");
}
@@ -89,11 +89,11 @@
if (doThisRead) {
audioFile.Read(data.GetPointer(), data.GetSize());
if (audioFile.GetErrorCode() != PChannel::NoError) {
- doThisRead = FALSE;
+ doThisRead = false;
if (!sentEndOfFile) {
PTRACE(1, "Send end of file as we had an error in read, " << audioFile.GetErrorText());
comms->SendEndOfFile();
- sentEndOfFile = TRUE;
+ sentEndOfFile = true;
PTRACE(3, "AudioRead\t failed with error text " << audioFile.GetErrorText());
}
}
@@ -118,12 +118,12 @@
PTRACE(3, "End audio read thread");
}
-BOOL AudioRead::EnactFileChange()
+bool AudioRead::EnactFileChange()
{
- BOOL changedFile = AudioBase::EnactFileChange();
+ bool changedFile = AudioBase::EnactFileChange();
if (changedFile)
- sentEndOfFile = FALSE;
+ sentEndOfFile = false;
return changedFile;
}
@@ -140,7 +140,7 @@
PUDPSocket * _socket,
PString _fileName)
{
- AudioBase::Initialise(_comms, _socket, _fileName, FALSE);
+ AudioBase::Initialise(_comms, _socket, _fileName, false);
PTRACE(3, "Writer\tInitialise thread for writing " );
}
@@ -210,7 +210,7 @@
void AudioBase::Initialise(Comms * _comms,
PUDPSocket *_socket,
PString _fileName,
- BOOL _isReadDir)
+ bool _isReadDir)
{
comms = _comms;
socket = _socket;
@@ -234,7 +234,7 @@
socket->Close(); //Not really required, but it will get it closed for sure.
}
-BOOL AudioBase::OpenWavFile(PString & newName)
+bool AudioBase::OpenWavFile(PString & newName)
{
PWaitAndSignal m(audioFileLock);
@@ -267,13 +267,13 @@
if (!audioFile.Open(newFile, openMode, openOptions)) {
PTRACE(1, "Audio\tFAILED to open the file \"" << newFile
<< "\" for access");
- return FALSE;
+ return false;
}
if (!isReadDir)
audioFile.SetFormat(PWAVFile::PCM_WavFile);
- return TRUE;
+ return true;
}
void AudioBase::ProcessFile(const PString & _audioFile)
@@ -284,12 +284,12 @@
incomingFile = _audioFile;
}
-BOOL AudioBase::EnactFileChange()
+bool AudioBase::EnactFileChange()
{
PTRACE(6, "EnactFileChange. New=\"" << incomingFile
<< "\" and current =\"" << fileName << "\"");
if (incomingFile.IsEmpty())
- return FALSE;
+ return false;
PTRACE(1, "EnactFileChange. New=\"" << incomingFile
<< "\" Current =\"" << fileName << "\"");
@@ -300,7 +300,7 @@
incomingFile = PString::Empty();
audioFile.SetPosition(0);
- return TRUE;
+ return true;
}
PTRACE(1, "Change of file name, Close \"" << fileName << "\". Use\"" << incomingFile << "\"");
@@ -321,14 +321,14 @@
/**At this point, comms has been initialised */
comms->SendEndOfFile();
- return TRUE;
+ return true;
}
PTRACE(3, "Success in open the file \"" << fileName << "\" to " << dirString);
delay.Restart();
- return TRUE;
+ return true;
}
////////////////////////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/am/comms.cxx
==============================================================================
--- sofaswitch/trunk/am/comms.cxx (original)
+++ sofaswitch/trunk/am/comms.cxx Thu Mar 27 18:33:08 2008
@@ -46,7 +46,7 @@
{
PTRACE(3, "Construct a Comms structrue " << GetOurId());
remoteController = PString();
- mediaStreamsStarted = FALSE;
+ mediaStreamsStarted = false;
IncCountComms();
}
@@ -77,7 +77,7 @@
PTRACE(3, "Comms::ProcessTransferUdp " << cmds);
if (!mediaStreamsStarted) {
- mediaStreamsStarted = TRUE;
+ mediaStreamsStarted = true;
StartMediaStreams();
manager.CreateCall(sender, GetOurId());
}
@@ -225,10 +225,10 @@
PTRACE(3, "We answer this call automatically, so thankyou");
}
-BOOL Comms::SendDtmf(const PString & dtmfVals)
+bool Comms::SendDtmf(const PString & dtmfVals)
{
PTRACE(1, "SEND DTMF not implemented, so " << dtmfVals << " not sent");
- return FALSE;
+ return false;
}
void Comms::SetReadFile(const PString & newReadFile)
@@ -248,7 +248,7 @@
}
-PString Comms::GetAudioFile(BOOL isReadFile)
+PString Comms::GetAudioFile(bool isReadFile)
{
if (isReadFile)
return audioReadFile;
Modified: sofaswitch/trunk/am/main.cxx
==============================================================================
--- sofaswitch/trunk/am/main.cxx (original)
+++ sofaswitch/trunk/am/main.cxx Thu Mar 27 18:33:08 2008
@@ -86,7 +86,7 @@
if (args.HasOption('v')) {
cout << GetName()
- << " Version " << GetVersion(TRUE)
+ << " Version " << GetVersion(true)
<< " by " << GetManufacturer()
<< " on " << GetOSClass() << ' ' << GetOSName()
<< " (" << GetOSVersion() << '-' << GetOSHardware() << ")\n\n";
Modified: sofaswitch/trunk/am/manager.cxx
==============================================================================
--- sofaswitch/trunk/am/manager.cxx (original)
+++ sofaswitch/trunk/am/manager.cxx Thu Mar 27 18:33:08 2008
@@ -111,7 +111,7 @@
return NULL;
}
-BOOL Manager::WaitUntilSupervisorOk()
+bool Manager::WaitUntilSupervisorOk()
{
return supervisor.WaitUntilInitialised();
}
Modified: sofaswitch/trunk/console/main.cxx
==============================================================================
--- sofaswitch/trunk/console/main.cxx (original)
+++ sofaswitch/trunk/console/main.cxx Thu Mar 27 18:33:08 2008
@@ -24,7 +24,7 @@
: PThread(1000, NoAutoDeleteThread), lid(_lid)
{
comms = NULL;
- keepGoing = TRUE;
+ keepGoing = true;
}
CommsLauncher::~CommsLauncher()
@@ -35,7 +35,7 @@
void CommsLauncher::Terminate()
{
- keepGoing = FALSE;
+ keepGoing = false;
delay.Signal();
}
@@ -142,7 +142,7 @@
void UserInterface::EndNow()
{
- endNow = TRUE;
+ endNow = true;
}
@@ -201,7 +201,7 @@
#ifdef PMEMORY_CHECK
"-setallocationbreakpoint:"
#endif
- , FALSE);
+ , false);
#if PMEMORY_CHECK
if (args.HasOption("setallocationbreakpoint"))
@@ -241,7 +241,7 @@
cout << endl
<< "Product Name: " << (const char *)GetName() << endl
<< "Manufacturer: " << (const char *)GetManufacturer() << endl
- << "Version : " << (const char *)GetVersion(TRUE) << endl
+ << "Version : " << (const char *)GetVersion(true) << endl
<< "System : " << (const char *)GetOSName() << " - "
<< (const char *)GetOSHardware() << " - "
<< (const char *)GetOSVersion() << endl
Modified: sofaswitch/trunk/mcu/audio.cxx
==============================================================================
--- sofaswitch/trunk/mcu/audio.cxx (original)
+++ sofaswitch/trunk/mcu/audio.cxx Thu Mar 27 18:33:08 2008
@@ -51,7 +51,7 @@
AudioRead::AudioRead()
- :AudioBase(TRUE)
+ :AudioBase(true)
{
PTRACE(3, "Reader\tConstruct thread for reading " );
}
@@ -72,13 +72,13 @@
member->ReadAudio(data.GetPointer(), readSize);
if (!socket->IsOpen()) {
- keepGoing = FALSE;
+ keepGoing = false;
break;
}
socket->Write(data.GetPointer(), readSize);
if (socket->GetErrorCode() != PChannel::NoError) {
- keepGoing = FALSE;
+ keepGoing = false;
PTRACE(3, "AudioRead\tWrite to socket failed with error text " << socket->GetErrorText());
} else {
PTRACE(3, "AudioRead\tWritten ok " << readSize << " bytes to socket");
@@ -101,7 +101,7 @@
//////////////////////////////////////////////////////////////////////
AudioWrite::AudioWrite()
- : AudioBase(FALSE)
+ : AudioBase(false)
{
PTRACE(3, "Writer\tConstruct thread for writing " );
}
@@ -121,14 +121,14 @@
while(keepGoing) {
if (!socket->IsOpen()) {
- keepGoing = FALSE;
+ keepGoing = false;
break;
}
if (keepGoing){
socket->Read(data.GetPointer(), maxSize);
if (socket->GetErrorCode() != PChannel::NoError) {
- keepGoing = FALSE;
+ keepGoing = false;
PTRACE(3, "AudioWrite\t failed with error text " << socket->GetErrorText());
} else {
readSize = socket->GetLastReadCount();
@@ -151,13 +151,13 @@
//////////////////////////////////////////////////////////////
-AudioBase::AudioBase(BOOL _isReadDir)
+AudioBase::AudioBase(bool _isReadDir)
: PThread(1000, NoAutoDeleteThread)
{
countPackets = 0;
isReadDir = _isReadDir;
dirString = (isReadDir ? "reading" : "writing");
- keepGoing = TRUE;
+ keepGoing = true;
manager = NULL;
socket = NULL;
}
@@ -169,7 +169,7 @@
memberId = _memberId;
}
-BOOL AudioBase::IsInitialised()
+bool AudioBase::IsInitialised()
{
return manager != NULL;
}
@@ -182,7 +182,7 @@
void AudioBase::Terminate()
{
- keepGoing = FALSE;
+ keepGoing = false;
if (socket != NULL)
socket->Close();
}
Modified: sofaswitch/trunk/mcu/comms.cxx
==============================================================================
--- sofaswitch/trunk/mcu/comms.cxx (original)
+++ sofaswitch/trunk/mcu/comms.cxx Thu Mar 27 18:33:08 2008
@@ -46,7 +46,7 @@
: MessageFrame(_lid, 62000), manager(_manager)
{
PTRACE(3, "Construct a Comms structrue ");
- mediaStreamsStarted = FALSE;
+ mediaStreamsStarted = false;
IncCountComms();
}
@@ -74,7 +74,7 @@
PTRACE(3, "Possible START the media Streams ");
if (!mediaStreamsStarted) {
- mediaStreamsStarted = TRUE;
+ mediaStreamsStarted = true;
PTRACE(3, "START the media Streams ");
manager.CreateCall(sender, GetOurId());
StartMediaStreams();
@@ -211,10 +211,10 @@
PTRACE(3, "We answer this call automatically, so thankyou");
}
-BOOL Comms::SendDtmf(const PString & dtmfVals)
+bool Comms::SendDtmf(const PString & dtmfVals)
{
PTRACE(1, "SEND DTMF not implemented, so " << dtmfVals << " not sent");
- return FALSE;
+ return false;
}
////////////////////////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/mcu/main.cxx
==============================================================================
--- sofaswitch/trunk/mcu/main.cxx (original)
+++ sofaswitch/trunk/mcu/main.cxx Thu Mar 27 18:33:08 2008
@@ -89,7 +89,7 @@
if (args.HasOption('v')) {
cout << GetName()
- << " Version " << GetVersion(TRUE)
+ << " Version " << GetVersion(true)
<< " by " << GetManufacturer()
<< " on " << GetOSClass() << ' ' << GetOSName()
<< " (" << GetOSVersion() << '-' << GetOSHardware() << ")\n\n";
Modified: sofaswitch/trunk/mcu/manager.cxx
==============================================================================
--- sofaswitch/trunk/mcu/manager.cxx (original)
+++ sofaswitch/trunk/mcu/manager.cxx Thu Mar 27 18:33:08 2008
@@ -154,7 +154,7 @@
PTRACE(3, "Manager\tFinish CollectGarbage");
}
-BOOL Manager::WaitUntilSupervisorOk()
+bool Manager::WaitUntilSupervisorOk()
{
return supervisor.WaitUntilInitialised();
}
Modified: sofaswitch/trunk/mcu/member.cxx
==============================================================================
--- sofaswitch/trunk/mcu/member.cxx (original)
+++ sofaswitch/trunk/mcu/member.cxx Thu Mar 27 18:33:08 2008
@@ -78,14 +78,14 @@
IncCountMembers();
PTRACE(3, "Member\tConstructor " << *this);
- keepGoing = TRUE;
+ keepGoing = true;
bufferSize = PCM_BUFFER_SIZE;
buffer = new BYTE[bufferSize];
memset(buffer, 0, bufferSize);
currentWriteIndex = 0;
- isClearing = FALSE;
+ isClearing = false;
}
Member::~Member()
@@ -198,10 +198,10 @@
participants.ReadAndMixAudio(dataPtr, readSize);
}
-BOOL Member::ReadAndMixAudio(BYTE * data, PINDEX readSize, PINDEX ¤tReadIndex)
+bool Member::ReadAndMixAudio(BYTE * data, PINDEX readSize, PINDEX ¤tReadIndex)
{
if (!keepGoing)
- return FALSE;
+ return false;
if (readSize == 0) {
PTRACE(3, "Mixer\tNo data to read");
@@ -274,7 +274,7 @@
PWaitAndSignal m(clearMutex);
if (isClearing)
return;
- isClearing = TRUE;
+ isClearing = true;
}
PTRACE(3, *this << " is now doing a CLEAR for sure.");
Modified: sofaswitch/trunk/mcu/participant.cxx
==============================================================================
--- sofaswitch/trunk/mcu/participant.cxx (original)
+++ sofaswitch/trunk/mcu/participant.cxx Thu Mar 27 18:33:08 2008
@@ -49,7 +49,7 @@
{
SetKey (srcMemberId + PString("-->") + dstMemberId);
SetMatchingKey(dstMemberId + PString("-->") + srcMemberId);
- isClearing = FALSE;
+ isClearing = false;
srcMemberPtr = manager.activeMembers.FindWithLock(srcMemberId, PSafeReadOnly);
srcMemberPtr->SafeReference();
@@ -79,7 +79,7 @@
strm << "(" << GetKey() << ")";
}
-BOOL Participant::ReadAndMixAudio(BYTE * data, PINDEX amount)
+bool Participant::ReadAndMixAudio(BYTE * data, PINDEX amount)
{
return dstMemberPtr->ReadAndMixAudio(data, amount, currentReadIndex);
}
@@ -102,7 +102,7 @@
PWaitAndSignal m(clearMutex);
if (isClearing)
return;
- isClearing = TRUE;
+ isClearing = true;
}
PTRACE(3, *this << " commence CLEAR now");
@@ -146,7 +146,7 @@
countEntries.SetValue(0);
SetAutoDeleteObjects();
- shuttingDown = FALSE;
+ shuttingDown = false;
PString name = psprintf("garbage %x", this);
PThread::Create(PCREATE_NOTIFIER(GarbageMain), 0,
PThread::AutoDeleteThread,
@@ -186,7 +186,7 @@
loops++;
PThread::Sleep(300);
if ((loops % 6) == 0)
- EmptyParticipantDict(TRUE);
+ EmptyParticipantDict(true);
}
}
@@ -210,7 +210,7 @@
void ParticipantDict::ReadAndMixAudio(BYTE *data, PINDEX amount)
{
for (PSafePtr<Participant> participant(*this, PSafeReadOnly); participant != NULL; ++participant) {
- BOOL readStatus = participant->ReadAndMixAudio(data, amount);
+ bool readStatus = participant->ReadAndMixAudio(data, amount);
if (!readStatus)
participant->Clear();
}
@@ -235,13 +235,13 @@
}
}
-void ParticipantDict::EmptyParticipantDict(BOOL doForce)
+void ParticipantDict::EmptyParticipantDict(bool doForce)
{
{
PWaitAndSignal m(addNewParticipantMutex);
if (shuttingDown && (!doForce))
return;
- shuttingDown = TRUE;
+ shuttingDown = true;
}
PTRACE(3, "Empty participantDict for Dictionary of \"" << *this << "\"");
Modified: sofaswitch/trunk/server/main.cxx
==============================================================================
--- sofaswitch/trunk/server/main.cxx (original)
+++ sofaswitch/trunk/server/main.cxx Thu Mar 27 18:33:08 2008
@@ -95,7 +95,7 @@
cout << endl
<< "Product Name: " << (const char *)GetName() << endl
<< "Manufacturer: " << (const char *)GetManufacturer() << endl
- << "Version : " << (const char *)GetVersion(TRUE) << endl
+ << "Version : " << (const char *)GetVersion(true) << endl
<< "System : " << (const char *)GetOSName() << '-'
<< (const char *)GetOSHardware() << ' '
<< (const char *)GetOSVersion() << endl
@@ -130,9 +130,9 @@
{
connectionCount.SetValue(0);
bogusCount.SetValue(0);
- keepRunning = TRUE;
+ keepRunning = true;
connectionsActive.SetAutoDeleteObjects();
- isQuitting = FALSE;
+ isQuitting = false;
}
Manager::~Manager()
@@ -211,7 +211,7 @@
return;
}
PTRACE(3, "Stop all incoming connection requests ");
- keepRunning = FALSE;
+ keepRunning = false;
PTRACE(3, "KeepRunning flag turned OFF");
listener.Close();
PTRACE(3, "listener closed");
@@ -223,7 +223,7 @@
if (isQuitting)
return;
PTRACE(3, "START of QuitNow process");
- isQuitting = TRUE;
+ isQuitting = true;
PThread::Create(PCREATE_NOTIFIER(DoQuitNow), 30000,
PThread::AutoDeleteThread,
@@ -340,7 +340,7 @@
globalUniqueId = GetTcpConnectionName();
// globalUniqueId = PString(PRandom::Number());
- isClearing = FALSE;
+ isClearing = false;
incomingMessages = NULL;
reportReadMessages = ServerProcess::Current().ReportReadMessages();
@@ -433,7 +433,7 @@
PWaitAndSignal m(clearMutex);
if (isClearing)
return;
- isClearing = TRUE;
+ isClearing = true;
}
// Add a reference for the thread we are about to start
SafeReference();
@@ -484,11 +484,11 @@
PTRACE(3, "This connection " << *this << " stopped");
}
-BOOL TcpConnection::IsRunning()
+bool TcpConnection::IsRunning()
{
PWaitAndSignal m(incomingLock);
if (incomingMessages == NULL)
- return FALSE;
+ return false;
return !incomingMessages->IsTerminated();
}
@@ -737,13 +737,13 @@
return;
}
-BOOL TcpConnection::ProcessedAsServerCommand(const PString & txt)
+bool TcpConnection::ProcessedAsServerCommand(const PString & txt)
{
if (txt *= PString("quitnow")) {
PTRACE(3, "QUIT now as have read in the command \"" << txt << "\"");
messagesSocket.Close();
manager.QuitNow();
- return TRUE;
+ return true;
}
if (txt.Left(6) *= PString("WhoAmI")){
@@ -752,13 +752,13 @@
memcpy(answer.GetPointer(), sourceId.GetPointer(), sourceId.GetLength());
answer[sourceId.GetLength()] = 0;
SendThisMessage(answer);
- return TRUE;
+ return true;
}
if (txt.Left(19) *= PString("AdviseOnTermination")) {
PStringArray msg = txt.Tokenise(" ");
adviseOnTermination = msg[1];
- return TRUE;
+ return true;
}
if (txt.Left(6) *= PString("status")) {
@@ -776,7 +776,7 @@
memcpy(answer.GetPointer(), msg.GetPointer(), msg.GetLength());
answer[msg.GetLength()] = 0;
SendThisMessage(answer);
- return TRUE;
+ return true;
}
#ifdef PMEMORY_CHECK
@@ -791,7 +791,7 @@
PFile::Create + PFile::Truncate)) {
PTRACE(3, "Failed to open the specified file " << fileName
<< " to dump memory to");
- return TRUE;
+ return true;
}
PMemoryHeap::DumpStatistics();
@@ -800,7 +800,7 @@
PMemoryHeap::DumpObjectsSince(0, result);
outputFile.WriteLine(result);
outputFile.Close();
- return TRUE;
+ return true;
}
#endif
@@ -816,10 +816,10 @@
memcpy(answer.GetPointer(), msg.GetPointer(), msg.GetLength());
answer[msg.GetLength()] = 0;
SendThisMessage(answer);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void TcpConnection::SendThisMessage(PBYTEArray & message)
@@ -847,7 +847,7 @@
{
DisallowDeleteObjects();
- endNow = FALSE;
+ endNow = false;
createNewTcpConnections =
PThread::Create(PCREATE_NOTIFIER(FillListWithTcpConnections), 0,
@@ -867,7 +867,7 @@
void TcpConnectionList::CloseDown()
{
PTRACE(3, "TcpConnectionList::CloseDown is starting");
- endNow = TRUE;
+ endNow = true;
checkListContents.Signal();
{
PWaitAndSignal m(mutexNewTcpConnections);
Modified: sofaswitch/trunk/sofa/src/messages.cxx
==============================================================================
--- sofaswitch/trunk/sofa/src/messages.cxx (original)
+++ sofaswitch/trunk/sofa/src/messages.cxx Thu Mar 27 18:33:08 2008
@@ -89,7 +89,7 @@
remoteServer = lid.GetServer();
PTRACE(5, "Constructor for MessageFrame " << ourId);
- keepGoing = TRUE;
+ keepGoing = true;
availableCommands += PString(/* 0 */ "HANGUP");
availableCommands += PString(/* 1 */ "CALLNODE");
@@ -153,14 +153,14 @@
messagesSocket.Close();
}
-BOOL MessageFrame::WaitUntilInitialised()
+bool MessageFrame::WaitUntilInitialised()
{
PTRACE(3, "WaitForInitialised start");
threadRunning.Wait();
if (!keepGoing) {
PTRACE(3, "Thread " << GetOurId() << " failed as thread never started");
PTRACE(3, "Thread " << GetOurId() << " has terminated.");
- return FALSE;
+ return false;
}
PTRACE(5, "WaitForInitialised start wait for connection");
@@ -168,7 +168,7 @@
if (!keepGoing) {
PTRACE(3, "Thread " << GetOurId() << " failed as we could not connect");
PTRACE(3, "Thread " << GetOurId() << " has terminated.");
- return FALSE;
+ return false;
}
PTRACE(5, "WaitForInitialised start wait for source id");
@@ -176,17 +176,17 @@
if (!keepGoing) {
PTRACE(3, "Thread " << GetOurId() << " failed as no source id received");
PTRACE(3, "Thread " << GetOurId() << " has terminated.");
- return FALSE;
+ return false;
}
PTRACE(5, "WaitForInitialised start all done ok.");
PTRACE(4, "Thread " << GetOurId() << " is initialised ok");
- return TRUE;
+ return true;
}
void MessageFrame::Terminate()
{
- keepGoing = FALSE;
+ keepGoing = false;
audioSocket.Close();
CloseMessagesSocket();
threadRunning.Signal();
@@ -227,7 +227,7 @@
if (messagesSocket.GetErrorCode() != PChannel::NoError) {
PTRACE(3, "error fail warning GIVE UP on this link. After 5 tries, could not get in." );
PTRACE(3, "multiple efforts to connect aborted " );
- keepGoing = FALSE;
+ keepGoing = false;
goodConnection.Signal();
return;
}
@@ -295,7 +295,7 @@
PTRACE(3, "Error on sending " << ourId << " to server");
PTRACE(3, "Wrote " << writeSize << " bytes");
PTRACE(3, "Error text is " << messagesSocket.GetErrorText());
- keepGoing = FALSE;
+ keepGoing = false;
writeSize = 1;
}
writeMessageLock.Signal();
@@ -343,7 +343,7 @@
SilentlyEndAll();
CloseMessagesSocket();
- keepGoing = FALSE;
+ keepGoing = false;
continue;
}
@@ -351,7 +351,7 @@
PTRACE(3, "Failed in read from comms socket, code is "
<< messagesSocket.GetErrorText());
PTRACE(3, "End Process Incoming Messages as we had a read error.");
- keepGoing = FALSE;
+ keepGoing = false;
continue;
} else {
ProcessIncomingMessages(data, size);
@@ -444,7 +444,7 @@
binary[binary.GetSize() - 1] = 0;
writeMessageLock.Wait();
- if (messagesSocket.Write(binary.GetPointer(), binary.GetSize()) == FALSE) {
+ if (messagesSocket.Write(binary.GetPointer(), binary.GetSize()) == false) {
PTRACE(3, "Failed to send message " << _message << " to " << dest << ". error was " << messagesSocket.GetErrorText());
}
writeMessageLock.Signal();
@@ -452,12 +452,12 @@
void MessageFrame::ProcessMessage(PString message, PString sender)
{
- PStringArray cmds = message.Tokenise(" ", FALSE);
+ PStringArray cmds = message.Tokenise(" ", false);
if (cmds[0] *= availableCommands[0]) {
PTRACE(4, "ProcessHangup " << cmds[0]);
if (OkToHangup()) {
- keepGoing = FALSE;
+ keepGoing = false;
ProcessHangup(cmds, sender);
CloseMessagesSocket();
} else {
@@ -524,7 +524,7 @@
if (cmds[0] *= availableCommands[10]) {
PTRACE(4, "ProcessQuitNow " << cmds[0]);
if (OkToQuitNow()) {
- keepGoing = FALSE;
+ keepGoing = false;
ProcessQuitNow(cmds, sender);
CloseMessagesSocket();
} else {
@@ -702,8 +702,7 @@
PString transfer = cmds[0] + PString(" ") + cmds[1] + PString(" ");
transfer += addr.AsString() + PString(":") + PString(portNo);
if (cmds.GetSize() == 3) {
- PTRACE(3, "have received a transfer command from " << sender);
- PTRACE(3, "Now we send the concluding message to " << sender);
+ PTRACE(7, "have received a transfer command from " << sender);
destination = sender;
transfer += " done";
}
@@ -712,7 +711,7 @@
if (cmds.GetSize() == 2) {
/**We have receive a command, "transferudp destination" */
- PTRACE(3, "finished " << cmds[0]);
+ PTRACE(7, "finished " << cmds[0]);
return;
}
@@ -739,7 +738,7 @@
if (!SetSendToAddress(addr, port)) {
PTRACE(3, cmds[0] << PString(" FAILED to specify a valid destination address ") << cmds[2] << PString("==not avail"));
}
- PTRACE(3, "Set send to address of " << addr << " : " << port);
+ PTRACE(8, "Set send to address of " << addr << " : " << port);
}
@@ -756,26 +755,26 @@
SendThisMessageTo(reply, sender);
}
-BOOL MessageFrame::GetLocalAddress(PIPSocket::Address &address, PINDEX &portNo)
+bool MessageFrame::GetLocalAddress(PIPSocket::Address &address, PINDEX &portNo)
{
PIPSocket::InterfaceTable table;
PIPSocket::Address addr;
if (PIPSocket::GetInterfaceTable (table) )
for (PINDEX i = 0; i < table.GetSize(); i++) {
addr = table[i].GetAddress();
- PTRACE(6, "Possible Local address is " << addr);
+ PTRACE(8, "Possible Local address is " << addr);
if (addr.IsLoopback())
continue;
- PTRACE(3, "Select Local address of " << addr);
+ PTRACE(8, "Select Local address of " << addr);
address = addr;
portNo = audioSocket.GetPort();
- PTRACE(3, "Select local port of " << portNo);
- return TRUE;
+ PTRACE(8, "Select local port of " << portNo);
+ return true;
}
PTRACE(3, "Failed to do :GetLocalAddress");
- return FALSE;
+ return false;
}
void MessageFrame::ProcessSendDtmf(PStringArray &cmds, PString & sender)
@@ -848,39 +847,39 @@
}
#endif
-BOOL MessageFrame::SendDtmf(const PString & dtmfVals)
+bool MessageFrame::SendDtmf(const PString & dtmfVals)
{
PTRACE(1, "Send DTMF of " << dtmfVals << " is not implemented - and it should be");
- return FALSE;
+ return false;
}
-BOOL MessageFrame::QueryLocalAddress(PIPSocket::Address & addr, PINDEX & portNo)
+bool MessageFrame::QueryLocalAddress(PIPSocket::Address & addr, PINDEX & portNo)
{
PTRACE(3, "Query local address " << GetOurId());
return GetLocalAddress(addr, portNo);
}
-BOOL MessageFrame::QuerySendToAddress(PIPSocket::Address & addr, PINDEX & portNo)
+bool MessageFrame::QuerySendToAddress(PIPSocket::Address & addr, PINDEX & portNo)
{
PTRACE(3, "Query sendto address " << GetOurId());
return GetSendToAddress(addr, portNo);
}
-BOOL MessageFrame::SetSendToAddress(PIPSocket::Address & addr, PINDEX & portNo)
+bool MessageFrame::SetSendToAddress(PIPSocket::Address & addr, PINDEX & portNo)
{
- PTRACE(3, "Set sendto address " << addr << ":" << PString(portNo));
+ PTRACE(8, "Set sendto address " << addr << ":" << PString(portNo));
audioSocket.SetSendAddress(addr, portNo);
- return TRUE;
+ return true;
}
-BOOL MessageFrame::GetSendToAddress(PIPSocket::Address & addr, PINDEX & portNo)
+bool MessageFrame::GetSendToAddress(PIPSocket::Address & addr, PINDEX & portNo)
{
WORD remotePort;
audioSocket.GetSendAddress(addr, remotePort);
portNo = remotePort;
- return TRUE;
+ return true;
}
void MessageFrame::SetWriteFile(const PString & newWriteFile)
Modified: sofaswitch/trunk/sofa/src/messlist.cxx
==============================================================================
--- sofaswitch/trunk/sofa/src/messlist.cxx (original)
+++ sofaswitch/trunk/sofa/src/messlist.cxx Thu Mar 27 18:33:08 2008
@@ -157,7 +157,7 @@
: lid(_lid)
{
SetPreAllocatedSize(10);
- keepGoing = TRUE;
+ keepGoing = true;
MessageFrameList::Initialise();
makeNewMessageFrame = PThread::Create(PCREATE_NOTIFIER(MakeNewMessageFrames), 0,
@@ -208,7 +208,7 @@
void MessageFrameListProvider::Terminate()
{
- keepGoing = FALSE;
+ keepGoing = false;
makeAnother.Signal();
}
@@ -365,16 +365,16 @@
data.AppendString(newString);
}
-BOOL NodeRequest::GetRequest(PString & nextString)
+bool NodeRequest::GetRequest(PString & nextString)
{
PWaitAndSignal m(accessMutex);
if (data.IsEmpty()) {
PTRACE(3, "No pending requests for a node. ");
- return FALSE;
+ return false;
}
nextString = data[0];
data.RemoveAt(0);
PTRACE(3, "Request from " << nextString << " for a node");
- return TRUE;
+ return true;
}
Modified: sofaswitch/trunk/sound/audio.cxx
==============================================================================
--- sofaswitch/trunk/sound/audio.cxx (original)
+++ sofaswitch/trunk/sound/audio.cxx Thu Mar 27 18:33:08 2008
@@ -48,7 +48,7 @@
countPackets++;
} else {
PTRACE(3, "Detected the closure of our udp socket, so end");
- keepGoing = FALSE;
+ keepGoing = false;
}
if (!keepGoing) {
@@ -98,7 +98,7 @@
<< readSize << " bytes");
if (!socket.IsOpen()) {
PTRACE(3, "Detected the closure of our udp socket, so end");
- keepGoing = FALSE;
+ keepGoing = false;
continue;
}
@@ -169,7 +169,7 @@
sound(_sound)
{
countPackets = 0;
- keepGoing = TRUE;
+ keepGoing = true;
currentVolume = 90;
}
@@ -182,7 +182,7 @@
void TestAudio::Terminate()
{
PTRACE(5, "Terminate of TestAudio class now");
- keepGoing = FALSE;
+ keepGoing = false;
socket.Close();
}
Modified: sofaswitch/trunk/sound/comms.cxx
==============================================================================
--- sofaswitch/trunk/sound/comms.cxx (original)
+++ sofaswitch/trunk/sound/comms.cxx Thu Mar 27 18:33:08 2008
@@ -43,8 +43,8 @@
tar(* new TestAudioRead(audioSocket, _soundRecorder)),
taw(* new TestAudioWrite(audioSocket, _soundPlayer))
{
- stopByExit = FALSE;
- stopByHangup = TRUE;
+ stopByExit = false;
+ stopByHangup = true;
}
Comms::~Comms()
@@ -74,7 +74,7 @@
void Comms::WaitForTermination()
{
- BOOL keepGoing = TRUE;
+ bool keepGoing = true;
while (keepGoing) {
{
PTRACE(6, "Comms\tWaitForTermination");
@@ -87,7 +87,7 @@
MessageFrame::WaitForTermination();
}
-PString Comms::AlterVolume(PSoundChannel::Directions dir, BOOL doRaise)
+PString Comms::AlterVolume(PSoundChannel::Directions dir, bool doRaise)
{
PString newVolume;
@@ -111,10 +111,10 @@
}
-BOOL Comms::SendDtmf(const PString & dtmfVals)
+bool Comms::SendDtmf(const PString & dtmfVals)
{
cerr << "At " << PTime() << " received DTMF from the controller of ---->>>|||" << dtmfVals << endl;
- return TRUE;
+ return true;
}
@@ -128,7 +128,7 @@
void Comms::ProcessHangup(PStringArray &cmds, PString & sender)
{
- stopByExit = TRUE;
+ stopByExit = true;
SetRemoteController(sender);
Terminate();
}
@@ -189,7 +189,7 @@
void Comms::ProcessQuitNow(PStringArray &cmds, PString & sender)
{
- stopByExit = TRUE;
+ stopByExit = true;
SetRemoteController(sender);
Terminate();
}
Modified: sofaswitch/trunk/sound/main.cxx
==============================================================================
--- sofaswitch/trunk/sound/main.cxx (original)
+++ sofaswitch/trunk/sound/main.cxx Thu Mar 27 18:33:08 2008
@@ -32,7 +32,7 @@
player(_player),
recorder(_recorder)
{
- endNow = FALSE;
+ endNow = false;
Resume();
}
@@ -99,7 +99,7 @@
break;
case 'x' :
case 'q' : {
- endNow = TRUE;
+ endNow = true;
PTRACE(3, "End this program now ");
}
break;
@@ -124,7 +124,7 @@
void UserInterface::Terminate()
{
- endNow = TRUE;
+ endNow = true;
}
/////////////////////////////////////////////////////////////////////////////
@@ -179,7 +179,7 @@
cout << endl
<< "Product Name: " << (const char *)GetName() << endl
<< "Manufacturer: " << (const char *)GetManufacturer() << endl
- << "Version : " << (const char *)GetVersion(TRUE) << endl
+ << "Version : " << (const char *)GetVersion(true) << endl
<< "System : " << (const char *)GetOSName() << '-'
<< (const char *)GetOSHardware() << ' '
<< (const char *)GetOSVersion() << endl
@@ -314,7 +314,7 @@
}
-BOOL Audio::OpenSoundDevice(PSoundChannel & sound, PSoundChannel::Directions dir)
+bool Audio::OpenSoundDevice(PSoundChannel & sound, PSoundChannel::Directions dir)
{
PString name = (dir == PSoundChannel::Recorder ? "recorder" : "player");
@@ -328,12 +328,12 @@
cerr << "TestAudio:: Failed to open sound Playing/Recording device. Exit" << endl;
PTRACE(3, "TestAudio\tFailed to open device for " << name << " and device name of " << devName);
- return FALSE;
+ return false;
}
#if 0
if (!sound.IsOpen()) {
PTRACE(3, "just opened the device, but it is not open ");
- return FALSE;
+ return false;
}
#endif
PINDEX currentVolume = 90;
@@ -343,13 +343,13 @@
#if 0
if (sound.IsOpen()) {
PTRACE(3, "End of OpenAudio, sound device is opened just fine");
- return TRUE;
+ return true;
} else {
PTRACE(3, "End of OpenAudio, but the sound device is closed");
- return FALSE;
+ return false;
}
#endif
- return TRUE;
+ return true;
}
////////////////////////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/voip/comms.cxx
==============================================================================
--- sofaswitch/trunk/voip/comms.cxx (original)
+++ sofaswitch/trunk/voip/comms.cxx Thu Mar 27 18:33:08 2008
@@ -185,28 +185,28 @@
}
remoteController = sender;
- BOOL doAnswer = FALSE;
- BOOL doAnswerDefined= FALSE;
+ bool doAnswer = false;
+ bool doAnswerDefined= false;
if (cmds.GetSize() > 1) {
if ((cmds[1] *= "true") || (cmds[1] *= "yes") || (cmds[1] *= "accept")) {
- doAnswer = TRUE;
- doAnswerDefined = TRUE;
+ doAnswer = true;
+ doAnswerDefined = true;
}
if ((cmds[1] *= "false") || (cmds[1] *= "no") || (cmds[1] *= "reject")) {
- doAnswer = FALSE;
- doAnswerDefined = TRUE;
+ doAnswer = false;
+ doAnswerDefined = true;
}
}
if (cmds.GetSize() == 1) {
- doAnswer = TRUE;
- doAnswerDefined = TRUE;
+ doAnswer = true;
+ doAnswerDefined = true;
}
if (!doAnswerDefined) {
PTRACE(0, "Answer command did not correctly specify what to do ");
PTRACE(0, "The command \"" << cmds[1] << "\" was not understood -- sorry");
- doAnswer = FALSE;
+ doAnswer = false;
}
PString thisToken;
@@ -218,7 +218,7 @@
if(!doAnswer) {
PTRACE(3, "Reject this call");
- manager.AcceptThisCall(thisToken, FALSE);
+ manager.AcceptThisCall(thisToken, false);
PWaitAndSignal m(opalCallLock);
if (myOpalCall != NULL)
myOpalCall->Clear();
@@ -229,16 +229,16 @@
manager.AcceptThisCall(thisToken);
}
-BOOL Comms::SendDtmf(const PString & dtmfValue)
+bool Comms::SendDtmf(const PString & dtmfValue)
{
PWaitAndSignal m(opalCallLock);
if (myOpalCall == NULL) {
PTRACE(3, "WE are not in a call, cannot send dtmf " << dtmfValue);
- return FALSE;
+ return false;
}
myOpalCall->SendThisDtmf(dtmfValue);
- return TRUE;
+ return true;
}
PUDPSocket & Comms::GetAudioSocket()
Modified: sofaswitch/trunk/voip/jocall.cxx
==============================================================================
--- sofaswitch/trunk/voip/jocall.cxx (original)
+++ sofaswitch/trunk/voip/jocall.cxx Thu Mar 27 18:33:08 2008
@@ -65,7 +65,7 @@
IncMyOpalCall();
PTRACE(3, "MyOpalCall\tCreated a new MyOpalCall. The opal call token is " << myToken);
- sentEstablishedMessage = FALSE;
+ sentEstablishedMessage = false;
}
#ifdef _MSC_VER
@@ -87,15 +87,15 @@
DecMyOpalCall();
}
-BOOL MyOpalCall::OnSetUp(OpalConnection & connection)
+bool MyOpalCall::OnSetUp(OpalConnection & connection)
{
PTRACE(3, "Call\tOnSetUp " << connection);
- BOOL ok = FALSE;
+ bool ok = false;
if (!LockReadWrite()) {
PTRACE(3, "failed to lock the read write");
- return FALSE;
+ return false;
}
partyA = connection.GetRemotePartyName();
@@ -116,27 +116,27 @@
PTRACE(3, "Now do a setup");
if (conn->SetUpConnection()) {
PTRACE(3, "set up the connection ok ");
- ok = TRUE;
+ ok = true;
}
}
}
PTRACE(2, "finished onsetup of connection/call and it gave " << 1);
- return TRUE;
+ return true;
}
-BOOL MyOpalCall::OnAlerting(OpalConnection & connection)
+bool MyOpalCall::OnAlerting(OpalConnection & connection)
{
PTRACE(2, "On alerting of connection. " << connection.GetToken());
return OpalCall::OnAlerting(connection);
}
-BOOL MyOpalCall::OnConnected(OpalConnection & connection)
+bool MyOpalCall::OnConnected(OpalConnection & connection)
{
PTRACE(2, "On Connected of connection. " << connection.GetToken());
return OpalCall::OnConnected(connection);
}
-BOOL MyOpalCall::OnEstablished(OpalConnection & connection)
+bool MyOpalCall::OnEstablished(OpalConnection & connection)
{
PTRACE(2, "On Established of connection. " << connection.GetToken());
@@ -145,7 +145,7 @@
if (PIsDescendant(&connection, OpalUdpSsConnection)) {
comms.AdviseCallCreation();
- sentEstablishedMessage = TRUE;
+ sentEstablishedMessage = true;
PTRACE(3, "We have just advised that the call was created ");
}
@@ -192,20 +192,30 @@
SendThisMessageTo(message, remoteController);
}
-void MyOpalCall::AcceptThisCall(BOOL doAccept)
+void MyOpalCall::AcceptThisCall(bool doAccept)
{
- PTRACE(3, "Process request to accept this call");
+ SafeReference();
+ acceptingThisCall = doAccept;
+ PStringStream threadName;
+ threadName << "Answer call " << *this;
+ PThread::Create(PCREATE_NOTIFIER(AcceptThisCallMain), 20000, PThread::AutoDeleteThread, PThread::NormalPriority, threadName);
+}
+
+void MyOpalCall::AcceptThisCallMain(PThread &, INT)
+{
+ PTRACE(3, "Process request to accept this call " << *this);
for (PSafePtr<OpalConnection> conn(connectionsActive, PSafeReadOnly); conn != NULL; ++conn) {
PSafePtr<OpalUdpSsConnection> connection;
connection = PSafePtrCast<OpalConnection, OpalUdpSsConnection>(conn);
if (connection == NULL) {
- if (doAccept)
+ if (acceptingThisCall)
conn->AnsweringCall(OpalConnection::AnswerCallNow);
else
conn->AnsweringCall(OpalConnection::AnswerCallDenied);
PTRACE(3, "Finished Answering the call for " << conn->GetToken());
}
}
+ SafeDereference();
}
void MyOpalCall::CloseThisId()
Modified: sofaswitch/trunk/voip/jocall.h
==============================================================================
--- sofaswitch/trunk/voip/jocall.h (original)
+++ sofaswitch/trunk/voip/jocall.h Thu Mar 27 18:33:08 2008
@@ -170,6 +170,18 @@
for permission to answer it */
void QueryAcceptIncomingCall(const PString & remoteController, const PString &remoteParty);
+
+
+#ifdef DOC_PLUS_PLUS
+ /**A short lived thread which handles the answering of this call. This
+ thread is required to do this - otherwise the message handling thread of
+ the comms interface does the work of answering the call. For voip
+ protocols like iax2, this is to much work for the comms thread to do. */
+ virtual void AcceptThisCallMain(PThread &, INT);
+#else
+ PDECLARE_NOTIFIER(PThread, MyOpalCall, AcceptThisCallMain);
+#endif
+
protected:
/**Link to our controll manager */
@@ -187,6 +199,10 @@
established. In other words, only tell the remote controller once
that we have been established.*/
BOOL sentEstablishedMessage;
+
+ /**Simple short lived flag which is used so the thread (which answers the
+ call) can correctly answer yes/no */
+ BOOL acceptingThisCall;
};
Modified: sofaswitch/trunk/voip/main.cxx
==============================================================================
--- sofaswitch/trunk/voip/main.cxx (original)
+++ sofaswitch/trunk/voip/main.cxx Thu Mar 27 18:33:08 2008
@@ -80,7 +80,7 @@
void VoipProcess::Main()
{
cout << GetName()
- << " Version " << GetVersion(TRUE)
+ << " Version " << GetVersion(true)
<< " by " << GetManufacturer()
<< " on " << GetOSClass() << ' ' << GetOSName()
<< " (" << GetOSVersion() << '-' << GetOSHardware() << ")\n\n";
@@ -145,7 +145,7 @@
#if OPAL_IAX2
"X-no-iax2."
#endif
- , FALSE);
+ , false);
if (args.HasOption('h')) {
Modified: sofaswitch/trunk/voip/mymanager.cxx
==============================================================================
--- sofaswitch/trunk/voip/mymanager.cxx (original)
+++ sofaswitch/trunk/voip/mymanager.cxx Thu Mar 27 18:33:08 2008
@@ -123,11 +123,11 @@
DecMyManager();
}
-BOOL MyManager::Initialise(PArgList & args)
+bool MyManager::Initialise(PArgList & args)
{
if (!supervisor.WaitUntilInitialised()) {
cerr << "The supervisor could not connect to the remote server. Sorry." << endl;
- return FALSE;
+ return false;
}
@@ -209,7 +209,7 @@
msg << "IP Type Of Service bits must be 0 to 255." << tos << " is invalid";
cerr << msg << endl;
PTRACE(1, msg);
- return FALSE;
+ return false;
}
SetRtpIpTypeofService(tos);
}
@@ -253,7 +253,7 @@
unsigned initialBandwidth = args.GetOptionString('b').AsUnsigned()*100;
if (initialBandwidth == 0) {
cerr << "Illegal bandwidth specified." << endl;
- return FALSE;
+ return false;
}
h323EP->SetInitialBandwidth(initialBandwidth);
}
@@ -271,7 +271,7 @@
if (!h323EP->StartListeners(listeners)) {
cerr << "Could not open any H.323 listener from "
<< setfill(',') << listeners << endl;
- return FALSE;
+ return false;
}
cout << "H.323 listeners: " << setfill(',') << h323EP->GetListeners() << setfill(' ') << endl;
@@ -316,7 +316,7 @@
}
cerr << '.' << endl;
if (args.HasOption("require-gatekeeper"))
- return FALSE;
+ return false;
}
}
}
@@ -370,7 +370,7 @@
if (!sipEP->StartListeners(listeners)) {
cerr << "Could not open any SIP listener from "
<< setfill(',') << listeners << endl;
- return FALSE;
+ return false;
}
if (args.HasOption('r')) {
@@ -393,7 +393,7 @@
if (args.HasOption('d')) {
if (!SetRouteTable(args.GetOptionString('d').Lines())) {
cerr << "No legal entries in dial peer!" << endl;
- return FALSE;
+ return false;
}
}
@@ -431,11 +431,11 @@
#endif
- return TRUE;
+ return true;
}
-BOOL MyManager::OnIncomingConnection(
+bool MyManager::OnIncomingConnection(
OpalConnection & connection,
unsigned options,
OpalConnection::StringOptions * stringOptions
@@ -458,17 +458,17 @@
return OpalManager::OnIncomingConnection(connection, options, stringOptions);
}
-void MyManager::AcceptThisCall(const PString & uniqueCallId, BOOL doAccept)
+void MyManager::AcceptThisCall(const PString & uniqueCallId, bool doAccept)
{
PTRACE(3, "Accept this call if we can find it " << uniqueCallId);
- OpalCall *oCall = FindCallWithLock(uniqueCallId);
+ PSafePtr<OpalCall> oCall = FindCallWithLock(uniqueCallId);
if (oCall == NULL) {
PTRACE(3, "Failed to accept call with a token of " << uniqueCallId);
return;
}
- MyOpalCall *call;
- call = PSafePtrCast<OpalCall, MyOpalCall>(oCall);
+
+ PSafePtr<MyOpalCall> call = PSafePtrCast<OpalCall, MyOpalCall>(oCall);
PTRACE(3, "Accept/Reject this call as we have found it " << uniqueCallId);
call->AcceptThisCall(doAccept);
}
@@ -604,20 +604,20 @@
supervisor.SendThisMessageTo(PString("REQUESTNEWID ") + c->GetOurId(), requester);
}
-BOOL MyManager::SendThisDtmf(const PString & token, const PString & thisDtmf)
+bool MyManager::SendThisDtmf(const PString & token, const PString & thisDtmf)
{
PTRACE(3, "MyManager\tSend this dtmf " << thisDtmf << " to call " << token);
OpalCall *oCall = FindCallWithLock(token);
if (oCall == NULL) {
PTRACE(3, "MyManager\tSend this dtmf " << thisDtmf << " to call " << token << " FAILED - call not found");
- return FALSE;
+ return false;
}
MyOpalCall *call;
call = PSafePtrCast<OpalCall, MyOpalCall>(oCall);
call->SendThisDtmf(thisDtmf);
PTRACE(3, "MyManager\tSend this dtmf " << thisDtmf << " to call " << token << " sent ok");
- return TRUE;
+ return true;
}
@@ -785,12 +785,12 @@
}
-BOOL MyManager::OnOpenMediaStream(OpalConnection & connection,
+bool MyManager::OnOpenMediaStream(OpalConnection & connection,
OpalMediaStream & stream)
{
if (!OpalManager::OnOpenMediaStream(connection, stream)) {
PTRACE(1, "Failed to open a media stream");
- return FALSE;
+ return false;
}
#if 0
cout << "Started media stream ";
@@ -805,7 +805,7 @@
cout << endl;
#endif
- return TRUE;
+ return true;
}
Modified: sofaswitch/trunk/voip/udpconnection.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpconnection.cxx (original)
+++ sofaswitch/trunk/voip/udpconnection.cxx Thu Mar 27 18:33:08 2008
@@ -89,29 +89,29 @@
}
-BOOL OpalUdpSsConnection::SetUpConnection()
+bool OpalUdpSsConnection::SetUpConnection()
{
// Check if we are A-Party in thsi call, so need to do things differently
if (ownerCall.GetConnection(0) == this) {
phase = SetUpPhase;
if (!OnIncomingConnection(0, NULL)) {
Release(EndedByCallerAbort);
- return FALSE;
+ return false;
}
PTRACE(3, "PCSS\tOutgoing call routed to " << ownerCall.GetPartyB() << " for " << *this);
if (!ownerCall.OnSetUp(*this)) {
Release(EndedByNoAccept);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
{
PSafePtr<OpalConnection> otherConn = ownerCall.GetOtherPartyConnection(*this);
if (otherConn == NULL)
- return FALSE;
+ return false;
remotePartyName = otherConn->GetRemotePartyName();
remotePartyAddress = otherConn->GetRemotePartyAddress();
@@ -126,7 +126,7 @@
}
-BOOL OpalUdpSsConnection::SetAlerting(const PString & calleeName, BOOL)
+bool OpalUdpSsConnection::SetAlerting(const PString & calleeName, bool)
{
PTRACE(3, "UdpSs\tSetAlerting(" << calleeName << ')');
phase = AlertingPhase;
@@ -135,7 +135,7 @@
}
-BOOL OpalUdpSsConnection::SetConnected()
+bool OpalUdpSsConnection::SetConnected()
{
PTRACE(3, "UdpSs\tSetConnected()");
@@ -147,7 +147,7 @@
OnEstablished();
}
- return TRUE;
+ return true;
}
void OpalUdpSsConnection::OnEstablished()
@@ -180,7 +180,7 @@
OpalMediaStream * OpalUdpSsConnection::CreateMediaStream(
const OpalMediaFormat & mediaFormat,
unsigned sessionID,
- BOOL isSource)
+ bool isSource)
{
if (sessionID != OpalMediaFormat::DefaultAudioSessionID)
return OpalConnection::CreateMediaStream(mediaFormat, sessionID, isSource);
@@ -198,11 +198,11 @@
OpalConnection::CloseMediaStreams();
}
-BOOL OpalUdpSsConnection::OnOpenMediaStream(OpalMediaStream & mediaStream)
+bool OpalUdpSsConnection::OnOpenMediaStream(OpalMediaStream & mediaStream)
{
PTRACE(3, "OnOpenMediaStream for " << mediaStream);
if (!OpalConnection::OnOpenMediaStream(mediaStream))
- return FALSE;
+ return false;
if (mediaStream.IsSource()) {
OpalMediaPatch * patch = mediaStream.GetPatch();
@@ -213,7 +213,7 @@
}
}
- return TRUE;
+ return true;
}
void OpalUdpSsConnection::Release(CallEndReason reason)
@@ -240,7 +240,7 @@
((MyOpalCall &)GetCall()).SendThisMessageTo(message, destination);
}
-PSoundChannel * OpalUdpSsConnection::CreateSoundChannel(BOOL isSource)
+PSoundChannel * OpalUdpSsConnection::CreateSoundChannel(bool isSource)
{
PTRACE(1, "Create UDP Sound Channel ");
@@ -265,10 +265,10 @@
}
-BOOL OpalUdpSsConnection::SendUserInputString(const PString & value)
+bool OpalUdpSsConnection::SendUserInputString(const PString & value)
{
PTRACE(5, "UdpSs\tSendUserInputString(" << value << ") drives nowhere");
- return TRUE;
+ return true;
}
Modified: sofaswitch/trunk/voip/udpep.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpep.cxx (original)
+++ sofaswitch/trunk/voip/udpep.cxx Thu Mar 27 18:33:08 2008
@@ -76,7 +76,7 @@
DecOpalUdpSsEndPoint();
}
-BOOL OpalUdpSsEndPoint::MakeConnection(OpalCall & call,
+bool OpalUdpSsEndPoint::MakeConnection(OpalCall & call,
const PString & remoteParty,
void * userData,
unsigned int /*options*/,
@@ -92,12 +92,12 @@
PSafePtr<OpalUdpSsConnection> connection = CreateConnection(call, userData, conToken);
if (connection == NULL) {
PTRACE(1, "Failed to create a connection on " << conToken);
- return FALSE;
+ return false;
}
connectionsActive.SetAt(conToken, connection);
- return TRUE;
+ return true;
}
@@ -143,22 +143,22 @@
}
-BOOL OpalUdpSsEndPoint::AcceptIncomingConnection(const PString & token)
+bool OpalUdpSsEndPoint::AcceptIncomingConnection(const PString & token)
{
PSafePtr<OpalUdpSsConnection> connection = GetUdpSsConnectionWithLock(token, PSafeReadOnly);
if (connection == NULL) {
PTRACE(2, "OpalSsEp\tAcceptIncoming connection on " << token << "return false as connection not found");
- return FALSE;
+ return false;
}
connection->AcceptIncoming();
- return TRUE;
+ return true;
}
-BOOL OpalUdpSsEndPoint::OnShowUserInput(const OpalUdpSsConnection &, const PString &)
+bool OpalUdpSsEndPoint::OnShowUserInput(const OpalUdpSsConnection &, const PString &)
{
- return TRUE;
+ return true;
}
@@ -169,19 +169,19 @@
return PSafePtrCast<OpalConnection, OpalUdpSsConnection>(GetConnectionWithLock(token, mode));
}
-BOOL OpalUdpSsEndPoint::OnShowIncoming(const OpalUdpSsConnection & connection)
+bool OpalUdpSsEndPoint::OnShowIncoming(const OpalUdpSsConnection & connection)
{
PTRACE(3, "INCOMING CALL from remote node " << connection.GetToken());
- return TRUE;
+ return true;
}
-BOOL OpalUdpSsEndPoint::OnShowOutgoing(const OpalUdpSsConnection & connection)
+bool OpalUdpSsEndPoint::OnShowOutgoing(const OpalUdpSsConnection & connection)
{
//PTime now;
//cout << connection.GetRemotePartyName() << " is ringing on "
// << now.AsString("w h:mma") << " ..." << endl;
- return TRUE;
+ return true;
}
Modified: sofaswitch/trunk/voip/udpsound.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpsound.cxx (original)
+++ sofaswitch/trunk/voip/udpsound.cxx Thu Mar 27 18:33:08 2008
@@ -45,7 +45,7 @@
-PString GetSSLabel(BOOL isSource)
+PString GetSSLabel(bool isSource)
{
if (isSource)
return PString ("-Source- ");
@@ -54,7 +54,7 @@
}
-UdpSoundChannel::UdpSoundChannel(MyOpalCall & _myOpalCall, BOOL _isSource)
+UdpSoundChannel::UdpSoundChannel(MyOpalCall & _myOpalCall, bool _isSource)
: myOpalCall(_myOpalCall),
audioSocket(_myOpalCall.GetAudioSocket()), isSource(_isSource)
{
@@ -73,13 +73,13 @@
}
-BOOL UdpSoundChannel::Open(const PString & device, Directions dir,
+bool UdpSoundChannel::Open(const PString & device, Directions dir,
unsigned /* numChannels*/,
unsigned /*sampleRate */, unsigned /*bitsPerSample*/)
{
if (device != PString("udpsound")) {
PTRACE(2, "OPEN failed for this udpsound channel");
- return FALSE;
+ return false;
}
PTRACE(3, "MEDIASound\t open for a direction of " << dir << " and for " << GetSSLabel(isSource));
@@ -90,7 +90,7 @@
readBuffer.SetSize(480); //The absolute largest possible size
readQueue.Open(960);
- return TRUE;
+ return true;
}
void UdpSoundChannel::CreateSilence(void * buffer, PINDEX amount)
@@ -99,7 +99,7 @@
lastReadCount = amount;
}
-BOOL UdpSoundChannel::Write(const void * buffer, PINDEX amount)
+bool UdpSoundChannel::Write(const void * buffer, PINDEX amount)
{
{
WORD dPort;
@@ -112,11 +112,11 @@
if (!IsOpen()) {
PTRACE(3, "MEDIA\tWrite failed as this sound channel is closed");
- return FALSE;
+ return false;
}
- BOOL res = audioSocket.Write(buffer, amount);
- if (res == FALSE) {
+ bool res = audioSocket.Write(buffer, amount);
+ if (res == false) {
WORD dPort;
PIPSocket::Address destination;
@@ -134,14 +134,14 @@
}
-BOOL UdpSoundChannel::Read(void * buffer, PINDEX amount)
+bool UdpSoundChannel::Read(void * buffer, PINDEX amount)
{
if (!IsOpen()) {
PTRACE(3, "MEDIA\tRead failed as this sound channel is closed");
- return FALSE;
+ return false;
}
- BOOL readOk = TRUE;
+ bool readOk = true;
PTRACE(7, "MEDIA\tNow do a read of " << amount << " bytes for " << GetSSLabel(isSource));
PTRACE(7, "MEDIA\tThe read queue has a buffered bytes size of " << readQueue.GetLength());
@@ -151,7 +151,7 @@
if (!readOk) {
PTRACE(3, "MEDIA\tThe read of a packet from a socket failed for "
<< GetSSLabel(isSource));
- return FALSE;
+ return false;
}
PTRACE(7, "The socket provided us with "
<< audioSocket.GetLastReadCount() << " bytes");
@@ -161,7 +161,7 @@
<< readQueue.GetLength() << " bytes");
if (!readOk) {
PTRACE(3, "Failed to write incoming packet to the memory queue");
- return FALSE;
+ return false;
}
}
@@ -172,30 +172,30 @@
}
-BOOL UdpSoundChannel::Close()
+bool UdpSoundChannel::Close()
{
PTRACE(3, "Close audio channel now for " << GetSSLabel(isSource));
PTRACE(6, "os_handle or fd = " << os_handle);
audioSocket.Close();
os_handle = -1;
- return TRUE;
+ return true;
}
-BOOL UdpSoundChannel::IsOpen() const
+bool UdpSoundChannel::IsOpen() const
{
if (os_handle < 0) {
PTRACE(6, "udp sound channel is closed");
- return FALSE;
+ return false;
}
if (audioSocket.IsOpen()) {
PTRACE(6, "udpsound channel is open");
- return TRUE;
+ return true;
}
PTRACE(6, "udp sound channel is closed");
- return FALSE;
+ return false;
}
void UdpSoundChannel::PrintOn( ostream & strm ) const
@@ -230,7 +230,7 @@
AudioDelay::AudioDelay()
{
- firstTime = TRUE;
+ firstTime = true;
error = 0;
}
@@ -240,15 +240,15 @@
void AudioDelay::Restart()
{
- firstTime = TRUE;
+ firstTime = true;
}
-BOOL AudioDelay::Delay(int frameTime)
+bool AudioDelay::Delay(int frameTime)
{
if (firstTime) {
- firstTime = FALSE;
+ firstTime = false;
previousTime = PTime();
- return TRUE;
+ return true;
}
error += frameTime;
1
0