Index: pjproject/trunk/pjmedia/build/pjmedia.vcproj
===================================================================
--- pjproject/trunk/pjmedia/build/pjmedia.vcproj	(revision 2746)
+++ pjproject/trunk/pjmedia/build/pjmedia.vcproj	(revision 2747)
@@ -35,12 +35,9 @@
 		<Configuration
 			Name="Release|Win32"
+			ConfigurationType="4"
 			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops"
-
+			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="2"
-
-			ConfigurationType="4"
-			UseOfMFC="0"
 			>
 			<Tool
@@ -61,7 +58,6 @@
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../include;../../pjlib/include;&quot;../../pjlib-util/include&quot;;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../..;&quot;$(DXSDK_DIR)include&quot;"
 				PreprocessorDefinitions="_LIB;"
-
-				AdditionalIncludeDirectories="../include;../../pjlib/include;&quot;../../pjlib-util/include&quot;;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../..;&quot;$(DXSDK_DIR)include&quot;"
 				PrecompiledHeaderFile=""
 			/>
@@ -96,11 +92,8 @@
 		<Configuration
 			Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)"
+			ConfigurationType="4"
 			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"
-
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -121,8 +114,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -139,5 +131,4 @@
 				Name="VCLibrarianTool"
 				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"
-
 			/>
 			<Tool
@@ -167,11 +158,8 @@
 		<Configuration
 			Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)"
+			ConfigurationType="4"
 			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"
-
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -192,8 +180,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -210,5 +197,4 @@
 				Name="VCLibrarianTool"
 				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"
-
 			/>
 			<Tool
@@ -237,13 +223,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug|Win32"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops"
-
+			Name="Release|Pocket PC 2003 (ARMV4)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
-			CharacterSet="2"
-
-			ConfigurationType="4"
-			UseOfMFC="0"
+			CharacterSet="1"
 			>
 			<Tool
@@ -264,68 +246,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
-				AdditionalIncludeDirectories="../include;../../pjlib/include;&quot;../../pjlib-util/include&quot;;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../..;&quot;$(DXSDK_DIR)include&quot;"
-				PrecompiledHeaderFile=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"
-
-			ATLMinimizesCRunTimeLibraryUsage="false"
-
-			CharacterSet="1"
-
-			ConfigurationType="4"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -341,6 +262,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -369,12 +289,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"
-
+			Name="Release|Smartphone 2003 (ARMV4)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -395,8 +312,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -412,6 +328,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -440,13 +355,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug-Static|Win32"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops"
-
+			Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
-			CharacterSet="2"
-
-			ConfigurationType="4"
-			UseOfMFC="0"
+			CharacterSet="1"
 			>
 			<Tool
@@ -467,68 +378,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
-				AdditionalIncludeDirectories="../include;../../pjlib/include;&quot;../../pjlib-util/include&quot;;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../..;&quot;$(DXSDK_DIR)include&quot;"
-				PrecompiledHeaderFile=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"
-
-			ATLMinimizesCRunTimeLibraryUsage="false"
-
-			CharacterSet="1"
-
-			ConfigurationType="4"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -544,6 +394,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -572,12 +421,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"
-
+			Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -598,8 +444,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -615,6 +460,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -643,13 +487,10 @@
 		</Configuration>
 		<Configuration
-			Name="Release-Dynamic|Win32"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops"
-
+			Name="Debug|Win32"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops"
+			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="2"
-
-			ConfigurationType="4"
-			UseOfMFC="0"
 			>
 			<Tool
@@ -670,7 +511,6 @@
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../include;../../pjlib/include;&quot;../../pjlib-util/include&quot;;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../..;&quot;$(DXSDK_DIR)include&quot;"
 				PreprocessorDefinitions="_LIB;"
-
-				AdditionalIncludeDirectories="../include;../../pjlib/include;&quot;../../pjlib-util/include&quot;;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../..;&quot;$(DXSDK_DIR)include&quot;"
 				PrecompiledHeaderFile=""
 			/>
@@ -704,12 +544,9 @@
 		</Configuration>
 		<Configuration
-			Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"
-
+			Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -730,8 +567,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -748,5 +584,4 @@
 				Name="VCLibrarianTool"
 				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"
-
 			/>
 			<Tool
@@ -775,12 +610,9 @@
 		</Configuration>
 		<Configuration
-			Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"
-
+			Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -801,8 +633,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -819,5 +650,4 @@
 				Name="VCLibrarianTool"
 				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"
-
 			/>
 			<Tool
@@ -846,13 +676,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug-Dynamic|Win32"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops"
-
+			Name="Debug|Pocket PC 2003 (ARMV4)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
-			CharacterSet="2"
-
-			ConfigurationType="4"
-			UseOfMFC="0"
+			CharacterSet="1"
 			>
 			<Tool
@@ -873,68 +699,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
-				AdditionalIncludeDirectories="../include;../../pjlib/include;&quot;../../pjlib-util/include&quot;;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../..;&quot;$(DXSDK_DIR)include&quot;"
-				PrecompiledHeaderFile=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"
-
-			ATLMinimizesCRunTimeLibraryUsage="false"
-
-			CharacterSet="1"
-
-			ConfigurationType="4"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -950,6 +715,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -978,12 +742,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"
-
+			Name="Debug|Smartphone 2003 (ARMV4)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -1004,8 +765,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -1021,6 +781,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -1049,13 +808,9 @@
 		</Configuration>
 		<Configuration
-			Name="Release-Static|Win32"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops"
-
+			Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
-			CharacterSet="2"
-
-			ConfigurationType="4"
-			UseOfMFC="0"
+			CharacterSet="1"
 			>
 			<Tool
@@ -1076,68 +831,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
-				AdditionalIncludeDirectories="../include;../../pjlib/include;&quot;../../pjlib-util/include&quot;;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../..;&quot;$(DXSDK_DIR)include&quot;"
-				PrecompiledHeaderFile=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"
-
-			ATLMinimizesCRunTimeLibraryUsage="false"
-
-			CharacterSet="1"
-
-			ConfigurationType="4"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -1153,6 +847,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -1181,12 +874,9 @@
 		</Configuration>
 		<Configuration
-			Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"
-
+			Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -1207,8 +897,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -1224,6 +913,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -1252,12 +940,66 @@
 		</Configuration>
 		<Configuration
-			Name="Release|Pocket PC 2003 (ARMV4)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"
-
+			Name="Debug-Static|Win32"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops"
+			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../include;../../pjlib/include;&quot;../../pjlib-util/include&quot;;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../..;&quot;$(DXSDK_DIR)include&quot;"
+				PreprocessorDefinitions="_LIB;"
+				PrecompiledHeaderFile=""
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"
+			ATLMinimizesCRunTimeLibraryUsage="false"
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -1278,8 +1020,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -1295,6 +1036,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -1323,12 +1063,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug|Pocket PC 2003 (ARMV4)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"
-
+			Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -1349,8 +1086,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -1366,6 +1102,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -1395,11 +1130,8 @@
 		<Configuration
 			Name="Debug-Static|Pocket PC 2003 (ARMV4)"
+			ConfigurationType="4"
 			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"
-
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -1420,8 +1152,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -1438,5 +1169,4 @@
 				Name="VCLibrarianTool"
 				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
-
 			/>
 			<Tool
@@ -1465,12 +1195,9 @@
 		</Configuration>
 		<Configuration
-			Name="Release-Dynamic|Pocket PC 2003 (ARMV4)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"
-
+			Name="Debug-Static|Smartphone 2003 (ARMV4)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -1491,8 +1218,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -1508,6 +1234,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -1536,12 +1261,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"
-
+			Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -1562,8 +1284,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -1579,6 +1300,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -1607,12 +1327,9 @@
 		</Configuration>
 		<Configuration
-			Name="Release-Static|Pocket PC 2003 (ARMV4)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"
-
+			Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -1633,8 +1350,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -1650,6 +1366,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -1678,12 +1393,66 @@
 		</Configuration>
 		<Configuration
-			Name="Release|Smartphone 2003 (ARMV4)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"
-
+			Name="Release-Dynamic|Win32"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops"
+			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../include;../../pjlib/include;&quot;../../pjlib-util/include&quot;;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../..;&quot;$(DXSDK_DIR)include&quot;"
+				PreprocessorDefinitions="_LIB;"
+				PrecompiledHeaderFile=""
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"
+			ATLMinimizesCRunTimeLibraryUsage="false"
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -1704,8 +1473,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -1721,6 +1489,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -1749,12 +1516,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug|Smartphone 2003 (ARMV4)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"
-
+			Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -1775,8 +1539,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -1792,6 +1555,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -1820,12 +1582,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug-Static|Smartphone 2003 (ARMV4)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"
-
+			Name="Release-Dynamic|Pocket PC 2003 (ARMV4)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -1846,8 +1605,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -1863,6 +1621,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -1892,11 +1649,8 @@
 		<Configuration
 			Name="Release-Dynamic|Smartphone 2003 (ARMV4)"
+			ConfigurationType="4"
 			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"
-
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -1917,8 +1671,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -1935,5 +1688,4 @@
 				Name="VCLibrarianTool"
 				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
-
 			/>
 			<Tool
@@ -1962,12 +1714,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug-Dynamic|Smartphone 2003 (ARMV4)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"
-
+			Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -1988,8 +1737,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -2005,6 +1753,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -2033,12 +1780,9 @@
 		</Configuration>
 		<Configuration
-			Name="Release-Static|Smartphone 2003 (ARMV4)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"
-
+			Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -2059,8 +1803,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -2076,6 +1819,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -2104,12 +1846,66 @@
 		</Configuration>
 		<Configuration
-			Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"
-
+			Name="Debug-Dynamic|Win32"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops"
+			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../include;../../pjlib/include;&quot;../../pjlib-util/include&quot;;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../..;&quot;$(DXSDK_DIR)include&quot;"
+				PreprocessorDefinitions="_LIB;"
+				PrecompiledHeaderFile=""
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"
+			ATLMinimizesCRunTimeLibraryUsage="false"
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -2130,8 +1926,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -2147,6 +1942,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -2175,12 +1969,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"
-
+			Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -2201,8 +1992,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -2218,6 +2008,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -2246,12 +2035,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"
-
+			Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -2272,8 +2058,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -2289,6 +2074,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -2317,12 +2101,9 @@
 		</Configuration>
 		<Configuration
-			Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"
-
+			Name="Debug-Dynamic|Smartphone 2003 (ARMV4)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -2343,8 +2124,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -2360,6 +2140,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -2389,11 +2168,8 @@
 		<Configuration
 			Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+			ConfigurationType="4"
 			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"
-
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -2414,8 +2190,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -2432,5 +2207,4 @@
 				Name="VCLibrarianTool"
 				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"
-
 			/>
 			<Tool
@@ -2459,12 +2233,9 @@
 		</Configuration>
 		<Configuration
-			Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"
-
+			Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -2485,8 +2256,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -2502,6 +2272,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -2530,12 +2299,66 @@
 		</Configuration>
 		<Configuration
-			Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"
-
+			Name="Release-Static|Win32"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops"
+			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../include;../../pjlib/include;&quot;../../pjlib-util/include&quot;;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../..;&quot;$(DXSDK_DIR)include&quot;"
+				PreprocessorDefinitions="_LIB;"
+				PrecompiledHeaderFile=""
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"
+			ATLMinimizesCRunTimeLibraryUsage="false"
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -2556,8 +2379,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -2573,6 +2395,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -2601,12 +2422,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"
-
+			Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -2627,8 +2445,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -2644,6 +2461,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -2672,12 +2488,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"
-
+			Name="Release-Static|Pocket PC 2003 (ARMV4)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -2698,8 +2511,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -2715,6 +2527,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -2743,12 +2554,9 @@
 		</Configuration>
 		<Configuration
-			Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"
-
+			Name="Release-Static|Smartphone 2003 (ARMV4)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -2769,8 +2577,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -2786,6 +2593,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -2814,12 +2620,9 @@
 		</Configuration>
 		<Configuration
-			Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"
-
+			Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -2840,8 +2643,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -2857,6 +2659,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"
-
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -2886,11 +2687,8 @@
 		<Configuration
 			Name="Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+			ConfigurationType="4"
 			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"
-
 			ATLMinimizesCRunTimeLibraryUsage="false"
-
 			CharacterSet="1"
-
-			ConfigurationType="4"
 			>
 			<Tool
@@ -2911,8 +2709,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_LIB;"
-
 				ExecutionBucket="7"
 				AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../../third_party/build/srtp,../../third_party/srtp/include,../../third_party/srtp/crypto/include;../.."
+				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
 			/>
@@ -2929,5 +2726,4 @@
 				Name="VCLibrarianTool"
 				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"
-
 			/>
 			<Tool
@@ -4794,4 +4590,8 @@
 			</File>
 			<File
+				RelativePath="..\src\pjmedia\sync_port.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\pjmedia\tonegen.c"
 				>
@@ -5303,4 +5103,8 @@
 			</File>
 			<File
+				RelativePath="..\include\pjmedia\sync_port.h"
+				>
+			</File>
+			<File
 				RelativePath="..\include\pjmedia\tonegen.h"
 				>
Index: pjproject/trunk/pjmedia/include/pjmedia/sync_port.h
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia/sync_port.h	(revision 2747)
+++ pjproject/trunk/pjmedia/include/pjmedia/sync_port.h	(revision 2747)
@@ -0,0 +1,104 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#ifndef __PJMEDIA_SYNC_PORT_H__
+#define __PJMEDIA_SYNC_PORT_H__
+
+/**
+ * @file sync_port.h
+ * @brief Media clock synchronization port.
+ */
+#include <pjmedia/port.h>
+
+/**
+ * @defgroup PJMEDIA_SYNC_PORT Clock Synchronization Port
+ * @ingroup PJMEDIA_PORT_CLOCK
+ * @brief Media clock synchronizer
+ * @{
+ *
+ * It is a common problem that audio device does not always provide a smooth
+ * clock for application, therefore the application may suffer from jitter, 
+ * burst, or even clock skew/drift. Processing audio frames in such 'messy'
+ * clock will just increase the complexity. So, before delivering the stream
+ * to other components, it could be very helpful to tidy up the clock first.
+ *
+ * This clock synchronizer port provides solutions in encountering burst and 
+ * clock skew, by simply inserting it between the port with 'unhealty' clock
+ * (upstream port) and the port requiring 'healthy' clock (downstream port) 
+ * using pjmedia port framework. Moreover, it also has an optional feature 
+ * to remove jitter by employing an external clock (@ref PJMEDIA_CLOCK),
+ * this feature will be enabled when PJMEDIA_SYNC_USE_EXT_CLOCK is specified
+ * in @pjmedia_sync_option upon its creation.
+ *
+ * A synchronizer port internally has instance(s) of @ref PJMED_DELAYBUF, 
+ * which provides buffering and wave-form manipulation (shrink/expand) to 
+ * handle burst and clock skew/drift, and may also have instance of @ref 
+ * PJMEDIA_CLOCK, which provides the external clock timer.
+ */
+
+PJ_BEGIN_DECL
+
+/**
+ * Synchronization port option.
+ */
+typedef enum pjmedia_sync_option
+{
+    /** 
+     * When this flag is specified, synchronizer will provide external clock,
+     * instead of using original parent clock.
+     */
+    PJMEDIA_SYNC_USE_EXT_CLOCK = 1,
+
+    /** 
+     * When this flag is specified, synchronizer will not destroy downstream
+     * port when synchronizer port is destroyed.
+     */
+    PJMEDIA_SYNC_DONT_DESTROY_DN = 128,
+
+} pjmedia_sync_option;
+
+typedef struct pjmedia_sync_param
+{
+    pjmedia_sync_option	    options;
+
+} pjmedia_sync_param;
+
+/**
+ * Create synchronizer port. 
+ *
+ * @param pool		Pool to allocate memory.
+ * @param dn_port	Downstream port.
+ * @param param		Synchronizer param, see @pjmedia_sync_param.
+ * @param p_port	Pointer to receive the port instance.
+ *
+ * @return		PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_sync_port_create(pj_pool_t *pool,
+					      pjmedia_port *dn_port,
+					      const pjmedia_sync_param *param,
+					      pjmedia_port **p_port );
+
+
+PJ_END_DECL
+
+/**
+ * @}
+ */
+
+
+#endif	/* __PJMEDIA_SYNC_PORT_H__ */
Index: pjproject/trunk/pjmedia/src/pjmedia/conference.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/conference.c	(revision 2746)
+++ pjproject/trunk/pjmedia/src/pjmedia/conference.c	(revision 2747)
@@ -237,4 +237,5 @@
     unsigned		  samples_per_frame;	/**< Samples per frame.	    */
     unsigned		  bits_per_sample;	/**< Bits per sample.	    */
+    pj_int16_t		 *master_port_buf;
 };
 
@@ -458,5 +459,5 @@
 
 
-    status = create_pasv_port(conf, pool, &name, NULL, &conf_port);
+    status = create_conf_port(conf, pool, &name, NULL, &conf_port);
     if (status != PJ_SUCCESS)
 	return status;
@@ -557,4 +558,8 @@
     conf->master_port = PJ_POOL_ZALLOC_T(pool, pjmedia_port);
     PJ_ASSERT_RETURN(conf->master_port, PJ_ENOMEM);
+
+    conf->master_port_buf = (pj_int16_t*)
+			    pj_pool_zalloc(pool, conf->samples_per_frame<<1);
+    PJ_ASSERT_RETURN(conf->master_port_buf, PJ_ENOMEM);
     
     pjmedia_port_info_init(&conf->master_port->info, &name, SIGNATURE,
@@ -1052,6 +1057,11 @@
 
 	/* if source port is passive port and has no listener, reset delaybuf */
-	if (src_port->delay_buf && src_port->listener_cnt == 0)
-	    pjmedia_delay_buf_reset(src_port->delay_buf);
+	if (src_port->listener_cnt == 0) {
+	    if (src_port->delay_buf)
+		pjmedia_delay_buf_reset(src_port->delay_buf);
+	    if (src_port->port == NULL)
+		pjmedia_zero_samples(conf->master_port_buf, 
+				     conf->samples_per_frame);
+	}
     }
 
@@ -1842,8 +1852,15 @@
 
 	/* Get frame from this port.
+	 * For port 0 (master port), get the frame from master_port_buf.
 	 * For passive ports, get the frame from the delay_buf.
 	 * For other ports, get the frame from the port. 
 	 */
-	if (conf_port->delay_buf != NULL) {
+	if (conf_port->port == NULL) {
+
+	    pjmedia_copy_samples((pj_int16_t*)frame->buf, conf->master_port_buf,
+				 conf->samples_per_frame);
+
+	} else if (conf_port->delay_buf != NULL) {
+
 	    pj_status_t status;
 	
@@ -2055,5 +2072,4 @@
     pjmedia_conf *conf = (pjmedia_conf*) this_port->port_data.pdata;
     struct conf_port *port = conf->ports[this_port->port_data.ldata];
-    pj_status_t status;
 
     /* Check for correct size. */
@@ -2062,7 +2078,4 @@
 		      PJMEDIA_ENCSAMPLESPFRAME);
 
-    /* Check existance of delay_buf instance */
-    PJ_ASSERT_RETURN( port->delay_buf, PJ_EBUG );
-
     /* Skip if this port is muted/disabled. */
     if (port->rx_setting != PJMEDIA_PORT_ENABLE) {
@@ -2075,7 +2088,8 @@
     }
 
-    status = pjmedia_delay_buf_put(port->delay_buf, (pj_int16_t*)frame->buf);
-
-    return status;
+    pjmedia_copy_samples(conf->master_port_buf, (pj_int16_t*)frame->buf,
+			 conf->samples_per_frame);
+
+    return PJ_SUCCESS;
 }
 
Index: pjproject/trunk/pjmedia/src/pjmedia/echo_common.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/echo_common.c	(revision 2746)
+++ pjproject/trunk/pjmedia/src/pjmedia/echo_common.c	(revision 2747)
@@ -20,5 +20,4 @@
 
 #include <pjmedia/echo.h>
-#include <pjmedia/delaybuf.h>
 #include <pjmedia/errno.h>
 #include <pj/assert.h>
@@ -51,6 +50,4 @@
     struct frame     lat_buf;	    /* Frame queue for delayed playback	    */
     struct frame     lat_free;	    /* Free frame list.			    */
-
-    pjmedia_delay_buf	*delay_buf;
 };
 
@@ -147,4 +144,5 @@
     pjmedia_echo_state *ec;
     pj_status_t status;
+    unsigned i;
 
     /* Create new pool and instantiate and init the EC */
@@ -192,30 +190,15 @@
     /* Create latency buffers */
     ptime = samples_per_frame * 1000 / clock_rate;
-    if (latency_ms == 0) {
-	/* Give at least one frame delay to simplify programming */
+    /* Give at least one frame delay to simplify programming */
+    if (latency_ms < ptime) {
 	latency_ms = ptime;
     }
     ec->lat_target_cnt = latency_ms / ptime;
-    if (ec->lat_target_cnt != 0) {
-	unsigned i;
-	for (i=0; i < ec->lat_target_cnt; ++i)  {
-	    struct frame *frm;
-
-	    frm = (struct frame*) pj_pool_alloc(pool, (samples_per_frame<<1) +
-						      sizeof(struct frame));
-	    pj_list_push_back(&ec->lat_free, frm);
-	}
-    } else {
-	ec->lat_ready = PJ_TRUE;
-    }
-
-    /* Create delay buffer to compensate drifts */
-    status = pjmedia_delay_buf_create(ec->pool, ec->obj_name, clock_rate, 
-				      samples_per_frame, channel_count,
-				      (PJMEDIA_SOUND_BUFFER_COUNT+1) * ptime,
-				      0, &ec->delay_buf);
-    if (status != PJ_SUCCESS) {
-	pj_pool_release(pool);
-	return status;
+    for (i=0; i < ec->lat_target_cnt; ++i)  {
+	struct frame *frm;
+
+	frm = (struct frame*) pj_pool_alloc(pool, (samples_per_frame<<1) +
+						  sizeof(struct frame));
+	pj_list_push_back(&ec->lat_free, frm);
     }
 
@@ -241,9 +224,4 @@
     (*echo->op->ec_destroy)(echo->state);
 
-    if (echo->delay_buf) {
-	pjmedia_delay_buf_destroy(echo->delay_buf);
-	echo->delay_buf = NULL;
-    }
-
     pj_pool_release(echo->pool);
     return PJ_SUCCESS;
@@ -263,5 +241,4 @@
     }
     echo->lat_ready = PJ_FALSE;
-    pjmedia_delay_buf_reset(echo->delay_buf);
     echo->op->ec_reset(echo->state);
     return PJ_SUCCESS;
@@ -275,29 +252,24 @@
 					   pj_int16_t *play_frm )
 {
-    if (!echo->lat_ready) {
+    struct frame *frm;
+
+    if (echo->lat_ready) {
+	frm = echo->lat_buf.next;
+	pj_list_erase(frm);
+    } else {
 	/* We've not built enough latency in the buffer, so put this frame
 	 * in the latency buffer list.
 	 */
-	struct frame *frm;
-
+	frm = echo->lat_free.prev;
+	pj_list_erase(frm);
 	if (pj_list_empty(&echo->lat_free)) {
 	    echo->lat_ready = PJ_TRUE;
 	    PJ_LOG(5,(echo->obj_name, "Latency bufferring complete"));
-	    pjmedia_delay_buf_put(echo->delay_buf, play_frm);
-	    return PJ_SUCCESS;
 	}
-	    
-	frm = echo->lat_free.prev;
-	pj_list_erase(frm);
-
-	pjmedia_copy_samples(frm->buf, play_frm, echo->samples_per_frame);
-	pj_list_push_back(&echo->lat_buf, frm);
-
-    } else {
-	/* Latency buffer is ready (full), so we put this frame in the
-	 * delay buffer.
-	 */
-	pjmedia_delay_buf_put(echo->delay_buf, play_frm);
-    }
+    }
+
+    /* Put the incoming frame into the end of latency buffer */
+    pjmedia_copy_samples(frm->buf, play_frm, echo->samples_per_frame);
+    pj_list_push_back(&echo->lat_buf, frm);
 
     return PJ_SUCCESS;
@@ -314,5 +286,5 @@
 {
     struct frame *oldest_frm;
-    pj_status_t status, rc;
+    pj_status_t status;
 
     if (!echo->lat_ready) {
@@ -324,5 +296,4 @@
     /* Retrieve oldest frame from the latency buffer */
     oldest_frm = echo->lat_buf.next;
-    pj_list_erase(oldest_frm);
 
     /* Cancel echo using this reference frame */
@@ -330,14 +301,4 @@
 				 options, NULL);
 
-    /* Move one frame from delay buffer to the latency buffer. */
-    rc = pjmedia_delay_buf_get(echo->delay_buf, oldest_frm->buf);
-    if (rc != PJ_SUCCESS) {
-	/* Ooops.. no frame! */
-	PJ_LOG(5,(echo->obj_name, 
-		  "No frame from delay buffer. This will upset EC later"));
-	pjmedia_zero_samples(oldest_frm->buf, echo->samples_per_frame);
-    }
-    pj_list_push_back(&echo->lat_buf, oldest_frm);
-    
     return status;
 }
Index: pjproject/trunk/pjmedia/src/pjmedia/sound_port.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/sound_port.c	(revision 2746)
+++ pjproject/trunk/pjmedia/src/pjmedia/sound_port.c	(revision 2747)
@@ -20,7 +20,7 @@
 #include <pjmedia/sound_port.h>
 #include <pjmedia/alaw_ulaw.h>
-#include <pjmedia/delaybuf.h>
-#include <pjmedia/echo.h>
+#include <pjmedia/echo_port.h>
 #include <pjmedia/errno.h>
+#include <pjmedia/sync_port.h>
 #include <pj/assert.h>
 #include <pj/log.h>
@@ -29,12 +29,10 @@
 
 #define AEC_TAIL	    128	    /* default AEC length in ms */
-#define AEC_SUSPEND_LIMIT   5	    /* seconds of no activity	*/
 
 #define THIS_FILE	    "sound_port.c"
 
-//#define TEST_OVERFLOW_UNDERFLOW
-
 struct pjmedia_snd_port
 {
+    pj_pool_t		*pool;
     int			 rec_id;
     int			 play_id;
@@ -44,4 +42,6 @@
     pjmedia_dir		 dir;
     pjmedia_port	*port;
+    pjmedia_port	*dn_port;
+    pjmedia_port	*sync_port;
 
     unsigned		 clock_rate;
@@ -51,10 +51,7 @@
 
     /* software ec */
-    pjmedia_echo_state	*ec_state;
+    pjmedia_port	*echo_port;
     unsigned		 ec_options;
     unsigned		 ec_tail_len;
-    pj_bool_t		 ec_suspended;
-    unsigned		 ec_suspend_count;
-    unsigned		 ec_suspend_limit;
 };
 
@@ -70,5 +67,5 @@
     pj_status_t status;
 
-    port = snd_port->port;
+    port = snd_port->dn_port;
     if (port == NULL)
 	goto no_frame;
@@ -83,14 +80,4 @@
     /* Must supply the required samples */
     pj_assert(frame->size == required_size);
-
-    if (snd_port->ec_state) {
-	if (snd_port->ec_suspended) {
-	    snd_port->ec_suspended = PJ_FALSE;
-	    //pjmedia_echo_state_reset(snd_port->ec_state);
-	    PJ_LOG(4,(THIS_FILE, "EC activated"));
-	}
-	snd_port->ec_suspend_count = 0;
-	pjmedia_echo_playback(snd_port->ec_state, (pj_int16_t*)frame->buf);
-    }
 
 
@@ -102,16 +89,4 @@
     pj_bzero(frame->buf, frame->size);
 
-    if (snd_port->ec_state && !snd_port->ec_suspended) {
-	++snd_port->ec_suspend_count;
-	if (snd_port->ec_suspend_count > snd_port->ec_suspend_limit) {
-	    snd_port->ec_suspended = PJ_TRUE;
-	    PJ_LOG(4,(THIS_FILE, "EC suspended because of inactivity"));
-	}
-	if (snd_port->ec_state) {
-	    /* To maintain correct delay in EC */
-	    pjmedia_echo_playback(snd_port->ec_state, (pj_int16_t*)frame->buf);
-	}
-    }
-
     return PJ_SUCCESS;
 }
@@ -123,4 +98,42 @@
  */
 static pj_status_t rec_cb(void *user_data, pjmedia_frame *frame)
+{
+    pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data;
+    pjmedia_port *port;
+
+    port = snd_port->dn_port;
+    if (port == NULL)
+	return PJ_SUCCESS;
+
+    pjmedia_port_put_frame(port, frame);
+
+    return PJ_SUCCESS;
+}
+
+/*
+ * The callback called by sound player when it needs more samples to be
+ * played. This version is for non-PCM data.
+ */
+static pj_status_t play_cb_ext(void *user_data, pjmedia_frame *frame)
+{
+    pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data;
+    pjmedia_port *port = snd_port->port;
+
+    if (port == NULL) {
+	frame->type = PJMEDIA_FRAME_TYPE_NONE;
+	return PJ_SUCCESS;
+    }
+
+    pjmedia_port_get_frame(port, frame);
+
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * The callback called by sound recorder when it has finished capturing a
+ * frame. This version is for non-PCM data.
+ */
+static pj_status_t rec_cb_ext(void *user_data, pjmedia_frame *frame)
 {
     pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data;
@@ -131,47 +144,4 @@
 	return PJ_SUCCESS;
 
-    /* Cancel echo */
-    if (snd_port->ec_state && !snd_port->ec_suspended) {
-	pjmedia_echo_capture(snd_port->ec_state, (pj_int16_t*) frame->buf, 0);
-    }
-
-    pjmedia_port_put_frame(port, frame);
-
-    return PJ_SUCCESS;
-}
-
-/*
- * The callback called by sound player when it needs more samples to be
- * played. This version is for non-PCM data.
- */
-static pj_status_t play_cb_ext(void *user_data, pjmedia_frame *frame)
-{
-    pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data;
-    pjmedia_port *port = snd_port->port;
-
-    if (port == NULL) {
-	frame->type = PJMEDIA_FRAME_TYPE_NONE;
-	return PJ_SUCCESS;
-    }
-
-    pjmedia_port_get_frame(port, frame);
-
-    return PJ_SUCCESS;
-}
-
-
-/*
- * The callback called by sound recorder when it has finished capturing a
- * frame. This version is for non-PCM data.
- */
-static pj_status_t rec_cb_ext(void *user_data, pjmedia_frame *frame)
-{
-    pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data;
-    pjmedia_port *port;
-
-    port = snd_port->port;
-    if (port == NULL)
-	return PJ_SUCCESS;
-
     pjmedia_port_put_frame(port, frame);
 
@@ -183,10 +153,9 @@
  * This may be called even when the sound stream has already been started.
  */
-static pj_status_t start_sound_device( pj_pool_t *pool,
-				       pjmedia_snd_port *snd_port )
+static pj_status_t start_sound_device( pjmedia_snd_port *snd_port )
 {
     pjmedia_aud_rec_cb snd_rec_cb;
     pjmedia_aud_play_cb snd_play_cb;
-    pjmedia_aud_param param_copy;
+    pjmedia_aud_param *param;
     pj_status_t status;
 
@@ -200,10 +169,11 @@
 		     PJ_EBUG);
 
+    param = &snd_port->aud_param;
+
     /* Get device caps */
-    if (snd_port->aud_param.dir & PJMEDIA_DIR_CAPTURE) {
+    if (param->dir & PJMEDIA_DIR_CAPTURE) {
 	pjmedia_aud_dev_info dev_info;
 
-	status = pjmedia_aud_dev_get_info(snd_port->aud_param.rec_id, 
-					  &dev_info);
+	status = pjmedia_aud_dev_get_info(param->rec_id, &dev_info);
 	if (status != PJ_SUCCESS)
 	    return status;
@@ -214,22 +184,6 @@
     }
 
-    /* Process EC settings */
-    pj_memcpy(&param_copy, &snd_port->aud_param, sizeof(param_copy));
-    if (param_copy.flags & PJMEDIA_AUD_DEV_CAP_EC) {
-	/* EC is wanted */
-	if (snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC) {
-	    /* Device supports EC */
-	    /* Nothing to do */
-	} else {
-	    /* Device doesn't support EC, remove EC settings from
-	     * device parameters
-	     */
-	    param_copy.flags &= ~(PJMEDIA_AUD_DEV_CAP_EC |
-				  PJMEDIA_AUD_DEV_CAP_EC_TAIL);
-	}
-    }
-
     /* Use different callback if format is not PCM */
-    if (snd_port->aud_param.ext_fmt.id == PJMEDIA_FORMAT_L16) {
+    if (param->ext_fmt.id == PJMEDIA_FORMAT_L16) {
 	snd_rec_cb = &rec_cb;
 	snd_play_cb = &play_cb;
@@ -240,5 +194,5 @@
 
     /* Open the device */
-    status = pjmedia_aud_stream_create(&param_copy,
+    status = pjmedia_aud_stream_create(param,
 				       snd_rec_cb,
 				       snd_play_cb,
@@ -248,32 +202,4 @@
     if (status != PJ_SUCCESS)
 	return status;
-
-    /* Inactivity limit before EC is suspended. */
-    snd_port->ec_suspend_limit = AEC_SUSPEND_LIMIT *
-				 (snd_port->clock_rate / 
-				  snd_port->samples_per_frame);
-
-    /* Create software EC if parameter specifies EC but device 
-     * doesn't support EC. Only do this if the format is PCM!
-     */
-    if ((snd_port->aud_param.flags & PJMEDIA_AUD_DEV_CAP_EC) &&
-	(snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC)==0 &&
-	param_copy.ext_fmt.id == PJMEDIA_FORMAT_PCM)
-    {
-	if ((snd_port->aud_param.flags & PJMEDIA_AUD_DEV_CAP_EC_TAIL)==0) {
-	    snd_port->aud_param.flags |= PJMEDIA_AUD_DEV_CAP_EC_TAIL;
-	    snd_port->aud_param.ec_tail_ms = AEC_TAIL;
-	    PJ_LOG(4,(THIS_FILE, "AEC tail is set to default %u ms",
-				 snd_port->aud_param.ec_tail_ms));
-	}
-	    
-	status = pjmedia_snd_port_set_ec(snd_port, pool, 
-					 snd_port->aud_param.ec_tail_ms, 0);
-	if (status != PJ_SUCCESS) {
-	    pjmedia_aud_stream_destroy(snd_port->aud_stream);
-	    snd_port->aud_stream = NULL;
-	    return status;
-	}
-    }
 
     /* Start sound stream. */
@@ -300,10 +226,4 @@
 	pjmedia_aud_stream_destroy(snd_port->aud_stream);
 	snd_port->aud_stream = NULL;
-    }
-
-    /* Destroy AEC */
-    if (snd_port->ec_state) {
-	pjmedia_echo_destroy(snd_port->ec_state);
-	snd_port->ec_state = NULL;
     }
 
@@ -421,7 +341,9 @@
     PJ_ASSERT_RETURN(pool && prm && p_port, PJ_EINVAL);
 
+    pool = pj_pool_create(pool->factory, pool->obj_name, 256, 256, NULL);
     snd_port = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_port);
     PJ_ASSERT_RETURN(snd_port, PJ_ENOMEM);
 
+    snd_port->pool = pool;
     snd_port->dir = prm->dir;
     snd_port->rec_id = prm->rec_id;
@@ -438,5 +360,5 @@
      * empty signal.
      */
-    status = start_sound_device( pool, snd_port );
+    status = start_sound_device( snd_port );
     if (status != PJ_SUCCESS) {
 	pjmedia_snd_port_destroy(snd_port);
@@ -454,7 +376,17 @@
 PJ_DEF(pj_status_t) pjmedia_snd_port_destroy(pjmedia_snd_port *snd_port)
 {
+    pj_status_t status;
+
     PJ_ASSERT_RETURN(snd_port, PJ_EINVAL);
 
-    return stop_sound_device(snd_port);
+    /* Stop sound port */
+    status = stop_sound_device(snd_port);
+
+    /* Disconnect sound port */
+    pjmedia_snd_port_disconnect(snd_port);
+
+    pj_pool_release(snd_port->pool);
+
+    return status;
 }
 
@@ -552,7 +484,7 @@
 
 	/* Destroy AEC */
-	if (snd_port->ec_state) {
-	    pjmedia_echo_destroy(snd_port->ec_state);
-	    snd_port->ec_state = NULL;
+	if (snd_port->echo_port) {
+	    pjmedia_port_destroy(snd_port->echo_port);
+	    snd_port->echo_port = NULL;
 	}
 
@@ -565,13 +497,9 @@
 	    //	   snd_port->clock_rate;
 	    delay_ms = prm.output_latency_ms;
-	    status = pjmedia_echo_create2(pool, snd_port->clock_rate, 
-					  snd_port->channel_count,
-					  snd_port->samples_per_frame, 
-					  tail_ms, delay_ms,
-					  options, &snd_port->ec_state);
+	    status = pjmedia_echo_port_create(pool, snd_port->port,
+					      tail_ms, delay_ms,
+					      options, &snd_port->echo_port);
 	    if (status != PJ_SUCCESS)
-		snd_port->ec_state = NULL;
-	    else
-		snd_port->ec_suspended = PJ_FALSE;
+		snd_port->echo_port = NULL;
 	} else {
 	    PJ_LOG(4,(THIS_FILE, "Echo canceller is now disabled in the "
@@ -623,5 +551,5 @@
     } else {
 	/* We use software EC */
-	*p_length =  snd_port->ec_state ? snd_port->ec_tail_len : 0;
+	*p_length =  snd_port->echo_port ? snd_port->ec_tail_len : 0;
     }
     return PJ_SUCCESS;
@@ -636,4 +564,7 @@
 {
     pjmedia_port_info *pinfo;
+    pjmedia_aud_param *param;
+    pjmedia_sync_param sync_param;
+    pj_status_t status;
 
     PJ_ASSERT_RETURN(snd_port && port, PJ_EINVAL);
@@ -657,4 +588,39 @@
     /* Port is okay. */
     snd_port->port = port;
+
+    /* Create software EC if parameter specifies EC but device 
+     * doesn't support EC. Only do this if the format is PCM!
+     */
+    param = &snd_port->aud_param;
+    if ((param->flags & PJMEDIA_AUD_DEV_CAP_EC) &&
+	(snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC)==0 &&
+	param->ext_fmt.id == PJMEDIA_FORMAT_PCM)
+    {
+	if ((param->flags & PJMEDIA_AUD_DEV_CAP_EC_TAIL)==0) {
+	    param->flags |= PJMEDIA_AUD_DEV_CAP_EC_TAIL;
+	    param->ec_tail_ms = AEC_TAIL;
+	    PJ_LOG(4,(THIS_FILE, "AEC tail is set to default %u ms",
+				 param->ec_tail_ms));
+	}
+	    
+	status = pjmedia_snd_port_set_ec(snd_port, snd_port->pool, 
+					 param->ec_tail_ms, 0);
+	if (status != PJ_SUCCESS)
+	    return status;
+    }
+
+    /* Create sync port */
+    pj_bzero(&sync_param, sizeof(sync_param));
+    sync_param.options = PJMEDIA_SYNC_DONT_DESTROY_DN;
+    status = pjmedia_sync_port_create(snd_port->pool, 
+				      (snd_port->echo_port?
+				       snd_port->echo_port:snd_port->port),
+				      &sync_param, &snd_port->sync_port);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    /* Update down port of sound port */
+    snd_port->dn_port = snd_port->sync_port;
+
     return PJ_SUCCESS;
 }
@@ -679,7 +645,22 @@
 
     snd_port->port = NULL;
-
-    return PJ_SUCCESS;
-}
-
-
+    snd_port->dn_port = NULL;
+
+    /* Destroy sync port */
+    if (snd_port->sync_port) {
+	pjmedia_port_destroy(snd_port->sync_port);
+	snd_port->sync_port = NULL;
+    }
+
+    /* Destroy EC port */
+    if (snd_port->echo_port) {
+	pjmedia_port_destroy(snd_port->echo_port);
+	snd_port->echo_port = NULL;
+	snd_port->ec_tail_len = 0;
+	snd_port->ec_options = 0;
+    }
+
+    return PJ_SUCCESS;
+}
+
+
Index: pjproject/trunk/pjmedia/src/pjmedia/sync_port.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/sync_port.c	(revision 2747)
+++ pjproject/trunk/pjmedia/src/pjmedia/sync_port.c	(revision 2747)
@@ -0,0 +1,274 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+
+#include <pjmedia/sync_port.h>
+#include <pjmedia/clock.h>
+#include <pjmedia/delaybuf.h>
+#include <pjmedia/errno.h>
+#include <pj/assert.h>
+#include <pj/log.h>
+#include <pj/pool.h>
+
+#define THIS_FILE   "sync_port.c"
+#define SIGNATURE   PJMEDIA_PORT_SIGNATURE('S', 'Y', 'N', 'C')
+
+typedef struct pjmedia_sync_port
+{
+    pjmedia_port	 base;
+    pjmedia_sync_param	 param;
+    pjmedia_port	*dn_port;
+    pj_int16_t		*framebuf;
+    pjmedia_clock	*clock;
+    pjmedia_delay_buf	*delay_buf;
+    pjmedia_delay_buf	*delay_buf2;
+
+} pjmedia_sync_port;
+
+
+/*
+ * CALLBACKS
+ */
+
+/* Clock callback */
+static void clock_cb(const pj_timestamp *ts, void *user_data)
+{
+    pjmedia_sync_port *port = (pjmedia_sync_port*)user_data;
+    pjmedia_frame f;
+    pj_status_t status;
+
+    /* call dn_port.put_frame() */
+    pj_bzero(&f, sizeof(f));
+    f.buf = port->framebuf;
+    f.size = port->base.info.samples_per_frame << 1;
+    f.type = PJMEDIA_TYPE_AUDIO;
+    f.timestamp = *ts;
+
+    status = pjmedia_delay_buf_get(port->delay_buf, (pj_int16_t*)f.buf);
+    if (status == PJ_SUCCESS) {
+	pjmedia_port_put_frame(port->dn_port, &f);
+    }
+
+    /* call dn_port.get_frame() */
+    pj_bzero(&f, sizeof(f));
+    f.buf = port->framebuf;
+    f.size = port->base.info.samples_per_frame << 1;
+    f.type = PJMEDIA_TYPE_AUDIO;
+    f.timestamp = *ts;
+
+    status = pjmedia_port_get_frame(port->dn_port, &f);
+    if (status != PJ_SUCCESS || f.type != PJMEDIA_FRAME_TYPE_AUDIO) {
+	pjmedia_zero_samples((pj_int16_t*)f.buf, 
+			     port->base.info.samples_per_frame);
+    }
+    pjmedia_delay_buf_put(port->delay_buf2, (pj_int16_t*)f.buf);
+}
+
+/* Get frame (from this port) when port is using own clock. */
+static pj_status_t get_frame_clock(pjmedia_port *this_port,
+				   pjmedia_frame *frame)
+{
+    pjmedia_sync_port *port = (pjmedia_sync_port*)this_port;
+    pj_status_t status;
+
+    PJ_ASSERT_RETURN(port, PJ_EINVAL);
+
+    /* get frame from delay buf */
+    status = pjmedia_delay_buf_get(port->delay_buf2, (pj_int16_t*)frame->buf);
+    if (status != PJ_SUCCESS) {
+	return status;
+    }
+
+    frame->size = this_port->info.samples_per_frame << 1;
+    frame->type = PJMEDIA_TYPE_AUDIO;
+
+    return PJ_SUCCESS;
+}
+
+/* Get frame (from this port). */
+static pj_status_t get_frame(pjmedia_port *this_port,
+			     pjmedia_frame *frame)
+{
+    pjmedia_sync_port *port = (pjmedia_sync_port*)this_port;
+    pjmedia_frame f;
+    pj_status_t status;
+
+    PJ_ASSERT_RETURN(port, PJ_EINVAL);
+
+    /* get frame */
+    status = pjmedia_port_get_frame(port->dn_port, frame);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    /* put frame from delay buf */
+    pj_bzero(&f, sizeof(f));
+    f.buf = port->framebuf;
+    f.size = this_port->info.samples_per_frame << 1;
+    f.type = PJMEDIA_TYPE_AUDIO;
+    f.timestamp = frame->timestamp;
+
+    status = pjmedia_delay_buf_get(port->delay_buf, (pj_int16_t*)f.buf);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    status = pjmedia_port_put_frame(port->dn_port, &f);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    return PJ_SUCCESS;
+}
+
+/* Put frame (to this port). */
+static pj_status_t put_frame(pjmedia_port *this_port,
+			     const pjmedia_frame *frame)
+{
+    pjmedia_sync_port *port = (pjmedia_sync_port*)this_port;
+
+    PJ_ASSERT_RETURN(port, PJ_EINVAL);
+
+    /* put frame to delay buf */
+    if (frame->type != PJMEDIA_FRAME_TYPE_AUDIO) {
+	pjmedia_zero_samples((pj_int16_t*)frame->buf, 
+			     this_port->info.samples_per_frame);
+    }
+
+    return pjmedia_delay_buf_put(port->delay_buf, (pj_int16_t*)frame->buf);
+}
+
+/* Destroy the port. */
+static pj_status_t on_destroy(pjmedia_port *this_port)
+{
+    pjmedia_sync_port *port = (pjmedia_sync_port*)this_port;
+
+    PJ_ASSERT_RETURN(port, PJ_EINVAL);
+
+    if (port->clock) {
+	pjmedia_clock_stop(port->clock);
+	pjmedia_clock_destroy(port->clock);
+	port->clock = NULL;
+    }
+
+    if (port->delay_buf) {
+	pjmedia_delay_buf_destroy(port->delay_buf);
+	port->delay_buf = NULL;
+    }
+
+    if (port->delay_buf2) {
+	pjmedia_delay_buf_destroy(port->delay_buf2);
+	port->delay_buf2 = NULL;
+    }
+
+    if (port->dn_port && 
+	(port->param.options & PJMEDIA_SYNC_DONT_DESTROY_DN) == 0)
+    {
+	pjmedia_port_destroy(port->dn_port);
+    }
+
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * API FUNCTIONS
+ */
+
+/* Create the sync port. */
+PJ_DEF(pj_status_t) pjmedia_sync_port_create(pj_pool_t *pool,
+					     pjmedia_port *dn_port,
+					     const pjmedia_sync_param *param,
+					     pjmedia_port **p_port )
+{
+    pjmedia_sync_port *sync;
+    pj_str_t name;
+    unsigned ptime;
+    pj_status_t status;
+
+    PJ_ASSERT_RETURN(pool && dn_port && p_port, PJ_EINVAL);
+    PJ_ASSERT_RETURN(dn_port->info.bits_per_sample==16, PJ_EINVAL);
+
+    sync = PJ_POOL_ZALLOC_T(pool, pjmedia_sync_port);
+    sync->framebuf = (pj_int16_t*)
+		     pj_pool_zalloc(pool, dn_port->info.samples_per_frame<<1);
+
+    /* Init port */
+    if (param)
+	sync->param = *param;
+    sync->dn_port = dn_port;
+
+    /* Init port info */
+    name = pj_str(pool->obj_name);
+    pjmedia_port_info_init(&sync->base.info,
+			   &name, SIGNATURE,
+			   dn_port->info.clock_rate,
+			   dn_port->info.channel_count,
+			   dn_port->info.bits_per_sample,
+			   dn_port->info.samples_per_frame);
+
+    /* Init port op */
+    sync->base.get_frame = &get_frame;
+    sync->base.put_frame = &put_frame;
+    sync->base.on_destroy = &on_destroy;
+
+    /* Create delay buffer to compensate drifts */
+    ptime = dn_port->info.samples_per_frame * 1000 / 
+	    dn_port->info.channel_count /
+	    dn_port->info.clock_rate;
+    status = pjmedia_delay_buf_create(pool, name.ptr, 
+				      dn_port->info.clock_rate, 
+				      dn_port->info.samples_per_frame,
+				      dn_port->info.channel_count,
+				      PJMEDIA_SOUND_BUFFER_COUNT * ptime,
+				      0, 
+				      &sync->delay_buf);
+    if (status != PJ_SUCCESS)
+	goto on_error;
+
+    /* Create clock if specified */
+    if (sync->param.options & PJMEDIA_SYNC_USE_EXT_CLOCK) {
+	status = pjmedia_delay_buf_create(pool, name.ptr, 
+					  dn_port->info.clock_rate, 
+					  dn_port->info.samples_per_frame,
+					  dn_port->info.channel_count,
+					  PJMEDIA_SOUND_BUFFER_COUNT * ptime,
+					  0, 
+					  &sync->delay_buf2);
+	if (status != PJ_SUCCESS)
+	    goto on_error;
+
+	status = pjmedia_clock_create(pool,
+				      dn_port->info.clock_rate, 
+				      dn_port->info.channel_count,
+				      dn_port->info.samples_per_frame,
+				      0,
+				      &clock_cb,
+				      sync,
+				      &sync->clock);
+	if (status != PJ_SUCCESS)
+	    goto on_error;
+
+	sync->base.get_frame = &get_frame_clock;
+    }
+
+    /* Done */
+    *p_port = &sync->base;
+    return PJ_SUCCESS;
+
+on_error:
+    on_destroy(&sync->base);
+    return status;
+}
