[Sofaswitch-svn] [commit] r397 - in sofaswitch/trunk: . am callflow/src console mcu server sofa sofa/include/sofa sound voip
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 */
participants (1)
-
SofaSWITCH SVN