[Freeswitch-svn] [commit] r2743 - in freeswitch/branches/mishehu: . conf libs libs/codec/g726 libs/codec/g7xx libs/codec/gsm libs/codec/ilbc libs/codec/lpc10 libs/iax libs/iax/src libs/libdingaling libs/libspeakup libs/libteletone libs/srtp libs/win32 libs/win32/apr libs/win32/apr-iconv libs/win32/apr-util libs/win32/curl libs/win32/exosip libs/win32/howl libs/win32/iksemel libs/win32/js libs/win32/libresample libs/win32/libsndfile libs/win32/pcre libs/win32/portaudio libs/win32/pthread libs/win32/sofia libs/win32/speex libs/win32/sqlite libs/win32/xmlrpc scripts src src/dotnet src/dotnet/Marshaling src/dotnet/Marshaling/Types src/dotnet/Modules src/dotnet/Properties src/dotnet/Switch src/dotnet/Types src/include src/mod src/mod/applications src/mod/applications/mod_bridgecall src/mod/applications/mod_commands src/mod/applications/mod_conference src/mod/applications/mod_dptools src/mod/applications/mod_echo src/mod/applications/mod_ivrtest src/mod/applications/mod_park 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_amr src/mod/codecs/mod_g711 src/mod/codecs/mod_g722 src/mod/codecs/mod_g723_1 src/mod/codecs/mod_g726 src/mod/codecs/mod_g729 src/mod/codecs/mod_gsm src/mod/codecs/mod_ilbc src/mod/codecs/mod_l16 src/mod/codecs/mod_lpc10 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/dotnet 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_sofia src/mod/endpoints/mod_wanpipe src/mod/endpoints/mod_woomera src/mod/event_handlers src/mod/event_handlers/mod_cdr src/mod/event_handlers/mod_event_multicast src/mod/event_handlers/mod_event_socket 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_mono src/mod/languages/mod_perl src/mod/languages/mod_php src/mod/languages/mod_python src/mod/languages/mod_ruby 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 w32/Console w32/Library w32/Setup

Freeswitch SVN mishehu at freeswitch.org
Mon Sep 18 11:45:46 EDT 2006


Author: mishehu
Date: Mon Sep 18 11:45:43 2006
New Revision: 2743

Added:
   freeswitch/branches/mishehu/libs/win32/Download PTHREAD.vcproj
      - copied unchanged from r2742, /freeswitch/trunk/libs/win32/Download PTHREAD.vcproj
   freeswitch/branches/mishehu/libs/win32/Download SOFIA.vcproj
      - copied unchanged from r2742, /freeswitch/trunk/libs/win32/Download SOFIA.vcproj
   freeswitch/branches/mishehu/libs/win32/pthread/   (props changed)
      - copied from r2742, /freeswitch/trunk/libs/win32/pthread/
   freeswitch/branches/mishehu/libs/win32/pthread/cleancount
      - copied unchanged from r2742, /freeswitch/trunk/libs/win32/pthread/cleancount
   freeswitch/branches/mishehu/libs/win32/pthread/pthread.vcproj
      - copied unchanged from r2742, /freeswitch/trunk/libs/win32/pthread/pthread.vcproj
   freeswitch/branches/mishehu/libs/win32/sofia/   (props changed)
      - copied from r2742, /freeswitch/trunk/libs/win32/sofia/
   freeswitch/branches/mishehu/libs/win32/sofia/cleancount
      - copied unchanged from r2742, /freeswitch/trunk/libs/win32/sofia/cleancount
   freeswitch/branches/mishehu/libs/win32/sofia/libsofia_sip_ua_static.vcproj
      - copied unchanged from r2742, /freeswitch/trunk/libs/win32/sofia/libsofia_sip_ua_static.vcproj
   freeswitch/branches/mishehu/src/dotnet/
      - copied from r2742, /freeswitch/trunk/src/dotnet/
   freeswitch/branches/mishehu/src/dotnet/Common.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Common.cs
   freeswitch/branches/mishehu/src/dotnet/FreeSwitch.NET.csproj
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/FreeSwitch.NET.csproj
   freeswitch/branches/mishehu/src/dotnet/Makefile
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Makefile
   freeswitch/branches/mishehu/src/dotnet/Marshaling/
      - copied from r2742, /freeswitch/trunk/src/dotnet/Marshaling/
   freeswitch/branches/mishehu/src/dotnet/Marshaling/BufferMarshaler.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/BufferMarshaler.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/CallerExtensionMarshaler.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/CallerExtensionMarshaler.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/CallerProfileMarshaler.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/CallerProfileMarshaler.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/ChannelMarshaler.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/ChannelMarshaler.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/ChannelTimetableMarshaler.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/ChannelTimetableMarshaler.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/CoreSessionMarshaler.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/CoreSessionMarshaler.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/EventMarshaler.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/EventMarshaler.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/FileHandleMarshaler.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/FileHandleMarshaler.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/MemoryPoolMarshaler.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/MemoryPoolMarshaler.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/StreamHandleMarshaler.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/StreamHandleMarshaler.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/
      - copied from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/ApiInterfaceMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/ApiInterfaceMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/ApplicationInterfaceMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/ApplicationInterfaceMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/BufferMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/BufferMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/CallerExtensionMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/CallerExtensionMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/CallerProfileMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/CallerProfileMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/ChannelFlagMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/ChannelFlagMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/ChannelMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/ChannelMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/ChannelStateMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/ChannelStateMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/ChannelTimetableMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/ChannelTimetableMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/CodecImplementationMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/CodecImplementationMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/CodecInterfaceMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/CodecInterfaceMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/CodecMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/CodecMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/CodecTypeMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/CodecTypeMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/CoreSessionMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/CoreSessionMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/EventMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/EventMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/FileHandleMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/FileHandleMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/FrameMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/FrameMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/IOEventHooksMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/IOEventHooksMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/LoadableModuleInterfaceMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/LoadableModuleInterfaceMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/LoadableModuleMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/LoadableModuleMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/StreamHandleMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/StreamHandleMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Marshaling/Types/TypesMarshal.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Marshaling/Types/TypesMarshal.cs
   freeswitch/branches/mishehu/src/dotnet/Module.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Module.cs
   freeswitch/branches/mishehu/src/dotnet/Modules/
      - copied from r2742, /freeswitch/trunk/src/dotnet/Modules/
   freeswitch/branches/mishehu/src/dotnet/Modules/Api.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Modules/Api.cs
   freeswitch/branches/mishehu/src/dotnet/Modules/Application.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Modules/Application.cs
   freeswitch/branches/mishehu/src/dotnet/Properties/
      - copied from r2742, /freeswitch/trunk/src/dotnet/Properties/
   freeswitch/branches/mishehu/src/dotnet/Properties/AssemblyInfo.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Properties/AssemblyInfo.cs
   freeswitch/branches/mishehu/src/dotnet/Switch/
      - copied from r2742, /freeswitch/trunk/src/dotnet/Switch/
   freeswitch/branches/mishehu/src/dotnet/Switch/CallerProfile.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Switch/CallerProfile.cs
   freeswitch/branches/mishehu/src/dotnet/Switch/Channel.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Switch/Channel.cs
   freeswitch/branches/mishehu/src/dotnet/Switch/Console.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Switch/Console.cs
   freeswitch/branches/mishehu/src/dotnet/Switch/CoreSession.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Switch/CoreSession.cs
   freeswitch/branches/mishehu/src/dotnet/Switch/Ivr.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Switch/Ivr.cs
   freeswitch/branches/mishehu/src/dotnet/Switch/LoadableModule.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Switch/LoadableModule.cs
   freeswitch/branches/mishehu/src/dotnet/Switch/StreamHandle.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Switch/StreamHandle.cs
   freeswitch/branches/mishehu/src/dotnet/Types/
      - copied from r2742, /freeswitch/trunk/src/dotnet/Types/
   freeswitch/branches/mishehu/src/dotnet/Types/ApiFunction.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/ApiFunction.cs
   freeswitch/branches/mishehu/src/dotnet/Types/ApplicationFunction.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/ApplicationFunction.cs
   freeswitch/branches/mishehu/src/dotnet/Types/ApplicationInterface.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/ApplicationInterface.cs
   freeswitch/branches/mishehu/src/dotnet/Types/Buffer.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/Buffer.cs
   freeswitch/branches/mishehu/src/dotnet/Types/CallCause.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/CallCause.cs
   freeswitch/branches/mishehu/src/dotnet/Types/CallerExtension.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/CallerExtension.cs
   freeswitch/branches/mishehu/src/dotnet/Types/CallerProfile.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/CallerProfile.cs
   freeswitch/branches/mishehu/src/dotnet/Types/Channel.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/Channel.cs
   freeswitch/branches/mishehu/src/dotnet/Types/ChannelFlag.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/ChannelFlag.cs
   freeswitch/branches/mishehu/src/dotnet/Types/ChannelState.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/ChannelState.cs
   freeswitch/branches/mishehu/src/dotnet/Types/ChannelTimetable.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/ChannelTimetable.cs
   freeswitch/branches/mishehu/src/dotnet/Types/CoreSession.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/CoreSession.cs
   freeswitch/branches/mishehu/src/dotnet/Types/DtmfCallbackFunction.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/DtmfCallbackFunction.cs
   freeswitch/branches/mishehu/src/dotnet/Types/Event.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/Event.cs
   freeswitch/branches/mishehu/src/dotnet/Types/FileHandle.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/FileHandle.cs
   freeswitch/branches/mishehu/src/dotnet/Types/InputCallbackFunction.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/InputCallbackFunction.cs
   freeswitch/branches/mishehu/src/dotnet/Types/InputType.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/InputType.cs
   freeswitch/branches/mishehu/src/dotnet/Types/LoadableModule.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/LoadableModule.cs
   freeswitch/branches/mishehu/src/dotnet/Types/LoadableModuleInterface.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/LoadableModuleInterface.cs
   freeswitch/branches/mishehu/src/dotnet/Types/MemoryPool.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/MemoryPool.cs
   freeswitch/branches/mishehu/src/dotnet/Types/Module.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/Module.cs
   freeswitch/branches/mishehu/src/dotnet/Types/ModuleInterfaces.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/ModuleInterfaces.cs
   freeswitch/branches/mishehu/src/dotnet/Types/Status.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/Status.cs
   freeswitch/branches/mishehu/src/dotnet/Types/StreamHandle.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/StreamHandle.cs
   freeswitch/branches/mishehu/src/dotnet/Types/TextChannel.cs
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/Types/TextChannel.cs
   freeswitch/branches/mishehu/src/dotnet/public.snk
      - copied unchanged from r2742, /freeswitch/trunk/src/dotnet/public.snk
   freeswitch/branches/mishehu/src/mod/codecs/mod_g723_1/mod_g723_1.vcproj
      - copied unchanged from r2742, /freeswitch/trunk/src/mod/codecs/mod_g723_1/mod_g723_1.vcproj
   freeswitch/branches/mishehu/src/mod/codecs/mod_g726/mod_g726.vcproj
      - copied unchanged from r2742, /freeswitch/trunk/src/mod/codecs/mod_g726/mod_g726.vcproj
   freeswitch/branches/mishehu/src/mod/dotnet/   (props changed)
      - copied from r2742, /freeswitch/trunk/src/mod/dotnet/
   freeswitch/branches/mishehu/src/mod/languages/mod_mono/   (props changed)
      - copied from r2742, /freeswitch/trunk/src/mod/languages/mod_mono/
   freeswitch/branches/mishehu/src/mod/languages/mod_mono/Makefile
      - copied unchanged from r2742, /freeswitch/trunk/src/mod/languages/mod_mono/Makefile
   freeswitch/branches/mishehu/src/mod/languages/mod_mono/mod_mono.c
      - copied unchanged from r2742, /freeswitch/trunk/src/mod/languages/mod_mono/mod_mono.c
   freeswitch/branches/mishehu/src/mod/languages/mod_php/php.ini
      - copied unchanged from r2742, /freeswitch/trunk/src/mod/languages/mod_php/php.ini
   freeswitch/branches/mishehu/src/mod/languages/mod_ruby/Makefile
      - copied unchanged from r2742, /freeswitch/trunk/src/mod/languages/mod_ruby/Makefile
   freeswitch/branches/mishehu/src/mod/languages/mod_ruby/config.h
      - copied unchanged from r2742, /freeswitch/trunk/src/mod/languages/mod_ruby/config.h
   freeswitch/branches/mishehu/src/mod/languages/mod_ruby/mod_ruby.c
      - copied unchanged from r2742, /freeswitch/trunk/src/mod/languages/mod_ruby/mod_ruby.c
   freeswitch/branches/mishehu/src/mod/languages/mod_ruby/switch_swig.c
      - copied unchanged from r2742, /freeswitch/trunk/src/mod/languages/mod_ruby/switch_swig.c
   freeswitch/branches/mishehu/src/mod/languages/mod_ruby/switch_swig.i
      - copied unchanged from r2742, /freeswitch/trunk/src/mod/languages/mod_ruby/switch_swig.i
   freeswitch/branches/mishehu/src/mod/languages/mod_ruby/switch_swig_wrap.c
      - copied unchanged from r2742, /freeswitch/trunk/src/mod/languages/mod_ruby/switch_swig_wrap.c
Removed:
   freeswitch/branches/mishehu/src/mod/codecs/mod_g711/g711.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_g711/g711.h
Modified:
   freeswitch/branches/mishehu/   (props changed)
   freeswitch/branches/mishehu/AUTHORS
   freeswitch/branches/mishehu/Freeswitch.sln
   freeswitch/branches/mishehu/conf/   (props changed)
   freeswitch/branches/mishehu/conf/freeswitch.xml
   freeswitch/branches/mishehu/configure
   freeswitch/branches/mishehu/configure.in
   freeswitch/branches/mishehu/libs/   (props changed)
   freeswitch/branches/mishehu/libs/codec/g726/   (props changed)
   freeswitch/branches/mishehu/libs/codec/g726/configure
   freeswitch/branches/mishehu/libs/codec/g7xx/   (props changed)
   freeswitch/branches/mishehu/libs/codec/gsm/   (props changed)
   freeswitch/branches/mishehu/libs/codec/ilbc/   (props changed)
   freeswitch/branches/mishehu/libs/codec/lpc10/   (props changed)
   freeswitch/branches/mishehu/libs/iax/   (props changed)
   freeswitch/branches/mishehu/libs/iax/src/iax.c
   freeswitch/branches/mishehu/libs/libdingaling/   (props changed)
   freeswitch/branches/mishehu/libs/libspeakup/   (props changed)
   freeswitch/branches/mishehu/libs/libteletone/   (props changed)
   freeswitch/branches/mishehu/libs/srtp/   (props changed)
   freeswitch/branches/mishehu/libs/win32/   (props changed)
   freeswitch/branches/mishehu/libs/win32/apr/   (props changed)
   freeswitch/branches/mishehu/libs/win32/apr-iconv/   (props changed)
   freeswitch/branches/mishehu/libs/win32/apr-util/   (props changed)
   freeswitch/branches/mishehu/libs/win32/curl/   (props changed)
   freeswitch/branches/mishehu/libs/win32/exosip/   (props changed)
   freeswitch/branches/mishehu/libs/win32/howl/   (props changed)
   freeswitch/branches/mishehu/libs/win32/iksemel/   (props changed)
   freeswitch/branches/mishehu/libs/win32/js/   (props changed)
   freeswitch/branches/mishehu/libs/win32/libresample/   (props changed)
   freeswitch/branches/mishehu/libs/win32/libsndfile/   (props changed)
   freeswitch/branches/mishehu/libs/win32/pcre/   (props changed)
   freeswitch/branches/mishehu/libs/win32/portaudio/   (props changed)
   freeswitch/branches/mishehu/libs/win32/speex/   (props changed)
   freeswitch/branches/mishehu/libs/win32/sqlite/   (props changed)
   freeswitch/branches/mishehu/libs/win32/xmlrpc/   (props changed)
   freeswitch/branches/mishehu/scripts/   (props changed)
   freeswitch/branches/mishehu/src/include/switch_am_config.h.in
   freeswitch/branches/mishehu/src/include/switch_apr.h
   freeswitch/branches/mishehu/src/include/switch_core.h
   freeswitch/branches/mishehu/src/include/switch_ivr.h
   freeswitch/branches/mishehu/src/include/switch_module_interfaces.h
   freeswitch/branches/mishehu/src/include/switch_platform.h
   freeswitch/branches/mishehu/src/include/switch_rtp.h
   freeswitch/branches/mishehu/src/include/switch_utils.h
   freeswitch/branches/mishehu/src/mod/   (props changed)
   freeswitch/branches/mishehu/src/mod/applications/   (props changed)
   freeswitch/branches/mishehu/src/mod/applications/mod_bridgecall/   (props changed)
   freeswitch/branches/mishehu/src/mod/applications/mod_bridgecall/mod_bridgecall.c
   freeswitch/branches/mishehu/src/mod/applications/mod_commands/   (props changed)
   freeswitch/branches/mishehu/src/mod/applications/mod_commands/mod_commands.c
   freeswitch/branches/mishehu/src/mod/applications/mod_conference/   (props changed)
   freeswitch/branches/mishehu/src/mod/applications/mod_conference/mod_conference.c
   freeswitch/branches/mishehu/src/mod/applications/mod_dptools/   (props changed)
   freeswitch/branches/mishehu/src/mod/applications/mod_echo/   (props changed)
   freeswitch/branches/mishehu/src/mod/applications/mod_ivrtest/   (props changed)
   freeswitch/branches/mishehu/src/mod/applications/mod_park/   (props changed)
   freeswitch/branches/mishehu/src/mod/applications/mod_playback/   (props changed)
   freeswitch/branches/mishehu/src/mod/applications/mod_rss/   (props changed)
   freeswitch/branches/mishehu/src/mod/applications/mod_skel/   (props changed)
   freeswitch/branches/mishehu/src/mod/asr_tts/   (props changed)
   freeswitch/branches/mishehu/src/mod/asr_tts/mod_cepstral/   (props changed)
   freeswitch/branches/mishehu/src/mod/codecs/   (props changed)
   freeswitch/branches/mishehu/src/mod/codecs/mod_amr/   (props changed)
   freeswitch/branches/mishehu/src/mod/codecs/mod_g711/   (props changed)
   freeswitch/branches/mishehu/src/mod/codecs/mod_g711/Makefile
   freeswitch/branches/mishehu/src/mod/codecs/mod_g711/mod_g711.c
   freeswitch/branches/mishehu/src/mod/codecs/mod_g711/mod_g711.vcproj
   freeswitch/branches/mishehu/src/mod/codecs/mod_g722/   (props changed)
   freeswitch/branches/mishehu/src/mod/codecs/mod_g723_1/   (props changed)
   freeswitch/branches/mishehu/src/mod/codecs/mod_g726/   (props changed)
   freeswitch/branches/mishehu/src/mod/codecs/mod_g729/   (props changed)
   freeswitch/branches/mishehu/src/mod/codecs/mod_g729/mod_g729.vcproj
   freeswitch/branches/mishehu/src/mod/codecs/mod_gsm/   (props changed)
   freeswitch/branches/mishehu/src/mod/codecs/mod_ilbc/   (props changed)
   freeswitch/branches/mishehu/src/mod/codecs/mod_l16/   (props changed)
   freeswitch/branches/mishehu/src/mod/codecs/mod_lpc10/   (props changed)
   freeswitch/branches/mishehu/src/mod/codecs/mod_speex/   (props changed)
   freeswitch/branches/mishehu/src/mod/dialplans/   (props changed)
   freeswitch/branches/mishehu/src/mod/dialplans/mod_dialplan_directory/   (props changed)
   freeswitch/branches/mishehu/src/mod/dialplans/mod_dialplan_xml/   (props changed)
   freeswitch/branches/mishehu/src/mod/directories/   (props changed)
   freeswitch/branches/mishehu/src/mod/directories/mod_ldap/   (props changed)
   freeswitch/branches/mishehu/src/mod/endpoints/   (props changed)
   freeswitch/branches/mishehu/src/mod/endpoints/mod_dingaling/   (props changed)
   freeswitch/branches/mishehu/src/mod/endpoints/mod_dingaling/mod_dingaling.c
   freeswitch/branches/mishehu/src/mod/endpoints/mod_exosip/   (props changed)
   freeswitch/branches/mishehu/src/mod/endpoints/mod_exosip/mod_exosip.c
   freeswitch/branches/mishehu/src/mod/endpoints/mod_iax/   (props changed)
   freeswitch/branches/mishehu/src/mod/endpoints/mod_iax/mod_iax.c
   freeswitch/branches/mishehu/src/mod/endpoints/mod_portaudio/   (props changed)
   freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/   (props changed)
   freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.vcproj
   freeswitch/branches/mishehu/src/mod/endpoints/mod_wanpipe/   (props changed)
   freeswitch/branches/mishehu/src/mod/endpoints/mod_woomera/   (props changed)
   freeswitch/branches/mishehu/src/mod/endpoints/mod_woomera/mod_woomera.c
   freeswitch/branches/mishehu/src/mod/event_handlers/   (props changed)
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/   (props changed)
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/Makefile
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_event_multicast/   (props changed)
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_event_socket/   (props changed)
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_event_test/   (props changed)
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_xmpp_event/   (props changed)
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_zeroconf/   (props changed)
   freeswitch/branches/mishehu/src/mod/formats/   (props changed)
   freeswitch/branches/mishehu/src/mod/formats/mod_sndfile/   (props changed)
   freeswitch/branches/mishehu/src/mod/languages/   (props changed)
   freeswitch/branches/mishehu/src/mod/languages/mod_perl/   (props changed)
   freeswitch/branches/mishehu/src/mod/languages/mod_php/   (props changed)
   freeswitch/branches/mishehu/src/mod/languages/mod_php/Makefile
   freeswitch/branches/mishehu/src/mod/languages/mod_php/apptest.php
   freeswitch/branches/mishehu/src/mod/languages/mod_php/classFreeswitch.php
   freeswitch/branches/mishehu/src/mod/languages/mod_php/mod_php.c
   freeswitch/branches/mishehu/src/mod/languages/mod_php/switch_swig.c
   freeswitch/branches/mishehu/src/mod/languages/mod_python/   (props changed)
   freeswitch/branches/mishehu/src/mod/languages/mod_python/Makefile
   freeswitch/branches/mishehu/src/mod/languages/mod_python/mod_python.c
   freeswitch/branches/mishehu/src/mod/languages/mod_python/switch_swig.c
   freeswitch/branches/mishehu/src/mod/languages/mod_ruby/   (props changed)
   freeswitch/branches/mishehu/src/mod/languages/mod_ruby/README
   freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/   (props changed)
   freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/Makefile
   freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
   freeswitch/branches/mishehu/src/mod/loggers/   (props changed)
   freeswitch/branches/mishehu/src/mod/loggers/mod_console/   (props changed)
   freeswitch/branches/mishehu/src/mod/loggers/mod_syslog/   (props changed)
   freeswitch/branches/mishehu/src/mod/loggers/mod_syslog/mod_syslog.c
   freeswitch/branches/mishehu/src/mod/timers/   (props changed)
   freeswitch/branches/mishehu/src/mod/timers/mod_softtimer/   (props changed)
   freeswitch/branches/mishehu/src/mod/timers/mod_softtimer/mod_softtimer.c
   freeswitch/branches/mishehu/src/mod/xml_int/   (props changed)
   freeswitch/branches/mishehu/src/mod/xml_int/mod_xml_rpc/   (props changed)
   freeswitch/branches/mishehu/src/switch.c
   freeswitch/branches/mishehu/src/switch_buffer.c
   freeswitch/branches/mishehu/src/switch_channel.c
   freeswitch/branches/mishehu/src/switch_core.c
   freeswitch/branches/mishehu/src/switch_event.c
   freeswitch/branches/mishehu/src/switch_ivr.c
   freeswitch/branches/mishehu/src/switch_rtp.c
   freeswitch/branches/mishehu/src/switch_utils.c
   freeswitch/branches/mishehu/w32/   (props changed)
   freeswitch/branches/mishehu/w32/Console/   (props changed)
   freeswitch/branches/mishehu/w32/Library/   (props changed)
   freeswitch/branches/mishehu/w32/Setup/   (props changed)

Log:
Made a minor fix to the dummy Makefile in mod_cdr.  Merged to trunk r2742.

Modified: freeswitch/branches/mishehu/AUTHORS
==============================================================================
--- freeswitch/branches/mishehu/AUTHORS	(original)
+++ freeswitch/branches/mishehu/AUTHORS	Mon Sep 18 11:45:43 2006
@@ -18,13 +18,16 @@
 
  Brian K. West - For countless hours of work on BSD and Mac support, finding countless bugs, 
   and moral support.  Xcode project files.
- Joshua Colp - For his help making mod_exosip possible, and for just being a swell guy!
+ Joshua Colp - For his help making mod_exosip possible (which we are now getting rid of but oh well), 
+               and for just being a swell guy! (until he backstabbed us, c'est la vie)
  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>
  Yossi Neiman of Cartis Solutions, Inc. <freeswitch AT cartissolutions.com>  -  implementation of mod_cdr (perldd, mysql, csv)
  Stefan Knoblich - Various patches and support.  Thanks.
- 
+ Justin Unger - <justinunger at gmail dot com> Lots of help with patches and SIP testing. Thanks! 
+ Paul D. Tinsley - Various patches and support. <pdt at jackhammer.org>
+
 A big THANK YOU goes to:
 
 Justin Cassidy - Build related cleanups and automatic build setup.

Modified: freeswitch/branches/mishehu/Freeswitch.sln
==============================================================================
--- freeswitch/branches/mishehu/Freeswitch.sln	(original)
+++ freeswitch/branches/mishehu/Freeswitch.sln	Mon Sep 18 11:45:43 2006
@@ -509,9 +509,11 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sofia", "src\mod\endpoints\mod_sofia\mod_sofia.vcproj", "{0DF3ABD0-DDC0-4265-B778-07C66780979B}"
 	ProjectSection(ProjectDependencies) = postProject
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
 		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
 		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
 		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	EndProjectSection
 EndProject
@@ -545,6 +547,30 @@
 		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
 	EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download SOFIA", "libs\win32\Download SOFIA.vcproj", "{8B2CE7D1-77EF-45ED-927D-82147805440B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsofia_sip_ua_static", "libs\win32\sofia\libsofia_sip_ua_static.vcproj", "{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}"
+	ProjectSection(ProjectDependencies) = postProject
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
+		{8B2CE7D1-77EF-45ED-927D-82147805440B} = {8B2CE7D1-77EF-45ED-927D-82147805440B}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download PTHREAD", "libs\win32\Download PTHREAD.vcproj", "{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pthread", "libs\win32\pthread\pthread.vcproj", "{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}"
+	ProjectSection(ProjectDependencies) = postProject
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g723_1", "src\mod\codecs\mod_g723_1\mod_g723_1.vcproj", "{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
@@ -874,7 +900,9 @@
 		{204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Win32.ActiveCfg = Release|Win32
 		{204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Win32.Build.0 = Release|Win32
 		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.Build.0 = Debug|Win32
 		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.ActiveCfg = Release|Win32
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.Build.0 = Release|Win32
 		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Debug|Win32.ActiveCfg = Debug|Win32
 		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Debug|Win32.Build.0 = Debug|Win32
 		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Release|Win32.ActiveCfg = Release|Win32
@@ -895,6 +923,26 @@
 		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Debug|Win32.Build.0 = Debug|Win32
 		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Release|Win32.ActiveCfg = Release|Win32
 		{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Release|Win32.Build.0 = Release|Win32
+		{8B2CE7D1-77EF-45ED-927D-82147805440B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8B2CE7D1-77EF-45ED-927D-82147805440B}.Debug|Win32.Build.0 = Debug|Win32
+		{8B2CE7D1-77EF-45ED-927D-82147805440B}.Release|Win32.ActiveCfg = Release|Win32
+		{8B2CE7D1-77EF-45ED-927D-82147805440B}.Release|Win32.Build.0 = Release|Win32
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.Build.0 = Debug|Win32
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.ActiveCfg = Release|Win32
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.Build.0 = Release|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.Build.0 = Debug|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.ActiveCfg = Release|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.Build.0 = Release|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.Build.0 = Debug|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.ActiveCfg = Release DLL|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.Build.0 = Release DLL|Win32
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.Build.0 = Debug Passthrough|Win32
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.ActiveCfg = Release Passthrough|Win32
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.Build.0 = Release Passthrough|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -908,6 +956,7 @@
 		{D3EC0AFF-76FC-4210-A825-9A17410660A3} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
 		{486369EB-F150-4B56-BCC8-77B9E18FF5F5} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
 		{D42518CC-7475-454D-B392-0E132C07D761} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
 		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
 		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
 		{C7705DC4-2088-493E-AF8D-65BC6D65C125} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
@@ -965,6 +1014,8 @@
 		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
 		{5A6A281A-AA50-470A-8305-202BDA1CD1BF} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
 		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
 		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {0C808854-54D1-4230-BFF5-77B5FD905000}
 		{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8} = {0C808854-54D1-4230-BFF5-77B5FD905000}
 		{7B077E7F-1BE7-4291-AB86-55E527B25CAC} = {0C808854-54D1-4230-BFF5-77B5FD905000}
@@ -986,5 +1037,7 @@
 		{831F76E8-D288-4C54-9B6D-281D9436CCC7} = {C120A020-773F-4EA3-923F-B67AF28B750D}
 		{EC8D4AE8-0F3E-454A-BFB8-D56A5D9C0121} = {C120A020-773F-4EA3-923F-B67AF28B750D}
 		{B0AA13FC-636C-45A7-8EAE-663220679A75} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{8B2CE7D1-77EF-45ED-927D-82147805440B} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {C120A020-773F-4EA3-923F-B67AF28B750D}
 	EndGlobalSection
 EndGlobal

Modified: freeswitch/branches/mishehu/conf/freeswitch.xml
==============================================================================
--- freeswitch/branches/mishehu/conf/freeswitch.xml	(original)
+++ freeswitch/branches/mishehu/conf/freeswitch.xml	Mon Sep 18 11:45:43 2006
@@ -112,6 +112,7 @@
         <param name="codec-prefs" value="PCMU at 20i"/>
         <param name="codec-ms" value="20"/>
         <param name="use-rtp-timer" value="true"/>
+        <param name="rtp-timer-name" value="thread_soft"/>
         <param name="rtp-ip" value="192.168.1.20"/>
         <param name="sip-ip" value="192.168.1.20"/>
         <!-- optional ; -->
@@ -186,8 +187,14 @@
       <settings>
         <param name="debug" value="0"/>
       </settings>
+      <interface>
+       <param name="host" value="localhost"/>
+       <param name="port" value="42420"/>
+       <param name="audio-ip" value="127.0.0.1"/>
+       <param name="dialplan" value="XML"/>
+      </interface>
     </configuration>
-  
+
     <configuration name="wanpipe.conf" description="Sangoma Wanpipe Endpoint">
       <settings>
         <param name="debug" value="1"/>

Modified: freeswitch/branches/mishehu/configure
==============================================================================
--- freeswitch/branches/mishehu/configure	(original)
+++ freeswitch/branches/mishehu/configure	Mon Sep 18 11:45:43 2006
@@ -20843,7 +20843,8 @@
 
 
 
-for ac_func in gethostname vasprintf mmap mlock mlockall
+
+for ac_func in gethostname vasprintf mmap mlock mlockall usleep
 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/mishehu/configure.in
==============================================================================
--- freeswitch/branches/mishehu/configure.in	(original)
+++ freeswitch/branches/mishehu/configure.in	Mon Sep 18 11:45:43 2006
@@ -34,7 +34,7 @@
 AC_FUNC_MALLOC
 AC_TYPE_SIGNAL
 AC_FUNC_STRFTIME
-AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall])
+AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep])
 
 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/mishehu/libs/codec/g726/configure
==============================================================================
--- freeswitch/branches/mishehu/libs/codec/g726/configure	(original)
+++ freeswitch/branches/mishehu/libs/codec/g726/configure	Mon Sep 18 11:45:43 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
@@ -3233,7 +3233,7 @@
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
 # along with /bin/sed that truncates output.
 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
+  test ! -f $lt_ac_sed && break
   cat /dev/null > conftest.in
   lt_ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
@@ -3338,7 +3338,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 variants of GNU ld only accept -v.
+      # but apparently some GNU ld's 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'*)
@@ -3372,7 +3372,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 lds only accept -v.
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
 case `$LD -v 2>&1 </dev/null` in
 *GNU* | *'with BFD'*)
   lt_cv_prog_gnu_ld=yes
@@ -3520,13 +3520,13 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-freebsd* | kfreebsd*-gnu | dragonfly*)
+freebsd* | kfreebsd*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     case $host_cpu in
     i*86 )
       # Not sure whether the presence of OpenBSD here was a mistake.
       # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
       lt_cv_file_magic_cmd=/usr/bin/file
       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
       ;;
@@ -3542,7 +3542,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
@@ -3731,7 +3731,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*)
@@ -5457,33 +5457,20 @@
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+  netbsd* | freebsd* | openbsd* | darwin* )
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
     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 all BSDs
+      lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
     fi
     # And add a safety zone
     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     ;;
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # 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 ;;
-      esac
-    fi
-    ;;
-  *)
+
+ *)
     # If test is not a shell built-in, we'll probably end up computing a
     # maximum length that is only half of the actual maximum length, but
     # we can't tell.
@@ -5534,6 +5521,9 @@
 # Regexp to match symbols that can be accessed directly from C.
 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
 
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
 # Transform an extracted symbol line into a proper C declaration
 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
 
@@ -5593,11 +5583,8 @@
 # Try without a prefix undercore, then with it.
 for ac_symprfx in "" "_"; do
 
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
-
   # Write the raw and C identifiers.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
 
   # Check to see that the pipe works correctly.
   pipe_works=no
@@ -5759,7 +5746,7 @@
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
+Xsed='sed -e s/^X//'
 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
 
 # Same as above, but do not quote variable references.
@@ -5779,7 +5766,7 @@
 default_ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a `.a' archive for static linking (except M$VC,
 # which needs '.lib').
 libext=a
 ltmain="$ac_aux_dir/ltmain.sh"
@@ -6064,17 +6051,8 @@
   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 fi
 
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
 
-
 # Only perform the check for file, if the check method requires it
 case $deplibs_check_method in
 file_magic*)
@@ -6100,7 +6078,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
@@ -6162,7 +6140,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
@@ -6261,20 +6239,6 @@
 compiler=$CC
 
 
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
 #
 # Check for any special shared library compilation flags.
 #
@@ -6311,16 +6275,11 @@
    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 linker can only warn and ignore the option if not recognized
+     # The compiler 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.
        cat conftest.err 1>&5
-       $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
-       $SED '/^$/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_prog_compiler_static_works=yes
-       fi
      else
        lt_prog_compiler_static_works=yes
      fi
@@ -6362,20 +6321,18 @@
    # 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}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6368: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6327: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6372: \$? = $ac_status" >&5
+   echo "$as_me:6331: \$? = $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.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
        lt_cv_prog_compiler_rtti_exceptions=yes
      fi
    fi
@@ -6452,7 +6409,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
 	;;
@@ -6481,7 +6438,7 @@
       darwin*)
         # PIC is the default on this platform
         # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
+       case "$cc_basename" in
          xlc*)
          lt_prog_compiler_pic='-qnocommon'
          lt_prog_compiler_wl='-Wl,'
@@ -6499,7 +6456,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
 	;;
@@ -6523,19 +6480,12 @@
       ;;
 
     linux*)
-      case $cc_basename in
+      case $CC in
       icc* | ecc*)
 	lt_prog_compiler_wl='-Wl,'
 	lt_prog_compiler_pic='-KPIC'
 	lt_prog_compiler_static='-static'
         ;;
-      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='-Bstatic'
-        ;;
       ccc*)
         lt_prog_compiler_wl='-Wl,'
         # All Alpha code is PIC.
@@ -6556,14 +6506,9 @@
       ;;
 
     solaris*)
+      lt_prog_compiler_wl='-Wl,'
       lt_prog_compiler_pic='-KPIC'
       lt_prog_compiler_static='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	lt_prog_compiler_wl='-Qoption ld ';;
-      *)
-	lt_prog_compiler_wl='-Wl,';;
-      esac
       ;;
 
     sunos4*)
@@ -6585,11 +6530,6 @@
       fi
       ;;
 
-    unicos*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_can_build_shared=no
-      ;;
-
     uts4*)
       lt_prog_compiler_pic='-pic'
       lt_prog_compiler_static='-Bstatic'
@@ -6624,20 +6564,18 @@
    # 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}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6630: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6570: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6634: \$? = $ac_status" >&5
+   echo "$as_me:6574: \$? = $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.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
        lt_prog_compiler_pic_works=yes
      fi
    fi
@@ -6658,7 +6596,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=
@@ -6686,25 +6624,23 @@
    # 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}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6692: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6630: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:6696: \$? = $ac_status" >&5
+   echo "$as_me:6634: \$? = $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
      # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
-     $SED '/^$/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+     if test ! -s out/conftest.err; then
        lt_cv_prog_compiler_c_o=yes
      fi
    fi
-   chmod u+w . 2>&5
+   chmod u+w .
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -6780,16 +6716,6 @@
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
   extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
   case $host_os in
   cygwin* | mingw* | pw32*)
@@ -6810,27 +6736,6 @@
     # 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.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 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*)
@@ -6881,7 +6786,7 @@
       allow_undefined_flag=unsupported
       always_export_symbols=no
       enable_shared_with_static_runtimes=yes
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
@@ -6899,37 +6804,6 @@
       fi
       ;;
 
-    linux*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	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'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	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' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	esac
-	archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-	if test $supports_anon_versioning = yes; then
-	  archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
-      else
-	ld_shlibs=no
-      fi
-      ;;
-
     netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
@@ -6968,6 +6842,31 @@
       hardcode_shlibpath_var=no
       ;;
 
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds="$tmp_archive_cmds"
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` in
+        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+        *\ 2.11.*) ;; # other 2.11 versions
+        *) supports_anon_versioning=yes ;;
+      esac
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds="$tmp_archive_cmds"
+      fi
+    else
+      ld_shlibs=no
+    fi
+    ;;
+
     *)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -6978,11 +6877,16 @@
       ;;
     esac
 
-    if test "$ld_shlibs" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec=
-      export_dynamic_flag_spec=
-      whole_archive_flag_spec=
+    if test "$ld_shlibs" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec='${wl}--export-dynamic'
+      # ancient GNU ld didn't support --whole-archive et. al.
+      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ 	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec=
+      fi
     fi
   else
     # PORTME fill in a description of your system's linker (not GNU ld)
@@ -7046,7 +6950,7 @@
       link_all_deplibs=yes
 
       if test "$GCC" = yes; then
-	case $host_os in aix4.[012]|aix4.[012].*)
+	case $host_os in aix4.012|aix4.012.*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
 	  collect2name=`${CC} -print-prog-name=collect2`
@@ -7067,9 +6971,6 @@
 	  fi
 	esac
 	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -7216,7 +7117,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 its shared libraries.
+	  # This is similar to how AIX traditionally builds it's 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
@@ -7256,7 +7157,7 @@
       ;;
 
     darwin* | rhapsody*)
-      case $host_os in
+      case "$host_os" in
         rhapsody* | darwin1.[012])
          allow_undefined_flag='${wl}-undefined ${wl}suppress'
          ;;
@@ -7285,16 +7186,16 @@
     	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 lds
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
       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
-      case $cc_basename in
+      case "$cc_basename" in
         xlc*)
          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 lds
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
          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}'
           ;;
@@ -7335,7 +7236,7 @@
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu | dragonfly*)
+    freebsd* | kfreebsd*-gnu)
       archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_direct=yes
@@ -7360,7 +7261,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'
 	  ;;
@@ -7369,7 +7270,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'
 	  ;;
@@ -7379,7 +7280,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'
@@ -7492,7 +7393,7 @@
 	allow_undefined_flag=' -expect_unresolved \*'
 	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec='-rpath $libdir'
@@ -7511,12 +7412,10 @@
     solaris*)
       no_undefined_flag=' -z text'
       if test "$GCC" = yes; then
-	wlarc='${wl}'
 	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
       else
-	wlarc=''
 	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
   	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
@@ -7525,18 +7424,8 @@
       hardcode_shlibpath_var=no
       case $host_os in
       solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
- 	# The compiler driver will combine linker options so we
- 	# cannot just pass the convience library names through
- 	# without $wl, iff we do not link with $LD.
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
- 	case $wlarc in
- 	'')
- 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
- 	*)
- 	  whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- 	esac ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
       esac
       link_all_deplibs=yes
       ;;
@@ -7838,8 +7727,7 @@
       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~
-      chmod a+x \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -7869,7 +7757,7 @@
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -7892,7 +7780,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"`
@@ -7927,17 +7815,8 @@
   dynamic_linker='GNU ld.so'
   ;;
 
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[123]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -7955,7 +7834,7 @@
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
+  freebsd3.01* | freebsdelf3.01*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -7982,7 +7861,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
@@ -8081,7 +7960,7 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -8144,11 +8023,7 @@
 openbsd*)
   version_type=sunos
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
+  need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
@@ -8937,7 +8812,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 8940 "configure"
+#line 8815 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9003,7 +8878,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
+    (./conftest; exit; ) 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
@@ -9035,7 +8910,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9038 "configure"
+#line 8913 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9101,7 +8976,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
+    (./conftest; exit; ) 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
@@ -9151,7 +9026,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
@@ -9293,7 +9168,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -9304,7 +9179,7 @@
 SED=$lt_SED
 
 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
+Xsed="$SED -e s/^X//"
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
@@ -9338,13 +9213,7 @@
 # The host system.
 host_alias=$host_alias
 host=$host
-host_os=$host_os
 
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
 
@@ -9420,7 +9289,7 @@
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o
 
-# Must we lock files when doing compilation?
+# Must we lock files when doing compilation ?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -9754,7 +9623,7 @@
 compiler_lib_search_path_CXX=
 
 # Source file extension for C++ test sources.
-ac_ext=cpp
+ac_ext=cc
 
 # Object file extension for compiled C++ test sources.
 objext=o
@@ -9775,20 +9644,6 @@
 compiler=$CC
 
 
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
 # Allow CC to be a program name with arguments.
 lt_save_CC=$CC
 lt_save_LD=$LD
@@ -9810,17 +9665,8 @@
 CC=${CXX-"c++"}
 compiler=$CC
 compiler_CXX=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
 
-
 # We don't want -fno-exception wen compiling C++ code, so set the
 # no_builtin_flag separately
 if test "$GXX" = yes; then
@@ -9890,7 +9736,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 variants of GNU ld only accept -v.
+      # but apparently some GNU ld's 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'*)
@@ -9924,7 +9770,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 lds only accept -v.
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
 case `$LD -v 2>&1 </dev/null` in
 *GNU* | *'with BFD'*)
   lt_cv_prog_gnu_ld=yes
@@ -10033,7 +9879,7 @@
     link_all_deplibs_CXX=yes
 
     if test "$GXX" = yes; then
-      case $host_os in aix4.[012]|aix4.[012].*)
+      case $host_os in aix4.012|aix4.012.*)
       # We only want to do this on AIX 4.2 and lower, the check
       # below for broken collect2 doesn't work under 4.3+
 	collect2name=`${CC} -print-prog-name=collect2`
@@ -10054,9 +9900,6 @@
 	fi
       esac
       shared_flag='-shared'
-      if test "$aix_use_runtimelinking" = yes; then
-	shared_flag="$shared_flag "'${wl}-G'
-      fi
     else
       # not using gcc
       if test "$host_cpu" = ia64; then
@@ -10204,7 +10047,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 its shared libraries.
+	# This is similar to how AIX traditionally builds it's 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
@@ -10243,7 +10086,7 @@
     fi
   ;;
       darwin* | rhapsody*)
-        case $host_os in
+        case "$host_os" in
         rhapsody* | darwin1.[012])
          allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
          ;;
@@ -10281,7 +10124,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 lds
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
           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
@@ -10289,12 +10132,12 @@
           fi
             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}'
       else
-      case $cc_basename in
+      case "$cc_basename" in
         xlc*)
          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 lds
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
           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}'
           ;;
@@ -10307,11 +10150,11 @@
 
   dgux*)
     case $cc_basename in
-      ec++*)
+      ec++)
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      ghcx*)
+      ghcx)
 	# Green Hills C++ Compiler
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
@@ -10322,14 +10165,14 @@
 	;;
     esac
     ;;
-  freebsd[12]*)
+  freebsd12*)
     # C++ shared libraries reported to be fairly broken before switch to ELF
     ld_shlibs_CXX=no
     ;;
   freebsd-elf*)
     archive_cmds_need_lc_CXX=no
     ;;
-  freebsd* | kfreebsd*-gnu | dragonfly*)
+  freebsd* | kfreebsd*-gnu)
     # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
     # conventions
     ld_shlibs_CXX=yes
@@ -10346,11 +10189,11 @@
 				# location of the library.
 
     case $cc_basename in
-    CC*)
+    CC)
       # FIXME: insert proper C++ library support
       ld_shlibs_CXX=no
       ;;
-    aCC*)
+    aCC)
       archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       # Commands to make compiler produce verbose output that lists
       # what "hidden" libraries, object files and flags are used when
@@ -10360,7 +10203,7 @@
       # 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 -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; 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='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
       ;;
     *)
       if test "$GXX" = yes; then
@@ -10374,7 +10217,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'
@@ -10390,7 +10233,7 @@
         ;;
       esac
     fi
-    case $host_cpu in
+    case "$host_cpu" in
     hppa*64*)
       hardcode_direct_CXX=no
       hardcode_shlibpath_var_CXX=no
@@ -10411,12 +10254,12 @@
     esac
 
     case $cc_basename in
-      CC*)
+      CC)
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      aCC*)
-	case $host_cpu in
+      aCC)
+	case "$host_cpu" in
 	hppa*64*|ia64*)
 	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
 	  ;;
@@ -10437,7 +10280,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'
 	      ;;
@@ -10455,9 +10298,9 @@
     ;;
   irix5* | irix6*)
     case $cc_basename in
-      CC*)
+      CC)
 	# SGI C++
-	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
 
 	# Archives containing C++ object files must be created using
 	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -10468,7 +10311,7 @@
       *)
 	if test "$GXX" = yes; then
 	  if test "$with_gnu_ld" = no; then
-	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
 	  else
 	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
 	  fi
@@ -10481,7 +10324,7 @@
     ;;
   linux*)
     case $cc_basename in
-      KCC*)
+      KCC)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -10506,7 +10349,7 @@
 	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
 	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
 	;;
-      icpc*)
+      icpc)
 	# Intel C++
 	with_gnu_ld=yes
 	# version 8.0 and above of icpc choke on multiply defined symbols
@@ -10518,12 +10361,8 @@
   	  archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 	  ;;
 	*)  # Version 8.0 or newer
-	  tmp_idyn=
-	  case $host_cpu in
-	    ia64*) tmp_idyn=' -i_dynamic';;
-	  esac
-  	  archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	  archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+  	  archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+  	archive_expsym_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 	  ;;
 	esac
 	archive_cmds_need_lc_CXX=no
@@ -10531,16 +10370,7 @@
 	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
 	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
 	;;
-      pgCC*)
-        # Portland Group C++ compiler
-	archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-  	archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
-	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'
-        ;;
-      cxx*)
+      cxx)
 	# Compaq C++
 	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
@@ -10571,7 +10401,7 @@
     ;;
   mvs*)
     case $cc_basename in
-      cxx*)
+      cxx)
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
@@ -10610,7 +10440,7 @@
     ;;
   osf3*)
     case $cc_basename in
-      KCC*)
+      KCC)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -10626,14 +10456,14 @@
 	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
 
 	;;
-      RCC*)
+      RCC)
 	# Rational C++ 2.4.1
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      cxx*)
+      cxx)
 	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
 
 	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
 	hardcode_libdir_separator_CXX=:
@@ -10651,7 +10481,7 @@
       *)
 	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
 
 	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
 	  hardcode_libdir_separator_CXX=:
@@ -10670,7 +10500,7 @@
     ;;
   osf4* | osf5*)
     case $cc_basename in
-      KCC*)
+      KCC)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -10685,17 +10515,17 @@
 	# the KAI C++ compiler.
 	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
 	;;
-      RCC*)
+      RCC)
 	# Rational C++ 2.4.1
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      cxx*)
+      cxx)
 	allow_undefined_flag_CXX=' -expect_unresolved \*'
-	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
 	archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
 	  echo "-hidden">> $lib.exp~
-	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
 	  $rm $lib.exp'
 
 	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
@@ -10714,7 +10544,7 @@
       *)
 	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
 
 	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
 	  hardcode_libdir_separator_CXX=:
@@ -10738,7 +10568,7 @@
   sco*)
     archive_cmds_need_lc_CXX=no
     case $cc_basename in
-      CC*)
+      CC)
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
@@ -10750,12 +10580,12 @@
     ;;
   sunos4*)
     case $cc_basename in
-      CC*)
+      CC)
 	# Sun C++ 4.x
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      lcc*)
+      lcc)
 	# Lucid
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
@@ -10768,33 +10598,36 @@
     ;;
   solaris*)
     case $cc_basename in
-      CC*)
+      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}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -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}  ${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} -nolib ${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
 	case $host_os in
-	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  solaris2.0-5 | solaris2.0-5.*) ;;
 	  *)
 	    # The C++ compiler is used as linker so we must use $wl
 	    # flag to pass the commands to the underlying system
-	    # linker. We must also pass each convience library through
-	    # to the system linker between allextract/defaultextract.
-	    # The C++ compiler will combine linker options so we
-	    # cannot just pass the convience library names through
-	    # without $wl.
+	    # linker.
 	    # Supported since Solaris 2.6 (maybe 2.5.1?)
-	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
 	    ;;
 	esac
 	link_all_deplibs_CXX=yes
 
-	output_verbose_link_cmd='echo'
+	# 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'
 
 	# Archives containing C++ object files must be created using
 	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -10802,7 +10635,7 @@
 	# in the archive.
 	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
 	;;
-      gcx*)
+      gcx)
 	# Green Hills C++ Compiler
 	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
@@ -10845,7 +10678,7 @@
     ;;
   tandem*)
     case $cc_basename in
-      NCC*)
+      NCC)
 	# NonStop-UX NCC 3.20
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
@@ -10898,7 +10731,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
@@ -10974,20 +10807,6 @@
 
 $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
@@ -11043,7 +10862,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*)
 	;;
       *)
@@ -11068,7 +10887,7 @@
 	;;
       chorus*)
 	case $cc_basename in
-	cxch68*)
+	cxch68)
 	  # Green Hills C++ Compiler
 	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
 	  ;;
@@ -11077,7 +10896,7 @@
        darwin*)
          # PIC is the default on this platform
          # Common symbols not allowed in MH_DYLIB files
-         case $cc_basename in
+         case "$cc_basename" in
            xlc*)
            lt_prog_compiler_pic_CXX='-qnocommon'
            lt_prog_compiler_wl_CXX='-Wl,'
@@ -11086,10 +10905,10 @@
        ;;
       dgux*)
 	case $cc_basename in
-	  ec++*)
+	  ec++)
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    ;;
-	  ghcx*)
+	  ghcx)
 	    # Green Hills C++ Compiler
 	    lt_prog_compiler_pic_CXX='-pic'
 	    ;;
@@ -11097,22 +10916,22 @@
 	    ;;
 	esac
 	;;
-      freebsd* | kfreebsd*-gnu | dragonfly*)
+      freebsd* | kfreebsd*-gnu)
 	# FreeBSD uses GNU C++
 	;;
       hpux9* | hpux10* | hpux11*)
 	case $cc_basename in
-	  CC*)
+	  CC)
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
 	    if test "$host_cpu" != ia64; then
 	      lt_prog_compiler_pic_CXX='+Z'
 	    fi
 	    ;;
-	  aCC*)
+	  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
 	      ;;
@@ -11127,7 +10946,7 @@
 	;;
       irix5* | irix6* | nonstopux*)
 	case $cc_basename in
-	  CC*)
+	  CC)
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_static_CXX='-non_shared'
 	    # CC pic flag -KPIC is the default.
@@ -11138,24 +10957,18 @@
 	;;
       linux*)
 	case $cc_basename in
-	  KCC*)
+	  KCC)
 	    # KAI C++ Compiler
 	    lt_prog_compiler_wl_CXX='--backend -Wl,'
 	    lt_prog_compiler_pic_CXX='-fPIC'
 	    ;;
-	  icpc* | ecpc*)
+	  icpc)
 	    # Intel C++
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    lt_prog_compiler_static_CXX='-static'
 	    ;;
-	  pgCC*)
-	    # Portland Group C++ compiler.
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-fpic'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    ;;
-	  cxx*)
+	  cxx)
 	    # Compaq C++
 	    # Make sure the PIC flag is empty.  It appears that all Alpha
 	    # Linux and Compaq Tru64 Unix objects are PIC.
@@ -11172,7 +10985,7 @@
 	;;
       mvs*)
 	case $cc_basename in
-	  cxx*)
+	  cxx)
 	    lt_prog_compiler_pic_CXX='-W c,exportall'
 	    ;;
 	  *)
@@ -11183,14 +10996,14 @@
 	;;
       osf3* | osf4* | osf5*)
 	case $cc_basename in
-	  KCC*)
+	  KCC)
 	    lt_prog_compiler_wl_CXX='--backend -Wl,'
 	    ;;
-	  RCC*)
+	  RCC)
 	    # Rational C++ 2.4.1
 	    lt_prog_compiler_pic_CXX='-pic'
 	    ;;
-	  cxx*)
+	  cxx)
 	    # Digital/Compaq C++
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    # Make sure the PIC flag is empty.  It appears that all Alpha
@@ -11206,7 +11019,7 @@
 	;;
       sco*)
 	case $cc_basename in
-	  CC*)
+	  CC)
 	    lt_prog_compiler_pic_CXX='-fPIC'
 	    ;;
 	  *)
@@ -11215,13 +11028,13 @@
 	;;
       solaris*)
 	case $cc_basename in
-	  CC*)
+	  CC)
 	    # Sun C++ 4.2, 5.x and Centerline C++
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    lt_prog_compiler_static_CXX='-Bstatic'
 	    lt_prog_compiler_wl_CXX='-Qoption ld '
 	    ;;
-	  gcx*)
+	  gcx)
 	    # Green Hills C++ Compiler
 	    lt_prog_compiler_pic_CXX='-PIC'
 	    ;;
@@ -11231,12 +11044,12 @@
 	;;
       sunos4*)
 	case $cc_basename in
-	  CC*)
+	  CC)
 	    # Sun C++ 4.x
 	    lt_prog_compiler_pic_CXX='-pic'
 	    lt_prog_compiler_static_CXX='-Bstatic'
 	    ;;
-	  lcc*)
+	  lcc)
 	    # Lucid
 	    lt_prog_compiler_pic_CXX='-pic'
 	    ;;
@@ -11246,7 +11059,7 @@
 	;;
       tandem*)
 	case $cc_basename in
-	  NCC*)
+	  NCC)
 	    # NonStop-UX NCC 3.20
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    ;;
@@ -11287,20 +11100,18 @@
    # 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}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11293: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11106: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11297: \$? = $ac_status" >&5
+   echo "$as_me:11110: \$? = $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.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
        lt_prog_compiler_pic_works_CXX=yes
      fi
    fi
@@ -11321,7 +11132,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=
@@ -11349,25 +11160,23 @@
    # 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}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11355: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11166: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11359: \$? = $ac_status" >&5
+   echo "$as_me:11170: \$? = $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
      # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
-     $SED '/^$/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+     if test ! -s out/conftest.err; then
        lt_cv_prog_compiler_c_o_CXX=yes
      fi
    fi
-   chmod u+w . 2>&5
+   chmod u+w .
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -11422,7 +11231,7 @@
     export_symbols_cmds_CXX="$ltdll_cmds"
   ;;
   cygwin* | mingw*)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
   *)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
@@ -11630,8 +11439,7 @@
       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~
-      chmod a+x \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -11661,7 +11469,7 @@
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -11684,7 +11492,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"`
@@ -11719,17 +11527,8 @@
   dynamic_linker='GNU ld.so'
   ;;
 
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[123]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -11747,7 +11546,7 @@
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
+  freebsd3.01* | freebsdelf3.01*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -11774,7 +11573,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
@@ -11873,7 +11672,7 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -11936,11 +11735,7 @@
 openbsd*)
   version_type=sunos
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
+  need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
@@ -12729,7 +12524,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12732 "configure"
+#line 12527 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12795,7 +12590,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
+    (./conftest; exit; ) 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
@@ -12827,7 +12622,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12830 "configure"
+#line 12625 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12893,7 +12688,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
+    (./conftest; exit; ) 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
@@ -13045,13 +12840,7 @@
 # The host system.
 host_alias=$host_alias
 host=$host
-host_os=$host_os
 
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
 
@@ -13127,7 +12916,7 @@
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
 
-# Must we lock files when doing compilation?
+# Must we lock files when doing compilation ?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -13408,36 +13197,13 @@
 compiler=$CC
 
 
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${F77-"f77"}
 compiler=$CC
 compiler_F77=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
 
-
 echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
 echo "$as_me:$LINENO: result: $can_build_shared" >&5
@@ -13449,7 +13215,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
@@ -13458,9 +13224,7 @@
   fi
   ;;
 aix4* | aix5*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
+  test "$enable_shared" = yes && enable_static=no
   ;;
 esac
 echo "$as_me:$LINENO: result: $enable_shared" >&5
@@ -13537,7 +13301,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
 	;;
@@ -13566,7 +13330,7 @@
       darwin*)
         # PIC is the default on this platform
         # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
+       case "$cc_basename" in
          xlc*)
          lt_prog_compiler_pic_F77='-qnocommon'
          lt_prog_compiler_wl_F77='-Wl,'
@@ -13584,7 +13348,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
 	;;
@@ -13608,19 +13372,12 @@
       ;;
 
     linux*)
-      case $cc_basename in
+      case $CC in
       icc* | ecc*)
 	lt_prog_compiler_wl_F77='-Wl,'
 	lt_prog_compiler_pic_F77='-KPIC'
 	lt_prog_compiler_static_F77='-static'
         ;;
-      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='-Bstatic'
-        ;;
       ccc*)
         lt_prog_compiler_wl_F77='-Wl,'
         # All Alpha code is PIC.
@@ -13641,14 +13398,9 @@
       ;;
 
     solaris*)
+      lt_prog_compiler_wl_F77='-Wl,'
       lt_prog_compiler_pic_F77='-KPIC'
       lt_prog_compiler_static_F77='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	lt_prog_compiler_wl_F77='-Qoption ld ';;
-      *)
-	lt_prog_compiler_wl_F77='-Wl,';;
-      esac
       ;;
 
     sunos4*)
@@ -13670,11 +13422,6 @@
       fi
       ;;
 
-    unicos*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      lt_prog_compiler_can_build_shared_F77=no
-      ;;
-
     uts4*)
       lt_prog_compiler_pic_F77='-pic'
       lt_prog_compiler_static_F77='-Bstatic'
@@ -13709,20 +13456,18 @@
    # 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}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13715: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13462: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13719: \$? = $ac_status" >&5
+   echo "$as_me:13466: \$? = $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.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
        lt_prog_compiler_pic_works_F77=yes
      fi
    fi
@@ -13743,7 +13488,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=
@@ -13771,25 +13516,23 @@
    # 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}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13777: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13522: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13781: \$? = $ac_status" >&5
+   echo "$as_me:13526: \$? = $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
      # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
-     $SED '/^$/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+     if test ! -s out/conftest.err; then
        lt_cv_prog_compiler_c_o_F77=yes
      fi
    fi
-   chmod u+w . 2>&5
+   chmod u+w .
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -13865,16 +13608,6 @@
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
   extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
   case $host_os in
   cygwin* | mingw* | pw32*)
@@ -13895,27 +13628,6 @@
     # 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.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec_F77='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec_F77=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 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*)
@@ -13966,7 +13678,7 @@
       allow_undefined_flag_F77=unsupported
       always_export_symbols_F77=no
       enable_shared_with_static_runtimes_F77=yes
-      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
@@ -13980,41 +13692,10 @@
 	fi~
 	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
       else
-	ld_shlibs_F77=no
+	ld_shlibs=no
       fi
       ;;
 
-    linux*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	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'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	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' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	esac
-	archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-	if test $supports_anon_versioning = yes; then
-	  archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
     netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
@@ -14053,6 +13734,31 @@
       hardcode_shlibpath_var_F77=no
       ;;
 
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds_F77="$tmp_archive_cmds"
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` in
+        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+        *\ 2.11.*) ;; # other 2.11 versions
+        *) supports_anon_versioning=yes ;;
+      esac
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds_F77="$tmp_archive_cmds"
+      fi
+    else
+      ld_shlibs_F77=no
+    fi
+    ;;
+
     *)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -14063,11 +13769,16 @@
       ;;
     esac
 
-    if test "$ld_shlibs_F77" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec_F77=
-      export_dynamic_flag_spec_F77=
-      whole_archive_flag_spec_F77=
+    if test "$ld_shlibs_F77" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+      # ancient GNU ld didn't support --whole-archive et. al.
+      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ 	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_F77=
+      fi
     fi
   else
     # PORTME fill in a description of your system's linker (not GNU ld)
@@ -14131,7 +13842,7 @@
       link_all_deplibs_F77=yes
 
       if test "$GCC" = yes; then
-	case $host_os in aix4.[012]|aix4.[012].*)
+	case $host_os in aix4.012|aix4.012.*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
 	  collect2name=`${CC} -print-prog-name=collect2`
@@ -14152,9 +13863,6 @@
 	  fi
 	esac
 	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -14281,7 +13989,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 its shared libraries.
+	  # This is similar to how AIX traditionally builds it's 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
@@ -14316,12 +14024,12 @@
       old_archive_From_new_cmds_F77='true'
       # FIXME: Should let the user specify the lib program.
       old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
       enable_shared_with_static_runtimes_F77=yes
       ;;
 
     darwin* | rhapsody*)
-      case $host_os in
+      case "$host_os" in
         rhapsody* | darwin1.[012])
          allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
          ;;
@@ -14350,16 +14058,16 @@
     	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 lds
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
       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
-      case $cc_basename in
+      case "$cc_basename" in
         xlc*)
          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 lds
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
          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}'
           ;;
@@ -14400,7 +14108,7 @@
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu | dragonfly*)
+    freebsd* | kfreebsd*-gnu)
       archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec_F77='-R$libdir'
       hardcode_direct_F77=yes
@@ -14425,7 +14133,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'
 	  ;;
@@ -14434,7 +14142,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'
 	  ;;
@@ -14444,7 +14152,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'
@@ -14557,7 +14265,7 @@
 	allow_undefined_flag_F77=' -expect_unresolved \*'
 	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec_F77='-rpath $libdir'
@@ -14576,12 +14284,10 @@
     solaris*)
       no_undefined_flag_F77=' -z text'
       if test "$GCC" = yes; then
-	wlarc='${wl}'
 	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
       else
-	wlarc=''
 	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
   	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
@@ -14590,18 +14296,8 @@
       hardcode_shlibpath_var_F77=no
       case $host_os in
       solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
- 	# The compiler driver will combine linker options so we
- 	# cannot just pass the convience library names through
- 	# without $wl, iff we do not link with $LD.
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
- 	case $wlarc in
- 	'')
- 	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
- 	*)
- 	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- 	esac ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
       esac
       link_all_deplibs_F77=yes
       ;;
@@ -14903,8 +14599,7 @@
       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~
-      chmod a+x \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -14934,7 +14629,7 @@
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -14957,7 +14652,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"`
@@ -14992,17 +14687,8 @@
   dynamic_linker='GNU ld.so'
   ;;
 
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[123]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -15020,7 +14706,7 @@
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
+  freebsd3.01* | freebsdelf3.01*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -15047,7 +14733,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
@@ -15146,7 +14832,7 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -15209,11 +14895,7 @@
 openbsd*)
   version_type=sunos
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
+  need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
@@ -15513,13 +15195,7 @@
 # The host system.
 host_alias=$host_alias
 host=$host
-host_os=$host_os
 
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
 
@@ -15595,7 +15271,7 @@
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
 
-# Must we lock files when doing compilation?
+# Must we lock files when doing compilation ?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -15833,7 +15509,7 @@
 lt_simple_compile_test_code="class foo {}\n"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
@@ -15844,42 +15520,16 @@
 compiler=$CC
 
 
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${GCJ-"gcj"}
 compiler=$CC
 compiler_GCJ=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
-
 # GCJ did not exist at the time GCC didn't implicitly link libc in.
 archive_cmds_need_lc_GCJ=no
 
-old_archive_cmds_GCJ=$old_archive_cmds
 
-
 lt_prog_compiler_no_builtin_flag_GCJ=
 
 if test "$GCC" = yes; then
@@ -15901,20 +15551,18 @@
    # 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}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15907: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15557: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15911: \$? = $ac_status" >&5
+   echo "$as_me:15561: \$? = $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.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
        lt_cv_prog_compiler_rtti_exceptions=yes
      fi
    fi
@@ -15991,7 +15639,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
 	;;
@@ -16020,7 +15668,7 @@
       darwin*)
         # PIC is the default on this platform
         # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
+       case "$cc_basename" in
          xlc*)
          lt_prog_compiler_pic_GCJ='-qnocommon'
          lt_prog_compiler_wl_GCJ='-Wl,'
@@ -16038,7 +15686,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
 	;;
@@ -16062,19 +15710,12 @@
       ;;
 
     linux*)
-      case $cc_basename in
+      case $CC in
       icc* | ecc*)
 	lt_prog_compiler_wl_GCJ='-Wl,'
 	lt_prog_compiler_pic_GCJ='-KPIC'
 	lt_prog_compiler_static_GCJ='-static'
         ;;
-      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='-Bstatic'
-        ;;
       ccc*)
         lt_prog_compiler_wl_GCJ='-Wl,'
         # All Alpha code is PIC.
@@ -16095,14 +15736,9 @@
       ;;
 
     solaris*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
       lt_prog_compiler_pic_GCJ='-KPIC'
       lt_prog_compiler_static_GCJ='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	lt_prog_compiler_wl_GCJ='-Qoption ld ';;
-      *)
-	lt_prog_compiler_wl_GCJ='-Wl,';;
-      esac
       ;;
 
     sunos4*)
@@ -16124,11 +15760,6 @@
       fi
       ;;
 
-    unicos*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      lt_prog_compiler_can_build_shared_GCJ=no
-      ;;
-
     uts4*)
       lt_prog_compiler_pic_GCJ='-pic'
       lt_prog_compiler_static_GCJ='-Bstatic'
@@ -16163,20 +15794,18 @@
    # 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}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16169: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15800: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16173: \$? = $ac_status" >&5
+   echo "$as_me:15804: \$? = $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.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
        lt_prog_compiler_pic_works_GCJ=yes
      fi
    fi
@@ -16197,7 +15826,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=
@@ -16225,25 +15854,23 @@
    # 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}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16231: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15860: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16235: \$? = $ac_status" >&5
+   echo "$as_me:15864: \$? = $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
      # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
-     $SED '/^$/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+     if test ! -s out/conftest.err; then
        lt_cv_prog_compiler_c_o_GCJ=yes
      fi
    fi
-   chmod u+w . 2>&5
+   chmod u+w .
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -16319,16 +15946,6 @@
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
   extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
   case $host_os in
   cygwin* | mingw* | pw32*)
@@ -16349,27 +15966,6 @@
     # 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.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec_GCJ=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 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*)
@@ -16420,7 +16016,7 @@
       allow_undefined_flag_GCJ=unsupported
       always_export_symbols_GCJ=no
       enable_shared_with_static_runtimes_GCJ=yes
-      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
@@ -16434,41 +16030,10 @@
 	fi~
 	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
       else
-	ld_shlibs_GCJ=no
+	ld_shlibs=no
       fi
       ;;
 
-    linux*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	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'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	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' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	esac
-	archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-	if test $supports_anon_versioning = yes; then
-	  archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
-
     netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
@@ -16507,6 +16072,31 @@
       hardcode_shlibpath_var_GCJ=no
       ;;
 
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds_GCJ="$tmp_archive_cmds"
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` in
+        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+        *\ 2.11.*) ;; # other 2.11 versions
+        *) supports_anon_versioning=yes ;;
+      esac
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds_GCJ="$tmp_archive_cmds"
+      fi
+    else
+      ld_shlibs_GCJ=no
+    fi
+    ;;
+
     *)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -16517,11 +16107,16 @@
       ;;
     esac
 
-    if test "$ld_shlibs_GCJ" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec_GCJ=
-      export_dynamic_flag_spec_GCJ=
-      whole_archive_flag_spec_GCJ=
+    if test "$ld_shlibs_GCJ" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
+      # ancient GNU ld didn't support --whole-archive et. al.
+      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ 	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_GCJ=
+      fi
     fi
   else
     # PORTME fill in a description of your system's linker (not GNU ld)
@@ -16585,7 +16180,7 @@
       link_all_deplibs_GCJ=yes
 
       if test "$GCC" = yes; then
-	case $host_os in aix4.[012]|aix4.[012].*)
+	case $host_os in aix4.012|aix4.012.*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
 	  collect2name=`${CC} -print-prog-name=collect2`
@@ -16606,9 +16201,6 @@
 	  fi
 	esac
 	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -16755,7 +16347,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 its shared libraries.
+	  # This is similar to how AIX traditionally builds it's 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
@@ -16790,12 +16382,12 @@
       old_archive_From_new_cmds_GCJ='true'
       # FIXME: Should let the user specify the lib program.
       old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
       enable_shared_with_static_runtimes_GCJ=yes
       ;;
 
     darwin* | rhapsody*)
-      case $host_os in
+      case "$host_os" in
         rhapsody* | darwin1.[012])
          allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
          ;;
@@ -16824,16 +16416,16 @@
     	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 lds
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
       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
-      case $cc_basename in
+      case "$cc_basename" in
         xlc*)
          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 lds
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
          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}'
           ;;
@@ -16874,7 +16466,7 @@
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu | dragonfly*)
+    freebsd* | kfreebsd*-gnu)
       archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec_GCJ='-R$libdir'
       hardcode_direct_GCJ=yes
@@ -16899,7 +16491,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'
 	  ;;
@@ -16908,7 +16500,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'
 	  ;;
@@ -16918,7 +16510,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'
@@ -17031,7 +16623,7 @@
 	allow_undefined_flag_GCJ=' -expect_unresolved \*'
 	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
@@ -17050,12 +16642,10 @@
     solaris*)
       no_undefined_flag_GCJ=' -z text'
       if test "$GCC" = yes; then
-	wlarc='${wl}'
 	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
       else
-	wlarc=''
 	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
   	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
@@ -17064,18 +16654,8 @@
       hardcode_shlibpath_var_GCJ=no
       case $host_os in
       solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
- 	# The compiler driver will combine linker options so we
- 	# cannot just pass the convience library names through
- 	# without $wl, iff we do not link with $LD.
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
- 	case $wlarc in
- 	'')
- 	  whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
- 	*)
- 	  whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- 	esac ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
       esac
       link_all_deplibs_GCJ=yes
       ;;
@@ -17377,8 +16957,7 @@
       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~
-      chmod a+x \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -17408,7 +16987,7 @@
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -17431,7 +17010,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"`
@@ -17466,17 +17045,8 @@
   dynamic_linker='GNU ld.so'
   ;;
 
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[123]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -17494,7 +17064,7 @@
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
+  freebsd3.01* | freebsdelf3.01*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -17521,7 +17091,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
@@ -17620,7 +17190,7 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -17683,11 +17253,7 @@
 openbsd*)
   version_type=sunos
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
+  need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
@@ -18476,7 +18042,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18479 "configure"
+#line 18045 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18542,7 +18108,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
+    (./conftest; exit; ) 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
@@ -18574,7 +18140,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 18577 "configure"
+#line 18143 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18640,7 +18206,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
+    (./conftest; exit; ) 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
@@ -18792,13 +18358,7 @@
 # The host system.
 host_alias=$host_alias
 host=$host
-host_os=$host_os
 
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
 
@@ -18874,7 +18434,7 @@
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
 
-# Must we lock files when doing compilation?
+# Must we lock files when doing compilation ?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -19122,35 +18682,11 @@
 compiler=$CC
 
 
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${RC-"windres"}
 compiler=$CC
 compiler_RC=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
 lt_cv_prog_compiler_c_o_RC=yes
 
 # The else clause should only fire when bootstrapping the
@@ -19267,13 +18803,7 @@
 # The host system.
 host_alias=$host_alias
 host=$host
-host_os=$host_os
 
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
 
@@ -19349,7 +18879,7 @@
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
 
-# Must we lock files when doing compilation?
+# Must we lock files when doing compilation ?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?

Modified: freeswitch/branches/mishehu/libs/iax/src/iax.c
==============================================================================
--- freeswitch/branches/mishehu/libs/iax/src/iax.c	(original)
+++ freeswitch/branches/mishehu/libs/iax/src/iax.c	Mon Sep 18 11:45:43 2006
@@ -904,6 +904,7 @@
 	}
 	
 	if (netfd > -1) {
+		shutdown(netfd, 2);
 		close(netfd);
 	}
 

Modified: freeswitch/branches/mishehu/src/include/switch_am_config.h.in
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_am_config.h.in	(original)
+++ freeswitch/branches/mishehu/src/include/switch_am_config.h.in	Mon Sep 18 11:45:43 2006
@@ -64,6 +64,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have the `usleep' function. */
+#undef HAVE_USLEEP
+
 /* Define to 1 if you have the `vasprintf' function. */
 #undef HAVE_VASPRINTF
 

Modified: freeswitch/branches/mishehu/src/include/switch_apr.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_apr.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_apr.h	Mon Sep 18 11:45:43 2006
@@ -1053,6 +1053,9 @@
  /** number of microseconds since 00:00:00 january 1, 1970 UTC */
 typedef apr_time_t switch_time_t;
 
+ /** number of microseconds in the interval */
+typedef apr_interval_time_t switch_interval_time_t;
+
 /**
  * a structure similar to ANSI struct tm with the following differences:
  *  - tm_usec isn't an ANSI field

Modified: freeswitch/branches/mishehu/src/include/switch_core.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_core.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_core.h	Mon Sep 18 11:45:43 2006
@@ -788,6 +788,20 @@
 SWITCH_DECLARE(int) switch_core_timer_next(switch_timer_t *timer);
 
 /*! 
+  \brief Step the timer one step
+  \param timer the timer to wait on
+  \return the newest sample count
+*/
+SWITCH_DECLARE(switch_status_t) switch_core_timer_step(switch_timer_t *timer);
+
+/*! 
+  \brief Check if the current step has been exceeded
+  \param timer the timer to wait on
+  \return the newest sample count
+*/
+SWITCH_DECLARE(switch_status_t) switch_core_timer_check(switch_timer_t *timer);
+
+/*! 
   \brief Destroy an allocated timer
   \param timer timer to destroy
   \return SWITCH_STATUS_SUCCESS after destruction

Modified: freeswitch/branches/mishehu/src/include/switch_ivr.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_ivr.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_ivr.h	Mon Sep 18 11:45:43 2006
@@ -189,6 +189,7 @@
   \brief Make an outgoing call
   \param session originating session
   \param bleg B leg session
+  \param cause a pointer to hold call cause
   \param bridgeto the desired remote callstring
   \param timelimit_sec timeout in seconds for outgoing call
   \param table optional state handler table to install on the channel
@@ -199,6 +200,7 @@
 */
 SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *session,
 													 switch_core_session_t **bleg,
+													 switch_call_cause_t *cause,
 													 char *bridgeto,
 													 uint32_t timelimit_sec,
 													 const switch_state_handler_table_t *table,

Modified: freeswitch/branches/mishehu/src/include/switch_module_interfaces.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_module_interfaces.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_module_interfaces.h	Mon Sep 18 11:45:43 2006
@@ -240,6 +240,10 @@
 	switch_status_t (*timer_init)(switch_timer_t *);
 	/*! function to wait for one cycle to pass */
 	switch_status_t (*timer_next)(switch_timer_t *);
+	/*! function to step the timer one step */
+	switch_status_t (*timer_step)(switch_timer_t *);
+	/*! function to check if the current step has expired */
+	switch_status_t (*timer_check)(switch_timer_t *);
 	/*! function to deallocate the timer */
 	switch_status_t (*timer_destroy)(switch_timer_t *);
 	const struct switch_timer_interface *next;

Modified: freeswitch/branches/mishehu/src/include/switch_platform.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_platform.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_platform.h	Mon Sep 18 11:45:43 2006
@@ -75,6 +75,7 @@
 #endif
 #endif
 
+#undef inline
 #define inline __inline
 
 #ifndef uint32_t

Modified: freeswitch/branches/mishehu/src/include/switch_rtp.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_rtp.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_rtp.h	Mon Sep 18 11:45:43 2006
@@ -77,13 +77,14 @@
   \return the new RTP session or NULL on failure
 */
 SWITCH_DECLARE(switch_status_t)switch_rtp_create(switch_rtp_t **new_rtp_session,
-											   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_payload_t payload,
+												 uint32_t packet_size,
+												 uint32_t ms_per_packet,
+												 switch_rtp_flag_t flags,
+												 char *crypto_key,
+												 char *timer_name,
+												 const char **err,
+												 switch_memory_pool_t *pool);
 
 
 /*!
@@ -102,16 +103,17 @@
   \return the new RTP session or NULL on failure
 */
 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,
+											 char *timer_name,
+											 const char **err,
+											 switch_memory_pool_t *pool);
 
 
 /*! 

Modified: freeswitch/branches/mishehu/src/include/switch_utils.h
==============================================================================
--- freeswitch/branches/mishehu/src/include/switch_utils.h	(original)
+++ freeswitch/branches/mishehu/src/include/switch_utils.h	Mon Sep 18 11:45:43 2006
@@ -166,7 +166,13 @@
 /*!
   \brief Wait a desired number of microseconds and yield the CPU
 */
-#define switch_yield(ms) apr_sleep(ms * 10); apr_thread_yield();
+#if defined(HAVE_USLEEP)
+#define switch_yield(ms) usleep(ms);
+#elif defined(WIN32)
+#define switch_yield(ms) Sleep((DWORD)((ms) / 1000));
+#else
+#define switch_yield(ms) apr_sleep(ms); //apr_thread_yield();
+#endif
 
 /*!
   \brief Declares a function designed to set a dymaic global string

Modified: freeswitch/branches/mishehu/src/mod/applications/mod_bridgecall/mod_bridgecall.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/applications/mod_bridgecall/mod_bridgecall.c	(original)
+++ freeswitch/branches/mishehu/src/mod/applications/mod_bridgecall/mod_bridgecall.c	Mon Sep 18 11:45:43 2006
@@ -42,6 +42,7 @@
 	switch_core_session_t *peer_session;
 	unsigned int timelimit = 60;
 	char *var;
+	switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
 
 	caller_channel = switch_core_session_get_channel(session);
 	assert(caller_channel != NULL);
@@ -50,9 +51,10 @@
 		timelimit = atoi(var);
 	}
 
-	if (switch_ivr_originate(session, &peer_session, data, timelimit, NULL, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
+	if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create Outgoing Channel!\n");
-		switch_channel_hangup(caller_channel, SWITCH_CAUSE_REQUESTED_CHAN_UNAVAIL);
+		/* Hangup the channel with the cause code from the failed originate.*/
+		switch_channel_hangup(caller_channel, cause);
 		return;
 	} else {
 		switch_ivr_multi_threaded_bridge(session, peer_session, NULL, NULL, NULL);

Modified: freeswitch/branches/mishehu/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/branches/mishehu/src/mod/applications/mod_commands/mod_commands.c	Mon Sep 18 11:45:43 2006
@@ -217,7 +217,7 @@
 	int x, argc = 0;
 	char *aleg, *exten, *dp, *context, *cid_name, *cid_num;
 	uint32_t timeout = 60;
-
+	switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
 	if (isession) {
 		stream->write_function(stream, "Illegal Usage\n");
 		return SWITCH_STATUS_SUCCESS;
@@ -260,7 +260,7 @@
 		return SWITCH_STATUS_SUCCESS;
 	}
 
-	if (switch_ivr_originate(NULL, &caller_session, aleg, timeout, &noop_state_handler, cid_name, cid_num, NULL) != SWITCH_STATUS_SUCCESS) {
+	if (switch_ivr_originate(NULL, &caller_session, &cause, aleg, timeout, &noop_state_handler, cid_name, cid_num, NULL) != SWITCH_STATUS_SUCCESS) {
 		stream->write_function(stream, "Cannot Create Outgoing Channel! [%s]\n", aleg);
 		return SWITCH_STATUS_SUCCESS;
 	} 

Modified: freeswitch/branches/mishehu/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/branches/mishehu/src/mod/applications/mod_conference/mod_conference.c	Mon Sep 18 11:45:43 2006
@@ -80,7 +80,8 @@
 	CFLAG_DYNAMIC = (1 << 1),
 	CFLAG_ENFORCE_MIN = (1 << 2),
 	CFLAG_DESTRUCT = (1 << 3),
-	CFLAG_LOCKED = (1 << 4)
+	CFLAG_LOCKED = (1 << 4),
+	CFLAG_ANSWERED = (1 << 5)
 } conf_flag_t;
 
 typedef enum {
@@ -127,6 +128,7 @@
 	char *bad_pin_sound;
 	char *profile_name;
 	uint32_t flags;
+	switch_call_cause_t bridge_hangup_cause;
 	switch_mutex_t *flag_mutex;
 	uint32_t rate;
 	uint32_t interval;
@@ -645,7 +647,13 @@
 
 		for(imember = conference->members; imember; imember = imember->next) {
 			switch_channel_t *channel = switch_core_session_get_channel(imember->session);
-			switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
+			// add this little bit to preserve the bridge cause code in case of an early media call that
+			// never answers
+			if (switch_test_flag(conference, CFLAG_ANSWERED)) 
+				switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);	
+			else 	
+				// put actual cause code from outbound channel hangup here
+				switch_channel_hangup(channel, conference->bridge_hangup_cause);
 			switch_clear_flag_locked(imember, MFLAG_RUNNING);
 		}
 
@@ -698,15 +706,13 @@
 		return;
 	}
 
-	if (!switch_channel_test_flag(channel, CF_OUTBOUND)) {
-		/* Answer the channel */
-		switch_channel_answer(channel);
-	}
-
-	/* Prepare the write frame */
 	write_frame.data = data;
 	write_frame.buflen = sizeof(data);
 	write_frame.codec = &member->write_codec;
+
+	if (switch_test_flag(member->conference, CFLAG_ANSWERED)) {
+		switch_channel_answer(channel);
+	}
 	
 	/* Start a thread to read data and feed it into the buffer and use this thread to generate output */
 	launch_input_thread(member, switch_core_session_get_pool(member->session));
@@ -723,7 +729,20 @@
 		if (switch_core_session_dequeue_event(member->session, &event) == SWITCH_STATUS_SUCCESS) {
 			switch_event_destroy(&event);
 		}
-
+#if 1
+		if (switch_channel_test_flag(channel, CF_OUTBOUND)) {
+			// test to see if outbound channel has answered
+			if (switch_channel_test_flag(channel, CF_ANSWERED) && !switch_test_flag(member->conference, CFLAG_ANSWERED)) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Outbound conference channel answered, setting CFLAG_ANSWERED");
+				switch_set_flag(member->conference, CFLAG_ANSWERED);
+			}
+		} else {
+			if (switch_test_flag(member->conference, CFLAG_ANSWERED) && !switch_channel_test_flag(channel, CF_ANSWERED)) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CLFAG_ANSWERED set, answering inbound channel\n");
+				switch_channel_answer(channel);
+			}
+		}
+#endif
         if (switch_channel_has_dtmf(channel)) {
             switch_channel_dequeue_dtmf(channel, dtmf, sizeof(dtmf));
 
@@ -942,10 +961,19 @@
 			}
 		}
 	} /* Rinse ... Repeat */
-	
+
 	switch_clear_flag_locked(member, MFLAG_RUNNING);
 	switch_core_timer_destroy(&timer);
 
+
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel leaving conference, cause: %s\n",
+			switch_channel_cause2str(switch_channel_get_cause(channel)));
+
+	// if it's an outbound channel, store the release cause in the conference struct, we might need it
+	if (switch_channel_test_flag(channel, CF_OUTBOUND)) {
+		member->conference->bridge_hangup_cause = switch_channel_get_cause(channel);
+	}
+
 	/* Wait for the input thead to end */
 	while(switch_test_flag(member, MFLAG_ITHREAD)) {
 		switch_yield(1000);
@@ -2044,13 +2072,22 @@
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 	switch_channel_t *caller_channel = NULL;
 	char appdata[512];
+	switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
 
-
-	if (switch_ivr_originate(session, &peer_session, bridgeto, timeout, &audio_bridge_peer_state_handlers, cid_name, cid_num, NULL) != SWITCH_STATUS_SUCCESS) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create Outgoing Channel!\n");
+	if (switch_ivr_originate(session,
+							 &peer_session,
+							 &cause,
+							 bridgeto,
+							 timeout,
+							 &audio_bridge_peer_state_handlers,
+							 cid_name,
+							 cid_num,
+							 NULL) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot create outgoing channel, cause: %s\n",
+				  switch_channel_cause2str(cause));
 		if (session) {
 			caller_channel = switch_core_session_get_channel(session);
-			switch_channel_hangup(caller_channel, SWITCH_CAUSE_REQUESTED_CHAN_UNAVAIL);
+			switch_channel_hangup(caller_channel, cause);
 		}
 		goto done;
 	} 
@@ -2311,6 +2348,11 @@
 		if (conference_outcall(conference, session, bridgeto, 60, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
 			goto done;
 		}
+	} else {	
+		// if we're not using "bridge:" set the conference answered flag
+		// and this isn't an outbound channel, answer the call
+		if (!switch_channel_test_flag(channel, CF_OUTBOUND)) 
+			switch_set_flag(conference, CFLAG_ANSWERED);
 	}
 
 

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_g711/Makefile
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_g711/Makefile	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_g711/Makefile	Mon Sep 18 11:45:43 2006
@@ -1,12 +1,9 @@
-
+CFLAGS += -I$(BASE)/libs/codec/g7xx/src/include
 all:	$(MODNAME).$(DYNAMIC_LIB_EXTEN)
 
-g711.o: g711.c g711.h
-	$(CC) $(CFLAGS) -c -O2 -pthread -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE g711.c -o g711.o
-
-$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c g711.o
+$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c
 	$(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o
-	$(CC) $(SOLINK) g711.o $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LDFLAGS)
+	$(CC) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LDFLAGS)
 
 
 

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_g711/mod_g711.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_g711/mod_g711.c	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_g711/mod_g711.c	Mon Sep 18 11:45:43 2006
@@ -30,7 +30,7 @@
  *
  */
 #include <switch.h>
-#include "g711.h"
+#include <g7xx/g711.h>
 
 
 static const char modname[] = "mod_g711";
@@ -68,7 +68,7 @@
 	ebuf = encoded_data;
 
 	for (i = 0; i < decoded_data_len / sizeof(short); i++) {
-		ebuf[i] = linear2ulaw(dbuf[i]);
+		ebuf[i] = linear_to_ulaw(dbuf[i]);
 	}
 
 	*encoded_data_len = i;
@@ -96,7 +96,7 @@
 		*decoded_data_len = codec->implementation->bytes_per_frame;
 	} else {
 		for (i = 0; i < encoded_data_len; i++) {
-			dbuf[i] = ulaw2linear(ebuf[i]);
+			dbuf[i] = ulaw_to_linear(ebuf[i]);
 		}
 
 		*decoded_data_len = i * 2;
@@ -143,7 +143,7 @@
 	ebuf = encoded_data;
 
 	for (i = 0; i < decoded_data_len / sizeof(short); i++) {
-		ebuf[i] = linear2alaw(dbuf[i]);
+		ebuf[i] = linear_to_alaw(dbuf[i]);
 	}
 
 	*encoded_data_len = i;
@@ -171,7 +171,7 @@
 		*decoded_data_len = codec->implementation->bytes_per_frame;
 	} else {
 		for (i = 0; i < encoded_data_len; i++) {
-			dbuf[i] = alaw2linear(ebuf[i]);
+			dbuf[i] = alaw_to_linear(ebuf[i]);
 		}
 
 		*decoded_data_len = i * 2;
@@ -187,8 +187,8 @@
 
 /* Registration */
 
-#if 0
 
+
 static const switch_codec_implementation_t g711u_8k_60ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 0,
@@ -208,7 +208,7 @@
 	/*.destroy */ switch_g711u_destroy
 };
 
-
+#if 0
 static const switch_codec_implementation_t g711u_8k_30ms_implementation = {
 	/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
 	/*.ianacode */ 0,
@@ -268,6 +268,7 @@
 	/*.decode */ switch_g711u_decode,
 	/*.destroy */ switch_g711u_destroy,
 	///*.next */ &g711u_16k_implementation
+	&g711u_8k_60ms_implementation
 };
 
 

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_g711/mod_g711.vcproj
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_g711/mod_g711.vcproj	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_g711/mod_g711.vcproj	Mon Sep 18 11:45:43 2006
@@ -41,7 +41,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;"
+				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\codec\g7xx\src\include&quot;"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -122,7 +122,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;"
+				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\codec\g7xx\src\include&quot;"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
 				RuntimeLibrary="0"
 				UsePrecompiledHeader="0"
@@ -186,10 +186,6 @@
 			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
 			>
-			<File
-				RelativePath=".\g711.c"
-				>
-			</File>
 			<File
 				RelativePath=".\mod_g711.c"
 				>

Modified: freeswitch/branches/mishehu/src/mod/codecs/mod_g729/mod_g729.vcproj
==============================================================================
--- freeswitch/branches/mishehu/src/mod/codecs/mod_g729/mod_g729.vcproj	(original)
+++ freeswitch/branches/mishehu/src/mod/codecs/mod_g729/mod_g729.vcproj	Mon Sep 18 11:45:43 2006
@@ -183,7 +183,7 @@
 		</Configuration>
 		<Configuration
 			Name="Debug Passthrough|Win32"
-			OutputDirectory="$(ConfigurationName)"
+			OutputDirectory="Debug"
 			IntermediateDirectory="$(ConfigurationName)"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
@@ -266,7 +266,7 @@
 		</Configuration>
 		<Configuration
 			Name="Release Passthrough|Win32"
-			OutputDirectory="$(ConfigurationName)"
+			OutputDirectory="Release"
 			IntermediateDirectory="$(ConfigurationName)"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

Modified: freeswitch/branches/mishehu/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_dingaling/mod_dingaling.c	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_dingaling/mod_dingaling.c	Mon Sep 18 11:45:43 2006
@@ -102,6 +102,7 @@
 	char *server;
     char *exten;
     char *context;
+	char *timer_name;
     ldl_handle_t *handle;
     uint32_t flags;
     uint32_t user_flags;
@@ -343,6 +344,7 @@
 												 tech_pvt->read_codec.implementation->microseconds_per_frame,
 												 flags,
 												 NULL,
+												 tech_pvt->profile->timer_name,
 												 &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);
@@ -1240,6 +1242,10 @@
 		profile->exten) {
 		ldl_handle_t *handle;
 
+		if (switch_test_flag(profile, TFLAG_TIMER) && !profile->timer_name) {
+			profile->timer_name = switch_core_strdup(module_pool, "soft");			
+		}
+
 		if (login) {
 			if (ldl_handle_init(&handle,
 								profile->login,
@@ -1326,6 +1332,8 @@
 		profile->extip = switch_core_strdup(module_pool, val);
 	} else if (!strcasecmp(var, "server")) {
 		profile->server = switch_core_strdup(module_pool, val);
+	} else if (!strcasecmp(var, "rtp-timer-name")) {
+		profile->timer_name = switch_core_strdup(module_pool, val);
 	} else if (!strcasecmp(var, "lanaddr")) {
 		profile->lanaddr = switch_core_strdup(module_pool, val);
 	} else if (!strcasecmp(var, "tls")) {

Modified: freeswitch/branches/mishehu/src/mod/endpoints/mod_exosip/mod_exosip.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_exosip/mod_exosip.c	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_exosip/mod_exosip.c	Mon Sep 18 11:45:43 2006
@@ -585,6 +585,7 @@
 										   ms,
 										   flags,
 										   key,
+										   "soft",
 										   &err, switch_core_session_get_pool(tech_pvt->session));
 
 	if (switch_rtp_ready(tech_pvt->rtp_session)) {

Modified: freeswitch/branches/mishehu/src/mod/endpoints/mod_iax/mod_iax.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_iax/mod_iax.c	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_iax/mod_iax.c	Mon Sep 18 11:45:43 2006
@@ -75,6 +75,9 @@
 	char *codec_rates[SWITCH_MAX_CODECS];
 	int codec_rates_last;
 	unsigned int flags;
+	int fd;
+	int calls;
+	switch_mutex_t *mutex;
 } globals;
 
 struct private_object {
@@ -467,6 +470,9 @@
 
 	/* Move Channel's State Machine to RING */
 	switch_channel_set_state(channel, CS_RING);
+	switch_mutex_lock(globals.mutex);
+	globals.calls++;
+	switch_mutex_unlock(globals.mutex);
 
 	return SWITCH_STATUS_SUCCESS;
 }
@@ -537,7 +543,13 @@
 	}
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL HANGUP\n", switch_channel_get_name(channel));
-
+	switch_mutex_lock(globals.mutex);
+	globals.calls--;
+	if (globals.calls < 0) {
+		globals.calls = 0;
+	}
+	switch_mutex_unlock(globals.mutex);
+		
 	return SWITCH_STATUS_SUCCESS;
 }
 
@@ -825,6 +837,7 @@
 		return SWITCH_STATUS_TERM;
 	}
 
+	
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &channel_module_interface;
 
@@ -848,7 +861,7 @@
 	switch_xml_t cfg, xml, settings, param;
 
 	memset(&globals, 0, sizeof(globals));
-
+	switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, module_pool);
 	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;
@@ -916,7 +929,7 @@
 
 	iax_set_error(iax_err_cb);
 	iax_set_output(iax_out_cb);
-	//netfd = iax_get_fd();
+	globals.fd = iax_get_fd();
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "IAX Ready Port %d\n", globals.port);
 
@@ -928,13 +941,26 @@
 
 	for (;;) {
 
+
 		if (running == -1) {
 			break;
 		}
 
 		/* Wait for an event. */
 		if ((iaxevent = iax_get_event(0)) == NULL) {
-			switch_yield(100);
+			int waitlen = 0;
+			
+			if (globals.calls == 0) {
+				waitlen = 10000;
+			} else if (globals.calls == 1) {
+				waitlen = 1000;
+			} else if (globals.calls < 10) {
+				waitlen = 100;
+			} else {
+				waitlen = 10;
+			}
+
+			switch_yield(waitlen);
 			continue;
 		} else {
 			struct private_object *tech_pvt = iax_get_private(iaxevent->session);
@@ -1160,6 +1186,10 @@
 
 	running = -1;
 
+	if (globals.fd) {
+		/* Die Mutha $%#$@% Die Mutha $#%#$^ Die*/
+		shutdown(globals.fd, 2);
+	}
 	iax_shutdown();
 
 	while (running) {

Modified: freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.c	Mon Sep 18 11:45:43 2006
@@ -111,6 +111,7 @@
 	char *username;
 	char *url;
 	char *sipdomain;
+	char *timer_name;
 	int sip_port;
 	char *codec_string;
 	char *codec_order[SWITCH_MAX_CODECS];
@@ -374,7 +375,7 @@
 		switch_channel_t *channel = switch_core_session_get_channel(*session);
 		switch_channel_state_t state = switch_channel_get_state(channel);
 		struct private_object *tech_pvt = NULL;
-			
+
 		tech_pvt = switch_core_session_get_private(*session);
 
 		if (tech_pvt) {
@@ -455,7 +456,6 @@
 	switch_set_flag_locked(tech_pvt, TFLAG_READY);
 	
 	tech_pvt->nh = nua_handle(tech_pvt->profile->nua, NULL, SIPTAG_TO_STR(tech_pvt->dest), TAG_END());
-
 	nua_handle_bind(tech_pvt->nh, session);
 	nua_invite(tech_pvt->nh,
 			   SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
@@ -531,14 +531,69 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
+// map QSIG cause codes to SIP ala RFC4497
+static int hangup_cause_to_sip(switch_call_cause_t cause) {
+	switch (cause) {
+		case SWITCH_CAUSE_UNALLOCATED: 
+		case SWITCH_CAUSE_NO_ROUTE_TRANSIT_NET:
+		case SWITCH_CAUSE_NO_ROUTE_DESTINATION:
+			return 404;
+		case SWITCH_CAUSE_USER_BUSY:
+			return 486;
+		case SWITCH_CAUSE_NO_USER_RESPONSE:
+			return 408;
+		case SWITCH_CAUSE_NO_ANSWER:
+			return 480;
+		case SWITCH_CAUSE_CALL_REJECTED:
+			return 603;
+		case SWITCH_CAUSE_NUMBER_CHANGED:
+			return 410;
+		case SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER:
+			return 502;
+		case SWITCH_CAUSE_INVALID_NUMBER_FORMAT:
+			return 484;
+		case SWITCH_CAUSE_FACILITY_REJECTED:
+			return 501;
+		case SWITCH_CAUSE_NORMAL_UNSPECIFIED:
+			return 480;
+		case SWITCH_CAUSE_NORMAL_CIRCUIT_CONGESTION:
+		case SWITCH_CAUSE_NETWORK_OUT_OF_ORDER:
+		case SWITCH_CAUSE_NORMAL_TEMPORARY_FAILURE:
+		case SWITCH_CAUSE_SWITCH_CONGESTION:
+			return 503;
+		case SWITCH_CAUSE_OUTGOING_CALL_BARRED:
+		case SWITCH_CAUSE_INCOMING_CALL_BARRED:
+		case SWITCH_CAUSE_BEARERCAPABILITY_NOTAUTH: 
+			return 403;
+		case SWITCH_CAUSE_BEARERCAPABILITY_NOTAVAIL:
+			return 503;
+		case SWITCH_CAUSE_BEARERCAPABILITY_NOTIMPL:
+			return 488;
+		case SWITCH_CAUSE_FACILITY_NOT_IMPLEMENTED:
+			return 501;
+		case SWITCH_CAUSE_INCOMPATIBLE_DESTINATION:
+			return 503;
+		case SWITCH_CAUSE_RECOVERY_ON_TIMER_EXPIRE:
+			return 504;
+		default:
+			return 500;
+	}
+
+}
+
 static switch_status_t sofia_on_hangup(switch_core_session_t *session)
 {
 	private_object_t *tech_pvt;
 	switch_channel_t *channel = NULL;
+	switch_call_cause_t cause;
+	int sip_cause;
 
 	channel = switch_core_session_get_channel(session);
 	assert(channel != NULL);
 
+	cause = switch_channel_get_cause(channel);
+	sip_cause = hangup_cause_to_sip(cause);
+
 	tech_pvt = (private_object_t *) switch_core_session_get_private(session);
 	assert(tech_pvt != NULL);
 
@@ -546,14 +601,18 @@
 
 	su_home_deinit(tech_pvt->home);
 
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel %s hanging up, cause: %s, SIP response: %d\n", 
+			  switch_channel_get_name(channel), switch_channel_cause2str(cause), sip_cause);
 
-
 	if (tech_pvt->nh) {
 		if (!switch_test_flag(tech_pvt, TFLAG_BYE)) {
 			if (switch_test_flag(tech_pvt, TFLAG_ANS)) {
 				nua_bye(tech_pvt->nh, TAG_END());
 			} else {
-				nua_cancel(tech_pvt->nh, TAG_END());
+				if (switch_test_flag(tech_pvt, TFLAG_INBOUND)) 
+					nua_respond(tech_pvt->nh, sip_cause, NULL, TAG_END());
+				else 
+					nua_cancel(tech_pvt->nh, TAG_END());
 			}
 		}
 		nua_handle_bind(tech_pvt->nh, NULL);
@@ -564,8 +623,6 @@
 	switch_set_flag_locked(tech_pvt, TFLAG_BYE);
 	switch_clear_flag_locked(tech_pvt, TFLAG_IO);
 
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SOFIA HANGUP\n");
-
 	return SWITCH_STATUS_SUCCESS;
 }
 
@@ -584,14 +641,12 @@
 static void deactivate_rtp(private_object_t *tech_pvt)
 {
 	int loops = 0;//, sock = -1;
-
 	if (switch_rtp_ready(tech_pvt->rtp_session)) {
 		while (loops < 10 && (switch_test_flag(tech_pvt, TFLAG_READING) || switch_test_flag(tech_pvt, TFLAG_WRITING))) {
 			switch_yield(10000);
 			loops++;
 		}
 		switch_rtp_destroy(&tech_pvt->rtp_session);
-		tech_pvt->rtp_session = NULL;
 	}
 }
 
@@ -672,11 +727,7 @@
 	bw = tech_pvt->read_codec.implementation->bits_per_second;
 	ms = tech_pvt->read_codec.implementation->microseconds_per_frame;
 
-	flags = (switch_rtp_flag_t) (SWITCH_RTP_FLAG_RAW_WRITE | SWITCH_RTP_FLAG_MINI);
-	if (switch_test_flag(tech_pvt, TFLAG_TIMER)) {
-		flags = (switch_rtp_flag_t) (flags | SWITCH_RTP_FLAG_USE_TIMER);
-	}
-	
+	flags = (switch_rtp_flag_t) (SWITCH_RTP_FLAG_RAW_WRITE | SWITCH_RTP_FLAG_MINI | SWITCH_RTP_FLAG_AUTOADJ);
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "RTP [%s] %s:%d->%s:%d codec: %u ms: %d\n",
 					  switch_channel_get_name(channel),
@@ -687,7 +738,6 @@
 					  tech_pvt->read_codec.implementation->ianacode,
 					  tech_pvt->read_codec.implementation->microseconds_per_frame / 1000);
 
-
 	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,
@@ -697,6 +747,7 @@
 										   tech_pvt->codec_ms * 1000,
 										   (switch_rtp_flag_t) flags,
 										   NULL,
+										   tech_pvt->profile->timer_name,
 										   &err,
 										   switch_core_session_get_pool(tech_pvt->session));
 	
@@ -761,9 +812,9 @@
 	size_t bytes = 0, samples = 0, frames = 0, ms = 0;
 	switch_channel_t *channel = NULL;
 	int payload = 0;
-	switch_time_t now, started = switch_time_now(), last_act = switch_time_now();
-	unsigned int elapsed;
-	uint32_t hard_timeout = 60000 * 3;
+	//switch_time_t now, started = switch_time_now(), last_act = switch_time_now();
+	//unsigned int elapsed;
+	//uint32_t hard_timeout = 60000 * 3;
 
 	channel = switch_core_session_get_channel(session);
 	assert(channel != NULL);
@@ -784,10 +835,12 @@
 	ms = tech_pvt->read_codec.implementation->microseconds_per_frame;
 	
 	if (tech_pvt->last_read) {
+#if 0
 		elapsed = (unsigned int)((switch_time_now() - tech_pvt->last_read) / 1000);
 		if (elapsed > 60000) {
 			return SWITCH_STATUS_TIMEOUT;
 		}
+#endif
 	}
 
 	if (switch_test_flag(tech_pvt, TFLAG_IO)) {
@@ -802,7 +855,7 @@
 
 
 		while (!switch_test_flag(tech_pvt, TFLAG_BYE) && switch_test_flag(tech_pvt, TFLAG_IO) && tech_pvt->read_frame.datalen == 0) {
-			now = switch_time_now();
+			//now = switch_time_now();
 			tech_pvt->read_frame.flags = SFF_NONE;
 
 			status = switch_rtp_zerocopy_read_frame(tech_pvt->rtp_session, &tech_pvt->read_frame);
@@ -814,7 +867,7 @@
 			
 			payload = tech_pvt->read_frame.payload;
 
-
+#if 0
 			elapsed = (unsigned int)((switch_time_now() - started) / 1000);
 
 			if (timeout > -1) {
@@ -827,7 +880,7 @@
 			if (elapsed >= hard_timeout) {
 				return SWITCH_STATUS_BREAK;
 			}
-
+#endif
 			if (switch_rtp_has_dtmf(tech_pvt->rtp_session)) {
 				char dtmf[128];
 				switch_rtp_dequeue_dtmf(tech_pvt->rtp_session, dtmf, sizeof(dtmf));
@@ -855,9 +908,14 @@
 		}
 
 	} 
-
+	
 	switch_clear_flag_locked(tech_pvt, TFLAG_READING);
 
+	if (tech_pvt->read_frame.datalen == 0) {
+		*frame = NULL;
+		return SWITCH_STATUS_GENERR;
+	}
+
 	*frame = &tech_pvt->read_frame;
 
 	return SWITCH_STATUS_SUCCESS;
@@ -1196,6 +1254,57 @@
 	return match;
 }
 
+// map sip responses to QSIG cause codes ala RFC4497
+static switch_call_cause_t sip_cause_to_freeswitch(int status) {
+	switch (status) {
+		case 200:
+			return SWITCH_CAUSE_NORMAL_CLEARING;
+		case 401:
+		case 402: 
+		case 403:
+		case 407:
+		case 603:
+			return SWITCH_CAUSE_CALL_REJECTED;
+		case 404:
+		case 485:
+		case 604:	
+			return SWITCH_CAUSE_UNALLOCATED;
+		case 408: 
+		case 504:
+			return SWITCH_CAUSE_RECOVERY_ON_TIMER_EXPIRE;
+		case 410: 
+			return SWITCH_CAUSE_NUMBER_CHANGED;
+		case 413: 
+		case 414:
+		case 416:
+		case 420:
+		case 421:
+		case 423:
+		case 505:
+		case 513:
+			return SWITCH_CAUSE_INTERWORKING;
+		case 480:
+			return SWITCH_CAUSE_NO_USER_RESPONSE;
+		case 400:
+		case 481:
+		case 500:
+		case 503:
+			return SWITCH_CAUSE_NORMAL_TEMPORARY_FAILURE;
+		case 486:
+		case 600:
+			return SWITCH_CAUSE_USER_BUSY;
+		case 484:
+			return SWITCH_CAUSE_INVALID_NUMBER_FORMAT;
+		case 488:
+		case 606:
+			return SWITCH_CAUSE_BEARERCAPABILITY_NOTIMPL;
+		case 502:
+			return SWITCH_CAUSE_NETWORK_OUT_OF_ORDER;
+		default: 
+			return SWITCH_CAUSE_NORMAL_UNSPECIFIED;
+	}
+}
+
 static void sip_i_state(int status,
 						char const *phrase, 
 						nua_t *nua,
@@ -1235,13 +1344,14 @@
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel %s entering state [%s]\n", 
 						  switch_channel_get_name(channel),
 						  nua_callstate_name(ss_state));
-	}
 
-	if (r_sdp) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Remote SDP:\n%s\n", r_sdp);			
-		tech_pvt->remote_sdp_str = switch_core_session_strdup(session, (char *)r_sdp);
+		if (r_sdp) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Remote SDP:\n%s\n", r_sdp);			
+			tech_pvt->remote_sdp_str = switch_core_session_strdup(session, (char *)r_sdp);
+		}
 	}
 
+
 	switch ((enum nua_callstate)ss_state) {
 	case nua_callstate_init:
 		break;
@@ -1250,76 +1360,82 @@
 	case nua_callstate_calling:
 		break;
 	case nua_callstate_proceeding:
-		if (session && r_sdp) {
-			sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
-			sdp_session_t *sdp;
-			uint8_t match = 0;
+		if (channel) {
+			if (r_sdp) {
+				sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
+				sdp_session_t *sdp;
+				uint8_t match = 0;
 
-			if (tech_pvt->num_codecs) {
-				if ((sdp = sdp_session(parser))) {
-					match = negotiate_sdp(session, sdp);
+				if (tech_pvt->num_codecs) {
+					if ((sdp = sdp_session(parser))) {
+						match = negotiate_sdp(session, sdp);
+					}
 				}
-			}
 
-			if (parser) {
-				sdp_parser_free(parser);
-			}
+				if (parser) {
+					sdp_parser_free(parser);
+				}
 
 
-			if (match) {
-				tech_choose_port(tech_pvt);
-                activate_rtp(tech_pvt);
-				switch_channel_set_variable(channel, "endpoint_disposition", "EARLY MEDIA");
-                switch_channel_pre_answer(channel);
-				return;
+				if (match) {
+					tech_choose_port(tech_pvt);
+					activate_rtp(tech_pvt);
+					switch_channel_set_variable(channel, "endpoint_disposition", "EARLY MEDIA");
+					switch_channel_pre_answer(channel);
+					return;
+				}
+				switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
+				nua_respond(nh, SIP_488_NOT_ACCEPTABLE, 
+							//SIPTAG_CONTACT(tech_pvt->contact), 
+							TAG_END());
 			}
 		}
-		switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
-		nua_respond(nh, SIP_488_NOT_ACCEPTABLE, 
-					//SIPTAG_CONTACT(tech_pvt->contact), 
-					TAG_END());
+
 		break;
 	case nua_callstate_completing:
 		nua_ack(nh, TAG_END());
 		break;
 	case nua_callstate_received: 
-		if (session && r_sdp) {
-			sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
-			sdp_session_t *sdp;
-			uint8_t match = 0;
+		if (channel) {
+			if (r_sdp) {
+				sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
+				sdp_session_t *sdp;
+				uint8_t match = 0;
 
 
 
-			if (tech_pvt->num_codecs) {
-				if ((sdp = sdp_session(parser))) {
-					match = negotiate_sdp(session, sdp);
+				if (tech_pvt->num_codecs) {
+					if ((sdp = sdp_session(parser))) {
+						match = negotiate_sdp(session, sdp);
+					}
 				}
-			}
 
-			if (parser) {
-				sdp_parser_free(parser);
-			}
+				if (parser) {
+					sdp_parser_free(parser);
+				}
 
 
-			if (match) {
-				switch_channel_set_variable(channel, "endpoint_disposition", "RECEIVED");
-				switch_channel_set_state(channel, CS_INIT);
-				switch_set_flag_locked(tech_pvt, TFLAG_READY);
-				switch_core_session_thread_launch(session);
-				return;
+				if (match) {
+					switch_channel_set_variable(channel, "endpoint_disposition", "RECEIVED");
+					switch_channel_set_state(channel, CS_INIT);
+					switch_set_flag_locked(tech_pvt, TFLAG_READY);
+					switch_core_session_thread_launch(session);
+					return;
+				}
+				switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
+				nua_respond(nh, SIP_488_NOT_ACCEPTABLE, 
+							//SIPTAG_CONTACT(tech_pvt->contact), 
+							TAG_END());
 			}
 		}
-		switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
-		nua_respond(nh, SIP_488_NOT_ACCEPTABLE, 
-					//SIPTAG_CONTACT(tech_pvt->contact), 
-					TAG_END());
+
 		break;		
 	case nua_callstate_early:
 		break;
 	case nua_callstate_completed:
 		break;
 	case nua_callstate_ready:
-		if (session) {
+		if (channel) {
 			if (r_sdp) {
 				sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
 				sdp_session_t *sdp;
@@ -1344,23 +1460,26 @@
 					switch_channel_answer(channel);
 					return;
 				}
+
+				switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
+				nua_respond(nh, SIP_488_NOT_ACCEPTABLE, 
+							//SIPTAG_CONTACT(tech_pvt->contact), 
+							TAG_END());
 			} else if (switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
 				switch_channel_set_variable(channel, "endpoint_disposition", "ANSWER");
 				switch_channel_answer(channel);
 				return;
-			}
+			} //else probably an ack
+
 		}
-		switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
-		nua_respond(nh, SIP_488_NOT_ACCEPTABLE, 
-					//SIPTAG_CONTACT(tech_pvt->contact), 
-					TAG_END());
+
 		break;
 	case nua_callstate_terminating:
 		break;
 	case nua_callstate_terminated:
 		if (session) {
 			switch_set_flag_locked(tech_pvt, TFLAG_BYE);
-			terminate_session(&session, SWITCH_CAUSE_NORMAL_CLEARING, __LINE__);
+			terminate_session(&session, sip_cause_to_freeswitch(status), __LINE__);
 		}
 		break;
 	}
@@ -1442,9 +1561,14 @@
 						   sip_t const  *sip,
 						   tagi_t        tags[])
 {
-
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "event [%s] status [%d] [%s]\n",
-					  nua_event_name (event), status, phrase);
+	if (session) {
+		if (switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) {
+			/* too late */
+			return;
+		}
+	}
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "channel [%s] event [%s] status [%d] [%s]\n",
+					  session ? switch_channel_get_name(switch_core_session_get_channel(session)) : "null",nua_event_name (event), status, phrase);
 	
 	switch (event) {
 	case nua_r_shutdown:    
@@ -1563,6 +1687,10 @@
 		break;
 
 	}
+
+	if (session) {
+		switch_core_session_rwunlock(session);
+	}
 }
 
 static void *SWITCH_THREAD_FUNC profile_thread_run(switch_thread_t *thread, void *obj)
@@ -1698,6 +1826,8 @@
 				profile->sipip = switch_core_strdup(profile->pool, val);
 			} else if (!strcmp(var, "sip-domain")) {
 				profile->sipdomain = switch_core_strdup(profile->pool, val);
+			} else if (!strcmp(var, "rtp-timer-name")) {
+				profile->timer_name = switch_core_strdup(profile->pool, val);
 			} else if (!strcmp(var, "ext-sip-ip")) {
 				profile->extsipip = switch_core_strdup(profile->pool, val);
 			} else if (!strcmp(var, "bitpacking")) {
@@ -1733,6 +1863,10 @@
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Duration out of bounds!\n");
 				}
 			}
+		}
+
+		if (switch_test_flag(profile, TFLAG_TIMER) && !profile->timer_name) {
+			profile->timer_name = switch_core_strdup(profile->pool, "soft");			
 		}
 
 		if (!profile->username) {

Modified: freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.vcproj
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.vcproj	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_sofia/mod_sofia.vcproj	Mon Sep 18 11:45:43 2006
@@ -43,7 +43,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\win32&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa&quot;"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;LIBSOFIA_SIP_UA_STATIC"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
@@ -65,10 +65,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="libsofia_sip_ua.lib"
+				AdditionalDependencies="ws2_32.lib pthreadVC2.lib"
 				OutputFile="$(SolutionDir)$(OutDir)/mod/$(InputName).dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="&quot;$(ProjectDir)..\..\..\..\libs\sofia-sip\win32\libsofia-sip-ua\$(OutDir)&quot;;&quot;..\..\..\..\w32\vsnet\$(OutDir)&quot;"
+				AdditionalLibraryDirectories="&quot;..\..\..\..\w32\vsnet\$(OutDir)&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\win32\pthread&quot;"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)$(TargetName).pdb"
 				SubSystem="2"
@@ -127,7 +127,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\win32&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa&quot;"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;LIBSOFIA_SIP_UA_STATIC"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="0"
 				WarningLevel="4"
@@ -147,10 +147,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="libsofia_sip_ua.lib"
+				AdditionalDependencies="ws2_32.lib pthreadVC2.lib"
 				OutputFile="$(SolutionDir)$(OutDir)/mod/$(InputName).dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="&quot;$(ProjectDir)..\..\..\..\libs\sofia-sip\win32\libsofia-sip-ua\$(OutDir)&quot;;&quot;..\..\..\..\w32\vsnet\$(OutDir)&quot;"
+				AdditionalLibraryDirectories="&quot;..\..\..\..\w32\vsnet\$(OutDir)&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\win32\pthread&quot;"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)$(TargetName).pdb"
 				SubSystem="2"

Modified: freeswitch/branches/mishehu/src/mod/endpoints/mod_woomera/mod_woomera.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/endpoints/mod_woomera/mod_woomera.c	(original)
+++ freeswitch/branches/mishehu/src/mod/endpoints/mod_woomera/mod_woomera.c	Mon Sep 18 11:45:43 2006
@@ -1318,6 +1318,9 @@
 	switch_set_flag(profile, PFLAG_INBOUND | PFLAG_OUTBOUND);
 	profile->name = "main";
 	strncpy(profile->dialplan, "default", sizeof(profile->dialplan) - 1);
+	strncpy(profile->audio_ip, "127.0.0.1", sizeof(profile->audio_ip) - 1);
+	strncpy(profile->woomera_host, "127.0.0.1", sizeof(profile->woomera_host) - 1);
+	profile->woomera_port = (switch_port_t)42420;
 
 	if ((settings = switch_xml_child(cfg, "settings"))) {
 		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
@@ -1337,7 +1340,7 @@
 		for (param = switch_xml_child(xmlp, "param"); param; param = param->next) {
 			char *var = (char *) switch_xml_attr_soft(param, "name");
 			char *val = (char *) switch_xml_attr_soft(param, "value");
-			if (!strcmp(var, "audio_ip")) {
+			if (!strcmp(var, "audio-ip")) {
 				strncpy(profile->audio_ip, val, sizeof(profile->audio_ip) - 1);
 			} else if (!strcmp(var, "host")) {
 				strncpy(profile->woomera_host, val, sizeof(profile->woomera_host) - 1);

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/Makefile
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/Makefile	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/Makefile	Mon Sep 18 11:45:43 2006
@@ -1,4 +1,4 @@
-LDFLAGS += -I/usr/include/mysql -L/usr/lib64/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lssl -lcrypto
+LDFLAGS += -I/usr/include/mysql -L/usr/lib64/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lssl -lcrypto -lodbc
 CFLAGS += -I/usr/include/mysql -L/usr/lib64/mysql 
 CPPCC = g++
 OBJS=cdrcontainer.o basecdr.o baseregistry.o mysqlcdr.o pddcdr.o csvcdr.o

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_php/Makefile
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_php/Makefile	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_php/Makefile	Mon Sep 18 11:45:43 2006
@@ -2,15 +2,18 @@
 PCFG=$(PREFIX)/bin/php-config
 
 LCFLAGS=-fPIC -DZTS -DPTHREADS
-CFLAGS += `$(PCFG) --includes`
+# we should NOT use -fno-strict-aliasing.  we need to fix this issue, but it is an issue in the php header files.  we need to be careful of the optimization level on this module becuase of this setting.
+CFLAGS += `$(PCFG) --includes` -g3 -fno-strict-aliasing
 MDIR += `$(PCFG) --extension-dir`
 PHPMOD=freeswitch
-PHPLDFLAGS = `$(PCFG) --ldflags` -lcrypt -lresolv -lm -ldl -lnsl -lxml2 -lz -lphp5
-
+PHPLDFLAGS = `$(PCFG) --ldflags` -lm -ldl -lxml2 -lz -lphp5
+MOD_CFLAGS += -fPIC
 all:	depends $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(PHPMOD).$(DYNAMIC_LIB_EXTEN)
 
 depends:
-	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install php-5.1.6.tar.gz --prefix=$(PREFIX) --enable-embed=static --enable-static --with-pic --with-mysql --with-curl
+	MOD_CFLAGS="$(MOD_CFLAGS)" MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install zlib-1.2.3.tar.gz --prefix=$(PREFIX)
+	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install curl-7.15.2.tar.gz --prefix=$(PREFIX)
+	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install php-5.1.6.tar.gz --prefix=$(PREFIX) --enable-embed=shared --enable-shared --with-pic --with-zlib=$(PREFIX) --with-curl --enable-maintainer-zts --with-tsrm-pthreads --enable-debug
 %.o:  %.c
 	$(CC) $(LCFLAGS) $(CFLAGS) -c $< -o $@
 
@@ -37,7 +40,13 @@
 	rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *~
 
 install:
-	mkdir -p $(MDIR)
-	cp -f php_$(PHPMOD).$(DYNAMIC_LIB_EXTEN) $(MDIR)
+	#mkdir -p $(MDIR)
+	#cp -f php_$(PHPMOD).$(DYNAMIC_LIB_EXTEN) $(MDIR)
+	cp -f php_$(PHPMOD).$(DYNAMIC_LIB_EXTEN) $(PREFIX)/lib/php/extensions
 	cp -f $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(PREFIX)/mod
 	cp -f $(PHPMOD).php $(PREFIX)/lib/php
+	cp -f classFreeswitch.php $(PREFIX)/lib/php
+	cp -f freeswitch.php $(PREFIX)/lib/php
+	cp -f apptest.php $(PREFIX)/scripts
+	cp -f test.php $(PREFIX)/scripts
+	cp -f php.ini $(PREFIX)/lib

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_php/apptest.php
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_php/apptest.php	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_php/apptest.php	Mon Sep 18 11:45:43 2006
@@ -8,10 +8,10 @@
 */
 require("classFreeswitch.php");
 
-$fs = new fs_class_api;
+$fs = new fs_class_api($uuid); // $uuid MUST be there for the class to work.
 
-$fs->fs_answer($session);
+$fs->fs_answer();
 
-$fs->fs_play_file($session, "/ram/sr8k.wav");
+//$fs->fs_play_file("/ram/sr8k.wav");
 
 ?>

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_php/classFreeswitch.php
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_php/classFreeswitch.php	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_php/classFreeswitch.php	Mon Sep 18 11:45:43 2006
@@ -31,13 +31,12 @@
  *
  */
 require("freeswitch.php");  // Required for freeswitch driver to be loaded
-global $sessn;
+
 class fs_class_api {
-    	function fs_class_api() {
-		if($sessn = $this->fs_getsessn($uuid)){}
-		else{
-		   echo "Couldnt get sessn!\n";
-		}
+	Private $uuid;
+
+    	function fs_class_api($uuid) {
+		$this->uuid = $uuid;
 	
 	}
 	
@@ -62,99 +61,88 @@
 		
 	}
 
-	function fs_getsessn($uuid){
-		
-		return fs_core_sessn_locate($uuid);
-	
-	}
 
 	function fs_answer(){
 		
-		fs_channel_answer($sessn);
+		fs_channel_answer($this->uuid);
 		
 	}
 
-	function fs_early_media($sessn){
+	function fs_early_media(){
 		
-		fs_channel_pre_answer($sessn);
+		fs_channel_pre_answer($this->uuid);
 		
 	}
 
 	function fs_hangup($cause){
 		
-		fs_channel_hangup($sessn, $cause);
+		fs_channel_hangup($this->uuid, $cause);
 		
 	}
 
 	function fs_set_variable($var, $val){
 		
-		fs_channel_set_variable($sessn, $var, $val);
+		fs_channel_set_variable($this->uuid, $var, $val);
 		
 	}
 	
 	function fs_get_variable($var){
 		
-		return fs_channel_get_var($sessn, $var);
+		return fs_channel_get_var($this->uuid, $var);
 		
 	}
 
 	function fs_set_channel_state($state){
 		
-		fs_channel_set_state($sessn, $state);
+		fs_channel_set_state($this->uuid, $state);
 		
 	}
 	
 	function fs_play_file($file){
 		
-		return fs_ivr_play_file($sessn, $file, NULL, NULL, NULL, 0);
+		return fs_ivr_play_file($this->uuid, $file, NULL, NULL, NULL, 0);
 				
 	}
 	
 	function record_file($file){
 		
-		return fs_switch_ivr_record_file($sessn, NULL, $file, NULL, NULL, 0);
+		return fs_switch_ivr_record_file($this->uuid, NULL, $file, NULL, NULL, 0);
 		
 	}
 	
 	function fs_wait($ms){
 		
-		return fs_switch_ivr_sleep($sessn, $ms);
+		return fs_switch_ivr_sleep($this->uuid, $ms);
 		
 	}
 	
 	function fs_get_dtmf_callback($len){
 		
-		return fs_switch_ivr_collect_digits_callback($sessn, NULL, NULL, $len);
+		return fs_switch_ivr_collect_digits_callback($this->uuid, NULL, NULL, $len);
 		
 	}
 
 	function fs_get_digit_count ($maxdigits, $terminator, $timeout){
 		
-		return fs_switch_ivr_collect_digits_count($sessn, NULL, NULL, $maxdigits, NULL, $terminator, $timeout);
+		return fs_switch_ivr_collect_digits_count($this->uuid, NULL, NULL, $maxdigits, NULL, $terminator, $timeout);
 		
 	}
 
-	function fs_x_way($peer_sessn, $dtmf, $sessn_data, $peer_data){
-		
-		return fs_switch_ivr_multi_threaded_bridge ($sessn, $peer_sessn, $dtmf, $sessn_data, $peer_data);
-		
-	}
-
 	function fs_dial($data, $timelimit){
 		
-		return fs_switch_ivr_originate(sessn, NULL, $data, $timelimit, NULL, NULL, NULL, NULL);
+		return fs_switch_ivr_originate($this->uuid, NULL, $data, $timelimit, NULL, NULL, NULL, NULL);
 
 	}
 
 	function fs_transfer($exten, $dialplan, $context){
 		
-		return fs_switch_ivr_sessn_transfer($sessn, $exten, $dialplan, $context);
+		return fs_switch_ivr_sessn_transfer($this->uuid, $exten, $dialplan, $context);
 		
 	}
 
 	function fs_speak($ttsName, $voice, $text, $dtmf=NULL){
 		
-		return fs_switch_ivr_speak_text($sessn, $ttsName, NULL, NULL, $dtmf, $text, NULL, 0);
+		return fs_switch_ivr_speak_text($this->uuid, $ttsName, NULL, NULL, $dtmf, $text, NULL, 0);
 		
 	}
 

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_php/mod_php.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_php/mod_php.c	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_php/mod_php.c	Mon Sep 18 11:45:43 2006
@@ -1,4 +1,4 @@
-/* 
+/*
  * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
  * Copyright (C) 2005/2006, Anthony Minessale II <anthmct at yahoo.com>
  *
@@ -22,19 +22,16 @@
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
- * 
+ *
  * Anthony Minessale II <anthmct at yahoo.com>
  * Brian Fertig <brian.fertig at convergencetek.com>
+ * Steph Fox <steph at zend.com> 
  *
+ *
  * mod_php.c -- PHP Module
  *
  */
 
-#if !defined(ZTS)
-#error "ZTS Needs to be defined."
-#endif
-
-
 #ifndef _REENTRANT
 #define _REENTRANT
 #endif
@@ -43,351 +40,270 @@
 #define _GNU_SOURCE
 #endif
 
+#ifdef _MSC_VER
+//disable warnings for malformed header files
+#pragma warning(push)
+#pragma warning(disable:4127 4311 4133 4244 4201)
+#define _USE_32BIT_TIME_T 1
+#endif
+
 #include <sapi/embed/php_embed.h>
-//#include "php.h"
-//#include "php_variables.h"
-//#include "ext/standard/info.h"
-//#include "php_ini.h"
-//#include "php_globals.h"
-//#include "SAPI.h"
-//#include "php_main.h"
-//#include "php_version.h"
-//#include "TSRM.h"
-//#include "ext/standard/php_standard.h"
 
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
 
+#ifdef ZTS
+	zend_compiler_globals *compiler_globals;
+	zend_executor_globals *executor_globals;
+	php_core_globals *core_globals;
+	sapi_globals_struct *sapi_globals;
+#endif
+
 #include <switch.h>
 
 const char modname[] = "mod_php";
 
+static int sapi_mod_php_ub_write(const char *str, unsigned int str_length TSRMLS_DC)
+{
+	char buffer[4096];
+	unsigned int i;
+	int j = 0;
+	FILE *fp = fopen("mod_php.log", "a");
+	fwrite(str, str_length, sizeof(char), fp);
+	fclose(fp);
+	for(i = 0; i < str_length; i++) {
+		buffer[j++] = str[i];
+		if(str[i] == 10) { /* new line */
+			buffer[j] = 0;
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s", buffer);
+			j = 0;
+		}
+		else if(str[i] == 0) { /* null character */
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s", buffer);
+			j = 0;
+		}
+		if(j == 4095) { /* don't overfill buffer */
+			buffer[j] = 0;
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s", buffer);
+			j = 0;
+		}
+	}
+	if(j) { /* stuff left over */
+		buffer[j] = 0;
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s", buffer);
+	}
+	return str_length;
+}
+
+
+void mod_php_error_handler(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args)
+{
+	char *buffer;
+	int buffer_len;
+	TSRMLS_FETCH();
+
+	buffer_len = vspprintf(&buffer, PG(log_errors_max_len), format, args);
+
+	if((EG(error_reporting) & type || (type & E_CORE)) && (PG(log_errors) || PG(display_errors))) {
+		char *error_type_str;
+
+		switch (type) {
+			case E_ERROR:
+			case E_CORE_ERROR:
+			case E_COMPILE_ERROR:
+			case E_USER_ERROR:
+				error_type_str = "Fatal error";
+				break;
+			case E_WARNING:
+			case E_CORE_WARNING:
+			case E_COMPILE_WARNING:
+			case E_USER_WARNING:
+				error_type_str = "Warning";
+				break;
+			case E_PARSE:
+				error_type_str = "Parse error";
+				break;
+			case E_NOTICE:
+			case E_USER_NOTICE:
+				error_type_str = "Notice";
+				break;
+			default:
+				error_type_str = "Unknown error";
+				break;
+		}
+
+		if(PG(log_errors)) {
+			char *log_buffer;
+			spprintf(&log_buffer, 0, "PHP %s:  %s in %s on line %d", error_type_str, buffer, error_filename, error_lineno);
+			php_log_err(log_buffer TSRMLS_CC);
+			efree(log_buffer);
+		}
+
+		if(PG(display_errors)) {
+			char *prepend_string = INI_STR("error_prepend_string");
+			char *append_string = INI_STR("error_append_string");
+			char *error_format = "%s\n%s: %s in %s on line %d\n%s";
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, error_format, STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string));
+		}
+	}
+
+	// Bail out if we can't recover 
+	switch(type) {
+		case E_CORE_ERROR:
+		case E_ERROR:
+			//case E_PARSE: the parser would return 1 (failure), we can bail out nicely 
+		case E_COMPILE_ERROR:
+		case E_USER_ERROR:
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "\nPHP: %s exiting\n", error_filename);
+			EG(exit_status) = 255;
+#if MEMORY_LIMIT
+			// restore memory limit 
+			AG(memory_limit) = PG(memory_limit);
+#endif
+			efree(buffer);
+			zend_bailout();
+			return;
+	}
+
+	// Log if necessary 
+	if(PG(track_errors) && EG(active_symbol_table)) {
+		pval *tmp;
+
+		ALLOC_ZVAL(tmp);
+		INIT_PZVAL(tmp);
+		Z_STRVAL_P(tmp) = (char *) estrndup(buffer, buffer_len);
+		Z_STRLEN_P(tmp) = buffer_len;
+		Z_TYPE_P(tmp) = IS_STRING;
+		zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, sizeof(pval *), NULL);
+	}
+	efree(buffer);
+}
+
+
+static void mod_php_log_message(char *message)
+{
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s\n", message);
+}
+
+typedef void (*sapi_error_function_t)(int type, const char *error_msg, ...);
+
+
+
 static void php_function(switch_core_session_t *session, char *data)
 {
 	char *uuid = switch_core_session_get_uuid(session);
-	uint32_t ulen = strlen(uuid);
-	uint32_t len = strlen((char *) data) + ulen + 2;
+	size_t ulen = strlen(uuid);
+	size_t len = strlen((char *) data) + ulen + 2;
 	char *mydata = switch_core_session_alloc(session, len);
 	int argc, retval;
 	char *argv[5];
-	char php_code[1024]; 
+	char php_code[1024];
 	void*** tsrm_ls = NULL;
-	
-	
+	zend_file_handle script;
+	zval *php_uuid;
+
 	snprintf(mydata, len, "%s %s", uuid, data);
 
-	argc = 1; //switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
+	argc = switch_separate_string(mydata, ' ',argv,(sizeof(argv) / sizeof(argv[0])));
 
-	//sprintf(php_code, "$uuid=\"%s\"; include(\"%s\");\n", argv[0], argv[1]);
-	sprintf(php_code, "include('%s');", argv[1]);
+	sprintf(php_code, "uuid=\"%s\"; include(\"%s\");\n", argv[0], argv[1]);
 
-	zend_file_handle script;
+	sprintf(php_code, "%s %s", data, uuid);
+
 	script.type = ZEND_HANDLE_FP;
 	script.filename = data;
 	script.opened_path = NULL;
 	script.free_filename = 0;
-	script.handle.fp = fopen(script.filename, "rb");	
+	script.handle.fp = fopen(script.filename, "rb");
 
-	//php_embed_init(argc, argv, &tsrm_ls);
-	if (php_request_startup(TSRMLS_C) == FAILURE) {
-		return;
-        }
+	// Initialize PHPs CORE
+	php_embed_init(argc, argv, &tsrm_ls);
 
+	// Return All of the DEBUG crap to the console and/or a log file
+	php_embed_module.ub_write = sapi_mod_php_ub_write;
+	php_embed_module.log_message = mod_php_log_message;
+	php_embed_module.sapi_error = (sapi_error_function_t)mod_php_error_handler;
+
+	// Let the nice people know we are about to start their script
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Starting Script %s\n",data);
 
-	retval = php_execute_script(&script TSRMLS_CC);	
-	php_request_shutdown(NULL);
+	// Force $uuid and $session to exist in PHPs memory space
+	MAKE_STD_ZVAL(php_uuid);
 
-        return;
+#ifdef _MSC_VER
+//disable warnings for malformed macros from header files
+#pragma warning(push)
+#pragma warning(disable:4127 4267)
+#endif
 
+	ZVAL_STRING(php_uuid, uuid , 1);
+	ZEND_SET_SYMBOL(&EG(symbol_table), "uuid", php_uuid);
 
-	//PHP_EMBED_START_BLOCK(argc, argv);
-		//void*** tsrm_ls = NULL;
-		//zend_error_cb = myapp_php_error_cb;
-		//zend_eval_string(php_code, NULL, "MOD_PHP" TSRMLS_CC);
-//		zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 1, &script);
-		//if (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 1, &script) == SUCCESS)
-		    //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "There was a problem with the file\n");
-		//PHP_EMBED_END_BLOCK();
-//	php_embed_shutdown(tsrm_ls);
-		
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
 
-	//}else{
-	//    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "There was a problem with the file\n");	   
-	//}
+	// Execute the bloody script
+	retval = php_execute_script(&script TSRMLS_CC);
 
+	// Clean up after PHP and such
+	php_embed_shutdown(tsrm_ls);
 
+	// Return back to the Dialplan
+
+// Buh bye now!
 }
 
 static const switch_application_interface_t php_application_interface = {
-	/*.interface_name */ "php",
-	/*.application_function */ php_function
+        /*.interface_name */ "php",
+        /*.application_function */ php_function
 };
 
 static switch_loadable_module_interface_t php_module_interface = {
-	/*.module_name */ modname,
-	/*.endpoint_interface */ NULL,
-	/*.timer_interface */ NULL,
-	/*.dialplan_interface */ NULL,
-	/*.codec_interface */ NULL,
-	/*.application_interface */ &php_application_interface,
-	/*.api_interface */ NULL,
-	/*.file_interface */ NULL,
-	/*.speech_interface */ NULL,
-	/*.directory_interface */ NULL
+        /*.module_name */ modname,
+        /*.endpoint_interface */ NULL,
+        /*.timer_interface */ NULL,
+        /*.dialplan_interface */ NULL,
+        /*.codec_interface */ NULL,
+        /*.application_interface */ &php_application_interface,
+        /*.api_interface */ NULL,
+        /*.file_interface */ NULL,
+        /*.speech_interface */ NULL,
+        /*.directory_interface */ NULL
 };
 
-/*SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
 {
-	// connect my internal structure to the blank pointer passed to me 
+	void*** tsrm_ls = NULL;
+
+	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = &php_module_interface;
-	
-	sapi_startup(&mod_php_sapi_module);
-        mod_php_sapi_module.startup(&mod_php_sapi_module);
 
+#ifdef ZTS
+	tsrm_startup(1, 1, 0, NULL);
+	compiler_globals = ts_resource(compiler_globals_id);
+	executor_globals = ts_resource(executor_globals_id);
+	core_globals = ts_resource(core_globals_id);
+	sapi_globals = ts_resource(sapi_globals_id);
+	tsrm_ls = ts_resource(0);
+#endif
 
-	//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Hello World!\n");
-
-	// indicate that the module should continue to be loaded 
+	/* indicate that the module should continue to be loaded */
 	return SWITCH_STATUS_SUCCESS;
 }
-*/
 
 /*
-  Called when the system shuts down
+  //Called when the system shuts down
   SWITCH_MOD_DECLARE(switch_status) switch_module_shutdown(void)
   {
   return SWITCH_STATUS_SUCCESS;
   }
-*/
 
-/*
-  If it exists, this is called in it's own thread when the module-load completes
+  //If it exists, this is called in it's own thread when the module-load completes
   SWITCH_MOD_DECLARE(switch_status) switch_module_shutdown(void)
   {
   return SWITCH_STATUS_SUCCESS;
   }
-*/
 
-
-zend_module_entry mod_php_module_entry = {
-        STANDARD_MODULE_HEADER,
-        "mod_php",
-        NULL,
-        NULL,
-        NULL,
-        NULL,
-        NULL,
-        NULL,
-        NO_VERSION_YET,
-        STANDARD_MODULE_PROPERTIES
-};
-
-
-static int sapi_mod_php_ub_write(const char *str, unsigned int str_length TSRMLS_DC)
-{ // This function partly based on code from asterisk_php
-
-  FILE *fp = fopen("mod_php.log", "a");
-  fwrite(str, str_length, sizeof(char), fp);
-  fclose(fp);
-
-
-        char buffer[4096];
-        int i, j = 0;
-        for(i = 0; i < str_length; i++) {
-                buffer[j++] = str[i];
-                if(str[i] == 10) { /* new line */
-                        buffer[j] = 0;
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s", buffer);
-                        j = 0;
-                }
-                else if(str[i] == 0) { /* null character */
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s", buffer);
-                        j = 0;
-                }
-                if(j == 4095) { /* don't overfill buffer */
-                        buffer[j] = 0;
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s", buffer);
-                        j = 0;
-                }
-        }
-        if(j) { /* stuff left over */
-                buffer[j] = 0;
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s", buffer);
-        }
-        return str_length;
-}
-
-
-void mod_php_error_handler(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args)
-{
-        char *buffer;
-        int buffer_len;
-        TSRMLS_FETCH();
-
-        buffer_len = vspprintf(&buffer, PG(log_errors_max_len), format, args);
-
-        if((EG(error_reporting) & type || (type & E_CORE)) && (PG(log_errors) || PG(display_errors))) {
-                char *error_type_str;
-
-                switch (type) {
-                        case E_ERROR:
-                        case E_CORE_ERROR:
-                        case E_COMPILE_ERROR:
-                        case E_USER_ERROR:
-                                error_type_str = "Fatal error";
-                                break;
-                        case E_WARNING:
-                        case E_CORE_WARNING:
-                        case E_COMPILE_WARNING:
-                        case E_USER_WARNING:
-                                error_type_str = "Warning";
-                                break;
-                        case E_PARSE:
-                                error_type_str = "Parse error";
-                                break;
-                        case E_NOTICE:
-                        case E_USER_NOTICE:
-                                error_type_str = "Notice";
-                                break;
-                        default:
-                                error_type_str = "Unknown error";
-                                break;
-                }
-
-                if(PG(log_errors)) {
-                        char *log_buffer;
-#ifdef PHP_WIN32
-                        if(type == E_CORE_ERROR || type == E_CORE_WARNING) {
-                                MessageBox(NULL, buffer, error_type_str, MB_OK|ZEND_SERVICE_MB_STYLE);
-                        }
-#endif
-                        spprintf(&log_buffer, 0, "PHP %s:  %s in %s on line %d", error_type_str, buffer, error_filename, error_lineno);
-                        php_log_err(log_buffer TSRMLS_CC);
-                        efree(log_buffer);
-                }
-
-                if(PG(display_errors)) {
-                        char *prepend_string = INI_STR("error_prepend_string");
-                        char *append_string = INI_STR("error_append_string");
-                        char *error_format = "%s\n%s: %s in %s on line %d\n%s";
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, error_format, STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, 
-STR_PRINT(append_string));
-                }
-        }
-
-        /* Bail out if we can't recover */
-        switch(type) {
-                case E_CORE_ERROR:
-                case E_ERROR:
-                /*case E_PARSE: the parser would return 1 (failure), we can bail out nicely */
-                case E_COMPILE_ERROR:
-                case E_USER_ERROR:
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "\nPHP: %s exiting\n", error_filename);
-                        EG(exit_status) = 255;
-#if MEMORY_LIMIT
-                        /* restore memory limit */
-                        AG(memory_limit) = PG(memory_limit);
-#endif
-                        efree(buffer);
-                        zend_bailout();
-                        return;
-                        break;
-        }
-
-        /* Log if necessary */
-        if(PG(track_errors) && EG(active_symbol_table)) {
-                pval *tmp;
-
-                ALLOC_ZVAL(tmp);
-                INIT_PZVAL(tmp);
-                Z_STRVAL_P(tmp) = (char *) estrndup(buffer, buffer_len);
-                Z_STRLEN_P(tmp) = buffer_len;
-                Z_TYPE_P(tmp) = IS_STRING;
-                zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, sizeof(pval *), NULL);
-        }
-        efree(buffer);
-}
-
-static int sapi_mod_php_header_handler(sapi_header_struct * sapi_header, sapi_headers_struct * sapi_headers TSRMLS_DC)
-{
-        return 0;
-}
-
-static int sapi_mod_php_send_headers(sapi_headers_struct * sapi_headers TSRMLS_DC)
-{
-        return SAPI_HEADER_SENT_SUCCESSFULLY;
-}
-
-static int sapi_mod_php_read_post(char *buffer, uint count_bytes TSRMLS_DC)
-{
-        return 0;
-}
-
-static int mod_php_startup(sapi_module_struct *sapi_module)
-{
-        if(php_module_startup(sapi_module, &mod_php_module_entry, 1) == FAILURE) {
-                return FAILURE;
-        }
-        return SUCCESS;
-}
-
-static void mod_php_log_message(char *message)
-{
-         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s\n", message);
-}
-
-
-static char *sapi_mod_php_read_cookies(TSRMLS_D)
-{
-        return NULL;
-}
-
-static int mod_php_startup(sapi_module_struct *sapi_module);
-
-sapi_module_struct mod_php_sapi_module = {
-   "mod_php",                                  /* name */
-   "mod_php",                                  /* pretty name */
-
-   mod_php_startup,                        /* startup */
-   NULL,                 /* shutdown */
-
-   NULL,                                        /* activate */
-   NULL,                                        /* deactivate */
-
-   sapi_mod_php_ub_write,                      /* unbuffered write */
-   NULL,                                        /* flush */
-   NULL,                                        /* get uid */
-   NULL,                                        /* getenv */
-
-   php_error,                                   /* error handler */
-
-   sapi_mod_php_header_handler,                /* header handler */
-   sapi_mod_php_send_headers,                  /* send headers handler */
-   NULL,                                        /* send header handler */
-
-   sapi_mod_php_read_post,                     /* read POST data */
-   sapi_mod_php_read_cookies,                  /* read Cookies */
-
-   NULL,					/* register server variables */
-   mod_php_log_message,                        /* Log message */
-   NULL,                                        /* Get request time */
-
-   NULL,                                        /* Block interruptions */
-   NULL,                                        /* Unblock interruptions */
-
-   STANDARD_SAPI_MODULE_PROPERTIES
-};
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
-{
-        /* connect my internal structure to the blank pointer passed to me */
-        *module_interface = &php_module_interface;
-
-        sapi_startup(&mod_php_sapi_module);
-        mod_php_sapi_module.startup(&mod_php_sapi_module);
-
-
-        //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Hello World!\n");
-
-        /* indicate that the module should continue to be loaded */
-        return SWITCH_STATUS_SUCCESS;
-}
+*/

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_php/switch_swig.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_php/switch_swig.c	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_php/switch_swig.c	Mon Sep 18 11:45:43 2006
@@ -257,6 +257,7 @@
         switch_core_session_t *peer_session;
         unsigned int timelimit = 60;
         char *var;
+		switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
 
         caller_channel = switch_core_session_get_channel(session);
         assert(caller_channel != NULL);
@@ -265,7 +266,7 @@
                 timelimit = atoi(var);
         }
         
-        if (switch_ivr_originate(session, &peer_session, bridgeto, timelimit, NULL, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
+        if (switch_ivr_originate(session, &peer_session, &cause, bridgeto, timelimit, NULL, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create Outgoing Channel!\n");
                 switch_channel_hangup(caller_channel, SWITCH_CAUSE_REQUESTED_CHAN_UNAVAIL);
                 return;

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_python/Makefile
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_python/Makefile	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_python/Makefile	Mon Sep 18 11:45:43 2006
@@ -1,13 +1,13 @@
-LCFLAGS=-fPIC -DZTS -DPTHREADS -Xlinker -export-dynamic
+LCFLAGS=-fPIC
 CFLAGS += -fPIC -I$(PREFIX)/include/python2.4/
 PYMOD=freeswitch
-LDFLAGS=-lpython2.4 -Xlinker -export-dynamic -L$(PREFIX)/lib/python2.4/config/
+LDFLAGS=-lpython2.4 -Xlinker -L$(PREFIX)/lib/python2.4/config/
 
 all:	depends $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(PYMOD).$(DYNAMIC_LIB_EXTEN)
 
 depends:
-	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install Python-2.4.3.tgz --prefix=$(PREFIX) 
-	
+	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install Python-2.4.3.tgz --prefix=$(PREFIX) --enable-threads
+
 %.o:  %.c
 	$(CC) $(LCFLAGS) $(CFLAGS) -c $< -o $@
 
@@ -39,4 +39,4 @@
 install:
 	#cp -f py_$(PYMOD).$(DYNAMIC_LIB_EXTEN) $(MDIR)
 	cp -f $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(PREFIX)/mod
-	
+

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_python/mod_python.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_python/mod_python.c	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_python/mod_python.c	Mon Sep 18 11:45:43 2006
@@ -29,6 +29,8 @@
  *
  */
 
+#include <Python.h>
+
 #ifndef _REENTRANT
 #define _REENTRANT
 #endif
@@ -36,8 +38,6 @@
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #endif
-
-#include <Python.h>
 
 #include <switch.h>
 

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_python/switch_swig.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_python/switch_swig.c	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_python/switch_swig.c	Mon Sep 18 11:45:43 2006
@@ -257,6 +257,7 @@
         switch_core_session_t *peer_session;
         unsigned int timelimit = 60;
         char *var;
+		switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
 
         caller_channel = switch_core_session_get_channel(session);
         assert(caller_channel != NULL);
@@ -265,7 +266,7 @@
                 timelimit = atoi(var);
         }
         
-        if (switch_ivr_originate(session, &peer_session, bridgeto, timelimit, NULL, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
+        if (switch_ivr_originate(session, &peer_session, &cause, bridgeto, timelimit, NULL, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create Outgoing Channel!\n");
                 switch_channel_hangup(caller_channel, SWITCH_CAUSE_REQUESTED_CHAN_UNAVAIL);
                 return;

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_ruby/README
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_ruby/README	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_ruby/README	Mon Sep 18 11:45:43 2006
@@ -1,5 +1,8 @@
-Sorry guys..  Due to licensing its not being populated. 
-When the license issue is fixed then I will populate it.
+Well here is what I know.  As of now more or less the license
+maybe compatible.  I am releasing with the clause that if the
+author of Ruby comes back and doesnt offer a license to us I 
+will be pulling it back from the tree.  Im sorry but licensing
+is licensing.  
 
 --Brian Fertig
   mod_ruby - Developer/Maintainer

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/Makefile
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/Makefile	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/Makefile	Mon Sep 18 11:45:43 2006
@@ -69,7 +69,7 @@
 
 depends:
 	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) mozilla.tar.gz --prefix=$(PREFIX)
-	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install curl-7.15.2.tar.gz --prefix=$(PREFIX)
+	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install curl-7.15.2.tar.gz --prefix=$(PREFIX) --without-libidn
 	MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install libetpan-0.45.tar.gz --prefix=$(PREFIX)
 
 $(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c

Modified: freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	(original)
+++ freeswitch/branches/mishehu/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	Mon Sep 18 11:45:43 2006
@@ -1390,6 +1390,7 @@
 {
 	switch_memory_pool_t *pool = NULL;
 	if (argc > 1) {
+		switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
 		struct js_session *jss = NULL;
 		JSObject *session_obj;
 		switch_core_session_t *session = NULL, *peer_session = NULL;
@@ -1471,7 +1472,7 @@
 												   context,
 												   dest);
 		
-		if (switch_ivr_originate(session, &peer_session, dest, to ? atoi(to) : 60, NULL, NULL, NULL, caller_profile) != SWITCH_STATUS_SUCCESS) {
+		if (switch_ivr_originate(session, &peer_session, &cause, dest, to ? atoi(to) : 60, NULL, NULL, NULL, caller_profile) != SWITCH_STATUS_SUCCESS) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot Create Outgoing Channel! [%s]\n", dest);
 			return JS_TRUE;
 		}

Modified: freeswitch/branches/mishehu/src/mod/loggers/mod_syslog/mod_syslog.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/loggers/mod_syslog/mod_syslog.c	(original)
+++ freeswitch/branches/mishehu/src/mod/loggers/mod_syslog/mod_syslog.c	Mon Sep 18 11:45:43 2006
@@ -103,42 +103,19 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **interface, char *filename)
-{
-	switch_status_t status;
-	*interface = &console_module_interface;
-
-	if ((status=load_config()) != SWITCH_STATUS_SUCCESS) {
-		return status;
-	}
-
-	openlog(globals.ident, LOG_PID, LOG_USER);
-
-	switch_log_bind_logger(mod_syslog_logger, SWITCH_LOG_DEBUG);
-	
-	return SWITCH_STATUS_SUCCESS;
-}
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_unload(const switch_loadable_module_interface_t **interface)
-{
-	closelog();
-	
-	return SWITCH_STATUS_SUCCESS;
-}
-
 static switch_status_t load_config(void)
 {
-	switch_config_t cfg;
-	char *var, *val;
 	char *cf = "syslog.conf";
+	switch_xml_t cfg, xml, settings, param;
 
-	memset(&globals, 0, sizeof(globals));
-
-	if (switch_config_open_file(&cfg, cf)) {
+	if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
+	} else {
+		if ((settings = switch_xml_child(cfg, "settings"))) {
+			for (param = switch_xml_child(settings, "param"); param; param = param->next) {
+				char *var = (char *) switch_xml_attr_soft(param, "name");
+				char *val = (char *) switch_xml_attr_soft(param, "value");
 
-		while (switch_config_next_pair(&cfg, &var, &val)) {
-			if (!strcasecmp(cfg.category, "settings")) {
 				if (!strcmp(var, "ident")) {
 					set_global_ident(val);
 				} else if (!strcmp(var, "facility")) {
@@ -148,12 +125,12 @@
 				} else if (!strcmp(var, "level")) {
 					set_global_level(val);;
 				}
+	
 			}
 		}
-
-		switch_config_close_file(&cfg);
+		switch_xml_free(xml);
 	}
-	
+
 	if (switch_strlen_zero(globals.ident)) {
 		set_global_ident(DEFAULT_IDENT);
 	}
@@ -167,5 +144,30 @@
 		set_global_level(DEFAULT_LEVEL);
 	}
 
+
+	return 0;
+}
+
+SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **interface, char *filename)
+{
+	switch_status_t status;
+	*interface = &console_module_interface;
+
+	if ((status=load_config()) != SWITCH_STATUS_SUCCESS) {
+		return status;
+	}
+
+	openlog(globals.ident, LOG_PID, LOG_USER);
+
+	switch_log_bind_logger(mod_syslog_logger, SWITCH_LOG_DEBUG);
+	
 	return SWITCH_STATUS_SUCCESS;
 }
+
+SWITCH_MOD_DECLARE(switch_status_t) switch_module_unload(const switch_loadable_module_interface_t **interface)
+{
+	closelog();
+	
+	return SWITCH_STATUS_SUCCESS;
+}
+

Modified: freeswitch/branches/mishehu/src/mod/timers/mod_softtimer/mod_softtimer.c
==============================================================================
--- freeswitch/branches/mishehu/src/mod/timers/mod_softtimer/mod_softtimer.c	(original)
+++ freeswitch/branches/mishehu/src/mod/timers/mod_softtimer/mod_softtimer.c	Mon Sep 18 11:45:43 2006
@@ -32,82 +32,131 @@
 #include <switch.h>
 #include <stdio.h>
 
-static const char modname[] = "mod_softtimer";
+static switch_memory_pool_t *module_pool = NULL;
 
-#ifdef WIN32
-//#define WINTIMER
-#endif
+static struct {
+	int32_t RUNNING;
+	switch_mutex_t *mutex;
+	uint32_t timer_milliseconds;
+	switch_interval_time_t timer_microseconds;
+} globals;
 
+static const char modname[] = "mod_softtimer";
+#define MAX_ELEMENTS 1000
+
 struct timer_private {
-#ifdef WINTIMER
-	LARGE_INTEGER freq;
-	LARGE_INTEGER base;
-	LARGE_INTEGER now;
-#else
-	switch_time_t reference;
-#endif
+    uint64_t reference;
 };
+typedef struct timer_private timer_private_t;
 
-static switch_status_t soft_timer_init(switch_timer_t *timer)
-{
-	struct timer_private *private;
+struct timer_matrix {
+	uint64_t tick;
+	uint32_t count;
+};
+typedef struct timer_matrix timer_matrix_t;
 
-	private = switch_core_alloc(timer->memory_pool, sizeof(*private));
-	timer->private_info = private;
+static timer_matrix_t TIMER_MATRIX[MAX_ELEMENTS+1];
 
-#ifdef WINTIMER
-	QueryPerformanceFrequency(&private->freq);
-	QueryPerformanceCounter(&private->base);
-#else
-	private->reference = switch_time_now();
-#endif
+#define IDLE_SPEED 100
 
-	return SWITCH_STATUS_SUCCESS;
-}
 
-static switch_status_t soft_timer_next(switch_timer_t *timer)
+static inline void set_timer(void)
 {
-	struct timer_private *private = timer->private_info;
+	uint32_t index = 0, min = IDLE_SPEED;
 
-#ifdef WINTIMER
-	private->base.QuadPart += timer->interval * (private->freq.QuadPart / 1000);
-	for (;;) {
-		QueryPerformanceCounter(&private->now);
-		if (private->now.QuadPart >= private->base.QuadPart) {
-			break;
+	for(index = 0; index < MAX_ELEMENTS; index++) {
+		if (TIMER_MATRIX[index].count) {
+			if (min > index) {
+				min = index;
+			}
 		}
-		switch_yield(100);
 	}
-#else
-	private->reference += timer->interval * 1000;
 
-	while (switch_time_now() < private->reference) {
-		switch_yield(1000);
+	globals.timer_milliseconds = min;
+	globals.timer_microseconds = min * 1000;
+}
+
+static inline switch_status_t timer_init(switch_timer_t *timer)
+{
+	timer_private_t *private_info;
+
+	if ((private_info = switch_core_alloc(timer->memory_pool, sizeof(*private_info)))) {
+		switch_mutex_lock(globals.mutex);
+		TIMER_MATRIX[timer->interval].count++;
+		switch_mutex_unlock(globals.mutex);
+		timer->private_info = private_info;
+		private_info->reference = TIMER_MATRIX[timer->interval].tick;
+		set_timer();
+
+		return SWITCH_STATUS_SUCCESS;
 	}
-#endif
 
+	return SWITCH_STATUS_MEMERR;
+}
+
+static inline switch_status_t timer_step(switch_timer_t *timer)
+{
+	timer_private_t *private_info = timer->private_info;
+
+	private_info->reference += timer->interval;
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
+
+static inline switch_status_t timer_next(switch_timer_t *timer)
+{
+	timer_private_t *private_info = timer->private_info;
+
+	timer_step(timer);
+	while (TIMER_MATRIX[timer->interval].tick < private_info->reference) {
+		switch_yield(1000);
+	}
 	timer->samplecount += timer->samples;
 
 	return SWITCH_STATUS_SUCCESS;
 }
 
-static switch_status_t soft_timer_destroy(switch_timer_t *timer)
+static inline switch_status_t timer_check(switch_timer_t *timer)
+
 {
+	timer_private_t *private_info = timer->private_info;
+	switch_status_t status;
+
+	if (TIMER_MATRIX[timer->interval].tick < private_info->reference) {
+		status = SWITCH_STATUS_FALSE;
+	} else {
+		private_info->reference += timer->interval;
+		status = SWITCH_STATUS_SUCCESS;
+	}
+
+	return status;
+}
+
+
+static inline switch_status_t timer_destroy(switch_timer_t *timer)
+{
+	switch_mutex_lock(globals.mutex);
+	TIMER_MATRIX[timer->interval].count--;
+	switch_mutex_unlock(globals.mutex);
+	set_timer();
 	timer->private_info = NULL;
 	return SWITCH_STATUS_SUCCESS;
 }
 
-static const switch_timer_interface_t soft_timer_interface = {
+static const switch_timer_interface_t timer_interface = {
 	/*.interface_name */ "soft",
-	/*.timer_init */ soft_timer_init,
-	/*.timer_next */ soft_timer_next,
-	/*.timer_destroy */ soft_timer_destroy
+	/*.timer_init */ timer_init,
+	/*.timer_next */ timer_next,
+	/*.timer_step */ timer_step,
+	/*.timer_check */ timer_check,
+	/*.timer_destroy */ timer_destroy
 };
 
-static const switch_loadable_module_interface_t mod_timers_module_interface = {
+static const switch_loadable_module_interface_t mod_softtimer_module_interface = {
 	/*.module_name */ modname,
 	/*.endpoint_interface */ NULL,
-	/*.timer_interface */ &soft_timer_interface,
+	/*.timer_interface */ &timer_interface,
 	/*.switch_dialplan_interface */ NULL,
 	/*.switch_codec_interface */ NULL,
 	/*.switch_application_interface */ NULL
@@ -116,9 +165,82 @@
 SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
 {
 
+	if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
+		return SWITCH_STATUS_MEMERR;
+	}
+
 	/* connect my internal structure to the blank pointer passed to me */
-	*module_interface = &mod_timers_module_interface;
+	*module_interface = &mod_softtimer_module_interface;
 
 	/* indicate that the module should continue to be loaded */
+	return SWITCH_STATUS_SUCCESS;
+}
+
+
+
+SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+{
+	switch_time_t reference = switch_time_now();
+	uint32_t current_ms = 0;
+	uint32_t x;
+	
+	memset(&globals, 0, sizeof(globals));
+	switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, module_pool);
+	globals.timer_microseconds = IDLE_SPEED  * 1000;
+	globals.timer_milliseconds = IDLE_SPEED;
+
+	globals.RUNNING = 1;
+
+	while(globals.RUNNING == 1) {
+		reference += globals.timer_microseconds;
+
+		while (switch_time_now() < reference) {
+			//switch_yield((reference - now) - 1000);
+			//switch_yield(globals.timer_microseconds >> 1);
+			switch_yield(1000);
+		}
+
+		current_ms += globals.timer_milliseconds;
+
+		for (x = 0; x < MAX_ELEMENTS; x++) {
+			int i = x, index;
+			if (i == 0) {
+				i = 1;
+			}
+			
+			index = (current_ms % i == 0) ? i : 0; 
+
+			if (TIMER_MATRIX[index].count) {
+				TIMER_MATRIX[index].tick += index;
+			}
+		}
+
+		if (current_ms == MAX_ELEMENTS) {
+			current_ms = 0;
+		}
+	}
+
+	switch_mutex_lock(globals.mutex);
+	globals.RUNNING = 0;
+	switch_mutex_unlock(globals.mutex);
+
+	return SWITCH_STATUS_TERM;
+}
+
+
+SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+{
+	
+	if (globals.RUNNING) {
+		switch_mutex_lock(globals.mutex);
+		globals.RUNNING = -1;
+		switch_mutex_unlock(globals.mutex);
+		
+		while (globals.RUNNING) {
+			switch_yield(10000);
+		}
+	}
+
 	return SWITCH_STATUS_SUCCESS;
 }

Modified: freeswitch/branches/mishehu/src/switch.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch.c	(original)
+++ freeswitch/branches/mishehu/src/switch.c	Mon Sep 18 11:45:43 2006
@@ -24,6 +24,7 @@
  * Contributor(s):
  * 
  * Anthony Minessale II <anthmct at yahoo.com>
+ * Michael Jerris <mike at jerris.com>
  *
  *
  * switch.c -- Main
@@ -62,7 +63,7 @@
 #ifdef WIN32
 	SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
 #else
-	nice(-20);
+	//nice(-19);
 #endif
 }
 

Modified: freeswitch/branches/mishehu/src/switch_buffer.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_buffer.c	(original)
+++ freeswitch/branches/mishehu/src/switch_buffer.c	Mon Sep 18 11:45:43 2006
@@ -39,7 +39,8 @@
 } switch_buffer_flag_t;
 
 struct switch_buffer {
-	unsigned char *data;
+	switch_byte_t *data;
+	switch_byte_t *front;
 	switch_size_t used;
 	switch_size_t datalen;
 	switch_size_t max_len;
@@ -56,6 +57,7 @@
 		&& (new_buffer->data = switch_core_alloc(pool, max_len)) != 0) {
 		new_buffer->datalen = max_len;
 		new_buffer->id = buffer_id++;
+		new_buffer->front = new_buffer->data;
 		*buffer = new_buffer;
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -84,6 +86,7 @@
 		new_buffer->datalen = start_len;
 		new_buffer->id = buffer_id++;
 		new_buffer->blocksize = blocksize;
+		new_buffer->front = new_buffer->data;
 		switch_set_flag(new_buffer, SWITCH_BUFFER_FLAG_DYNAMIC);
 		
 		*buffer = new_buffer;
@@ -163,8 +166,9 @@
 		reading = buffer->used;
 	}
 
-	memcpy(data, buffer->data, reading);
-	memmove(buffer->data, buffer->data + reading, buffer->datalen - reading);
+	memcpy(data, buffer->front, reading);
+
+	buffer->front += reading;
 	buffer->used -= reading;
 	//if (buffer->id == 3) printf("%u o %d = %d\n", buffer->id, (uint32_t)reading, (uint32_t)buffer->used);
 	return reading;
@@ -180,10 +184,15 @@
 
 	freespace = buffer->datalen - buffer->used;
 
+	if (buffer->front != buffer->data) {
+		memmove(buffer->data, buffer->front, buffer->used);
+		buffer->front = buffer->data;
+	}
+
 	if (switch_test_flag(buffer, SWITCH_BUFFER_FLAG_DYNAMIC)) {
 		if (freespace < datalen) {
 			switch_size_t new_size, new_block_size;
-
+			
 			new_size = buffer->datalen + datalen;
 			new_block_size = buffer->datalen + buffer->blocksize;
 
@@ -194,7 +203,6 @@
 			if (!(buffer->data = realloc(buffer->data, new_size))) {
 				return 0;
 			}
-			
 			buffer->datalen = new_size;
 		}
 	}

Modified: freeswitch/branches/mishehu/src/switch_channel.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_channel.c	(original)
+++ freeswitch/branches/mishehu/src/switch_channel.c	Mon Sep 18 11:45:43 2006
@@ -24,6 +24,7 @@
  * Contributor(s):
  * 
  * Anthony Minessale II <anthmct at yahoo.com>
+ * Michael Jerris <mike at jerris.com>
  *
  *
  * switch_channel.c -- Media Channel Interface
@@ -381,8 +382,14 @@
 
 SWITCH_DECLARE(switch_channel_state_t) switch_channel_get_state(switch_channel_t *channel)
 {
+	switch_channel_state_t state;
 	assert(channel != NULL);
-	return channel->state;
+
+	switch_mutex_lock(channel->flag_mutex);
+	state = channel->state;
+	switch_mutex_unlock(channel->flag_mutex);
+
+	return state;
 }
 
 SWITCH_DECLARE(unsigned int) switch_channel_ready(switch_channel_t *channel)
@@ -433,16 +440,18 @@
 
 
 	assert(channel != NULL);
+	switch_mutex_lock(channel->flag_mutex);
+
 	last_state = channel->state;
 
 	if (last_state == state) {
-		return state;
+		goto done;
 	}
 
 	if (last_state >= CS_HANGUP && state < last_state) {
-		return last_state;
+		goto done;
 	}
-
+	
 	/* STUB for more dev
 	   case CS_INIT:
 	   switch(state) {
@@ -566,7 +575,9 @@
 						  channel->name,
 						  state_names[last_state], 
 						  state_names[state]);
+		switch_mutex_lock(channel->flag_mutex);
 		channel->state = state;
+		switch_mutex_unlock(channel->flag_mutex);
 
 		if (state == CS_HANGUP && channel->hangup_cause == SWITCH_CAUSE_UNALLOCATED) {
 			channel->hangup_cause = SWITCH_CAUSE_NORMAL_CLEARING;
@@ -587,10 +598,11 @@
 				switch_event_fire(&event);
 			}
 		}
-		
+				
 		if (state < CS_DONE) {
 			switch_core_session_signal_state_change(channel->session);
 		}
+		
 	} else {
 		switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char *) file, func, line, SWITCH_LOG_WARNING, "%s Invalid State Change %s -> %s\n", 
 						  channel->name,
@@ -603,6 +615,8 @@
 			assert(0);
 		}
 	}
+ done:
+	switch_mutex_unlock(channel->flag_mutex);
 	return channel->state;
 }
 
@@ -851,6 +865,7 @@
 																   switch_call_cause_t hangup_cause)
 {
 	assert(channel != NULL);
+	switch_mutex_lock(channel->flag_mutex);
 
 	if (channel->times && !channel->times->hungup) {
 		channel->times->hungup = switch_time_now();
@@ -859,7 +874,6 @@
 	if (channel->state < CS_HANGUP) {
 		switch_event_t *event;
 		switch_channel_state_t last_state = channel->state;
-
 		channel->state = CS_HANGUP;
 		channel->hangup_cause = hangup_cause;
 		switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char *) file, func, line, SWITCH_LOG_NOTICE, "Hangup %s [%s] [%s]\n", 
@@ -874,6 +888,8 @@
 		switch_core_session_kill_channel(channel->session, SWITCH_SIG_KILL);
 		switch_core_session_signal_state_change(channel->session);
 	}
+
+	switch_mutex_unlock(channel->flag_mutex);
 	return channel->state;
 }
 

Modified: freeswitch/branches/mishehu/src/switch_core.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_core.c	(original)
+++ freeswitch/branches/mishehu/src/switch_core.c	Mon Sep 18 11:45:43 2006
@@ -24,6 +24,8 @@
  * Contributor(s):
  * 
  * Anthony Minessale II <anthmct at yahoo.com>
+ * Michael Jerris <mike at jerris.com>
+ * Paul D. Tinsley <pdt at jackhammer.org>
  *
  *
  * switch_core.c -- Main Core Library
@@ -39,6 +41,7 @@
 #endif
 
 //#define DEBUG_ALLOC
+#define DO_EVENTS
 
 #ifdef CRASH_PROT
 #define __CP "ENABLED"
@@ -140,6 +143,11 @@
 /* The main runtime obj we keep this hidden for ourselves */
 static struct switch_core_runtime runtime;
 
+/* Mutex and conditional for sql lite */
+static switch_mutex_t *SWITCH_SQL_MUTEX;
+static switch_thread_cond_t *SWITCH_SQL_CONDITIONAL;
+
+
 static void db_pick_path(char *dbname, char *buf, switch_size_t size)
 {
 
@@ -1050,7 +1058,27 @@
 
 }
 
+SWITCH_DECLARE(switch_status_t) switch_core_timer_step(switch_timer_t *timer)
+{
+	if (!timer->timer_interface) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer is not initilized!\n");
+		return SWITCH_STATUS_GENERR;
+	}
 
+	return timer->timer_interface->timer_step(timer);
+}
+
+SWITCH_DECLARE(switch_status_t) switch_core_timer_check(switch_timer_t *timer)
+{
+	if (!timer->timer_interface) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer is not initilized!\n");
+		return SWITCH_STATUS_GENERR;
+	}
+
+	return timer->timer_interface->timer_check(timer);
+}
+
+
 SWITCH_DECLARE(switch_status_t) switch_core_timer_destroy(switch_timer_t *timer)
 {
 	if (!timer->timer_interface) {
@@ -2352,7 +2380,7 @@
 static void switch_core_standard_on_hangup(switch_core_session_t *session)
 {
 
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard HANGUP %s\n", switch_channel_get_name(session->channel));
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard HANGUP %s, cause: %s\n", switch_channel_get_name(session->channel),switch_channel_cause2str(switch_channel_get_cause(session->channel)));
 
 }
 
@@ -2468,7 +2496,13 @@
 
 SWITCH_DECLARE(void) switch_core_session_signal_state_change(switch_core_session_t *session)
 {
-	switch_thread_cond_signal(session->cond);
+
+	/* If trylock fails the signal is already awake so we needn't bother */
+	if (switch_mutex_trylock(session->mutex) == SWITCH_STATUS_SUCCESS) {
+		switch_thread_cond_signal(session->cond);
+		switch_mutex_unlock(session->mutex);
+	} 
+	
 }
 
 SWITCH_DECLARE(unsigned int) switch_core_session_runing(switch_core_session_t *session)
@@ -2528,7 +2562,7 @@
 
 SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
 {
-	switch_channel_state_t state = CS_NEW, laststate = CS_HANGUP, midstate = CS_DONE;
+	switch_channel_state_t state = CS_NEW, laststate = CS_HANGUP, midstate = CS_DONE, endstate;
 	const switch_endpoint_interface_t *endpoint_interface;
 	const switch_state_handler_table_t *driver_state_handler = NULL;
 	const switch_state_handler_table_t *application_state_handler = NULL;
@@ -2593,7 +2627,7 @@
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State NEW\n", switch_channel_get_name(session->channel));
 				break;
 			case CS_DONE:
-				continue;
+				goto done;
 			case CS_HANGUP:	/* Deactivate and end the thread */
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State HANGUP\n", switch_channel_get_name(session->channel));
 				if (!driver_state_handler->on_hangup ||
@@ -2630,8 +2664,7 @@
 						switch_core_standard_on_hangup(session);
 					}
 				}
-				switch_channel_set_state(session->channel, CS_DONE);
-				midstate = switch_channel_get_state(session->channel);
+				goto done;
 				break;
 			case CS_INIT:		/* Basic setup tasks */
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State INIT\n", switch_channel_get_name(session->channel));
@@ -2860,14 +2893,26 @@
 			laststate = midstate;
 		}
 		
-		if (state < CS_DONE && midstate == switch_channel_get_state(session->channel)) {
+
+		endstate = switch_channel_get_state(session->channel);
+
+		if (endstate >= CS_HANGUP) {
+			goto done;
+		}
+
+		if (midstate == endstate) {
 			switch_thread_cond_wait(session->cond, session->mutex);
-		} 
+		}
+
 	}
+ done:
+	switch_mutex_unlock(session->mutex);
+
 #ifdef CRASH_PROT
 	apr_hash_set(runtime.stack_table, &thread_id, sizeof(thread_id), NULL);
 #endif
 	session->thread_running = 0;
+
 }
 
 SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session_t **session)
@@ -3170,20 +3215,23 @@
 	uint8_t trans = 0;
 	switch_time_t last_commit = switch_time_now();
 	uint32_t freq = 1000, target = 1000, diff = 0;
+
+	//if these are null we have big problems
+	assert(SWITCH_SQL_MUTEX != NULL);
+	assert(SWITCH_SQL_CONDITIONAL != NULL);
 	
 	if (!runtime.event_db) {
 		runtime.event_db = switch_core_db_handle();
 	}
 	switch_queue_create(&runtime.sql_queue, SWITCH_SQL_QUEUE_LEN, runtime.memory_pool);
+
+	switch_mutex_lock(SWITCH_SQL_MUTEX);
 	
 	for(;;) {
-		uint32_t work = 0;
-
 		if (switch_queue_trypop(runtime.sql_queue, &pop) == SWITCH_STATUS_SUCCESS) {
 			char *sql = (char *) pop;
 
 			if (sql) {
-				work++;
 				if (itterations == 0) {
 					char *isql = "begin transaction CORE1;";
 					if (switch_core_db_persistant_execute(runtime.event_db, isql, 25) != SWITCH_STATUS_SUCCESS) {
@@ -3203,6 +3251,15 @@
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "SQL thread ending\n");
 				break;
 			}
+		} else {
+			//Are we currently in a transaction, wait accordingly
+			if(trans) {
+				//we need to finish a transaction in a bit, wait around until we have more work or that time comes
+				switch_thread_cond_timedwait(SWITCH_SQL_CONDITIONAL, SWITCH_SQL_MUTEX, (freq * 1000)  + last_commit - switch_time_now());
+			} else {
+				//wait until we have more work
+				switch_thread_cond_wait(SWITCH_SQL_CONDITIONAL, SWITCH_SQL_MUTEX);
+			}
 		}
 		
 		if (diff < freq) {
@@ -3211,7 +3268,6 @@
 
 		if (trans && (itterations == target || diff >= freq)) {
 			char *sql = "end transaction CORE1";
-			work++;
 			if (switch_core_db_persistant_execute(runtime.event_db, sql, 25) != SWITCH_STATUS_SUCCESS) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SQL exec error! [%s]\n", sql);
 			}
@@ -3220,9 +3276,7 @@
 			trans = 0;
 			diff = 0;
 		}
-		if (!work) {
-			switch_yield(1000);
-		}
+		
 	}
 	return NULL;
 }
@@ -3235,6 +3289,10 @@
 	
 	assert(runtime.memory_pool != NULL);
 
+	//create the mutex and conditional
+	switch_mutex_init(&SWITCH_SQL_MUTEX, SWITCH_MUTEX_NESTED, runtime.memory_pool);
+	switch_thread_cond_create(&SWITCH_SQL_CONDITIONAL, runtime.memory_pool);
+
 	switch_threadattr_create(&thd_attr, runtime.memory_pool);
 	switch_threadattr_detach_set(thd_attr, 1);
 	switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
@@ -3242,7 +3300,7 @@
 	
 }
 
-
+#ifdef DO_EVENTS
 static void core_event_handler(switch_event_t *event)
 {
 	char *sql = NULL;
@@ -3342,9 +3400,20 @@
 
 	if (sql) {
 		switch_queue_push(runtime.sql_queue, sql);
+
+		//See if we need to wake up the sql thread
+		if(switch_mutex_trylock(SWITCH_SQL_MUTEX) == SWITCH_STATUS_SUCCESS) {
+                        //wake up the SQL thread
+                        switch_thread_cond_signal(SWITCH_SQL_CONDITIONAL);
+
+                        //give up our lock
+                        switch_mutex_unlock(SWITCH_SQL_MUTEX);
+		}
+
 		sql = NULL;
 	}
 }
+#endif
 
 SWITCH_DECLARE(void) switch_core_set_globals(void)
 {
@@ -3527,11 +3596,12 @@
 		switch_core_db_exec(runtime.db, create_channels_sql, NULL, NULL, NULL);
 		switch_core_db_exec(runtime.db, create_calls_sql, NULL, NULL, NULL);
 		switch_core_db_exec(runtime.db, create_interfaces_sql, NULL, NULL, NULL);
-		
+#ifdef DO_EVENTS		
 		if (switch_event_bind("core_db", SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL) !=
 			SWITCH_STATUS_SUCCESS) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind event handler!\n");
 		}
+#endif
 	}
 
 	runtime.session_id = 1;
@@ -3595,9 +3665,12 @@
 		switch_event_fire(&event);
 	}
 
+//#define USE_MLOCKALL
 #ifdef HAVE_MLOCKALL
+#ifdef USE_MLOCKALL
 	mlockall(MCL_CURRENT|MCL_FUTURE);
 #endif
+#endif
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "\nFreeSWITCH Version %s Started.\nCrash Protection [%s]\nMax Sessions[%u]\n\n", SWITCH_VERSION_FULL, __CP, switch_core_session_limit(0));
 	return SWITCH_STATUS_SUCCESS;
@@ -3643,6 +3716,15 @@
 	switch_event_shutdown();
 	
 	switch_queue_push(runtime.sql_queue, NULL);
+	//See if we need to wake up the sql thread
+	if(switch_mutex_trylock(SWITCH_SQL_MUTEX) == SWITCH_STATUS_SUCCESS) {
+		//wake up the SQL thread
+		switch_thread_cond_signal(SWITCH_SQL_CONDITIONAL);
+
+		//give up our lock
+		switch_mutex_unlock(SWITCH_SQL_MUTEX);
+	}
+
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Waiting for unfinished SQL transactions\n");
 	while (switch_queue_size(runtime.sql_queue) > 0) {
 		switch_yield(10000);

Modified: freeswitch/branches/mishehu/src/switch_event.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_event.c	(original)
+++ freeswitch/branches/mishehu/src/switch_event.c	Mon Sep 18 11:45:43 2006
@@ -24,6 +24,8 @@
  * Contributor(s):
  * 
  * Anthony Minessale II <anthmct at yahoo.com>
+ * Michael Jerris <mike at jerris.com>
+ * Paul D. Tinsley <pdt at jackhammer.org>
  *
  *
  * switch_event.c -- Event System
@@ -35,6 +37,9 @@
 static switch_event_node_t *EVENT_NODES[SWITCH_EVENT_ALL + 1] = { NULL };
 static switch_mutex_t *BLOCK = NULL;
 static switch_mutex_t *POOL_LOCK = NULL;
+static switch_mutex_t *EVENT_QUEUE_MUTEX = NULL;
+static switch_mutex_t *EVENT_QUEUE_HAVEMORE_MUTEX = NULL;
+static switch_thread_cond_t *EVENT_QUEUE_CONDITIONAL = NULL;
 static switch_memory_pool_t *RUNTIME_POOL = NULL;
 //static switch_memory_pool_t *APOOL = NULL;
 //static switch_memory_pool_t *BPOOL = NULL;
@@ -44,6 +49,7 @@
 
 static switch_hash_t *CUSTOM_HASH = NULL;
 static int THREAD_RUNNING = 0;
+static int EVENT_QUEUE_HAVEMORE = 0;
 
 #if 0
 static void *locked_alloc(switch_size_t len)
@@ -174,25 +180,56 @@
 	assert(obj == NULL);
 	assert(POOL_LOCK != NULL);
 	assert(RUNTIME_POOL != NULL);
+	assert(EVENT_QUEUE_MUTEX != NULL);
+	assert(EVENT_QUEUE_HAVEMORE_MUTEX != NULL);
+	assert(EVENT_QUEUE_CONDITIONAL != NULL);
 	THREAD_RUNNING = 1;
 	
 	queues[0] = EVENT_QUEUE[SWITCH_PRIORITY_HIGH];
 	queues[1] = EVENT_QUEUE[SWITCH_PRIORITY_NORMAL];
 	queues[2] = EVENT_QUEUE[SWITCH_PRIORITY_LOW];
+
+	switch_mutex_lock(EVENT_QUEUE_MUTEX);
 	
 	for(;;) {
 		int any;
 
+
 		len[1] = switch_queue_size(EVENT_QUEUE[SWITCH_PRIORITY_NORMAL]);
 		len[2] = switch_queue_size(EVENT_QUEUE[SWITCH_PRIORITY_LOW]);
 		len[0] = switch_queue_size(EVENT_QUEUE[SWITCH_PRIORITY_HIGH]);
 		any = len[1] + len[2] + len[0];
 
+	
 		if (!any) {
-			if (THREAD_RUNNING != 1) {
-				break;
+			//lock on havemore so we are the only ones poking at it while we check it
+			//see if we saw anything in the queues or have a check again flag
+			switch_mutex_lock(EVENT_QUEUE_HAVEMORE_MUTEX);
+			if(!EVENT_QUEUE_HAVEMORE) {
+				//See if we need to quit
+				if (THREAD_RUNNING != 1) {
+					//give up our lock
+					switch_mutex_unlock(EVENT_QUEUE_HAVEMORE_MUTEX);
+
+					//Game over
+					break;
+				}
+
+				//give up our lock
+				switch_mutex_unlock(EVENT_QUEUE_HAVEMORE_MUTEX);
+
+				//wait until someone tells us we have something to do
+				switch_thread_cond_wait(EVENT_QUEUE_CONDITIONAL, EVENT_QUEUE_MUTEX);
+			} else {
+				//Caught a race, one of the queues was updated after we looked at it
+				//reset our flag
+				EVENT_QUEUE_HAVEMORE = 0;
+
+				//Give up our lock
+				switch_mutex_unlock(EVENT_QUEUE_HAVEMORE_MUTEX);
 			}
-			switch_yield(1000);
+
+			//go grab some events
 			continue;
 		}
 
@@ -304,6 +341,27 @@
 	if (THREAD_RUNNING > 0) {
 		THREAD_RUNNING = -1;
 
+		//Lock on havemore to make sure he event thread, if currently running
+		// doesn't check the HAVEMORE flag before we set it
+		switch_mutex_lock(EVENT_QUEUE_HAVEMORE_MUTEX);
+		//See if the event thread is sitting
+		if(switch_mutex_trylock(EVENT_QUEUE_MUTEX) == SWITCH_STATUS_SUCCESS) {
+			//we don't need havemore anymore, the thread was sitting already
+			switch_mutex_unlock(EVENT_QUEUE_HAVEMORE_MUTEX);
+
+			//wake up the event thread
+			switch_thread_cond_signal(EVENT_QUEUE_CONDITIONAL);
+
+			//give up our lock
+			switch_mutex_unlock(EVENT_QUEUE_MUTEX);
+		} else { // it wasn't waiting which means we might have updated a queue it already looked at
+			//set a flag so it knows to read the queues again
+			EVENT_QUEUE_HAVEMORE = 1;
+
+			//variable updated, give up the mutex
+			switch_mutex_unlock(EVENT_QUEUE_HAVEMORE_MUTEX);
+		}
+
 		while (x < 100 && THREAD_RUNNING) {
 			switch_yield(1000);
 			if (THREAD_RUNNING == last) {
@@ -344,6 +402,9 @@
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Activate Eventing Engine.\n");
 	switch_mutex_init(&BLOCK, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
 	switch_mutex_init(&POOL_LOCK, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
+	switch_mutex_init(&EVENT_QUEUE_MUTEX, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
+	switch_mutex_init(&EVENT_QUEUE_HAVEMORE_MUTEX, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
+	switch_thread_cond_create(&EVENT_QUEUE_CONDITIONAL, RUNTIME_POOL);
 	switch_core_hash_init(&CUSTOM_HASH, RUNTIME_POOL);
 	switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
 	switch_thread_create(&thread, thd_attr, switch_event_thread, NULL, RUNTIME_POOL);
@@ -662,6 +723,10 @@
 
 	assert(BLOCK != NULL);
 	assert(RUNTIME_POOL != NULL);
+	assert(EVENT_QUEUE_HAVEMORE_MUTEX != NULL);
+	assert(EVENT_QUEUE_MUTEX != NULL);
+	assert(EVENT_QUEUE_CONDITIONAL != NULL);
+	assert(RUNTIME_POOL != NULL);
 
 	if (THREAD_RUNNING <= 0) {
 		/* sorry we're closed */
@@ -690,6 +755,29 @@
 	}
 
 	switch_queue_push(EVENT_QUEUE[(*event)->priority], *event);
+
+	//Lock on havemore to make sure he event thread, if currently running
+	// doesn't check the HAVEMORE flag before we set it
+	switch_mutex_lock(EVENT_QUEUE_HAVEMORE_MUTEX);
+	//See if the event thread is sitting
+	if(switch_mutex_trylock(EVENT_QUEUE_MUTEX) == SWITCH_STATUS_SUCCESS) {
+		//we don't need havemore anymore, the thread was sitting already
+		switch_mutex_unlock(EVENT_QUEUE_HAVEMORE_MUTEX);
+
+		//wake up the event thread
+		switch_thread_cond_signal(EVENT_QUEUE_CONDITIONAL);
+
+		//give up our lock
+		switch_mutex_unlock(EVENT_QUEUE_MUTEX);
+	} else { // it wasn't waiting which means we might have updated a queue it already looked at
+		//set a flag so it knows to read the queues again
+		EVENT_QUEUE_HAVEMORE = 1;
+
+		//variable updated, give up the mutex
+		switch_mutex_unlock(EVENT_QUEUE_HAVEMORE_MUTEX);
+	}
+		
+
 	*event = NULL;
 
 	return SWITCH_STATUS_SUCCESS;

Modified: freeswitch/branches/mishehu/src/switch_ivr.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_ivr.c	(original)
+++ freeswitch/branches/mishehu/src/switch_ivr.c	Mon Sep 18 11:45:43 2006
@@ -580,6 +580,8 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
+#define FILE_STARTSAMPLES 512 * 128
+#define FILE_BLOCKSIZE 1024
 SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *session, 
 												   switch_file_handle_t *fh,
 												   char *file,
@@ -589,7 +591,7 @@
 												   unsigned int buflen)
 {
 	switch_channel_t *channel;
-	short abuf[960];
+	int16_t abuf[FILE_STARTSAMPLES+1];
 	char dtmf[128];
 	uint32_t interval = 0, samples = 0;
 	uint32_t ilen = 0;
@@ -676,6 +678,9 @@
 	assert(read_codec != NULL);
 	interval = read_codec->implementation->microseconds_per_frame / 1000;
 
+	if (!fh->audio_buffer) {
+		switch_buffer_create_dynamic(&fh->audio_buffer, FILE_BLOCKSIZE, (FILE_STARTSAMPLES * sizeof(int16_t)) + FILE_BLOCKSIZE, 0);
+	} 
 
 	codec_name = "L16";
 
@@ -771,8 +776,10 @@
 			olen = ilen;
 			do_speed = 0;
 		} else {
-			olen = ilen;
+			olen = FILE_STARTSAMPLES;
 			switch_core_file_read(fh, abuf, &olen);
+			switch_buffer_write(fh->audio_buffer, abuf, olen * 2);
+			olen = switch_buffer_read(fh->audio_buffer, abuf, ilen * 2) / 2;
 		}
 
 		if (done || olen <= 0) {
@@ -796,9 +803,6 @@
 			short *bp = write_frame.data;
 			switch_size_t wrote = 0;
 			
-			if (!fh->audio_buffer) {
-				switch_buffer_create(fh->memory_pool, &fh->audio_buffer, SWITCH_RECCOMMENDED_BUFFER_SIZE);
-			} 
 			
 			supplement = (int) (factor * olen);
 			newlen = (fh->speed > 0) ? olen - supplement : olen + supplement;
@@ -872,6 +876,7 @@
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "done playing file\n");
 	switch_core_file_close(fh);
+	switch_buffer_destroy(&fh->audio_buffer);
 	switch_core_codec_destroy(&codec);
 
 	if (timer_name) {
@@ -1534,6 +1539,7 @@
 #define MAX_PEERS 256
 SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *session,
 													 switch_core_session_t **bleg,
+													 switch_call_cause_t *cause,
 													 char *bridgeto,
 													 uint32_t timelimit_sec,
 													 const switch_state_handler_table_t *table,
@@ -1554,7 +1560,7 @@
 	switch_channel_t *caller_channel = NULL;
 	switch_memory_pool_t *pool = NULL;
 	char *data = NULL;
-	int i, argc;
+	int i, argc = 0;
 	int32_t idx = -1;
 	switch_codec_t write_codec = {0};
 	switch_frame_t write_frame = {0};
@@ -1835,26 +1841,45 @@
 
 	if (switch_channel_test_flag(peer_channel, CF_ANSWERED) || switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA)) {
 		*bleg = peer_session;
+		status = SWITCH_STATUS_SUCCESS;
+	} else {
+		status = SWITCH_STATUS_FALSE;
+	}
+
+ done:
+	*cause = SWITCH_CAUSE_UNALLOCATED;
+
+	if (status == SWITCH_STATUS_SUCCESS) {
 		if (caller_channel) {
 			switch_channel_set_variable(caller_channel, "originate_disposition", "call accepted");
 		}
-		status = SWITCH_STATUS_SUCCESS;
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Originate Resulted in Success: [%s]\n", switch_channel_get_name(peer_channel));
 	} else {
+		if (peer_channel) {
+			*cause = switch_channel_get_cause(peer_channel);
+		} else {
+			for (i = 0; i < argc; i++) {
+				if (!peer_channels[i]) {
+					continue;
+				}
+				
+				*cause = switch_channel_get_cause(peer_channels[i]);
+				break;
+			}
+		}
 		if (caller_channel) {
-			switch_channel_set_variable(caller_channel, "originate_disposition", "no answer");
-			switch_channel_hangup(caller_channel, SWITCH_CAUSE_NO_ANSWER);
+			switch_channel_set_variable(caller_channel, "originate_disposition", switch_channel_cause2str(*cause));
 		}
-		status = SWITCH_STATUS_FALSE;
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Originate Resulted in Error Cause: %d [%s]\n", *cause, switch_channel_cause2str(*cause));
 	}
 
-
- done:
 	if (odata) {
 		free(odata);
 	}
 	if (!pass && write_codec.implementation) {
 		switch_core_codec_destroy(&write_codec);
 	}
+
 	return status;
 }
 

Modified: freeswitch/branches/mishehu/src/switch_rtp.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_rtp.c	(original)
+++ freeswitch/branches/mishehu/src/switch_rtp.c	Mon Sep 18 11:45:43 2006
@@ -161,7 +161,6 @@
 	uint32_t packet_size;
 	uint32_t rpacket_size;
 	switch_time_t last_read;
-	switch_time_t next_read;
 	uint32_t ms_per_packet;
 	uint32_t remote_port;
 	uint8_t stuncount;
@@ -171,6 +170,9 @@
 	uint8_t mini;
 	switch_payload_t te;
 	switch_mutex_t *flag_mutex;
+	switch_timer_t timer;
+	uint8_t ready;
+	switch_time_t last_time;
 };
 
 static int global_init = 0;
@@ -353,13 +355,14 @@
 }
 
 SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **new_rtp_session,
-												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_payload_t payload,
+												  uint32_t packet_size,
+												  uint32_t ms_per_packet,
+												  switch_rtp_flag_t flags, 
+												  char *crypto_key,
+												  char *timer_name,
+												  const char **err,
+												  switch_memory_pool_t *pool)
 {
 	switch_rtp_t *rtp_session = NULL;
 	srtp_policy_t policy;
@@ -456,7 +459,6 @@
 	rtp_session->payload = payload;
 	rtp_session->ms_per_packet = ms_per_packet;
 	rtp_session->packet_size = packet_size;
-	rtp_session->next_read = switch_time_now() + rtp_session->ms_per_packet;
 
 	if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_SECURE)) {
 		err_status_t stat;
@@ -473,26 +475,46 @@
 		}
 	}
 
+	if (timer_name) {
+		switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
+	}
+
+	if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER) && !timer_name) {
+		timer_name = "soft";
+	}
+
+	if (timer_name) {
+		if (switch_core_timer_init(&rtp_session->timer, timer_name, ms_per_packet / 1000, packet_size, rtp_session->pool) == SWITCH_STATUS_SUCCESS) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Starting timer [%s] %d bytes per %dms\n", timer_name, packet_size, ms_per_packet);
+		} else {
+			memset(&rtp_session->timer, 0, sizeof(rtp_session->timer));
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error starting timer [%s], async RTP disabled\n", timer_name);
+			switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
+		}
+	}
+
+	rtp_session->ready++;
 	*new_rtp_session = rtp_session;
 
 	return SWITCH_STATUS_SUCCESS;
 }
 
 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,
+											 char *timer_name,
+											 const char **err,
+											 switch_memory_pool_t *pool) 
 {
 	switch_rtp_t *rtp_session;
 
-	if (switch_rtp_create(&rtp_session, payload, packet_size, ms_per_packet, flags, crypto_key, err, pool) != SWITCH_STATUS_SUCCESS) {
+	if (switch_rtp_create(&rtp_session, payload, packet_size, ms_per_packet, flags, crypto_key, timer_name, err, pool) != SWITCH_STATUS_SUCCESS) {
 		return NULL;
 	}
 
@@ -540,21 +562,24 @@
 
 SWITCH_DECLARE(void) switch_rtp_kill_socket(switch_rtp_t *rtp_session)
 {
+	assert(rtp_session != NULL);
 	switch_mutex_lock(rtp_session->flag_mutex);
-	apr_socket_shutdown(rtp_session->sock, APR_SHUTDOWN_READWRITE);
-	switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_IO);
+	if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO)) {
+		assert(rtp_session->sock != NULL);
+		apr_socket_shutdown(rtp_session->sock, APR_SHUTDOWN_READWRITE);
+		switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_IO);
+	}
 	switch_mutex_unlock(rtp_session->flag_mutex);
 }
 
 SWITCH_DECLARE(uint8_t) switch_rtp_ready(switch_rtp_t *rtp_session)
 {
-	return (rtp_session != NULL && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO)) ? 1 : 0;
+	return (rtp_session != NULL && rtp_session->ready) ? 1 : 0;
 }
 
 SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp_t **rtp_session)
 {
-
-	if (!switch_test_flag((*rtp_session), SWITCH_RTP_FLAG_IO)) {
+	if (!switch_rtp_ready(*rtp_session)) {
 		return;
 	}
 
@@ -573,6 +598,10 @@
 		srtp_dealloc((*rtp_session)->send_ctx);
 	}
 
+	if ((*rtp_session)->timer.timer_interface) {
+		switch_core_timer_destroy(&(*rtp_session)->timer);
+	}
+
 	return;
 }
 
@@ -709,11 +738,19 @@
 {
 	switch_size_t bytes;
 	switch_status_t status;
+	uint8_t check = 1;
 
+	if (!rtp_session->timer.interval) {
+		rtp_session->last_time = switch_time_now();
+	}
 
 	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_STATUS_IS_BREAK(status) && rtp_session->timer.interval) {
+			switch_core_timer_step(&rtp_session->timer);
+		}
 		
 		if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BREAK)) {
 			switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_BREAK);
@@ -774,16 +811,13 @@
 			}
 		}
 
-		if ((switch_time_now() - rtp_session->next_read) > 1000) {
+		if (rtp_session->timer.interval) {
+			check = (uint8_t)(switch_core_timer_check(&rtp_session->timer) == SWITCH_STATUS_SUCCESS);
+		}
+
+		if (check) {
 			do_2833(rtp_session);
 
-			/* Set the next waypoint */
-			if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_TIMER_RECLOCK)) {
-				rtp_session->next_read = switch_time_now() + rtp_session->ms_per_packet;
-			} else {
-				rtp_session->next_read += rtp_session->ms_per_packet;
-			}
-
 			if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) {
 				/* We're late! We're Late!*/
 				if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK) && status == SWITCH_STATUS_BREAK) {
@@ -877,7 +911,6 @@
 	}
 
 	rtp_session->last_read = switch_time_now();
-	rtp_session->next_read += rtp_session->ms_per_packet;
 	*payload_type = rtp_session->recv_msg.header.pt;
 
 

Modified: freeswitch/branches/mishehu/src/switch_utils.c
==============================================================================
--- freeswitch/branches/mishehu/src/switch_utils.c	(original)
+++ freeswitch/branches/mishehu/src/switch_utils.c	Mon Sep 18 11:45:43 2006
@@ -204,9 +204,7 @@
 {
 	int nsds = 0;
 
-	if (switch_poll(poll, 1, &nsds, ms) != SWITCH_STATUS_SUCCESS) {
-		return -1;
-	}
+	switch_poll(poll, 1, &nsds, ms);
 
 	return nsds;
 }



More information about the Freeswitch-svn mailing list