[Freeswitch-svn] [commit] r1647 - in freeswitch/branches/james: . build conf docs libs libs/codec/gsm libs/codec/ilbc libs/iax libs/iax/src libs/libdingaling libs/libspeakup libs/libteletone libs/srtp libs/srtp/crypto libs/srtp/crypto/include libs/srtp/crypto/test libs/srtp/test scripts/rss src src/include src/mod src/mod/applications src/mod/applications/mod_bridgecall src/mod/applications/mod_commands src/mod/applications/mod_echo src/mod/applications/mod_ivrtest src/mod/applications/mod_playback src/mod/applications/mod_rss src/mod/applications/mod_skel src/mod/asr_tts src/mod/asr_tts/mod_cepstral src/mod/codecs src/mod/codecs/mod_g711 src/mod/codecs/mod_g729 src/mod/codecs/mod_gsm src/mod/codecs/mod_ilbc src/mod/codecs/mod_l16 src/mod/codecs/mod_speex src/mod/dialplans src/mod/dialplans/mod_dialplan_directory src/mod/dialplans/mod_dialplan_xml src/mod/directories src/mod/directories/mod_ldap src/mod/endpoints src/mod/endpoints/mod_dingaling src/mod/endpoints/mod_exosip src/mod/endpoints/mod_iax src/mod/endpoints/mod_portaudio src/mod/endpoints/mod_wanpipe src/mod/endpoints/mod_woomera src/mod/event_handlers src/mod/event_handlers/mod_event_multicast src/mod/event_handlers/mod_event_test src/mod/event_handlers/mod_xmpp_event src/mod/event_handlers/mod_zeroconf src/mod/formats src/mod/formats/mod_sndfile src/mod/languages src/mod/languages/mod_perl src/mod/languages/mod_spidermonkey src/mod/loggers src/mod/loggers/mod_console src/mod/loggers/mod_syslog src/mod/timers src/mod/timers/mod_softtimer src/mod/xml_int src/mod/xml_int/mod_xml_rpc w32/Setup w32/vsnet w32/vsnet/Tools w32/vsnet/Tools/pcre

james at freeswitch.org james at freeswitch.org
Sun Jun 18 11:09:43 EDT 2006


Author: james
Date: Sun Jun 18 11:09:41 2006
New Revision: 1647

Added:
   freeswitch/branches/james/scripts/rss/
      - copied from r1644, /freeswitch/trunk/scripts/rss/
   freeswitch/branches/james/scripts/rss/rss2ivr.pl
      - copied unchanged from r1644, /freeswitch/trunk/scripts/rss/rss2ivr.pl
   freeswitch/branches/james/src/mod/applications/mod_rss/   (props changed)
      - copied from r1644, /freeswitch/trunk/src/mod/applications/mod_rss/
   freeswitch/branches/james/src/mod/applications/mod_rss/mod_rss.c
      - copied unchanged from r1644, /freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c
   freeswitch/branches/james/src/mod/applications/mod_rss/mod_rss.vcproj
      - copied unchanged from r1644, /freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.vcproj
   freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig.i
      - copied unchanged from r1644, /freeswitch/trunk/src/mod/languages/mod_perl/switch_swig.i
Modified:
   freeswitch/branches/james/   (props changed)
   freeswitch/branches/james/AUTHORS
   freeswitch/branches/james/Makefile.am
   freeswitch/branches/james/Makefile.in
   freeswitch/branches/james/aclocal.m4
   freeswitch/branches/james/build/   (props changed)
   freeswitch/branches/james/conf/freeswitch.xml
   freeswitch/branches/james/configure
   freeswitch/branches/james/configure.in
   freeswitch/branches/james/docs/   (props changed)
   freeswitch/branches/james/libs/   (props changed)
   freeswitch/branches/james/libs/codec/gsm/   (props changed)
   freeswitch/branches/james/libs/codec/ilbc/   (props changed)
   freeswitch/branches/james/libs/iax/   (props changed)
   freeswitch/branches/james/libs/iax/src/   (props changed)
   freeswitch/branches/james/libs/libdingaling/   (props changed)
   freeswitch/branches/james/libs/libspeakup/   (props changed)
   freeswitch/branches/james/libs/libteletone/   (props changed)
   freeswitch/branches/james/libs/srtp/   (props changed)
   freeswitch/branches/james/libs/srtp/crypto/   (props changed)
   freeswitch/branches/james/libs/srtp/crypto/include/   (props changed)
   freeswitch/branches/james/libs/srtp/crypto/test/   (props changed)
   freeswitch/branches/james/libs/srtp/test/   (props changed)
   freeswitch/branches/james/modules.conf.in
   freeswitch/branches/james/src/include/   (props changed)
   freeswitch/branches/james/src/include/switch.h
   freeswitch/branches/james/src/include/switch_am_config.h.in
   freeswitch/branches/james/src/include/switch_caller.h
   freeswitch/branches/james/src/include/switch_channel.h
   freeswitch/branches/james/src/include/switch_core.h
   freeswitch/branches/james/src/include/switch_ivr.h
   freeswitch/branches/james/src/include/switch_module_interfaces.h
   freeswitch/branches/james/src/include/switch_rtp.h
   freeswitch/branches/james/src/include/switch_types.h
   freeswitch/branches/james/src/include/switch_xml.h
   freeswitch/branches/james/src/mod/   (props changed)
   freeswitch/branches/james/src/mod/applications/   (props changed)
   freeswitch/branches/james/src/mod/applications/mod_bridgecall/   (props changed)
   freeswitch/branches/james/src/mod/applications/mod_bridgecall/mod_bridgecall.c
   freeswitch/branches/james/src/mod/applications/mod_commands/   (props changed)
   freeswitch/branches/james/src/mod/applications/mod_commands/mod_commands.c
   freeswitch/branches/james/src/mod/applications/mod_echo/   (props changed)
   freeswitch/branches/james/src/mod/applications/mod_ivrtest/   (props changed)
   freeswitch/branches/james/src/mod/applications/mod_ivrtest/mod_ivrtest.c
   freeswitch/branches/james/src/mod/applications/mod_playback/   (props changed)
   freeswitch/branches/james/src/mod/applications/mod_playback/mod_playback.c
   freeswitch/branches/james/src/mod/applications/mod_skel/   (props changed)
   freeswitch/branches/james/src/mod/asr_tts/   (props changed)
   freeswitch/branches/james/src/mod/asr_tts/mod_cepstral/   (props changed)
   freeswitch/branches/james/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
   freeswitch/branches/james/src/mod/codecs/   (props changed)
   freeswitch/branches/james/src/mod/codecs/mod_g711/   (props changed)
   freeswitch/branches/james/src/mod/codecs/mod_g729/   (props changed)
   freeswitch/branches/james/src/mod/codecs/mod_gsm/   (props changed)
   freeswitch/branches/james/src/mod/codecs/mod_ilbc/   (props changed)
   freeswitch/branches/james/src/mod/codecs/mod_l16/   (props changed)
   freeswitch/branches/james/src/mod/codecs/mod_speex/   (props changed)
   freeswitch/branches/james/src/mod/dialplans/   (props changed)
   freeswitch/branches/james/src/mod/dialplans/mod_dialplan_directory/   (props changed)
   freeswitch/branches/james/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c
   freeswitch/branches/james/src/mod/dialplans/mod_dialplan_xml/   (props changed)
   freeswitch/branches/james/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
   freeswitch/branches/james/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.vcproj
   freeswitch/branches/james/src/mod/directories/   (props changed)
   freeswitch/branches/james/src/mod/directories/mod_ldap/   (props changed)
   freeswitch/branches/james/src/mod/endpoints/   (props changed)
   freeswitch/branches/james/src/mod/endpoints/mod_dingaling/   (props changed)
   freeswitch/branches/james/src/mod/endpoints/mod_dingaling/mod_dingaling.c
   freeswitch/branches/james/src/mod/endpoints/mod_exosip/   (props changed)
   freeswitch/branches/james/src/mod/endpoints/mod_exosip/Makefile
   freeswitch/branches/james/src/mod/endpoints/mod_exosip/mod_exosip.c
   freeswitch/branches/james/src/mod/endpoints/mod_iax/   (props changed)
   freeswitch/branches/james/src/mod/endpoints/mod_iax/mod_iax.c
   freeswitch/branches/james/src/mod/endpoints/mod_portaudio/   (props changed)
   freeswitch/branches/james/src/mod/endpoints/mod_portaudio/mod_portaudio.c
   freeswitch/branches/james/src/mod/endpoints/mod_wanpipe/   (props changed)
   freeswitch/branches/james/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
   freeswitch/branches/james/src/mod/endpoints/mod_woomera/   (props changed)
   freeswitch/branches/james/src/mod/endpoints/mod_woomera/mod_woomera.c
   freeswitch/branches/james/src/mod/event_handlers/   (props changed)
   freeswitch/branches/james/src/mod/event_handlers/mod_event_multicast/   (props changed)
   freeswitch/branches/james/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
   freeswitch/branches/james/src/mod/event_handlers/mod_event_test/   (props changed)
   freeswitch/branches/james/src/mod/event_handlers/mod_xmpp_event/   (props changed)
   freeswitch/branches/james/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c
   freeswitch/branches/james/src/mod/event_handlers/mod_zeroconf/   (props changed)
   freeswitch/branches/james/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c
   freeswitch/branches/james/src/mod/formats/   (props changed)
   freeswitch/branches/james/src/mod/formats/mod_sndfile/   (props changed)
   freeswitch/branches/james/src/mod/languages/   (props changed)
   freeswitch/branches/james/src/mod/languages/mod_perl/   (props changed)
   freeswitch/branches/james/src/mod/languages/mod_perl/Makefile
   freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig.c
   freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig_wrap.c
   freeswitch/branches/james/src/mod/languages/mod_spidermonkey/   (props changed)
   freeswitch/branches/james/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
   freeswitch/branches/james/src/mod/loggers/   (props changed)
   freeswitch/branches/james/src/mod/loggers/mod_console/   (props changed)
   freeswitch/branches/james/src/mod/loggers/mod_console/mod_console.c
   freeswitch/branches/james/src/mod/loggers/mod_syslog/   (props changed)
   freeswitch/branches/james/src/mod/timers/   (props changed)
   freeswitch/branches/james/src/mod/timers/mod_softtimer/   (props changed)
   freeswitch/branches/james/src/mod/xml_int/   (props changed)
   freeswitch/branches/james/src/mod/xml_int/mod_xml_rpc/   (props changed)
   freeswitch/branches/james/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
   freeswitch/branches/james/src/switch.c
   freeswitch/branches/james/src/switch_caller.c
   freeswitch/branches/james/src/switch_channel.c
   freeswitch/branches/james/src/switch_config.c
   freeswitch/branches/james/src/switch_console.c
   freeswitch/branches/james/src/switch_core.c
   freeswitch/branches/james/src/switch_event.c
   freeswitch/branches/james/src/switch_ivr.c
   freeswitch/branches/james/src/switch_loadable_module.c
   freeswitch/branches/james/src/switch_log.c
   freeswitch/branches/james/src/switch_rtp.c
   freeswitch/branches/james/src/switch_xml.c
   freeswitch/branches/james/w32/Setup/   (props changed)
   freeswitch/branches/james/w32/vsnet/   (props changed)
   freeswitch/branches/james/w32/vsnet/Freeswitch.sln
   freeswitch/branches/james/w32/vsnet/GetLibs.vbs
   freeswitch/branches/james/w32/vsnet/Tools/   (props changed)
   freeswitch/branches/james/w32/vsnet/Tools/pcre/libpcre.vcproj

Log:
Updating branch to trunk to get back to dev, sorry guys ;(


Modified: freeswitch/branches/james/AUTHORS
==============================================================================
--- freeswitch/branches/james/AUTHORS	(original)
+++ freeswitch/branches/james/AUTHORS	Sun Jun 18 11:09:41 2006
@@ -21,6 +21,7 @@
   and moral support.
  Michal "cypromis" Bielicki (michal.bielicki  AT halo2.pl) - Solaris porting, and autotools enhancements.
  James Martelletti <james at nerdc0re.com> - All around cool guy (mod_syslog)
+ Johny Kadarisman <jkr888 at gmail.com>
  
 A big THANK YOU goes to:
 

Modified: freeswitch/branches/james/Makefile.am
==============================================================================
--- freeswitch/branches/james/Makefile.am	(original)
+++ freeswitch/branches/james/Makefile.am	Sun Jun 18 11:09:41 2006
@@ -22,8 +22,10 @@
 AM_CFLAGS += -DCRASH_PROT
 endif
 
+AM_CFGARGS =
 if IS64BITLINUX
-AM_CFLAGS += -m64 -march=k8 -fPIC
+AM_CFLAGS += -m64 -march=k8 -fPIC -D_64BIT_MACHINE_
+AM_CFGARGS += --enable-64bit
 endif
 
 #put elsif win here
@@ -183,6 +185,7 @@
 	@./build/addenv.sh build/freeswitch.env LDFLAGS "$(AM_LDFLAGS) -lfreeswitch"
 	@./build/addenv.sh build/freeswitch.env CFLAGS "-Werror $(AM_CFLAGS)"
 	@./build/addenv.sh build/freeswitch.env CC "$(CC)"
+	@./build/addenv.sh build/freeswitch.env CFGARGS "$(AM_CFGARGS)"
 	@cd src/mod && for i in `cat ../../modules.conf | grep -v \#` ; do echo making $$i ; $(PWD)/build/modmake.sh $(PWD) $$i || exit 1; done
 	@rm -f build/freeswitch.env
 

Modified: freeswitch/branches/james/Makefile.in
==============================================================================
--- freeswitch/branches/james/Makefile.in	(original)
+++ freeswitch/branches/james/Makefile.in	Sun Jun 18 11:09:41 2006
@@ -40,8 +40,9 @@
 host_triplet = @host@
 @ISLINUX_TRUE at am__append_1 = -Wl,-E
 @CRASHPROT_TRUE at am__append_2 = -DCRASH_PROT
- at IS64BITLINUX_TRUE@am__append_3 = -m64 -march=k8 -fPIC
- at ISMAC_TRUE@am__append_4 = -DMACOSX
+ at IS64BITLINUX_TRUE@am__append_3 = -m64 -march=k8 -fPIC -D_64BIT_MACHINE_
+ at IS64BITLINUX_TRUE@am__append_4 = --enable-64bit
+ at ISMAC_TRUE@am__append_5 = -DMACOSX
 bin_PROGRAMS = freeswitch$(EXEEXT)
 DIST_COMMON = README $(am__configure_deps) $(library_include_HEADERS) \
 	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
@@ -246,7 +247,7 @@
 AM_CFLAGS = -I$(PREFIX)/include $(shell $(APR_CONFIG) --cflags \
 	--cppflags --includes) -I${prefix}/include/srtp $(shell \
 	$(APU_CONFIG) --includes) $(am__append_2) $(am__append_3) \
-	$(am__append_4) -fPIC -Wall -I$(PWD)/src/sqlite -I$(PWD) \
+	$(am__append_5) -fPIC -Wall -I$(PWD)/src/sqlite -I$(PWD) \
 	-I$(PWD)/src/include -I$(PREFIX)/include \
 	-DSWITCH_MOD_DIR=\"$(PREFIX)/mod\" \
 	-DSWITCH_PREFIX_DIR=\"$(PREFIX)\" \
@@ -259,6 +260,7 @@
 	$(shell $(APU_CONFIG) --link-ld --libs ) -lm \
 	-L/usr/local/lib/db42 -L/usr/local/lib $(am__append_1)
 OSARCH = $(shell uname -s)
+AM_CFGARGS = $(am__append_4)
 @ISMAC_FALSE at SOLINK = -shared -Xlinker -x
 
 #put elsif win here
@@ -1090,6 +1092,7 @@
 	@./build/addenv.sh build/freeswitch.env LDFLAGS "$(AM_LDFLAGS) -lfreeswitch"
 	@./build/addenv.sh build/freeswitch.env CFLAGS "-Werror $(AM_CFLAGS)"
 	@./build/addenv.sh build/freeswitch.env CC "$(CC)"
+	@./build/addenv.sh build/freeswitch.env CFGARGS "$(AM_CFGARGS)"
 	@cd src/mod && for i in `cat ../../modules.conf | grep -v \#` ; do echo making $$i ; $(PWD)/build/modmake.sh $(PWD) $$i || exit 1; done
 	@rm -f build/freeswitch.env
 

Modified: freeswitch/branches/james/aclocal.m4
==============================================================================
--- freeswitch/branches/james/aclocal.m4	(original)
+++ freeswitch/branches/james/aclocal.m4	Sun Jun 18 11:09:41 2006
@@ -143,7 +143,7 @@
 default_ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except M$VC,
+# All known linkers require a `.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 ltmain="$ac_aux_dir/ltmain.sh"
@@ -359,8 +359,8 @@
 # find a string as large as possible, as long as the shell can cope with it
   for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
-       echo_test_string="`eval $cmd`" &&
+    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+       echo_test_string=`eval $cmd` &&
        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
     then
       break
@@ -529,7 +529,7 @@
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
-    case "`/usr/bin/file conftest.o`" in
+    case `/usr/bin/file conftest.o` in
     *32-bit*)
       case $host in
         x86_64-*linux*)
@@ -611,7 +611,7 @@
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
@@ -650,7 +650,7 @@
    LDFLAGS="$LDFLAGS $3"
    printf "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The compiler can only warn and ignore the option if not recognized
+     # The linker can only warn and ignore the option if not recognized
      # So say no if there are warnings
      if test -s conftest.err; then
        # Append any errors to the config.log.
@@ -725,7 +725,7 @@
     elif test -x /usr/sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
     else
-      lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
     fi
     # And add a safety zone
     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
@@ -737,7 +737,7 @@
     # nice to cause kernel panics so lets avoid the loop below.
     # First set a reasonable default.
     lt_cv_sys_max_cmd_len=16384
-    # 
+    #
     if test -x /sbin/sysconfig; then
       case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
         *1*) lt_cv_sys_max_cmd_len=-1 ;;
@@ -854,7 +854,7 @@
 }]
 EOF
   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) $1 ;;
@@ -1003,7 +1003,7 @@
    # Note that $ac_compile itself does not contain backslashes and begins
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
@@ -1021,7 +1021,7 @@
        _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
      fi
    fi
-   chmod u+w .
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -1281,7 +1281,8 @@
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -1334,7 +1335,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -1372,7 +1373,14 @@
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[123]]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -1417,7 +1425,7 @@
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -1813,7 +1821,7 @@
 
 # AC_LIBTOOL_WIN32_DLL
 # --------------------
-# declare package support for building win32 dll's
+# declare package support for building win32 DLLs
 AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
 [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
 ])# AC_LIBTOOL_WIN32_DLL
@@ -1987,7 +1995,7 @@
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
-	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
 	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
@@ -2097,7 +2105,7 @@
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
       lt_cv_path_LD="$ac_dir/$ac_prog"
       # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
+      # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
@@ -2129,7 +2137,7 @@
 AC_DEFUN([AC_PROG_LD_GNU],
 [AC_REQUIRE([AC_PROG_EGREP])dnl
 AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
 *GNU* | *'with BFD'*)
   lt_cv_prog_gnu_ld=yes
@@ -2243,7 +2251,7 @@
 
 hpux10.20* | hpux11*)
   lt_cv_file_magic_cmd=/usr/bin/file
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
@@ -2417,13 +2425,13 @@
 # -----------------------------------
 # sets LIBLTDL to the link flags for the libltdl convenience library and
 # LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
-# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
-# DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
-# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
-# '${top_srcdir}/' (note the single quotes!).  If your package is not
-# flat and you're not using automake, define top_builddir and
-# top_srcdir appropriately in the Makefiles.
+# --enable-ltdl-convenience to the configure arguments.  Note that
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
+# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
+# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
+# (note the single quotes!).  If your package is not flat and you're not
+# using automake, define top_builddir and top_srcdir appropriately in
+# the Makefiles.
 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   case $enable_ltdl_convenience in
@@ -2442,13 +2450,13 @@
 # -----------------------------------
 # sets LIBLTDL to the link flags for the libltdl installable library and
 # LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
-# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
-# DIRECTORY is not provided and an installed libltdl is not found, it is
-# assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
-# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
-# quotes!).  If your package is not flat and you're not using automake,
-# define top_builddir and top_srcdir appropriately in the Makefiles.
+# --enable-ltdl-install to the configure arguments.  Note that
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
+# and an installed libltdl is not found, it is assumed to be `libltdl'.
+# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
+# flat and you're not using automake, define top_builddir and top_srcdir
+# appropriately in the Makefiles.
 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
@@ -2627,7 +2635,7 @@
 
 # On AIX, shared libraries and static libraries use the same namespace, and
 # are all built from PIC.
-case "$host_os" in
+case $host_os in
 aix3*)
   test "$enable_shared" = yes && enable_static=no
   if test -n "$RANLIB"; then
@@ -2694,7 +2702,7 @@
 _LT_AC_TAGVAR(compiler_lib_search_path, $1)=
 
 # Source file extension for C++ test sources.
-ac_ext=cc
+ac_ext=cpp
 
 # Object file extension for compiled C++ test sources.
 objext=o
@@ -2910,7 +2918,7 @@
 	# Exported symbols can be pulled into shared objects from archives
 	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
 	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-	# This is similar to how AIX traditionally builds it's shared libraries.
+	# This is similar to how AIX traditionally builds its shared libraries.
 	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
       fi
     fi
@@ -2949,7 +2957,7 @@
     fi
   ;;
       darwin* | rhapsody*)
-        case "$host_os" in
+        case $host_os in
         rhapsody* | darwin1.[[012]])
          _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
          ;;
@@ -2987,7 +2995,7 @@
           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
         fi
         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
           if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
             _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           else
@@ -3000,7 +3008,7 @@
          output_verbose_link_cmd='echo'
           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
           _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
@@ -3080,7 +3088,7 @@
     ;;
   hpux10*|hpux11*)
     if test $with_gnu_ld = no; then
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*)
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
@@ -3096,7 +3104,7 @@
         ;;
       esac
     fi
-    case "$host_cpu" in
+    case $host_cpu in
     hppa*64*)
       _LT_AC_TAGVAR(hardcode_direct, $1)=no
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -3122,7 +3130,7 @@
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	;;
       aCC*)
-	case "$host_cpu" in
+	case $host_cpu in
 	hppa*64*|ia64*)
 	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
 	  ;;
@@ -3143,7 +3151,7 @@
       *)
 	if test "$GXX" = yes; then
 	  if test $with_gnu_ld = no; then
-	    case "$host_cpu" in
+	    case $host_cpu in
 	    ia64*|hppa*64*)
 	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
 	      ;;
@@ -3244,7 +3252,7 @@
 
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
 	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
         ;;
       cxx*)
 	# Compaq C++
@@ -3476,10 +3484,11 @@
     case $cc_basename in
       CC*)
 	# Sun C++ 4.2, 5.x and Centerline C++
+        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
 	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -3499,15 +3508,7 @@
 	esac
 	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	output_verbose_link_cmd='echo'
 
 	# Archives containing C++ object files must be created using
 	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -3664,7 +3665,7 @@
   # The `*' in the case matches for architectures that use `case' in
   # $output_verbose_cmd can trigger glob expansion during the loop
   # eval without this substitution.
-  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
 
   for p in `eval $output_verbose_link_cmd`; do
     case $p in
@@ -3740,6 +3741,21 @@
 
 $rm -f confest.$objext
 
+# PORTME: override above test on systems where it is broken
+ifelse([$1],[CXX],
+[case $host_os in
+solaris*)
+  case $cc_basename in
+  CC*)
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+    ;;
+  esac
+esac
+])
+
 case " $_LT_AC_TAGVAR(postdeps, $1) " in
 *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
 esac
@@ -3809,7 +3825,7 @@
 
 # On AIX, shared libraries and static libraries use the same namespace, and
 # are all built from PIC.
-case "$host_os" in
+case $host_os in
 aix3*)
   test "$enable_shared" = yes && enable_static=no
   if test -n "$RANLIB"; then
@@ -4708,7 +4724,7 @@
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	;;
       *)
@@ -4777,7 +4793,7 @@
 	  aCC*)
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
-	    case "$host_cpu" in
+	    case $host_cpu in
 	    hppa*64*|ia64*)
 	      # +Z the default
 	      ;;
@@ -4818,7 +4834,7 @@
 	    # Portland Group C++ compiler.
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	    ;;
 	  cxx*)
 	    # Compaq C++
@@ -4982,7 +4998,7 @@
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -5029,7 +5045,7 @@
       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -5059,12 +5075,12 @@
 	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
         ;;
-      pgcc* | pgf77* | pgf90*)
+      pgcc* | pgf77* | pgf90* | pgf95*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
 	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         ;;
       ccc*)
         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
@@ -5147,7 +5163,7 @@
     [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
@@ -5243,7 +5259,7 @@
   if test "$with_gnu_ld" = yes; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
-    
+
     # Set some defaults for GNU ld with shared library support. These
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
@@ -5264,7 +5280,7 @@
       *\ 2.11.*) ;; # other 2.11 versions
       *) supports_anon_versioning=yes ;;
     esac
-    
+
     # See if GNU ld supports shared libraries.
     case $host_os in
     aix3* | aix4* | aix5*)
@@ -5338,11 +5354,11 @@
 	tmp_addflag=
 	case $cc_basename,$host_cpu in
 	pgcc*)				# Portland Group C compiler
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
-	pgf77* | pgf90* )			# Portland Group f77 and f90 compilers
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -5548,7 +5564,7 @@
 	  # Exported symbols can be pulled into shared objects from archives
 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
 	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  # This is similar to how AIX traditionally builds its shared libraries.
 	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
@@ -5588,7 +5604,7 @@
       ;;
 
     darwin* | rhapsody*)
-      case "$host_os" in
+      case $host_os in
         rhapsody* | darwin1.[[012]])
          _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
          ;;
@@ -5617,7 +5633,7 @@
     	output_verbose_link_cmd='echo'
         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
       _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
       _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
     else
@@ -5626,7 +5642,7 @@
          output_verbose_link_cmd='echo'
          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
@@ -5692,7 +5708,7 @@
 
     hpux10* | hpux11*)
       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case "$host_cpu" in
+	case $host_cpu in
 	hppa*64*|ia64*)
 	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
@@ -5701,7 +5717,7 @@
 	  ;;
 	esac
       else
-	case "$host_cpu" in
+	case $host_cpu in
 	hppa*64*|ia64*)
 	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  ;;
@@ -5711,7 +5727,7 @@
 	esac
       fi
       if test "$with_gnu_ld" = no; then
-	case "$host_cpu" in
+	case $host_cpu in
 	hppa*64*)
 	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
 	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'

Modified: freeswitch/branches/james/conf/freeswitch.xml
==============================================================================
--- freeswitch/branches/james/conf/freeswitch.xml	(original)
+++ freeswitch/branches/james/conf/freeswitch.xml	Sun Jun 18 11:09:41 2006
@@ -58,6 +58,7 @@
         
         <!-- ASR /TTS -->
         <!-- <load module="mod_cepstral"/> -->
+        <!-- <load module="mod_rss"/> -->
         </modules>
     </configuration>
   
@@ -67,9 +68,9 @@
         <!-- <param name="ip" value="1.2.3.4"> -->
         <param name="port" value="4569"/>
         <param name="dialplan" value="XML"/>
-        <param name="codec_prefs" value="PCMU,PCMA,speex,L16"/>
-        <param name="codec_master" value="us"/>
-        <param name="codec_rates" value="8"/>
+        <param name="codec-prefs" value="PCMU,PCMA,speex,L16"/>
+        <param name="codec-master" value="us"/>
+        <param name="codec-rates" value="8"/>
       </settings>
     </configuration>
   
@@ -104,8 +105,14 @@
       <settings>
         <param name="port" value="5060"/>
         <param name="dialplan" value="XML"/>
-        <param name="dtmf_duration" value="100"/>
-        <param name="codec_prefs" value="PCMU,PCMA"/>
+        <param name="dtmf-duration" value="100"/>
+        <param name="codec-prefs" value="PCMU,PCMA"/>
+	<!-- Payload number to bind DTMF to-->
+        <param name="rfc2833-pt" value="101"/>
+	<!-- disable to trade async for more calls -->
+	<param name="use-rtp-timer" value="true"/>
+	<!-- auto sense NAT issues and adjust accordingly -->
+	<param name="use-rtp-auto-adjust" value="true"/>
         <!-- pick one (default if not specified is 'guess'); -->
         <param name="rtp-ip" value="guess"/>
         <!-- <param name-"rtp-ip" value="10.0.0.1"/> -->
@@ -139,9 +146,9 @@
         <param name="debug" value="1"/>
         <param name="dialplan" value="XML"/>
         <param name="mtu" value="320"/>
-        <param name="dtmf_on" value="800"/>
-        <param name="dtmf_off" value="100"/>
-        <param name="supress_dtmf_tone" value="yes"/>
+        <param name="dtmf-on" value="800"/>
+        <param name="dtmf-off" value="100"/>
+        <param name="supress-dtmf-tone" value="yes"/>
       </settings>
       <span>
         <param name="span" value="1"/>
@@ -175,8 +182,8 @@
         <param name="indev" value="USB"/>
         <param name="outdev" value="USB"/>
   
-        <param name="cid_name" value="FreeSwitch"/>
-        <param name="cid_num" value="5555551212"/>
+        <param name="cid-name" value="FreeSwitch"/>
+        <param name="cid-num" value="5555551212"/>
       </settings>
     </configuration>
   
@@ -192,13 +199,13 @@
         <param name="#debug" value="1"/>
         <param name="jid" value="freeswitch at my.jabber.com/me"/>
         <param name="passwd" value="mypass"/>
-        <param name="target_jid" value="freeswitch at reader.org/him"/>
+        <param name="target-jid" value="freeswitch at reader.org/him"/>
       </settings>
     </configuration>
   
     <configuration name="dialplan_directory.conf" description="Dialplan Directory">
       <settings>
-        <param name="directory_name" value="ldap"/>
+        <param name="directory-name" value="ldap"/>
         <param name="host" value="ldap.freeswitch.org"/>
         <param name="dn" value="cn=Manager,dc=freeswitch,dc=org"/>
         <param name="pass" value="test"/>
@@ -209,7 +216,7 @@
     <configuration name="dingaling.conf" description="XMPP Jingle Endpoint">
       <settings>
         <param name="debug" value="0"/>
-        <param name="codec_prefs" value="PCMU"/>
+        <param name="codec-prefs" value="PCMU"/>
       </settings>
       <!-- *NOTE* your resource (after the /) MUST contain the string "talk" (upper or lower case is ok) -->
       <!-- *NOTE* as of May 2 2006 you must set"auto-login" to"true" if you want to be able to auto-login on startup"/> -->
@@ -221,6 +228,8 @@
         <param name="message" value="Jingle all the way"/>
         <param name="rtp-ip" value="10.0.0.1"/>
         <param name="auto-login" value="true"/>
+	<!-- disable to trade async for more calls -->
+	<param name="use-rtp-timer" value="true"/>
         <!-- or -->
         <!-- <param name="rtp-ip" value="my_lan_ip"/> -->
         <!-- <param name="ext-rtp-ip" value="stun:stun.server.com"/> -->
@@ -235,14 +244,27 @@
     <configuration name="xml_rpc.conf" description="XML RPC">
       <settings>
 	<!-- The port where you want to run the http service (default 8080) -->
-	<param name="http_port" value="8080"/>
+	<param name="http-port" value="8080"/>
+	<!-- if all 3 of the following params exist all http traffic will require auth -->
+        <param name="auth-realm" value="freeswitch"/>
+        <param name="auth-user" value="freeswitch"/>
+        <param name="auth-pass" value="works"/>
         <!-- The url to a gateway cgi that can generate xml similar to
         what's in this file only on-the-fly (leave it commented if you dont
         need it) -->
 	<!-- one or more |-delim of configuration|directory|dialplan -->
-        <!-- <param name="gateway_url" value="http://www.server.com/gateway.cgi" bindings="configuration"/> -->
+        <!-- <param name="gateway-url" value="http://www.server.com/gateway.cgi" bindings="configuration"/> -->
       </settings>
     </configuration>
+
+    <configuration name="rss.conf" description="RSS Parser">
+      <feeds>
+        <!-- Just download the files to wherever and refer to them here -->
+        <!-- <feed name="Slash Dot">/home/rss/rss.rss</feed> -->
+        <!-- <feed name="News Forge">/home/rss/newsforge.rss</feed> -->
+      </feeds>
+    </configuration>
+
   </section>
   <section name="dialplan" description="Regex/XML Dialplan">
     <!-- Valid fields in conditions:
@@ -252,10 +274,22 @@
 
     <!-- *NOTE* The special context name 'any' will match any context -->
     <context name="default">
-      <extension name="devconf">
-        <condition field="destination_number" expression="^888$">
-          <action application="bridge" data="exosip/888 at 66.250.68.194"/>
-	</condition>
+			<extension name="tollfree">
+      	<condition field="destination_number" expression="^(18[0{2}8{2}7{2}6{2}]\d{7})">
+					<action application="bridge" data="exosip/$1-freeswitch at voip.trxtel.com"/>
+				</condition>
+			</extension>
+
+			<extension name="devconf">
+				<condition field="destination_number" expression="^888$">
+					<action application="bridge" data="exosip/888 at 66.250.68.194"/>
+				</condition>
+			</extension>
+
+      <!-- if the destination is an exact match on the extension name
+      you do not need any regex in the condition -->
+      <extension name="999">
+        <condition><action application="bridge" data="exosip/888 at 66.250.68.194"/></condition>
       </extension>
       <!-- extensions starting with 4, all the numbers after 4 form a numeric filename
            continue=true means keep looking for more extensions to match

Modified: freeswitch/branches/james/configure
==============================================================================
--- freeswitch/branches/james/configure	(original)
+++ freeswitch/branches/james/configure	Sun Jun 18 11:09:41 2006
@@ -287,8 +287,8 @@
 # find a string as large as possible, as long as the shell can cope with it
   for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
-       echo_test_string="`eval $cmd`" &&
+    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+       echo_test_string=`eval $cmd` &&
        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
     then
       break
@@ -3463,7 +3463,7 @@
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
       lt_cv_path_LD="$ac_dir/$ac_prog"
       # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
+      # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
@@ -3497,7 +3497,7 @@
 if test "${lt_cv_prog_gnu_ld+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
 *GNU* | *'with BFD'*)
   lt_cv_prog_gnu_ld=yes
@@ -3667,7 +3667,7 @@
 
 hpux10.20* | hpux11*)
   lt_cv_file_magic_cmd=/usr/bin/file
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
@@ -3856,7 +3856,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-    case "`/usr/bin/file conftest.o`" in
+    case `/usr/bin/file conftest.o` in
     *32-bit*)
       case $host in
         x86_64-*linux*)
@@ -5589,7 +5589,7 @@
     elif test -x /usr/sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
     else
-      lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
     fi
     # And add a safety zone
     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
@@ -5904,7 +5904,7 @@
 default_ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except M$VC,
+# All known linkers require a `.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 ltmain="$ac_aux_dir/ltmain.sh"
@@ -6225,7 +6225,7 @@
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
-	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
 	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
@@ -6287,7 +6287,7 @@
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
-	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
 	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
@@ -6436,7 +6436,7 @@
    LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
    printf "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The compiler can only warn and ignore the option if not recognized
+     # The linker can only warn and ignore the option if not recognized
      # So say no if there are warnings
      if test -s conftest.err; then
        # Append any errors to the config.log.
@@ -6487,7 +6487,7 @@
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
    (eval echo "\"\$as_me:6493: $lt_compile\"" >&5)
@@ -6577,7 +6577,7 @@
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -6624,7 +6624,7 @@
       lt_prog_compiler_wl='-Wl,'
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -6654,12 +6654,12 @@
 	lt_prog_compiler_pic='-KPIC'
 	lt_prog_compiler_static='-static'
         ;;
-      pgcc* | pgf77* | pgf90*)
+      pgcc* | pgf77* | pgf90* | pgf95*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
 	lt_prog_compiler_wl='-Wl,'
 	lt_prog_compiler_pic='-fpic'
-	lt_prog_compiler_static='-static'
+	lt_prog_compiler_static='-Bstatic'
         ;;
       ccc*)
         lt_prog_compiler_wl='-Wl,'
@@ -6749,7 +6749,7 @@
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
    (eval echo "\"\$as_me:6755: $lt_compile\"" >&5)
@@ -6783,7 +6783,7 @@
 fi
 
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic=
@@ -6811,7 +6811,7 @@
    # Note that $ac_compile itself does not contain backslashes and begins
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
    (eval echo "\"\$as_me:6817: $lt_compile\"" >&5)
@@ -6829,7 +6829,7 @@
        lt_cv_prog_compiler_c_o=yes
      fi
    fi
-   chmod u+w .
+   chmod u+w . 2>&5
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -7029,11 +7029,11 @@
 	tmp_addflag=
 	case $cc_basename,$host_cpu in
 	pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
-	pgf77* | pgf90* )			# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -7341,7 +7341,7 @@
 	  # Exported symbols can be pulled into shared objects from archives
 	  whole_archive_flag_spec=' '
 	  archive_cmds_need_lc=yes
-	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  # This is similar to how AIX traditionally builds its shared libraries.
 	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
@@ -7381,7 +7381,7 @@
       ;;
 
     darwin* | rhapsody*)
-      case "$host_os" in
+      case $host_os in
         rhapsody* | darwin1.[012])
          allow_undefined_flag='${wl}-undefined ${wl}suppress'
          ;;
@@ -7410,7 +7410,7 @@
     	output_verbose_link_cmd='echo'
         archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
       module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
       archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
       module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
     else
@@ -7419,7 +7419,7 @@
          output_verbose_link_cmd='echo'
          archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
          module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
@@ -7485,7 +7485,7 @@
 
     hpux10* | hpux11*)
       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case "$host_cpu" in
+	case $host_cpu in
 	hppa*64*|ia64*)
 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
@@ -7494,7 +7494,7 @@
 	  ;;
 	esac
       else
-	case "$host_cpu" in
+	case $host_cpu in
 	hppa*64*|ia64*)
 	  archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  ;;
@@ -7504,7 +7504,7 @@
 	esac
       fi
       if test "$with_gnu_ld" = no; then
-	case "$host_cpu" in
+	case $host_cpu in
 	hppa*64*)
 	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
 	  hardcode_libdir_flag_spec_ld='+b $libdir'
@@ -7963,7 +7963,8 @@
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -8016,7 +8017,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -8054,7 +8055,14 @@
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -8099,7 +8107,7 @@
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -9054,7 +9062,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9057 "configure"
+#line 9065 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9120,7 +9128,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
+    (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
@@ -9152,7 +9160,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9155 "configure"
+#line 9163 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9218,7 +9226,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
+    (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
@@ -9268,7 +9276,7 @@
 
 # On AIX, shared libraries and static libraries use the same namespace, and
 # are all built from PIC.
-case "$host_os" in
+case $host_os in
 aix3*)
   test "$enable_shared" = yes && enable_static=no
   if test -n "$RANLIB"; then
@@ -9871,7 +9879,7 @@
 compiler_lib_search_path_CXX=
 
 # Source file extension for C++ test sources.
-ac_ext=cc
+ac_ext=cpp
 
 # Object file extension for compiled C++ test sources.
 objext=o
@@ -10007,7 +10015,7 @@
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
       lt_cv_path_LD="$ac_dir/$ac_prog"
       # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
+      # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
@@ -10041,7 +10049,7 @@
 if test "${lt_cv_prog_gnu_ld+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
 *GNU* | *'with BFD'*)
   lt_cv_prog_gnu_ld=yes
@@ -10321,7 +10329,7 @@
 	# Exported symbols can be pulled into shared objects from archives
 	whole_archive_flag_spec_CXX=' '
 	archive_cmds_need_lc_CXX=yes
-	# This is similar to how AIX traditionally builds it's shared libraries.
+	# This is similar to how AIX traditionally builds its shared libraries.
 	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
       fi
     fi
@@ -10360,7 +10368,7 @@
     fi
   ;;
       darwin* | rhapsody*)
-        case "$host_os" in
+        case $host_os in
         rhapsody* | darwin1.[012])
          allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
          ;;
@@ -10398,7 +10406,7 @@
           archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
         fi
         module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
           if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
             archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           else
@@ -10411,7 +10419,7 @@
          output_verbose_link_cmd='echo'
           archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
           module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
           archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
@@ -10491,7 +10499,7 @@
     ;;
   hpux10*|hpux11*)
     if test $with_gnu_ld = no; then
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*)
 	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
 	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
@@ -10507,7 +10515,7 @@
         ;;
       esac
     fi
-    case "$host_cpu" in
+    case $host_cpu in
     hppa*64*)
       hardcode_direct_CXX=no
       hardcode_shlibpath_var_CXX=no
@@ -10533,7 +10541,7 @@
 	ld_shlibs_CXX=no
 	;;
       aCC*)
-	case "$host_cpu" in
+	case $host_cpu in
 	hppa*64*|ia64*)
 	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
 	  ;;
@@ -10554,7 +10562,7 @@
       *)
 	if test "$GXX" = yes; then
 	  if test $with_gnu_ld = no; then
-	    case "$host_cpu" in
+	    case $host_cpu in
 	    ia64*|hppa*64*)
 	      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
 	      ;;
@@ -10655,7 +10663,7 @@
 
 	hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
 	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	whole_archive_flag_spec_CXX='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
         ;;
       cxx*)
 	# Compaq C++
@@ -10887,10 +10895,11 @@
     case $cc_basename in
       CC*)
 	# Sun C++ 4.2, 5.x and Centerline C++
+        archive_cmds_need_lc_CXX=yes
 	no_undefined_flag_CXX=' -zdefs'
-	archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
 	hardcode_libdir_flag_spec_CXX='-R$libdir'
 	hardcode_shlibpath_var_CXX=no
@@ -10910,15 +10919,7 @@
 	esac
 	link_all_deplibs_CXX=yes
 
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	output_verbose_link_cmd='echo'
 
 	# Archives containing C++ object files must be created using
 	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -11022,7 +11023,7 @@
   # The `*' in the case matches for architectures that use `case' in
   # $output_verbose_cmd can trigger glob expansion during the loop
   # eval without this substitution.
-  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
 
   for p in `eval $output_verbose_link_cmd`; do
     case $p in
@@ -11098,6 +11099,20 @@
 
 $rm -f confest.$objext
 
+# PORTME: override above test on systems where it is broken
+case $host_os in
+solaris*)
+  case $cc_basename in
+  CC*)
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    postdeps_CXX='-lCstd -lCrun'
+    ;;
+  esac
+esac
+
+
 case " $postdeps_CXX " in
 *" -lc "*) archive_cmds_need_lc_CXX=no ;;
 esac
@@ -11153,7 +11168,7 @@
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	;;
       *)
@@ -11222,7 +11237,7 @@
 	  aCC*)
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
-	    case "$host_cpu" in
+	    case $host_cpu in
 	    hppa*64*|ia64*)
 	      # +Z the default
 	      ;;
@@ -11263,7 +11278,7 @@
 	    # Portland Group C++ compiler.
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_pic_CXX='-fpic'
-	    lt_prog_compiler_static_CXX='-static'
+	    lt_prog_compiler_static_CXX='-Bstatic'
 	    ;;
 	  cxx*)
 	    # Compaq C++
@@ -11397,14 +11412,14 @@
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11403: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11418: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11407: \$? = $ac_status" >&5
+   echo "$as_me:11422: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -11431,7 +11446,7 @@
 fi
 
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic_CXX=
@@ -11459,14 +11474,14 @@
    # Note that $ac_compile itself does not contain backslashes and begins
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11465: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11480: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11469: \$? = $ac_status" >&5
+   echo "$as_me:11484: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -11477,7 +11492,7 @@
        lt_cv_prog_compiler_c_o_CXX=yes
      fi
    fi
-   chmod u+w .
+   chmod u+w . 2>&5
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -11740,7 +11755,8 @@
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -11793,7 +11809,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -11831,7 +11847,14 @@
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -11876,7 +11899,7 @@
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -12831,7 +12854,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12834 "configure"
+#line 12857 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12897,7 +12920,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
+    (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
@@ -12929,7 +12952,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12932 "configure"
+#line 12955 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12995,7 +13018,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
+    (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
@@ -13551,7 +13574,7 @@
 
 # On AIX, shared libraries and static libraries use the same namespace, and
 # are all built from PIC.
-case "$host_os" in
+case $host_os in
 aix3*)
   test "$enable_shared" = yes && enable_static=no
   if test -n "$RANLIB"; then
@@ -13639,7 +13662,7 @@
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -13686,7 +13709,7 @@
       lt_prog_compiler_wl_F77='-Wl,'
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -13716,12 +13739,12 @@
 	lt_prog_compiler_pic_F77='-KPIC'
 	lt_prog_compiler_static_F77='-static'
         ;;
-      pgcc* | pgf77* | pgf90*)
+      pgcc* | pgf77* | pgf90* | pgf95*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
 	lt_prog_compiler_wl_F77='-Wl,'
 	lt_prog_compiler_pic_F77='-fpic'
-	lt_prog_compiler_static_F77='-static'
+	lt_prog_compiler_static_F77='-Bstatic'
         ;;
       ccc*)
         lt_prog_compiler_wl_F77='-Wl,'
@@ -13811,14 +13834,14 @@
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13817: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13840: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13821: \$? = $ac_status" >&5
+   echo "$as_me:13844: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -13845,7 +13868,7 @@
 fi
 
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic_F77=
@@ -13873,14 +13896,14 @@
    # Note that $ac_compile itself does not contain backslashes and begins
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13879: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13902: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13883: \$? = $ac_status" >&5
+   echo "$as_me:13906: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -13891,7 +13914,7 @@
        lt_cv_prog_compiler_c_o_F77=yes
      fi
    fi
-   chmod u+w .
+   chmod u+w . 2>&5
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -14091,11 +14114,11 @@
 	tmp_addflag=
 	case $cc_basename,$host_cpu in
 	pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec_F77='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
-	pgf77* | pgf90* )			# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec_F77='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -14383,7 +14406,7 @@
 	  # Exported symbols can be pulled into shared objects from archives
 	  whole_archive_flag_spec_F77=' '
 	  archive_cmds_need_lc_F77=yes
-	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  # This is similar to how AIX traditionally builds its shared libraries.
 	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
@@ -14423,7 +14446,7 @@
       ;;
 
     darwin* | rhapsody*)
-      case "$host_os" in
+      case $host_os in
         rhapsody* | darwin1.[012])
          allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
          ;;
@@ -14452,7 +14475,7 @@
     	output_verbose_link_cmd='echo'
         archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
       module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
       archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
       module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
     else
@@ -14461,7 +14484,7 @@
          output_verbose_link_cmd='echo'
          archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
          module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
@@ -14527,7 +14550,7 @@
 
     hpux10* | hpux11*)
       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case "$host_cpu" in
+	case $host_cpu in
 	hppa*64*|ia64*)
 	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
@@ -14536,7 +14559,7 @@
 	  ;;
 	esac
       else
-	case "$host_cpu" in
+	case $host_cpu in
 	hppa*64*|ia64*)
 	  archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  ;;
@@ -14546,7 +14569,7 @@
 	esac
       fi
       if test "$with_gnu_ld" = no; then
-	case "$host_cpu" in
+	case $host_cpu in
 	hppa*64*)
 	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
 	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
@@ -15005,7 +15028,8 @@
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -15058,7 +15082,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -15096,7 +15120,14 @@
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -15141,7 +15172,7 @@
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -15995,14 +16026,14 @@
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16001: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16032: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16005: \$? = $ac_status" >&5
+   echo "$as_me:16036: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16085,7 +16116,7 @@
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -16132,7 +16163,7 @@
       lt_prog_compiler_wl_GCJ='-Wl,'
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -16162,12 +16193,12 @@
 	lt_prog_compiler_pic_GCJ='-KPIC'
 	lt_prog_compiler_static_GCJ='-static'
         ;;
-      pgcc* | pgf77* | pgf90*)
+      pgcc* | pgf77* | pgf90* | pgf95*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
 	lt_prog_compiler_wl_GCJ='-Wl,'
 	lt_prog_compiler_pic_GCJ='-fpic'
-	lt_prog_compiler_static_GCJ='-static'
+	lt_prog_compiler_static_GCJ='-Bstatic'
         ;;
       ccc*)
         lt_prog_compiler_wl_GCJ='-Wl,'
@@ -16257,14 +16288,14 @@
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16263: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16294: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16267: \$? = $ac_status" >&5
+   echo "$as_me:16298: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16291,7 +16322,7 @@
 fi
 
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic_GCJ=
@@ -16319,14 +16350,14 @@
    # Note that $ac_compile itself does not contain backslashes and begins
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16325: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16356: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16329: \$? = $ac_status" >&5
+   echo "$as_me:16360: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -16337,7 +16368,7 @@
        lt_cv_prog_compiler_c_o_GCJ=yes
      fi
    fi
-   chmod u+w .
+   chmod u+w . 2>&5
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -16537,11 +16568,11 @@
 	tmp_addflag=
 	case $cc_basename,$host_cpu in
 	pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec_GCJ='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
-	pgf77* | pgf90* )			# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec_GCJ='${wl}--whole-archive,`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -16849,7 +16880,7 @@
 	  # Exported symbols can be pulled into shared objects from archives
 	  whole_archive_flag_spec_GCJ=' '
 	  archive_cmds_need_lc_GCJ=yes
-	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  # This is similar to how AIX traditionally builds its shared libraries.
 	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
@@ -16889,7 +16920,7 @@
       ;;
 
     darwin* | rhapsody*)
-      case "$host_os" in
+      case $host_os in
         rhapsody* | darwin1.[012])
          allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
          ;;
@@ -16918,7 +16949,7 @@
     	output_verbose_link_cmd='echo'
         archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
       module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
       archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
       module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
     else
@@ -16927,7 +16958,7 @@
          output_verbose_link_cmd='echo'
          archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
          module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           ;;
@@ -16993,7 +17024,7 @@
 
     hpux10* | hpux11*)
       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case "$host_cpu" in
+	case $host_cpu in
 	hppa*64*|ia64*)
 	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
@@ -17002,7 +17033,7 @@
 	  ;;
 	esac
       else
-	case "$host_cpu" in
+	case $host_cpu in
 	hppa*64*|ia64*)
 	  archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  ;;
@@ -17012,7 +17043,7 @@
 	esac
       fi
       if test "$with_gnu_ld" = no; then
-	case "$host_cpu" in
+	case $host_cpu in
 	hppa*64*)
 	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
 	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
@@ -17471,7 +17502,8 @@
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -17524,7 +17556,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -17562,7 +17594,14 @@
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -17607,7 +17646,7 @@
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -18562,7 +18601,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18565 "configure"
+#line 18604 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18628,7 +18667,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
+    (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
@@ -18660,7 +18699,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18663 "configure"
+#line 18702 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18726,7 +18765,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
+    (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
@@ -21263,7 +21302,9 @@
 
 
 
-for ac_func in gethostname vasprintf mmap
+
+
+for ac_func in gethostname vasprintf mmap mlock mlockall
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5

Modified: freeswitch/branches/james/configure.in
==============================================================================
--- freeswitch/branches/james/configure.in	(original)
+++ freeswitch/branches/james/configure.in	Sun Jun 18 11:09:41 2006
@@ -34,7 +34,7 @@
 AC_FUNC_MALLOC
 AC_TYPE_SIGNAL
 AC_FUNC_STRFTIME
-AC_CHECK_FUNCS([gethostname vasprintf mmap])
+AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall])
 
 AC_C_BIGENDIAN(AC_DEFINE([__BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([__BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
 AC_DEFINE([__LITTLE_ENDIAN],1234,[for the places where it is not defined])

Modified: freeswitch/branches/james/modules.conf.in
==============================================================================
--- freeswitch/branches/james/modules.conf.in	(original)
+++ freeswitch/branches/james/modules.conf.in	Sun Jun 18 11:09:41 2006
@@ -6,12 +6,12 @@
 applications/mod_ivrtest
 applications/mod_playback
 applications/mod_skel
+#applications/mod_rss
 #asr_tts/mod_cepstral
 codecs/mod_g711
 codecs/mod_ilbc
 #codecs/mod_g729
 codecs/mod_gsm
-#codecs/mod_ilbc
 codecs/mod_l16
 #codecs/mod_speex
 #dialplans/mod_dialplan_directory

Modified: freeswitch/branches/james/src/include/switch.h
==============================================================================
--- freeswitch/branches/james/src/include/switch.h	(original)
+++ freeswitch/branches/james/src/include/switch.h	Sun Jun 18 11:09:41 2006
@@ -101,7 +101,6 @@
  *	Additionally, the experimental external modules make use of several external modules:
  *
  *	mod_Exosip:
- *		- JRTPlib (http://research.edm.luc.ac.be/jori/jrtplib/jrtplib.html)
  *		- eXoSIP (http://savannah.nongnu.org/projects/exosip/)
  *
  *	mod_iaxchan:

Modified: freeswitch/branches/james/src/include/switch_am_config.h.in
==============================================================================
--- freeswitch/branches/james/src/include/switch_am_config.h.in	(original)
+++ freeswitch/branches/james/src/include/switch_am_config.h.in	Sun Jun 18 11:09:41 2006
@@ -20,6 +20,12 @@
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
+/* Define to 1 if you have the `mlock' function. */
+#undef HAVE_MLOCK
+
+/* Define to 1 if you have the `mlockall' function. */
+#undef HAVE_MLOCKALL
+
 /* Define to 1 if you have the `mmap' function. */
 #undef HAVE_MMAP
 

Modified: freeswitch/branches/james/src/include/switch_caller.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_caller.h	(original)
+++ freeswitch/branches/james/src/include/switch_caller.h	Sun Jun 18 11:09:41 2006
@@ -60,6 +60,8 @@
 /*! \brief Call Specific Data
  */
 struct switch_caller_profile {
+	/*! The Call's User Name */
+	char *username;
 	/*! The name of the dialplan */
 	char *dialplan;
 	/*! Caller ID Name */
@@ -110,6 +112,7 @@
 	switch_caller_application_t *last_application;
 	/*! Pointer to the entire stack of applications for this extension */
 	switch_caller_application_t *applications;
+	struct switch_caller_extension *next;
 };
 
 /*!
@@ -148,6 +151,7 @@
 /*!
   \brief Create a new caller profile object
   \param pool memory pool to use
+  \param username tne username of the caller
   \param dialplan name of the dialplan module in use
   \param caller_id_name caller ID name
   \param caller_id_number caller ID number
@@ -161,16 +165,17 @@
   \return a new profile object allocated from the session's memory pool
 */
 SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memory_pool_t *pool,
-																  char *dialplan,
-																  char *caller_id_name,
-																  char *caller_id_number,
-																  char *network_addr,
-																  char *ani,
-																  char *ani2,
-																  char *rdnis,
-																  char *source,
-																  char *context,
-																  char *destination_number);
+																	char *username,
+																	char *dialplan,
+																	char *caller_id_name,
+																	char *caller_id_number,
+																	char *network_addr,
+																	char *ani,
+																	char *ani2,
+																	char *rdnis,
+																	char *source,
+																	char *context,
+																	char *destination_number);
 
 /*!
   \brief Clone an existing caller profile object

Modified: freeswitch/branches/james/src/include/switch_channel.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_channel.h	(original)
+++ freeswitch/branches/james/src/include/switch_channel.h	Sun Jun 18 11:09:41 2006
@@ -204,6 +204,15 @@
 SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel_t *channel, char *varname);
 
 /*!
+ * Start iterating over the entries in the channel variable list.
+ * @param channel the channel to intterate the variales for
+ * @param pool The pool to allocate the switch_hash_index_t iterator. If this
+ *          pool is NULL, then an internal, non-thread-safe iterator is used.
+ * @remark  Use switch_hash_next and switch_hash_this with this function to iterate all the channel variables
+ */
+SWITCH_DECLARE(switch_hash_index_t *) switch_channel_variable_first(switch_channel_t *channel, switch_memory_pool_t *pool);
+
+/*!
   \brief Assign a caller extension to a given channel
   \param channel channel to assign extension to
   \param caller_extension extension to assign
@@ -361,6 +370,13 @@
   \return the string representation of the state
 */
 SWITCH_DECLARE(const char *) switch_channel_state_name(switch_channel_state_t state);
+
+/*!
+  \brief Render the enum of the provided state name
+  \param name the name of the state
+  \return the enum value (numeric)
+*/
+SWITCH_DECLARE(switch_channel_state_t) switch_channel_name_state(char *name);
 
 /*!
   \brief Add information about a given channel to an event object

Modified: freeswitch/branches/james/src/include/switch_core.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_core.h	(original)
+++ freeswitch/branches/james/src/include/switch_core.h	Sun Jun 18 11:09:41 2006
@@ -111,9 +111,10 @@
 /*! 
   \brief Initilize the core
   \param console optional FILE stream for output
+  \param err a pointer to set any errors to
   \note to be called at application startup
 */
-SWITCH_DECLARE(switch_status_t) switch_core_init(char *console);
+SWITCH_DECLARE(switch_status_t) switch_core_init(char *console, const char **err);
 
 /*! 
   \brief Destroy the core
@@ -433,6 +434,12 @@
 SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, int stream_id);
 
 /*! 
+  \brief Reset the buffers and resampler on a session
+  \param session the session to reset
+*/
+SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session);
+
+/*! 
   \brief Write a frame to a session
   \param session the session to write to
   \param frame the frame to write
@@ -887,6 +894,36 @@
   \return SWITCH_STATUS_SUCCESS with len adjusted to the bytes written if successful
 */
 SWITCH_DECLARE(switch_status_t) switch_core_speech_feed_tts(switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags);
+
+/*! 
+  \brief Flush TTS audio on a given handle
+  \param sh the speech handle
+*/
+SWITCH_DECLARE(void) switch_core_speech_flush_tts(switch_speech_handle_t *sh);
+
+/*! 
+  \brief Set a text parameter on a TTS handle
+  \param sh the speech handle
+  \param param the parameter
+  \param val the value
+*/
+SWITCH_DECLARE(void) switch_core_speech_text_param_tts(switch_speech_handle_t *sh, char *param, char *val);
+
+/*! 
+  \brief Set a numeric parameter on a TTS handle
+  \param sh the speech handle
+  \param param the parameter
+  \param val the value
+*/
+SWITCH_DECLARE(void) switch_core_speech_numeric_param_tts(switch_speech_handle_t *sh, char *param, int val);
+
+/*! 
+  \brief Set a float parameter on a TTS handle
+  \param sh the speech handle
+  \param param the parameter
+  \param val the value
+*/
+SWITCH_DECLARE(void) switch_core_speech_float_param_tts(switch_speech_handle_t *sh, char *param, double val);
 
 /*! 
   \brief Read rendered audio from the TTS module

Modified: freeswitch/branches/james/src/include/switch_ivr.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_ivr.h	(original)
+++ freeswitch/branches/james/src/include/switch_ivr.h	Sun Jun 18 11:09:41 2006
@@ -72,17 +72,15 @@
   \param terminators digits to end the collection
   \param terminator actual digit that caused the collection to end (if any)
   \param timeout timeout in ms
-  \param poll_channel flag to specify if you want the function to poll the channel while running
   \return SWITCH_STATUS_SUCCESS to keep the collection moving.
 */
 SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_session_t *session,
-															  char *buf,
-															  unsigned int buflen,
-															  unsigned int maxdigits,
-															  const char *terminators,
-															  char *terminator,
-															  unsigned int timeout,
-                                                              unsigned int poll_channel);
+																char *buf,
+																unsigned int buflen,
+																unsigned int maxdigits,
+																const char *terminators,
+																char *terminator,
+																unsigned int timeout);
 	
 /*!
   \brief play a file from the disk to the session
@@ -125,6 +123,15 @@
 													 unsigned int buflen);
 
 
+SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session_t *session,
+                                                             switch_speech_handle_t *sh,
+                                                             switch_codec_t *codec,
+                                                             switch_timer_t *timer,
+                                                             switch_dtmf_callback_function_t dtmf_callback,
+                                                             char *text,
+                                                             void *buf,
+                                                             unsigned int buflen);
+
 /*!
   \brief Speak given text with given tts engine
   \param session the session to speak on
@@ -139,14 +146,15 @@
   \return SWITCH_STATUS_SUCCESS if all is well
 */
 SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *session, 
-													char *tts_name,
-													char *voice_name,
-													char *timer_name,
-													uint32_t rate,
-													switch_dtmf_callback_function_t dtmf_callback,
-													char *text,
-													void *buf,
-													unsigned int buflen);
+													  char *tts_name,
+													  char *voice_name,
+													  char *timer_name,
+													  uint32_t rate,
+													  switch_dtmf_callback_function_t dtmf_callback,
+													  char *text,
+													  void *buf,
+													  unsigned int buflen);
+
 
 /*!
   \brief Bridge Audio from one session to another

Modified: freeswitch/branches/james/src/include/switch_module_interfaces.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_module_interfaces.h	(original)
+++ freeswitch/branches/james/src/include/switch_module_interfaces.h	Sun Jun 18 11:09:41 2006
@@ -327,6 +327,10 @@
 									 switch_size_t *datalen,
 									 uint32_t *rate,
 									 switch_speech_flag_t *flags);
+	void (*speech_flush_tts)(switch_speech_handle_t *sh);
+	void (*speech_text_param_tts)(switch_speech_handle_t *sh, char *param, char *val);
+	void (*speech_numeric_param_tts)(switch_speech_handle_t *sh, char *param, int val);
+	void (*speech_float_param_tts)(switch_speech_handle_t *sh, char *param, double val);
 
 	const struct switch_speech_interface *next;
 };
@@ -338,7 +342,13 @@
 	const switch_speech_interface_t *speech_interface;
 	/*! flags to control behaviour */
 	uint32_t flags;
-
+	/*! The Name*/
+	char *name;
+	/*! The Rate*/
+	uint32_t rate;
+	uint32_t speed;
+	char voice[80];
+	char engine[80];
 	/*! the handle's memory pool */
 	switch_memory_pool_t *memory_pool;
 	/*! private data for the format module to store handle specific info */

Modified: freeswitch/branches/james/src/include/switch_rtp.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_rtp.h	(original)
+++ freeswitch/branches/james/src/include/switch_rtp.h	Sun Jun 18 11:09:41 2006
@@ -349,6 +349,13 @@
 SWITCH_DECLARE(void) switch_rtp_set_private(switch_rtp_t *rtp_session, void *private_data);
 
 /*! 
+  \brief Set the payload type to consider RFC2833 DTMF
+  \param rtp_session the RTP session to modify
+  \param te the payload type
+*/
+SWITCH_DECLARE(void) switch_rtp_set_telephony_event(switch_rtp_t *rtp_session, switch_payload_t te);
+
+/*! 
   \brief Retrieve the private data from a given RTP session
   \param rtp_session the RTP session to retrieve the data from
   \return the pointer to the private data

Modified: freeswitch/branches/james/src/include/switch_types.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_types.h	(original)
+++ freeswitch/branches/james/src/include/switch_types.h	Sun Jun 18 11:09:41 2006
@@ -92,8 +92,8 @@
 #define SWITCH_MAX_STATE_HANDLERS 30
 #define SWITCH_TRUE 1
 #define SWITCH_FALSE 0
+#define SWITCH_CORE_QUEUE_LEN 20000
 
-
 typedef enum {
 	SWITCH_XML_SECTION_RESULT = 0,
 	SWITCH_XML_SECTION_CONFIG = (1 << 0),
@@ -229,7 +229,9 @@
     SWITCH_STATUS_GENERR	- A general Error
     SWITCH_STATUS_INUSE		- An indication that requested resource is in use
 	SWITCH_STATUS_BREAK     - A non-fatal break of an operation
-    SWITCH_STATUS_SOCKERR  - A socket error
+    SWITCH_STATUS_SOCKERR   - A socket error
+	SWITCH_STATUS_MORE_DATA - Need More Data
+	SWITCH_STATUS_NOTFOUND  - Not Found
 </pre>
  */
 typedef enum {
@@ -245,7 +247,9 @@
 	SWITCH_STATUS_GENERR,
 	SWITCH_STATUS_INUSE,
 	SWITCH_STATUS_BREAK,
-	SWITCH_STATUS_SOCKERR
+	SWITCH_STATUS_SOCKERR,
+	SWITCH_STATUS_MORE_DATA,
+	SWITCH_STATUS_NOTFOUND
 } switch_status_t;
 
 
@@ -340,6 +344,7 @@
 CF_LOCK_THREAD	= (1 <<  6) - Prevent the channel thread from exiting while this flag is set
 CF_BRIDGED		= (1 <<  7) - Channel in a bridge
 CF_HOLD			= (1 <<  8) - Channel is on hold
+CF_SERVICE		= (1 <<  9) - Channel has a service thread
 </pre>
  */
 
@@ -352,7 +357,8 @@
 	CF_ACCEPT_CNG	= (1 <<  5),
 	CF_LOCK_THREAD	= (1 <<  6),
 	CF_BRIDGED		= (1 <<  7),
-	CF_HOLD			= (1 <<  8)
+	CF_HOLD			= (1 <<  8),
+	CF_SERVICE		= (1 <<  9)
 } switch_channel_flag_t;
 
 
@@ -366,6 +372,7 @@
 </pre>
  */
 typedef enum {
+	SFF_NONE = 0,
 	SFF_CNG = (1 << 0),
 	SFF_RAW_RTP = (1 << 1)
 } switch_frame_flag_t;
@@ -419,6 +426,7 @@
 SWITCH_SPEECH_FLAG_PEEK =			(1 <<  3) - Read data but do not erase it.
 SWITCH_SPEECH_FLAG_FREE_POOL =		(1 <<  4) - Free interface's pool on destruction.
 SWITCH_SPEECH_FLAG_BLOCKING =       (1 <<  5) - Indicate that a blocking call is desired 
+SWITCH_SPEECH_FLAG_PAUSE = 			(1 <<  6) - Pause toggle for playback
 </pre>
 */
 typedef enum {
@@ -428,6 +436,7 @@
 	SWITCH_SPEECH_FLAG_PEEK =			(1 <<  3),
 	SWITCH_SPEECH_FLAG_FREE_POOL =		(1 <<  4),
 	SWITCH_SPEECH_FLAG_BLOCKING =		(1 <<  5),
+	SWITCH_SPEECH_FLAG_PAUSE =			(1 <<  6)
 
 } switch_speech_flag_t;
 

Modified: freeswitch/branches/james/src/include/switch_xml.h
==============================================================================
--- freeswitch/branches/james/src/include/switch_xml.h	(original)
+++ freeswitch/branches/james/src/include/switch_xml.h	Sun Jun 18 11:09:41 2006
@@ -172,6 +172,12 @@
 ///\return the value
 SWITCH_DECLARE(const char *) switch_xml_attr(switch_xml_t xml, const char *attr);
 
+///\brief returns the value of the requested tag attribute, or "" if not found
+///\param xml the xml node
+///\param attr the attribute
+///\return the value
+SWITCH_DECLARE(const char *) switch_xml_attr_soft(switch_xml_t xml, const char *attr);
+
 ///\brief Traverses the switch_xml sturcture to retrieve a specific subtag. Takes a
 ///\ variable length list of tag names and indexes. The argument list must be
 ///\ terminated by either an index of -1 or an empty string tag name. Example: 
@@ -271,13 +277,15 @@
 
 ///\brief open the Core xml root
 ///\param reload if it's is already open close it and open it again as soon as permissable (blocking)
+///\param err a pointer to set error strings
 ///\return the xml root node or NULL
-SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload);
+SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **err);
 
 ///\brief initilize the core XML backend
 ///\param pool a memory pool to use
+///\param err a pointer to set error strings
 ///\return SWITCH_STATUS_SUCCESS if successful
-SWITCH_DECLARE(switch_status_t) switch_xml_init(switch_memory_pool_t *pool);
+SWITCH_DECLARE(switch_status_t) switch_xml_init(switch_memory_pool_t *pool, const char **err);
 
 
 SWITCH_DECLARE(switch_status_t) switch_xml_destroy(void);

Modified: freeswitch/branches/james/src/mod/applications/mod_bridgecall/mod_bridgecall.c
==============================================================================
--- freeswitch/branches/james/src/mod/applications/mod_bridgecall/mod_bridgecall.c	(original)
+++ freeswitch/branches/james/src/mod/applications/mod_bridgecall/mod_bridgecall.c	Sun Jun 18 11:09:41 2006
@@ -56,6 +56,7 @@
 
 	caller_caller_profile = switch_channel_get_caller_profile(caller_channel);
 	caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
+											   caller_caller_profile->username,
 											   caller_caller_profile->dialplan,
 											   caller_caller_profile->caller_id_name,
 											   caller_caller_profile->caller_id_number,

Modified: freeswitch/branches/james/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/branches/james/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/branches/james/src/mod/applications/mod_commands/mod_commands.c	Sun Jun 18 11:09:41 2006
@@ -24,6 +24,8 @@
  * Contributor(s):
  * 
  * Anthony Minessale II <anthmct at yahoo.com>
+ * Michael Jerris <mike at jerris.com>
+ * Johny Kadarisman <jkr888 at gmail.com>
  *
  * 
  * mod_commands.c -- Misc. Command Module
@@ -80,6 +82,20 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
+
+static switch_status_t reload_function(char *mod, switch_stream_handle_t *stream)
+{
+	const char *err;
+	switch_xml_t xml_root;
+
+	if ((xml_root = switch_xml_open_root(1, &err))) {
+		switch_xml_free(xml_root);
+	}
+	
+	stream->write_function(stream, "OK [%s]\n", err);
+	return SWITCH_STATUS_SUCCESS;
+}
+
 static switch_status_t kill_function(char *dest, switch_stream_handle_t *stream)
 {
 	switch_core_session_t *session = NULL;
@@ -171,7 +187,7 @@
 static int show_callback(void *pArg, int argc, char **argv, char **columnNames){
 	switch_stream_handle_t *stream = (switch_stream_handle_t *) pArg;
 
-	stream->write_function(stream, "%s\n", argv[1]);
+	stream->write_function(stream, "%s|%s\n", argv[0], argv[1] ? argv[1] : "NULL");
 	return 0;
 }
 
@@ -182,7 +198,22 @@
 	char *errmsg;
 	switch_core_db_t *db = switch_core_db_handle();
 
-	sprintf (sql, "select * from interfaces");
+    if (!cmd) {
+        sprintf (sql, "select * from interfaces");
+    }
+    else if ( !strcmp(cmd,"codec") || !strcmp(cmd,"application") || 
+              !strcmp(cmd,"api") || !strcmp(cmd,"dialplan") || 
+              !strcmp(cmd,"file") || !strcmp(cmd,"timer") 
+            ) {
+        sprintf (sql, "select * from interfaces where type = '%s'", cmd);
+    }
+    else {
+        stream->write_function(stream, "Invalid interfaces type!\n");
+        stream->write_function(stream, "Example:\n");
+        stream->write_function(stream, "show <blank>|codec|application|api|dialplan|file|timer\n");
+        return SWITCH_STATUS_SUCCESS;
+    }
+    
 	switch_core_db_exec(db, sql, show_callback, stream, &errmsg);
 
 	if (errmsg) {
@@ -231,12 +262,19 @@
 	/*.next */ &transfer_api_interface
 };
 
+static switch_api_interface_t reload_api_interface = {
+	/*.interface_name */ "reloadxml",
+	/*.desc */ "Reload XML",
+	/*.function */ reload_function,
+	/*.next */ &load_api_interface,
 
+};
+
 static switch_api_interface_t commands_api_interface = {
 	/*.interface_name */ "killchan",
 	/*.desc */ "Kill Channel",
 	/*.function */ kill_function,
-	/*.next */ &load_api_interface
+	/*.next */ &reload_api_interface
 };
 
 static const switch_loadable_module_interface_t mod_commands_module_interface = {

Modified: freeswitch/branches/james/src/mod/applications/mod_ivrtest/mod_ivrtest.c
==============================================================================
--- freeswitch/branches/james/src/mod/applications/mod_ivrtest/mod_ivrtest.c	(original)
+++ freeswitch/branches/james/src/mod/applications/mod_ivrtest/mod_ivrtest.c	Sun Jun 18 11:09:41 2006
@@ -63,7 +63,7 @@
 	const char *teamname;
 
 	for (team = switch_xml_child(f1, "team"); team; team = team->next) {
-		teamname = switch_xml_attr(team, "name");
+		teamname = switch_xml_attr_soft(team, "name");
 		for (driver = switch_xml_child(team, "driver"); driver; driver = driver->next) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, 
 							  "%s, %s: %s\n", switch_xml_child(driver, "name")->txt, teamname,
@@ -183,7 +183,7 @@
 			}
 		}
 
-		if (switch_ivr_collect_digits_count(session, buf, sizeof(buf), 10, "#*", &term, 10000, 1) != SWITCH_STATUS_SUCCESS) {
+		if (switch_ivr_collect_digits_count(session, buf, sizeof(buf), 10, "#*", &term, 10000) != SWITCH_STATUS_SUCCESS) {
 			switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
 			break;
 		}

Modified: freeswitch/branches/james/src/mod/applications/mod_playback/mod_playback.c
==============================================================================
--- freeswitch/branches/james/src/mod/applications/mod_playback/mod_playback.c	(original)
+++ freeswitch/branches/james/src/mod/applications/mod_playback/mod_playback.c	Sun Jun 18 11:09:41 2006
@@ -49,6 +49,43 @@
 }
 
 
+static void speak_function(switch_core_session_t *session, char *data)
+{
+	switch_channel_t *channel;
+	char buf[10];
+	char *argv[4] = {0};
+	int argc;
+	char *engine = NULL;
+	char *voice = NULL;
+	char *text = NULL;
+	char *timer_name = NULL;
+	char *mydata = NULL;
+	switch_codec_t *codec;
+
+	codec = switch_core_session_get_read_codec(session);
+	assert(codec != NULL);
+
+	channel = switch_core_session_get_channel(session);
+    assert(channel != NULL);
+
+	mydata = switch_core_session_strdup(session, data);
+	argc = switch_separate_string(mydata, '|', argv, sizeof(argv)/sizeof(argv[0]));
+
+	engine = argv[0];
+	voice = argv[1];
+	text = argv[2];
+	timer_name = argv[3];
+	
+	if (!(engine && voice && text)) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Params!\n");
+		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+	}
+
+	switch_channel_answer(channel);
+	switch_ivr_speak_text(session, engine, voice, timer_name, codec->implementation->samples_per_second, on_dtmf, text, buf, sizeof(buf));
+	
+}
+
 static void playback_function(switch_core_session_t *session, char *data)
 {
 	switch_channel_t *channel;
@@ -85,9 +122,17 @@
 	
 }
 
+
+static const switch_application_interface_t speak_application_interface = {
+	/*.interface_name */ "speak",
+	/*.application_function */ speak_function
+};
+
 static const switch_application_interface_t record_application_interface = {
 	/*.interface_name */ "record",
-	/*.application_function */ record_function
+	/*.application_function */ record_function,
+	NULL,NULL,NULL,
+	&speak_application_interface
 };
 
 static const switch_application_interface_t playback_application_interface = {

Modified: freeswitch/branches/james/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
==============================================================================
--- freeswitch/branches/james/src/mod/asr_tts/mod_cepstral/mod_cepstral.c	(original)
+++ freeswitch/branches/james/src/mod/asr_tts/mod_cepstral/mod_cepstral.c	Sun Jun 18 11:09:41 2006
@@ -36,6 +36,8 @@
 #include <swift.h>
 #include <switch.h>
 
+#define MY_BUF_LEN 1024 * 256
+
 static const char modname[] = "mod_cepstral";
 
 static swift_engine *engine;
@@ -59,22 +61,42 @@
 	cepstral_t *cepstral;
     swift_event_t rv = SWIFT_SUCCESS;
     void *buf = NULL;
-    int len = 0;
+    int len = 0, i = 0;
 	
 	cepstral = udata;
 	assert(cepstral != NULL);
 	
+	if (!cepstral->port || cepstral->done || cepstral->done_gen) {
+		return  SWIFT_UNKNOWN_ERROR;
+	}
+
 	/* Only proceed when we have success */
     if (!SWIFT_FAILED((rv = swift_event_get_audio(event, &buf, &len)))) {
-		switch_mutex_lock(cepstral->audio_lock);
-		if (switch_buffer_write(cepstral->audio_buffer, buf, len) <= 0) {
-			rv = SWIFT_UNKNOWN_ERROR;
+		while(!cepstral->done) {
+			switch_mutex_lock(cepstral->audio_lock);
+			if (switch_buffer_write(cepstral->audio_buffer, buf, len) > 0) {
+				switch_mutex_unlock(cepstral->audio_lock);
+				break;
+			}
+			switch_mutex_unlock(cepstral->audio_lock);
+			if (!cepstral->done) {
+				for (i = 0; i < 10; i++) {
+					switch_yield(10000);
+					if (cepstral->done) {
+						break;
+					}
+				}
+			}
+			
 		}
-		switch_mutex_unlock(cepstral->audio_lock);
 	} else {
 		cepstral->done = 1;
 	}
 
+	if (cepstral->done) {
+		rv = SWIFT_UNKNOWN_ERROR;
+	}
+	
     return rv;
 }
 
@@ -91,7 +113,7 @@
 			return SWITCH_STATUS_MEMERR;
 		}
 
-		if (switch_buffer_create(sh->memory_pool, &cepstral->audio_buffer, SWITCH_RECCOMMENDED_BUFFER_SIZE) != SWITCH_STATUS_SUCCESS) {
+		if (switch_buffer_create(sh->memory_pool, &cepstral->audio_buffer, MY_BUF_LEN) != SWITCH_STATUS_SUCCESS) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Write Buffer Failed!\n");
 			return SWITCH_STATUS_MEMERR;
 		}
@@ -130,8 +152,14 @@
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to set voice.\n");
 				goto all_done;
 			}
+
+			voice_name = (char *) swift_voice_get_attribute(cepstral->voice, "name");
 		}
 
+		if (voice_name) {
+            switch_copy_string(sh->voice, voice_name, sizeof(sh->voice));
+        }
+
 		swift_port_set_callback(cepstral->port, &write_audio, SWIFT_EVENT_AUDIO, cepstral);
 
 		sh->private_info = cepstral;
@@ -150,6 +178,10 @@
 	cepstral = sh->private_info;
 	assert(cepstral != NULL);
 	
+
+	cepstral->done = 1;
+	cepstral->done_gen = 1;
+	swift_port_stop(cepstral->port, SWIFT_ASYNC_ANY, SWIFT_EVENT_NOW);
 	/* Close the Swift Port and Engine */
 	if (NULL != cepstral->port) swift_port_close(cepstral->port);
 	//if (NULL != cepstral->engine) swift_engine_close(cepstral->engine);
@@ -163,19 +195,45 @@
 static switch_status_t cepstral_speech_feed_tts(switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags)
 {
 	cepstral_t *cepstral;
+	const char *fp = "file:";
+	int len = strlen(fp);
 
 	assert(sh != NULL);
 	cepstral = sh->private_info;
 	assert(cepstral != NULL);
 
+	cepstral->done_gen = 0;
+	cepstral->done = 0;
 
-	swift_port_speak_text(cepstral->port, text, 0, NULL, &cepstral->tts_stream, NULL); 
-	//swift_port_speak_text(cepstral->port, text, 0, NULL, NULL, NULL); 
-
+	cepstral->tts_stream = NULL;
 	
+	if (!strncasecmp(text, fp, len)) {
+		text += len;
+		swift_port_speak_file(cepstral->port, text, NULL, &cepstral->tts_stream, NULL); 
+	} else {
+		swift_port_speak_text(cepstral->port, text, 0, NULL, &cepstral->tts_stream, NULL); 
+	}
+
 	return SWITCH_STATUS_FALSE;
 }
 
+static void cepstral_speech_flush_tts(switch_speech_handle_t *sh)
+{
+	cepstral_t *cepstral;
+
+	cepstral = sh->private_info;
+    assert(cepstral != NULL);
+
+	cepstral->done_gen = 1;
+    cepstral->done = 1;
+	if (cepstral->audio_buffer) {
+		switch_mutex_lock(cepstral->audio_lock);
+		switch_buffer_zero(cepstral->audio_buffer);
+		switch_mutex_unlock(cepstral->audio_lock);
+	}
+	swift_port_stop(cepstral->port, SWIFT_ASYNC_ANY, SWIFT_EVENT_NOW);
+}
+
 static switch_status_t cepstral_speech_read_tts(switch_speech_handle_t *sh,
 											  void *data,
 											  size_t *datalen,
@@ -193,20 +251,23 @@
 
 	while(!cepstral->done) {
 		if (!cepstral->done_gen) {
-			int check = (SWIFT_STATUS_RUNNING == swift_port_status(cepstral->port, cepstral->tts_stream));
-			if (!check) {
+			int check = swift_port_status(cepstral->port, cepstral->tts_stream);
+
+			if (!check == SWIFT_STATUS_RUNNING) {
 				cepstral->done_gen = 1;
 			}
 		}
 
+		switch_mutex_lock(cepstral->audio_lock);
 		used = switch_buffer_inuse(cepstral->audio_buffer);
-
-
+		switch_mutex_unlock(cepstral->audio_lock);
 		
+		
 		if (!used && cepstral->done_gen) {
+
+			status = SWITCH_STATUS_BREAK;
 			break;
 		}
-		
 
 		/* wait for the right amount of data (unless there is no blocking flag) */
 		if (used < desired) {
@@ -245,6 +306,83 @@
 	return status;
 }
 
+static void cepstral_text_param_tts(switch_speech_handle_t *sh, char *param, char *val)
+{
+	cepstral_t *cepstral;
+
+	cepstral = sh->private_info;
+	assert(cepstral != NULL);
+
+	if (!strcasecmp(param, "voice")) {
+		char *voice_name = val;
+		if (!strcasecmp(voice_name, "next")) {
+			if ((cepstral->voice = swift_port_find_next_voice(cepstral->port))) {
+				if ( SWIFT_FAILED(swift_port_set_voice(cepstral->port, cepstral->voice)) ) {
+					cepstral->done = cepstral->done_gen = 1;
+					return;
+				}
+				voice_name = (char *) swift_voice_get_attribute(cepstral->voice, "name");
+			} else {
+				voice_name = NULL;
+			}
+		} else {
+			if (voice_name && SWIFT_FAILED(swift_port_set_voice_by_name(cepstral->port, voice_name))) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid voice %s!\n", voice_name);
+				voice_name = NULL;
+			}
+		}
+
+		if (!voice_name) {
+            /* Find the first voice on the system */
+            if ((cepstral->voice = swift_port_find_first_voice(cepstral->port, NULL, NULL)) == NULL) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to find any voices!\n");
+				cepstral->done = cepstral->done_gen = 1;
+				return;
+            }
+
+            /* Set the voice found by find_first_voice() as the port's current voice */
+            if ( SWIFT_FAILED(swift_port_set_voice(cepstral->port, cepstral->voice)) ) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to set voice.\n");
+				cepstral->done = cepstral->done_gen = 1;
+				return;
+            }
+
+			voice_name = (char *) swift_voice_get_attribute(cepstral->voice, "name");
+        } 
+
+		if (voice_name) {
+			switch_copy_string(sh->voice, voice_name, sizeof(sh->voice));
+		}
+
+		return;
+	}
+
+	swift_port_set_param_string(cepstral->port, param, val, NULL);
+}
+
+static void cepstral_numeric_param_tts(switch_speech_handle_t *sh, char *param, int val)
+{
+	cepstral_t *cepstral;
+
+	cepstral = sh->private_info;
+	assert(cepstral != NULL);
+
+	swift_port_set_param_int(cepstral->port, param, val, NULL);
+
+}
+
+
+static void cepstral_float_param_tts(switch_speech_handle_t *sh, char *param, double val)
+{
+	cepstral_t *cepstral;
+
+	cepstral = sh->private_info;
+	assert(cepstral != NULL);
+
+	swift_port_set_param_float(cepstral->port, param, val, NULL);
+
+}
+
 static const switch_speech_interface_t cepstral_speech_interface = {
 	/*.interface_name*/			"cepstral",
 	/*.speech_open*/			cepstral_speech_open,
@@ -252,8 +390,11 @@
 	/*.speech_feed_asr*/		NULL,
 	/*.speech_interpret_asr*/	NULL,
 	/*.speech_feed_tts*/		cepstral_speech_feed_tts,
-	/*.speech_read_tts*/		cepstral_speech_read_tts
-	
+	/*.speech_read_tts*/		cepstral_speech_read_tts,
+	/*.speech_flush_tts*/		cepstral_speech_flush_tts,
+	/*.speech_text_param_tts*/  cepstral_text_param_tts,
+	/*.speech_numeric_param_tts*/  cepstral_numeric_param_tts,
+	/*.speech_numeric_param_tts*/  cepstral_float_param_tts
 };
 
 static const switch_loadable_module_interface_t cepstral_module_interface = {

Modified: freeswitch/branches/james/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c
==============================================================================
--- freeswitch/branches/james/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c	(original)
+++ freeswitch/branches/james/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c	Sun Jun 18 11:09:41 2006
@@ -64,12 +64,10 @@
 
 	if ((settings = switch_xml_child(cfg, "settings"))) {
 		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 
-			if (!strcmp(var, "directory_name") && val) {
-				set_global_directory_name(val);
-			} else if (!strcmp(var, "directory_name") && val) {
+			if (!strcmp(var, "directory-name") && val) {
 				set_global_directory_name(val);
 			} else if (!strcmp(var, "host") && val) {
 				set_global_host(val);

Modified: freeswitch/branches/james/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
==============================================================================
--- freeswitch/branches/james/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c	(original)
+++ freeswitch/branches/james/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c	Sun Jun 18 11:09:41 2006
@@ -122,13 +122,80 @@
 	substituted[y++] = '\0';
 }
 
+static int parse_exten(switch_core_session_t *session, switch_xml_t xexten, switch_caller_extension_t **extension)
+{
+	switch_xml_t xcond, xaction;
+	switch_caller_profile_t *caller_profile;
+	switch_channel_t *channel;
+	char *exten_name = (char *) switch_xml_attr_soft(xexten, "name");
+	int proceed = 0;
+
+	channel = switch_core_session_get_channel(session);
+	caller_profile = switch_channel_get_caller_profile(channel);
+
+	for (xcond = switch_xml_child(xexten, "condition"); xcond; xcond = xcond->next) {
+		char *field = NULL;
+		char *expression = NULL;
+		char *field_data = NULL;
+		pcre *re = NULL;
+		int ovector[30];
+
+		field = (char *) switch_xml_attr(xcond, "field");
+		expression = (char *) switch_xml_attr_soft(xcond, "expression");
+		
+		if (field) {
+			if (*field == '$') {
+				field_data = switch_channel_get_variable(channel, field + 1);
+			} else {
+				field_data = switch_caller_get_field_by_name(caller_profile, field);
+			}
+			if (!field_data) {
+				field_data = "";
+			}
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "test conditions %s(%s) =~ /%s/\n", field, field_data, expression);
+			if (!(proceed = perform_regex(channel, field_data, expression, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Regex mismatch\n");
+				break;
+			}
+			assert(re != NULL);
+		}
+
+
+		for (xaction = switch_xml_child(xcond, "action"); xaction; xaction = xaction->next) {
+			char *application = (char*) switch_xml_attr_soft(xaction, "application");
+			char *data = (char *) switch_xml_attr_soft(xaction, "data");
+			char substituted[1024] = "";
+			char *app_data = NULL;
+
+			if (field && strchr(expression, '(')) {
+				perform_substitution(re, proceed, data, field_data, substituted, sizeof(substituted), ovector);
+				app_data = substituted;
+			} else {
+				app_data = data;
+			}
+
+			if (!*extension) {
+				if ((*extension =
+					 switch_caller_extension_new(session, exten_name, caller_profile->destination_number)) == 0) {
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "memory error!\n");
+					return 0;
+				}
+			}
+
+			switch_caller_extension_add_application(session, *extension, application, app_data);
+		}
+
+		cleanre(re);
+	}
+	return proceed;
+}
+
 static switch_caller_extension_t *dialplan_hunt(switch_core_session_t *session)
 {
 	switch_caller_profile_t *caller_profile;
 	switch_caller_extension_t *extension = NULL;
 	switch_channel_t *channel;
-	char *exten_name = NULL;
-	switch_xml_t cfg, xml, xcontext, xexten, xaction, xcond;
+	switch_xml_t cfg, xml, xcontext, xexten;
 	char *context = NULL;
 	char params[1024];
 
@@ -143,7 +210,7 @@
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Processing %s->%s!\n", caller_profile->caller_id_name,
 					  caller_profile->destination_number);
 	
-	snprintf(params, sizeof(params), "dest=%s", caller_profile->destination_number);
+	snprintf(params, sizeof(params), "context=%s&dest=%s", caller_profile->context, caller_profile->destination_number);
 
 	if (switch_xml_locate("dialplan", NULL, NULL, NULL, &xml, &cfg, params) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of dialplan failed\n");
@@ -159,55 +226,21 @@
 		}
 	}
 	
-	for (xexten = switch_xml_child(xcontext, "extension"); xexten; xexten = xexten->next) {
+	if (!(xexten = switch_xml_find_child(xcontext, "extension", "name", caller_profile->destination_number))) {
+		xexten = switch_xml_child(xcontext, "extension");
+	}
+	
+	while(xexten) {
 		int proceed = 0;
-		char *cont = (char *) switch_xml_attr(xexten, "continue");
+		char *cont = (char *) switch_xml_attr_soft(xexten, "continue");
 
-		for (xcond = switch_xml_child(xexten, "condition"); xcond; xcond = xcond->next) {
-			char *field = (char *) switch_xml_attr(xcond, "field");
-			char *expression = (char *) switch_xml_attr(xcond, "expression");
-			char *field_data = switch_caller_get_field_by_name(caller_profile, field);
-			pcre *re = NULL;
-			int ovector[30];
-			
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "test conditions %s(%s) =~ /%s/\n", field, field_data, expression);
-			if (!(proceed = perform_regex(channel, field_data, expression, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Regex mismatch\n");
-				break;
-			}
+		proceed = parse_exten(session, xexten, &extension);
 
-			assert(re != NULL);
-
-			for (xaction = switch_xml_child(xcond, "action"); xaction; xaction = xaction->next) {
-				char *application = (char*) switch_xml_attr(xaction, "application");
-				char *data = (char *) switch_xml_attr(xaction, "data");
-				char substituted[1024] = "";
-				char *app_data = NULL;
-				
-				if (strchr(expression, '(')) {
-					perform_substitution(re, proceed, data, field_data, substituted, sizeof(substituted), ovector);
-					app_data = substituted;
-				} else {
-					app_data = data;
-				}
-
-				if (!extension) {
-					if ((extension =
-						 switch_caller_extension_new(session, exten_name, caller_profile->destination_number)) == 0) {
-						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "memory error!\n");
-						return NULL;
-					}
-				}
-
-				switch_caller_extension_add_application(session, extension, application, app_data);
-			}
-
-			cleanre(re);
-		}
-		
 		if (proceed && !switch_true(cont)) {
 			break;
 		}
+
+		xexten = xexten->next;
 	}
 
 

Modified: freeswitch/branches/james/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.vcproj
==============================================================================
--- freeswitch/branches/james/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.vcproj	(original)
+++ freeswitch/branches/james/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.vcproj	Sun Jun 18 11:09:41 2006
@@ -42,8 +42,8 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\pcre&quot;;&quot;$(InputDir)..\..\..\..\libs\pcre\win32&quot;"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;PCRE_STATIC"
+				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="1"
@@ -67,7 +67,7 @@
 				AdditionalDependencies="libpcre.lib"
 				OutputFile="..\..\..\..\w32\vsnet\$(OutDir)/mod/mod_dialplan_xml.dll"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="$(InputDir)..\..\..\..\libs\pcre\win32\$(OutDir);..\..\..\..\w32\vsnet\$(OutDir)"
+				AdditionalLibraryDirectories="&quot;..\..\..\..\w32\vsnet\$(OutDir)&quot;"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)/mod_dialplan_xml.pdb"
 				SubSystem="2"
@@ -125,8 +125,8 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\pcre&quot;;&quot;$(InputDir)..\..\..\..\libs\pcre\win32&quot;"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;PCRE_STATIC"
+				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
 				RuntimeLibrary="0"
 				UsePrecompiledHeader="0"
 				WarningLevel="4"
@@ -147,7 +147,7 @@
 				AdditionalDependencies="libpcre.lib"
 				OutputFile="..\..\..\..\w32\vsnet\$(OutDir)/mod/mod_dialplan_xml.dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="$(InputDir)..\..\..\..\libs\pcre\win32\$(OutDir);..\..\..\..\w32\vsnet\$(OutDir)"
+				AdditionalLibraryDirectories="&quot;..\..\..\..\w32\vsnet\$(OutDir)&quot;"
 				GenerateDebugInformation="true"
 				SubSystem="2"
 				OptimizeReferences="2"

Modified: freeswitch/branches/james/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/branches/james/src/mod/endpoints/mod_dingaling/mod_dingaling.c	(original)
+++ freeswitch/branches/james/src/mod/endpoints/mod_dingaling/mod_dingaling.c	Sun Jun 18 11:09:41 2006
@@ -63,7 +63,8 @@
 	TFLAG_DO_DESC = (1 << 15),
 	TFLAG_LANADDR = (1 << 16),
 	TFLAG_AUTO = (1 << 17),
-	TFLAG_DTMF = (1 << 18)
+	TFLAG_DTMF = (1 << 18),
+	TFLAG_TIMER = ( 1 << 19)
 } TFLAGS;
 
 typedef enum {
@@ -236,6 +237,7 @@
 	switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session);
 	const char *err;
 	int ms = 20;
+	switch_rtp_flag_t flags;
 
 	if (tech_pvt->rtp_session) {
 		return 0;
@@ -246,12 +248,12 @@
 	}
 
 	if (switch_core_codec_init(&tech_pvt->read_codec,
-							   tech_pvt->codec_name,
-							   8000,
-							   ms,
-							   1,
-							   SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
-							   NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
+				   tech_pvt->codec_name,
+				   8000,
+				   ms,
+				   1,
+				   SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
+				   NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't load codec?\n");
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
 		return -1;
@@ -260,14 +262,14 @@
 	tech_pvt->read_frame.codec = &tech_pvt->read_codec;
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set Read Codec to %s\n", tech_pvt->codec_name);
-
+	
 	if (switch_core_codec_init(&tech_pvt->write_codec,
-							   tech_pvt->codec_name,
-							   8000,
-							   ms,
-							   1,
-							   SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
-							   NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
+				   tech_pvt->codec_name,
+				   8000,
+				   ms,
+				   1,
+				   SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
+				   NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't load codec?\n");
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
 		return -1;
@@ -279,17 +281,23 @@
 	
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SETUP RTP %s:%d -> %s:%d\n", tech_pvt->profile->ip, tech_pvt->local_port, tech_pvt->remote_ip, tech_pvt->remote_port);
+	
+	flags = SWITCH_RTP_FLAG_GOOGLEHACK | SWITCH_RTP_FLAG_AUTOADJ;
 
+	if (switch_test_flag(tech_pvt->profile, TFLAG_TIMER)) {
+	  flags |= SWITCH_RTP_FLAG_USE_TIMER;
+	}
+
 	if (!(tech_pvt->rtp_session = switch_rtp_new(tech_pvt->profile->ip,
-												 tech_pvt->local_port,
-												 tech_pvt->remote_ip,
-												 tech_pvt->remote_port,
-												 tech_pvt->codec_num,
-												 tech_pvt->read_codec.implementation->encoded_bytes_per_frame,
-												 tech_pvt->read_codec.implementation->microseconds_per_frame,
-												 SWITCH_RTP_FLAG_USE_TIMER | SWITCH_RTP_FLAG_AUTOADJ | SWITCH_RTP_FLAG_GOOGLEHACK,
-												 NULL,
-												 &err, switch_core_session_get_pool(tech_pvt->session)))) {
+						     tech_pvt->local_port,
+						     tech_pvt->remote_ip,
+						     tech_pvt->remote_port,
+						     tech_pvt->codec_num,
+						     tech_pvt->read_codec.implementation->encoded_bytes_per_frame,
+						     tech_pvt->read_codec.implementation->microseconds_per_frame,
+						     flags,
+						     NULL,
+						     &err, switch_core_session_get_pool(tech_pvt->session)))) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "RTP ERROR %s\n", err);
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
 		return -1;
@@ -881,14 +889,14 @@
 
 	switch (msg->message_id) {
 	case SWITCH_MESSAGE_INDICATE_BRIDGE:
-		if (tech_pvt->rtp_session) {
+	  if (tech_pvt->rtp_session && switch_test_flag(tech_pvt->profile, TFLAG_TIMER)) {
 			switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "De-activate timed RTP!\n");
 			//switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_TIMER_RECLOCK);
 		}
 		break;
 	case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
-		if (tech_pvt->rtp_session) {
+		if (tech_pvt->rtp_session && switch_test_flag(tech_pvt->profile, TFLAG_TIMER)) {
 			switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Re-activate timed RTP!\n");
 			//switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_TIMER_RECLOCK);
@@ -1188,6 +1196,8 @@
 		profile->login = switch_core_strdup(module_pool, val);
 	} else if (!strcasecmp(var, "password")) {
 		profile->password = switch_core_strdup(module_pool, val);
+	} else if (!strcasecmp(var, "use-rtp-timer") && switch_true(val)) {
+	  	switch_set_flag(profile, TFLAG_TIMER);
 	} else if (!strcasecmp(var, "dialplan")) {
 		profile->dialplan = switch_core_strdup(module_pool, val);
 	} else if (!strcasecmp(var, "name")) {
@@ -1225,6 +1235,12 @@
 static switch_status_t dl_logout(char *profile_name, switch_stream_handle_t *stream)
 {
 	struct mdl_profile *profile;
+
+	if (!profile_name) {
+		stream->write_function(stream, "NO PROFILE NAME SPECIFIED\n");
+		return SWITCH_STATUS_SUCCESS;
+	}
+
 	if ((profile = switch_core_hash_find(globals.profile_hash, profile_name))) {
 		ldl_handle_stop(profile->handle);
 		stream->write_function(stream, "OK\n");
@@ -1305,16 +1321,16 @@
 
 	if ((settings = switch_xml_child(cfg, "settings"))) {
 		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 
 			if (!strcasecmp(var, "debug")) {
 				globals.debug = atoi(val);
-			} else if (!strcasecmp(var, "codec_prefs")) {
+			} else if (!strcasecmp(var, "codec-prefs")) {
 				set_global_codec_string(val);
 				globals.codec_order_last =
 					switch_separate_string(globals.codec_string, ',', globals.codec_order, SWITCH_MAX_CODECS);
-			} else if (!strcasecmp(var, "codec_rates")) {
+			} else if (!strcasecmp(var, "codec-rates")) {
 				set_global_codec_rates_string(val);
 				globals.codec_rates_last =
 					switch_separate_string(globals.codec_rates_string, ',', globals.codec_rates, SWITCH_MAX_CODECS);
@@ -1324,8 +1340,8 @@
 	
 	for (xmlint = switch_xml_child(cfg, "interface"); xmlint; xmlint = xmlint->next) {
 		for (param = switch_xml_child(xmlint, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 
 			if (!globals.init) {
 				ldl_global_init(globals.debug);
@@ -1623,6 +1639,7 @@
 											  ldl_session_get_id(dlsession), cid_name, cid_num, exten);
 			
 							if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
+																					  profile->login,
 																					  profile->dialplan,
 																					  cid_name,
 																					  cid_num,

Modified: freeswitch/branches/james/src/mod/endpoints/mod_exosip/Makefile
==============================================================================
--- freeswitch/branches/james/src/mod/endpoints/mod_exosip/Makefile	(original)
+++ freeswitch/branches/james/src/mod/endpoints/mod_exosip/Makefile	Sun Jun 18 11:09:41 2006
@@ -11,8 +11,8 @@
 
 depends:
 	#MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install jrtplib --prefix=$(PREFIX) --disable-gst
-	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install libosip2-2.2.2.tar.gz --prefix=$(PREFIX)
-	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install libeXosip2-2.2.3-pre1.tar.gz  --disable-josua --prefix=$(PREFIX)
+	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install libosip2-2.2.3.tar.gz --prefix=$(PREFIX)
+	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install libeXosip2-2.2.3.tar.gz  --disable-josua --prefix=$(PREFIX)
 
 
 %.o:  %.c

Modified: freeswitch/branches/james/src/mod/endpoints/mod_exosip/mod_exosip.c
==============================================================================
--- freeswitch/branches/james/src/mod/endpoints/mod_exosip/mod_exosip.c	(original)
+++ freeswitch/branches/james/src/mod/endpoints/mod_exosip/mod_exosip.c	Sun Jun 18 11:09:41 2006
@@ -75,7 +75,9 @@
 	TFLAG_SECURE = (1 << 11),
 	TFLAG_VAD_IN = ( 1 << 12),
 	TFLAG_VAD_OUT = ( 1 << 13),
-	TFLAG_VAD = ( 1 << 14)
+	TFLAG_VAD = ( 1 << 14),
+	TFLAG_TIMER = ( 1 << 15),
+	TFLAG_AA = (1 << 16)
 } TFLAGS;
 
 
@@ -108,6 +110,7 @@
 	unsigned int flags;
 	switch_mutex_t *reg_mutex;
 	switch_core_db_t *db;
+	switch_payload_t te;
 } globals;
 
 struct private_object {
@@ -135,6 +138,9 @@
 	int ssrc;
 	switch_time_t last_read;
 	char *realm;
+	switch_codec_interface_t *codecs[SWITCH_MAX_CODECS];
+	int num_codecs;
+	switch_payload_t te;
 };
 
 
@@ -166,12 +172,30 @@
 static switch_status_t exosip_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
 										switch_io_flag_t flags, int stream_id);
 static int config_exosip(int reload);
-static switch_status_t parse_sdp_media(sdp_media_t * media, char **dname, char **drate, char **dpayload);
+static switch_status_t parse_sdp_media(struct private_object *tech_pvt, sdp_media_t * media, char **dname, char **drate, char **dpayload);
 static switch_status_t exosip_kill_channel(switch_core_session_t *session, int sig);
 static switch_status_t activate_rtp(struct private_object *tech_pvt);
 static void deactivate_rtp(struct private_object *tech_pvt);
-static void sdp_add_rfc2833(struct osip_rfc3264 *cnf, int rate);
 
+static void tech_set_codecs(struct private_object *tech_pvt)
+{
+	if (tech_pvt->num_codecs) {
+		return;
+	}
+
+	if (globals.codec_string) {
+		tech_pvt->num_codecs = switch_loadable_module_get_codecs_sorted(tech_pvt->codecs,
+																		SWITCH_MAX_CODECS,
+																		globals.codec_order,
+																		globals.codec_order_last);
+		
+	} else {
+		tech_pvt->num_codecs = switch_loadable_module_get_codecs(switch_core_session_get_pool(tech_pvt->session), tech_pvt->codecs,
+																 sizeof(tech_pvt->codecs) / sizeof(tech_pvt->codecs[0]));
+	}
+}
+
+
 static struct private_object *get_pvt_by_call_id(int id)
 {
 	char name[50];
@@ -254,8 +278,8 @@
 		char *dest_uri;
 		char *ip, *err;
 		switch_port_t sdp_port;
-		switch_codec_interface_t *codecs[SWITCH_MAX_CODECS];
-		int num_codecs = 0;
+		char dbuf[256];
+
 		/* do SIP Goodies... */
 
 		/* Decide on local IP and rtp port */
@@ -315,36 +339,33 @@
 		snprintf(port, sizeof(port), "%i", sdp_port);
 		sdp_message_m_media_add(tech_pvt->local_sdp, "audio", port, NULL, "RTP/AVP");
 		/* Add in every codec we support on this outbound call */
-		if (globals.codec_string) {
-			num_codecs = switch_loadable_module_get_codecs_sorted(codecs,
-																  SWITCH_MAX_CODECS,
-																  globals.codec_order,
-																  globals.codec_order_last);
-			
-		} else {
-			num_codecs =
-				switch_loadable_module_get_codecs(switch_core_session_get_pool(session), codecs,
-												  sizeof(codecs) / sizeof(codecs[0]));
-		}
-		
+		tech_set_codecs(tech_pvt);
 
-		if (num_codecs > 0) {
+
+		sprintf(dbuf, "%u", tech_pvt->te);
+		sdp_message_m_payload_add(tech_pvt->local_sdp, 0, osip_strdup(dbuf));
+		sdp_add_codec(tech_pvt->sdp_config, SWITCH_CODEC_TYPE_AUDIO, tech_pvt->te, "telephone-event", 8000, 0);
+		sprintf(dbuf, "%u telephone-event/8000", tech_pvt->te);
+		sdp_message_a_attribute_add(tech_pvt->local_sdp, 0, "rtpmap", osip_strdup(dbuf));
+		
+		
+		if (tech_pvt->num_codecs > 0) {
 			int i;
 			static const switch_codec_implementation_t *imp;
-			for (i = 0; i < num_codecs; i++) {
+			for (i = 0; i < tech_pvt->num_codecs; i++) {
 				int x = 0;
 
-				snprintf(tmp, sizeof(tmp), "%u", codecs[i]->ianacode);
+				snprintf(tmp, sizeof(tmp), "%u", tech_pvt->codecs[i]->ianacode);
 				sdp_message_m_payload_add(tech_pvt->local_sdp, 0, osip_strdup(tmp));
-				imp = codecs[i]->implementations;
+				imp = tech_pvt->codecs[i]->implementations;
 
 				while(NULL != imp) {
 					uint32_t sps = imp->samples_per_second;
 					/* Add to SDP config */
-					sdp_add_codec(tech_pvt->sdp_config, codecs[i]->codec_type, codecs[i]->ianacode, codecs[i]->iananame, sps, x++);
+					sdp_add_codec(tech_pvt->sdp_config, tech_pvt->codecs[i]->codec_type, tech_pvt->codecs[i]->ianacode, tech_pvt->codecs[i]->iananame, sps, x++);
 
 					/* Add to SDP message */
-					snprintf(tmp, sizeof(tmp), "%u %s/%d", codecs[i]->ianacode, codecs[i]->iananame, sps);
+					snprintf(tmp, sizeof(tmp), "%u %s/%d", tech_pvt->codecs[i]->ianacode, tech_pvt->codecs[i]->iananame, sps);
 					sdp_message_a_attribute_add(tech_pvt->local_sdp, 0, "rtpmap", osip_strdup(tmp));
 					memset(tmp, 0, sizeof(tmp));
 					if (imp) {
@@ -354,8 +375,8 @@
 			}
 		}
 
-		sdp_add_rfc2833(tech_pvt->sdp_config, 8000);
 
+
 		/* Setup our INVITE */
 		eXosip_lock();
 		if ((dest_uri =
@@ -367,9 +388,11 @@
 		eXosip_call_build_initial_invite(&invite, dest_uri, from_uri, NULL, NULL);
 		osip_message_set_supported(invite, "100rel, replaces");
 		/* Add SDP to the INVITE */
+
 		sdp_message_to_str(tech_pvt->local_sdp, &buf);
 		osip_message_set_body(invite, buf, strlen(buf));
 		osip_message_set_content_type(invite, "application/sdp");
+		
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "OUTBOUND SDP:\n%s\n", buf);
 		free(buf);
 		/* Send the INVITE */
@@ -475,6 +498,7 @@
 	switch_channel_t *channel;
 	const char *err;
 	char *key = NULL;
+	switch_rtp_flag_t flags;
 
 	assert(tech_pvt != NULL);
 
@@ -511,17 +535,25 @@
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "using Realm %s\n", tech_pvt->realm);
 		}
 	}
+	flags = SWITCH_RTP_FLAG_MINI | SWITCH_RTP_FLAG_RAW_WRITE;
+	if (switch_test_flag(tech_pvt, TFLAG_TIMER)) {
+		flags |= SWITCH_RTP_FLAG_USE_TIMER;
+	}
 
+	if (switch_test_flag(tech_pvt, TFLAG_AA)) {
+		flags |= SWITCH_RTP_FLAG_AUTOADJ;
+	}
+
 	tech_pvt->rtp_session = switch_rtp_new(tech_pvt->local_sdp_audio_ip,
-										   tech_pvt->local_sdp_audio_port,
-										   tech_pvt->remote_sdp_audio_ip,
-										   tech_pvt->remote_sdp_audio_port,
-										   tech_pvt->read_codec.codec_interface->ianacode,
-										   tech_pvt->read_codec.implementation->encoded_bytes_per_frame,
-										   ms,
-										   SWITCH_RTP_FLAG_MINI | SWITCH_RTP_FLAG_USE_TIMER | SWITCH_RTP_FLAG_TIMER_RECLOCK | SWITCH_RTP_FLAG_RAW_WRITE,
-										   key,
-										   &err, switch_core_session_get_pool(tech_pvt->session));
+					       tech_pvt->local_sdp_audio_port,
+					       tech_pvt->remote_sdp_audio_ip,
+					       tech_pvt->remote_sdp_audio_port,
+					       tech_pvt->read_codec.codec_interface->ianacode,
+					       tech_pvt->read_codec.implementation->encoded_bytes_per_frame,
+					       ms,
+					       flags,
+					       key,
+					       &err, switch_core_session_get_pool(tech_pvt->session));
 
 	if (tech_pvt->rtp_session) {
 		uint8_t vad_in = switch_test_flag(tech_pvt, TFLAG_VAD_IN) ? 1 : 0;
@@ -530,7 +562,11 @@
 
 		tech_pvt->ssrc = switch_rtp_get_ssrc(tech_pvt->rtp_session);
 		switch_set_flag(tech_pvt, TFLAG_RTP);
-		
+
+		if (tech_pvt->te > 96) {
+			switch_rtp_set_telephony_event(tech_pvt->rtp_session, tech_pvt->te);
+		}
+
 		if ((vad_in && inb) || (vad_out && !inb)) {
 			switch_rtp_enable_vad(tech_pvt->rtp_session, tech_pvt->session, &tech_pvt->read_codec, SWITCH_VAD_FLAG_TALKING);
 			switch_set_flag(tech_pvt, TFLAG_VAD);
@@ -819,51 +855,51 @@
 
 	switch (msg->message_id) {
 	case SWITCH_MESSAGE_INDICATE_BRIDGE:
-		if (tech_pvt->rtp_session) {
-			switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "De-activate timed RTP!\n");
-		}
-			break;
+	  if (tech_pvt->rtp_session && switch_test_flag(tech_pvt, TFLAG_TIMER)) {
+	    switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
+	    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "De-activate timed RTP!\n");
+	  }
+	  break;
 	case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
-		if (tech_pvt->rtp_session) {
-			switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Re-activate timed RTP!\n");
-		}
-			break;
+	  if (tech_pvt->rtp_session && switch_test_flag(tech_pvt, TFLAG_TIMER)) {
+	    switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
+	    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Re-activate timed RTP!\n");
+	  }
+	  break;
 	case SWITCH_MESSAGE_INDICATE_PROGRESS:
-		if (msg) {
-			struct private_object *tech_pvt;
-			switch_channel_t *channel = NULL;
-			
-			channel = switch_core_session_get_channel(session);
-			assert(channel != NULL);
+	  if (msg) {
+	    struct private_object *tech_pvt;
+	    switch_channel_t *channel = NULL;
+		  
+	    channel = switch_core_session_get_channel(session);
+	    assert(channel != NULL);
 
-			tech_pvt = switch_core_session_get_private(session);
-			assert(tech_pvt != NULL);
+	    tech_pvt = switch_core_session_get_private(session);
+	    assert(tech_pvt != NULL);
 
-			if (!switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
-				char *buf = NULL;
-				osip_message_t *progress = NULL;
+	    if (!switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
+	      char *buf = NULL;
+	      osip_message_t *progress = NULL;
 
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Asked to send early media by %s\n", msg->from);
+	      switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Asked to send early media by %s\n", msg->from);
 
-				/* Transmit 183 Progress with SDP */
-				eXosip_lock();
-				eXosip_call_build_answer(tech_pvt->tid, 183, &progress);
-				if (progress) {
-					sdp_message_to_str(tech_pvt->local_sdp, &buf);
-					osip_message_set_body(progress, buf, strlen(buf));
-					osip_message_set_content_type(progress, "application/sdp");
-					free(buf);
-					eXosip_call_send_answer(tech_pvt->tid, 183, progress);
-					switch_set_flag(tech_pvt, TFLAG_EARLY_MEDIA);
-					switch_channel_set_flag(channel, CF_EARLY_MEDIA);
-				}
-				eXosip_unlock();
-			}
-		}
+	      /* Transmit 183 Progress with SDP */
+	      eXosip_lock();
+	      eXosip_call_build_answer(tech_pvt->tid, 183, &progress);
+	      if (progress) {
+		sdp_message_to_str(tech_pvt->local_sdp, &buf);
+		osip_message_set_body(progress, buf, strlen(buf));
+		osip_message_set_content_type(progress, "application/sdp");
+		free(buf);
+		eXosip_call_send_answer(tech_pvt->tid, 183, progress);
+		switch_set_flag(tech_pvt, TFLAG_EARLY_MEDIA);
+		switch_channel_set_flag(channel, CF_EARLY_MEDIA);
+	      }
+	      eXosip_unlock();
+	    }
+	  }
 		
-		break;
+	  break;
 	default:
 		break;
 	}
@@ -995,6 +1031,7 @@
 			channel = switch_core_session_get_channel(*new_session);
 			switch_core_session_set_private(*new_session, tech_pvt);
 			tech_pvt->session = *new_session;
+			tech_pvt->te = globals.te;
 		} else {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
 			switch_core_session_destroy(new_session);
@@ -1097,26 +1134,6 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-static void sdp_add_rfc2833(struct osip_rfc3264 *cnf, int rate)
-{
-	sdp_media_t *med = NULL;
-	sdp_attribute_t *attr = NULL;
-	char tmp[128];
-	
-	sdp_media_init(&med);
-	sdp_attribute_init(&attr);
-	attr->a_att_field = osip_strdup("rtpmap");
-	snprintf(tmp, sizeof(tmp), "101 telephony-event/%d", rate);
-	attr->a_att_value = osip_strdup(tmp);
-	osip_list_add(med->a_attributes, attr, -1);
-	
-
-	med->m_media = osip_strdup("telephony-event");
-	osip_rfc3264_add_audio_media(cnf, med, -1);
-
-}
-
-
 static switch_status_t exosip_create_call(eXosip_event_t * event)
 {
 	switch_core_session_t *session;
@@ -1127,13 +1144,12 @@
 	int mline = 0, pos = 0;
 	switch_channel_t *channel = NULL;
 	char name[128];
-	char *dpayload, *dname = NULL, *drate = NULL;
+	char *dpayload = NULL, *dname = NULL, *drate = NULL;
 	char *remote_sdp_str = NULL;
+	char dbuf[256];
 
 	if ((session = switch_core_session_request(&exosip_endpoint_interface, NULL)) != 0) {
 		struct private_object *tech_pvt;
-		switch_codec_interface_t *codecs[SWITCH_MAX_CODECS];
-		int num_codecs = 0;
 		switch_port_t sdp_port;
 		char *ip, *err;
 		osip_uri_t *uri;
@@ -1149,6 +1165,7 @@
 			channel = switch_core_session_get_channel(session);
 			switch_core_session_set_private(session, tech_pvt);
 			tech_pvt->session = session;
+			tech_pvt->te = globals.te;
 		} else {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
 			switch_core_session_destroy(&session);
@@ -1169,7 +1186,7 @@
 		if (!(val = osip_from_get_displayname(from))) {
 			val = event->request->from->url->username;
 			if (!val) {
-				val = "n/a";
+				val = "FreeSWITCH";
 			}
 		}
 		
@@ -1191,6 +1208,7 @@
 		}
 
 		if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
+																  username,
 																  globals.dialplan,
 																  displayname,
 																  username,
@@ -1254,37 +1272,35 @@
 		}
 		osip_rfc3264_init(&tech_pvt->sdp_config);
 		/* Add in what codecs we support locally */
+		tech_set_codecs(tech_pvt);
+		
+		sdp_message_init(&tech_pvt->local_sdp);
+		sprintf(dbuf, "%u", tech_pvt->te);
+		sdp_message_m_payload_add(tech_pvt->local_sdp, 0, osip_strdup(dbuf));
+		sdp_add_codec(tech_pvt->sdp_config, SWITCH_CODEC_TYPE_AUDIO, tech_pvt->te, "telephone-event", 8000, 0);
+		sprintf(dbuf, "%u telephone-event/8000", tech_pvt->te);
+		sdp_message_a_attribute_add(tech_pvt->local_sdp, 0, "rtpmap", osip_strdup(dbuf));
 
-		if (globals.codec_string) {
-			num_codecs = switch_loadable_module_get_codecs_sorted(codecs,
-																  SWITCH_MAX_CODECS,
-																  globals.codec_order,
-																  globals.codec_order_last);
-			
-		} else {
-			num_codecs = switch_loadable_module_get_codecs(switch_core_session_get_pool(session), codecs,
-														   sizeof(codecs) / sizeof(codecs[0]));
-		}
-
-		if (num_codecs > 0) {
+		
+		if (tech_pvt->num_codecs > 0) {
 			int i;
 			static const switch_codec_implementation_t *imp;
 
 
 
-			for (i = 0; i < num_codecs; i++) {
+			for (i = 0; i < tech_pvt->num_codecs; i++) {
 				int x = 0;
 
-				for (imp = codecs[i]->implementations; imp; imp = imp->next) {
-					sdp_add_codec(tech_pvt->sdp_config, codecs[i]->codec_type, codecs[i]->ianacode, codecs[i]->iananame,
+				for (imp = tech_pvt->codecs[i]->implementations; imp; imp = imp->next) {
+					sdp_add_codec(tech_pvt->sdp_config, tech_pvt->codecs[i]->codec_type, tech_pvt->codecs[i]->ianacode, tech_pvt->codecs[i]->iananame,
 								  imp->samples_per_second, x++);
 				}
 			}
 		}
-		sdp_add_rfc2833(tech_pvt->sdp_config, 8000);
 
+
 		osip_rfc3264_prepare_answer(tech_pvt->sdp_config, remote_sdp, local_sdp_str, 8192);
-		sdp_message_init(&tech_pvt->local_sdp);
+		
 		sdp_message_parse(tech_pvt->local_sdp, local_sdp_str);
 
 		sdp_message_to_str(remote_sdp, &remote_sdp_str);
@@ -1300,7 +1316,7 @@
 			for (pos = 0; audio_tab[pos] != NULL; pos++) {
 				osip_rfc3264_complete_answer(tech_pvt->sdp_config, remote_sdp, tech_pvt->local_sdp, audio_tab[pos],
 											 mline);
-				if (parse_sdp_media(audio_tab[pos], &dname, &drate, &dpayload) == SWITCH_STATUS_SUCCESS) {
+				if (parse_sdp_media(tech_pvt, audio_tab[pos], &dname, &drate, &dpayload) == SWITCH_STATUS_SUCCESS) {
 					tech_pvt->payload_num = atoi(dpayload);
 					break;
 				}
@@ -1444,39 +1460,73 @@
 
 }
 
-static switch_status_t parse_sdp_media(sdp_media_t * media, char **dname, char **drate, char **dpayload)
+static switch_status_t parse_sdp_media(struct private_object *tech_pvt, sdp_media_t * media, char **dname, char **drate, char **dpayload)
 {
 	int pos = 0;
 	sdp_attribute_t *attr = NULL;
-	char *name, *rate, *payload;
+	char *name, *payload, *rate;
 	switch_status_t status = SWITCH_STATUS_GENERR;
+	char workspace[512];
 
 	while (osip_list_eol(media->a_attributes, pos) == 0) {
 		attr = (sdp_attribute_t *) osip_list_get(media->a_attributes, pos);
 		if (attr != NULL && strcasecmp(attr->a_att_field, "rtpmap") == 0) {
-			payload = attr->a_att_value;
-			if ((name = strchr(payload, ' ')) != 0) {
-				*(name++) = '\0';
-				/* Name and payload are required */
-				*dpayload = strdup(payload);
-				status = SWITCH_STATUS_SUCCESS;
-				if ((rate = strchr(name, '/')) != 0) {
-					*(rate++) = '\0';
-					*drate = strdup(rate);
-					*dname = strdup(name);
+			switch_payload_t pt;
+			uint32_t r;
+			int32_t i;
+			uint8_t match = 0;
+			name = rate = payload = NULL;
+
+			switch_copy_string(workspace, attr->a_att_value, sizeof(workspace));
+			payload = workspace;
+			if ((name = strchr(workspace, ' ')) != 0) {
+                *(name++) = '\0';
+			}
+			if ((rate = strchr(name, '/'))) {
+				*rate++ = '\0';
+			}
+			pt = (switch_payload_t)atoi(payload);
+			r = atoi(rate);
+			
+			if (!strcasecmp(name, "telephone-event")) {
+				tech_pvt->te = pt;
+				attr = NULL;
+				pos++;
+				continue;
+			}
+
+			for(i = 0; !match && i < tech_pvt->num_codecs; i++) {
+				const switch_codec_implementation_t *imp;
+				
+				if (pt < 97) {
+					match = (pt == tech_pvt->codecs[i]->ianacode) ? 1 : 0;
 				} else {
-					*dname = strdup(name);
-					*drate = strdup("8000");
+					match = strcasecmp(name, tech_pvt->codecs[i]->iananame) ? 0 : 1;
 				}
-			} else {
-				*dpayload = strdup("10");
-				*dname = strdup("L16");
-				*drate = strdup("8000");
+				
+				if (match) {
+					match = 0;
+					
+					for (imp = tech_pvt->codecs[i]->implementations; imp; imp = imp->next) {
+						if ((r == imp->samples_per_second)) {
+							match = 1;
+							break;
+						}
+					}
+				}
 			}
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Found negotiated codec Payload: %s Name: %s Rate: %s\n",
-								  *dpayload, *dname, *drate);
-			break;
+
+			if (match) {
+				*dname = strdup(name);
+				*drate = strdup(rate);
+				*dpayload = strdup(payload);
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Found negotiated codec Payload: %s Name: %s Rate: %s\n",
+								  *dpayload, *dname, *drate);	
+				break;
+			}
+
 		}
+
 		attr = NULL;
 		pos++;
 	}
@@ -1525,8 +1575,11 @@
 				}
 
 
-				expires = get_header_value(je, "expires");
-				exptime = time(NULL) + atoi(expires) + 20;
+				if ((expires = get_header_value(je, "expires"))) {
+					exptime = time(NULL) + atoi(expires) + 20;
+				} else {
+					exptime = time(NULL) + 3600;
+				}
 
 				
 				if (!find_reg_url(globals.db, je->request->from->url->username, sql, sizeof(sql))) {
@@ -1608,7 +1661,7 @@
 	snprintf(tech_pvt->remote_sdp_audio_ip, 50, conn->c_addr);
 
 	/* Grab codec elements */
-	if (parse_sdp_media(remote_med, &dname, &drate, &dpayload) == SWITCH_STATUS_SUCCESS) {
+	if (parse_sdp_media(tech_pvt, remote_med, &dname, &drate, &dpayload) == SWITCH_STATUS_SUCCESS) {
 		tech_pvt->payload_num = atoi(dpayload);
 	}
 
@@ -1877,16 +1930,23 @@
 	}
 
 	globals.dtmf_duration = 100;
+	globals.te = 101;
 
 	if ((settings = switch_xml_child(cfg, "settings"))) {
 		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 
 			if (!strcmp(var, "debug")) {
 				globals.debug = atoi(val);
+			} else if (!strcmp(var, "use-rtp-timer") && switch_true(val)) {
+				  switch_set_flag(&globals, TFLAG_TIMER);
+			} else if (!strcmp(var, "use-rtp-auto-adjust") && switch_true(val)) {
+				  switch_set_flag(&globals, TFLAG_AA);
 			} else if (!strcmp(var, "port")) {
 				globals.port = atoi(val);
+			} else if (!strcmp(var, "rfc2833-pt")) {
+				globals.te = (switch_payload_t) atoi(val);
 			} else if (!strcmp(var, "vad")) {
 				if (!strcasecmp(val, "in")) {
 					switch_set_flag(&globals, TFLAG_VAD_IN);
@@ -1912,12 +1972,12 @@
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Add Realm [%s][%s]\n", name, val);
 					switch_core_hash_insert(globals.srtp_hash, switch_core_strdup(module_pool, name), switch_core_strdup(module_pool, val));
 				}
-			} else if (!strcmp(var, "codec_prefs")) {
+			} else if (!strcmp(var, "codec-prefs")) {
 				set_global_codec_string(val);
 				globals.codec_order_last = switch_separate_string(globals.codec_string, ',', globals.codec_order, SWITCH_MAX_CODECS);
-			} else if (!strcmp(var, "codec_ms")) {
+			} else if (!strcmp(var, "codec-ms")) {
 				globals.codec_ms = atoi(val);
-			} else if (!strcmp(var, "dtmf_duration")) {
+			} else if (!strcmp(var, "dtmf-duration")) {
 				int dur = atoi(val);
 				if (dur > 10 && dur < 8000) {
 					globals.dtmf_duration = dur;

Modified: freeswitch/branches/james/src/mod/endpoints/mod_iax/mod_iax.c
==============================================================================
--- freeswitch/branches/james/src/mod/endpoints/mod_iax/mod_iax.c	(original)
+++ freeswitch/branches/james/src/mod/endpoints/mod_iax/mod_iax.c	Sun Jun 18 11:09:41 2006
@@ -829,8 +829,8 @@
 
 	if ((settings = switch_xml_child(cfg, "settings"))) {
 		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 
 			if (!strcmp(var, "debug")) {
 				globals.debug = atoi(val);
@@ -838,17 +838,17 @@
 				globals.port = atoi(val);
 			} else if (!strcmp(var, "ip")) {
 				set_global_ip(val);
-			} else if (!strcmp(var, "codec_master")) {
+			} else if (!strcmp(var, "codec-master")) {
 				if (!strcasecmp(val, "us")) {
 					switch_set_flag(&globals, GFLAG_MY_CODEC_PREFS);
 				}
 			} else if (!strcmp(var, "dialplan")) {
 				set_global_dialplan(val);
-			} else if (!strcmp(var, "codec_prefs")) {
+			} else if (!strcmp(var, "codec-prefs")) {
 				set_global_codec_string(val);
 				globals.codec_order_last =
 					switch_separate_string(globals.codec_string, ',', globals.codec_order, SWITCH_MAX_CODECS);
-			} else if (!strcmp(var, "codec_rates")) {
+			} else if (!strcmp(var, "codec-rates")) {
 				set_global_codec_rates_string(val);
 				globals.codec_rates_last =
 					switch_separate_string(globals.codec_rates_string, ',', globals.codec_rates, SWITCH_MAX_CODECS);
@@ -999,6 +999,7 @@
 
 
 						if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
+																				  iaxevent->ies.username,
 																				  globals.dialplan,
 																				  iaxevent->ies.calling_name,
 																				  iaxevent->ies.calling_number,
@@ -1007,7 +1008,7 @@
 																				  NULL, 
 																				  NULL,
 																				  (char *)modname,
-																				  NULL,
+																				  iaxevent->ies.called_context,
 																				  iaxevent->ies.called_number)) != 0) {
 							char name[128];
 							snprintf(name, sizeof(name), "IAX/%s-%04x", tech_pvt->caller_profile->destination_number,

Modified: freeswitch/branches/james/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/branches/james/src/mod/endpoints/mod_portaudio/mod_portaudio.c	(original)
+++ freeswitch/branches/james/src/mod/endpoints/mod_portaudio/mod_portaudio.c	Sun Jun 18 11:09:41 2006
@@ -409,7 +409,31 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
+static switch_status_t channel_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg)
+{
+	switch_channel_t *channel;
+	struct private_object *tech_pvt;
+			
+	channel = switch_core_session_get_channel(session);
+	assert(channel != NULL);
+			
+	tech_pvt = switch_core_session_get_private(session);
+	assert(tech_pvt != NULL);
 
+
+	switch (msg->message_id) {
+	case SWITCH_MESSAGE_INDICATE_PROGRESS: 
+		{
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Engage Early Media\n");
+			switch_set_flag(tech_pvt, TFLAG_IO);
+		}
+	default:
+		break;
+	}
+	return SWITCH_STATUS_SUCCESS;
+}
+
+
 static switch_api_interface_t send_dtmf_interface = {
 	/*.interface_name */ "padtmf",
 	/*.desc */ "PortAudio Dial DTMF",
@@ -462,7 +486,8 @@
 	/*.kill_channel */ channel_kill_channel,
 	/*.waitfor_read */ channel_waitfor_read,
 	/*.waitfor_write */ channel_waitfor_write,
-	/*.send_dtmf */ channel_send_dtmf
+	/*.send_dtmf */ channel_send_dtmf,
+	/*.receive_message*/ channel_receive_message
 };
 
 static const switch_endpoint_interface_t channel_endpoint_interface = {
@@ -578,18 +603,18 @@
 
 	if ((settings = switch_xml_child(cfg, "settings"))) {
 		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 
 			if (!strcmp(var, "debug")) {
 				globals.debug = atoi(val);
-			} else if (!strcmp(var, "sample_rate")) {
+			} else if (!strcmp(var, "sample-rate")) {
 				globals.sample_rate = atoi(val);
 			} else if (!strcmp(var, "dialplan")) {
 				set_global_dialplan(val);
-			} else if (!strcmp(var, "cid_name")) {
+			} else if (!strcmp(var, "cid-name")) {
 				set_global_cid_name(val);
-			} else if (!strcmp(var, "cid_num")) {
+			} else if (!strcmp(var, "cid-num")) {
 				set_global_cid_num(val);
 			} else if (!strcmp(var, "indev")) {
 				if (*val == '#') {
@@ -823,6 +848,7 @@
 		}
 
 		if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
+																  NULL,
 																  globals.dialplan,
 																  globals.cid_name,
 																  globals.cid_num, NULL, NULL, NULL, NULL, (char *)modname, NULL, dest)) != 0) {
@@ -860,7 +886,7 @@
 		void *val;
 		int i = 0;
 
-		for (hi = apr_hash_first(module_pool, globals.call_hash); hi; hi = switch_hash_next(hi)) {
+		for (hi = switch_hash_first(module_pool, globals.call_hash); hi; hi = switch_hash_next(hi)) {
 			switch_hash_this(hi, NULL, NULL, &val);
 			tech_pvt = val;
 			channel = switch_core_session_get_channel(tech_pvt->session);
@@ -951,7 +977,7 @@
 	switch_hash_index_t *hi;
 	void *val;
 	if (!callid || !strcasecmp(callid, "all")) {
-		for (hi = apr_hash_first(module_pool, globals.call_hash); hi; hi = switch_hash_next(hi)) {
+		for (hi = switch_hash_first(module_pool, globals.call_hash); hi; hi = switch_hash_next(hi)) {
 			switch_hash_this(hi, NULL, NULL, &val);
 			tech_pvt = val;
 			print_info(tech_pvt, stream);

Modified: freeswitch/branches/james/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
==============================================================================
--- freeswitch/branches/james/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c	(original)
+++ freeswitch/branches/james/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c	Sun Jun 18 11:09:41 2006
@@ -566,8 +566,8 @@
 	while (bytes > 0) {
 		unsigned int towrite;
 
-#if 0
-		if (sangoma_socket_waitfor(tech_pvt->socket, -1, POLLOUT | POLLERR | POLLHUP) <= 0) {
+#if 1
+		if (sangoma_socket_waitfor(tech_pvt->socket, 1000, POLLOUT | POLLERR | POLLHUP) <= 0) {
 			return SWITCH_STATUS_GENERR;
 		}
 #endif
@@ -577,11 +577,17 @@
 #endif
 		towrite = bytes >= globals.mtu ? globals.mtu : bytes;
 
+		if (towrite < globals.mtu) {
+			int diff = globals.mtu - towrite;
+			memset(bp + towrite, 0, diff);
+			towrite = globals.mtu;
+		}
+
 		result = sangoma_sendmsg_socket(tech_pvt->socket,
 									 &tech_pvt->hdrframe, sizeof(tech_pvt->hdrframe), bp, towrite, 0);
 		if (result < 0) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
-								  "Bad Write frame len %u write %d bytes returned %d (%s)!\n", frame->datalen,
+								  "Bad Write frame len %u write %d bytes returned %d (%s)!\n", towrite,
 								  globals.mtu, result, strerror(errno));
 			if (errno == EBUSY) {
 				continue;
@@ -1128,8 +1134,9 @@
 		}
 
 		if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
+																  NULL,
 																  globals.dialplan,
-																  "N/A",
+																  "FreeSWITCH",
 																  event->ring.callingnum,
 																  event->ring.callingani,
 																  switch_strlen_zero(ani2str) ? NULL : ani2str,
@@ -1302,18 +1309,18 @@
 
 	if ((settings = switch_xml_child(cfg, "settings"))) {
 		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 
 			if (!strcmp(var, "debug")) {
 				globals.debug = atoi(val);
 			} else if (!strcmp(var, "mtu")) {
 				globals.mtu = atoi(val);
-			} else if (!strcmp(var, "dtmf_on")) {
+			} else if (!strcmp(var, "dtmf-on")) {
 				globals.dtmf_on = atoi(val);
-			} else if (!strcmp(var, "dtmf_off")) {
+			} else if (!strcmp(var, "dtmf-off")) {
 				globals.dtmf_off = atoi(val);
-			} else if (!strcmp(var, "supress_dtmf_tone")) {
+			} else if (!strcmp(var, "supress-dtmf-tone")) {
 				globals.supress_dtmf_tone = switch_true(val);
 			}
 		}
@@ -1322,8 +1329,8 @@
 	
 	for (span = switch_xml_child(cfg, "span"); span; span = span->next) {
 		for (param = switch_xml_child(span, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 
 			if (!strcmp(var, "span")) {
 				current_span = atoi(val);

Modified: freeswitch/branches/james/src/mod/endpoints/mod_woomera/mod_woomera.c
==============================================================================
--- freeswitch/branches/james/src/mod/endpoints/mod_woomera/mod_woomera.c	(original)
+++ freeswitch/branches/james/src/mod/endpoints/mod_woomera/mod_woomera.c	Sun Jun 18 11:09:41 2006
@@ -1065,6 +1065,7 @@
 				ip = woomera_message_header(&wmsg, "Remote-Address");
 
 				if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
+																		  NULL,
 																		  tech_pvt->profile->dialplan,
 																		  cid_name, cid_num, ip, NULL, NULL, NULL, (char *)modname, NULL, exten)) != 0) {
 					char name[128];
@@ -1317,8 +1318,8 @@
 
 	if ((settings = switch_xml_child(cfg, "settings"))) {
 		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 
 			if (!strcmp(var, "noload") && atoi(val)) {
 				return SWITCH_STATUS_TERM;
@@ -1331,8 +1332,8 @@
 
 	for (xmlp = switch_xml_child(cfg, "interface"); xmlp; xmlp = xmlp->next) {
 		for (param = switch_xml_child(xmlp, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 			if (!strcmp(var, "audio_ip")) {
 				strncpy(profile->audio_ip, val, sizeof(profile->audio_ip) - 1);
 			} else if (!strcmp(var, "host")) {

Modified: freeswitch/branches/james/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
==============================================================================
--- freeswitch/branches/james/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c	(original)
+++ freeswitch/branches/james/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c	Sun Jun 18 11:09:41 2006
@@ -66,8 +66,8 @@
 	
 	if ((settings = switch_xml_child(cfg, "settings"))) {
 		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 
 			if (!strcasecmp(var, "address")) {
 				set_global_address(val);

Modified: freeswitch/branches/james/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c
==============================================================================
--- freeswitch/branches/james/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c	(original)
+++ freeswitch/branches/james/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c	Sun Jun 18 11:09:41 2006
@@ -111,13 +111,13 @@
 
 	if ((settings = switch_xml_child(cfg, "settings"))) {
 		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 
 			if (!strcmp(var, "jid")) {
 				set_global_jid(val);
 				count++;
-			} else if (!strcmp(var, "target_jid")) {
+			} else if (!strcmp(var, "target-jid")) {
 				set_global_target_jid(val);
 				count++;
 			} else if (!strcmp(var, "passwd")) {

Modified: freeswitch/branches/james/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c
==============================================================================
--- freeswitch/branches/james/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c	(original)
+++ freeswitch/branches/james/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c	Sun Jun 18 11:09:41 2006
@@ -206,8 +206,8 @@
 
 	if ((settings = switch_xml_child(cfg, "settings"))) {
 		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 			
 			if (!strcmp(var, "browse")) {
 				if ((oid = switch_core_alloc(module_pool, sizeof(*oid))) != 0) {

Modified: freeswitch/branches/james/src/mod/languages/mod_perl/Makefile
==============================================================================
--- freeswitch/branches/james/src/mod/languages/mod_perl/Makefile	(original)
+++ freeswitch/branches/james/src/mod/languages/mod_perl/Makefile	Sun Jun 18 11:09:41 2006
@@ -23,7 +23,7 @@
 
 reswig: 
 	rm switch_swig_wrap.c
-	swig -DMULTIPLICITY -perl5 -module fs_perl switch_swig.c
+	swig -lswitch_swig.i -ignoremissing -DMULTIPLICITY -perl5 -module fs_perl switch_swig.c
 
 switch_swig_wrap.o: switch_swig_wrap.c
 	$(CC) -w $(CFLAGS) -c $< -o $@

Modified: freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig.c
==============================================================================
--- freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig.c	(original)
+++ freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig.c	Sun Jun 18 11:09:41 2006
@@ -18,12 +18,13 @@
 int fs_core_init(char *path)
 {
 	switch_status_t status;
+	const char *err = NULL;
 
 	if (switch_strlen_zero(path)) {
 		path = NULL;
 	}
 
-	status = switch_core_init(path);
+	status = switch_core_init(path, &err);
 
 	return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
 }
@@ -81,10 +82,10 @@
 	switch_channel_pre_answer(channel);
 }
 
-void fs_channel_hangup(switch_core_session_t *session)
+void fs_channel_hangup(switch_core_session_t *session, char *cause)
 {
 	switch_channel_t *channel = switch_core_session_get_channel(session);
-	switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
+	switch_channel_hangup(channel, switch_channel_str2cause(cause));
 }
 
 void fs_channel_set_variable(switch_core_session_t *session, char *var, char *val)
@@ -104,16 +105,17 @@
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 	switch_channel_state_t fs_state = switch_channel_get_state(channel);
 
-	if (!strcmp(state, "EXECUTE")) {
-		fs_state = CS_EXECUTE;
-	} else 	if (!strcmp(state, "TRANSMIT")) {
-		fs_state = CS_TRANSMIT;
+	if ((fs_state = switch_channel_name_state(state)) < CS_HANGUP) {
+		switch_channel_set_state(channel, fs_state);
 	}
-	
-	switch_channel_set_state(channel, fs_state);
 }
 
-int fs_ivr_play_file(switch_core_session_t *session, char *file, char *timer_name) 
+int fs_ivr_play_file(switch_core_session_t *session,
+					 char *file,
+					 char *timer_name,
+					 switch_dtmf_callback_function_t dtmf_callback,
+					 void *buf,
+					 unsigned int buflen)
 {
 	switch_status_t status;
 	if (switch_strlen_zero(timer_name)) {

Modified: freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig_wrap.c
==============================================================================
--- freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig_wrap.c	(original)
+++ freeswitch/branches/james/src/mod/languages/mod_perl/switch_swig_wrap.c	Sun Jun 18 11:09:41 2006
@@ -991,9 +991,10 @@
 
 /* -------- TYPES TABLE (BEGIN) -------- */
 
-#define SWIGTYPE_p_switch_core_session swig_types[0]
-static swig_type_info *swig_types[2];
-static swig_module_info swig_module = {swig_types, 1, 0, 0, 0, 0};
+#define SWIGTYPE_p_switch_core_session_t swig_types[0]
+#define SWIGTYPE_p_switch_dtmf_callback_function_t swig_types[1]
+static swig_type_info *swig_types[3];
+static swig_module_info swig_module = {swig_types, 2, 0, 0, 0, 0};
 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
 
@@ -1017,6 +1018,9 @@
 SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
 #endif
 
+
+#include <switch.h>
+
 #ifdef PERL_OBJECT
 #define MAGIC_CLASS _wrap_fs_perl_var::
 class _wrap_fs_perl_var : public CPerlObj {
@@ -1044,6 +1048,9 @@
         int argvi = 0;
         dXSARGS;
         
+        if ((items < 0) || (items > 0)) {
+            SWIG_croak("Usage: fs_core_set_globals();");
+        }
         fs_core_set_globals();
         
         
@@ -1085,6 +1092,9 @@
         int argvi = 0;
         dXSARGS;
         
+        if ((items < 0) || (items > 0)) {
+            SWIG_croak("Usage: fs_core_destroy();");
+        }
         result = (int)fs_core_destroy();
         
         ST(argvi) = sv_newmortal();
@@ -1103,6 +1113,9 @@
         int argvi = 0;
         dXSARGS;
         
+        if ((items < 0) || (items > 0)) {
+            SWIG_croak("Usage: fs_loadable_module_init();");
+        }
         result = (int)fs_loadable_module_init();
         
         ST(argvi) = sv_newmortal();
@@ -1121,6 +1134,9 @@
         int argvi = 0;
         dXSARGS;
         
+        if ((items < 0) || (items > 0)) {
+            SWIG_croak("Usage: fs_loadable_module_shutdown();");
+        }
         result = (int)fs_loadable_module_shutdown();
         
         ST(argvi) = sv_newmortal();
@@ -1139,7 +1155,9 @@
         int argvi = 0;
         dXSARGS;
         
-
+        if ((items < 0) || (items > 0)) {
+            SWIG_croak("Usage: fs_console_loop();");
+        }
         result = (int)fs_console_loop();
         
         ST(argvi) = sv_newmortal();
@@ -1199,7 +1217,7 @@
 XS(_wrap_fs_core_session_locate) {
     {
         char *arg1 = (char *) 0 ;
-        struct switch_core_session *result;
+        switch_core_session_t *result;
         int argvi = 0;
         dXSARGS;
         
@@ -1208,10 +1226,10 @@
         }
         if (!SvOK((SV*) ST(0))) arg1 = 0;
         else arg1 = (char *) SvPV(ST(0), PL_na);
-        result = (struct switch_core_session *)fs_core_session_locate(arg1);
+        result = (switch_core_session_t *)fs_core_session_locate(arg1);
         
         ST(argvi) = sv_newmortal();
-        SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_switch_core_session, 0|0);
+        SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_switch_core_session_t, 0|0);
         XSRETURN(argvi);
         fail:
         ;
@@ -1222,7 +1240,7 @@
 
 XS(_wrap_fs_channel_answer) {
     {
-        struct switch_core_session *arg1 = (struct switch_core_session *) 0 ;
+        switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
         int argvi = 0;
         dXSARGS;
         
@@ -1230,8 +1248,8 @@
             SWIG_croak("Usage: fs_channel_answer(session);");
         }
         {
-            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session,0) < 0) {
-                SWIG_croak("Type error in argument 1 of fs_channel_answer. Expected _p_switch_core_session");
+            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t,0) < 0) {
+                SWIG_croak("Type error in argument 1 of fs_channel_answer. Expected _p_switch_core_session_t");
             }
         }
         fs_channel_answer(arg1);
@@ -1247,7 +1265,7 @@
 
 XS(_wrap_fs_channel_pre_answer) {
     {
-        struct switch_core_session *arg1 = (struct switch_core_session *) 0 ;
+        switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
         int argvi = 0;
         dXSARGS;
         
@@ -1255,8 +1273,8 @@
             SWIG_croak("Usage: fs_channel_pre_answer(session);");
         }
         {
-            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session,0) < 0) {
-                SWIG_croak("Type error in argument 1 of fs_channel_pre_answer. Expected _p_switch_core_session");
+            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t,0) < 0) {
+                SWIG_croak("Type error in argument 1 of fs_channel_pre_answer. Expected _p_switch_core_session_t");
             }
         }
         fs_channel_pre_answer(arg1);
@@ -1272,19 +1290,22 @@
 
 XS(_wrap_fs_channel_hangup) {
     {
-        struct switch_core_session *arg1 = (struct switch_core_session *) 0 ;
+        switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+        char *arg2 = (char *) 0 ;
         int argvi = 0;
         dXSARGS;
         
-        if ((items < 1) || (items > 1)) {
-            SWIG_croak("Usage: fs_channel_hangup(session);");
+        if ((items < 2) || (items > 2)) {
+            SWIG_croak("Usage: fs_channel_hangup(session,cause);");
         }
         {
-            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session,0) < 0) {
-                SWIG_croak("Type error in argument 1 of fs_channel_hangup. Expected _p_switch_core_session");
+            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t,0) < 0) {
+                SWIG_croak("Type error in argument 1 of fs_channel_hangup. Expected _p_switch_core_session_t");
             }
         }
-        fs_channel_hangup(arg1);
+        if (!SvOK((SV*) ST(1))) arg2 = 0;
+        else arg2 = (char *) SvPV(ST(1), PL_na);
+        fs_channel_hangup(arg1,arg2);
         
         
         XSRETURN(argvi);
@@ -1297,7 +1318,7 @@
 
 XS(_wrap_fs_channel_set_variable) {
     {
-        struct switch_core_session *arg1 = (struct switch_core_session *) 0 ;
+        switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
         char *arg2 = (char *) 0 ;
         char *arg3 = (char *) 0 ;
         int argvi = 0;
@@ -1307,8 +1328,8 @@
             SWIG_croak("Usage: fs_channel_set_variable(session,var,val);");
         }
         {
-            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session,0) < 0) {
-                SWIG_croak("Type error in argument 1 of fs_channel_set_variable. Expected _p_switch_core_session");
+            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t,0) < 0) {
+                SWIG_croak("Type error in argument 1 of fs_channel_set_variable. Expected _p_switch_core_session_t");
             }
         }
         if (!SvOK((SV*) ST(1))) arg2 = 0;
@@ -1328,7 +1349,7 @@
 
 XS(_wrap_fs_channel_get_variable) {
     {
-        struct switch_core_session *arg1 = (struct switch_core_session *) 0 ;
+        switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
         char *arg2 = (char *) 0 ;
         int argvi = 0;
         dXSARGS;
@@ -1337,8 +1358,8 @@
             SWIG_croak("Usage: fs_channel_get_variable(session,var);");
         }
         {
-            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session,0) < 0) {
-                SWIG_croak("Type error in argument 1 of fs_channel_get_variable. Expected _p_switch_core_session");
+            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t,0) < 0) {
+                SWIG_croak("Type error in argument 1 of fs_channel_get_variable. Expected _p_switch_core_session_t");
             }
         }
         if (!SvOK((SV*) ST(1))) arg2 = 0;
@@ -1356,7 +1377,7 @@
 
 XS(_wrap_fs_channel_set_state) {
     {
-        struct switch_core_session *arg1 = (struct switch_core_session *) 0 ;
+        switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
         char *arg2 = (char *) 0 ;
         int argvi = 0;
         dXSARGS;
@@ -1365,8 +1386,8 @@
             SWIG_croak("Usage: fs_channel_set_state(session,state);");
         }
         {
-            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session,0) < 0) {
-                SWIG_croak("Type error in argument 1 of fs_channel_set_state. Expected _p_switch_core_session");
+            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t,0) < 0) {
+                SWIG_croak("Type error in argument 1 of fs_channel_set_state. Expected _p_switch_core_session_t");
             }
         }
         if (!SvOK((SV*) ST(1))) arg2 = 0;
@@ -1384,26 +1405,42 @@
 
 XS(_wrap_fs_ivr_play_file) {
     {
-        struct switch_core_session *arg1 = (struct switch_core_session *) 0 ;
+        switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
         char *arg2 = (char *) 0 ;
         char *arg3 = (char *) 0 ;
+        switch_dtmf_callback_function_t arg4 ;
+        void *arg5 = (void *) 0 ;
+        unsigned int arg6 ;
         int result;
         int argvi = 0;
         dXSARGS;
         
-        if ((items < 3) || (items > 3)) {
-            SWIG_croak("Usage: fs_ivr_play_file(session,file,timer_name_in);");
+        if ((items < 6) || (items > 6)) {
+            SWIG_croak("Usage: fs_ivr_play_file(session,file,timer_name,dtmf_callback,buf,buflen);");
         }
         {
-            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session,0) < 0) {
-                SWIG_croak("Type error in argument 1 of fs_ivr_play_file. Expected _p_switch_core_session");
+            if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t,0) < 0) {
+                SWIG_croak("Type error in argument 1 of fs_ivr_play_file. Expected _p_switch_core_session_t");
             }
         }
         if (!SvOK((SV*) ST(1))) arg2 = 0;
         else arg2 = (char *) SvPV(ST(1), PL_na);
         if (!SvOK((SV*) ST(2))) arg3 = 0;
         else arg3 = (char *) SvPV(ST(2), PL_na);
-        result = (int)fs_ivr_play_file(arg1,arg2,arg3);
+        {
+            switch_dtmf_callback_function_t * argp;
+            if (SWIG_ConvertPtr(ST(3),(void **) &argp, SWIGTYPE_p_switch_dtmf_callback_function_t,0) < 0) {
+                SWIG_croak("Type error in argument 4 of fs_ivr_play_file. Expected _p_switch_dtmf_callback_function_t");
+            }
+            arg4 = *argp;
+        }
+        {
+            if (SWIG_ConvertPtr(ST(4), (void **) &arg5, 0,0) < 0) {
+                SWIG_croak("Type error in argument 5 of fs_ivr_play_file. Expected _p_void");
+            }
+        }
+        arg6 = (unsigned int) SvUV(ST(5));
+        result = (int)fs_ivr_play_file(arg1,arg2,arg3,arg4,arg5,arg6);
         
         ST(argvi) = sv_newmortal();
         sv_setiv(ST(argvi++), (IV) result);
@@ -1418,16 +1455,20 @@
 
 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
 
-static swig_type_info _swigt__p_switch_core_session = {"_p_switch_core_session", "struct switch_core_session *", 0, 0, 0};
+static swig_type_info _swigt__p_switch_core_session_t = {"_p_switch_core_session_t", "switch_core_session_t *", 0, 0, 0};
+static swig_type_info _swigt__p_switch_dtmf_callback_function_t = {"_p_switch_dtmf_callback_function_t", "switch_dtmf_callback_function_t *", 0, 0, 0};
 
 static swig_type_info *swig_type_initial[] = {
-  &_swigt__p_switch_core_session,
+  &_swigt__p_switch_core_session_t,
+  &_swigt__p_switch_dtmf_callback_function_t,
 };
 
-static swig_cast_info _swigc__p_switch_core_session[] = {  {&_swigt__p_switch_core_session, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_switch_core_session_t[] = {  {&_swigt__p_switch_core_session_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_switch_dtmf_callback_function_t[] = {  {&_swigt__p_switch_dtmf_callback_function_t, 0, 0, 0},{0, 0, 0, 0}};
 
 static swig_cast_info *swig_cast_initial[] = {
-  _swigc__p_switch_core_session,
+  _swigc__p_switch_core_session_t,
+  _swigc__p_switch_dtmf_callback_function_t,
 };
 
 

Modified: freeswitch/branches/james/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/branches/james/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	(original)
+++ freeswitch/branches/james/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	Sun Jun 18 11:09:41 2006
@@ -559,9 +559,7 @@
 	char *buf;
 	int digits;
 	int32 timeout = 5000;
-	int32 poll_chan = 1;
 	
-	
 	if (argc > 0) {
 		char term;
 		digits = atoi(JS_GetStringBytes(JS_ValueToString(cx, argv[0])));
@@ -571,11 +569,9 @@
 		if (argc > 2) {
 			JS_ValueToInt32(cx, argv[2], &timeout);
 		}
-		if (argc > 3) {
-			JS_ValueToInt32(cx, argv[3], &poll_chan);
-		}
+
 		buf = switch_core_session_alloc(jss->session, digits);
-		switch_ivr_collect_digits_count(jss->session, buf, digits, digits, terminators, &term, timeout, poll_chan ? SWITCH_TRUE : SWITCH_FALSE);
+		switch_ivr_collect_digits_count(jss->session, buf, digits, digits, terminators, &term, timeout);
 		*rval = STRING_TO_JSVAL ( JS_NewStringCopyZ(cx, buf) );
 		return JS_TRUE;
 	}
@@ -988,7 +984,7 @@
 		char *ani2 = "";
 		char *rdnis = "";
 		char *context = "";
-
+		char *username = NULL;
 		*rval = BOOLEAN_TO_JSVAL( JS_FALSE );
 
 		if (JS_ValueToObject(cx, argv[0], &session_obj)) {
@@ -1025,6 +1021,9 @@
 		if (argc > 10) {
 			rdnis = JS_GetStringBytes(JS_ValueToString(cx, argv[10]));
 		}
+		if (argc > 11) {
+			username = JS_GetStringBytes(JS_ValueToString(cx, argv[11]));
+		}
 		
 		
 		if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
@@ -1032,7 +1031,7 @@
 			return JS_FALSE;
 		}
 
-		caller_profile = switch_caller_profile_new(pool, dialplan, cid_name, cid_num, network_addr, ani, ani2, rdnis, (char *)modname, context, dest);
+		caller_profile = switch_caller_profile_new(pool, username, dialplan, cid_name, cid_num, network_addr, ani, ani2, rdnis, (char *)modname, context, dest);
 		if (switch_core_session_outgoing_channel(session, channel_type, caller_profile, &peer_session, pool) == SWITCH_STATUS_SUCCESS) {
 			jss = switch_core_session_alloc(peer_session, sizeof(*jss));
 			jss->session = peer_session;
@@ -2000,7 +1999,7 @@
 		if (code[0] == '/') {
 			script = JS_CompileFile(cx, obj, code);
 		} else {
-			snprintf(path, sizeof(path), "%s/%s", SWITCH_GLOBAL_dirs.script_dir, code);
+			snprintf(path, sizeof(path), "%s%s%s", SWITCH_GLOBAL_dirs.script_dir, SWITCH_PATH_SEPARATOR, code);
 			script = JS_CompileFile(cx, obj, path);
 		}
 	}

Modified: freeswitch/branches/james/src/mod/loggers/mod_console/mod_console.c
==============================================================================
--- freeswitch/branches/james/src/mod/loggers/mod_console/mod_console.c	(original)
+++ freeswitch/branches/james/src/mod/loggers/mod_console/mod_console.c	Sun Jun 18 11:09:41 2006
@@ -93,8 +93,8 @@
 	
 	if ((settings = switch_xml_child(cfg, "mappings"))) {
 		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 
 			add_mapping(var, val);
 		}

Modified: freeswitch/branches/james/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
==============================================================================
--- freeswitch/branches/james/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	(original)
+++ freeswitch/branches/james/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	Sun Jun 18 11:09:41 2006
@@ -50,10 +50,16 @@
 	uint8_t running;
 	char *url;
 	char *bindings;
+	char *realm;
+	char *user;
+	char *pass;
 } globals;
 
 SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_url, globals.url);
 SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_bindings, globals.bindings);
+SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_realm, globals.realm);
+SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_user, globals.user);
+SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_pass, globals.pass);
 
 struct config_data {
 	char *name;
@@ -138,7 +144,9 @@
 {
 	char *cf = "xml_rpc.conf";
 	switch_xml_t cfg, xml, settings, param;
-	
+	char *realm, *user, *pass;
+
+	realm = user = pass = NULL;
 	if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
 		return SWITCH_STATUS_TERM;
@@ -146,14 +154,20 @@
 
 	if ((settings = switch_xml_child(cfg, "settings"))) {
 		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
-			char *var = (char *) switch_xml_attr(param, "name");
-			char *val = (char *) switch_xml_attr(param, "value");
+			char *var = (char *) switch_xml_attr_soft(param, "name");
+			char *val = (char *) switch_xml_attr_soft(param, "value");
 
-			if (!strcasecmp(var, "gateway_url")) {
-				char *bindings = (char *) switch_xml_attr(param, "bindings");
+			if (!strcasecmp(var, "auth-realm")) {
+				realm = val;
+			} else if (!strcasecmp(var, "auth-user")) {
+				user = val;
+			} else if (!strcasecmp(var, "auth-pass")) {
+				pass = val;
+			} else if (!strcasecmp(var, "gateway-url")) {
+				char *bindings = (char *) switch_xml_attr_soft(param, "bindings");
 				set_global_bindings(bindings);
 				set_global_url(val);
-			} else if (!strcasecmp(var, "http_port")) {
+			} else if (!strcasecmp(var, "http-port")) {
 				globals.port = (uint16_t)atoi(val);
 			}
 		}
@@ -162,7 +176,11 @@
 	if (!globals.port) {
 		globals.port = 8080;
 	}
-
+	if (user && pass && realm) {
+		set_global_realm(realm);
+		set_global_user(user);
+		set_global_pass(pass);
+	}
 	switch_xml_free(xml);
 
 	return globals.url ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
@@ -214,12 +232,24 @@
 	return ret ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
 }
 
+
 abyss_bool HandleHook(TSession *r)
 {
     char *m = "text/html";
 	switch_stream_handle_t stream = {0};
 	char *command;
 
+	stream.data = r;
+	stream.write_function = http_stream_write;
+
+	if (globals.realm) {
+		if (!RequestAuth(r,globals.realm, globals.user, globals.pass)) {
+			return TRUE;
+		}
+	}
+
+
+
 	if(strncmp(r->uri, "/api/", 5)) {
 		return FALSE;
 	}
@@ -242,8 +272,6 @@
 	ResponseStatus(r,200);
 	ResponseContentType(r, m);
     ResponseWrite(r);
-	stream.data = r;
-	stream.write_function = http_stream_write;
 	switch_api_execute(command, r->query, &stream);
 	HTTPWriteEnd(r);
     return TRUE;
@@ -295,7 +323,7 @@
     MIMETypeInit();
 	MIMETypeAdd("text/html", "html");
 
-	snprintf(logfile, sizeof(logfile), "%s/%s", SWITCH_GLOBAL_dirs.log_dir, "freeswitch_http.log");
+	snprintf(logfile, sizeof(logfile), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, "freeswitch_http.log");
     ServerCreate(&abyssServer, "XmlRpcServer", globals.port, SWITCH_GLOBAL_dirs.htdocs_dir, logfile);
     
     xmlrpc_server_abyss_set_handler(&env, &abyssServer, "/RPC2", registryP);

Modified: freeswitch/branches/james/src/switch.c
==============================================================================
--- freeswitch/branches/james/src/switch.c	(original)
+++ freeswitch/branches/james/src/switch.c	Sun Jun 18 11:09:41 2006
@@ -32,6 +32,9 @@
 
 #include <switch.h>
 #include <switch_version.h>
+#ifdef HAVE_MLOCKALL
+#include <sys/mman.h>
+#endif
 
 static int RUNNING = 0;
 
@@ -70,7 +73,7 @@
 	char *pfile = "freeswitch.pid";
 	char path[256] = "";
 	char *ppath = NULL;
-	char *err = NULL;
+	const char *err = NULL;
 	switch_event_t *event;
 	int bg = 0;
 	FILE *f;
@@ -78,9 +81,13 @@
 	SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
 #else
 	int pid;
-	nice(-20);
+	//nice(-20);
 #endif
 
+#ifdef HAVE_MLOCKALL
+	mlockall(MCL_CURRENT|MCL_FUTURE);
+#endif
+
 #ifndef WIN32
 	if (argv[1] && !strcmp(argv[1], "-stop")) {
 		pid_t pid = 0;
@@ -124,8 +131,8 @@
 	}
 
 
-	if (switch_core_init(ppath) != SWITCH_STATUS_SUCCESS) {
-		fprintf(stderr, "Cannot Initilize\n");
+	if (switch_core_init(ppath, &err) != SWITCH_STATUS_SUCCESS) {
+		fprintf(stderr, "Cannot Initilize [%s]\n", err);
 		return 255;
 	}
 
@@ -156,8 +163,6 @@
 
 	fprintf(f, "%d", getpid());
 	fclose(f);
-
-
 	
 	if (!err) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Bringing up environment.\n");

Modified: freeswitch/branches/james/src/switch_caller.c
==============================================================================
--- freeswitch/branches/james/src/switch_caller.c	(original)
+++ freeswitch/branches/james/src/switch_caller.c	Sun Jun 18 11:09:41 2006
@@ -33,16 +33,17 @@
 #include <switch_caller.h>
 
 SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memory_pool_t *pool,
-																  char *dialplan,
-																  char *caller_id_name,
-																  char *caller_id_number,
-																  char *network_addr,
-																  char *ani,
-																  char *ani2, 
-																  char *rdnis,
-																  char *source,
-																  char *context,
-																  char *destination_number)
+																	char *username,
+																	char *dialplan,
+																	char *caller_id_name,
+																	char *caller_id_number,
+																	char *network_addr,
+																	char *ani,
+																	char *ani2, 
+																	char *rdnis,
+																	char *source,
+																	char *context,
+																	char *destination_number)
 {
 
 
@@ -52,6 +53,7 @@
 		if (!context) {
 			context = "default";
 		}
+		profile->username = switch_core_strdup(pool, username);
 		profile->dialplan = switch_core_strdup(pool, dialplan);
 		profile->caller_id_name = switch_core_strdup(pool, caller_id_name);
 		profile->caller_id_number = switch_core_strdup(pool, caller_id_number);
@@ -73,6 +75,7 @@
 {
 	switch_caller_profile_t *profile = NULL;
 	if ((profile = switch_core_session_alloc(session, sizeof(switch_caller_profile_t))) != 0) {
+		profile->username = switch_core_session_strdup(session, tocopy->username);
 		profile->dialplan = switch_core_session_strdup(session, tocopy->dialplan);
 		profile->caller_id_name = switch_core_session_strdup(session, tocopy->caller_id_name);
 		profile->ani = switch_core_session_strdup(session, tocopy->ani);
@@ -95,6 +98,9 @@
 	if (!strcasecmp(name, "dialplan")) {
 		return caller_profile->dialplan;
 	}
+	if (!strcasecmp(name, "username")) {
+		return caller_profile->username;
+	}
 	if (!strcasecmp(name, "caller_id_name")) {
 		return caller_profile->caller_id_name;
 	}
@@ -136,6 +142,11 @@
 {
 	char header_name[1024];
 
+
+	if (caller_profile->username) {
+		snprintf(header_name, sizeof(header_name), "%s-Username", prefix);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->username);
+	}
 	if (caller_profile->dialplan) {
 		snprintf(header_name, sizeof(header_name), "%s-Dialplan", prefix);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->dialplan);

Modified: freeswitch/branches/james/src/switch_channel.c
==============================================================================
--- freeswitch/branches/james/src/switch_channel.c	(original)
+++ freeswitch/branches/james/src/switch_channel.c	Sun Jun 18 11:09:41 2006
@@ -141,11 +141,13 @@
 
 SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause(switch_channel_t *channel)
 {
+	assert(channel != NULL);
 	return channel->hangup_cause;
 }
 
 SWITCH_DECLARE(switch_channel_timetable_t *) switch_channel_get_timetable(switch_channel_t *channel)
 {
+	assert(channel != NULL);
 	return channel->times;
 }
 
@@ -289,9 +291,16 @@
 
 SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel_t *channel, char *varname)
 {
+	assert(channel != NULL);
 	return switch_core_hash_find(channel->variables, varname);
 }
 
+SWITCH_DECLARE(switch_hash_index_t *) switch_channel_variable_first(switch_channel_t *channel, switch_memory_pool_t *pool)
+{
+	assert(channel != NULL);
+	return switch_hash_first(pool, channel->variables);
+}
+
 SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *channel, void *private_info)
 {
 	assert(channel != NULL);
@@ -336,16 +345,19 @@
 
 SWITCH_DECLARE(int) switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag_t flags)
 {
+	assert(channel != NULL);
 	return switch_test_flag(channel, flags) ? 1 : 0;
 }
 
 SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel_t *channel, switch_channel_flag_t flags)
 {
+	assert(channel != NULL);
 	switch_set_flag(channel, flags);
 }
 
 SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch_channel_flag_t flags)
 {
+	assert(channel != NULL);
 	switch_clear_flag(channel, flags);
 }
 
@@ -370,7 +382,8 @@
 	"CS_LOOPBACK",
 	"CS_HOLD",
 	"CS_HANGUP",
-	"CS_DONE"
+	"CS_DONE",
+	NULL
 };
 
 SWITCH_DECLARE(const char *) switch_channel_state_name(switch_channel_state_t state)
@@ -378,6 +391,19 @@
 	return state_names[state];
 }
 
+
+SWITCH_DECLARE(switch_channel_state_t) switch_channel_name_state(char *name)
+{
+	uint32_t x = 0;
+	for(x = 0; state_names[x]; x++) {
+		if (!strcasecmp(state_names[x], name)) {
+			return (switch_channel_state_t) x;
+		}
+	}
+
+	return CS_DONE;
+}
+
 SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_state(switch_channel_t *channel,
 																	  const char *file,
 																	  const char *func,
@@ -757,7 +783,11 @@
 														 switch_caller_extension_t *caller_extension)
 {
 	assert(channel != NULL);
+
+	switch_mutex_lock(channel->profile_mutex);
+	caller_extension->next = channel->caller_extension;
 	channel->caller_extension = caller_extension;
+	switch_mutex_unlock(channel->profile_mutex);
 }
 
 
@@ -837,6 +867,10 @@
 
 	if (channel->state >= CS_HANGUP) {
 		return SWITCH_STATUS_FALSE;
+	}
+
+	if (switch_channel_test_flag(channel, CF_ANSWERED)) {
+		return SWITCH_STATUS_SUCCESS;
 	}
 
 	if (switch_core_session_answer_channel(channel->session) == SWITCH_STATUS_SUCCESS) {

Modified: freeswitch/branches/james/src/switch_config.c
==============================================================================
--- freeswitch/branches/james/src/switch_config.c	(original)
+++ freeswitch/branches/james/src/switch_config.c	Sun Jun 18 11:09:41 2006
@@ -41,7 +41,7 @@
 	if (file_path[0] == '/') {
 		path = file_path;
 	} else {
-		snprintf(path_buf, sizeof(path_buf), "%s/%s", SWITCH_GLOBAL_dirs.conf_dir, file_path);
+		snprintf(path_buf, sizeof(path_buf), "%s%s%s", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR, file_path);
 		path = path_buf;
 	}
 
@@ -57,7 +57,7 @@
 			int last = -1;
 			char *var, *val;
 
-			snprintf(path_buf, sizeof(path_buf), "%s/freeswitch.conf", SWITCH_GLOBAL_dirs.conf_dir);
+			snprintf(path_buf, sizeof(path_buf), "%s%sfreeswitch.conf", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR);
 			path = path_buf;
 
 			if ((f = fopen(path, "r")) == 0) {

Modified: freeswitch/branches/james/src/switch_console.c
==============================================================================
--- freeswitch/branches/james/src/switch_console.c	(original)
+++ freeswitch/branches/james/src/switch_console.c	Sun Jun 18 11:09:41 2006
@@ -198,7 +198,7 @@
 		}
 
 		memset(&cmd, 0, sizeof(cmd));
-		for (x = 0; x < sizeof(cmd); x++) {
+		for (x = 0; x < (sizeof(cmd)-1); x++) {
 			cmd[x] = (char) getchar();
 			if (cmd[x] == '\n') {
 				cmd[x] = '\0';

Modified: freeswitch/branches/james/src/switch_core.c
==============================================================================
--- freeswitch/branches/james/src/switch_core.c	(original)
+++ freeswitch/branches/james/src/switch_core.c	Sun Jun 18 11:09:41 2006
@@ -117,7 +117,7 @@
 	if (strchr(dbname, '/')) {
 		strncpy(buf, dbname, size);
 	} else {
-		snprintf(buf, size, "%s/%s.db", SWITCH_DB_DIR, dbname);
+		snprintf(buf, size, "%s%s%s.db", SWITCH_DB_DIR, SWITCH_PATH_SEPARATOR, dbname);
 	}
 }
 
@@ -565,11 +565,11 @@
 }
 
 SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *sh, 
-													  char *module_name, 
-													  char *voice_name,
-													  unsigned int rate,
-													  switch_speech_flag_t *flags,
-													  switch_memory_pool_t *pool)
+														char *module_name, 
+														char *voice_name,
+														unsigned int rate,
+														switch_speech_flag_t *flags,
+														switch_memory_pool_t *pool)
 {
 	switch_status_t status;
 
@@ -578,6 +578,7 @@
 		return SWITCH_STATUS_GENERR;
 	}
 
+	switch_copy_string(sh->engine, module_name, sizeof(sh->engine));
 	sh->flags = *flags;
 	if (pool) {
 		sh->memory_pool = pool;
@@ -587,7 +588,8 @@
 		}
 		switch_set_flag(sh, SWITCH_SPEECH_FLAG_FREE_POOL);
 	}
-
+	sh->rate = rate;
+	sh->name = switch_core_strdup(pool, module_name);
 	return sh->speech_interface->speech_open(sh, voice_name, rate, flags);
 }
 
@@ -612,6 +614,42 @@
 	return sh->speech_interface->speech_feed_tts(sh, text, flags);
 }
 
+SWITCH_DECLARE(void) switch_core_speech_flush_tts(switch_speech_handle_t *sh)
+{
+	assert(sh != NULL);
+
+	if (sh->speech_interface->speech_flush_tts) {
+		sh->speech_interface->speech_flush_tts(sh);
+	}
+}
+
+SWITCH_DECLARE(void) switch_core_speech_text_param_tts(switch_speech_handle_t *sh, char *param, char *val)
+{
+	assert(sh != NULL);
+
+	if (sh->speech_interface->speech_text_param_tts) {
+		sh->speech_interface->speech_text_param_tts(sh, param, val);
+	}
+}
+
+SWITCH_DECLARE(void) switch_core_speech_numeric_param_tts(switch_speech_handle_t *sh, char *param, int val)
+{
+	assert(sh != NULL);
+
+	if (sh->speech_interface->speech_numeric_param_tts) {
+		sh->speech_interface->speech_numeric_param_tts(sh, param, val);
+	}
+}
+
+SWITCH_DECLARE(void) switch_core_speech_float_param_tts(switch_speech_handle_t *sh, char *param, double val)
+{
+	assert(sh != NULL);
+
+	if (sh->speech_interface->speech_float_param_tts) {
+		sh->speech_interface->speech_float_param_tts(sh, param, val);
+	}
+}
+
 SWITCH_DECLARE(switch_status_t) switch_core_speech_read_tts(switch_speech_handle_t *sh, 
 														  void *data,
 														  switch_size_t *datalen,
@@ -705,20 +743,20 @@
 	channel = switch_core_session_get_channel(session);
 	assert(channel != NULL);
 
+	switch_channel_set_flag(channel, CF_SERVICE);
 	while (data->running > 0) {
 		switch (switch_core_session_read_frame(session, &read_frame, -1, stream_id)) {
 		case SWITCH_STATUS_SUCCESS:
-			break;
 		case SWITCH_STATUS_TIMEOUT:
+		case SWITCH_STATUS_BREAK:
 			break;
 		default:
 			data->running = -1;
 			continue;
 		}
-
-		switch_yield(10000);
 	}
 
+	switch_channel_clear_flag(channel, CF_SERVICE);
 	data->running = 0;
 	return NULL;
 }
@@ -1203,6 +1241,17 @@
 	return status;
 }
 
+SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session)
+{
+	/* sweep theese under the rug, they wont be leaked they will be reclaimed
+	   when the session ends.
+	 */
+	session->raw_write_buffer = NULL;
+	session->raw_read_buffer = NULL;
+	session->read_resampler = NULL;
+	session->write_resampler = NULL;
+}
+
 SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_session_t *session, switch_frame_t *frame,
 															  int timeout, int stream_id)
 {
@@ -1284,15 +1333,21 @@
 		if (session->write_resampler) {
 			short *data = write_frame->data;
 
-			session->write_resampler->from_len =
-				switch_short_to_float(data, session->write_resampler->from, (int) write_frame->datalen / 2);
+			session->write_resampler->from_len = write_frame->datalen / 2;
+			switch_short_to_float(data, session->write_resampler->from, session->write_resampler->from_len);
+
+
+
 			session->write_resampler->to_len = (uint32_t)
 				switch_resample_process(session->write_resampler, session->write_resampler->from,
 										session->write_resampler->from_len, session->write_resampler->to,
 										session->write_resampler->to_size, 0);
-			switch_float_to_short(session->write_resampler->to, data, write_frame->datalen * 2);
+			
+
+			switch_float_to_short(session->write_resampler->to, data, session->write_resampler->to_len);
+
 			write_frame->samples = session->write_resampler->to_len;
-			write_frame->datalen = session->write_resampler->to_len * 2;
+			write_frame->datalen = write_frame->samples * 2;
 			write_frame->rate = session->write_resampler->to_rate;
 		}
 
@@ -1308,20 +1363,20 @@
 										  bytes,
 										  write_frame->datalen, session->write_codec->implementation->bytes_per_frame);
 					if ((status =
-						 switch_buffer_create(session->pool, &session->raw_write_buffer,
-											  bytes)) != SWITCH_STATUS_SUCCESS) {
+						 switch_buffer_create(session->pool, &session->raw_write_buffer, bytes)) != SWITCH_STATUS_SUCCESS) {
 						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Write Buffer Failed!\n");
 						return status;
 					}
 				}
+
 				if (!(switch_buffer_write(session->raw_write_buffer, write_frame->data, write_frame->datalen))) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Write Buffer %u bytes Failed!\n", write_frame->datalen);
 					return SWITCH_STATUS_MEMERR;
 				}
 			}
 
+			
 			if (perfect) {
-
 				enc_frame = write_frame;
 				session->enc_write_frame.datalen = session->enc_write_frame.buflen;
 
@@ -1333,7 +1388,7 @@
 												  session->enc_write_frame.data,
 												  &session->enc_write_frame.datalen,
 												  &session->enc_write_frame.rate, &flag);
-
+				
 				switch (status) {
 				case SWITCH_STATUS_RESAMPLE:
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "fixme 2\n");
@@ -1357,14 +1412,15 @@
 				switch_size_t used = switch_buffer_inuse(session->raw_write_buffer);
 				uint32_t bytes = session->write_codec->implementation->bytes_per_frame;
 				switch_size_t frames = (used / bytes);
-
+				
 				status = SWITCH_STATUS_SUCCESS;
-				if (frames) {
+				if (!frames) {
+					return status;
+				} else {
 					switch_size_t x;
 					for (x = 0; x < frames; x++) {
 						if ((session->raw_write_frame.datalen = (uint32_t)
 							 switch_buffer_read(session->raw_write_buffer, session->raw_write_frame.data, bytes)) != 0) {
-
 							enc_frame = &session->raw_write_frame;
 							session->raw_write_frame.rate = session->write_codec->implementation->samples_per_second;
 							session->enc_write_frame.datalen = session->enc_write_frame.buflen;
@@ -1449,7 +1505,7 @@
 	switch_io_event_hook_kill_channel_t *ptr;
 	switch_status_t status = SWITCH_STATUS_FALSE;
 	
-	switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char *) file, func, line, SWITCH_LOG_NOTICE, "Kill %s [%d]\n", switch_channel_get_name(session->channel), sig);
+	switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char *) file, func, line, SWITCH_LOG_INFO, "Kill %s [%d]\n", switch_channel_get_name(session->channel), sig);
 
 	if (session->endpoint_interface->io_routines->kill_channel) {
 		if ((status = session->endpoint_interface->io_routines->kill_channel(session, sig)) == SWITCH_STATUS_SUCCESS) {
@@ -1717,7 +1773,7 @@
 
 	assert(runtime.memory_pool != NULL);
 
-	if ((apr_pool_create(pool, runtime.memory_pool)) != SWITCH_STATUS_SUCCESS) {
+	if ((apr_pool_create(pool, NULL)) != SWITCH_STATUS_SUCCESS) {
 		*pool = NULL;
 		return SWITCH_STATUS_MEMERR;
 	}
@@ -2740,9 +2796,8 @@
 #endif
 }
 
-SWITCH_DECLARE(switch_status_t) switch_core_init(char *console)
+SWITCH_DECLARE(switch_status_t) switch_core_init(char *console, const char **err)
 {
-
 	memset(&runtime, 0, sizeof(runtime));
 	
 	switch_core_set_globals();
@@ -2750,29 +2805,34 @@
 	/* INIT APR and Create the pool context */
 	if (apr_initialize() != SWITCH_STATUS_SUCCESS) {
 		apr_terminate();
-		fprintf(stderr, "FATAL ERROR! Could not initilize APR\n");
+		*err = "FATAL ERROR! Could not initilize APR\n";
 		return SWITCH_STATUS_MEMERR;
 	}
 
 	if (apr_pool_create(&runtime.memory_pool, NULL) != SWITCH_STATUS_SUCCESS) {
-		fprintf(stderr, "FATAL ERROR! Could not allocate memory pool\n");
-		switch_core_destroy();
+		apr_terminate();
+		*err = "FATAL ERROR! Could not allocate memory pool\n";
 		return SWITCH_STATUS_MEMERR;
 	}
 
-	if (switch_xml_init(runtime.memory_pool) != SWITCH_STATUS_SUCCESS) {
-		fprintf(stderr, "FATAL ERROR! Could not open XML Registry\n");
-		switch_core_destroy();
+	if (switch_xml_init(runtime.memory_pool, err) != SWITCH_STATUS_SUCCESS) {
+		apr_terminate();
 		return SWITCH_STATUS_MEMERR;
 	}
 
+	*err = NULL;
+
 	if(console) {
 		if (*console != '/') {
 			char path[265];
 			snprintf(path, sizeof(path), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, console);
 			console = path;
 		}
-		switch_core_set_console(console);
+		if (switch_core_set_console(console) != SWITCH_STATUS_SUCCESS) {
+			*err = "FATAL ERROR! Could not open console\n";
+			apr_terminate();
+			return SWITCH_STATUS_GENERR;
+		}
 	} else {
 		runtime.console = stdout;
 	}

Modified: freeswitch/branches/james/src/switch_event.c
==============================================================================
--- freeswitch/branches/james/src/switch_event.c	(original)
+++ freeswitch/branches/james/src/switch_event.c	Sun Jun 18 11:09:41 2006
@@ -40,7 +40,7 @@
 //static switch_memory_pool_t *BPOOL = NULL;
 static switch_memory_pool_t *THRUNTIME_POOL = NULL;
 static switch_queue_t *EVENT_QUEUE[3] = {0,0,0};
-static int POOL_COUNT_MAX = 2000;
+static int POOL_COUNT_MAX = SWITCH_CORE_QUEUE_LEN;
 
 static switch_hash_t *CUSTOM_HASH = NULL;
 static int THREAD_RUNNING = 0;

Modified: freeswitch/branches/james/src/switch_ivr.c
==============================================================================
--- freeswitch/branches/james/src/switch_ivr.c	(original)
+++ freeswitch/branches/james/src/switch_ivr.c	Sun Jun 18 11:09:41 2006
@@ -63,7 +63,11 @@
 			break;
 		}
 
-		status = switch_core_session_read_frame(session, &read_frame, -1, 0);
+		if (switch_channel_test_flag(channel, CF_SERVICE)) {
+			switch_yield(1000);
+		} else {
+			status = switch_core_session_read_frame(session, &read_frame, -1, 0);
+		}
 
 		if (!SWITCH_READ_ACCEPTABLE(status)) {
 			break;
@@ -75,14 +79,12 @@
 
 
 SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_session_t *session,
-															  char *buf,
-															  unsigned int buflen,
-															  unsigned int maxdigits,
-															  const char *terminators,
-															  char *terminator,
-															  unsigned int timeout,
-															  unsigned int poll_channel
-															  )
+																char *buf,
+																unsigned int buflen,
+																unsigned int maxdigits,
+																const char *terminators,
+																char *terminator,
+																unsigned int timeout)
 {
 	unsigned int i = 0, x =  (unsigned int) strlen(buf);
 	switch_channel_t *channel;
@@ -135,14 +137,14 @@
 				}
 			}
 		}
-		if (poll_channel) {
+
+		if (switch_channel_test_flag(channel, CF_SERVICE)) {
+			switch_yield(1000);
+		} else {
 			status = switch_core_session_read_frame(session, &read_frame, -1, 0);
-			
 			if (!SWITCH_READ_ACCEPTABLE(status)) {
 				break;
 			}
-		} else {
-			switch_yield(1000);
 		}
 	}
 
@@ -186,6 +188,7 @@
 							  SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT,
 							  switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+		switch_core_session_reset(session);
 		return SWITCH_STATUS_GENERR;
 	}
 
@@ -206,6 +209,7 @@
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Raw Codec Activation Failed %s@%uhz %u channels %dms\n",
 							  codec_name, fh->samplerate, fh->channels, read_codec->implementation->microseconds_per_frame / 1000);
 		switch_core_file_close(fh);
+		switch_core_session_reset(session);
 		return SWITCH_STATUS_GENERR;
 	}
 	
@@ -245,7 +249,7 @@
 
 	switch_core_session_set_read_codec(session, read_codec);
 	switch_core_file_close(fh);
-
+	switch_core_session_reset(session);
 	return status;
 }
 
@@ -261,7 +265,7 @@
 	short abuf[960];
 	char dtmf[128];
 	uint32_t interval = 0, samples = 0;
-	uint32_t len = 0, ilen = 0;
+	uint32_t ilen = 0;
 	switch_size_t olen = 0;
 	switch_frame_t write_frame = {0};
 	switch_timer_t timer;
@@ -286,8 +290,8 @@
 							  file,
 							  SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
 							  switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
-		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
-		return SWITCH_STATUS_GENERR;
+		switch_core_session_reset(session);
+		return SWITCH_STATUS_NOTFOUND;
 	}
 
 
@@ -298,8 +302,8 @@
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "OPEN FILE %s %uhz %u channels\n", file, fh->samplerate, fh->channels);
 
 	interval = read_codec->implementation->microseconds_per_frame / 1000;
-	samples = read_codec->implementation->bytes_per_frame / 2;
-	len = samples * 2;
+
+
 	codec_name = "L16";
 
 	if (switch_core_codec_init(&codec,
@@ -315,14 +319,21 @@
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Failed %s@%uhz %u channels %dms\n",
 							  codec_name, fh->samplerate, fh->channels, interval);
 		switch_core_file_close(fh);
+		switch_core_session_reset(session);
 		return SWITCH_STATUS_GENERR;
 	}
 
+	samples = codec.implementation->bytes_per_frame / 2;
+
 	if (timer_name) {
+		uint32_t len;
+
+		len = samples * 2;
 		if (switch_core_timer_init(&timer, timer_name, interval, samples, pool) != SWITCH_STATUS_SUCCESS) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "setup timer failed!\n");
 			switch_core_codec_destroy(&codec);
 			switch_core_file_close(fh);
+			switch_core_session_reset(session);
 			return SWITCH_STATUS_GENERR;
 		}
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "setup timer success %u bytes per %d ms!\n", len, interval);
@@ -437,8 +448,12 @@
 #endif
 		
 		for (stream_id = 0; stream_id < switch_core_session_get_stream_count(session); stream_id++) {
+			status = switch_core_session_write_frame(session, &write_frame, -1, stream_id);
 
-			if (switch_core_session_write_frame(session, &write_frame, -1, stream_id) != SWITCH_STATUS_SUCCESS) {
+			if (status == SWITCH_STATUS_MORE_DATA) {
+				status = SWITCH_STATUS_SUCCESS;
+				continue;
+			} else if (status != SWITCH_STATUS_SUCCESS) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Bad Write\n");
 				done = 1;
 				break;
@@ -447,6 +462,7 @@
 				break;
 			}
 		}
+		
 		if (timer_name) {
 			if (switch_core_timer_next(&timer) < 0) {
 				break;
@@ -474,110 +490,63 @@
 		switch_core_timer_destroy(&timer);
 	}
 
+	switch_core_session_reset(session);
 	return status;
 }
 
 
 
 
-SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *session, 
-													char *tts_name,
-													char *voice_name,
-													char *timer_name,
-													uint32_t rate,
-													switch_dtmf_callback_function_t dtmf_callback,
-													char *text,
-													void *buf,
-													unsigned int buflen)
+SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session_t *session, 
+															 switch_speech_handle_t *sh,
+															 switch_codec_t *codec,
+															 switch_timer_t *timer,
+															 switch_dtmf_callback_function_t dtmf_callback,
+															 char *text,
+															 void *buf,
+															 unsigned int buflen)
 {
 	switch_channel_t *channel;
 	short abuf[960];
 	char dtmf[128];
-	int interval = 0;
-	uint32_t samples = 0;
 	uint32_t len = 0;
 	switch_size_t ilen = 0;
 	switch_frame_t write_frame = {0};
-	switch_timer_t timer;
-	switch_core_thread_session_t thread_session;
-	switch_codec_t codec;
-	switch_memory_pool_t *pool = switch_core_session_get_pool(session);
-	char *codec_name;
 	int x;
 	int stream_id;
 	int done = 0;
 	int lead_in_out = 10;
-
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
-	switch_speech_handle_t sh;
 	switch_speech_flag_t flags = SWITCH_SPEECH_FLAG_TTS;
+	uint32_t rate = 0, samples = 0;
 
-
-	memset(&sh, 0, sizeof(sh));
-
 	channel = switch_core_session_get_channel(session);
 	assert(channel != NULL);
 
-	if (switch_core_speech_open(&sh,
-								tts_name,
-								voice_name,
-								(unsigned int)rate,
-								&flags,
-								switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid TTS module!\n");
+	if (!sh) {
 		return SWITCH_STATUS_FALSE;
 	}
-
+	
 	switch_channel_answer(channel);
 
 	write_frame.data = abuf;
 	write_frame.buflen = sizeof(abuf);
 
+    samples = (uint32_t)(sh->rate / 50);
+    len = samples * 2;
 
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "OPEN TTS %s\n", tts_name);
-	
-	interval = 20;
-	samples = (uint32_t)(rate / 50);
-	len = samples * 2;
-
-	codec_name = "L16";
-
-	if (switch_core_codec_init(&codec,
-							   codec_name,
-							   (int)rate,
-							   interval,
-							   1,
-							   SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
-							   NULL, pool) == SWITCH_STATUS_SUCCESS) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activated\n");
-		write_frame.codec = &codec;
-	} else {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Failed %s@%uhz 1 channel %dms\n",
-							  codec_name, rate, interval);
-		flags = 0;
-		switch_core_speech_close(&sh, &flags);
-		return SWITCH_STATUS_GENERR;
-	}
-
-	if (timer_name) {
-		if (switch_core_timer_init(&timer, timer_name, interval, (int)samples, pool) != SWITCH_STATUS_SUCCESS) {
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "setup timer failed!\n");
-			switch_core_codec_destroy(&codec);
-			flags = 0;
-			switch_core_speech_close(&sh, &flags);
-			return SWITCH_STATUS_GENERR;
-		}
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "setup timer success %u bytes per %d ms!\n", len, interval);
-	}
-
 	flags = 0;
-	switch_core_speech_feed_tts(&sh, text, &flags);
-	write_frame.rate = rate;
+	switch_sleep(200000);
+	switch_core_speech_feed_tts(sh, text, &flags);
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Speaking text: %s\n", text);
 
+	write_frame.rate = sh->rate;
+
 	memset(write_frame.data, 0, len);
 	write_frame.datalen = len;
 	write_frame.samples = len / 2;
-	
+	write_frame.codec = codec;
+
 	for( x = 0; !done && x < lead_in_out; x++) {
 		for (stream_id = 0; stream_id < switch_core_session_get_stream_count(session); stream_id++) {
 			if (switch_core_session_write_frame(session, &write_frame, -1, stream_id) != SWITCH_STATUS_SUCCESS) {
@@ -588,29 +557,25 @@
 		}
 	}
 
-	if (timer_name) {
-		/* start a thread to absorb incoming audio */
-		for (stream_id = 0; stream_id < switch_core_session_get_stream_count(session); stream_id++) {
-			switch_core_service_session(session, &thread_session, stream_id);
-		}
-	}
-
 	ilen = len;
 	while(switch_channel_ready(channel)) {
-		if (dtmf_callback || buf) {
 
-
+		if (dtmf_callback || buf) {
 			/*
 			  dtmf handler function you can hook up to be executed when a digit is dialed during playback 
 			  if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
 			*/
 			if (switch_channel_has_dtmf(channel)) {
-				switch_channel_dequeue_dtmf(channel, dtmf, sizeof(dtmf));
-				if (dtmf_callback) {
-					status = dtmf_callback(session, dtmf, buf, buflen);
-				} else {
-					switch_copy_string((char *)buf, dtmf, buflen);
+				if (buf && !strcasecmp(buf, "_break_")) {
 					status = SWITCH_STATUS_BREAK;
+				} else {
+					switch_channel_dequeue_dtmf(channel, dtmf, sizeof(dtmf));
+					if (dtmf_callback) {
+						status = dtmf_callback(session, dtmf, buf, buflen);
+					} else {
+						switch_copy_string((char *)buf, dtmf, buflen);
+						status = SWITCH_STATUS_BREAK;
+					}
 				}
 			}
 			
@@ -619,9 +584,29 @@
 				break;
 			}
 		}
+		
+		if (switch_test_flag(sh, SWITCH_SPEECH_FLAG_PAUSE)) {
+			if (timer) {
+				if ((x = switch_core_timer_next(timer)) < 0) {
+					break;
+				}
+			} else {
+				switch_frame_t *read_frame;
+				switch_status_t status = switch_core_session_read_frame(session, &read_frame, -1, 0);
 
+				while (switch_channel_test_flag(channel, CF_HOLD)) {
+					switch_yield(10000);
+				}
+			
+				if (!SWITCH_READ_ACCEPTABLE(status)) {
+					break;
+				}
+			}
+			continue;
+		}
+
 		flags = SWITCH_SPEECH_FLAG_BLOCKING;
-		status = switch_core_speech_read_tts(&sh,
+		status = switch_core_speech_read_tts(sh,
 											 abuf,
 											 &ilen,
 											 &rate,
@@ -637,10 +622,13 @@
 					}
 				}
 			}
+			if (status == SWITCH_STATUS_BREAK) {
+				status = SWITCH_STATUS_SUCCESS;
+			}
 			done = 1;
 		}
 		
-		if (done || ilen <= 0) {
+		if (done) {
 			break;
 		}
 
@@ -658,8 +646,9 @@
 				break;
 			}
 		}
-		if (timer_name) {
-			if ((x = switch_core_timer_next(&timer)) < 0) {
+
+		if (timer) {
+			if ((x = switch_core_timer_next(timer)) < 0) {
 				break;
 			}
 		} else { /* time off the channel (if you must) */
@@ -674,10 +663,106 @@
 				break;
 			}
 		}
-	}
 
+	}
+	
+	
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "done speaking text\n");
 	flags = 0;	
+	switch_core_speech_flush_tts(sh);
+	return status;
+}
+
+
+SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *session, 
+													  char *tts_name,
+													  char *voice_name,
+													  char *timer_name,
+													  uint32_t rate,
+													  switch_dtmf_callback_function_t dtmf_callback,
+													  char *text,
+													  void *buf,
+													  unsigned int buflen)
+{
+	switch_channel_t *channel;
+	int interval = 0;
+	uint32_t samples = 0;
+	uint32_t len = 0;
+	switch_frame_t write_frame = {0};
+	switch_timer_t timer;
+	switch_core_thread_session_t thread_session;
+	switch_codec_t codec;
+	switch_memory_pool_t *pool = switch_core_session_get_pool(session);
+	char *codec_name;
+	int stream_id;
+	switch_status_t status = SWITCH_STATUS_SUCCESS;
+	switch_speech_handle_t sh;
+	switch_speech_flag_t flags = SWITCH_SPEECH_FLAG_TTS;
+
+
+	channel = switch_core_session_get_channel(session);
+	assert(channel != NULL);
+
+
+	memset(&sh, 0, sizeof(sh));
+	if (switch_core_speech_open(&sh,
+								tts_name,
+								voice_name,
+								(unsigned int)rate,
+								&flags,
+								switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid TTS module!\n");
+		switch_core_session_reset(session);
+		return SWITCH_STATUS_FALSE;
+	}
+		
+	switch_channel_answer(channel);
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "OPEN TTS %s\n", tts_name);
+	
+	interval = 20;
+	samples = (uint32_t)(rate / 50);
+	len = samples * 2;
+
+	codec_name = "L16";
+
+	if (switch_core_codec_init(&codec,
+							   codec_name,
+							   (int)rate,
+							   interval,
+							   1,
+							   SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
+							   NULL, pool) == SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activated\n");
+		write_frame.codec = &codec;
+	} else {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Failed %s@%uhz 1 channel %dms\n",
+							  codec_name, rate, interval);
+		flags = 0;
+		switch_core_speech_close(&sh, &flags);
+		switch_core_session_reset(session);
+		return SWITCH_STATUS_GENERR;
+	}
+
+	if (timer_name) {
+		if (switch_core_timer_init(&timer, timer_name, interval, (int)samples, pool) != SWITCH_STATUS_SUCCESS) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "setup timer failed!\n");
+			switch_core_codec_destroy(&codec);
+			flags = 0;
+			switch_core_speech_close(&sh, &flags);
+
+			switch_core_session_reset(session);
+			return SWITCH_STATUS_GENERR;
+		}
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "setup timer success %u bytes per %d ms!\n", len, interval);
+
+		/* start a thread to absorb incoming audio */
+		for (stream_id = 0; stream_id < switch_core_session_get_stream_count(session); stream_id++) {
+			switch_core_service_session(session, &thread_session, stream_id);
+		}
+	}
+
+	switch_ivr_speak_text_handle(session, &sh, &codec, timer_name ? &timer : NULL, dtmf_callback, text, buf, buflen);
+	flags = 0;	
 	switch_core_speech_close(&sh, &flags);
 	switch_core_codec_destroy(&codec);
 
@@ -687,6 +772,7 @@
 		switch_core_timer_destroy(&timer);
 	}
 
+	switch_core_session_reset(session);
 	return status;
 }
 

Modified: freeswitch/branches/james/src/switch_loadable_module.c
==============================================================================
--- freeswitch/branches/james/src/switch_loadable_module.c	(original)
+++ freeswitch/branches/james/src/switch_loadable_module.c	Sun Jun 18 11:09:41 2006
@@ -476,7 +476,7 @@
 
 		if ((mods = switch_xml_child(cfg, "modules"))) {
 			for (ld = switch_xml_child(mods, "load"); ld; ld = ld->next) {
-				const char *val = switch_xml_attr(ld, "module");
+				const char *val = switch_xml_attr_soft(ld, "module");
 				if (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT)) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Invalid extension for %s\n", val);
 					continue;
@@ -496,7 +496,7 @@
 
 		if ((mods = switch_xml_child(cfg, "modules"))) {
 			for (ld = switch_xml_child(mods, "load"); ld; ld = ld->next) {
-				const char *val = switch_xml_attr(ld, "module");
+				const char *val = switch_xml_attr_soft(ld, "module");
 				if (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT)) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Invalid extension for %s\n", val);
 					continue;

Modified: freeswitch/branches/james/src/switch_log.c
==============================================================================
--- freeswitch/branches/james/src/switch_log.c	(original)
+++ freeswitch/branches/james/src/switch_log.c	Sun Jun 18 11:09:41 2006
@@ -263,7 +263,7 @@
 	switch_threadattr_detach_set(thd_attr, 1);
 
 
-	switch_queue_create(&LOG_QUEUE, 2000, LOG_POOL);
+	switch_queue_create(&LOG_QUEUE, SWITCH_CORE_QUEUE_LEN, LOG_POOL);
 	switch_mutex_init(&BINDLOCK, SWITCH_MUTEX_NESTED, LOG_POOL);
 	switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
 	switch_thread_create(&thread, thd_attr, log_thread, NULL, LOG_POOL);

Modified: freeswitch/branches/james/src/switch_rtp.c
==============================================================================
--- freeswitch/branches/james/src/switch_rtp.c	(original)
+++ freeswitch/branches/james/src/switch_rtp.c	Sun Jun 18 11:09:41 2006
@@ -169,6 +169,7 @@
 	struct switch_rtp_vad_data vad_data;
 	struct switch_rtp_rfc2833_data dtmf_data;
 	uint8_t mini;
+	switch_payload_t te;
 };
 
 static int global_init = 0;
@@ -379,6 +380,7 @@
 
 	rtp_session->pool = pool;
 	rtp_session->flags = flags;
+	rtp_session->te = 101;
 	switch_mutex_init(&rtp_session->dtmf_data.dtmf_mutex, SWITCH_MUTEX_NESTED, rtp_session->pool);
 	switch_buffer_create(rtp_session->pool, &rtp_session->dtmf_data.dtmf_buffer, 128);
 	/* for from address on recvfrom calls */
@@ -473,16 +475,16 @@
 }
 
 SWITCH_DECLARE(switch_rtp_t *)switch_rtp_new(char *rx_host,
-										   switch_port_t rx_port,
-										   char *tx_host,
-										   switch_port_t tx_port,
-										   switch_payload_t payload,
-										   uint32_t packet_size,
-										   uint32_t ms_per_packet,
-										   switch_rtp_flag_t flags,
-										   char *crypto_key,
-										   const char **err,
-										   switch_memory_pool_t *pool) 
+					     switch_port_t rx_port,
+					     char *tx_host,
+					     switch_port_t tx_port,
+					     switch_payload_t payload,
+					     uint32_t packet_size,
+					     uint32_t ms_per_packet,
+					     switch_rtp_flag_t flags,
+					     char *crypto_key,
+					     const char **err,
+					     switch_memory_pool_t *pool) 
 {
 	switch_rtp_t *rtp_session;
 
@@ -506,6 +508,12 @@
 	return rtp_session;
 }
 
+SWITCH_DECLARE(void) switch_rtp_set_telephony_event(switch_rtp_t *rtp_session, switch_payload_t te)
+{
+	if (te > 96) {
+		rtp_session->te = te;
+	}
+}
 
 SWITCH_DECLARE(switch_status_t) switch_rtp_activate_ice(switch_rtp_t *rtp_session, char *login, char *rlogin)
 {
@@ -608,7 +616,7 @@
 	uint32_t samples = rtp_session->packet_size;
 
 	if (rtp_session->dtmf_data.out_digit_dur > 0) {
-		int x, ts, loops = 1, duration;
+		int x, loops = 1, duration;
 		rtp_session->dtmf_data.out_digit_sofar += samples;
 
 		if (rtp_session->dtmf_data.out_digit_sofar >= rtp_session->dtmf_data.out_digit_dur) {
@@ -620,19 +628,19 @@
 			duration = rtp_session->dtmf_data.out_digit_sofar;
 		}
 
-		ts = rtp_session->dtmf_data.timestamp_dtmf += samples;
+		//ts = rtp_session->dtmf_data.timestamp_dtmf += samples;
 		rtp_session->dtmf_data.out_digit_packet[2] = (unsigned char) (duration >> 8);
 		rtp_session->dtmf_data.out_digit_packet[3] = (unsigned char) duration;
 		
 
 		for (x = 0; x < loops; x++) {
 			switch_rtp_write_manual(rtp_session, 
-									rtp_session->dtmf_data.out_digit_packet, 4, 0, 101, ts,
-									loops == 1 ? rtp_session->dtmf_data.out_digit_seq++ : rtp_session->dtmf_data.out_digit_seq, &flags);
+									rtp_session->dtmf_data.out_digit_packet, 4, 0, rtp_session->te, rtp_session->dtmf_data.timestamp_dtmf,
+									rtp_session->dtmf_data.out_digit_seq++, &flags);
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send %s packet for [%c] ts=%d sofar=%u dur=%d\n", 
 							  loops == 1 ? "middle" : "end",
 							  rtp_session->dtmf_data.out_digit,
-							  ts, 
+							  rtp_session->dtmf_data.timestamp_dtmf, 
 							  rtp_session->dtmf_data.out_digit_sofar,
 							  duration);
 		}
@@ -642,7 +650,7 @@
 		void *pop;
 
 		if (switch_queue_trypop(rtp_session->dtmf_data.dtmf_queue, &pop) == SWITCH_STATUS_SUCCESS) {
-			int x, ts;
+			int x;
 			struct rfc2833_digit *rdigit = pop;
 
 			memset(rtp_session->dtmf_data.out_digit_packet, 0, 4);
@@ -652,22 +660,24 @@
 			rtp_session->dtmf_data.out_digit_packet[0] = (unsigned char)switch_char_to_rfc2833(rdigit->digit);
 			rtp_session->dtmf_data.out_digit_packet[1] = 7;
 
-			ts = rtp_session->dtmf_data.timestamp_dtmf += samples;
-			rtp_session->dtmf_data.out_digit_seq++;
+			//ts = rtp_session->dtmf_data.timestamp_dtmf += samples;
+			rtp_session->dtmf_data.timestamp_dtmf++;
+
+
 			for (x = 0; x < 3; x++) {
 				switch_rtp_write_manual(rtp_session,
 										rtp_session->dtmf_data.out_digit_packet,
 										4,
 										1,
-										101,
-										ts,
-										rtp_session->dtmf_data.out_digit_seq,
+										rtp_session->te,
+										rtp_session->dtmf_data.timestamp_dtmf,
+										rtp_session->dtmf_data.out_digit_seq++,
 										&flags);
 				switch_log_printf(SWITCH_CHANNEL_LOG,
 								  SWITCH_LOG_DEBUG,
 								  "Send start packet for [%c] ts=%d sofar=%u dur=%d\n",
 								  rtp_session->dtmf_data.out_digit,
-								  ts,
+								  rtp_session->dtmf_data.timestamp_dtmf,
 								  rtp_session->dtmf_data.out_digit_sofar,
 								  0);
 			}
@@ -682,10 +692,10 @@
 	switch_size_t bytes;
 	switch_status_t status;
 
+
 	for(;;) {
 		bytes = sizeof(rtp_msg_t);	
 		status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock, 0, (void *)&rtp_session->recv_msg, &bytes);
-
 		
 		if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BREAK)) {
 			switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_BREAK);
@@ -777,19 +787,21 @@
 
 
 		if (rtp_session->recv_msg.header.version) {
-			if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && rtp_session->from_addr->port && 
-				(rtp_session->from_addr->port != rtp_session->remote_port)) {
-				const char *err;
-				char *tx_host;
-				uint32_t old = rtp_session->remote_port;
-				char *old_host;
+			if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && rtp_session->from_addr->port) {
+				if ((rtp_session->from_addr->port != rtp_session->remote_port)) {
+					const char *err;
+					char *tx_host;
+					uint32_t old = rtp_session->remote_port;
+					char *old_host;
 				
-				switch_sockaddr_ip_get(&tx_host, rtp_session->from_addr);
-				switch_sockaddr_ip_get(&old_host, rtp_session->remote_addr);
-
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Auto Changing port from %s:%u to %s:%u\n",
-								  old_host, old, tx_host, rtp_session->from_addr->port);
-				switch_rtp_set_remote_address(rtp_session, tx_host, rtp_session->from_addr->port, &err);
+					switch_sockaddr_ip_get(&tx_host, rtp_session->from_addr);
+					switch_sockaddr_ip_get(&old_host, rtp_session->remote_addr);
+					
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Auto Changing port from %s:%u to %s:%u\n",
+									  old_host, old, tx_host, rtp_session->from_addr->port);
+					switch_rtp_set_remote_address(rtp_session, tx_host, rtp_session->from_addr->port, &err);
+				}
+				switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
 			}
 		}
 
@@ -811,7 +823,7 @@
 		}
 
 		/* RFC2833 ... TBD try harder to honor the duration etc.*/
-		if (rtp_session->recv_msg.header.pt == 101) {
+		if (rtp_session->recv_msg.header.pt == rtp_session->te) {
 			unsigned char *packet = (unsigned char *) rtp_session->recv_msg.body;
 			int end = packet[1]&0x80;
 			int duration = (packet[2]<<8) + packet[3];
@@ -1313,7 +1325,7 @@
 
 	rtp_session->ts += ts;
 	rtp_session->send_msg.header.seq = htons(mseq);
-	rtp_session->send_msg.header.ts = htonl(rtp_session->ts);
+	rtp_session->send_msg.header.ts = htonl(ts);
 
 	return rtp_common_write(rtp_session, data, datalen, m, payload, flags);
 }

Modified: freeswitch/branches/james/src/switch_xml.c
==============================================================================
--- freeswitch/branches/james/src/switch_xml.c	(original)
+++ freeswitch/branches/james/src/switch_xml.c	Sun Jun 18 11:09:41 2006
@@ -94,6 +94,7 @@
 static switch_memory_pool_t *XML_MEMORY_POOL;
 static switch_mutex_t *XML_LOCK;
 static switch_thread_rwlock_t *RWLOCK;
+static uint32_t lock_count = 0;
 
 struct xml_section_t {
 	const char *name;
@@ -192,6 +193,14 @@
     return xml;
 }
 
+// returns the value of the requested tag attribute or "" if not found
+SWITCH_DECLARE(const char *) switch_xml_attr_soft(switch_xml_t xml, const char *attr)
+{
+	const char *ret = switch_xml_attr(xml, attr);
+
+	return ret ? ret : "";
+}
+
 // returns the value of the requested tag attribute or NULL if not found
 SWITCH_DECLARE(const char *) switch_xml_attr(switch_xml_t xml, const char *attr)
 {
@@ -836,7 +845,7 @@
 
 	for(;;) {
 		if (!xml) {
-			if (!(xml = MAIN_XML_ROOT)) {
+			if (!(xml = switch_xml_root())) {
 				*node = NULL;
 				*root = NULL;
 				return SWITCH_STATUS_FALSE;
@@ -862,17 +871,19 @@
 	return SWITCH_STATUS_FALSE;
 }
 
+
 SWITCH_DECLARE(switch_xml_t) switch_xml_root(void)
 {
+	lock_count++;
 	switch_thread_rwlock_rdlock(RWLOCK);
 	return MAIN_XML_ROOT;
 }
 
-SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload)
+SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **err)
 {
 	char path_buf[1024];
 	uint8_t hasmain = 0;
-
+	
 	switch_mutex_lock(XML_LOCK);
 
 	if (MAIN_XML_ROOT) {
@@ -889,9 +900,17 @@
 		switch_xml_free(xml);
 	}
 
-	snprintf(path_buf, sizeof(path_buf), "%s/%s", SWITCH_GLOBAL_dirs.conf_dir, "freeswitch.xml");
+	snprintf(path_buf, sizeof(path_buf), "%s%s%s", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR, "freeswitch.xml");
 	if ((MAIN_XML_ROOT = switch_xml_parse_file(path_buf))) {
-		switch_set_flag(MAIN_XML_ROOT, SWITCH_XML_ROOT);
+		*err = switch_xml_error(MAIN_XML_ROOT);
+
+		if (!switch_strlen_zero(*err)) {
+			switch_xml_free(MAIN_XML_ROOT);
+			MAIN_XML_ROOT = NULL;
+		} else {
+			*err = "Success";
+			switch_set_flag(MAIN_XML_ROOT, SWITCH_XML_ROOT);
+		}
 	} else {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot Open XML Root!\n");
 	}
@@ -900,20 +919,23 @@
 		switch_thread_rwlock_unlock(RWLOCK);
 	}
 	switch_mutex_unlock(XML_LOCK);
+
 	return switch_xml_root();
 }
 
 
-SWITCH_DECLARE(switch_status_t) switch_xml_init(switch_memory_pool_t *pool)
+SWITCH_DECLARE(switch_status_t) switch_xml_init(switch_memory_pool_t *pool, const char **err)
 {
 	switch_xml_t xml;
 	XML_MEMORY_POOL = pool;
+	*err = "Success";
+
 	switch_mutex_init(&XML_LOCK, SWITCH_MUTEX_NESTED, XML_MEMORY_POOL);
 	switch_thread_rwlock_create(&RWLOCK, XML_MEMORY_POOL);
 
 	assert(pool != NULL);
 
-	if((xml=switch_xml_open_root(FALSE))) {
+	if((xml=switch_xml_open_root(FALSE, err))) {
 		switch_xml_free(xml);
 		return SWITCH_STATUS_SUCCESS;
 	} else {
@@ -1083,7 +1105,10 @@
     if (! xml ) return;
 
 	if (switch_test_flag(xml, SWITCH_XML_ROOT)) {
-		switch_thread_rwlock_unlock(RWLOCK);
+		if (lock_count > 0) {
+			switch_thread_rwlock_unlock(RWLOCK);
+			lock_count--;
+		}
 	}
 
 	if (xml == MAIN_XML_ROOT) {

Modified: freeswitch/branches/james/w32/vsnet/Freeswitch.sln
==============================================================================
--- freeswitch/branches/james/w32/vsnet/Freeswitch.sln	(original)
+++ freeswitch/branches/james/w32/vsnet/Freeswitch.sln	Sun Jun 18 11:09:41 2006
@@ -146,8 +146,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey", "..\..\src\mod\languages\mod_spidermonkey\mod_spidermonkey.vcproj", "{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}"
 	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 		{89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ASR-TTS", "ASR-TTS", "{4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}"
@@ -207,10 +207,15 @@
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XML Interfaces", "XML Interfaces", "{F69A4A6B-9360-4EBB-A280-22AA3C455AC5}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_rpc", "..\..\src\mod\xml_int\mod_xml_rpc\mod_xml_rpc.vcproj", "{CBEC7225-0C21-4DA8-978E-1F158F8AD950}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{99D6D74B-32A8-4441-A417-551B0E0A4510}"
-	ProjectSection(SolutionItems) = preProject
-		GetLibs.vbs = GetLibs.vbs
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_rss", "..\..\src\mod\applications\mod_rss\mod_rss.vcproj", "{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 	EndProjectSection
 EndProject
 Global
@@ -603,6 +608,10 @@
 		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.Build.0 = Debug|Win32
 		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.ActiveCfg = Release|Win32
 		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.Build.0 = Release|Win32
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.Build.0 = Debug|Win32
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.ActiveCfg = Release|Win32
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -624,6 +633,7 @@
 		{419AA391-5F3F-4BFE-A869-9D154D62A792} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
 		{0E2C6395-13B9-46E5-9264-8859D346018D} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
 		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
 		{3A5B9131-F20C-4A85-9447-6C1610941CEE} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
 		{5FD31A25-5D83-4794-8BEE-904DAD84CE71} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
 		{FE3540C5-3303-46E0-A69E-D92F775687F1} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}

Modified: freeswitch/branches/james/w32/vsnet/GetLibs.vbs
==============================================================================
--- freeswitch/branches/james/w32/vsnet/GetLibs.vbs	(original)
+++ freeswitch/branches/james/w32/vsnet/GetLibs.vbs	Sun Jun 18 11:09:41 2006
@@ -767,18 +767,23 @@
 		FSO.CopyFile Utilsdir & "pcre\pcre_chartables.c.vcproj", LibDestDir & "pcre\win32\", True
 		FSO.CopyFile Utilsdir & "pcre\pcre.h", LibDestDir & "pcre\win32\", True
 		FSO.CopyFile Utilsdir & "pcre\config.h", LibDestDir & "pcre\win32\", True
+		FSO.CopyFile Utilsdir & "pcre\pcre.h", LibDestDir & "include\", True
 	End If 
 	If FSO.FolderExists(LibDestDir & "pcre") Then 
 		If BuildDebug Then
-			If Not FSO.FileExists(LibDestDir & "pcre\win32\Debug\libpcre.lib") Then 
+			If Not FSO.FileExists(LibDestDir & "pcre\win32\Debug DLL\libpcre.lib") Then 
 				BuildViaVCBuild LibDestDir & "pcre\win32\pcre_chartables.c.vcproj", "Debug"
-				BuildViaVCBuild LibDestDir & "pcre\win32\libpcre.vcproj", "Debug"
+				BuildViaVCBuild LibDestDir & "pcre\win32\libpcre.vcproj", "Debug DLL"
+				FSO.CopyFile LibDestDir & "pcre\win32\Debug DLL\libpcre.lib", ScriptDir & "Debug\", True
+				FSO.CopyFile LibDestDir & "pcre\win32\Debug DLL\libpcre.dll", ScriptDir & "Debug\", True
 			End If
 		End If
 		If BuildRelease Then
-			If Not FSO.FileExists(LibDestDir & "pcre\win32\Release\libpcre.lib") Then 
+			If Not FSO.FileExists(LibDestDir & "pcre\win32\Release DLL\libpcre.lib") Then 
 				BuildViaVCBuild LibDestDir & "pcre\win32\pcre_chartables.c.vcproj", "Release"
-				BuildViaVCBuild LibDestDir & "pcre\win32\libpcre.vcproj", "Release"
+				BuildViaVCBuild LibDestDir & "pcre\win32\libpcre.vcproj", "Release DLL"
+				FSO.CopyFile LibDestDir & "pcre\win32\Release DLL\libpcre.lib", ScriptDir & "Release\", True
+				FSO.CopyFile LibDestDir & "pcre\win32\Release DLL\libpcre.dll", ScriptDir & "Release\", True
 			End If
 		End If
 	Else

Modified: freeswitch/branches/james/w32/vsnet/Tools/pcre/libpcre.vcproj
==============================================================================
--- freeswitch/branches/james/w32/vsnet/Tools/pcre/libpcre.vcproj	(original)
+++ freeswitch/branches/james/w32/vsnet/Tools/pcre/libpcre.vcproj	Sun Jun 18 11:09:41 2006
@@ -25,7 +25,6 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				Description=""
 				CommandLine=""
 			/>
 			<Tool
@@ -111,7 +110,6 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				Description=""
 				CommandLine=""
 			/>
 			<Tool
@@ -198,7 +196,6 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				Description=""
 				CommandLine=""
 			/>
 			<Tool
@@ -256,7 +253,7 @@
 				OutputFile="$(OutDir)\$(ProjectName).dll"
 				LinkIncremental="2"
 				SuppressStartupBanner="true"
-				ModuleDefinitionFile=""
+				ModuleDefinitionFile="$(InputDir)..\pcre.def"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
 				ImportLibrary="$(OutDir)\$(ProjectName).lib"
@@ -300,7 +297,6 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				Description=""
 				CommandLine=""
 			/>
 			<Tool
@@ -358,7 +354,7 @@
 				OutputFile="$(OutDir)\$(ProjectName).dll"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
-				ModuleDefinitionFile=""
+				ModuleDefinitionFile="$(InputDir)..\pcre.def"
 				ProgramDatabaseFile="$(OutDir)\$(ProjectName).pdb"
 				ImportLibrary="$(OutDir)\$(ProjectName).lib"
 				TargetMachine="1"



More information about the Freeswitch-svn mailing list