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
September 2006
- 2 participants
- 78 discussions
Author: derek
Date: Mon Sep 18 23:47:21 2006
New Revision: 105
Modified:
sofaswitch/trunk/sound/comms.cxx
sofaswitch/trunk/sound/comms.h
sofaswitch/trunk/sound/main.cxx
Log:
Use library method to advise the remote controller of
dtmf received (read from the keyboard).
Modified: sofaswitch/trunk/sound/comms.cxx
==============================================================================
--- sofaswitch/trunk/sound/comms.cxx (original)
+++ sofaswitch/trunk/sound/comms.cxx Mon Sep 18 23:47:21 2006
@@ -112,12 +112,6 @@
MessageFrame::WaitForTermination();
}
-void Comms::SendMessageToController(PString & message)
-{
- SendThisMessageTo(message, GetRemoteController());
-}
-
-
void Comms::SilentlyEndAll()
{
Modified: sofaswitch/trunk/sound/comms.h
==============================================================================
--- sofaswitch/trunk/sound/comms.h (original)
+++ sofaswitch/trunk/sound/comms.h Mon Sep 18 23:47:21 2006
@@ -69,11 +69,7 @@
/**Block the calling process, and return when the threads have
terminated */
virtual void WaitForTermination();
-
- /**Send this message to the current controller. Typically, this will be a
- * message stating that dtmf has been read from the keyboard. */
- void SendMessageToController(PString & message);
-
+
/**Report if we were stopped by hangup */
BOOL StoppedByHangup() { return stopByHangup; }
Modified: sofaswitch/trunk/sound/main.cxx
==============================================================================
--- sofaswitch/trunk/sound/main.cxx (original)
+++ sofaswitch/trunk/sound/main.cxx Mon Sep 18 23:47:21 2006
@@ -68,8 +68,7 @@
case 'd' : {
PString message;
console >> message;
- message = PString("SENDDTMF ") + message;
- comms.SendMessageToController(message);
+ comms.DtmfReceivedFromTheWorld(message);
cout << "Command ? " << flush;
}
break;
1
0
19 Sep '06
Author: derek
Date: Mon Sep 18 23:28:46 2006
New Revision: 104
Modified:
sofaswitch/trunk/server/docs.cfg
sofaswitch/trunk/sound/docs.cfg
Log:
Fix docs configuration files.
Modified: sofaswitch/trunk/server/docs.cfg
==============================================================================
--- sofaswitch/trunk/server/docs.cfg (original)
+++ sofaswitch/trunk/server/docs.cfg Mon Sep 18 23:28:46 2006
@@ -1,41 +1,43 @@
-# Doxyfile 1.0.0
+# Doxyfile 1.4.6
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SSServer, or Sofa Switch Server"
-PROJECT_NUMBER =
+PROJECT_NAME = Server - from the SofaSwitch set of utilities
+PROJECT_NUMBER = 1.0.0
OUTPUT_DIRECTORY =
-#CREATE_SUBDIRS = NO
+CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
-#ABBREVIATE_BRIEF =
+ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH =
-#STRIP_FROM_INC_PATH =
+STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
-DISTRIBUTE_GROUP_DOC = NO
+SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
-#SUBGROUPING = YES
+BUILTIN_STL_SUPPORT = NO
+DISTRIBUTE_GROUP_DOC = NO
+SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
-EXTRACT_ALL = NO
-EXTRACT_PRIVATE = NO
-EXTRACT_STATIC = NO
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = YES
+EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
-#EXTRACT_LOCAL_METHODS = NO
+EXTRACT_LOCAL_METHODS = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
@@ -46,8 +48,8 @@
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
-#SORT_BRIEF_DOCS = NO
-#SORT_BY_SCOPE_NAME = NO
+SORT_BRIEF_DOCS = NO
+SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
@@ -55,6 +57,8 @@
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
+SHOW_DIRECTORIES = NO
+FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
@@ -62,13 +66,14 @@
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = .
-FILE_PATTERNS =
+FILE_PATTERNS = *.h overview.cxx
RECURSIVE = NO
EXCLUDE =
EXCLUDE_SYMLINKS = NO
@@ -76,9 +81,9 @@
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
-IMAGE_PATH = .
+IMAGE_PATH =
INPUT_FILTER =
-#FILTER_PATTERNS =
+FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
@@ -88,18 +93,19 @@
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
+USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = NO
+ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
-HTML_OUTPUT = html
+HTML_OUTPUT =
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
@@ -113,7 +119,7 @@
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
-GENERATE_TREEVIEW = YES
+GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
@@ -153,7 +159,7 @@
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
-#XML_PROGRAMLISTING = YES
+XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
@@ -174,7 +180,7 @@
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
-PREDEFINED = DOCPLUSLUS DOC_PLUS_PLUS
+PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
@@ -193,18 +199,22 @@
HAVE_DOT = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
-UML_LOOK = YES
-TEMPLATE_RELATIONS = YES
+GROUP_GRAPHS = YES
+UML_LOOK = NO
+TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
-DOT_IMAGE_FORMAT = jpg
+DIRECTORY_GRAPH = YES
+DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 0
+DOT_TRANSPARENT = NO
+DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
Modified: sofaswitch/trunk/sound/docs.cfg
==============================================================================
--- sofaswitch/trunk/sound/docs.cfg (original)
+++ sofaswitch/trunk/sound/docs.cfg Mon Sep 18 23:28:46 2006
@@ -1,33 +1,35 @@
-# Doxyfile 1.3.8
+# Doxyfile 1.4.6
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SSSound : Sofa Switch Sound"
-PROJECT_NUMBER =
+PROJECT_NAME = Sound - part of the Sofa Switch set of utilities
+PROJECT_NUMBER = 1.0.0
OUTPUT_DIRECTORY =
-#CREATE_SUBDIRS = NO
+CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
-#ABBREVIATE_BRIEF =
+ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH =
-#STRIP_FROM_INC_PATH =
+STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
-DISTRIBUTE_GROUP_DOC = NO
+SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
-#SUBGROUPING = YES
+BUILTIN_STL_SUPPORT = NO
+DISTRIBUTE_GROUP_DOC = NO
+SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
@@ -35,7 +37,7 @@
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
-#EXTRACT_LOCAL_METHODS = NO
+EXTRACT_LOCAL_METHODS = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
@@ -46,8 +48,8 @@
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
-#SORT_BRIEF_DOCS = NO
-#SORT_BY_SCOPE_NAME = NO
+SORT_BRIEF_DOCS = NO
+SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
@@ -55,6 +57,8 @@
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
+SHOW_DIRECTORIES = NO
+FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
@@ -62,13 +66,14 @@
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
-INPUT = . ../sofa/docs.cfg ../sofa/src ../sofa/include/sofa
-FILE_PATTERNS =
+INPUT =
+FILE_PATTERNS = *.h overview.cxx
RECURSIVE = NO
EXCLUDE =
EXCLUDE_SYMLINKS = NO
@@ -78,7 +83,7 @@
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
-#FILTER_PATTERNS =
+FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
@@ -88,11 +93,12 @@
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
+USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = NO
+ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
@@ -103,7 +109,7 @@
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
-HTML_STYLESHEET =
+HTML_STYLESHEET = YES
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
@@ -113,7 +119,7 @@
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
-GENERATE_TREEVIEW = YES
+GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
@@ -153,7 +159,7 @@
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
-#XML_PROGRAMLISTING = YES
+XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
@@ -174,7 +180,7 @@
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
-PREDEFINED = DOCPLUSLUS DOC_PLUS_PLUS
+PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
@@ -190,21 +196,25 @@
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = NO
+HAVE_DOT = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
-UML_LOOK = YES
-TEMPLATE_RELATIONS = YES
+GROUP_GRAPHS = YES
+UML_LOOK = NO
+TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
-DOT_IMAGE_FORMAT = jpg
+DIRECTORY_GRAPH = YES
+DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 0
+DOT_TRANSPARENT = NO
+DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
1
0
Author: derek
Date: Mon Sep 18 23:28:08 2006
New Revision: 103
Added:
sofaswitch/trunk/sofa/docs.cfg
Removed:
sofaswitch/trunk/sofa/sofa_cfg.dxy
Modified:
sofaswitch/trunk/sofa/Makefile
Log:
Rename the file back to docs.cfg.. Fix target in Makefile.
Modified: sofaswitch/trunk/sofa/Makefile
==============================================================================
--- sofaswitch/trunk/sofa/Makefile (original)
+++ sofaswitch/trunk/sofa/Makefile Mon Sep 18 23:28:08 2006
@@ -243,7 +243,7 @@
$(DESTDIR)${exec_prefix}/lib/$(LIBNAME_PAT)
docs:
- doxygen sofa_cfg.dxy
+ doxygen docs.cfg
distclean:
Added: sofaswitch/trunk/sofa/docs.cfg
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/sofa/docs.cfg Mon Sep 18 23:28:08 2006
@@ -0,0 +1,213 @@
+# Doxyfile 1.0.0
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = "Sofa Switch library"
+PROJECT_NUMBER =
+OUTPUT_DIRECTORY =
+#CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+USE_WINDOWS_ENCODING = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+#ABBREVIATE_BRIEF =
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = YES
+STRIP_FROM_PATH =
+#STRIP_FROM_INC_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP = NO
+INHERIT_DOCS = YES
+DISTRIBUTE_GROUP_DOC = NO
+TAB_SIZE = 8
+ALIASES =
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+#SUBGROUPING = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = NO
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = NO
+EXTRACT_LOCAL_CLASSES = YES
+#EXTRACT_LOCAL_METHODS = NO
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+#SORT_BRIEF_DOCS = NO
+#SORT_BY_SCOPE_NAME = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = . ./include/sofa ./src
+FILE_PATTERNS =
+RECURSIVE = NO
+EXCLUDE =
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+#FILTER_PATTERNS =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+VERBATIM_HEADERS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = NO
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = NO
+CHM_FILE =
+HHC_LOCATION =
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = NO
+USE_PDFLATEX = NO
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+#XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED = DOCPLUSLUS DOC_PLUS_PLUS
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = YES
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+UML_LOOK = YES
+TEMPLATE_RELATIONS = YES
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = YES
+GRAPHICAL_HIERARCHY = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+MAX_DOT_GRAPH_DEPTH = 0
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
1
0
19 Sep '06
Author: derek
Date: Mon Sep 18 23:19:54 2006
New Revision: 102
Removed:
sofaswitch/trunk/sofa/lib/
Modified:
sofaswitch/trunk/sofa/Makefile
Log:
Remove the lib path from the svn repositary. Does not belong here.
Extend the distclean option.
Modified: sofaswitch/trunk/sofa/Makefile
==============================================================================
--- sofaswitch/trunk/sofa/Makefile (original)
+++ sofaswitch/trunk/sofa/Makefile Mon Sep 18 23:19:54 2006
@@ -252,6 +252,7 @@
@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 " "
1
0
Author: derek
Date: Mon Sep 18 23:12:23 2006
New Revision: 101
Added:
sofaswitch/trunk/sofa/sofa_cfg.dxy
Removed:
sofaswitch/trunk/sofa/docs.cfg
Log:
Name change, and alter format of output files.
Added: sofaswitch/trunk/sofa/sofa_cfg.dxy
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/sofa/sofa_cfg.dxy Mon Sep 18 23:12:23 2006
@@ -0,0 +1,213 @@
+# Doxyfile 1.0.0
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = "Sofa Switch library"
+PROJECT_NUMBER =
+OUTPUT_DIRECTORY =
+#CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+USE_WINDOWS_ENCODING = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+#ABBREVIATE_BRIEF =
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = YES
+STRIP_FROM_PATH =
+#STRIP_FROM_INC_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP = NO
+INHERIT_DOCS = YES
+DISTRIBUTE_GROUP_DOC = NO
+TAB_SIZE = 8
+ALIASES =
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+#SUBGROUPING = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = NO
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = NO
+EXTRACT_LOCAL_CLASSES = YES
+#EXTRACT_LOCAL_METHODS = NO
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+#SORT_BRIEF_DOCS = NO
+#SORT_BY_SCOPE_NAME = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = . ./include/sofa ./src
+FILE_PATTERNS =
+RECURSIVE = NO
+EXCLUDE =
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+#FILTER_PATTERNS =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+VERBATIM_HEADERS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = NO
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = NO
+CHM_FILE =
+HHC_LOCATION =
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = NO
+USE_PDFLATEX = NO
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+#XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED = DOCPLUSLUS DOC_PLUS_PLUS
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = YES
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+UML_LOOK = YES
+TEMPLATE_RELATIONS = YES
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = YES
+GRAPHICAL_HIERARCHY = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+MAX_DOT_GRAPH_DEPTH = 0
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
1
0
[Sofaswitch-svn] [commit] r100 - in sofaswitch/trunk: controller server sofa/include/sofa sofa/src
by SofaSWITCH SVN 18 Sep '06
by SofaSWITCH SVN 18 Sep '06
18 Sep '06
Author: derek
Date: Mon Sep 18 19:47:44 2006
New Revision: 100
Modified:
sofaswitch/trunk/controller/testonemcu.py
sofaswitch/trunk/controller/testonevoip.py
sofaswitch/trunk/server/main.cxx
sofaswitch/trunk/sofa/include/sofa/messages.h
sofaswitch/trunk/sofa/src/messages.cxx
sofaswitch/trunk/sofa/src/messlist.cxx
Log:
Update library to work better.
Modified: sofaswitch/trunk/controller/testonemcu.py
==============================================================================
--- sofaswitch/trunk/controller/testonemcu.py (original)
+++ sofaswitch/trunk/controller/testonemcu.py Mon Sep 18 19:47:44 2006
@@ -23,7 +23,7 @@
## each iteration is done in a new fork.
expstart = time.time()
-maxcalls = 200
+maxcalls = 20
calls = range(maxcalls)
for i in calls:
Modified: sofaswitch/trunk/controller/testonevoip.py
==============================================================================
--- sofaswitch/trunk/controller/testonevoip.py (original)
+++ sofaswitch/trunk/controller/testonevoip.py Mon Sep 18 19:47:44 2006
@@ -8,7 +8,7 @@
from basecall import *
-maxcalls = 10
+maxcalls = 1
server = 'localhost'
@@ -77,7 +77,7 @@
# controller.send_message_to('callnode h323:kauri', voipNode)
controller.send_message_to('transferudp ' + voipNode, voipNode)
- time.sleep(3);
+ time.sleep(30);
controller.send_message_to('hangup', voipNode)
controller.wait_event_on_list(controller.terminatingList, voipNode)
Modified: sofaswitch/trunk/server/main.cxx
==============================================================================
--- sofaswitch/trunk/server/main.cxx (original)
+++ sofaswitch/trunk/server/main.cxx Mon Sep 18 19:47:44 2006
@@ -256,7 +256,7 @@
void Manager::AppendRunning(PSafePtr<TcpConnection> conn, const PString & id)
{
PTRACE(3, "Manager\tAppendRunning " << *conn);
-
+ PTRACE(3, "Manager\tSupplied ID is \"" << id << "\"");
if (id == PString("?")) {
conn->GenerateSourceId();
PTRACE(3, "ADD " << conn->GetSourceId() << " which is a random Id");
@@ -546,7 +546,7 @@
return;
}
-
+ PTRACE(3, "Manager\tSetReadTimeout to 2 seconds");
messagesSocket.SetReadTimeout(2000); //We demand the source id within 2 seconds.
//Get the id of the remote host connected on this socket
if (!messagesSocket.Read(message.GetPointer(), 2000)) {
@@ -555,7 +555,8 @@
return;
}
messagesSocket.SetReadTimeout(PMaxTimeInterval);
-
+ PTRACE(5, "Manager\tHave read the first packet, and it was " << endl
+ << ::hex << message << ::dec);
if (!manager.KeepRunning()) {
PTRACE(2, "End of this tcp connection as the manager is ending now " << *this);
manager.AppendDead(this);
Modified: sofaswitch/trunk/sofa/include/sofa/messages.h
==============================================================================
--- sofaswitch/trunk/sofa/include/sofa/messages.h (original)
+++ sofaswitch/trunk/sofa/include/sofa/messages.h Mon Sep 18 19:47:44 2006
@@ -101,13 +101,18 @@
a particular call. Other uses are indeed possible. */
PTimeInterval TimeSinceCreation() { return PTime() - createdAt; }
- /**Mark This frame as having been created right now, which is a
- required function for those frames sitting in the pending
- list */
+ /**Mark This frame as having been created right now, which is a required
+ function for those frames sitting in the pending list */
void SetCreatedAtNow() { createdAt = PTime(); }
- /**Set the name of the remote controller*/
+ /**Set the name of the remote controller. This method sends a message to
+ the remote server, and advises the server who to inform on our
+ death. This means that the remote controller knows of our death, even
+ if we segfault and die.*/
void SetRemoteController(const PString & rc);
+
+ /**Report the name of the remote controller.*/
+ PString GetRemoteController() { return remoteController; }
/**Report TRUE/FALSE if this message frame instance is in the
process of closing down */
Modified: sofaswitch/trunk/sofa/src/messages.cxx
==============================================================================
--- sofaswitch/trunk/sofa/src/messages.cxx (original)
+++ sofaswitch/trunk/sofa/src/messages.cxx Mon Sep 18 19:47:44 2006
@@ -139,11 +139,6 @@
void MessageFrame::CloseMessagesSocket()
{
PTRACE(3, "Close messages socket for " << GetOurId());
- PTRACE(3, "Send Terminating to \"" << remoteController << "\"");
- if (remoteController.IsEmpty()) {
- PTRACE(3, "Not sent, as remoteController is not defined");
- } else
- SendThisMessageTo("Terminating", remoteController);
PThread::Sleep(100); //Let the message be sent, then close the socket.
messagesSocket.Close();
@@ -902,6 +897,13 @@
remoteController = rc;
PTRACE(3, "SET Remote controller to " << remoteController);
+ /*We now send a message to the server. This message tells the server that
+ when this node dies, to advise the designated node that we have died.
+
+ With this approach, the remote controller (i.e. a python script) will
+ receive a message about our death even though this box segfaulted and died
+ in 1 nanosecond. */
+
PStringStream message;
message << "AdviseOnTermination " << rc;
PBYTEArray binary;
Modified: sofaswitch/trunk/sofa/src/messlist.cxx
==============================================================================
--- sofaswitch/trunk/sofa/src/messlist.cxx (original)
+++ sofaswitch/trunk/sofa/src/messlist.cxx Mon Sep 18 19:47:44 2006
@@ -285,6 +285,7 @@
PTRACE(1, "Delete old message frame thread pending thread");
delete removeOldMessageFrame;
+ PTRACE(1, "old Message Frame Pending collector now deleted. ");
}
void MessageFrameListPending::WaitForTermination()
1
0
Author: derek
Date: Mon Sep 18 19:46:52 2006
New Revision: 99
Modified:
sofaswitch/trunk/sound/comms.cxx
sofaswitch/trunk/sound/comms.h
sofaswitch/trunk/sound/docs.cfg
sofaswitch/trunk/sound/main.cxx
sofaswitch/trunk/sound/main.h
Log:
Lots of fixes. Works correctly now.
Remove local variable of currentController from comms.
Modified: sofaswitch/trunk/sound/comms.cxx
==============================================================================
--- sofaswitch/trunk/sound/comms.cxx (original)
+++ sofaswitch/trunk/sound/comms.cxx Mon Sep 18 19:46:52 2006
@@ -39,100 +39,100 @@
////////////////////////////////////////////////////////////////////////////////
Comms::Comms(LaunchNewId & lid)
- : MessageFrame(lid, 63000)
+ : MessageFrame(lid, 63000)
{
- stopByExit = FALSE;
- stopByHangup = TRUE;
-
- tar = NULL;
- taw = NULL;
+ stopByExit = FALSE;
+ stopByHangup = TRUE;
+
+ tar = NULL;
+ taw = NULL;
}
Comms::~Comms()
{
- PTRACE(3, "Comms destructor ");
- Terminate();
- WaitForTermination();
- PWaitAndSignal m(lockReaderWriter);
-
- if (tar != NULL)
- delete tar;
-
- if (taw != NULL)
- delete taw;
+ PTRACE(3, "Comms destructor ");
+ Terminate();
+ WaitForTermination();
+ PWaitAndSignal m(lockReaderWriter);
+
+ if (tar != NULL)
+ delete tar;
+
+ if (taw != NULL)
+ delete taw;
}
void Comms::OnTermination()
{
- PTRACE(3, "Comms sound thread has ended");
-
- Terminate();
+ PTRACE(3, "Comms sound thread has ended");
+
+ Terminate();
}
-
+
void Comms::Terminate()
{
- PTRACE(3, "Terminate comms instance ");
- PWaitAndSignal m(lockReaderWriter);
-
- if (tar != NULL) {
- PTRACE(3, "Set tar to terminate");
- tar->Terminate();
- } else {
- PTRACE(3, "NO tar to terminate");
- }
-
- if (taw != NULL) {
- PTRACE(3, "Set taw to terminate");
- taw->Terminate();
- } else {
- PTRACE(3, "NO taw to terminate");
- }
+ PTRACE(3, "Terminate comms instance ");
+ PWaitAndSignal m(lockReaderWriter);
+
+ if (tar != NULL) {
+ PTRACE(3, "Set tar to terminate");
+ tar->Terminate();
+ } else {
+ PTRACE(3, "NO tar to terminate");
+ }
+
+ if (taw != NULL) {
+ PTRACE(3, "Set taw to terminate");
+ taw->Terminate();
+ } else {
+ PTRACE(3, "NO taw to terminate");
+ }
}
void Comms::WaitForTermination()
{
- BOOL keepGoing = TRUE;
- while (keepGoing) {
- {
- PTRACE(6, "Comms\tWaitForTermination");
- PWaitAndSignal m(lockReaderWriter);
- if (tar != NULL) {
- keepGoing = !tar->IsTerminated();
- }
- if (taw != NULL) {
- keepGoing = keepGoing || (!taw->IsTerminated());
- }
- if ((taw == NULL) && (tar == NULL))
- keepGoing = !MessageFrame::IsTerminated();
+ BOOL keepGoing = TRUE;
+ while (keepGoing) {
+ {
+ PTRACE(6, "Comms\tWaitForTermination");
+ PWaitAndSignal m(lockReaderWriter);
+ if (tar != NULL) {
+ keepGoing = !tar->IsTerminated();
+ }
+ if (taw != NULL) {
+ keepGoing = keepGoing || (!taw->IsTerminated());
+ }
+ if ((taw == NULL) && (tar == NULL))
+ keepGoing = !MessageFrame::IsTerminated();
+ }
+ PThread::Sleep(100);
}
- PThread::Sleep(100);
- }
-
- MessageFrame::WaitForTermination();
+
+ MessageFrame::WaitForTermination();
}
void Comms::SendMessageToController(PString & message)
{
- SendThisMessageTo(message, currentController);
+ SendThisMessageTo(message, GetRemoteController());
}
void Comms::SilentlyEndAll()
{
-
+
}
BOOL Comms::SendDtmf(const PString & dtmfVals)
{
- cout << "Received DTMF from the controller of " << dtmfVals << " " << PTime();
+ cerr << "At " << PTime() << " received DTMF from the controller of ---->>>|||" << dtmfVals << endl;
return TRUE;
}
void Comms::ProcessRequestNewId(PStringArray &cmds, PString & sender)
{
- currentController = sender;
+ SetRemoteController(sender);
PString answer = PString("REQUESTNEWID ") + Audio::Current().GetNodeId();
SendThisMessageTo(answer, sender);
return;
@@ -140,101 +140,108 @@
void Comms::ProcessHangup(PStringArray &cmds, PString & sender)
{
- stopByExit = TRUE;
- SetRemoteController(sender);
- Terminate();
+ stopByExit = TRUE;
+ SetRemoteController(sender);
+ Terminate();
}
void Comms::ProcessCallNode(PStringArray &cmds, PString & sender)
{
- SendThisMessageTo("Failed to do " + cmds[0] + " as we are a sound handler", "", sender);
- return;
+ SendThisMessageTo("Failed to do " + cmds[0] + " as we are a sound handler", "", sender);
+ return;
}
-void Comms::ProcessStatusQuery(PStringArray &cmds, PString & sender)
+void Comms::GetStatusInformation(PString & statusInfo)
{
- PStringStream countMessage;
- countMessage << "sound card handler" << endl;
- {
- PWaitAndSignal m(lockReaderWriter);
- if (tar != NULL)
- countMessage << PString("Reader = ") << PString(tar->GetCountPackets())
- << PString(" packets");
- else
- countMessage << PString(" no read count available");
- countMessage << endl << endl;
+ PStringStream countMessage;
+ countMessage << "sound card handler" << endl;
+ {
+ PWaitAndSignal m(lockReaderWriter);
+ if (tar != NULL)
+ countMessage << PString("Reader = ") << PString(tar->GetCountPackets())
+ << PString(" packets");
+ else
+ countMessage << PString(" no read count available");
+ countMessage << endl << endl;
+
+ if (taw != NULL)
+ countMessage << PString("writer = ") << PString(taw->GetCountPackets())
+ << PString(" packets");
+ else
+ countMessage << PString(" no write count available");
+ countMessage << endl << endl;
+ }
+ PString partner = GetMediaPartner();
+ countMessage << "other node is: " << (partner.IsEmpty() ? " not specified" : partner);
+ countMessage << endl << endl << "............................ ";
- if (taw != NULL)
- countMessage << PString("writer = ") << PString(taw->GetCountPackets())
- << PString(" packets");
- else
- countMessage << PString(" no write count available");
- countMessage << endl << endl;
- }
- PString partner = GetMediaPartner();
- countMessage << "other node is: " << (partner.IsEmpty() ? " not specified" : partner);
- countMessage << endl << endl << "............................ ";
+ statusInfo= countMessage;
+}
- SendThisMessageTo(countMessage, sender);
+void Comms::ProcessStatusQuery(PStringArray &cmds, PString & sender)
+{
+ PString statusInfo;
+ GetStatusInformation(statusInfo);
+ SendThisMessageTo(statusInfo, sender);
}
void Comms::ProcessDuration(PStringArray &cmds, PString & sender)
{
- SendThisMessageTo(cmds[0] + PString(" sorry, duration not implemented "), "", sender);
+ SendThisMessageTo(cmds[0] + PString(" sorry, duration not implemented "), "", sender);
}
void Comms::ProcessIdentify(PStringArray &cmds, PString & sender)
{
- SendThisMessageTo(cmds[0] + PString(" node for handling sound port comms"), "", sender);
+ SendThisMessageTo(cmds[0] + PString(" node for handling sound port comms"), "", sender);
}
void Comms::ProcessDebug(PStringArray &cmds, PString & sender)
{
- SendThisMessageTo(cmds[0] + PString(" sorry, debug not implemented "), "", sender);
+ SendThisMessageTo(cmds[0] + PString(" sorry, debug not implemented "), "", sender);
}
void Comms::ProcessAnswer(PStringArray &cmds, PString & sender)
{
- SendThisMessageTo(cmds[0] + PString(" sorry, answer not implemented "), "", sender);
+ SendThisMessageTo(cmds[0] + PString(" sorry, answer not implemented "), "", sender);
}
void Comms::ProcessQuitNow(PStringArray &cmds, PString & sender)
{
- stopByExit = TRUE;
- SetRemoteController(sender);
- Terminate();
+ stopByExit = TRUE;
+ SetRemoteController(sender);
+ Terminate();
}
BOOL Comms::ConstructReader(PSoundChannel & sound)
{
- PWaitAndSignal m(lockReaderWriter);
-
- tar = new TestAudioRead(audioSocket, sound);
- PThread::Sleep(100);
-
- if (tar->IsTerminated()) {
- PTRACE(3, "OOPS TestAudioRead has finished real quick");
- return FALSE;
- }
- return TRUE;
+ PWaitAndSignal m(lockReaderWriter);
+
+ tar = new TestAudioRead(audioSocket, sound);
+ PThread::Sleep(100);
+
+ if (tar->IsTerminated()) {
+ PTRACE(3, "OOPS TestAudioRead has finished real quick");
+ return FALSE;
+ }
+ return TRUE;
}
BOOL Comms::ConstructWriter(PSoundChannel & sound)
{
- PWaitAndSignal m(lockReaderWriter);
-
- taw = new TestAudioWrite(audioSocket, sound);
- PThread::Sleep(100);
-
- if (taw->IsTerminated()) {
- PTRACE(3, "OOPS TestAudioWrite has finished real quick");
- return FALSE;
- }
-
- return TRUE;
+ PWaitAndSignal m(lockReaderWriter);
+
+ taw = new TestAudioWrite(audioSocket, sound);
+ PThread::Sleep(100);
+
+ if (taw->IsTerminated()) {
+ PTRACE(3, "OOPS TestAudioWrite has finished real quick");
+ return FALSE;
+ }
+
+ return TRUE;
}
Modified: sofaswitch/trunk/sound/comms.h
==============================================================================
--- sofaswitch/trunk/sound/comms.h (original)
+++ sofaswitch/trunk/sound/comms.h Mon Sep 18 19:46:52 2006
@@ -30,8 +30,8 @@
#ifdef P_USE_PRAGMA
#pragma interface
#endif
-
+
#include <ptlib.h>
#include <ptlib/sound.h>
#include <sofa/messages.h>
@@ -46,115 +46,116 @@
device */
class Comms : public MessageFrame
{
-
+
public:
- /**Constuctor */
- Comms(LaunchNewId & lid);
-
- /**Terminate, wait for threads to exit, and destroy the tar & taw
- threads */
- ~Comms();
-
- /**Open the test audio read thread..
- Return TRUE if successfull, FALSE on failure */
- BOOL ConstructReader(PSoundChannel & sound);
-
- /**Open the test audio write thread.
- Return TRUE if successfull, FALSE on failure */
- BOOL ConstructWriter(PSoundChannel & sound);
-
- /**Shut down the read and write methods */
- virtual void Terminate();
-
- /**Block the calling process, and return when the threads have
- terminated */
- virtual void WaitForTermination();
-
- /**Send this message to the current controller. Typically, this will be a
- * message stating that dtmf has been read from the keyboard. */
- void SendMessageToController(PString & message);
-
- /**Report if we were stopped by hangup */
- BOOL StoppedByHangup() { return stopByHangup; }
-
- /**Report if we were stopped by a shutdown request */
- BOOL StoppedByExit() { return stopByExit; }
-
+ /**Constuctor */
+ Comms(LaunchNewId & lid);
+
+ /**Terminate, wait for threads to exit, and destroy the tar & taw
+ threads */
+ ~Comms();
+
+ /**Open the test audio read thread..
+ Return TRUE if successfull, FALSE on failure */
+ BOOL ConstructReader(PSoundChannel & sound);
+
+ /**Open the test audio write thread.
+ Return TRUE if successfull, FALSE on failure */
+ BOOL ConstructWriter(PSoundChannel & sound);
+
+ /**Shut down the read and write methods */
+ virtual void Terminate();
+
+ /**Block the calling process, and return when the threads have
+ terminated */
+ virtual void WaitForTermination();
+
+ /**Send this message to the current controller. Typically, this will be a
+ * message stating that dtmf has been read from the keyboard. */
+ void SendMessageToController(PString & message);
+
+ /**Report if we were stopped by hangup */
+ BOOL StoppedByHangup() { return stopByHangup; }
+
+ /**Report if we were stopped by a shutdown request */
+ 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
+ keybaord */
+ void GetStatusInformation(PString & statusInfo);
+
protected:
-
- /**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. */
+
+ /**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 have received a command asking us to provide the id of a new
- communications nodes, that will be controlled only by the remote
- node */
- virtual void ProcessRequestNewId(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. */
- virtual void OnTermination();
-
- /**we have received a hangup message, so end the call */
- virtual void ProcessHangup(PStringArray &cmds, PString & sender);
-
- /**we have received a Call other Node command, so do it and reply
- accordingly*/
- virtual void ProcessCallNode(PStringArray &cmds, PString & sender);
-
- /**we have received a query status command, so do it and reply accordingly*/
- virtual void ProcessStatusQuery(PStringArray &cmds, PString & sender);
-
- /**we have received a command queryig the current call duration ,
- so extract information & answer */
- virtual void ProcessDuration(PStringArray &cmds, PString & sender);
-
- /**we have received a command requesting that we identify ourselves
- so do it and reply accordingly*/
- virtual void ProcessIdentify(PStringArray &cmds, PString & sender);
-
- /**we have received a command which enables/disables debug
- information so install as required and reply accordingly*/
- virtual void ProcessDebug(PStringArray &cmds, PString & sender);
-
- /**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);
-
- /**we have received a command advising us that we are to end now */
- virtual void ProcessQuitNow(PStringArray &cmds, PString & sender);
-
- /**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; }
-
- /**We have a comms error, so just close everything right now. Send
- no message to the remote node - just end end end. */
- virtual void SilentlyEndAll();
-
- /**@name manage the audio streams of data to the sound device */
- //@{
- /**class that writes audio data to sound device */
- TestAudioWrite *taw;
-
- /**Class that reads audio from the sound device */
- TestAudioRead *tar;
-
- /**Mutex which protects access to the tar/taw variables */
- PMutex lockReaderWriter;
- //@}
-
- /**The terminating condition was */
- BOOL stopByHangup;
-
- /**The terminating condition was */
- BOOL stopByExit;
-
- /**The id of the last node who has requested a sound worker. This node will
- receive all dtmf messages. */
- PString currentController;
+
+ /**we have received a command asking us to provide the id of a new
+ communications nodes, that will be controlled only by the remote
+ node */
+ virtual void ProcessRequestNewId(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. */
+ virtual void OnTermination();
+
+ /**we have received a hangup message, so end the call */
+ virtual void ProcessHangup(PStringArray &cmds, PString & sender);
+
+ /**we have received a Call other Node command, so do it and reply
+ accordingly*/
+ virtual void ProcessCallNode(PStringArray &cmds, PString & sender);
+
+ /**we have received a query status command, so do it and reply accordingly*/
+ virtual void ProcessStatusQuery(PStringArray &cmds, PString & sender);
+
+ /**we have received a command queryig the current call duration ,
+ so extract information & answer */
+ virtual void ProcessDuration(PStringArray &cmds, PString & sender);
+
+ /**we have received a command requesting that we identify ourselves
+ so do it and reply accordingly*/
+ virtual void ProcessIdentify(PStringArray &cmds, PString & sender);
+
+ /**we have received a command which enables/disables debug
+ information so install as required and reply accordingly*/
+ virtual void ProcessDebug(PStringArray &cmds, PString & sender);
+
+ /**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);
+
+ /**we have received a command advising us that we are to end now */
+ virtual void ProcessQuitNow(PStringArray &cmds, PString & sender);
+
+ /**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; }
+
+ /**We have a comms error, so just close everything right now. Send
+ no message to the remote node - just end end end. */
+ virtual void SilentlyEndAll();
+
+ /**@name manage the audio streams of data to the sound device */
+ //@{
+ /**class that writes audio data to sound device */
+ TestAudioWrite *taw;
+
+ /**Class that reads audio from the sound device */
+ TestAudioRead *tar;
+
+ /**Mutex which protects access to the tar/taw variables */
+ PMutex lockReaderWriter;
+ //@}
+
+ /**The terminating condition was */
+ BOOL stopByHangup;
+
+ /**The terminating condition was */
+ BOOL stopByExit;
};
#endif
Modified: sofaswitch/trunk/sound/docs.cfg
==============================================================================
--- sofaswitch/trunk/sound/docs.cfg (original)
+++ sofaswitch/trunk/sound/docs.cfg Mon Sep 18 19:46:52 2006
@@ -190,7 +190,7 @@
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = YES
+HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
UML_LOOK = YES
Modified: sofaswitch/trunk/sound/main.cxx
==============================================================================
--- sofaswitch/trunk/sound/main.cxx (original)
+++ sofaswitch/trunk/sound/main.cxx Mon Sep 18 19:46:52 2006
@@ -24,56 +24,78 @@
#define new PNEW
/////////////////////////////////////////////////////////////////////////////
+UserInterface::UserInterface(Comms & _comms,
+ PSoundChannel &_player,
+ PSoundChannel & _recorder)
+ : PThread(1000, NoAutoDeleteThread),
+ comms(_comms),
+ player(_player),
+ recorder(_recorder)
+{
+ endNow = FALSE;
+ Resume();
+}
+
void UserInterface::Main()
{
-
- PConsoleChannel console(PConsoleChannel::StandardInput);
-
- cout << "This program will waits for user commands, and generates DTMF messages as required" << endl;
-
-
- console.SetReadTimeout(500);
-
- PThread::Yield();
-
- PStringStream help;
- help << "Press : " << endl
- << " H or ? help on this interface" << endl
- << " D dtmf Send dtmf message text to the controller"
- << " X or Q exit " << endl;
-
-
- cout << endl << endl << help;
-
- for (;(!endNow) && (!comms.IsTerminated());) {
- char ch = console.ReadChar();
-
- if (endNow)
- break;
-
- switch (tolower(ch)) {
- case 'd' :
- {
- PString message;
- console >> message;
- comms.SendMessageToController(message);
- cout << "Command ? " << flush;
- }
- break;
- case 'x' :
- case 'q' :
- cout << "Exiting." << endl;
- PTRACE(3, "End this program now ");
- return;
+
+ PConsoleChannel console(PConsoleChannel::StandardInput);
+
+ cout << "This program will waits for user commands, and generates DTMF messages as required" << endl;
+
+
+ console.SetReadTimeout(500);
+
+ PThread::Yield();
+
+ PStringStream help;
+ help << "Press : " << endl
+ << " H or ? help on this interface" << endl
+ << " D dtmf Send dtmf message text to the controller" << endl
+ << " S Report the status of this device" << endl
+ << " X or Q exit " << endl;
+
+
+ cout << endl << endl << help;
+
+ for (;!endNow;) {
+ char ch = console.ReadChar();
+
+ if (endNow)
break;
- case '?' :
- case 'h' :
- cout << help << endl;
- cout << "Command ? " << flush;
- default:
- break;
- } // end switch
- } // end for
+
+ switch (tolower(ch)) {
+ case 'd' : {
+ PString message;
+ console >> message;
+ message = PString("SENDDTMF ") + message;
+ comms.SendMessageToController(message);
+ cout << "Command ? " << flush;
+ }
+ break;
+ case 'x' :
+ case 'q' : {
+ endNow = TRUE;
+ PTRACE(3, "End this program now ");
+ }
+ break;
+ case 's' : {
+ PString status;
+ comms.GetStatusInformation(status);
+ cout << status << endl;
+ }
+ break;
+ case '?' :
+ case 'h' :
+ cout << help << endl;
+ cout << "Command ? " << flush;
+ default:
+ break;
+ } // end switch
+ } // end for
+
+ comms.Terminate();
+ cerr << "Exiting." << endl;
}
void UserInterface::Terminate()
@@ -83,174 +105,201 @@
/////////////////////////////////////////////////////////////////////////////
Audio::Audio()
- : PProcess("Derek Smithies code factory", "audio",
- MAJOR_VERSION, MINOR_VERSION, BUILD_TYPE, BUILD_NUMBER)
+ : PProcess("Derek Smithies code factory", "audio",
+ MAJOR_VERSION, MINOR_VERSION, BUILD_TYPE, BUILD_NUMBER)
{
-
+
}
PCREATE_PROCESS(Audio)
-
-void Audio::Main()
+
+ void Audio::Main()
{
- PArgList & args = GetArguments();
- args.Parse(
- "d-sounddevice:"
- "s-server:"
- "i-id:"
- "-password:"
- "h. "
+ PArgList & args = GetArguments();
+ args.Parse(
+ "d-sounddevice:"
+ "s-server: "
+ "i-id: "
+ "h. "
+ "l. "
#if PTRACING
- "o-output:" "-no-output."
- "t-trace." "-no-trace."
+ "o-output: "
+ "t-trace. "
#endif
- "v. "
- "s: ");
-
- if (args.HasOption('h')) {
- cout << "usage: audio "
- << endl
- << " -d dev : use this device " << endl
- << " -h : get help on usage " << endl
- << " -v : report program version " << endl
- << " -s --server srv : server to connect to\n"
- << " -i --id ## : id we are labelled with \n"
- << " --password pwd : password to use\n"
+ "v. "
+ "s: ");
+
+ if (args.HasOption('h')) {
+ cout << "usage: audio "
+ << endl
+ << " -d dev : use this device " << endl
+ << " -h : get help on usage " << endl
+ << " -v : report program version " << endl
+ << " -s --server srv : server to connect to" << endl
+ << " -i --id ## : id we are labelled with" << endl
+ << " -l : list available sound devices" << endl
#if PTRACING
- << " -t --trace : Enable trace, use multiple times for more detail" << endl
- << " -o --output : File for trace output, default is stderr" << endl
+ << " -t --trace : Enable trace, use multiple times for more detail" << endl
+ << " -o --output : File for trace output, default is stderr" << endl
#endif
- << endl;
- return;
- }
-
-
- PTrace::Initialise(args.GetOptionCount('t'),
- args.HasOption('o') ? (const char *)args.GetOptionString('o') : NULL,
- PTrace::Blocks | PTrace::Timestamp | PTrace::Thread | PTrace::FileAndLine);
-
- if (args.HasOption('v')) {
- cout << endl
- << "Product Name: " << (const char *)GetName() << endl
- << "Manufacturer: " << (const char *)GetManufacturer() << endl
- << "Version : " << (const char *)GetVersion(TRUE) << endl
- << "System : " << (const char *)GetOSName() << '-'
- << (const char *)GetOSHardware() << ' '
- << (const char *)GetOSVersion() << endl
<< endl;
return;
- }
-
-
- cout << "Audio Endpoint for SofaSwitch\n";
-
-
- devName = args.GetOptionString('d');
- if (devName.IsEmpty())
- devName = PSoundChannel::GetDefaultDevice(PSoundChannel::Player);
-
- PSoundChannel::Directions dir;
- PStringArray namesPlay;
- dir = PSoundChannel::Player;
- namesPlay = PSoundChannel::GetDeviceNames(dir);
-
-
- if (namesPlay.GetStringsIndex(devName) == P_MAX_INDEX) {
- cout << "could not find " << devName << " in list of available play devices - abort program" << endl;
- cout << "available device names are " << endl;
- for(PINDEX i = 0; i < namesPlay.GetSize(); i++)
- cout << namesPlay[i] << endl;
- return;
- }
-
- PStringArray namesRecord;
- dir = PSoundChannel::Recorder;
- namesRecord = PSoundChannel::GetDeviceNames(dir);
-
- if (namesRecord.GetStringsIndex(devName) == P_MAX_INDEX) {
- cout << "could not find " << devName << " in list of available record devices - abort program" << endl;
- cout << "available device names are " << endl;
- for(PINDEX i = 0; i < namesRecord.GetSize(); i++)
- cout << namesRecord[i] << endl;
- return;
- }
-
- PTRACE(3, "Audio\tTest device " << devName);
-
- PString server;
- if (args.HasOption("server")) {
- server = args.GetOptionString("server");
- PTRACE(3, "server is " << server);
- } else {
- server = "localhost";
- PTRACE(3, "Select a default server of localhost");
- }
-
- PString ourId;
- if (args.HasOption("id")) {
- nodeId = args.GetOptionString("id");
- PTRACE(3, "our ID is " << ourId);
- } else {
- nodeId = "sound";
- PTRACE(3, "Select a default ID of " << ourId);
- }
-
- ourId = server + "/" + ourId;
+ }
- PString ourPassword;
- if (args.HasOption("password")) {
- ourPassword = args.GetOptionString("password");
- PTRACE(3, "password is " << ourPassword);
- } else {
- ourPassword = "audio";
+
+ PTrace::Initialise(args.GetOptionCount('t'),
+ args.HasOption('o') ? (const char *)args.GetOptionString('o') : NULL,
+ PTrace::Blocks | PTrace::Timestamp | PTrace::Thread | PTrace::FileAndLine);
+
+ if (args.HasOption('v')) {
+ cout << endl
+ << "Product Name: " << (const char *)GetName() << endl
+ << "Manufacturer: " << (const char *)GetManufacturer() << endl
+ << "Version : " << (const char *)GetVersion(TRUE) << endl
+ << "System : " << (const char *)GetOSName() << '-'
+ << (const char *)GetOSHardware() << ' '
+ << (const char *)GetOSVersion() << endl
+ << endl;
+ return;
+ }
+
+
+ cout << "Audio Endpoint for SofaSwitch\n";
+
+ if (args.HasOption('l')) {
+ cout << "\n List of play devices\n";
+
+ PSoundChannel::Directions dir;
+ PStringArray namesPlay, namesRecord;
+
+ dir = PSoundChannel::Player;
+ namesPlay = PSoundChannel::GetDeviceNames(dir);
+ for (PINDEX i = 0; i < namesPlay.GetSize(); i++)
+ cout << " \"" << namesPlay[i] << "\"\n";
+
+ cout << "The default play device is \"" << PSoundChannel::GetDefaultDevice(dir) << "\"\n";
+
+ cout << "\nList of Record devices\n";
+
+ dir = PSoundChannel::Recorder;
+ namesRecord = PSoundChannel::GetDeviceNames(dir);
+ for (PINDEX i = 0; i < namesRecord.GetSize(); i++)
+ cout << " \"" << namesRecord[i] << "\"\n";
+
+ cout << "The default record device is \"" << PSoundChannel::GetDefaultDevice(dir) << "\"\n\n";
+ }
+
+
+
+ devName = args.GetOptionString('d');
+ if (devName.IsEmpty())
+ devName = PSoundChannel::GetDefaultDevice(PSoundChannel::Player);
+
+ PSoundChannel::Directions dir;
+ PStringArray namesPlay;
+ dir = PSoundChannel::Player;
+ namesPlay = PSoundChannel::GetDeviceNames(dir);
+
+
+ if (namesPlay.GetStringsIndex(devName) == P_MAX_INDEX) {
+ cout << "could not find " << devName << " in list of available play devices - abort program" << endl;
+ cout << "available device names are " << endl;
+ for(PINDEX i = 0; i < namesPlay.GetSize(); i++)
+ cout << namesPlay[i] << endl;
+ return;
+ }
+
+ PStringArray namesRecord;
+ dir = PSoundChannel::Recorder;
+ namesRecord = PSoundChannel::GetDeviceNames(dir);
+
+ if (namesRecord.GetStringsIndex(devName) == P_MAX_INDEX) {
+ cout << "could not find " << devName << " in list of available record devices - abort program" << endl;
+ cout << "available device names are " << endl;
+ for(PINDEX i = 0; i < namesRecord.GetSize(); i++)
+ cout << namesRecord[i] << endl;
+ return;
+ }
+
+ PTRACE(3, "Audio\tTest device " << devName);
+
+ PString server;
+ if (args.HasOption("server")) {
+ server = args.GetOptionString("server");
+ PTRACE(3, "server is " << server);
+ } else {
+ server = "localhost";
+ PTRACE(3, "Select a default server of localhost");
+ }
+
+ PString ourId;
+ if (args.HasOption("id")) {
+ nodeId = args.GetOptionString("id");
+ PTRACE(3, "our ID is " << ourId);
+ } else {
+ nodeId = "sound";
+ PTRACE(3, "Select a default ID of " << ourId);
+ }
+
+ ourId = server + "/" + nodeId;
+
+ PString ourPassword = "audio";
PTRACE(3, "Select a default password of audio");
- }
-
- LaunchNewId lid(ourId, ourPassword);
- Comms c(lid);
- c.Resume();
-
- PTRACE(3, "Constructed the comms device ");
-
-
- if (!OpenSoundDevice(soundRecorder, PSoundChannel::Recorder))
- return;
-
- if (!OpenSoundDevice(soundPlayer, PSoundChannel::Player))
- return;
-
- if (!c.ConstructReader(soundRecorder)) {
- cerr << "Failed to consturct a reader for audio.... OOPs srry " << endl;
- PTRACE(3, "Failed to construct a reader for the audio. Exit now ");
- return;
- }
-
- if (!c.ConstructWriter(soundPlayer)) {
- cerr << "Failed to consturct a writer for audio.... OOPs srry " << endl;
- PTRACE(3, "Failed to construct a writer for the audio. Exit now ");
- return;
- }
-
- UserInterface ui(c, soundPlayer, soundRecorder);
- c.WaitForTermination();
-
- PTRACE(3, "End of comms object, exit program ");
-
+
+ LaunchNewId lid(ourId, ourPassword);
+ Comms c(lid);
+ c.Resume();
+
+ PTRACE(3, "Constructed the comms device ");
+
+ if (!OpenSoundDevice(soundRecorder, PSoundChannel::Recorder)) {
+ PStringStream msg;
+ msg << " Failed to open sound device " << soundRecorder << " to read from microphone";
+ cerr << msg << " .... OOOPs Sorry. " << endl;
+ PTRACE(3, msg);
+ return;
+ }
+
+ if (!OpenSoundDevice(soundPlayer, PSoundChannel::Player)){
+ PStringStream msg;
+ msg << " Failed to open sound device " << soundPlayer << " to write to speaker";
+ cerr << msg << " .... OOOPs Sorry. " << endl;
+ PTRACE(3, msg);
+ return;
+ }
+
+ if (!c.ConstructReader(soundRecorder)) {
+ cerr << "Failed to consturct a reader for audio.... OOPs srry " << endl;
+ PTRACE(3, "Failed to construct a reader for the audio. Exit now ");
+ return;
+ }
+
+ if (!c.ConstructWriter(soundPlayer)) {
+ cerr << "Failed to consturct a writer for audio.... OOPs srry " << endl;
+ PTRACE(3, "Failed to construct a writer for the audio. Exit now ");
+ return;
+ }
+
+ UserInterface ui(c, soundPlayer, soundRecorder);
+ c.WaitForTermination();
+
+ PTRACE(3, "End of comms object, exit program ");
+
#if PTRACING
- if (args.GetOptionCount('t') > 0) {
- PTrace::ClearOptions(0);
- PTrace::SetLevel(0);
- }
+ if (args.GetOptionCount('t') > 0) {
+ PTrace::ClearOptions(0);
+ PTrace::SetLevel(0);
+ }
#endif
-
+
}
BOOL Audio::OpenSoundDevice(PSoundChannel & sound, PSoundChannel::Directions dir)
{
-
+
PString name = (dir == PSoundChannel::Recorder ? "recorder" : "player");
-
+
PTRACE(3, "TestAudio\t open audio start for " << name << " and device name of " << devName);
PTRACE(3, "Open audio device for " << name << " and device name of " << devName);
@@ -274,7 +323,7 @@
if (!sound.IsOpen()) {
PTRACE(3, "End of OpenAudio, but the sound device is closed");
}
-
+
return TRUE;
}
Modified: sofaswitch/trunk/sound/main.h
==============================================================================
--- sofaswitch/trunk/sound/main.h (original)
+++ sofaswitch/trunk/sound/main.h Mon Sep 18 19:46:52 2006
@@ -15,7 +15,7 @@
*
*
*/
-
+
#ifndef _MAIN_H
#define _MAIN_H
@@ -29,79 +29,74 @@
rudimentary status information */
class UserInterface: public PThread
{
- PCLASSINFO(UserInterface, PThread);
-
-public:
- /**construct this class, to have access to the communications and sound modules */
- UserInterface(Comms & _comms, PSoundChannel &_player, PSoundChannel & _recorder)
- : PThread(1000, NoAutoDeleteThread),
- comms(_comms),
- player(_player),
- recorder(_recorder)
- { endNow = FALSE; Resume(); }
-
- /**The main method where everything happens */
- void Main();
-
- /**This method is used to shutdown the operation of this class */
- virtual void Terminate();
-
+ PCLASSINFO(UserInterface, PThread);
+
+ public:
+ /**construct this class, to have access to the communications and sound modules */
+ UserInterface(Comms & _comms, PSoundChannel &_player, PSoundChannel & _recorder);
+
+ /**The main method where everything happens */
+ void Main();
+
+ /**This method is used to shutdown the operation of this class */
+ virtual void Terminate();
+
protected:
- /**Reference to the class that does all the communications */
- Comms & comms;
-
- /**Reference to the class that does all the playing of audio to the speaker */
- PSoundChannel & player;
-
- /**Reference to the class that does all of the recording of audio from the microphone */
- PSoundChannel & recorder;
-
- /**Variable used to indicate it is time to finish */
- BOOL endNow;
+ /**Reference to the class that does all the communications */
+ Comms & comms;
+
+ /**Reference to the class that does all the playing of audio to the speaker */
+ PSoundChannel & player;
+
+ /**Reference to the class that does all of the recording of audio from the microphone */
+ PSoundChannel & recorder;
+
+ /**Variable used to indicate it is time to finish */
+ BOOL endNow;
};
/////////////////////////////////////////////////////////////////////////////
/**The parent class, that hides the int main(int argc, char **argv).
-
+
This handles all command line parsing, and creation of the relevant
worker classes */
class Audio : public PProcess
{
- PCLASSINFO(Audio, PProcess);
-
-public:
- /**Constructor */
- Audio();
-
- /**The handling of the command line, generating classes etc */
- void Main();
-
- /**Access function to return the selected audio device name */
- PString GetTestDeviceName() { return devName; }
-
- /**Access function, so that any code in this program can address
- this class */
+ PCLASSINFO(Audio, PProcess);
+
+ public:
+ /**Constructor */
+ Audio();
+
+ /**The handling of the command line, generating classes etc */
+ void Main();
+
+ /**Access function to return the selected audio device name */
+ PString GetTestDeviceName() { return devName; }
+
+ /**Access function, so that any code in this program can address
+ this class */
static Audio & Current()
{ return (Audio &)PProcess::Current(); }
-
+
/**Report the node id of this particular entity, as seen by the sofa switch server */
PString GetNodeId() { return nodeId; }
protected:
/**The selected audio device name */
- PString devName;
-
- /**Open the sound device before we use it, and leave it open */
- BOOL OpenSoundDevice(PSoundChannel &device, PSoundChannel::Directions dir);
-
- /**Device for recording audio */
- PSoundChannel soundRecorder;
-
- /**Device for playing audio */
- PSoundChannel soundPlayer;
-
- /**The id of this particular entity, as seen by the sofaswitch server */
- PString nodeId;
+ PString devName;
+
+ /**Open the sound device before we use it, and leave it open */
+ BOOL OpenSoundDevice(PSoundChannel &device, PSoundChannel::Directions dir);
+
+ /**Device for recording audio */
+ PSoundChannel soundRecorder;
+
+ /**Device for playing audio */
+ PSoundChannel soundPlayer;
+
+ /**The id of this particular entity, as seen by the sofaswitch server */
+ PString nodeId;
};
1
0
18 Sep '06
Author: derek
Date: Mon Sep 18 01:11:06 2006
New Revision: 98
Added:
sofaswitch/trunk/callflow/tests/requestnode.src
Log:
Add this test script, to show how one will request a
worker node from a remote supervisor.
Added: sofaswitch/trunk/callflow/tests/requestnode.src
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/tests/requestnode.src Mon Sep 18 01:11:06 2006
@@ -0,0 +1 @@
+14<B>244<B>255<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought<ms>voipREQUESTNEWID<ms><special>Competing timer label<ms>requestnode<ms><special> <B><Shape>2<B>230<B>347<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>10<B>232<B>204<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print \"Have requested a node from voip at \", time.asctime()<ms><special> <B><Shape>1<B>231<B>108<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>11<B>232<B>159<B> extra <special>Tool Tip<ms>Request Node<ms><special>Request node from<ms>voip<ms><special>Timer period (seconds)<ms>1<ms><special>Timer label<ms>requestnode<ms><special> <B><Shape>10<B>231<B>295<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print \"have a new node on \", self.data[self.currentNode][\"Event Data\"]<ms><special> <B><Shape>
1
0
[Sofaswitch-svn] [commit] r97 - in sofaswitch/trunk/callflow: src tests
by SofaSWITCH SVN 18 Sep '06
by SofaSWITCH SVN 18 Sep '06
18 Sep '06
Author: derek
Date: Mon Sep 18 01:09:55 2006
New Revision: 97
Added:
sofaswitch/trunk/callflow/tests/
sofaswitch/trunk/callflow/tests/timetest.src
Modified:
sofaswitch/trunk/callflow/src/eventer.cpp
sofaswitch/trunk/callflow/src/shapelist.cpp
Log:
Add standard test directory, to illustrate how it works.
Add code to handle (in a generic fashion) different network messages.
Modified: sofaswitch/trunk/callflow/src/eventer.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/eventer.cpp (original)
+++ sofaswitch/trunk/callflow/src/eventer.cpp Mon Sep 18 01:09:55 2006
@@ -30,6 +30,9 @@
displayData[displayData.size()] =
InformationSection(wxT("Event sought"), wxT("incoming"));
+
+ displayData[displayData.size()] =
+ InformationSection(wxT("Competing timer label"), wxT(""));
}
void DndShapeEventer::Draw(wxDC& dc)
@@ -118,6 +121,9 @@
file.AddLine(wxString::Format(" \"Event\" : "));
file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str()));
+
+ file.AddLine(wxString::Format(" \"Competing timer label\" : "));
+ file.AddLine(wxString::Format(" \"%s\", ", displayData[2].data.c_str()));
file.AddLine(wxString::Format(" },"));
Modified: sofaswitch/trunk/callflow/src/shapelist.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/shapelist.cpp (original)
+++ sofaswitch/trunk/callflow/src/shapelist.cpp Mon Sep 18 01:09:55 2006
@@ -287,7 +287,6 @@
file.AddLine(" \"\"\" The class which holds all the information on how to manage each entity");
file.AddLine(" on the flow chart, how to connect, and does the requisite calls to twisted ");
file.AddLine(" ");
- file.AddLine(" There are two types of events. A) name,data or B)name,handler ");
file.AddLine(" \"\"\" ");
file.AddLine(" def __init__(self): ");
file.AddLine(" self.graphSet = False ");
@@ -296,6 +295,10 @@
file.AddLine(" self.generatedEvents = {} ");
file.AddLine(" self.pendingEvents = {} ");
file.AddLine(" self.currentHandlers= {} ");
+ file.AddLine(" self.knownNetworkMessages= [] ");
+ file.AddLine(" self.knownNetworkMessages.append(\"REQUESTNEWID\") ");
+ file.AddLine(" self.knownNetworkMessages.append(\"DTMF\") ");
+// file.AddLine(" self.knownNetworkMessages.append(\"\") ");
char c= 34;
wxString tString = wxString::Format(" self.quote = \"\\%c\"", c);
file.AddLine(tString.c_str());
@@ -343,9 +346,14 @@
file.AddLine(" self.generatedEvents.pop(killEvent) ");
file.AddLine(" ");
file.AddLine(" def processQueue(self, data): ");
- file.AddLine(" \"\"\"This method is called after an event has been detected");
+ file.AddLine(" \"\"\"This method is called after an event has been detected ");
file.AddLine(" as happening. It compares the generated events queue with the registered");
file.AddLine(" handlers, and dispatches execution to the relevant handler ");
+ file.AddLine(" ");
+ file.AddLine(" Then, this method empties the generated events queue. These are events ");
+ file.AddLine(" for which there was no corresponding handler. We cannot have these ");
+ file.AddLine(" hanging around. It would give weird output if they were processed at ");
+ file.AddLine(" some later time when the program adds a handler for this case ");
file.AddLine(" \"\"\" ");
file.AddLine(" #print \"processQueue\" ");
file.AddLine(" #print \"current handlers \", self.currentHandlers ");
@@ -354,35 +362,44 @@
file.AddLine(" keys = self.generatedEvents.keys() ");
file.AddLine(" for k in range(len(keys)): ");
file.AddLine(" if self.currentHandlers.has_key(keys[k]): ");
- file.AddLine(" eventerNode = self.currentHandlers[keys[k]] ");
- file.AddLine(" #print \"eventer node is \", eventerNode ");
- file.AddLine(" self.DoWork(self.data[eventerNode][\"Event Handler\"])");
- file.AddLine(" self.generatedEvents.pop(keys[k]) ");
- file.AddLine(" ");
- file.AddLine(" def transferEventToGenerated(self, data): ");
- file.AddLine(" \"\"\"An event has happened, and now we need to act on it. Consequently, ");
- file.AddLine(" we take it out of the pending list and put it in the process now list");
- file.AddLine(" \"\"\" ");
- file.AddLine(" if self.pendingEvents.has_key(data): ");
- file.AddLine(" self.generatedEvents[data] = self.pendingEvents.pop(data)");
- file.AddLine(" ");
- file.AddLine(" def newRemoteNodeToUse(self, eventName, newNode):");
- file.AddLine(" \"\"\"This node has received a message advising us that a remote");
- file.AddLine(" sofa switch entity has created a node for us to use. This method");
- file.AddLine(" has to transfer the pending event to the generated event queue ");
- file.AddLine(" and get it activated for processing ");
+ file.AddLine(" eventNode = self.currentHandlers[keys[k]] ");
+ file.AddLine(" eventData = self.generatedEvents.pop(keys[k]) ");
+ file.AddLine(" cTimer = self.data[eventNode][\"Competing timer label\"]");
+ file.AddLine(" self.DeleteThisEvent(cTimer) ");
+ file.AddLine(" handler = self.data[eventNode][\"Event Handler\"]");
+ file.AddLine(" a,b,c = handler ");
+ file.AddLine(" self.data[a][\"Event Data\"] = eventData ");
+ file.AddLine(" self.DoWork(handler) ");
+ file.AddLine(" self.generatedEvents.clear() ");
+ file.AddLine(" ");
+ file.AddLine(" def networkEventData(self, eName, data): ");
+ file.AddLine(" \"\"\"This node has received a message from some remote node. The ");
+ file.AddLine(" eventName is a concatanation of the sender name and the event. ");
+ file.AddLine(" Thus, an example eventName would be voipREQUESTNEWID. ");
+ file.AddLine(" The data is additional information on this event. In this case, ");
+ file.AddLine(" the date field could be voip34 (the ID of the node node on voip)");
+ file.AddLine(" A second possible set of parameters would be voip23DTMF and 9 ");
+ file.AddLine(" ");
+ file.AddLine(" This method places the event on the generated events list, and ");
+ file.AddLine(" places the data there also. ");
+ file.AddLine(" Then, this methods asks for processing to resume ");
file.AddLine(" \"\"\" ");
- file.AddLine(" self.transferEventToGenerated(eventName) ");
- file.AddLine(" reactor.callLater(0, self.processQueue, newNode) ");
+ file.AddLine(" self.generatedEvents[eName] = data ");
+ file.AddLine(" reactor.callLater(0, self.processQueue, 0) ");
file.AddLine(" ");
file.AddLine(" def timerObjectExpired(self, data): ");
- file.AddLine(" \"\"\"Some timer has expired. Move it from the pending list and place ");
+ file.AddLine(" \"\"\"Some timer has expired. Move it from the pending list and place ");
file.AddLine(" it in the active list. Then activate processing so that things move ");
- file.AddLine(" along");
+ file.AddLine(" along ");
+ file.AddLine(" ");
+ file.AddLine(" Note that when the timer object was initiated, an entry was put in ");
+ file.AddLine(" self.pendingEvent list statiing this event name. If the timer sas ");
+ file.AddLine(" deleted (after starting it) the corresponding event in the pending ");
+ file.AddLine(" list will be absent ");
file.AddLine(" \"\"\" ");
- file.AddLine(" #print \"timer object has expired \", data ");
- file.AddLine(" self.transferEventToGenerated(data) ");
- file.AddLine(" reactor.callLater(0, self.processQueue, 0) ");
+ file.AddLine(" if self.pendingEvents.has_key(data): ");
+ file.AddLine(" self.generatedEvents[data] = self.pendingEvents.pop(data)");
+ file.AddLine(" reactor.callLater(0, self.processQueue, 0) ");
file.AddLine(" ");
file.AddLine(" def startWorkNow(self, notUsed): ");
file.AddLine(" \"\"\" Initiate processing on the flow chart");
@@ -400,6 +417,7 @@
file.AddLine(" self.keepGoing = True ");
file.AddLine(" ");
file.AddLine(" while self.keepGoing: ");
+ file.AddLine(" self.currentNode=a ");
file.AddLine(" command = \"self.\" + str(c) + \"(\" + str(sTuple) + \")\"");
file.AddLine(" sTuple = eval(command) ");
file.AddLine(" if sTuple == None: ");
@@ -459,12 +477,16 @@
file.AddLine(" \"\"\"Handle an ordinary message from the remote sofa server. Break the message up");
file.AddLine(" turn it into a MyEvent message, and added to the right ");
file.AddLine(" queue. On doing this, spark an event to drive queue processing. ");
+ file.AddLine(" Note that this method can only deal with certain predefined ");
+ file.AddLine(" types of messages ");
file.AddLine(" \"\"\" ");
- file.AddLine(" print \"Received \", thisMessage ");
- file.AddLine(" if (thisMessage.find(\"REQUESTNEWID\") >=0):");
- file.AddLine(" pMsg = str(thisMessage).split(\" \") ");
- file.AddLine(" eName = pMsg(":","") ");
- file.AddLine("
+ file.AddLine(" if len(thisMessage) > 2: ");
+ file.AddLine(" print \"Received \", thisMessage ");
+ file.AddLine(" for msg in self.knownNetworkMessages: ");
+ file.AddLine(" if thisMessage.find(msg) >= 0: ");
+ file.AddLine(" pMsg = str(thisMessage).split(\" \") ");
+ file.AddLine(" eName = pMsg[0].replace(\":\",\"\") ");
+ file.AddLine(" self.networkEventData(eName, pMsg[1]) ");
file.AddLine(" ");
file.AddLine(" ");
for (int i = 0; i < DndShape::KnownShapes; i++) {
Added: sofaswitch/trunk/callflow/tests/timetest.src
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/tests/timetest.src Mon Sep 18 01:09:55 2006
@@ -0,0 +1 @@
+12<B>123<B>122<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds)<ms>1<ms><special>Timer label<ms>timer1<ms><special> <B><Shape>9<B>150<B>272<B>151,272,150,344,232,354<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>10<B>126<B>221<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print \"t1 \", time.asctime(), \" data is \", self.data[self.currentNode][\"Event Data\"]<ms><special> <B><Shape>12<B>206<B>198<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds)<ms>2<ms><special>Timer label<ms>timer2<ms><special> <B><Shape>9<B>187<B>196<B>187,196,230,197<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>14<B>137<B>173<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought<ms>timer1<ms><special>Competing timer label<ms><ms><special> <B><Shape>10<B>123<B>74<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print \"Start \", time.asctime()<ms><special> <B><Shape>1<B>123<B>26<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>2<B>207<B>352<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>10<B>207<B>305<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print \"t2 \", time.asctime(), \" data is \", self.data[self.currentNode][\"Event Data\"]<ms><special> <B><Shape>14<B>218<B>251<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought<ms>timer2<ms><special>Competing timer label<ms><ms><special> <B><Shape>
1
0
Author: derek
Date: Mon Sep 18 01:08:55 2006
New Revision: 96
Modified:
sofaswitch/trunk/sound/comms.cxx
sofaswitch/trunk/sound/comms.h
sofaswitch/trunk/sound/main.cxx
sofaswitch/trunk/sound/main.h
Log:
First cut of a command line interface. Primary purpose of this
command line interface is to generate DTMF characters for the controller
Modified: sofaswitch/trunk/sound/comms.cxx
==============================================================================
--- sofaswitch/trunk/sound/comms.cxx (original)
+++ sofaswitch/trunk/sound/comms.cxx Mon Sep 18 01:08:55 2006
@@ -32,6 +32,7 @@
#include "comms.h"
#include "audio.h"
+#include "main.h"
#define new PNEW
@@ -111,11 +112,31 @@
MessageFrame::WaitForTermination();
}
+void Comms::SendMessageToController(PString & message)
+{
+ SendThisMessageTo(message, currentController);
+}
+
+
void Comms::SilentlyEndAll()
{
}
+BOOL Comms::SendDtmf(const PString & dtmfVals)
+{
+ cout << "Received DTMF from the controller of " << dtmfVals << " " << PTime();
+ return TRUE;
+}
+
+
+void Comms::ProcessRequestNewId(PStringArray &cmds, PString & sender)
+{
+ currentController = sender;
+ PString answer = PString("REQUESTNEWID ") + Audio::Current().GetNodeId();
+ SendThisMessageTo(answer, sender);
+ return;
+}
void Comms::ProcessHangup(PStringArray &cmds, PString & sender)
{
Modified: sofaswitch/trunk/sound/comms.h
==============================================================================
--- sofaswitch/trunk/sound/comms.h (original)
+++ sofaswitch/trunk/sound/comms.h Mon Sep 18 01:08:55 2006
@@ -70,6 +70,9 @@
terminated */
virtual void WaitForTermination();
+ /**Send this message to the current controller. Typically, this will be a
+ * message stating that dtmf has been read from the keyboard. */
+ void SendMessageToController(PString & message);
/**Report if we were stopped by hangup */
BOOL StoppedByHangup() { return stopByHangup; }
@@ -78,6 +81,16 @@
BOOL StoppedByExit() { return stopByExit; }
protected:
+
+ /**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 have received a command asking us to provide the id of a new
+ communications nodes, that will be controlled only by the remote
+ node */
+ virtual void ProcessRequestNewId(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. */
@@ -139,6 +152,9 @@
/**The terminating condition was */
BOOL stopByExit;
+ /**The id of the last node who has requested a sound worker. This node will
+ receive all dtmf messages. */
+ PString currentController;
};
#endif
Modified: sofaswitch/trunk/sound/main.cxx
==============================================================================
--- sofaswitch/trunk/sound/main.cxx (original)
+++ sofaswitch/trunk/sound/main.cxx Mon Sep 18 01:08:55 2006
@@ -15,14 +15,73 @@
*/
#include <ptlib.h>
-#include "version.h"
+
+
#include "audio.h"
-#include "main.h"
#include "comms.h"
+#include "main.h"
+#include "version.h"
-
#define new PNEW
+/////////////////////////////////////////////////////////////////////////////
+void UserInterface::Main()
+{
+ PConsoleChannel console(PConsoleChannel::StandardInput);
+
+ cout << "This program will waits for user commands, and generates DTMF messages as required" << endl;
+
+
+ console.SetReadTimeout(500);
+
+ PThread::Yield();
+
+ PStringStream help;
+ help << "Press : " << endl
+ << " H or ? help on this interface" << endl
+ << " D dtmf Send dtmf message text to the controller"
+ << " X or Q exit " << endl;
+
+
+ cout << endl << endl << help;
+
+ for (;(!endNow) && (!comms.IsTerminated());) {
+ char ch = console.ReadChar();
+
+ if (endNow)
+ break;
+
+ switch (tolower(ch)) {
+ case 'd' :
+ {
+ PString message;
+ console >> message;
+ comms.SendMessageToController(message);
+ cout << "Command ? " << flush;
+ }
+ break;
+ case 'x' :
+ case 'q' :
+ cout << "Exiting." << endl;
+ PTRACE(3, "End this program now ");
+ return;
+ break;
+ case '?' :
+ case 'h' :
+ cout << help << endl;
+ cout << "Command ? " << flush;
+ default:
+ break;
+ } // end switch
+ } // end for
+}
+
+void UserInterface::Terminate()
+{
+ endNow = TRUE;
+}
+
+/////////////////////////////////////////////////////////////////////////////
Audio::Audio()
: PProcess("Derek Smithies code factory", "audio",
MAJOR_VERSION, MINOR_VERSION, BUILD_TYPE, BUILD_NUMBER)
@@ -123,16 +182,16 @@
server = args.GetOptionString("server");
PTRACE(3, "server is " << server);
} else {
- server = "beta";
- PTRACE(3, "Select a default server of beta");
+ server = "localhost";
+ PTRACE(3, "Select a default server of localhost");
}
PString ourId;
if (args.HasOption("id")) {
- ourId = args.GetOptionString("id");
+ nodeId = args.GetOptionString("id");
PTRACE(3, "our ID is " << ourId);
} else {
- ourId = "sound";
+ nodeId = "sound";
PTRACE(3, "Select a default ID of " << ourId);
}
@@ -171,9 +230,10 @@
PTRACE(3, "Failed to construct a writer for the audio. Exit now ");
return;
}
-
- c.WaitForTermination();
+ UserInterface ui(c, soundPlayer, soundRecorder);
+ c.WaitForTermination();
+
PTRACE(3, "End of comms object, exit program ");
#if PTRACING
Modified: sofaswitch/trunk/sound/main.h
==============================================================================
--- sofaswitch/trunk/sound/main.h (original)
+++ sofaswitch/trunk/sound/main.h Mon Sep 18 01:08:55 2006
@@ -19,7 +19,49 @@
#ifndef _MAIN_H
#define _MAIN_H
+#include <ptlib.h>
+#include "comms.h"
+
+
+/**This class manages the user interface during program execution. It reads
+ the keyboard to generate dtmf events as required, and displays some
+ rudimentary status information */
+class UserInterface: public PThread
+{
+ PCLASSINFO(UserInterface, PThread);
+
+public:
+ /**construct this class, to have access to the communications and sound modules */
+ UserInterface(Comms & _comms, PSoundChannel &_player, PSoundChannel & _recorder)
+ : PThread(1000, NoAutoDeleteThread),
+ comms(_comms),
+ player(_player),
+ recorder(_recorder)
+ { endNow = FALSE; Resume(); }
+
+ /**The main method where everything happens */
+ void Main();
+
+ /**This method is used to shutdown the operation of this class */
+ virtual void Terminate();
+
+ protected:
+ /**Reference to the class that does all the communications */
+ Comms & comms;
+
+ /**Reference to the class that does all the playing of audio to the speaker */
+ PSoundChannel & player;
+
+ /**Reference to the class that does all of the recording of audio from the microphone */
+ PSoundChannel & recorder;
+
+ /**Variable used to indicate it is time to finish */
+ BOOL endNow;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
/**The parent class, that hides the int main(int argc, char **argv).
This handles all command line parsing, and creation of the relevant
@@ -43,6 +85,8 @@
static Audio & Current()
{ return (Audio &)PProcess::Current(); }
+ /**Report the node id of this particular entity, as seen by the sofa switch server */
+ PString GetNodeId() { return nodeId; }
protected:
/**The selected audio device name */
PString devName;
@@ -55,6 +99,9 @@
/**Device for playing audio */
PSoundChannel soundPlayer;
+
+ /**The id of this particular entity, as seen by the sofaswitch server */
+ PString nodeId;
};
1
0