Index: /pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
===================================================================
--- /pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c	(revision 5596)
+++ /pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c	(revision 5597)
@@ -126,4 +126,5 @@
 #    pragma comment(lib, "libcrypto")
 #    pragma comment(lib, "libssl")
+#    pragma comment(lib, "crypt32")
 #  else
 #    pragma comment(lib, "libeay32")
Index: /pjproject/trunk/pjmedia/build/pjmedia.vcproj
===================================================================
--- /pjproject/trunk/pjmedia/build/pjmedia.vcproj	(revision 5596)
+++ /pjproject/trunk/pjmedia/build/pjmedia.vcproj	(revision 5597)
@@ -12,11 +12,11 @@
 		/>
 		<Platform
+			Name="x64"
+		/>
+		<Platform
 			Name="Pocket PC 2003 (ARMV4)"
 		/>
 		<Platform
 			Name="Smartphone 2003 (ARMV4)"
-		/>
-		<Platform
-			Name="x64"
 		/>
 		<Platform
@@ -94,9 +94,10 @@
 		</Configuration>
 		<Configuration
-			Name="Release|Pocket PC 2003 (ARMV4)"
+			Name="Release|x64"
 			ConfigurationType="4"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
+			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="1"
+			CharacterSet="2"
 			>
 			<Tool
@@ -114,9 +115,9 @@
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				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;../../third_party/yuv/include,../../third_party/webrtc/src;../..;&quot;$(DXSDK_DIR)include&quot;"
 				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
@@ -133,5 +134,4 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -145,82 +145,8 @@
 			/>
 			<Tool
-				Name="VCCodeSignTool"
+				Name="VCFxCopTool"
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-			/>
-			<DeploymentTool
-				ForceDirty="-1"
-				RemoteDirectory=""
-				RegisterOutput="0"
-				AdditionalFiles=""
-			/>
-			<DebuggerTool
-			/>
-		</Configuration>
-		<Configuration
-			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"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
-				PreprocessorDefinitions="_LIB;"
-				PrecompiledHeaderFile=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCCodeSignTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-			<DeploymentTool
-				ForceDirty="-1"
-				RemoteDirectory=""
-				RegisterOutput="0"
-				AdditionalFiles=""
-			/>
-			<DebuggerTool
 			/>
 		</Configuration>
@@ -284,9 +210,10 @@
 		</Configuration>
 		<Configuration
-			Name="Debug|Pocket PC 2003 (ARMV4)"
+			Name="Debug|x64"
 			ConfigurationType="4"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
+			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="1"
+			CharacterSet="2"
 			>
 			<Tool
@@ -304,11 +231,12 @@
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				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;../../third_party/yuv/include,../../third_party/webrtc/src;../..;&quot;$(DXSDK_DIR)include&quot;"
 				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
+				DebugInformationFormat="3"
 			/>
 			<Tool
@@ -323,5 +251,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
+				IgnoreDefaultLibraryNames=""
 			/>
 			<Tool
@@ -335,82 +263,8 @@
 			/>
 			<Tool
-				Name="VCCodeSignTool"
+				Name="VCFxCopTool"
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-			/>
-			<DeploymentTool
-				ForceDirty="-1"
-				RemoteDirectory=""
-				RegisterOutput="0"
-				AdditionalFiles=""
-			/>
-			<DebuggerTool
-			/>
-		</Configuration>
-		<Configuration
-			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"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
-				PreprocessorDefinitions="_LIB;"
-				PrecompiledHeaderFile=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCCodeSignTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-			<DeploymentTool
-				ForceDirty="-1"
-				RemoteDirectory=""
-				RegisterOutput="0"
-				AdditionalFiles=""
-			/>
-			<DebuggerTool
 			/>
 		</Configuration>
@@ -473,9 +327,10 @@
 		</Configuration>
 		<Configuration
-			Name="Debug-Static|Pocket PC 2003 (ARMV4)"
+			Name="Debug-Static|x64"
 			ConfigurationType="4"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
+			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="1"
+			CharacterSet="2"
 			>
 			<Tool
@@ -493,11 +348,12 @@
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				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;../../third_party/yuv/include,../../third_party/webrtc/src;../..;&quot;$(DXSDK_DIR)include&quot;"
 				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
+				DebugInformationFormat="3"
 			/>
 			<Tool
@@ -512,5 +368,4 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -524,82 +379,8 @@
 			/>
 			<Tool
-				Name="VCCodeSignTool"
+				Name="VCFxCopTool"
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-			/>
-			<DeploymentTool
-				ForceDirty="-1"
-				RemoteDirectory=""
-				RegisterOutput="0"
-				AdditionalFiles=""
-			/>
-			<DebuggerTool
-			/>
-		</Configuration>
-		<Configuration
-			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"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
-				PreprocessorDefinitions="_LIB;"
-				PrecompiledHeaderFile=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCCodeSignTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-			<DeploymentTool
-				ForceDirty="-1"
-				RemoteDirectory=""
-				RegisterOutput="0"
-				AdditionalFiles=""
-			/>
-			<DebuggerTool
 			/>
 		</Configuration>
@@ -662,9 +443,10 @@
 		</Configuration>
 		<Configuration
-			Name="Release-Dynamic|Pocket PC 2003 (ARMV4)"
+			Name="Release-Dynamic|x64"
 			ConfigurationType="4"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
+			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="1"
+			CharacterSet="2"
 			>
 			<Tool
@@ -682,9 +464,9 @@
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				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;../../third_party/yuv/include,../../third_party/webrtc/src;../..;&quot;$(DXSDK_DIR)include&quot;"
 				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
@@ -701,5 +483,4 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -713,82 +494,8 @@
 			/>
 			<Tool
-				Name="VCCodeSignTool"
+				Name="VCFxCopTool"
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-			/>
-			<DeploymentTool
-				ForceDirty="-1"
-				RemoteDirectory=""
-				RegisterOutput="0"
-				AdditionalFiles=""
-			/>
-			<DebuggerTool
-			/>
-		</Configuration>
-		<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"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
-				PreprocessorDefinitions="_LIB;"
-				PrecompiledHeaderFile=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCCodeSignTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-			<DeploymentTool
-				ForceDirty="-1"
-				RemoteDirectory=""
-				RegisterOutput="0"
-				AdditionalFiles=""
-			/>
-			<DebuggerTool
 			/>
 		</Configuration>
@@ -851,9 +558,10 @@
 		</Configuration>
 		<Configuration
-			Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)"
+			Name="Debug-Dynamic|x64"
 			ConfigurationType="4"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
+			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="1"
+			CharacterSet="2"
 			>
 			<Tool
@@ -871,11 +579,12 @@
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				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;../../third_party/yuv/include,../../third_party/webrtc/src;../..;&quot;$(DXSDK_DIR)include&quot;"
 				PreprocessorDefinitions="_LIB;"
 				PrecompiledHeaderFile=""
+				DebugInformationFormat="3"
 			/>
 			<Tool
@@ -890,5 +599,4 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
 			/>
 			<Tool
@@ -902,82 +610,8 @@
 			/>
 			<Tool
-				Name="VCCodeSignTool"
+				Name="VCFxCopTool"
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-			/>
-			<DeploymentTool
-				ForceDirty="-1"
-				RemoteDirectory=""
-				RegisterOutput="0"
-				AdditionalFiles=""
-			/>
-			<DebuggerTool
-			/>
-		</Configuration>
-		<Configuration
-			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"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
-				PreprocessorDefinitions="_LIB;"
-				PrecompiledHeaderFile=""
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCCodeSignTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-			<DeploymentTool
-				ForceDirty="-1"
-				RemoteDirectory=""
-				RegisterOutput="0"
-				AdditionalFiles=""
-			/>
-			<DebuggerTool
 			/>
 		</Configuration>
@@ -1040,4 +674,722 @@
 		</Configuration>
 		<Configuration
+			Name="Release-Static|x64"
+			ConfigurationType="4"
+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<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;../../third_party/yuv/include,../../third_party/webrtc/src;../..;&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|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"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				PreprocessorDefinitions="_LIB;"
+				PrecompiledHeaderFile=""
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
+		</Configuration>
+		<Configuration
+			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"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				PreprocessorDefinitions="_LIB;"
+				PrecompiledHeaderFile=""
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
+		</Configuration>
+		<Configuration
+			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="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				PreprocessorDefinitions="_LIB;"
+				PrecompiledHeaderFile=""
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
+		</Configuration>
+		<Configuration
+			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"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				PreprocessorDefinitions="_LIB;"
+				PrecompiledHeaderFile=""
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
+		</Configuration>
+		<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"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				PreprocessorDefinitions="_LIB;"
+				PrecompiledHeaderFile=""
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
+		</Configuration>
+		<Configuration
+			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"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				PreprocessorDefinitions="_LIB;"
+				PrecompiledHeaderFile=""
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
+		</Configuration>
+		<Configuration
+			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"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				PreprocessorDefinitions="_LIB;"
+				PrecompiledHeaderFile=""
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
+		</Configuration>
+		<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"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				PreprocessorDefinitions="_LIB;"
+				PrecompiledHeaderFile=""
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
+		</Configuration>
+		<Configuration
+			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"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				PreprocessorDefinitions="_LIB;"
+				PrecompiledHeaderFile=""
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
+		</Configuration>
+		<Configuration
+			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"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				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,../../third_party/yuv/include,../../third_party/webrtc/src;../.."
+				PreprocessorDefinitions="_LIB;"
+				PrecompiledHeaderFile=""
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
+		</Configuration>
+		<Configuration
 			Name="Release-Static|Pocket PC 2003 (ARMV4)"
 			ConfigurationType="4"
@@ -1169,356 +1521,4 @@
 			/>
 			<DebuggerTool
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|x64"
-			ConfigurationType="4"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<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;../../third_party/yuv/include,../../third_party/webrtc/src;../..;&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|x64"
-			ConfigurationType="4"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<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;../../third_party/yuv/include,../../third_party/webrtc/src;../..;&quot;$(DXSDK_DIR)include&quot;"
-				PreprocessorDefinitions="_LIB;"
-				PrecompiledHeaderFile=""
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				IgnoreDefaultLibraryNames=""
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug-Static|x64"
-			ConfigurationType="4"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<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;../../third_party/yuv/include,../../third_party/webrtc/src;../..;&quot;$(DXSDK_DIR)include&quot;"
-				PreprocessorDefinitions="_LIB;"
-				PrecompiledHeaderFile=""
-				DebugInformationFormat="3"
-			/>
-			<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|x64"
-			ConfigurationType="4"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<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;../../third_party/yuv/include,../../third_party/webrtc/src;../..;&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|x64"
-			ConfigurationType="4"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<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;../../third_party/yuv/include,../../third_party/webrtc/src;../..;&quot;$(DXSDK_DIR)include&quot;"
-				PreprocessorDefinitions="_LIB;"
-				PrecompiledHeaderFile=""
-				DebugInformationFormat="3"
-			/>
-			<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|x64"
-			ConfigurationType="4"
-			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<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;../../third_party/yuv/include,../../third_party/webrtc/src;../..;&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>
@@ -3128,4 +3128,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -3137,4 +3146,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -3146,4 +3164,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -3155,4 +3182,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -3164,4 +3200,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -3173,4 +3218,26 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\alaw_ulaw_table.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -3182,4 +3249,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -3191,4 +3267,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -3200,4 +3285,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -3209,4 +3303,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -3218,4 +3321,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -3228,5 +3340,13 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\alaw_ulaw_table.c"
+				RelativePath="..\src\pjmedia\audiodev.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\avi_player.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\bidirectional.c"
 				>
 				<FileConfiguration
@@ -3240,4 +3360,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -3249,4 +3378,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -3258,4 +3396,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -3267,4 +3414,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -3276,4 +3432,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -3285,4 +3450,26 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\clock_thread.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -3294,4 +3481,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -3303,4 +3499,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -3312,4 +3517,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -3321,4 +3535,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -3330,4 +3553,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -3340,13 +3572,5 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\audiodev.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\avi_player.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\bidirectional.c"
+				RelativePath="..\src\pjmedia\codec.c"
 				>
 				<FileConfiguration
@@ -3360,4 +3584,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -3369,4 +3602,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -3378,4 +3620,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -3387,4 +3638,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -3396,4 +3656,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -3405,4 +3674,30 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\conf_switch.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\conference.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -3414,4 +3709,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -3423,4 +3727,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -3432,4 +3745,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -3441,4 +3763,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -3450,4 +3781,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -3460,5 +3800,21 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\clock_thread.c"
+				RelativePath="..\src\pjmedia\converter.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\converter_libswscale.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\converter_libyuv.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\delaybuf.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\echo_common.c"
 				>
 				<FileConfiguration
@@ -3472,4 +3828,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -3481,4 +3846,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -3490,4 +3864,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -3499,4 +3882,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -3508,4 +3900,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -3517,4 +3918,26 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\echo_port.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -3526,4 +3949,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -3535,4 +3967,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -3544,4 +3985,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -3553,4 +4003,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -3562,4 +4021,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -3572,5 +4040,5 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\codec.c"
+				RelativePath="..\src\pjmedia\echo_speex.c"
 				>
 				<FileConfiguration
@@ -3584,4 +4052,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -3593,4 +4070,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -3602,4 +4088,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -3611,4 +4106,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -3620,4 +4124,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -3629,4 +4142,26 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\echo_suppress.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -3638,4 +4173,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -3647,4 +4191,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -3656,4 +4209,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -3665,4 +4227,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -3674,4 +4245,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -3684,9 +4264,9 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\conf_switch.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\conference.c"
+				RelativePath="..\src\pjmedia\echo_webrtc.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\endpoint.c"
 				>
 				<FileConfiguration
@@ -3700,4 +4280,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -3709,4 +4298,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -3718,4 +4316,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -3727,4 +4334,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -3736,4 +4352,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -3745,4 +4370,26 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\errno.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -3754,4 +4401,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -3763,4 +4419,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -3772,4 +4437,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -3781,4 +4455,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -3790,4 +4473,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -3800,21 +4492,17 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\converter.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\converter_libswscale.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\converter_libyuv.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\delaybuf.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\echo_common.c"
+				RelativePath="..\src\pjmedia\event.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\ffmpeg_util.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\format.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\g711.c"
 				>
 				<FileConfiguration
@@ -3828,4 +4516,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -3837,4 +4534,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -3846,4 +4552,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -3855,4 +4570,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -3864,4 +4588,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -3873,4 +4606,26 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\jbuf.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -3882,4 +4637,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -3891,4 +4655,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -3900,4 +4673,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -3909,4 +4691,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -3918,4 +4709,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -3928,5 +4728,5 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\echo_port.c"
+				RelativePath="..\src\pjmedia\master_port.c"
 				>
 				<FileConfiguration
@@ -3940,4 +4740,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -3949,4 +4758,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -3958,4 +4776,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -3967,4 +4794,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -3976,4 +4812,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -3985,4 +4830,26 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\mem_capture.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -3994,4 +4861,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -4003,4 +4879,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -4012,4 +4897,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -4021,4 +4915,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -4030,4 +4933,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -4040,5 +4952,5 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\echo_speex.c"
+				RelativePath="..\src\pjmedia\mem_player.c"
 				>
 				<FileConfiguration
@@ -4052,4 +4964,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -4061,4 +4982,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -4070,4 +5000,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -4079,4 +5018,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -4088,4 +5036,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -4097,4 +5054,26 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\null_port.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -4106,4 +5085,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -4115,4 +5103,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -4124,4 +5121,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -4133,4 +5139,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -4142,4 +5157,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -4152,5 +5176,5 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\echo_suppress.c"
+				RelativePath="..\src\pjmedia\plc_common.c"
 				>
 				<FileConfiguration
@@ -4164,4 +5188,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -4173,4 +5206,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -4182,4 +5224,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -4191,4 +5242,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -4200,4 +5260,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -4209,4 +5278,26 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\port.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -4218,4 +5309,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -4227,4 +5327,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -4236,4 +5345,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -4245,4 +5363,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -4254,4 +5381,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -4264,9 +5400,9 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\echo_webrtc.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\endpoint.c"
+				RelativePath="..\src\pjmedia\resample_libsamplerate.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\resample_port.c"
 				>
 				<FileConfiguration
@@ -4280,4 +5416,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -4289,4 +5434,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -4298,4 +5452,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -4307,4 +5470,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -4316,4 +5488,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -4325,4 +5506,34 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\resample_resample.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\resample_speex.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\rtcp.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -4334,4 +5545,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -4343,4 +5563,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -4352,4 +5581,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -4361,4 +5599,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -4370,4 +5617,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -4380,5 +5636,9 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\errno.c"
+				RelativePath="..\src\pjmedia\rtcp_xr.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\rtp.c"
 				>
 				<FileConfiguration
@@ -4392,4 +5652,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -4401,4 +5670,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -4410,4 +5688,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -4419,4 +5706,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -4428,4 +5724,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -4437,4 +5742,26 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\sdp.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -4446,4 +5773,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -4455,4 +5791,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -4464,4 +5809,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -4473,4 +5827,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -4482,4 +5845,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -4492,17 +5864,5 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\event.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\ffmpeg_util.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\format.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\g711.c"
+				RelativePath="..\src\pjmedia\sdp_cmp.c"
 				>
 				<FileConfiguration
@@ -4516,4 +5876,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -4525,4 +5894,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -4534,4 +5912,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -4543,4 +5930,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -4552,4 +5948,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -4561,4 +5966,26 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\sdp_neg.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -4570,4 +5997,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -4579,4 +6015,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -4588,4 +6033,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -4597,4 +6051,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -4606,4 +6069,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -4616,5 +6088,5 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\jbuf.c"
+				RelativePath="..\src\pjmedia\silencedet.c"
 				>
 				<FileConfiguration
@@ -4628,4 +6100,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -4637,4 +6118,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -4646,4 +6136,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -4655,4 +6154,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -4664,4 +6172,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -4673,4 +6190,30 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\sound_legacy.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\sound_port.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -4682,4 +6225,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -4691,4 +6243,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -4700,4 +6261,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -4709,4 +6279,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -4718,4 +6297,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -4728,5 +6316,5 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\master_port.c"
+				RelativePath="..\src\pjmedia\splitcomb.c"
 				>
 				<FileConfiguration
@@ -4740,4 +6328,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -4749,4 +6346,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -4758,4 +6364,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -4767,4 +6382,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -4776,4 +6400,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -4785,4 +6418,30 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\stereo_port.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\stream.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -4794,4 +6453,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -4803,4 +6471,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -4812,4 +6489,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -4821,4 +6507,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -4830,4 +6525,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -4840,5 +6544,13 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\mem_capture.c"
+				RelativePath="..\src\pjmedia\stream_common.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\stream_info.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\tonegen.c"
 				>
 				<FileConfiguration
@@ -4852,4 +6564,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -4861,4 +6582,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -4870,4 +6600,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -4879,4 +6618,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -4888,4 +6636,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -4897,108 +6654,234 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\transport_adapter_sample.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\transport_ice.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\transport_loop.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\transport_srtp.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\transport_srtp_dtls.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug-Static|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-Static|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\mem_player.c"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\transport_srtp_sdes.c"
 				>
 				<FileConfiguration
 					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug-Static|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Release-Static|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-Static|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\transport_udp.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
 					>
 					<Tool
@@ -5018,4 +6901,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -5027,4 +6919,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -5036,4 +6937,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -5045,4 +6955,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -5054,4 +6973,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -5064,5 +6992,37 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\null_port.c"
+				RelativePath="..\src\pjmedia\types.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\vid_codec.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\vid_codec_util.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\vid_port.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\vid_stream.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\vid_stream_info.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\vid_tee.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\videodev.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\wav_player.c"
 				>
 				<FileConfiguration
@@ -5076,4 +7036,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -5085,4 +7054,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -5094,4 +7072,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -5103,4 +7090,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -5112,4 +7108,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -5121,4 +7126,26 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\wav_playlist.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -5130,4 +7157,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -5139,4 +7175,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -5148,4 +7193,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -5157,4 +7211,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -5166,4 +7229,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|x64"
 					>
@@ -5176,5 +7248,5 @@
 			</File>
 			<File
-				RelativePath="..\src\pjmedia\plc_common.c"
+				RelativePath="..\src\pjmedia\wav_writer.c"
 				>
 				<FileConfiguration
@@ -5188,4 +7260,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|Win32"
 					>
@@ -5197,4 +7278,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|Win32"
 					>
@@ -5206,4 +7296,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|Win32"
 					>
@@ -5215,4 +7314,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|Win32"
 					>
@@ -5224,4 +7332,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Static|Win32"
 					>
@@ -5233,4 +7350,26 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Static|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\pjmedia\wave.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|x64"
 					>
@@ -5242,4 +7381,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug|x64"
 					>
@@ -5251,4 +7399,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Static|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Static|x64"
 					>
@@ -5260,4 +7417,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Release-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release-Dynamic|x64"
 					>
@@ -5269,4 +7435,13 @@
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug-Dynamic|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Debug-Dynamic|x64"
 					>
@@ -5278,1980 +7453,5 @@
 				</FileConfiguration>
 				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\port.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
 					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\resample_libsamplerate.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\resample_port.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\resample_resample.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\resample_speex.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\rtcp.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\rtcp_xr.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\rtp.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\sdp.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\sdp_cmp.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\sdp_neg.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\silencedet.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\sound_legacy.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\sound_port.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\splitcomb.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\stereo_port.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\stream.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\stream_common.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\stream_info.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\tonegen.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\transport_adapter_sample.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\transport_ice.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\transport_loop.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\transport_srtp.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\transport_udp.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\types.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\vid_codec.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\vid_codec_util.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\vid_port.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\vid_stream.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\vid_stream_info.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\vid_tee.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\videodev.c"
-				>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\wav_player.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\wav_playlist.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\wav_writer.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\src\pjmedia\wave.c"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Static|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Static|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release-Dynamic|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug-Dynamic|x64"
 					>
 					<Tool
Index: /pjproject/trunk/pjmedia/include/pjmedia/config.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/config.h	(revision 5596)
+++ /pjproject/trunk/pjmedia/include/pjmedia/config.h	(revision 5597)
@@ -954,4 +954,34 @@
 
 /**
+ * Enable session description for SRTP keying.
+ *
+ * By default it is enabled.
+ */
+#ifndef PJMEDIA_SRTP_HAS_SDES
+#   define PJMEDIA_SRTP_HAS_SDES		    1
+#endif
+
+
+/**
+ * Enable DTLS for SRTP keying.
+ *
+ * Default value: 0 (disabled)
+ */
+#ifndef PJMEDIA_SRTP_HAS_DTLS
+#   define PJMEDIA_SRTP_HAS_DTLS		    0
+#endif
+
+
+/**
+ * Set OpenSSL ciphers for DTLS-SRTP.
+ *
+ * Default value: "DEFAULT"
+ */
+#ifndef PJMEDIA_SRTP_DTLS_OSSL_CIPHERS
+#   define PJMEDIA_SRTP_DTLS_OSSL_CIPHERS	    "DEFAULT"
+#endif
+
+
+/**
  * Maximum number of SRTP cryptos.
  *
Index: /pjproject/trunk/pjmedia/include/pjmedia/errno.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/errno.h	(revision 5596)
+++ /pjproject/trunk/pjmedia/include/pjmedia/errno.h	(revision 5597)
@@ -623,4 +623,22 @@
 #define PJMEDIA_SRTP_ESDPREQSECTP   (PJMEDIA_ERRNO_START+229)    /* 220229 */
 
+/**
+ * @hideinitializer
+ * No matching SRTP crypto-suite after DTLS nego.
+ */
+#define PJMEDIA_SRTP_DTLS_ENOCRYPTO (PJMEDIA_ERRNO_START+240)    /* 220240 */
+
+/**
+ * @hideinitializer
+ * No certificate supplied by peer in DTLS nego.
+ */
+#define PJMEDIA_SRTP_DTLS_EPEERNOCERT (PJMEDIA_ERRNO_START+241)  /* 220241 */
+
+/**
+ * @hideinitializer
+ * Fingerprint from signalling not match to actual fingerprint.
+ */
+#define PJMEDIA_SRTP_DTLS_EFPNOTMATCH (PJMEDIA_ERRNO_START+242)  /* 220242 */
+
 #endif /* PJMEDIA_HAS_SRTP */
 
Index: /pjproject/trunk/pjmedia/include/pjmedia/transport_ice.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/transport_ice.h	(revision 5596)
+++ /pjproject/trunk/pjmedia/include/pjmedia/transport_ice.h	(revision 5597)
@@ -59,4 +59,19 @@
 			       pj_ice_strans_op op,
 			       pj_status_t status);
+
+    /**
+     * This callback will be called when ICE negotiation completes, with
+     * application user data. Note that if both callbacks are implemented,
+     * only this callback will be invoked.
+     *
+     * @param tp	PJMEDIA ICE transport.
+     * @param op	The operation
+     * @param status	Operation status.
+     * @param user_data	User data for this callback.
+     */
+    void    (*on_ice_complete2)(pjmedia_transport *tp,
+			        pj_ice_strans_op op,
+			        pj_status_t status,
+				void *user_data);
 
 } pjmedia_ice_cb;
@@ -231,4 +246,37 @@
 PJ_DECL(pj_grp_lock_t *) pjmedia_ice_get_grp_lock(pjmedia_transport *tp);
 
+
+/**
+ * Add application to receive ICE notifications from the specified ICE media
+ * transport.
+ *
+ * @param tp	        The ICE media transport.
+ * @param cb	        The ICE specific callbacks.
+ * @param user_data     Optional application user data.
+ *
+ * @return		PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pjmedia_ice_add_ice_cb(pjmedia_transport *tp,
+					    const pjmedia_ice_cb *cb,
+					    void *user_data);
+
+
+/**
+ * Remove application to stop receiving ICE notifications from the specified
+ * ICE media transport.
+ *
+ * @param tp	        The ICE media transport.
+ * @param cb	        The ICE specific callbacks.
+ * @param user_data     Optional application user data. The same user data
+ *			passed to pjmedia_ice_add_ice_cb(), this is for
+ *			validation purpose.
+ *
+ * @return		PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pjmedia_ice_remove_ice_cb(pjmedia_transport *tp,
+					       const pjmedia_ice_cb *cb,
+					       void *user_data);
+
+
 PJ_END_DECL
 
Index: /pjproject/trunk/pjmedia/include/pjmedia/transport_srtp.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/transport_srtp.h	(revision 5596)
+++ /pjproject/trunk/pjmedia/include/pjmedia/transport_srtp.h	(revision 5597)
@@ -131,4 +131,46 @@
 
 /**
+ * This enumeration specifies SRTP keying methods.
+ */
+typedef enum pjmedia_srtp_keying_method
+{
+    /**
+     * Session Description (SDES).
+     */
+    PJMEDIA_SRTP_KEYING_SDES,
+
+    /**
+     * DTLS-SRTP.
+     */
+    PJMEDIA_SRTP_KEYING_DTLS_SRTP,
+
+    /**
+     * Number of keying method.
+     */
+    PJMEDIA_SRTP_KEYINGS_COUNT
+
+} pjmedia_srtp_keying_method;
+
+
+/**
+ * Structure containing callbacks to receive SRTP notifications.
+ */
+typedef struct pjmedia_srtp_cb
+{
+    /**
+     * This callback will be called when SRTP negotiation completes. This
+     * callback will be invoked when the negotiation is done outside of
+     * the SDP signalling, such as in DTLS-SRTP.
+     *
+     * @param tp	PJMEDIA SRTP transport.
+     * @param status	Operation status.
+     */
+    void    (*on_srtp_nego_complete)(pjmedia_transport *tp,
+				     pj_status_t status);
+
+} pjmedia_srtp_cb;
+
+
+/**
  * Settings to be given when creating SRTP transport. Application should call
  * #pjmedia_srtp_setting_default() to initialize this structure with its 
@@ -140,5 +182,5 @@
      * Specify the usage policy. Default is PJMEDIA_SRTP_OPTIONAL.
      */
-    pjmedia_srtp_use		use;
+    pjmedia_srtp_use		 use;
 
     /**
@@ -146,15 +188,46 @@
      * when it is destroyed. Default: PJ_TRUE.
      */
-    pj_bool_t			close_member_tp;
+    pj_bool_t			 close_member_tp;
 
     /**
      * Specify the number of crypto suite settings.
      */
-    unsigned			crypto_count;
+    unsigned			 crypto_count;
 
     /**
      * Specify individual crypto suite setting.
-     */
-    pjmedia_srtp_crypto		crypto[PJMEDIA_SRTP_MAX_CRYPTOS];
+     * Notes for DTLS-SRTP keying:
+     *  - Currently only supports these cryptos: AES_CM_128_HMAC_SHA1_80,
+     *    AES_CM_128_HMAC_SHA1_32, AEAD_AES_256_GCM, and AEAD_AES_128_GCM.
+     *  - SRTP key is not configurable.
+     */
+    pjmedia_srtp_crypto		 crypto[PJMEDIA_SRTP_MAX_CRYPTOS];
+
+    /**
+     * Specify the number of enabled keying methods.
+     * Default is PJMEDIA_SRTP_MAX_KEYINGS (all enabled).
+     */
+    unsigned			 keying_count;
+
+    /**
+     * Specify enabled keying methods and its priority order. Keying method
+     * with higher priority will be given earlier chance to process the SDP,
+     * for example as currently only one keying is supported in the SDP offer,
+     * keying with first priority will be likely used in the SDP offer.
+     *
+     * Default is that all supported keying methods (i.e: currently SDES and
+     * DTLS-SRTP) will be enabled and with priority order: SDES, DTLS-SRTP.
+     */
+    pjmedia_srtp_keying_method	 keying[PJMEDIA_SRTP_KEYINGS_COUNT];
+
+    /**
+     * Specify SRTP callback.
+     */
+    pjmedia_srtp_cb		 cb;
+
+    /**
+     * Specify SRTP transport user data.
+     */
+    void			*user_data;
 
 } pjmedia_srtp_setting;
Index: /pjproject/trunk/pjmedia/src/pjmedia/errno.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/errno.c	(revision 5596)
+++ /pjproject/trunk/pjmedia/src/pjmedia/errno.c	(revision 5597)
@@ -166,5 +166,8 @@
     PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPINTRANSPORT, "Invalid SDP media transport for SRTP" ),
     PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPREQCRYPTO,   "SRTP crypto attribute required" ),
-    PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPREQSECTP,    "Secure transport required in SDP media descriptor" )
+    PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPREQSECTP,    "Secure transport required in SDP media descriptor" ),
+    PJ_BUILD_ERR( PJMEDIA_SRTP_DTLS_ENOCRYPTO,  "No matching SRTP crypto-suite after DTLS nego" ),
+    PJ_BUILD_ERR( PJMEDIA_SRTP_DTLS_EPEERNOCERT,"No certificate supplied by peer in DTLS nego" ),
+    PJ_BUILD_ERR( PJMEDIA_SRTP_DTLS_EFPNOTMATCH,"Fingerprint from signalling not match to actual fingerprint" )
 #endif
 
Index: /pjproject/trunk/pjmedia/src/pjmedia/stream_info.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/stream_info.c	(revision 5596)
+++ /pjproject/trunk/pjmedia/src/pjmedia/stream_info.c	(revision 5597)
@@ -420,5 +420,5 @@
 	si->proto = PJMEDIA_TP_PROTO_RTP_AVP;
 
-    } else if (pj_stricmp(&local_m->desc.transport, &ID_RTP_SAVP) == 0) {
+    } else if (pj_stristr(&local_m->desc.transport, &ID_RTP_SAVP)) {
 
 	si->proto = PJMEDIA_TP_PROTO_RTP_SAVP;
Index: /pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c	(revision 5596)
+++ /pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c	(revision 5597)
@@ -47,4 +47,12 @@
 };
 
+/* ICE listener */
+typedef struct ice_listener
+{
+    PJ_DECL_LIST_MEMBER(struct ice_listener);
+    pjmedia_ice_cb	 cb;
+    void		*user_data;
+} ice_listener;
+
 struct transport_ice
 {
@@ -57,4 +65,6 @@
 
     pjmedia_ice_cb	 cb;
+    ice_listener	 listener;
+    ice_listener	 listener_empty;
     unsigned		 media_option;
 
@@ -67,4 +77,5 @@
     pj_sockaddr		 remote_rtcp;
     unsigned		 addr_len;	/**< Length of addresses.	    */
+    unsigned		 rem_rtp_cnt;	/**< How many pkt from this addr.   */
 
     pj_bool_t		 use_ice;
@@ -244,4 +255,6 @@
     tp_ice->oa_role = ROLE_NONE;
     tp_ice->use_ice = PJ_FALSE;
+    pj_list_init(&tp_ice->listener);
+    pj_list_init(&tp_ice->listener_empty);
 
     pj_memcpy(&ice_st_cfg, cfg, sizeof(pj_ice_strans_cfg));
@@ -286,4 +299,75 @@
     PJ_ASSERT_RETURN(tp, NULL);
     return pj_ice_strans_get_grp_lock(((struct transport_ice *)tp)->ice_st);
+}
+
+
+/*
+ * Add application to receive ICE notifications from the specified ICE media
+ * transport.
+ */
+PJ_DEF(pj_status_t) pjmedia_ice_add_ice_cb( pjmedia_transport *tp,
+					    const pjmedia_ice_cb *cb,
+					    void *user_data)
+{
+    struct transport_ice *tp_ice = (struct transport_ice*)tp;
+    ice_listener *il;
+    pj_grp_lock_t *grp_lock;
+
+    PJ_ASSERT_RETURN(tp && cb, PJ_EINVAL);
+    grp_lock = pjmedia_ice_get_grp_lock(tp);
+    PJ_ASSERT_RETURN(grp_lock, PJ_EINVAL);
+
+    pj_grp_lock_acquire(grp_lock);
+
+    if (!pj_list_empty(&tp_ice->listener_empty)) {
+	il = tp_ice->listener_empty.next;
+	pj_list_erase(il);
+	il->cb = *cb;
+	il->user_data = user_data;
+	pj_list_push_back(&tp_ice->listener, il);
+    } else {
+	il = PJ_POOL_ZALLOC_T(tp_ice->pool, ice_listener);
+	pj_list_init(il);
+	il->cb = *cb;
+	il->user_data = user_data;
+	pj_list_push_back(&tp_ice->listener, il);
+    }
+
+    pj_grp_lock_release(grp_lock);
+
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Remove application to stop receiving ICE notifications the specified
+ * ICE media transport.
+ */
+PJ_DEF(pj_status_t) pjmedia_ice_remove_ice_cb( pjmedia_transport *tp,
+					       const pjmedia_ice_cb *cb,
+					       void *user_data)
+{
+    struct transport_ice *tp_ice = (struct transport_ice*)tp;
+    ice_listener *il;
+    pj_grp_lock_t *grp_lock;
+
+    PJ_ASSERT_RETURN(tp && cb, PJ_EINVAL);
+    grp_lock = pjmedia_ice_get_grp_lock(tp);
+    PJ_ASSERT_RETURN(grp_lock, PJ_EINVAL);
+
+    pj_grp_lock_acquire(grp_lock);
+
+    for (il=tp_ice->listener.next; il!=&tp_ice->listener; il=il->next) {
+	if (pj_memcmp(&il->cb, cb, sizeof(cb))==0 && il->user_data==user_data)
+	    break;
+    }
+    if (il != &tp_ice->listener) {
+	pj_list_erase(il);
+	pj_list_push_back(&tp_ice->listener_empty, il);
+    }
+
+    pj_grp_lock_release(grp_lock);
+
+    return (il != &tp_ice->listener? PJ_SUCCESS : PJ_ENOTFOUND);
 }
 
@@ -1620,4 +1704,5 @@
     pj_memcpy(&tp_ice->remote_rtcp, rem_rtcp, addr_len);
     tp_ice->addr_len = addr_len;
+    tp_ice->rem_rtp_cnt = 0;
 
     /* Init source RTP & RTCP addresses and counter */
@@ -1731,4 +1816,5 @@
 		/* Don't switch while we're receiving from remote_rtp */
 		tp_ice->rtp_src_cnt = 0;
+		tp_ice->rem_rtp_cnt++;
 	    } else {
 
@@ -1745,5 +1831,8 @@
 
 		if (tp_ice->rtp_src_cnt < PJMEDIA_RTP_NAT_PROBATION_CNT) {
-		    discard = PJ_TRUE;
+		    /* Only discard if we have ever received packet from
+		     * remote address (remote_rtp).
+		     */
+		    discard = (tp_ice->rem_rtp_cnt != 0);
 		} else {
 		    char addr_text[80];
@@ -1834,4 +1923,5 @@
 {
     struct transport_ice *tp_ice;
+    ice_listener *il;
 
     tp_ice = (struct transport_ice*) pj_ice_strans_get_user_data(ice_st);
@@ -1845,4 +1935,13 @@
     if (tp_ice->cb.on_ice_complete)
 	(*tp_ice->cb.on_ice_complete)(&tp_ice->base, op, result);
+
+    for (il=tp_ice->listener.next; il!=&tp_ice->listener; il=il->next) {
+	if (il->cb.on_ice_complete2) {
+	    (*il->cb.on_ice_complete2)(&tp_ice->base, op, result,
+				       il->user_data);
+	} else if (il->cb.on_ice_complete) {
+	    (*il->cb.on_ice_complete)(&tp_ice->base, op, result);
+	}
+    }
 }
 
Index: /pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c	(revision 5596)
+++ /pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c	(revision 5597)
@@ -22,4 +22,5 @@
 #include <pjmedia/endpoint.h>
 #include <pjlib-util/base64.h>
+#include <pj/array.h>
 #include <pj/assert.h>
 #include <pj/ctype.h>
@@ -80,5 +81,6 @@
     char		*name;
     cipher_type_id_t	 cipher_type;
-    unsigned		 cipher_key_len;
+    unsigned		 cipher_key_len;    /* key + salt length    */
+    unsigned		 cipher_salt_len;   /* salt only length	    */
     auth_type_id_t	 auth_type;
     unsigned		 auth_key_len;
@@ -101,58 +103,67 @@
     /* plain RTP/RTCP (no cipher & no auth) */
     {"NULL", NULL_CIPHER, 0, NULL_AUTH, 0, 0, 0, sec_serv_none},
-#if defined(PJMEDIA_SRTP_HAS_AES_GCM_256) && \
-    (PJMEDIA_SRTP_HAS_AES_GCM_256 != 0)
+
+#if defined(PJMEDIA_SRTP_HAS_AES_GCM_256)&&(PJMEDIA_SRTP_HAS_AES_GCM_256!=0)
+
     /* cipher AES_GCM, NULL auth, auth tag len = 16 octets */
-    {"AEAD_AES_256_GCM", AES_256_GCM, AES_256_GCM_KEYSIZE_WSALT,
+    {"AEAD_AES_256_GCM", AES_256_GCM, 44, 12,
 	NULL_AUTH, 0, 16, 16, sec_serv_conf_and_auth, &aes_gcm_256_openssl},
+
     /* cipher AES_GCM, NULL auth, auth tag len = 8 octets */
-    {"AEAD_AES_256_GCM_8", AES_256_GCM, AES_256_GCM_KEYSIZE_WSALT,
+    {"AEAD_AES_256_GCM_8", AES_256_GCM, 44, 12,
 	NULL_AUTH, 0, 8, 8, sec_serv_conf_and_auth, &aes_gcm_256_openssl},
 #endif
-#if defined(PJMEDIA_SRTP_HAS_AES_CM_256) && \
-    (PJMEDIA_SRTP_HAS_AES_CM_256 != 0)
+#if defined(PJMEDIA_SRTP_HAS_AES_CM_256)&&(PJMEDIA_SRTP_HAS_AES_CM_256!=0)
+
     /* cipher AES_CM_256, auth HMAC_SHA1, auth tag len = 10 octets */
-    {"AES_256_CM_HMAC_SHA1_80", AES_ICM, 46, HMAC_SHA1, 20, 10, 10,
+    {"AES_256_CM_HMAC_SHA1_80", AES_ICM, 46, 14, HMAC_SHA1, 20, 10, 10,
 	sec_serv_conf_and_auth, NULL, 
         &crypto_policy_set_aes_cm_256_hmac_sha1_80},
+
     /* cipher AES_CM_256, auth HMAC_SHA1, auth tag len = 10 octets */
-    {"AES_256_CM_HMAC_SHA1_32", AES_ICM, 46, HMAC_SHA1, 20, 4, 10,
+    {"AES_256_CM_HMAC_SHA1_32", AES_ICM, 46, 14, HMAC_SHA1, 20, 4, 10,
 	sec_serv_conf_and_auth, NULL,
         &crypto_policy_set_aes_cm_256_hmac_sha1_32},
 #endif
-#if defined(PJMEDIA_SRTP_HAS_AES_CM_192) && \
-    (PJMEDIA_SRTP_HAS_AES_CM_192 != 0)
+#if defined(PJMEDIA_SRTP_HAS_AES_CM_192)&&(PJMEDIA_SRTP_HAS_AES_CM_192!=0)
+
     /* cipher AES_CM_192, auth HMAC_SHA1, auth tag len = 10 octets */
-    {"AES_192_CM_HMAC_SHA1_80", AES_ICM, 38, HMAC_SHA1, 20, 10, 10,
+    {"AES_192_CM_HMAC_SHA1_80", AES_ICM, 38, 14, HMAC_SHA1, 20, 10, 10,
 	sec_serv_conf_and_auth, &aes_icm_192},
+
     /* cipher AES_CM_192, auth HMAC_SHA1, auth tag len = 4 octets */
-    {"AES_192_CM_HMAC_SHA1_32", AES_ICM, 38, HMAC_SHA1, 20, 4, 10,
+    {"AES_192_CM_HMAC_SHA1_32", AES_ICM, 38, 14, HMAC_SHA1, 20, 4, 10,
 	sec_serv_conf_and_auth, &aes_icm_192},
 #endif
-#if defined(PJMEDIA_SRTP_HAS_AES_GCM_128) && \
-    (PJMEDIA_SRTP_HAS_AES_GCM_128 != 0)
+#if defined(PJMEDIA_SRTP_HAS_AES_GCM_128)&&(PJMEDIA_SRTP_HAS_AES_GCM_128!=0)
+
     /* cipher AES_GCM, NULL auth, auth tag len = 16 octets */
-    {"AEAD_AES_128_GCM", AES_128_GCM, AES_128_GCM_KEYSIZE_WSALT,
+    {"AEAD_AES_128_GCM", AES_128_GCM, 28, 12,
 	NULL_AUTH, 0, 16, 16, sec_serv_conf_and_auth, &aes_gcm_128_openssl},
 
     /* cipher AES_GCM, NULL auth, auth tag len = 8 octets */
-    {"AEAD_AES_128_GCM_8", AES_128_GCM, AES_128_GCM_KEYSIZE_WSALT,
+    {"AEAD_AES_128_GCM_8", AES_128_GCM, 28, 12,
 	NULL_AUTH, 0, 8, 8, sec_serv_conf_and_auth, &aes_gcm_128_openssl},
 #endif
-#if defined(PJMEDIA_SRTP_HAS_AES_CM_128) && \
-    (PJMEDIA_SRTP_HAS_AES_CM_128 != 0)
+#if defined(PJMEDIA_SRTP_HAS_AES_CM_128)&&(PJMEDIA_SRTP_HAS_AES_CM_128!=0)
+
     /* cipher AES_CM_128, auth HMAC_SHA1, auth tag len = 10 octets */
-    {"AES_CM_128_HMAC_SHA1_80", AES_ICM, 30, HMAC_SHA1, 20, 10, 10,
+    {"AES_CM_128_HMAC_SHA1_80", AES_ICM, 30, 14, HMAC_SHA1, 20, 10, 10,
 	sec_serv_conf_and_auth},
+
     /* cipher AES_CM_128, auth HMAC_SHA1, auth tag len = 4 octets */
-    {"AES_CM_128_HMAC_SHA1_32", AES_ICM, 30, HMAC_SHA1, 20, 4, 10,
+    {"AES_CM_128_HMAC_SHA1_32", AES_ICM, 30, 14, HMAC_SHA1, 20, 4, 10,
 	sec_serv_conf_and_auth},
 #endif
+
     /*
      * F8_128_HMAC_SHA1_8 not supported by libsrtp?
-     * {"F8_128_HMAC_SHA1_8", NULL_CIPHER, 0, NULL_AUTH, 0, 0, 0, sec_serv_none}
+     * {"F8_128_HMAC_SHA1_8", NULL_CIPHER, 0, 0, NULL_AUTH, 0, 0, 0,
+     *	sec_serv_none}
      */
 };
 
+
+/* SRTP transport */
 typedef struct transport_srtp
 {
@@ -193,4 +204,5 @@
     /* Transport information */
     pjmedia_transport	*member_tp; /**< Underlying transport.       */
+    pj_bool_t		 member_tp_attached;
 
     /* SRTP usage policy of peer. This field is updated when media is starting.
@@ -205,4 +217,23 @@
      */
     unsigned		 probation_cnt;
+
+    /* SRTP keying methods. The keying is implemented using media transport
+     * abstraction, so it will also be invoked when the SRTP media transport
+     * operation is invoked.
+     *
+     * As there can be multiple keying methods enabled (currently only SDES &
+     * DTLS-SRTP), each keying method will be given the chance to respond to
+     * remote SDP. If any keying operation returns non-success, it will be
+     * removed from the session. And once SRTP key is obtained via a keying
+     * method, any other keying methods will be stopped and destroyed.
+     */
+    unsigned		 keying_cnt;
+    pjmedia_transport	*keying[2];
+
+    /* If not zero, keying nego is ongoing (async-ly, e.g: by DTLS-SRTP).
+     * This field may be updated by keying method.
+     */
+    unsigned		 keying_pending_cnt;
+
 } transport_srtp;
 
@@ -224,15 +255,15 @@
 static pj_status_t transport_get_info (pjmedia_transport *tp,
 				       pjmedia_transport_info *info);
-static pj_status_t transport_attach   (pjmedia_transport *tp,
-				       void *user_data,
-				       const pj_sockaddr_t *rem_addr,
-				       const pj_sockaddr_t *rem_rtcp,
-				       unsigned addr_len,
-				       void (*rtp_cb)(void*,
-						      void*,
-						      pj_ssize_t),
-				       void (*rtcp_cb)(void*,
-						       void*,
-						       pj_ssize_t));
+//static pj_status_t transport_attach   (pjmedia_transport *tp,
+//				       void *user_data,
+//				       const pj_sockaddr_t *rem_addr,
+//				       const pj_sockaddr_t *rem_rtcp,
+//				       unsigned addr_len,
+//				       void (*rtp_cb)(void*,
+//						      void*,
+//						      pj_ssize_t),
+//				       void (*rtcp_cb)(void*,
+//						       void*,
+//						       pj_ssize_t));
 static void	   transport_detach   (pjmedia_transport *tp,
 				       void *strm);
@@ -268,4 +299,6 @@
 				       unsigned pct_lost);
 static pj_status_t transport_destroy  (pjmedia_transport *tp);
+static pj_status_t transport_attach2  (pjmedia_transport *tp,
+				       pjmedia_transport_attach_param *param);
 
 
@@ -274,5 +307,5 @@
 {
     &transport_get_info,
-    &transport_attach,
+    NULL, //&transport_attach,
     &transport_detach,
     &transport_send_rtp,
@@ -284,6 +317,31 @@
     &transport_media_stop,
     &transport_simulate_lost,
-    &transport_destroy
+    &transport_destroy,
+    &transport_attach2
 };
+
+/* Get crypto index from crypto name */
+static int get_crypto_idx(const pj_str_t* crypto_name);
+
+/* Is crypto empty (i.e: no name or key)? */
+static pj_bool_t srtp_crypto_empty(const pjmedia_srtp_crypto* c);
+
+/* Compare crypto, return zero if same */
+static int srtp_crypto_cmp(const pjmedia_srtp_crypto* c1,
+			   const pjmedia_srtp_crypto* c2);
+
+/* Start SRTP */
+static pj_status_t start_srtp(transport_srtp *srtp);
+
+/* SRTP keying method: Session Description */
+#if defined(PJMEDIA_SRTP_HAS_SDES) && (PJMEDIA_SRTP_HAS_SDES != 0)
+#  include "transport_srtp_sdes.c"
+#endif
+
+/* SRTP keying method: DTLS */
+#if defined(PJMEDIA_SRTP_HAS_DTLS) && (PJMEDIA_SRTP_HAS_DTLS != 0)
+#  include "transport_srtp_dtls.c"
+#endif
+
 
 /* This function may also be used by other module, e.g: pjmedia/errno.c,
@@ -346,6 +404,12 @@
 PJ_DEF(pj_status_t) pjmedia_srtp_init_lib(pjmedia_endpt *endpt)
 {
+    pj_status_t status = PJ_SUCCESS;
+
+    if (libsrtp_initialized)
+	return PJ_SUCCESS;
+
 #if PJMEDIA_LIBSRTP_AUTO_INIT_DEINIT
-    if (libsrtp_initialized == PJ_FALSE) {
+    /* Init libsrtp */
+    {
 	err_status_t err;
 
@@ -356,22 +420,24 @@
 	    return PJMEDIA_ERRNO_FROM_LIBSRTP(err);
 	}
-
-	if (pjmedia_endpt_atexit(endpt, pjmedia_srtp_deinit_lib) != PJ_SUCCESS)
-	{
-	    /* There will be memory leak when it fails to schedule libsrtp
-	     * deinitialization, however the memory leak could be harmless,
-	     * since in modern OS's memory used by an application is released
-	     * when the application terminates.
-	     */
-	    PJ_LOG(4, (THIS_FILE, "Failed to register libsrtp deinit."));
-	}
-
-	libsrtp_initialized = PJ_TRUE;
-    }
-#else
-    PJ_UNUSED_ARG(endpt);
-#endif
-
-    return PJ_SUCCESS;
+    }
+#endif
+
+#if defined(PJMEDIA_SRTP_HAS_DTLS) && (PJMEDIA_SRTP_HAS_DTLS != 0)
+    dtls_init();
+#endif
+
+    if (pjmedia_endpt_atexit(endpt, pjmedia_srtp_deinit_lib) != PJ_SUCCESS)
+    {
+	/* There will be memory leak when it fails to schedule libsrtp
+	 * deinitialization, however the memory leak could be harmless,
+	 * since in modern OS's memory used by an application is released
+	 * when the application terminates.
+	 */
+	PJ_LOG(4, (THIS_FILE, "Failed to register libsrtp deinit."));
+    }
+
+    libsrtp_initialized = PJ_TRUE;
+
+    return status;
 }
 
@@ -392,4 +458,6 @@
 # define PJMEDIA_SRTP_HAS_SHUTDOWN 1
 #endif
+
+#if PJMEDIA_LIBSRTP_AUTO_INIT_DEINIT
 
 # if defined(PJMEDIA_SRTP_HAS_DEINIT) && PJMEDIA_SRTP_HAS_DEINIT!=0
@@ -404,4 +472,9 @@
 		   get_libsrtp_errstr(err)));
     }
+#endif // PJMEDIA_LIBSRTP_AUTO_INIT_DEINIT
+
+#if defined(PJMEDIA_SRTP_HAS_DTLS) && (PJMEDIA_SRTP_HAS_DTLS != 0)
+    dtls_deinit();
+#endif
 
     libsrtp_initialized = PJ_FALSE;
@@ -464,4 +537,12 @@
     for (i=0; i<opt->crypto_count; ++i)
 	opt->crypto[i].name = pj_str(crypto_suites[i+1].name);
+
+    /* Keying method */
+    opt->keying_count = PJMEDIA_SRTP_KEYINGS_COUNT;
+    opt->keying[0] = PJMEDIA_SRTP_KEYING_SDES;
+    opt->keying[1] = PJMEDIA_SRTP_KEYING_DTLS_SRTP;
+
+    /* Just for reminder to add any new keying to the array above */
+    pj_assert(PJMEDIA_SRTP_KEYINGS_COUNT == 2);
 }
 
@@ -551,4 +632,5 @@
 	srtp->base.type = PJMEDIA_TRANSPORT_TYPE_UDP;
     srtp->base.op = &transport_srtp_op;
+    srtp->base.user_data = srtp->setting.user_data;
 
     /* Set underlying transport */
@@ -557,4 +639,25 @@
     /* Initialize peer's SRTP usage mode. */
     srtp->peer_use = srtp->setting.use;
+
+    /* Initialize SRTP keying method. */
+    for (i = 0; i < srtp->setting.keying_count; ++i) {
+	switch(srtp->setting.keying[i]) {
+
+	case PJMEDIA_SRTP_KEYING_SDES:
+#if defined(PJMEDIA_SRTP_HAS_SDES) && (PJMEDIA_SRTP_HAS_SDES != 0)
+	    sdes_create(srtp, &srtp->keying[srtp->keying_cnt++]);
+#endif
+	    break;
+
+	case PJMEDIA_SRTP_KEYING_DTLS_SRTP:
+#if defined(PJMEDIA_SRTP_HAS_DTLS) && (PJMEDIA_SRTP_HAS_DTLS != 0)
+	    dtls_create(srtp, &srtp->keying[srtp->keying_cnt++]);
+#endif
+	    break;
+
+	default:
+	    break;
+	}
+    }
 
     /* Done */
@@ -780,4 +883,46 @@
 }
 
+
+static pj_status_t start_srtp(transport_srtp *srtp)
+{
+    /* Make sure we have the SRTP policies */
+    if (srtp_crypto_empty(&srtp->tx_policy_neg) ||
+	srtp_crypto_empty(&srtp->rx_policy_neg))
+    {
+	srtp->bypass_srtp = PJ_TRUE;
+	srtp->peer_use = PJMEDIA_SRTP_DISABLED;
+	if (srtp->session_inited) {
+	    pjmedia_transport_srtp_stop(&srtp->base);
+	}
+
+	return PJ_SUCCESS;
+    }
+
+    /* Reset probation counts */
+    srtp->probation_cnt = PROBATION_CNT_INIT;
+
+    /* Got policy_local & policy_remote, let's initalize the SRTP */
+
+    /* Ticket #1075: media_start() is called whenever media description
+     * gets updated, e.g: call hold, however we should restart SRTP only
+     * when the SRTP policy settings are updated.
+     */
+    if (srtp_crypto_cmp(&srtp->tx_policy_neg, &srtp->tx_policy) ||
+	srtp_crypto_cmp(&srtp->rx_policy_neg, &srtp->rx_policy))
+    {
+	pj_status_t status;
+	status = pjmedia_transport_srtp_start(&srtp->base,
+					      &srtp->tx_policy_neg,
+					      &srtp->rx_policy_neg);
+	if (status != PJ_SUCCESS)
+	    return status;
+    }
+
+    srtp->bypass_srtp = PJ_FALSE;
+
+    return PJ_SUCCESS;
+}
+
+
 PJ_DEF(pjmedia_transport *) pjmedia_transport_srtp_get_member(
 						pjmedia_transport *tp)
@@ -797,4 +942,5 @@
     pjmedia_srtp_info srtp_info;
     int spc_info_idx;
+    unsigned i;
 
     PJ_ASSERT_RETURN(tp && info, PJ_EINVAL);
@@ -816,33 +962,33 @@
 	      sizeof(srtp_info));
 
+    /* Invoke get_info() of all keying methods */
+    for (i=0; i < srtp->keying_cnt; i++)
+	pjmedia_transport_get_info(srtp->keying[i], info);
+
     return pjmedia_transport_get_info(srtp->member_tp, info);
 }
 
-static pj_status_t transport_attach(pjmedia_transport *tp,
-				    void *user_data,
-				    const pj_sockaddr_t *rem_addr,
-				    const pj_sockaddr_t *rem_rtcp,
-				    unsigned addr_len,
-				    void (*rtp_cb) (void*, void*,
-						    pj_ssize_t),
-				    void (*rtcp_cb)(void*, void*,
-						    pj_ssize_t))
+static pj_status_t transport_attach2(pjmedia_transport *tp,
+				     pjmedia_transport_attach_param *param)
 {
     transport_srtp *srtp = (transport_srtp*) tp;
+    pjmedia_transport_attach_param member_param;
     pj_status_t status;
 
-    PJ_ASSERT_RETURN(tp && rem_addr && addr_len, PJ_EINVAL);
+    PJ_ASSERT_RETURN(tp && param, PJ_EINVAL);
 
     /* Save the callbacks */
     pj_lock_acquire(srtp->mutex);
-    srtp->rtp_cb = rtp_cb;
-    srtp->rtcp_cb = rtcp_cb;
-    srtp->user_data = user_data;
+    srtp->rtp_cb = param->rtp_cb;
+    srtp->rtcp_cb = param->rtcp_cb;
+    srtp->user_data = param->user_data;
     pj_lock_release(srtp->mutex);
 
-    /* Attach itself to transport */
-    status = pjmedia_transport_attach(srtp->member_tp, srtp, rem_addr,
-				      rem_rtcp, addr_len, &srtp_rtp_cb,
-				      &srtp_rtcp_cb);
+    /* Attach self to member transport */
+    member_param = *param;
+    member_param.user_data = srtp;
+    member_param.rtp_cb = &srtp_rtp_cb;
+    member_param.rtcp_cb = &srtp_rtcp_cb;
+    status = pjmedia_transport_attach2(srtp->member_tp, &member_param);
     if (status != PJ_SUCCESS) {
 	pj_lock_acquire(srtp->mutex);
@@ -854,4 +1000,5 @@
     }
 
+    srtp->member_tp_attached = PJ_TRUE;
     return PJ_SUCCESS;
 }
@@ -874,4 +1021,5 @@
     srtp->user_data = NULL;
     pj_lock_release(srtp->mutex);
+    srtp->member_tp_attached = PJ_FALSE;
 }
 
@@ -973,7 +1121,13 @@
     transport_srtp *srtp = (transport_srtp *) tp;
     pj_status_t status;
+    unsigned i;
 
     PJ_ASSERT_RETURN(tp, PJ_EINVAL);
 
+    /* Close keying */
+    for (i=0; i < srtp->keying_cnt; i++)
+	pjmedia_transport_close(srtp->keying[i]);
+
+    /* Close member if configured */
     if (srtp->setting.close_member_tp && srtp->member_tp) {
 	pjmedia_transport_close(srtp->member_tp);
@@ -1010,4 +1164,24 @@
     if (size < 0) {
 	return;
+    }
+
+    /* Give the packet to keying first by invoking its send_rtp() op.
+     * Yes, the usage of send_rtp() is rather hacky, but it is convenient
+     * as the signature suits the purpose and it is ready to use
+     * (no futher registration/setting needed), and it may never be used
+     * by any keying method in the future.
+     */
+    {
+	unsigned i;
+	pj_status_t status;
+	for (i=0; i < srtp->keying_cnt; i++) {
+	    if (!srtp->keying[i]->op->send_rtp)
+		continue;
+	    status = pjmedia_transport_send_rtp(srtp->keying[i], pkt, size);
+	    if (status != PJ_EIGNORED) {
+		/* Packet is already consumed by the keying method */
+		return;
+	    }
+	}
     }
 
@@ -1111,188 +1285,4 @@
 }
 
-/* Generate crypto attribute, including crypto key.
- * If crypto-suite chosen is crypto NULL, just return PJ_SUCCESS,
- * and set buffer_len = 0.
- */
-static pj_status_t generate_crypto_attr_value(pj_pool_t *pool,
-					      char *buffer, int *buffer_len,
-					      pjmedia_srtp_crypto *crypto,
-					      int tag)
-{
-    pj_status_t status;
-    int cs_idx = get_crypto_idx(&crypto->name);
-    char b64_key[PJ_BASE256_TO_BASE64_LEN(MAX_KEY_LEN)+1];
-    int b64_key_len = sizeof(b64_key);
-    int print_len;
-
-    if (cs_idx == -1)
-	return PJMEDIA_SRTP_ENOTSUPCRYPTO;
-
-    /* Crypto-suite NULL. */
-    if (cs_idx == 0) {
-	*buffer_len = 0;
-	return PJ_SUCCESS;
-    }
-
-    /* Generate key if not specified. */
-    if (crypto->key.slen == 0) {
-	pj_bool_t key_ok;
-	char key[MAX_KEY_LEN];
-	err_status_t err;
-	unsigned i;
-
-	PJ_ASSERT_RETURN(MAX_KEY_LEN >= crypto_suites[cs_idx].cipher_key_len,
-			 PJ_ETOOSMALL);
-
-	do {
-	    key_ok = PJ_TRUE;
-
-
-#if defined(PJ_HAS_SSL_SOCK) && (PJ_HAS_SSL_SOCK != 0)
-
-/* Include OpenSSL libraries for MSVC */
-#  ifdef _MSC_VER
-#    if OPENSSL_VERSION_NUMBER >= 0x10100000L
-#      pragma comment(lib, "libcrypto")
-#    else
-#      pragma comment(lib, "libeay32")
-#      pragma comment(lib, "ssleay32")
-#    endif
-#  endif
-
-	    err = RAND_bytes((unsigned char*)key,
-			     crypto_suites[cs_idx].cipher_key_len);
-	    if (err != 1) {
-		PJ_LOG(5,(THIS_FILE, "Failed generating random key"));
-		return PJMEDIA_ERRNO_FROM_LIBSRTP(1);
-	    }
-#else	    
-	    err = crypto_get_random((unsigned char*)key,
-				     crypto_suites[cs_idx].cipher_key_len);
-	    if (err != err_status_ok) {
-		PJ_LOG(5,(THIS_FILE, "Failed generating random key: %s",
-			  get_libsrtp_errstr(err)));
-		return PJMEDIA_ERRNO_FROM_LIBSRTP(err);
-	    }
-#endif
-	    for (i=0; i<crypto_suites[cs_idx].cipher_key_len && key_ok; ++i)
-		if (key[i] == 0) key_ok = PJ_FALSE;
-
-	} while (!key_ok);
-	crypto->key.ptr = (char*)
-			  pj_pool_zalloc(pool,
-					 crypto_suites[cs_idx].cipher_key_len);
-	pj_memcpy(crypto->key.ptr, key, crypto_suites[cs_idx].cipher_key_len);
-	crypto->key.slen = crypto_suites[cs_idx].cipher_key_len;
-    }
-
-    if (crypto->key.slen != (pj_ssize_t)crypto_suites[cs_idx].cipher_key_len)
-	return PJMEDIA_SRTP_EINKEYLEN;
-
-    /* Key transmitted via SDP should be base64 encoded. */
-    status = pj_base64_encode((pj_uint8_t*)crypto->key.ptr, crypto->key.slen,
-			      b64_key, &b64_key_len);
-    if (status != PJ_SUCCESS) {
-	PJ_LOG(5,(THIS_FILE, "Failed encoding plain key to base64"));
-	return status;
-    }
-
-    b64_key[b64_key_len] = '\0';
-
-    PJ_ASSERT_RETURN(*buffer_len >= (crypto->name.slen + \
-		     b64_key_len + 16), PJ_ETOOSMALL);
-
-    /* Print the crypto attribute value. */
-    print_len = pj_ansi_snprintf(buffer, *buffer_len, "%d %s inline:%s",
-				   tag,
-				   crypto_suites[cs_idx].name,
-				   b64_key);
-    if (print_len < 1 || print_len >= *buffer_len)
-	return PJ_ETOOSMALL;
-
-    *buffer_len = print_len;
-
-    return PJ_SUCCESS;
-}
-
-/* Parse crypto attribute line */
-static pj_status_t parse_attr_crypto(pj_pool_t *pool,
-				     const pjmedia_sdp_attr *attr,
-				     pjmedia_srtp_crypto *crypto,
-				     int *tag)
-{
-    pj_str_t token, delim;
-    pj_status_t status;
-    int itmp, found_idx;
-
-    pj_bzero(crypto, sizeof(*crypto));
-
-    /* Tag */
-    delim = pj_str(" ");
-    found_idx = pj_strtok(&attr->value, &delim, &token, 0);
-    if (found_idx == attr->value.slen) {
-	PJ_LOG(4,(THIS_FILE, "Attribute crypto expecting tag"));
-	return PJMEDIA_SDP_EINATTR;
-    }
-
-    /* Tag must not use leading zeroes. */
-    if (token.slen > 1 && *token.ptr == '0')
-	return PJMEDIA_SDP_EINATTR;
-
-    /* Tag must be decimal, i.e: contains only digit '0'-'9'. */
-    for (itmp = 0; itmp < token.slen; ++itmp)
-	if (!pj_isdigit(token.ptr[itmp]))
-	    return PJMEDIA_SDP_EINATTR;
-
-    /* Get tag value. */
-    *tag = pj_strtoul(&token);
-
-    /* Crypto-suite */
-    found_idx = pj_strtok(&attr->value, &delim, &token, found_idx+token.slen);
-    if (found_idx == attr->value.slen) {
-	PJ_LOG(4,(THIS_FILE, "Attribute crypto expecting crypto suite"));
-	return PJMEDIA_SDP_EINATTR;
-    }
-    pj_strdup(pool, &crypto->name, &token);    
-
-    /* Key method */
-    delim = pj_str(": ");
-    found_idx = pj_strtok(&attr->value, &delim, &token, found_idx+token.slen);
-    if (found_idx == attr->value.slen) {
-	PJ_LOG(4,(THIS_FILE, "Attribute crypto expecting key method"));
-	return PJMEDIA_SDP_EINATTR;
-    }
-    if (pj_stricmp2(&token, "inline")) {
-	PJ_LOG(4,(THIS_FILE, "Attribute crypto key method '%.*s' "
-	          "not supported!", token.slen, token.ptr));
-	return PJMEDIA_SDP_EINATTR;
-    }
-
-    /* Key */    
-    delim = pj_str("| ");
-    found_idx = pj_strtok(&attr->value, &delim, &token, found_idx+token.slen);
-    if (found_idx == attr->value.slen) {
-	PJ_LOG(4,(THIS_FILE, "Attribute crypto expecting key"));
-	return PJMEDIA_SDP_EINATTR;
-    }
-    
-    if (PJ_BASE64_TO_BASE256_LEN(token.slen) > MAX_KEY_LEN) {
-	PJ_LOG(4,(THIS_FILE, "Key too long"));
-	return PJMEDIA_SRTP_EINKEYLEN;
-    }
-
-    /* Decode key */
-    crypto->key.ptr = (char*) pj_pool_zalloc(pool, MAX_KEY_LEN);
-    itmp = MAX_KEY_LEN;
-    status = pj_base64_decode(&token, (pj_uint8_t*)crypto->key.ptr,
-			      &itmp);
-    if (status != PJ_SUCCESS) {
-	PJ_LOG(4,(THIS_FILE, "Failed decoding crypto key from base64"));
-	return status;
-    }
-    crypto->key.slen = itmp;
-
-    return PJ_SUCCESS;
-}
 
 static pj_status_t transport_media_create(pjmedia_transport *tp,
@@ -1304,4 +1294,7 @@
     struct transport_srtp *srtp = (struct transport_srtp*) tp;
     unsigned member_tp_option;
+    pj_status_t last_err_st = PJ_EBUG;
+    pj_status_t status;
+    unsigned i;
 
     PJ_ASSERT_RETURN(tp, PJ_EINVAL);
@@ -1310,51 +1303,46 @@
     pj_bzero(&srtp->tx_policy_neg, sizeof(srtp->tx_policy_neg));
 
-    srtp->media_option = options;
-    member_tp_option = options | PJMEDIA_TPMED_NO_TRANSPORT_CHECKING;
-
-    srtp->offerer_side = sdp_remote == NULL;
-
-    /* Validations */
-    if (srtp->offerer_side) {
-
-	if (srtp->setting.use == PJMEDIA_SRTP_DISABLED)
-	    goto BYPASS_SRTP;
-
-    } else {
-
-	pjmedia_sdp_media *m_rem;
-
-	m_rem = sdp_remote->media[media_index];
-
-	/* Nothing to do on inactive media stream */
-	if (pjmedia_sdp_media_find_attr(m_rem, &ID_INACTIVE, NULL))
-	    goto BYPASS_SRTP;
-
-	/* Validate remote media transport based on SRTP usage option.
-	 */
-	switch (srtp->setting.use) {
-	    case PJMEDIA_SRTP_DISABLED:
-		if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) == 0)
-		    return PJMEDIA_SRTP_ESDPINTRANSPORT;
-		goto BYPASS_SRTP;
-	    case PJMEDIA_SRTP_OPTIONAL:
-		break;
-	    case PJMEDIA_SRTP_MANDATORY:
-		if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) != 0)
-		    return PJMEDIA_SRTP_ESDPINTRANSPORT;
-		break;
+    srtp->media_option = member_tp_option = options;
+    srtp->offerer_side = (sdp_remote == NULL);
+
+    if (srtp->offerer_side && srtp->setting.use == PJMEDIA_SRTP_DISABLED)
+	srtp->bypass_srtp = PJ_TRUE;
+    else
+	member_tp_option |= PJMEDIA_TPMED_NO_TRANSPORT_CHECKING;
+
+    status = pjmedia_transport_media_create(srtp->member_tp, sdp_pool,
+					    member_tp_option, sdp_remote,
+					    media_index);
+    if (status != PJ_SUCCESS || srtp->bypass_srtp)
+	return status;
+
+    /* Invoke media_create() of all keying methods */
+    for (i=0; i < srtp->keying_cnt; ) {
+	pj_status_t st;
+	st = pjmedia_transport_media_create(srtp->keying[i], sdp_pool,
+					    options, sdp_remote,
+					    media_index);
+	if (st != PJ_SUCCESS) {
+	    /* This keying method returns error, remove it */
+	    pj_array_erase(srtp->keying, sizeof(srtp->keying[0]),
+			   srtp->keying_cnt, i);
+	    srtp->keying_cnt--;
+	    last_err_st = st;
+	    continue;
+	} else if (srtp->offerer_side) {
+	    /* Currently we can send one keying only in outgoing offer */
+	    srtp->keying[0] = srtp->keying[i];
+	    srtp->keying_cnt = 1;
+	    break;
 	}
 
-    }
-    goto PROPAGATE_MEDIA_CREATE;
-
-BYPASS_SRTP:
-    srtp->bypass_srtp = PJ_TRUE;
-    member_tp_option &= ~PJMEDIA_TPMED_NO_TRANSPORT_CHECKING;
-
-PROPAGATE_MEDIA_CREATE:
-    return pjmedia_transport_media_create(srtp->member_tp, sdp_pool,
-					  member_tp_option, sdp_remote,
-					  media_index);
+	++i;
+    }
+
+    /* All keying method failed to process remote SDP? */
+    if (srtp->keying_cnt == 0)
+	return last_err_st;
+
+    return PJ_SUCCESS;
 }
 
@@ -1366,12 +1354,7 @@
 {
     struct transport_srtp *srtp = (struct transport_srtp*) tp;
-    pjmedia_sdp_media *m_rem, *m_loc;
-    enum { MAXLEN = 512 };
-    char buffer[MAXLEN];
-    int buffer_len;
+    pj_status_t last_err_st = PJ_EBUG;
     pj_status_t status;
-    pjmedia_sdp_attr *attr;
-    pj_str_t attr_value;
-    unsigned i, j;
+    unsigned i;
 
     PJ_ASSERT_RETURN(tp && sdp_pool && sdp_local, PJ_EINVAL);
@@ -1380,275 +1363,49 @@
     pj_bzero(&srtp->tx_policy_neg, sizeof(srtp->tx_policy_neg));
 
-    srtp->offerer_side = sdp_remote == NULL;
-
-    m_rem = sdp_remote ? sdp_remote->media[media_index] : NULL;
-    m_loc = sdp_local->media[media_index];
-
-    /* Bypass if media transport is not RTP/AVP or RTP/SAVP */
-    if (pj_stricmp(&m_loc->desc.transport, &ID_RTP_AVP)  != 0 &&
-	pj_stricmp(&m_loc->desc.transport, &ID_RTP_SAVP) != 0)
-	goto BYPASS_SRTP;
-
-    /* If the media is inactive, do nothing. */
-    /* No, we still need to process SRTP offer/answer even if the media is
-     * marked as inactive, because the transport is still alive in this
-     * case (e.g. for keep-alive). See:
-     *   http://trac.pjsip.org/repos/ticket/1079
-     */
-    /*
-    if (pjmedia_sdp_media_find_attr(m_loc, &ID_INACTIVE, NULL) ||
-	(m_rem && pjmedia_sdp_media_find_attr(m_rem, &ID_INACTIVE, NULL)))
-	goto BYPASS_SRTP;
-    */
-
-    /* Check remote media transport & set local media transport
-     * based on SRTP usage option.
-     */
-    if (srtp->offerer_side) {
-
-	/* Generate transport */
-	switch (srtp->setting.use) {
-	    case PJMEDIA_SRTP_DISABLED:
-		goto BYPASS_SRTP;
-	    case PJMEDIA_SRTP_OPTIONAL:
-		m_loc->desc.transport =
-				(srtp->peer_use == PJMEDIA_SRTP_MANDATORY)?
-				ID_RTP_SAVP : ID_RTP_AVP;
-		break;
-	    case PJMEDIA_SRTP_MANDATORY:
-		m_loc->desc.transport = ID_RTP_SAVP;
-		break;
+    srtp->offerer_side = (sdp_remote == NULL);
+
+    status = pjmedia_transport_encode_sdp(srtp->member_tp, sdp_pool,
+					  sdp_local, sdp_remote, media_index);
+    if (status != PJ_SUCCESS || srtp->bypass_srtp)
+	return status;
+
+    /* Invoke encode_sdp() of all keying methods */
+    for (i=0; i < srtp->keying_cnt; ) {
+	pj_status_t st;
+	st = pjmedia_transport_encode_sdp(srtp->keying[i], sdp_pool,
+					  sdp_local, sdp_remote,
+					  media_index);
+	if (st != PJ_SUCCESS) {
+	    /* This keying method returns error, remove it */
+	    pj_array_erase(srtp->keying, sizeof(srtp->keying[0]),
+			   srtp->keying_cnt, i);
+	    srtp->keying_cnt--;
+	    last_err_st = st;
+	    continue;
 	}
 
-	/* Generate crypto attribute if not yet */
-	if (pjmedia_sdp_media_find_attr(m_loc, &ID_CRYPTO, NULL) == NULL) {
-	    int tag = 1;
-
-	    /* Offer only current active crypto if any, otherwise offer all
-	     * crypto-suites in the setting.
-	     */
-	    for (i=0; i<srtp->setting.crypto_count; ++i) {
-		if (srtp->tx_policy.name.slen &&
-		    pj_stricmp(&srtp->tx_policy.name,
-			       &srtp->setting.crypto[i].name) != 0)
-		{
-		    continue;
-		}
-
-		buffer_len = MAXLEN;
-		status = generate_crypto_attr_value(srtp->pool, buffer, &buffer_len,
-						    &srtp->setting.crypto[i],
-						    tag);
-		if (status != PJ_SUCCESS)
-		    return status;
-
-		/* If buffer_len==0, just skip the crypto attribute. */
-		if (buffer_len) {
-		    pj_strset(&attr_value, buffer, buffer_len);
-		    attr = pjmedia_sdp_attr_create(srtp->pool, ID_CRYPTO.ptr,
-						   &attr_value);
-		    m_loc->attr[m_loc->attr_count++] = attr;
-		    ++tag;
-		}
+	if (!srtp_crypto_empty(&srtp->tx_policy_neg) &&
+	    !srtp_crypto_empty(&srtp->rx_policy_neg))
+	{
+	    /* SRTP nego is done, let's destroy any other keying. */
+	    unsigned j;
+	    for (j = 0; j < srtp->keying_cnt; ++j) {
+		if (j != i)
+		    pjmedia_transport_close(srtp->keying[j]);
 	    }
+	    srtp->keying_cnt = 1;
+	    srtp->keying[0] = srtp->keying[i];
+	    srtp->keying_pending_cnt = 0;
+	    break;
 	}
 
-    } else {
-	/* Answerer side */
-
-	pj_assert(sdp_remote && m_rem);
-
-	/* Generate transport */
-	switch (srtp->setting.use) {
-	    case PJMEDIA_SRTP_DISABLED:
-		if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) == 0)
-		    return PJMEDIA_SRTP_ESDPINTRANSPORT;
-		goto BYPASS_SRTP;
-	    case PJMEDIA_SRTP_OPTIONAL:
-		m_loc->desc.transport = m_rem->desc.transport;
-		break;
-	    case PJMEDIA_SRTP_MANDATORY:
-		if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) != 0)
-		    return PJMEDIA_SRTP_ESDPINTRANSPORT;
-		m_loc->desc.transport = ID_RTP_SAVP;
-		break;
-	}
-
-	/* Generate crypto attribute if not yet */
-	if (pjmedia_sdp_media_find_attr(m_loc, &ID_CRYPTO, NULL) == NULL) {
-
-	    pjmedia_srtp_crypto tmp_rx_crypto;
-	    pj_bool_t has_crypto_attr = PJ_FALSE;
-	    int matched_idx = -1;
-	    int chosen_tag = 0;
-	    int tags[64]; /* assume no more than 64 crypto attrs in a media */
-	    unsigned cr_attr_count = 0;
-
-	    /* Find supported crypto-suite, get the tag, and assign policy_local */
-	    for (i=0; i<m_rem->attr_count; ++i) {
-		if (pj_stricmp(&m_rem->attr[i]->name, &ID_CRYPTO) != 0)
-		    continue;
-
-		has_crypto_attr = PJ_TRUE;
-
-		status = parse_attr_crypto(srtp->pool, m_rem->attr[i],
-					   &tmp_rx_crypto, &tags[cr_attr_count]);
-		if (status != PJ_SUCCESS)
-		    return status;
-
-		/* Check duplicated tag */
-		for (j=0; j<cr_attr_count; ++j) {
-		    if (tags[j] == tags[cr_attr_count]) {
-			DEACTIVATE_MEDIA(sdp_pool, m_loc);
-			return PJMEDIA_SRTP_ESDPDUPCRYPTOTAG;
-		    }
-		}
-
-		if (matched_idx == -1) {
-		    /* lets see if the crypto-suite offered is supported */
-		    for (j=0; j<srtp->setting.crypto_count; ++j)
-			if (pj_stricmp(&tmp_rx_crypto.name,
-				       &srtp->setting.crypto[j].name) == 0)
-			{
-			    int cs_idx = get_crypto_idx(&tmp_rx_crypto.name);
-			    
-	    		    if (cs_idx == -1)
-	    		        return PJMEDIA_SRTP_ENOTSUPCRYPTO;
-
-			    /* Force to use test key */
-			    /* bad keys for snom: */
-			    //char *hex_test_key = "58b29c5c8f42308120ce857e439f2d"
-			    //		     "7810a8b10ad0b1446be5470faea496";
-			    //char *hex_test_key = "20a26aac7ba062d356ff52b61e3993"
-			    //		     "ccb78078f12c64db94b9c294927fd0";
-			    //pj_str_t *test_key = &srtp->setting.crypto[j].key;
-			    //char  *raw_test_key = pj_pool_zalloc(srtp->pool, 64);
-			    //hex_string_to_octet_string(
-			    //		raw_test_key,
-			    //		hex_test_key,
-			    //		strlen(hex_test_key));
-			    //pj_strset(test_key, raw_test_key,
-			    //	  crypto_suites[cs_idx].cipher_key_len);
-			    /* EO Force to use test key */
-
-			    if (tmp_rx_crypto.key.slen !=
-				(int)crypto_suites[cs_idx].cipher_key_len)
-				return PJMEDIA_SRTP_EINKEYLEN;
-
-			    srtp->rx_policy_neg = tmp_rx_crypto;
-			    chosen_tag = tags[cr_attr_count];
-			    matched_idx = j;
-    			    break;
-			}
-		}
-		cr_attr_count++;
-	    }
-
-	    /* Check crypto negotiation result */
-	    switch (srtp->setting.use) {
-		case PJMEDIA_SRTP_DISABLED:
-		    pj_assert(!"Should never reach here");
-		    break;
-
-		case PJMEDIA_SRTP_OPTIONAL:
-		    /* bypass SRTP when no crypto-attr and remote uses RTP/AVP */
-		    if (!has_crypto_attr &&
-			pj_stricmp(&m_rem->desc.transport, &ID_RTP_AVP) == 0)
-			goto BYPASS_SRTP;
-		    /* bypass SRTP when nothing match and remote uses RTP/AVP */
-		    else if (matched_idx == -1 &&
-			pj_stricmp(&m_rem->desc.transport, &ID_RTP_AVP) == 0)
-			goto BYPASS_SRTP;
-		    break;
-
-		case PJMEDIA_SRTP_MANDATORY:
-		    /* Do nothing, intentional */
-		    break;
-	    }
-
-	    /* No crypto attr */
-	    if (!has_crypto_attr) {
-		DEACTIVATE_MEDIA(sdp_pool, m_loc);
-		return PJMEDIA_SRTP_ESDPREQCRYPTO;
-	    }
-
-	    /* No crypto match */
-	    if (matched_idx == -1) {
-		DEACTIVATE_MEDIA(sdp_pool, m_loc);
-		return PJMEDIA_SRTP_ENOTSUPCRYPTO;
-	    }
-
-	    /* we have to generate crypto answer,
-	     * with srtp->tx_policy_neg matched the offer
-	     * and rem_tag contains matched offer tag.
-	     */
-	    buffer_len = MAXLEN;
-	    status = generate_crypto_attr_value(srtp->pool, buffer, &buffer_len,
-						&srtp->setting.crypto[matched_idx],
-						chosen_tag);
-	    if (status != PJ_SUCCESS)
-		return status;
-
-	    srtp->tx_policy_neg = srtp->setting.crypto[matched_idx];
-
-	    /* If buffer_len==0, just skip the crypto attribute. */
-	    if (buffer_len) {
-		pj_strset(&attr_value, buffer, buffer_len);
-		attr = pjmedia_sdp_attr_create(sdp_pool, ID_CRYPTO.ptr,
-					       &attr_value);
-		m_loc->attr[m_loc->attr_count++] = attr;
-	    }
-
-	    /* At this point, we get valid rx_policy_neg & tx_policy_neg. */
-	}
-
-    }
-    goto PROPAGATE_MEDIA_CREATE;
-
-BYPASS_SRTP:
-    /* Do not update this flag here as actually the media session hasn't been
-     * updated.
-     */
-    //srtp->bypass_srtp = PJ_TRUE;
-
-PROPAGATE_MEDIA_CREATE:
-    return pjmedia_transport_encode_sdp(srtp->member_tp, sdp_pool,
-					sdp_local, sdp_remote, media_index);
-}
-
-
-static pj_status_t fill_local_crypto(pj_pool_t *pool,
-			             const pjmedia_sdp_media *m_loc, 
-			             pjmedia_srtp_crypto loc_crypto[],
-			             int *count)
-{
-    int i;
-    int crypto_count = 0;
-    pj_status_t status = PJ_SUCCESS;
-    
-    for (i = 0; i < *count; ++i) {
-	pj_bzero(&loc_crypto[i], sizeof(loc_crypto[i]));
-    }
-
-    for (i = 0; i < (int)m_loc->attr_count; ++i) {	
-	pjmedia_srtp_crypto tmp_crypto;
-	int loc_tag;
-
-	if (pj_stricmp(&m_loc->attr[i]->name, &ID_CRYPTO) != 0)
-	    continue;
-
-	status = parse_attr_crypto(pool, m_loc->attr[i],
-				   &tmp_crypto, &loc_tag);
-	if (status != PJ_SUCCESS)
-	    return status;
-
-	if (loc_tag > *count)
-	    return PJMEDIA_SRTP_ESDPINCRYPTOTAG;
-
-	loc_crypto[loc_tag-1] = tmp_crypto;
-	++crypto_count;
-    }
-    *count = crypto_count;
-    return status;
+	i++;
+    }
+
+    /* All keying method failed to process remote SDP? */
+    if (srtp->keying_cnt == 0)
+	return last_err_st;
+
+    return PJ_SUCCESS;
 }
 
@@ -1661,168 +1418,64 @@
 {
     struct transport_srtp *srtp = (struct transport_srtp*) tp;
-    pjmedia_sdp_media *m_rem, *m_loc;
+    pj_status_t last_err_st = PJ_EBUG;
     pj_status_t status;
     unsigned i;
-    pjmedia_srtp_crypto	loc_crypto[PJMEDIA_SRTP_MAX_CRYPTOS];
-    int loc_cryto_cnt = PJMEDIA_SRTP_MAX_CRYPTOS;
 
     PJ_ASSERT_RETURN(tp && pool && sdp_local && sdp_remote, PJ_EINVAL);
 
-    m_rem = sdp_remote->media[media_index];
-    m_loc = sdp_local->media[media_index];
-
-    if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) == 0)
-	srtp->peer_use = PJMEDIA_SRTP_MANDATORY;
-    else
-	srtp->peer_use = PJMEDIA_SRTP_OPTIONAL;
-
-    /* For answerer side, this function will just have to start SRTP */
-
-    /* Check remote media transport & set local media transport
-     * based on SRTP usage option.
+    status = pjmedia_transport_media_start(srtp->member_tp, pool,
+					   sdp_local, sdp_remote,
+				           media_index);
+    if (status != PJ_SUCCESS || srtp->bypass_srtp)
+	return status;
+
+    /* Invoke media_start() of all keying methods */
+    for (i=0; i < srtp->keying_cnt; ) {
+	status = pjmedia_transport_media_start(srtp->keying[i], pool,
+					       sdp_local, sdp_remote,
+					       media_index);
+	if (status != PJ_SUCCESS) {
+	    /* This keying method returns error, remove it */
+	    pj_array_erase(srtp->keying, sizeof(srtp->keying[0]),
+			   srtp->keying_cnt, i);
+	    srtp->keying_cnt--;
+	    last_err_st = status;
+	    continue;
+	}
+
+	if (!srtp_crypto_empty(&srtp->tx_policy_neg) &&
+	    !srtp_crypto_empty(&srtp->rx_policy_neg))
+	{
+	    /* SRTP nego is done, let's destroy any other keying. */
+	    unsigned j;
+	    for (j = 0; j < srtp->keying_cnt; ++j) {
+		if (j != i)
+		    pjmedia_transport_close(srtp->keying[j]);
+	    }
+	    srtp->keying_cnt = 1;
+	    srtp->keying[0] = srtp->keying[i];
+	    srtp->keying_pending_cnt = 0;
+	    break;
+	}
+
+	i++;
+    }
+
+    /* All keying method failed to process remote SDP? */
+    if (srtp->keying_cnt == 0)
+	return last_err_st;
+
+    /* If SRTP key is being negotiated, just return now.
+     * The keying method should start the SRTP once keying nego is done.
      */
-    if (srtp->offerer_side) {
-	if (srtp->setting.use == PJMEDIA_SRTP_DISABLED) {
-	    if (pjmedia_sdp_media_find_attr(m_rem, &ID_CRYPTO, NULL)) {
-		DEACTIVATE_MEDIA(pool, m_loc);
-		return PJMEDIA_SRTP_ESDPINCRYPTO;
-	    }
-	    goto BYPASS_SRTP;
-	} else if (srtp->setting.use == PJMEDIA_SRTP_OPTIONAL) {
-	    // Regardless the answer's transport type (RTP/AVP or RTP/SAVP),
-	    // the answer must be processed through in optional mode.
-	    // Please note that at this point transport type is ensured to be
-	    // RTP/AVP or RTP/SAVP, see transport_media_create()
-	    //if (pj_stricmp(&m_rem->desc.transport, &m_loc->desc.transport)) {
-		//DEACTIVATE_MEDIA(pool, m_loc);
-		//return PJMEDIA_SDP_EINPROTO;
-	    //}
-	    fill_local_crypto(srtp->pool, m_loc, loc_crypto, &loc_cryto_cnt);
-	} else if (srtp->setting.use == PJMEDIA_SRTP_MANDATORY) {
-	    if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP)) {
-		DEACTIVATE_MEDIA(pool, m_loc);
-		return PJMEDIA_SDP_EINPROTO;
-	    }
-	    fill_local_crypto(srtp->pool, m_loc, loc_crypto, &loc_cryto_cnt);
-	}
-    }
-
-    if (srtp->offerer_side) {
-	/* find supported crypto-suite, get the tag, and assign policy_local */
-	pjmedia_srtp_crypto tmp_tx_crypto;
-	pj_bool_t has_crypto_attr = PJ_FALSE;
-	int rem_tag;
-	int j;
-
-	for (i=0; i<m_rem->attr_count; ++i) {
-	    if (pj_stricmp(&m_rem->attr[i]->name, &ID_CRYPTO) != 0)
-		continue;
-
-	    /* more than one crypto attribute in media answer */
-	    if (has_crypto_attr) {
-		DEACTIVATE_MEDIA(pool, m_loc);
-		return PJMEDIA_SRTP_ESDPAMBIGUEANS;
-	    }
-
-	    has_crypto_attr = PJ_TRUE;
-
-	    status = parse_attr_crypto(srtp->pool, m_rem->attr[i],
-				       &tmp_tx_crypto, &rem_tag);
-	    if (status != PJ_SUCCESS)
-		return status;
-
-
-	    /* Tag range check, our tags in the offer must be in the SRTP 
-	     * setting range, so does the remote answer's. The remote answer's 
-	     * tag must not exceed the tag range of the local offer.
-	     */
-	    if (rem_tag < 1 || rem_tag > (int)srtp->setting.crypto_count ||
-		rem_tag > loc_cryto_cnt) 
-	    
-	    {
-		DEACTIVATE_MEDIA(pool, m_loc);
-		return PJMEDIA_SRTP_ESDPINCRYPTOTAG;
-	    }
-
-	    /* match the crypto name */
-	    if (pj_stricmp(&tmp_tx_crypto.name, 
-			   &loc_crypto[rem_tag-1].name) != 0)		
-	    {
-		DEACTIVATE_MEDIA(pool, m_loc);
-		return PJMEDIA_SRTP_ECRYPTONOTMATCH;
-	    }
-
-	    /* Find the crypto from the setting. */
-	    for (j = 0; j < (int)srtp->setting.crypto_count; ++j) {
-		if (pj_stricmp(&tmp_tx_crypto.name, 
-			       &srtp->setting.crypto[j].name) == 0) 
-		
-		{
-		    srtp->tx_policy_neg = srtp->setting.crypto[j];
-		    break;
-		}		
-	    }
-	    
-	    srtp->rx_policy_neg = tmp_tx_crypto;
-	}
-
-	if (srtp->setting.use == PJMEDIA_SRTP_DISABLED) {
-	    /* should never reach here */
-	    goto BYPASS_SRTP;
-	} else if (srtp->setting.use == PJMEDIA_SRTP_OPTIONAL) {
-	    if (!has_crypto_attr)
-		goto BYPASS_SRTP;
-	} else if (srtp->setting.use == PJMEDIA_SRTP_MANDATORY) {
-	    if (!has_crypto_attr) {
-		DEACTIVATE_MEDIA(pool, m_loc);
-		return PJMEDIA_SRTP_ESDPREQCRYPTO;
-	    }
-	}
-
-	/* At this point, we get valid rx_policy_neg & tx_policy_neg. */
-    }
-
-    /* Make sure we have the SRTP policies */
-    if (srtp_crypto_empty(&srtp->tx_policy_neg) ||
-	srtp_crypto_empty(&srtp->rx_policy_neg))
-    {
-	goto BYPASS_SRTP;
-    }
-
-    /* Reset probation counts */
-    srtp->probation_cnt = PROBATION_CNT_INIT;
-
-    /* Got policy_local & policy_remote, let's initalize the SRTP */
-
-    /* Ticket #1075: media_start() is called whenever media description
-     * gets updated, e.g: call hold, however we should restart SRTP only
-     * when the SRTP policy settings are updated.
-     */
-    if (srtp_crypto_cmp(&srtp->tx_policy_neg, &srtp->tx_policy) ||
-	srtp_crypto_cmp(&srtp->rx_policy_neg, &srtp->rx_policy))
-    {
-	status = pjmedia_transport_srtp_start(tp,
-					      &srtp->tx_policy_neg,
-					      &srtp->rx_policy_neg);
-	if (status != PJ_SUCCESS)
-	    return status;
-    }
-
-    srtp->bypass_srtp = PJ_FALSE;
-
-    goto PROPAGATE_MEDIA_START;
-
-BYPASS_SRTP:
-    srtp->bypass_srtp = PJ_TRUE;
-    srtp->peer_use = PJMEDIA_SRTP_DISABLED;
-    if (srtp->session_inited) {
-	pjmedia_transport_srtp_stop(tp);
-    }
-
-PROPAGATE_MEDIA_START:
-    return pjmedia_transport_media_start(srtp->member_tp, pool,
-					 sdp_local, sdp_remote,
-				         media_index);
-}
+    if (srtp->keying_pending_cnt)
+	return PJ_SUCCESS;
+
+    /* Start SRTP */
+    status = start_srtp(srtp);
+
+    return status;
+}
+
 
 static pj_status_t transport_media_stop(pjmedia_transport *tp)
@@ -1830,7 +1483,14 @@
     struct transport_srtp *srtp = (struct transport_srtp*) tp;
     pj_status_t status;
+    unsigned i;
 
     PJ_ASSERT_RETURN(tp, PJ_EINVAL);
 
+    /* Invoke media_stop() of all keying methods */
+    for (i=0; i < srtp->keying_cnt; ++i) {
+	pjmedia_transport_media_stop(srtp->keying[i]);
+    }
+
+    /* Invoke media_stop() of member tp */
     status = pjmedia_transport_media_stop(srtp->member_tp);
     if (status != PJ_SUCCESS)
@@ -1838,6 +1498,8 @@
 		   "SRTP failed stop underlying media transport."));
 
+    /* Finally, stop SRTP */
     return pjmedia_transport_srtp_stop(tp);
 }
+
 
 /* Utility */
Index: /pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_dtls.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_dtls.c	(revision 5597)
+++ /pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_dtls.c	(revision 5597)
@@ -0,0 +1,1337 @@
+/* $Id$ */
+/*
+ * Copyright (C) 2017 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/clock.h>
+#include <pjmedia/sdp.h>
+#include <pjmedia/transport_ice.h>
+#include <pj/errno.h>
+#include <pj/rand.h>
+#include <pj/ssl_sock.h>
+
+/* 
+ * Include OpenSSL headers
+ */
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+
+
+/* Set to 1 to enable DTLS-SRTP debugging */
+#define DTLS_DEBUG  0
+
+/* DTLS-SRTP transport op */
+static pj_status_t dtls_media_create  (pjmedia_transport *tp,
+				       pj_pool_t *sdp_pool,
+				       unsigned options,
+				       const pjmedia_sdp_session *sdp_remote,
+				       unsigned media_index);
+static pj_status_t dtls_encode_sdp    (pjmedia_transport *tp,
+				       pj_pool_t *sdp_pool,
+				       pjmedia_sdp_session *sdp_local,
+				       const pjmedia_sdp_session *sdp_remote,
+				       unsigned media_index);
+static pj_status_t dtls_media_start   (pjmedia_transport *tp,
+				       pj_pool_t *tmp_pool,
+				       const pjmedia_sdp_session *sdp_local,
+				       const pjmedia_sdp_session *sdp_remote,
+				       unsigned media_index);
+static pj_status_t dtls_media_stop    (pjmedia_transport *tp);
+static pj_status_t dtls_destroy	      (pjmedia_transport *tp);
+static pj_status_t dtls_on_recv_rtp   (pjmedia_transport *tp,
+				       const void *pkt,
+				       pj_size_t size);
+
+static void on_ice_complete2(pjmedia_transport *tp,
+			     pj_ice_strans_op op,
+			     pj_status_t status,
+			     void *user_data);
+
+
+static pjmedia_transport_op dtls_op =
+{
+    NULL,
+    NULL,
+    NULL,
+    &dtls_on_recv_rtp,	    // originally send_rtp()
+    NULL,
+    NULL,
+    &dtls_media_create,
+    &dtls_encode_sdp,
+    &dtls_media_start,
+    &dtls_media_stop,
+    NULL,
+    &dtls_destroy,
+    NULL,
+};
+
+
+typedef enum dtls_setup
+{ 
+    DTLS_SETUP_UNKNOWN,
+    DTLS_SETUP_ACTPASS,
+    DTLS_SETUP_ACTIVE,
+    DTLS_SETUP_PASSIVE
+} dtls_setup;
+
+
+typedef struct dtls_srtp
+{
+    pjmedia_transport	 base;
+    pj_pool_t		*pool;
+    transport_srtp	*srtp;
+
+    dtls_setup		 setup;
+    unsigned long	 last_err;
+    pj_bool_t		 use_ice;
+    pj_bool_t		 nego_started;
+    pj_str_t		 rem_fingerprint;   /* Remote fingerprint in SDP    */
+    pj_status_t		 rem_fprint_status; /* Fingerprint verif. status    */
+    pj_sockaddr		 rem_addr;	    /* Remote address (from SDP/RTP)*/
+    pj_sockaddr		 rem_rtcp;	    /* Remote RTCP address (SDP)    */
+    pj_bool_t		 pending_start;	    /* media_start() invoked but DTLS
+					       nego not done yet, so start
+					       the SRTP once the nego done  */
+    pj_bool_t		 got_keys;	    /* DTLS nego done & keys ready  */
+    pjmedia_srtp_crypto	 tx_crypto;
+    pjmedia_srtp_crypto	 rx_crypto;
+
+    char		 buf[PJMEDIA_MAX_MTU];
+    pjmedia_clock	*clock;		    /* Timer workaround for retrans */
+
+    SSL_CTX		*ossl_ctx;
+    SSL			*ossl_ssl;
+    BIO			*ossl_rbio;
+    BIO			*ossl_wbio;
+} dtls_srtp;
+
+
+static const pj_str_t ID_TP_DTLS_SRTP = { "UDP/TLS/RTP/SAVP", 16 };
+static const pj_str_t ID_SETUP	      = { "setup", 5 };
+static const pj_str_t ID_ACTPASS      = { "actpass", 7 };
+static const pj_str_t ID_ACTIVE       = { "active", 6 };
+static const pj_str_t ID_PASSIVE      = { "passive", 7 };
+static const pj_str_t ID_FINGERPRINT  = { "fingerprint", 11 };
+
+
+/* Certificate & private key */
+static X509	*dtls_cert;
+static EVP_PKEY *dtls_priv_key;
+static pj_status_t ssl_generate_cert(X509 **p_cert, EVP_PKEY **p_priv_key);
+
+static pj_status_t dtls_init()
+{
+    /* Make sure OpenSSL library has been initialized */
+    {
+	pj_ssl_cipher ciphers[1];
+	unsigned cipher_num = 1;
+	pj_ssl_cipher_get_availables(ciphers, &cipher_num);
+    }
+
+    /* Generate cert if not yet */
+    if (!dtls_cert) {
+	pj_status_t status;
+	status = ssl_generate_cert(&dtls_cert, &dtls_priv_key);
+	if (status != PJ_SUCCESS) {
+	    pj_perror(4, "DTLS-SRTP", status,
+		      "Failed generating DTLS certificate");
+	    return status;
+	}
+    }
+
+    return PJ_SUCCESS;
+}
+
+static void dtls_deinit()
+{
+    if (dtls_cert) {
+	X509_free(dtls_cert);
+	dtls_cert = NULL;
+
+	EVP_PKEY_free(dtls_priv_key);
+	dtls_priv_key = NULL;
+    }
+}
+
+
+/* Create DTLS-SRTP keying instance */
+static pj_status_t dtls_create(transport_srtp *srtp,
+			       pjmedia_transport **p_keying)
+{
+    dtls_srtp *ds;
+    pj_pool_t *pool;
+
+    pool = pj_pool_create(srtp->pool->factory, "dtls%p",
+			  2000, 256, NULL);
+    ds = PJ_POOL_ZALLOC_T(pool, dtls_srtp);
+    ds->pool = pool;
+
+    pj_ansi_strncpy(ds->base.name, pool->obj_name, PJ_MAX_OBJ_NAME);
+    ds->base.type = PJMEDIA_TRANSPORT_TYPE_SRTP;
+    ds->base.op = &dtls_op;
+    ds->base.user_data = srtp;
+    ds->srtp = srtp;
+
+    *p_keying = &ds->base;
+    PJ_LOG(5,(THIS_FILE, "SRTP keying DTLS-SRTP created"));
+    return PJ_SUCCESS;
+}
+
+
+/**
+ * Mapping from OpenSSL error codes to pjlib error space.
+ */
+#define PJ_SSL_ERRNO_START		(PJ_ERRNO_START_USER + \
+					 PJ_ERRNO_SPACE_SIZE*6)
+
+#define PJ_SSL_ERRNO_SPACE_SIZE		PJ_ERRNO_SPACE_SIZE
+
+/* Expected maximum value of reason component in OpenSSL error code */
+#define MAX_OSSL_ERR_REASON		1200
+
+static pj_status_t STATUS_FROM_SSL_ERR(dtls_srtp *ds,
+				       unsigned long err)
+{
+    pj_status_t status;
+
+    /* General SSL error, dig more from OpenSSL error queue */
+    if (err == SSL_ERROR_SSL)
+	err = ERR_get_error();
+
+    /* OpenSSL error range is much wider than PJLIB errno space, so
+     * if it exceeds the space, only the error reason will be kept.
+     * Note that the last native error will be kept as is and can be
+     * retrieved via SSL socket info.
+     */
+    status = ERR_GET_LIB(err)*MAX_OSSL_ERR_REASON + ERR_GET_REASON(err);
+    if (status > PJ_SSL_ERRNO_SPACE_SIZE)
+	status = ERR_GET_REASON(err);
+
+    status += PJ_SSL_ERRNO_START;
+    ds->last_err = err;
+    return status;
+}
+
+
+static pj_status_t GET_SSL_STATUS(dtls_srtp *ds)
+{
+    return STATUS_FROM_SSL_ERR(ds, ERR_get_error());
+}
+
+
+/* SSL cert verification callback. */
+static int verify_cb(int preverify_ok, X509_STORE_CTX *x509_ctx)
+{
+    PJ_UNUSED_ARG(preverify_ok);
+    PJ_UNUSED_ARG(x509_ctx);
+    /* Just skip it for now (as usually it's a self-signed cert) */
+    return 1;
+}
+
+/* Get fingerprint from TLS cert, output is formatted for SDP a=fingerprint,
+ * e.g: "SHA-256 XX:XX:XX...". If is_sha256 is true, SHA-256 hash algo will
+ * be used, otherwise it is SHA-1.
+ */
+static pj_status_t ssl_get_fingerprint(X509 *cert, pj_bool_t is_sha256,
+				       char *buf, pj_size_t *buf_len)
+{
+    unsigned int len, st_out_len, i;
+    unsigned char tmp[EVP_MAX_MD_SIZE];
+    char *p;
+
+    if (!X509_digest(cert, (is_sha256?EVP_sha256():EVP_sha1()), tmp, &len))
+	return PJ_EUNKNOWN;
+
+    st_out_len =  len*3 + (is_sha256? 7 : 5);
+    if (*buf_len < st_out_len + 1)
+	return PJ_ETOOSMALL;
+
+    /* Format fingerprint to "SHA-256 XX:XX:XX..." */
+    p = buf;
+    p += pj_ansi_sprintf(p, "SHA-%s %.2X", (is_sha256?"256":"1"), tmp[0]);
+    for (i=1; i<len; ++i)
+	p += pj_ansi_sprintf(p, ":%.2X", tmp[i]);
+
+    *buf_len = st_out_len;
+
+    return PJ_SUCCESS;
+}
+
+/* Generate self-signed cert */
+static pj_status_t ssl_generate_cert(X509 **p_cert, EVP_PKEY **p_priv_key)
+{
+    BIGNUM *bne = ;
+    RSA *rsa_key = NULL;
+    X509_NAME *cert_name = NULL;
+    X509 *cert = NULL;
+    EVP_PKEY *priv_key = NULL;
+
+    /* Create big number */
+    bne = BN_new();
+    if (!bne) goto on_error;
+    if (!BN_set_word(bne, RSA_F4)) goto on_error;
+
+    /* Generate RSA key */
+    rsa_key = RSA_new();
+    if (!rsa_key) goto on_error;
+    if (!RSA_generate_key_ex(rsa_key, 2048, bne, NULL)) goto on_error;
+
+    /* Create private key */
+    priv_key = EVP_PKEY_new();
+    if (!priv_key) goto on_error;
+    if (!EVP_PKEY_assign_RSA(priv_key, rsa_key)) goto on_error;
+    rsa_key = NULL;
+
+    /* Create certificate */
+    cert = X509_new();
+    if (!cert) goto on_error;
+
+    /* Set version to 3 (2 = x509v3) */
+    X509_set_version(cert, 2);
+
+    /* Set serial number */
+    ASN1_INTEGER_set(X509_get_serialNumber(cert), pj_rand());
+
+    /* Set valid period */
+    X509_gmtime_adj(X509_get_notBefore(cert), -60*60*24);
+    X509_gmtime_adj(X509_get_notAfter(cert), 60*60*24*365);
+
+    /* Set subject name */
+    cert_name = X509_get_subject_name(cert);
+    if (!cert_name) goto on_error;
+    if (!X509_NAME_add_entry_by_txt(cert_name, "CN", MBSTRING_ASC,
+				    (const unsigned char*)"pjmedia.pjsip.org",
+				    -1, -1, 0)) goto on_error;
+
+    /* Set the issuer name (to subject name as this is self-signed cert) */
+    if (!X509_set_issuer_name(cert, cert_name)) goto on_error;
+
+    /* Set the public key */
+    if (!X509_set_pubkey(cert, priv_key)) goto on_error;
+
+    /* Sign with the private key */
+    if (!X509_sign(cert, priv_key, EVP_sha1())) goto on_error;
+
+    /* Free big number */
+    BN_free(bne);
+
+    *p_cert = cert;
+    *p_priv_key = priv_key;
+    return PJ_SUCCESS;
+
+on_error:
+    if (bne) BN_free(bne);
+    if (rsa_key && !priv_key) RSA_free(rsa_key);
+    if (priv_key) EVP_PKEY_free(priv_key);
+    if (cert) X509_free(cert);
+    return PJ_EUNKNOWN;
+}
+
+
+/* Map of OpenSSL-pjmedia SRTP cryptos. Currently OpenSSL seems to
+ * support few cryptos only (based on ssl/d1_srtp.c of OpenSSL 1.1.0c).
+ */
+static char* ossl_profiles[] =
+{
+     "SRTP_AES128_CM_SHA1_80",
+     "SRTP_AES128_CM_SHA1_32",
+     "SRTP_AEAD_AES_256_GCM"
+     "SRTP_AEAD_AES_128_GCM",
+};
+static char* pj_profiles[] =
+{
+    "AES_CM_128_HMAC_SHA1_80",
+    "AES_CM_128_HMAC_SHA1_32",
+    "AEAD_AES_256_GCM"
+    "AEAD_AES_128_GCM",
+};
+
+
+/* Create and initialize new SSL context and instance */
+static pj_status_t ssl_create(dtls_srtp *ds)
+{
+    SSL_CTX *ctx;
+    unsigned i;
+    int mode, rc;
+        
+    /* Create DTLS context */
+    ctx = SSL_CTX_new(DTLSv1_method());
+    if (ctx == NULL) {
+	return GET_SSL_STATUS(ds);
+    }
+
+    /* Set crypto */
+    if (1) {
+	char *p, *end, buf[PJ_ARRAY_SIZE(ossl_profiles)*25];
+	unsigned n;
+
+	p = buf;
+	end = buf + sizeof(buf);
+	for (i=0; i<ds->srtp->setting.crypto_count && p < end; ++i) {
+	    pjmedia_srtp_crypto *crypto = &ds->srtp->setting.crypto[i];
+	    unsigned j;
+	    for (j=0; j<PJ_ARRAY_SIZE(pj_profiles); ++j) {
+		if (!pj_ansi_strcmp(crypto->name.ptr, pj_profiles[j])) {
+		    n = pj_ansi_snprintf(p, end-p, ":%s", ossl_profiles[j]);
+		    p += n;
+		    break;
+		}
+	    }
+
+	}
+	rc = SSL_CTX_set_tlsext_use_srtp(ctx, buf+1);
+	pj_assert(rc == 0);
+    }
+
+    /* Set ciphers */
+    SSL_CTX_set_cipher_list(ctx, PJMEDIA_SRTP_DTLS_OSSL_CIPHERS);
+
+    /* Set cert & private key */
+    rc = SSL_CTX_use_certificate(ctx, dtls_cert);
+    pj_assert(rc);
+    rc = SSL_CTX_use_PrivateKey(ctx, dtls_priv_key);
+    pj_assert(rc);
+    rc = SSL_CTX_check_private_key(ctx);
+    pj_assert(rc);
+
+    /* Create SSL instance */
+    ds->ossl_ctx = ctx;
+    ds->ossl_ssl = SSL_new(ds->ossl_ctx);
+    if (ds->ossl_ssl == NULL) {
+	SSL_CTX_free(ctx);
+	return GET_SSL_STATUS(ds);
+    }
+
+    /* Set MTU */
+#ifdef DTLS_CTRL_SET_LINK_MTU
+    if (!SSL_ctrl(ds->ossl_ssl, DTLS_CTRL_SET_LINK_MTU, PJMEDIA_MAX_MTU,
+		  NULL))
+    {
+	PJ_LOG(4, (ds->base.name,
+		  "Ignored failure in setting MTU to %d (too small?)",
+		  PJMEDIA_MAX_MTU));
+    }
+#endif
+
+    /* SSL verification options, must be mutual auth */
+    mode = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
+    SSL_set_verify(ds->ossl_ssl, mode, &verify_cb);
+
+    /* Setup SSL BIOs */
+    ds->ossl_rbio = BIO_new(BIO_s_mem());
+    ds->ossl_wbio = BIO_new(BIO_s_mem());
+    (void)BIO_set_close(ds->ossl_rbio, BIO_CLOSE);
+    (void)BIO_set_close(ds->ossl_wbio, BIO_CLOSE);
+    SSL_set_bio(ds->ossl_ssl, ds->ossl_rbio, ds->ossl_wbio);
+
+    return PJ_SUCCESS;
+}
+
+
+/* Destroy SSL context and instance */
+static void ssl_destroy(dtls_srtp *ds)
+{
+    /* Destroy SSL instance */
+    if (ds->ossl_ssl) {
+	SSL_shutdown(ds->ossl_ssl);
+	SSL_free(ds->ossl_ssl); /* this will also close BIOs */
+	ds->ossl_ssl = NULL;
+    }
+
+    /* Destroy SSL context */
+    if (ds->ossl_ctx) {
+	SSL_CTX_free(ds->ossl_ctx);
+	ds->ossl_ctx = NULL;
+    }
+}
+
+static pj_status_t ssl_get_srtp_material(dtls_srtp *ds)
+{
+    unsigned char material[SRTP_MAX_KEY_LEN];
+    SRTP_PROTECTION_PROFILE *profile;
+    int rc, i, crypto_idx = -1;
+    pjmedia_srtp_crypto *tx, *rx;
+    pj_status_t status = PJ_SUCCESS;
+
+    /* Get selected crypto-suite */
+    profile = SSL_get_selected_srtp_profile(ds->ossl_ssl);
+    if (!profile) {
+	status = PJMEDIA_SRTP_DTLS_ENOCRYPTO;
+	goto on_return;
+    }
+
+    tx = &ds->tx_crypto;
+    rx = &ds->rx_crypto;
+    pj_bzero(tx, sizeof(*tx));
+    pj_bzero(rx, sizeof(*rx));
+    for (i=0; i<PJ_ARRAY_SIZE(ossl_profiles); ++i) {
+	if (pj_ansi_stricmp(profile->name, ossl_profiles[i])==0) {
+	    pj_strset2(&tx->name, pj_profiles[i]);
+	    pj_strset2(&rx->name, pj_profiles[i]);
+	    crypto_idx = get_crypto_idx(&tx->name);
+	    break;
+	}
+    }
+    if (crypto_idx == -1) {
+	status = PJMEDIA_SRTP_ENOTSUPCRYPTO;
+	goto on_return;
+    }
+
+    /* Get keying material from DTLS nego. There seems to be no info about
+     * material length returned by SSL_export_keying_material()?
+     */
+    rc = SSL_export_keying_material(ds->ossl_ssl, material, sizeof(material),
+				    "EXTRACTOR-dtls_srtp", 19, NULL, 0, 0);
+    if (rc == 0) {
+	status = PJMEDIA_SRTP_EINKEYLEN;
+	goto on_return;
+    }
+
+    /* Parse SRTP master key & salt from keying material */
+    {
+	char *p = (char*)material;
+	char *k1, *k2;
+	crypto_suite *cs = &crypto_suites[crypto_idx];
+	unsigned key_len, salt_len;
+
+	key_len = cs->cipher_key_len - cs->cipher_salt_len;
+	salt_len = cs->cipher_salt_len;
+
+	tx->key.ptr = (char*)pj_pool_alloc(ds->pool, key_len+salt_len);
+	tx->key.slen = key_len+salt_len;
+	rx->key.ptr = (char*)pj_pool_alloc(ds->pool, key_len+salt_len);
+	rx->key.slen = key_len+salt_len;
+	if (ds->setup == DTLS_SETUP_ACTIVE) {
+	    k1 = tx->key.ptr;
+	    k2 = rx->key.ptr;
+	} else {
+	    k1 = rx->key.ptr;
+	    k2 = tx->key.ptr;
+	}
+	pj_memcpy(k1, p, key_len); p += key_len;
+	pj_memcpy(k2, p, key_len); p += key_len;
+	pj_memcpy(k1+key_len, p, salt_len); p += salt_len;
+	pj_memcpy(k2+key_len, p, salt_len);
+	ds->got_keys = PJ_TRUE;
+    }
+
+on_return:
+    return status;
+}
+
+/* Match remote fingerprint: SDP vs actual */
+static pj_status_t ssl_match_fingerprint(dtls_srtp *ds)
+{
+    X509 *rem_cert;
+    pj_bool_t is_sha256;
+    char buf[128];
+    pj_size_t buf_len = sizeof(buf);
+    pj_status_t status;
+
+    /* Check hash algo, currently we only support SHA-256 & SHA-1 */
+    if (!pj_strncmp2(&ds->rem_fingerprint, "SHA-256 ", 8))
+	is_sha256 = PJ_TRUE;
+    else if (!pj_strncmp2(&ds->rem_fingerprint, "SHA-1 ", 6))
+	is_sha256 = PJ_FALSE;
+    else {
+	PJ_LOG(4,(ds->base.name, "Remote hash algo in SDP for "
+		  "DTLS-SRTP is not supported"));
+	return PJ_ENOTSUP;
+    }
+
+    /* Get remote cert & calculate the hash */
+    rem_cert = SSL_get_peer_certificate(ds->ossl_ssl);
+    if (!rem_cert)
+	return PJMEDIA_SRTP_DTLS_EPEERNOCERT;
+
+    status = ssl_get_fingerprint(rem_cert, is_sha256, buf, &buf_len);
+    X509_free(rem_cert);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    /* Do they match? */
+    if (pj_stricmp2(&ds->rem_fingerprint, buf))
+	return PJMEDIA_SRTP_DTLS_EFPNOTMATCH;
+
+    return PJ_SUCCESS;
+}
+
+
+/* Send data to network */
+static pj_status_t send_raw(dtls_srtp *ds, const void *buf, pj_size_t len)
+{
+#if DTLS_DEBUG
+    PJ_LOG(2,(ds->base.name, "DTLS-SRTP sending %d bytes", len));
+#endif
+
+    return pjmedia_transport_send_rtp(ds->srtp->member_tp, buf, len);
+}
+
+
+/* Flush write BIO */
+static pj_status_t ssl_flush_wbio(dtls_srtp *ds)
+{
+    pj_size_t len;
+    pj_status_t status = PJ_SUCCESS;
+
+    /* Check whether there is data to send */
+    if (BIO_ctrl_pending(ds->ossl_wbio) > 0) {
+	/* Yes, get and send it */
+	len = BIO_read(ds->ossl_wbio, ds->buf, sizeof(ds->buf));
+	if (len > 0) {
+	    status = send_raw(ds, ds->buf, len);
+	    if (status != PJ_SUCCESS) {
+#if DTLS_DEBUG
+		pj_perror(2, ds->base.name, status, "Send error");
+#endif
+		/* This error should be recoverable, remote will retransmit
+		 * its packet when not receiving from us.
+		 */
+	    }
+	}
+    }
+
+    /* Check if handshake has been completed */
+    if (!SSL_is_init_finished(ds->ossl_ssl))
+	return PJ_SUCCESS;
+
+    /* Yes, SSL handshake is done! */
+    PJ_LOG(2,(ds->base.name, "DTLS-SRTP negotiation completed!"));
+
+    /* Stop the retrans clock */
+    if (ds->clock)
+	pjmedia_clock_stop(ds->clock);
+
+    /* Get SRTP key material */
+    status = ssl_get_srtp_material(ds);
+    if (status != PJ_SUCCESS) {
+	pj_perror(4, ds->base.name, status,
+		  "Failed to get SRTP material");
+	goto on_return;
+    }
+
+    /* Verify remote fingerprint if we've already got one from SDP */
+    if (ds->rem_fingerprint.slen && ds->rem_fprint_status == PJ_EPENDING) {
+	ds->rem_fprint_status = status = ssl_match_fingerprint(ds);
+	if (status != PJ_SUCCESS) {
+	    pj_perror(4, ds->base.name, status,
+		      "Fingerprint specified in remote SDP doesn't match "
+		      "to actual remote certificate fingerprint!");
+	    goto on_return;
+	}
+    }
+
+    /* If media_start() has been called, start SRTP now */
+    if (ds->pending_start) {
+	ds->pending_start = PJ_FALSE;
+	ds->srtp->keying_pending_cnt--;
+
+	ds->srtp->tx_policy_neg = ds->tx_crypto;
+	ds->srtp->rx_policy_neg = ds->rx_crypto;
+	status = start_srtp(ds->srtp);
+	if (status != PJ_SUCCESS)
+	    pj_perror(4, ds->base.name, status, "Failed starting SRTP");
+    }
+
+on_return:
+    if (ds->srtp->setting.cb.on_srtp_nego_complete) {
+	(*ds->srtp->setting.cb.on_srtp_nego_complete)
+					    (&ds->srtp->base, status);
+    }
+
+    return status;
+}
+
+
+static void clock_cb(const pj_timestamp *ts, void *user_data)
+{
+    dtls_srtp *ds = (dtls_srtp*)user_data;
+
+    PJ_UNUSED_ARG(ts);
+
+    if (ds->ossl_ssl) {
+	if (DTLSv1_handle_timeout(ds->ossl_ssl) > 0)
+	    ssl_flush_wbio(ds);
+    }
+}
+
+
+/* Asynchronous handshake */
+static pj_status_t ssl_handshake(dtls_srtp *ds)
+{
+    pj_status_t status;
+    int err;
+
+    /* Check if handshake has been initiated or even completed */
+    if (ds->nego_started || SSL_is_init_finished(ds->ossl_ssl))
+	return PJ_SUCCESS;
+
+    /* Perform SSL handshake */
+    if (ds->setup == DTLS_SETUP_ACTIVE) {
+	SSL_set_connect_state(ds->ossl_ssl);
+    } else {
+	SSL_set_accept_state(ds->ossl_ssl);
+    }
+    err = SSL_do_handshake(ds->ossl_ssl);
+    if (err < 0) {
+	err = SSL_get_error(ds->ossl_ssl, err);
+	if (err == SSL_ERROR_WANT_READ) {
+	    status = ssl_flush_wbio(ds);
+	    if (status != PJ_SUCCESS)
+		goto on_return;
+	} else if (err != SSL_ERROR_NONE) {
+	    /* Handshake fails */
+	    status = STATUS_FROM_SSL_ERR(ds, err);
+	    pj_perror(2, ds->base.name, status, "SSL_do_handshake() error");
+	    goto on_return;
+	}
+    }
+
+    /* Create and start clock @4Hz for retransmission */
+    if (!ds->clock) {
+	status = pjmedia_clock_create(ds->pool, 4, 1, 1,
+				      PJMEDIA_CLOCK_NO_HIGHEST_PRIO, clock_cb,
+				      ds, &ds->clock);
+	if (status != PJ_SUCCESS)
+	    goto on_return;
+    }    
+    status = pjmedia_clock_start(ds->clock);
+    if (status != PJ_SUCCESS)
+	goto on_return;
+
+    /* Finally, DTLS nego started! */
+    ds->nego_started = PJ_TRUE;
+    PJ_LOG(2,(ds->base.name, "DTLS-SRTP negotiation initiated as %s",
+	      (ds->setup==DTLS_SETUP_ACTIVE? "client":"server")));
+
+on_return:
+    if (status != PJ_SUCCESS) {
+	if (ds->clock)
+	    pjmedia_clock_stop(ds->clock);
+    }
+    return status;
+}
+
+
+/* Parse a=setup & a=fingerprint in remote SDP to update DTLS-SRTP states
+ * 'setup' and 'rem_fingerprint'.
+ * TODO: check those attributes in a=acap too?
+ */
+static pj_status_t parse_setup_finger_attr(dtls_srtp *ds,
+					   pj_bool_t rem_as_offerer,
+					   const pjmedia_sdp_session *sdp,
+					   unsigned media_index)
+{
+    pjmedia_sdp_media *m;
+    pjmedia_sdp_attr *a;
+
+    m = sdp->media[media_index];
+
+    /* Parse a=setup */
+    a = pjmedia_sdp_media_find_attr(m, &ID_SETUP, NULL);
+    if (!a)
+	a = pjmedia_sdp_attr_find(sdp->attr_count,
+				  sdp->attr, &ID_SETUP, NULL);
+    if (!a)
+	return PJMEDIA_SRTP_ESDPAMBIGUEANS;
+
+    if (pj_stristr(&a->value, &ID_PASSIVE) ||
+	(rem_as_offerer && pj_stristr(&a->value, &ID_ACTPASS)))
+    {
+	/* Remote offers/answers 'passive' (or offers 'actpass'), so we are
+	 * the client.
+	 */
+	ds->setup = DTLS_SETUP_ACTIVE;
+    } else if (pj_stristr(&a->value, &ID_ACTIVE)) {
+	/* Remote offers/answers 'active' so we are the server. */
+	ds->setup = DTLS_SETUP_PASSIVE;
+    } else {
+	/* Unknown value set in remote a=setup */
+	return PJMEDIA_SRTP_ESDPAMBIGUEANS;
+    }
+
+    /* Parse a=fingerprint */
+    a = pjmedia_sdp_media_find_attr(m, &ID_FINGERPRINT, NULL);
+    if (!a)
+	a = pjmedia_sdp_attr_find(sdp->attr_count,
+				  sdp->attr, &ID_FINGERPRINT,
+				  NULL);
+    if (!a) {
+	/* Let's just print warning for now, instead of returning error */
+	PJ_LOG(4,(ds->base.name, "Warning: no fingerprint attribute in "
+				 "remote SDP, DTLS verification cannot "
+				 "be done!"));
+    } else {
+	pj_str_t rem_fp = a->value;
+	pj_strtrim(&rem_fp);
+	if (pj_stricmp(&ds->rem_fingerprint, &rem_fp))
+	    pj_strdup(ds->pool, &ds->rem_fingerprint, &rem_fp);
+    }
+
+    return PJ_SUCCESS;
+}
+
+
+static pj_status_t get_rem_addrs(dtls_srtp *ds,
+				 const pjmedia_sdp_session *sdp_remote,
+				 unsigned media_index)
+{
+    pjmedia_sdp_media *m_rem = sdp_remote->media[media_index];
+    pjmedia_sdp_conn *conn;
+    pjmedia_sdp_attr *a;
+    int af = pj_AF_UNSPEC();
+
+    /* Get RTP address */
+    conn = m_rem->conn ? m_rem->conn : sdp_remote->conn;
+    if (pj_stricmp2(&conn->net_type, "IN")==0) {
+	if (pj_stricmp2(&conn->addr_type, "IP4")==0) {
+	    af = pj_AF_INET();
+	} else if (pj_stricmp2(&conn->addr_type, "IP6")==0) {
+	    af = pj_AF_INET6();
+	}
+    }
+    if (af != pj_AF_UNSPEC()) {
+	pj_sockaddr_init(af, &ds->rem_addr, &conn->addr,
+			 m_rem->desc.port);
+    } else {
+	return PJ_EAFNOTSUP;
+    }
+
+    /* Get RTCP address. If "rtcp" attribute is present in the SDP,
+     * set the RTCP address from that attribute. Otherwise, calculate
+     * from RTP address.
+     */
+    a = pjmedia_sdp_attr_find2(m_rem->attr_count, m_rem->attr,
+			       "rtcp", NULL);
+    if (a) {
+	pjmedia_sdp_rtcp_attr rtcp;
+	pj_status_t status;
+	status = pjmedia_sdp_attr_get_rtcp(a, &rtcp);
+	if (status == PJ_SUCCESS) {
+	    if (rtcp.addr.slen) {
+		pj_sockaddr_init(af, &ds->rem_rtcp, &rtcp.addr,
+				 (pj_uint16_t)rtcp.port);
+	    } else {
+		pj_sockaddr_init(af, &ds->rem_rtcp, NULL,
+				 (pj_uint16_t)rtcp.port);
+		pj_memcpy(pj_sockaddr_get_addr(&ds->rem_rtcp),
+			  pj_sockaddr_get_addr(&ds->rem_addr),
+			  pj_sockaddr_get_addr_len(&ds->rem_addr));
+	    }
+	}
+    }
+    if (!pj_sockaddr_has_addr(&ds->rem_rtcp)) {
+	int rtcp_port;
+	pj_memcpy(&ds->rem_rtcp, &ds->rem_addr, sizeof(pj_sockaddr));
+	rtcp_port = pj_sockaddr_get_port(&ds->rem_addr) + 1;
+	pj_sockaddr_set_port(&ds->rem_rtcp, (pj_uint16_t)rtcp_port);
+    }
+
+    return PJ_SUCCESS;
+}
+
+/* Check if an incoming packet is a DTLS packet (rfc5764 section 5.1.2) */
+#define IS_DTLS_PKT(pkt, pkt_len) (*(char*)pkt > 19 && *(char*)pkt < 64)
+
+
+/* Received packet (SSL handshake) from socket */
+static pj_status_t ssl_on_recv_packet(dtls_srtp *ds,
+				      const void *data, pj_size_t len)
+{
+    char tmp[128];
+    pj_size_t nwritten;
+
+    nwritten = BIO_write(ds->ossl_rbio, data, (int)len);
+    if (nwritten < len) {
+	/* Error? */
+	pj_status_t status;
+	status = GET_SSL_STATUS(ds);
+#if DTLS_DEBUG
+	pj_perror(2, ds->base.name, status, "BIO_write() error");
+#endif
+	return status;
+    }
+
+    /* Consume (and ignore) the packet */
+    while (1) {
+	int rc = SSL_read(ds->ossl_ssl, tmp, sizeof(tmp));
+	if (rc <= 0) {
+#if DTLS_DEBUG
+    	    pj_status_t status = GET_SSL_STATUS(ds);
+	    if (status != PJ_SUCCESS)
+    		pj_perror(2, ds->base.name, status, "SSL_read() error");
+#endif
+	    break;
+	}
+    }
+
+    /* Flush anything pending in the write BIO */
+    return ssl_flush_wbio(ds);
+}
+
+
+static void on_ice_complete2(pjmedia_transport *tp,
+			     pj_ice_strans_op op,
+			     pj_status_t status,
+			     void *user_data)
+{
+    dtls_srtp *ds = (dtls_srtp*)user_data;
+    pj_assert(ds);
+
+    if (op == PJ_ICE_STRANS_OP_NEGOTIATION && status == PJ_SUCCESS &&
+	ds->setup == DTLS_SETUP_ACTIVE)
+    {
+	pj_status_t tmp_st;
+	tmp_st = ssl_handshake(ds);
+	if (tmp_st != PJ_SUCCESS)
+	    pj_perror(4, ds->base.name, tmp_st, "Failed starting DTLS nego");
+    }
+}
+
+
+/* *************************************
+ *
+ * DTLS-SRTP transport keying operations
+ *
+ * *************************************/
+
+/*
+ * This callback is called by SRTP transport when incoming rtp is received.
+ * Originally this is send_rtp() op.
+ */
+static pj_status_t dtls_on_recv_rtp( pjmedia_transport *tp,
+				     const void *pkt,
+				     pj_size_t size)
+{
+    dtls_srtp *ds = (dtls_srtp*)tp;
+
+    if (size < 1 || !IS_DTLS_PKT(pkt, size))
+	return PJ_EIGNORED;
+
+#if DTLS_DEBUG
+    PJ_LOG(2,(ds->base.name, "DTLS-SRTP receiving %d bytes", size));
+#endif
+
+    /* This is DTLS packet, let's process it */
+
+    /* Check remote address info, reattach member tp if changed */
+    if (!ds->use_ice) {
+	pjmedia_transport_info info;
+	pjmedia_transport_get_info(ds->srtp->member_tp, &info);
+	if (pj_sockaddr_cmp(&ds->rem_addr, &info.src_rtp_name)) {
+	    pjmedia_transport_attach_param ap;
+
+	    pj_bzero(&ap, sizeof(ap));
+	    pj_sockaddr_cp(&ds->rem_addr, &info.src_rtp_name);
+	    pj_sockaddr_cp(&ap.rem_addr, &ds->rem_addr);
+	    ap.addr_len = pj_sockaddr_get_len(&ap.rem_addr);
+	    if (pj_sockaddr_has_addr(&ds->rem_rtcp)) {
+		pj_sockaddr_cp(&ap.rem_rtcp, &ds->rem_rtcp);
+	    } else {
+		pj_sockaddr_cp(&ap.rem_rtcp, &ds->rem_addr);
+		pj_sockaddr_set_port(&ap.rem_rtcp,
+				     pj_sockaddr_get_port(&ds->rem_addr)+1);
+	    }
+
+	    pjmedia_transport_attach2(&ds->srtp->base, &ap);
+	}
+    }
+
+    /* If our setup is ACTPASS, incoming packet may be a client hello,
+     * so let's update setup to PASSIVE and initiate DTLS handshake.
+     */
+    if (ds->setup == DTLS_SETUP_ACTPASS || ds->setup == DTLS_SETUP_PASSIVE)
+    {
+	pj_status_t status;
+	ds->setup = DTLS_SETUP_PASSIVE;
+	status = ssl_handshake(ds);
+	if (status != PJ_SUCCESS)
+	    return status;
+    }
+
+    /* Send it to OpenSSL */
+    ssl_on_recv_packet(ds, pkt, size);
+    return PJ_SUCCESS;
+}
+
+static pj_status_t dtls_media_create( pjmedia_transport *tp,
+				      pj_pool_t *sdp_pool,
+				      unsigned options,
+				      const pjmedia_sdp_session *sdp_remote,
+				      unsigned media_index)
+{
+    dtls_srtp *ds = (dtls_srtp*) tp;
+    pj_status_t status = PJ_SUCCESS;
+
+#if DTLS_DEBUG
+    PJ_LOG(2,(ds->base.name, "dtls_media_create()"));
+#endif
+
+    if (ds->srtp->offerer_side) {
+	/* As offerer: do nothing. */
+    } else {
+	/* As answerer:
+	 *    Check for DTLS-SRTP support in remote SDP. Detect remote
+	 *    support of DTLS-SRTP by inspecting remote SDP offer for
+	 *    UDP/TLS/RTP/SAVP as media transport, this may be presented
+	 *    in m= line.
+	 */
+	pjmedia_sdp_media *m_rem = sdp_remote->media[media_index];
+
+	if (pj_stricmp(&m_rem->desc.transport, &ID_TP_DTLS_SRTP)!=0) {
+	    /* Remote doesn't signal DTLS-SRTP */
+	    status = PJMEDIA_SRTP_ESDPINTRANSPORT;
+	    goto on_return;
+	}
+    }
+
+    /* Init DTLS */
+    if (!ds->ossl_ssl) {
+	status = ssl_create(ds);
+	if (status != PJ_SUCCESS)
+	    goto on_return;
+    }
+
+    /* Set remote cert fingerprint verification status to PJ_EPENDING */
+    ds->rem_fprint_status = PJ_EPENDING;
+
+on_return:
+    if (status != PJ_SUCCESS) {
+	pj_perror(4, ds->base.name, status, "dtls_media_create() failed");
+	dtls_destroy(tp);
+    }
+    return status;
+}
+
+static pj_status_t dtls_encode_sdp( pjmedia_transport *tp,
+				    pj_pool_t *sdp_pool,
+				    pjmedia_sdp_session *sdp_local,
+				    const pjmedia_sdp_session *sdp_remote,
+				    unsigned media_index)
+{
+    dtls_srtp *ds = (dtls_srtp *)tp;
+    pjmedia_sdp_media *m_rem, *m_loc;
+    pjmedia_sdp_attr *a;
+    pj_bool_t use_ice = PJ_FALSE;
+    pj_status_t status = PJ_SUCCESS;
+
+#if DTLS_DEBUG
+    PJ_LOG(2,(ds->base.name, "dtls_encode_sdp()"));
+#endif
+
+    m_rem = sdp_remote ? sdp_remote->media[media_index] : NULL;
+    m_loc = sdp_local->media[media_index];
+    if (ds->srtp->offerer_side) {
+	/* As offerer */
+
+	/* Add attribute a=setup if none (rfc5763 section 5) */
+	a = pjmedia_sdp_media_find_attr(m_loc, &ID_SETUP, NULL);
+	if (!a)
+	    a = pjmedia_sdp_attr_find(sdp_local->attr_count,
+				      sdp_local->attr, &ID_SETUP, NULL);
+	if (!a) {
+	    pj_str_t val;
+
+	    if (ds->setup == DTLS_SETUP_UNKNOWN)
+		ds->setup = DTLS_SETUP_ACTPASS;
+	    
+	    if (ds->setup == DTLS_SETUP_ACTIVE)
+		val = ID_ACTIVE;
+	    else if (ds->setup == DTLS_SETUP_PASSIVE)
+		val = ID_PASSIVE;
+	    else
+		val = ID_ACTPASS;
+	    a = pjmedia_sdp_attr_create(ds->pool, ID_SETUP.ptr, &val);
+	    pjmedia_sdp_media_add_attr(m_loc, a);
+	}
+    } else {
+	/* As answerer */
+	dtls_setup last_setup = ds->setup;
+	pj_str_t last_rem_fp = ds->rem_fingerprint;
+
+	/* Parse a=setup and a=fingerprint */
+	status = parse_setup_finger_attr(ds, PJ_TRUE, sdp_remote,
+					 media_index);
+	if (status != PJ_SUCCESS)
+	    goto on_return;
+
+	/* Add attribute a=setup:active/passive if we are client/server. */
+	a = pjmedia_sdp_attr_create(ds->pool, ID_SETUP.ptr,
+		    (ds->setup==DTLS_SETUP_ACTIVE? &ID_ACTIVE:&ID_PASSIVE));
+	pjmedia_sdp_media_add_attr(m_loc, a);
+
+	/* Check if remote signals DTLS re-nego by changing its
+	 * setup/fingerprint in SDP.
+	 */
+	if ((last_setup != DTLS_SETUP_UNKNOWN && last_setup != ds->setup) ||
+	    (last_rem_fp.slen &&
+	     pj_memcmp(&last_rem_fp, &ds->rem_fingerprint, sizeof(pj_str_t))))
+	{
+	    ssl_destroy(ds);
+	    ds->nego_started = PJ_FALSE;
+	    ds->got_keys = PJ_FALSE;
+
+	    status = ssl_create(ds);
+	    if (status != PJ_SUCCESS)
+		goto on_return;
+	}
+    }
+
+    /* Set media transport to UDP/TLS/RTP/SAVP */
+    m_loc->desc.transport = ID_TP_DTLS_SRTP;
+
+    /* Add a=fingerprint attribute, fingerprint of our TLS certificate */
+    {
+	char buf[128];
+	pj_size_t buf_len = sizeof(buf);
+	pj_str_t fp;
+
+	status = ssl_get_fingerprint(dtls_cert, PJ_TRUE, buf, &buf_len);
+	if (status != PJ_SUCCESS)
+	    goto on_return;
+
+	pj_strset(&fp, buf, buf_len);
+	a = pjmedia_sdp_attr_create(ds->pool, ID_FINGERPRINT.ptr, &fp);
+	pjmedia_sdp_media_add_attr(m_loc, a);
+    }
+
+    if (ds->got_keys) {
+	/* This is subsequent SDP offer/answer and we already got SRTP keys */
+	goto on_return;
+    }
+
+    /* Attach member transport, so we can receive DTLS init (if our setup
+     * is PASSIVE/ACTPASS) or send DTLS init (if our setup is ACTIVE).
+     */
+    {
+	pjmedia_transport_attach_param ap;
+	pj_bzero(&ap, sizeof(ap));
+
+	if (sdp_remote)
+	    get_rem_addrs(ds, sdp_remote, media_index);
+
+	if (pj_sockaddr_has_addr(&ds->rem_addr))
+	    pj_sockaddr_cp(&ap.rem_addr, &ds->rem_addr);
+	else
+	    pj_sockaddr_init(pj_AF_INET(), &ap.rem_addr, 0, 0);
+
+	if (pj_sockaddr_has_addr(&ds->rem_rtcp))
+	    pj_sockaddr_cp(&ap.rem_rtcp, &ds->rem_rtcp);
+	else
+	    pj_sockaddr_init(pj_AF_INET(), &ap.rem_rtcp, 0, 0);
+
+	ap.addr_len = pj_sockaddr_get_len(&ap.rem_addr);
+	status = pjmedia_transport_attach2(&ds->srtp->base, &ap);
+	if (status != PJ_SUCCESS)
+	    goto on_return;
+    }
+
+    /* If our setup is ACTIVE and member transport is not ICE,
+     * start DTLS nego.
+     */
+    if (ds->setup == DTLS_SETUP_ACTIVE) {
+	pjmedia_transport_info info;
+	pjmedia_ice_transport_info *ice_info;
+
+	pjmedia_transport_info_init(&info);
+	pjmedia_transport_get_info(ds->srtp->member_tp, &info);
+	ice_info = (pjmedia_ice_transport_info*)
+		   pjmedia_transport_info_get_spc_info(
+				    &info, PJMEDIA_TRANSPORT_TYPE_ICE);
+	use_ice = ice_info && ice_info->comp_cnt;
+	if (!use_ice) {
+	    status = ssl_handshake(ds);
+	    if (status != PJ_SUCCESS)
+		goto on_return;
+	}
+    }
+
+on_return:
+    if (status != PJ_SUCCESS) {
+	pj_perror(4, ds->base.name, status, "dtls_encode_sdp() failed");
+	dtls_destroy(tp);
+    }
+    return status;
+}
+
+
+static pj_status_t dtls_media_start( pjmedia_transport *tp,
+				     pj_pool_t *tmp_pool,
+				     const pjmedia_sdp_session *sdp_local,
+				     const pjmedia_sdp_session *sdp_remote,
+				     unsigned media_index)
+{
+    dtls_srtp *ds = (dtls_srtp *)tp;
+    pjmedia_sdp_media *m_rem, *m_loc;
+    pj_ice_strans_state ice_state;
+    pj_status_t status = PJ_SUCCESS;
+
+#if DTLS_DEBUG
+    PJ_LOG(2,(ds->base.name, "dtls_media_start()"));
+#endif
+
+    m_rem = sdp_remote->media[media_index];
+    m_loc = sdp_local->media[media_index];
+
+    if (ds->srtp->offerer_side) {
+	/* As offerer */
+	dtls_setup last_setup = ds->setup;
+	pj_str_t last_rem_fp = ds->rem_fingerprint;
+
+	/* Parse a=setup and a=fingerprint */
+	status = parse_setup_finger_attr(ds, PJ_FALSE, sdp_remote,
+					 media_index);
+	if (status != PJ_SUCCESS)
+	    goto on_return;
+
+	/* Check if remote signals DTLS re-nego by changing its
+	 * setup/fingerprint in SDP.
+	 */
+	if ((last_setup != DTLS_SETUP_ACTPASS && last_setup != ds->setup) ||
+	    (last_rem_fp.slen &&
+	     pj_memcmp(&last_rem_fp, &ds->rem_fingerprint, sizeof(pj_str_t))))
+	{
+	    ssl_destroy(ds);
+	    ds->nego_started = PJ_FALSE;
+	    ds->got_keys = PJ_FALSE;
+
+	    status = ssl_create(ds);
+	    if (status != PJ_SUCCESS)
+		goto on_return;
+	}
+    } else {
+	/* As answerer */
+	
+	/* Nothing to do? */
+    }
+
+    /* Check and update ICE status */
+    {
+	pjmedia_transport_info info;
+	pjmedia_ice_transport_info *ice_info;
+
+	pjmedia_transport_info_init(&info);
+	pjmedia_transport_get_info(ds->srtp->member_tp, &info);
+	ice_info = (pjmedia_ice_transport_info*)
+		   pjmedia_transport_info_get_spc_info(
+				    &info, PJMEDIA_TRANSPORT_TYPE_ICE);
+	ds->use_ice = ice_info && ice_info->active;
+	ice_state = ds->use_ice? ice_info->sess_state : 0;
+    }
+
+    /* Check if the background DTLS nego has completed */
+    if (ds->got_keys) {	
+	ds->srtp->tx_policy_neg = ds->tx_crypto;
+	ds->srtp->rx_policy_neg = ds->rx_crypto;
+
+	/* Verify remote fingerprint if not yet */
+	if (ds->rem_fingerprint.slen && ds->rem_fprint_status == PJ_EPENDING)
+	    ds->rem_fprint_status = ssl_match_fingerprint(ds);
+	if (ds->rem_fprint_status != PJ_SUCCESS) {
+	    pj_perror(4, ds->base.name, ds->rem_fprint_status,
+		      "Fingerprint specified in remote SDP doesn't match "
+		      "to actual remote certificate fingerprint!");
+	    return ds->rem_fprint_status;
+	}
+
+	return PJ_SUCCESS;
+    } 
+
+    /* SRTP key is not ready, SRTP start is pending */
+    ds->srtp->keying_pending_cnt++;
+    ds->pending_start = PJ_TRUE;
+
+    /* If our DTLS setup is ACTIVE:
+     * - start DTLS nego after ICE nego, or
+     * - start it now if there is no ICE.
+     */
+    if (ds->setup == DTLS_SETUP_ACTIVE) {
+	if (ds->use_ice && ice_state < PJ_ICE_STRANS_STATE_RUNNING)  {
+	    /* Register ourselves to listen to ICE notifications */
+	    pjmedia_ice_cb ice_cb;
+	    pj_bzero(&ice_cb, sizeof(ice_cb));
+	    ice_cb.on_ice_complete2 = &on_ice_complete2;
+	    pjmedia_ice_add_ice_cb(ds->srtp->member_tp, &ice_cb, ds);
+	} else {
+	    /* This can happen when we are SDP offerer and remote wants
+	     * PASSIVE DTLS role.
+	     */
+	    pjmedia_transport_attach_param ap;
+	    pj_bzero(&ap, sizeof(ap));
+
+	    /* Attach ourselves to member transport for DTLS nego. */
+	    if (!pj_sockaddr_has_addr(&ds->rem_addr))
+		get_rem_addrs(ds, sdp_remote, media_index);
+
+	    if (pj_sockaddr_has_addr(&ds->rem_addr))
+		pj_sockaddr_cp(&ap.rem_addr, &ds->rem_addr);
+	    else
+		pj_sockaddr_init(pj_AF_INET(), &ap.rem_addr, 0, 0);
+
+	    if (pj_sockaddr_has_addr(&ds->rem_rtcp))
+		pj_sockaddr_cp(&ap.rem_rtcp, &ds->rem_rtcp);
+	    else
+		pj_sockaddr_init(pj_AF_INET(), &ap.rem_rtcp, 0, 0);
+
+	    ap.addr_len = pj_sockaddr_get_len(&ap.rem_addr);
+	    status = pjmedia_transport_attach2(&ds->srtp->base, &ap);
+	    if (status != PJ_SUCCESS)
+		goto on_return;
+            
+	    status = ssl_handshake(ds);
+	    if (status != PJ_SUCCESS)
+		goto on_return;
+	}
+    }
+
+on_return:
+    if (status != PJ_SUCCESS) {
+	pj_perror(4, ds->base.name, status, "dtls_media_start() failed");
+	dtls_destroy(tp);
+    }
+    return status;
+}
+
+static pj_status_t dtls_media_stop(pjmedia_transport *tp)
+{
+    dtls_srtp *ds = (dtls_srtp *)tp;
+
+#if DTLS_DEBUG
+    PJ_LOG(2,(ds->base.name, "dtls_media_stop()"));
+#endif
+
+    if (ds->clock)
+	pjmedia_clock_stop(ds->clock);
+
+    return PJ_SUCCESS;
+}
+
+static pj_status_t dtls_destroy(pjmedia_transport *tp)
+{
+    dtls_srtp *ds = (dtls_srtp *)tp;
+
+#if DTLS_DEBUG
+    PJ_LOG(2,(ds->base.name, "dtls_destroy()"));
+#endif
+
+    if (ds->clock)
+	pjmedia_clock_destroy(ds->clock);
+    ssl_destroy(ds);
+    pj_pool_safe_release(&ds->pool);
+
+    return PJ_SUCCESS;
+}
Index: /pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_sdes.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_sdes.c	(revision 5597)
+++ /pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_sdes.c	(revision 5597)
@@ -0,0 +1,703 @@
+/* $Id$ */
+/*
+ * Copyright (C) 2017 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
+ */
+
+#if defined(PJ_HAS_SSL_SOCK) && (PJ_HAS_SSL_SOCK != 0)
+
+/* Include OpenSSL libraries for MSVC */
+#  ifdef _MSC_VER
+#    if OPENSSL_VERSION_NUMBER >= 0x10100000L
+#      pragma comment(lib, "libcrypto")
+#    else
+#      pragma comment(lib, "libeay32")
+#      pragma comment(lib, "ssleay32")
+#    endif
+#  endif
+
+#endif
+
+static pj_status_t sdes_media_create(pjmedia_transport *tp,
+				     pj_pool_t *sdp_pool,
+				     unsigned options,
+				     const pjmedia_sdp_session *sdp_remote,
+				     unsigned media_index);
+static pj_status_t sdes_encode_sdp  (pjmedia_transport *tp,
+				     pj_pool_t *sdp_pool,
+				     pjmedia_sdp_session *sdp_local,
+				     const pjmedia_sdp_session *sdp_remote,
+				     unsigned media_index);
+static pj_status_t sdes_media_start (pjmedia_transport *tp,
+				     pj_pool_t *pool,
+				     const pjmedia_sdp_session *sdp_local,
+				     const pjmedia_sdp_session *sdp_remote,
+				     unsigned media_index);
+static pj_status_t sdes_media_stop  (pjmedia_transport *tp);
+
+
+static pjmedia_transport_op sdes_op =
+{
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    &sdes_media_create,
+    &sdes_encode_sdp,
+    &sdes_media_start,
+    &sdes_media_stop,
+    NULL,
+    NULL
+};
+
+
+static pj_status_t sdes_create(transport_srtp *srtp,
+			       pjmedia_transport **p_keying)
+{
+    pjmedia_transport *sdes;
+
+    sdes = PJ_POOL_ZALLOC_T(srtp->pool, pjmedia_transport);
+    pj_ansi_strncpy(sdes->name, "SDES", PJ_MAX_OBJ_NAME);
+    sdes->type = PJMEDIA_TRANSPORT_TYPE_SRTP;
+    sdes->op = &sdes_op;
+    sdes->user_data = srtp;
+
+    *p_keying = sdes;
+    PJ_LOG(5,(THIS_FILE, "SRTP keying SDES created"));
+    return PJ_SUCCESS;
+}
+
+
+/* Generate crypto attribute, including crypto key.
+ * If crypto-suite chosen is crypto NULL, just return PJ_SUCCESS,
+ * and set buffer_len = 0.
+ */
+static pj_status_t generate_crypto_attr_value(pj_pool_t *pool,
+					      char *buffer, int *buffer_len,
+					      pjmedia_srtp_crypto *crypto,
+					      int tag)
+{
+    pj_status_t status;
+    int cs_idx = get_crypto_idx(&crypto->name);
+    char b64_key[PJ_BASE256_TO_BASE64_LEN(MAX_KEY_LEN)+1];
+    int b64_key_len = sizeof(b64_key);
+    int print_len;
+
+    if (cs_idx == -1)
+	return PJMEDIA_SRTP_ENOTSUPCRYPTO;
+
+    /* Crypto-suite NULL. */
+    if (cs_idx == 0) {
+	*buffer_len = 0;
+	return PJ_SUCCESS;
+    }
+
+    /* Generate key if not specified. */
+    if (crypto->key.slen == 0) {
+	pj_bool_t key_ok;
+	char key[MAX_KEY_LEN];
+	err_status_t err;
+	unsigned i;
+
+	PJ_ASSERT_RETURN(MAX_KEY_LEN >= crypto_suites[cs_idx].cipher_key_len,
+			 PJ_ETOOSMALL);
+
+	do {
+	    key_ok = PJ_TRUE;
+
+
+#if defined(PJ_HAS_SSL_SOCK) && (PJ_HAS_SSL_SOCK != 0)
+	    err = RAND_bytes((unsigned char*)key,
+			     crypto_suites[cs_idx].cipher_key_len);
+	    if (err != 1) {
+		PJ_LOG(5,(THIS_FILE, "Failed generating random key"));
+		return PJMEDIA_ERRNO_FROM_LIBSRTP(1);
+	    }
+#else	    
+	    err = crypto_get_random((unsigned char*)key,
+				     crypto_suites[cs_idx].cipher_key_len);
+	    if (err != err_status_ok) {
+		PJ_LOG(5,(THIS_FILE, "Failed generating random key: %s",
+			  get_libsrtp_errstr(err)));
+		return PJMEDIA_ERRNO_FROM_LIBSRTP(err);
+	    }
+#endif
+	    for (i=0; i<crypto_suites[cs_idx].cipher_key_len && key_ok; ++i)
+		if (key[i] == 0) key_ok = PJ_FALSE;
+
+	} while (!key_ok);
+	crypto->key.ptr = (char*)
+			  pj_pool_zalloc(pool,
+					 crypto_suites[cs_idx].cipher_key_len);
+	pj_memcpy(crypto->key.ptr, key, crypto_suites[cs_idx].cipher_key_len);
+	crypto->key.slen = crypto_suites[cs_idx].cipher_key_len;
+    }
+
+    if (crypto->key.slen != (pj_ssize_t)crypto_suites[cs_idx].cipher_key_len)
+	return PJMEDIA_SRTP_EINKEYLEN;
+
+    /* Key transmitted via SDP should be base64 encoded. */
+    status = pj_base64_encode((pj_uint8_t*)crypto->key.ptr, crypto->key.slen,
+			      b64_key, &b64_key_len);
+    if (status != PJ_SUCCESS) {
+	PJ_LOG(5,(THIS_FILE, "Failed encoding plain key to base64"));
+	return status;
+    }
+
+    b64_key[b64_key_len] = '\0';
+
+    PJ_ASSERT_RETURN(*buffer_len >= (crypto->name.slen + \
+		     b64_key_len + 16), PJ_ETOOSMALL);
+
+    /* Print the crypto attribute value. */
+    print_len = pj_ansi_snprintf(buffer, *buffer_len, "%d %s inline:%s",
+				   tag,
+				   crypto_suites[cs_idx].name,
+				   b64_key);
+    if (print_len < 1 || print_len >= *buffer_len)
+	return PJ_ETOOSMALL;
+
+    *buffer_len = print_len;
+
+    return PJ_SUCCESS;
+}
+
+
+/* Parse crypto attribute line */
+static pj_status_t parse_attr_crypto(pj_pool_t *pool,
+				     const pjmedia_sdp_attr *attr,
+				     pjmedia_srtp_crypto *crypto,
+				     int *tag)
+{
+    pj_str_t token, delim;
+    pj_status_t status;
+    int itmp, found_idx;
+
+    pj_bzero(crypto, sizeof(*crypto));
+
+    /* Tag */
+    delim = pj_str(" ");
+    found_idx = pj_strtok(&attr->value, &delim, &token, 0);
+    if (found_idx == attr->value.slen) {
+	PJ_LOG(4,(THIS_FILE, "Attribute crypto expecting tag"));
+	return PJMEDIA_SDP_EINATTR;
+    }
+
+    /* Tag must not use leading zeroes. */
+    if (token.slen > 1 && *token.ptr == '0')
+	return PJMEDIA_SDP_EINATTR;
+
+    /* Tag must be decimal, i.e: contains only digit '0'-'9'. */
+    for (itmp = 0; itmp < token.slen; ++itmp)
+	if (!pj_isdigit(token.ptr[itmp]))
+	    return PJMEDIA_SDP_EINATTR;
+
+    /* Get tag value. */
+    *tag = pj_strtoul(&token);
+
+    /* Crypto-suite */
+    found_idx = pj_strtok(&attr->value, &delim, &token, found_idx+token.slen);
+    if (found_idx == attr->value.slen) {
+	PJ_LOG(4,(THIS_FILE, "Attribute crypto expecting crypto suite"));
+	return PJMEDIA_SDP_EINATTR;
+    }
+    pj_strdup(pool, &crypto->name, &token);
+
+    /* Key method */
+    delim = pj_str(": ");
+    found_idx = pj_strtok(&attr->value, &delim, &token, found_idx+token.slen);
+    if (found_idx == attr->value.slen) {
+	PJ_LOG(4,(THIS_FILE, "Attribute crypto expecting key method"));
+	return PJMEDIA_SDP_EINATTR;
+    }
+    if (pj_stricmp2(&token, "inline")) {
+	PJ_LOG(4,(THIS_FILE, "Attribute crypto key method '%.*s' "
+	          "not supported!", token.slen, token.ptr));
+	return PJMEDIA_SDP_EINATTR;
+    }
+
+    /* Key */    
+    delim = pj_str("| ");
+    found_idx = pj_strtok(&attr->value, &delim, &token, found_idx+token.slen);
+    if (found_idx == attr->value.slen) {
+	PJ_LOG(4,(THIS_FILE, "Attribute crypto expecting key"));
+	return PJMEDIA_SDP_EINATTR;
+    }
+    
+    if (PJ_BASE64_TO_BASE256_LEN(token.slen) > MAX_KEY_LEN) {
+	PJ_LOG(4,(THIS_FILE, "Key too long"));
+	return PJMEDIA_SRTP_EINKEYLEN;
+    }
+
+    /* Decode key */
+    crypto->key.ptr = (char*) pj_pool_zalloc(pool, MAX_KEY_LEN);
+    itmp = MAX_KEY_LEN;
+    status = pj_base64_decode(&token, (pj_uint8_t*)crypto->key.ptr,
+			      &itmp);
+    if (status != PJ_SUCCESS) {
+	PJ_LOG(4,(THIS_FILE, "Failed decoding crypto key from base64"));
+	return status;
+    }
+    crypto->key.slen = itmp;
+
+    return PJ_SUCCESS;
+}
+
+
+static pj_status_t sdes_media_create( pjmedia_transport *tp,
+				      pj_pool_t *sdp_pool,
+				      unsigned options,
+				      const pjmedia_sdp_session *sdp_remote,
+				      unsigned media_index)
+{
+    struct transport_srtp *srtp = (struct transport_srtp*)tp->user_data;
+
+    /* Validations */
+    if (srtp->offerer_side) {
+	if (srtp->setting.use == PJMEDIA_SRTP_DISABLED)
+	    srtp->bypass_srtp = PJ_TRUE;
+    } else {
+	pjmedia_sdp_media *m_rem = sdp_remote->media[media_index];
+
+	/* Nothing to do on inactive media stream */
+	if (pjmedia_sdp_media_find_attr(m_rem, &ID_INACTIVE, NULL))
+	    srtp->bypass_srtp = PJ_TRUE;
+
+	/* Validate remote media transport based on SRTP usage option. */
+	switch (srtp->setting.use) {
+	    case PJMEDIA_SRTP_DISABLED:
+		if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) == 0)
+		    return PJMEDIA_SRTP_ESDPINTRANSPORT;
+		srtp->bypass_srtp = PJ_TRUE;
+		break;
+	    case PJMEDIA_SRTP_OPTIONAL:
+		break;
+	    case PJMEDIA_SRTP_MANDATORY:
+		if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) != 0)
+		    return PJMEDIA_SRTP_ESDPINTRANSPORT;
+		break;
+	}
+    }
+
+    return PJ_SUCCESS;
+}
+
+static pj_status_t sdes_encode_sdp( pjmedia_transport *tp,
+				    pj_pool_t *sdp_pool,
+				    pjmedia_sdp_session *sdp_local,
+				    const pjmedia_sdp_session *sdp_remote,
+				    unsigned media_index)
+{
+    struct transport_srtp *srtp = (struct transport_srtp*)tp->user_data;
+    pjmedia_sdp_media *m_rem, *m_loc;
+    enum { MAXLEN = 512 };
+    char buffer[MAXLEN];
+    int buffer_len;
+    pj_status_t status;
+    pjmedia_sdp_attr *attr;
+    pj_str_t attr_value;
+    unsigned i, j;
+
+    m_rem = sdp_remote ? sdp_remote->media[media_index] : NULL;
+    m_loc = sdp_local->media[media_index];
+
+    /* Bypass SDES if media transport is not RTP/AVP or RTP/SAVP */
+    if (pj_stricmp(&m_loc->desc.transport, &ID_RTP_AVP)  != 0 &&
+	pj_stricmp(&m_loc->desc.transport, &ID_RTP_SAVP) != 0)
+    {
+	return PJ_SUCCESS;
+    }
+
+    /* If the media is inactive, do nothing. */
+    /* No, we still need to process SRTP offer/answer even if the media is
+     * marked as inactive, because the transport is still alive in this
+     * case (e.g. for keep-alive). See:
+     *   http://trac.pjsip.org/repos/ticket/1079
+     */
+    /*
+    if (pjmedia_sdp_media_find_attr(m_loc, &ID_INACTIVE, NULL) ||
+	(m_rem && pjmedia_sdp_media_find_attr(m_rem, &ID_INACTIVE, NULL)))
+	goto BYPASS_SRTP;
+    */
+
+    /* Check remote media transport & set local media transport
+     * based on SRTP usage option.
+     */
+    if (srtp->offerer_side) {
+
+	/* Generate transport */
+	switch (srtp->setting.use) {
+	    case PJMEDIA_SRTP_DISABLED:
+		pj_assert(!"Shouldn't reach here");
+		return PJ_SUCCESS;
+	    case PJMEDIA_SRTP_OPTIONAL:
+		m_loc->desc.transport =
+				(srtp->peer_use == PJMEDIA_SRTP_MANDATORY)?
+				ID_RTP_SAVP : ID_RTP_AVP;
+		break;
+	    case PJMEDIA_SRTP_MANDATORY:
+		m_loc->desc.transport = ID_RTP_SAVP;
+		break;
+	}
+
+	/* Generate crypto attribute if not yet */
+	if (pjmedia_sdp_media_find_attr(m_loc, &ID_CRYPTO, NULL) == NULL) {
+	    int tag = 1;
+
+	    /* Offer only current active crypto if any, otherwise offer all
+	     * crypto-suites in the setting.
+	     */
+	    for (i=0; i<srtp->setting.crypto_count; ++i) {
+		if (srtp->tx_policy.name.slen &&
+		    pj_stricmp(&srtp->tx_policy.name,
+			       &srtp->setting.crypto[i].name) != 0)
+		{
+		    continue;
+		}
+
+		buffer_len = MAXLEN;
+		status = generate_crypto_attr_value(srtp->pool, buffer,
+						    &buffer_len,
+						    &srtp->setting.crypto[i],
+						    tag);
+		if (status != PJ_SUCCESS)
+		    return status;
+
+		/* If buffer_len==0, just skip the crypto attribute. */
+		if (buffer_len) {
+		    pj_strset(&attr_value, buffer, buffer_len);
+		    attr = pjmedia_sdp_attr_create(srtp->pool, ID_CRYPTO.ptr,
+						   &attr_value);
+		    m_loc->attr[m_loc->attr_count++] = attr;
+		    ++tag;
+		}
+	    }
+	}
+
+    } else {
+	/* Answerer side */
+
+	pj_assert(sdp_remote && m_rem);
+
+	/* Generate transport */
+	switch (srtp->setting.use) {
+	    case PJMEDIA_SRTP_DISABLED:
+		pj_assert(!"Shouldn't reach here");
+		if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) == 0)
+		    return PJMEDIA_SRTP_ESDPINTRANSPORT;
+		return PJ_SUCCESS;
+	    case PJMEDIA_SRTP_OPTIONAL:
+		m_loc->desc.transport = m_rem->desc.transport;
+		break;
+	    case PJMEDIA_SRTP_MANDATORY:
+		if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) != 0)
+		    return PJMEDIA_SRTP_ESDPINTRANSPORT;
+		m_loc->desc.transport = ID_RTP_SAVP;
+		break;
+	}
+
+	/* Generate crypto attribute if not yet */
+	if (pjmedia_sdp_media_find_attr(m_loc, &ID_CRYPTO, NULL) == NULL) {
+
+	    pjmedia_srtp_crypto tmp_rx_crypto;
+	    pj_bool_t has_crypto_attr = PJ_FALSE;
+	    int matched_idx = -1;
+	    int chosen_tag = 0;
+	    int tags[64]; /* assume no more than 64 crypto attrs in a media */
+	    unsigned cr_attr_count = 0;
+
+	    /* Find supported crypto-suite, get the tag, and assign
+	     * policy_local.
+	     */
+	    for (i=0; i<m_rem->attr_count; ++i) {
+		if (pj_stricmp(&m_rem->attr[i]->name, &ID_CRYPTO) != 0)
+		    continue;
+
+		has_crypto_attr = PJ_TRUE;
+
+		status = parse_attr_crypto(srtp->pool, m_rem->attr[i],
+					   &tmp_rx_crypto,
+					   &tags[cr_attr_count]);
+		if (status != PJ_SUCCESS)
+		    return status;
+
+		/* Check duplicated tag */
+		for (j=0; j<cr_attr_count; ++j) {
+		    if (tags[j] == tags[cr_attr_count]) {
+			DEACTIVATE_MEDIA(sdp_pool, m_loc);
+			return PJMEDIA_SRTP_ESDPDUPCRYPTOTAG;
+		    }
+		}
+
+		if (matched_idx == -1) {
+		    /* lets see if the crypto-suite offered is supported */
+		    for (j=0; j<srtp->setting.crypto_count; ++j)
+			if (pj_stricmp(&tmp_rx_crypto.name,
+				       &srtp->setting.crypto[j].name) == 0)
+			{
+			    int cs_idx = get_crypto_idx(&tmp_rx_crypto.name);
+			    
+	    		    if (cs_idx == -1)
+	    		        return PJMEDIA_SRTP_ENOTSUPCRYPTO;
+
+			    if (tmp_rx_crypto.key.slen !=
+				(int)crypto_suites[cs_idx].cipher_key_len)
+				return PJMEDIA_SRTP_EINKEYLEN;
+
+			    srtp->rx_policy_neg = tmp_rx_crypto;
+			    chosen_tag = tags[cr_attr_count];
+			    matched_idx = j;
+    			    break;
+			}
+		}
+		cr_attr_count++;
+	    }
+
+	    /* Check crypto negotiation result */
+	    switch (srtp->setting.use) {
+		case PJMEDIA_SRTP_DISABLED:
+		    pj_assert(!"Should never reach here");
+		    break;
+
+		case PJMEDIA_SRTP_OPTIONAL:
+		    /* Bypass SDES if remote uses RTP/AVP and:
+		     * - has no crypto-attr, or
+		     * - has no matching crypto
+		     */
+		    if ((!has_crypto_attr || matched_idx == -1) &&
+			pj_stricmp(&m_rem->desc.transport, &ID_RTP_AVP) == 0)
+		    {
+			return PJ_SUCCESS;
+		    }
+		    break;
+
+		case PJMEDIA_SRTP_MANDATORY:
+		    /* Do nothing, intentional */
+		    break;
+	    }
+
+	    /* No crypto attr */
+	    if (!has_crypto_attr) {
+		DEACTIVATE_MEDIA(sdp_pool, m_loc);
+		return PJMEDIA_SRTP_ESDPREQCRYPTO;
+	    }
+
+	    /* No crypto match */
+	    if (matched_idx == -1) {
+		DEACTIVATE_MEDIA(sdp_pool, m_loc);
+		return PJMEDIA_SRTP_ENOTSUPCRYPTO;
+	    }
+
+	    /* we have to generate crypto answer,
+	     * with srtp->tx_policy_neg matched the offer
+	     * and rem_tag contains matched offer tag.
+	     */
+	    buffer_len = MAXLEN;
+	    status = generate_crypto_attr_value(
+					srtp->pool, buffer, &buffer_len,
+					&srtp->setting.crypto[matched_idx],
+					chosen_tag);
+	    if (status != PJ_SUCCESS)
+		return status;
+
+	    srtp->tx_policy_neg = srtp->setting.crypto[matched_idx];
+
+	    /* If buffer_len==0, just skip the crypto attribute. */
+	    if (buffer_len) {
+		pj_strset(&attr_value, buffer, buffer_len);
+		attr = pjmedia_sdp_attr_create(sdp_pool, ID_CRYPTO.ptr,
+					       &attr_value);
+		m_loc->attr[m_loc->attr_count++] = attr;
+	    }
+
+	    /* At this point, we get valid rx_policy_neg & tx_policy_neg. */
+	}
+    }
+
+    return PJ_SUCCESS;
+}
+
+
+static pj_status_t fill_local_crypto(pj_pool_t *pool,
+			             const pjmedia_sdp_media *m_loc, 
+			             pjmedia_srtp_crypto loc_crypto[],
+			             int *count)
+{
+    int i;
+    int crypto_count = 0;
+    pj_status_t status = PJ_SUCCESS;
+    
+    for (i = 0; i < *count; ++i) {
+	pj_bzero(&loc_crypto[i], sizeof(loc_crypto[i]));
+    }
+
+    for (i = 0; i < (int)m_loc->attr_count; ++i) {	
+	pjmedia_srtp_crypto tmp_crypto;
+	int loc_tag;
+
+	if (pj_stricmp(&m_loc->attr[i]->name, &ID_CRYPTO) != 0)
+	    continue;
+
+	status = parse_attr_crypto(pool, m_loc->attr[i],
+				   &tmp_crypto, &loc_tag);
+	if (status != PJ_SUCCESS)
+	    return status;
+
+	if (loc_tag > *count)
+	    return PJMEDIA_SRTP_ESDPINCRYPTOTAG;
+
+	loc_crypto[loc_tag-1] = tmp_crypto;
+	++crypto_count;
+    }
+    *count = crypto_count;
+    return status;
+}
+
+
+static pj_status_t sdes_media_start( pjmedia_transport *tp,
+				     pj_pool_t *pool,
+				     const pjmedia_sdp_session *sdp_local,
+				     const pjmedia_sdp_session *sdp_remote,
+				     unsigned media_index)
+{
+    struct transport_srtp *srtp = (struct transport_srtp*)tp->user_data;
+    pjmedia_sdp_media *m_rem, *m_loc;
+    pj_status_t status;
+    unsigned i;
+    pjmedia_srtp_crypto	loc_crypto[PJMEDIA_SRTP_MAX_CRYPTOS];
+    int loc_cryto_cnt = PJMEDIA_SRTP_MAX_CRYPTOS;
+
+    m_rem = sdp_remote->media[media_index];
+    m_loc = sdp_local->media[media_index];
+
+    if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) == 0)
+	srtp->peer_use = PJMEDIA_SRTP_MANDATORY;
+    else
+	srtp->peer_use = PJMEDIA_SRTP_OPTIONAL;
+
+    /* For answerer side, this function will just have to start SRTP */
+
+    /* Check remote media transport & set local media transport
+     * based on SRTP usage option.
+     */
+    if (srtp->offerer_side) {
+	if (srtp->setting.use == PJMEDIA_SRTP_DISABLED) {
+	    if (pjmedia_sdp_media_find_attr(m_rem, &ID_CRYPTO, NULL)) {
+		DEACTIVATE_MEDIA(pool, m_loc);
+		return PJMEDIA_SRTP_ESDPINCRYPTO;
+	    }
+	    return PJ_SUCCESS;
+	} else if (srtp->setting.use == PJMEDIA_SRTP_OPTIONAL) {
+	    // Regardless the answer's transport type (RTP/AVP or RTP/SAVP),
+	    // the answer must be processed through in optional mode.
+	    // Please note that at this point transport type is ensured to be
+	    // RTP/AVP or RTP/SAVP, see sdes_media_create()
+	    //if (pj_stricmp(&m_rem->desc.transport, &m_loc->desc.transport)) {
+		//DEACTIVATE_MEDIA(pool, m_loc);
+		//return PJMEDIA_SDP_EINPROTO;
+	    //}
+	    fill_local_crypto(srtp->pool, m_loc, loc_crypto, &loc_cryto_cnt);
+	} else if (srtp->setting.use == PJMEDIA_SRTP_MANDATORY) {
+	    if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP)) {
+		DEACTIVATE_MEDIA(pool, m_loc);
+		return PJMEDIA_SDP_EINPROTO;
+	    }
+	    fill_local_crypto(srtp->pool, m_loc, loc_crypto, &loc_cryto_cnt);
+	}
+    }
+
+    if (srtp->offerer_side) {
+	/* find supported crypto-suite, get the tag, and assign policy_local */
+	pjmedia_srtp_crypto tmp_tx_crypto;
+	pj_bool_t has_crypto_attr = PJ_FALSE;
+	int rem_tag;
+	int j;
+
+	for (i=0; i<m_rem->attr_count; ++i) {
+	    if (pj_stricmp(&m_rem->attr[i]->name, &ID_CRYPTO) != 0)
+		continue;
+
+	    /* more than one crypto attribute in media answer */
+	    if (has_crypto_attr) {
+		DEACTIVATE_MEDIA(pool, m_loc);
+		return PJMEDIA_SRTP_ESDPAMBIGUEANS;
+	    }
+
+	    has_crypto_attr = PJ_TRUE;
+
+	    status = parse_attr_crypto(srtp->pool, m_rem->attr[i],
+				       &tmp_tx_crypto, &rem_tag);
+	    if (status != PJ_SUCCESS)
+		return status;
+
+
+	    /* Tag range check, our tags in the offer must be in the SRTP 
+	     * setting range, so does the remote answer's. The remote answer's 
+	     * tag must not exceed the tag range of the local offer.
+	     */
+	    if (rem_tag < 1 || rem_tag > (int)srtp->setting.crypto_count ||
+		rem_tag > loc_cryto_cnt) 
+	    {
+		DEACTIVATE_MEDIA(pool, m_loc);
+		return PJMEDIA_SRTP_ESDPINCRYPTOTAG;
+	    }
+
+	    /* match the crypto name */
+	    if (pj_stricmp(&tmp_tx_crypto.name, &loc_crypto[rem_tag-1].name))
+	    {
+		DEACTIVATE_MEDIA(pool, m_loc);
+		return PJMEDIA_SRTP_ECRYPTONOTMATCH;
+	    }
+
+	    /* Find the crypto from the setting. */
+	    for (j = 0; j < (int)srtp->setting.crypto_count; ++j) {
+		if (pj_stricmp(&tmp_tx_crypto.name, 
+			       &srtp->setting.crypto[j].name) == 0) 
+		{
+		    srtp->tx_policy_neg = srtp->setting.crypto[j];
+		    break;
+		}		
+	    }
+
+	    srtp->rx_policy_neg = tmp_tx_crypto;
+	}
+
+	if (srtp->setting.use == PJMEDIA_SRTP_DISABLED) {
+	    /* should never reach here */
+	    return PJ_SUCCESS;
+	} else if (srtp->setting.use == PJMEDIA_SRTP_OPTIONAL) {
+	    if (!has_crypto_attr)
+		return PJ_SUCCESS;
+	} else if (srtp->setting.use == PJMEDIA_SRTP_MANDATORY) {
+	    if (!has_crypto_attr) {
+		DEACTIVATE_MEDIA(pool, m_loc);
+		return PJMEDIA_SRTP_ESDPREQCRYPTO;
+	    }
+	}
+
+	/* At this point, we get valid rx_policy_neg & tx_policy_neg. */
+    }
+
+    return PJ_SUCCESS;
+}
+
+static pj_status_t sdes_media_stop(pjmedia_transport *tp)
+{
+    PJ_UNUSED_ARG(tp);
+    return PJ_SUCCESS;
+}
Index: /pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c	(revision 5596)
+++ /pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c	(revision 5597)
@@ -56,6 +56,7 @@
     unsigned		media_options;	/**< Transport media options.	    */
     void	       *user_data;	/**< Only valid when attached	    */
-    pj_bool_t		attached;	/**< Has attachment?		    */
+    //pj_bool_t		attached;	/**< Has attachment?		    */
     pj_sockaddr		rem_rtp_addr;	/**< Remote RTP address		    */
+    unsigned		rem_rtp_cnt;	/**< How many pkt from this addr.   */
     pj_sockaddr		rem_rtcp_addr;	/**< Remote RTCP address	    */
     int			addr_len;	/**< Length of addresses.	    */
@@ -480,9 +481,14 @@
 		/* We're still receiving from rem_rtp_addr. Don't switch. */
 		udp->rtp_src_cnt = 0;
+		udp->rem_rtp_cnt++;
 	    } else {
 		udp->rtp_src_cnt++;
 
 		if (udp->rtp_src_cnt < PJMEDIA_RTP_NAT_PROBATION_CNT) {
-		    discard = PJ_TRUE;
+		    /* Only discard if we have ever received packet from
+		     * remote address (rem_rtp_addr).
+		     */
+		    //discard = PJ_TRUE;
+		    discard = (udp->rem_rtp_cnt != 0);
 		} else {
 		
@@ -530,5 +536,6 @@
 	}
 
-	if (!discard && udp->attached && cb)
+	//if (!discard && udp->attached && cb)
+	if (!discard && cb)
 	    (*cb)(user_data, udp->rtp_pkt, bytes_read);
 
@@ -566,5 +573,6 @@
 	user_data = udp->user_data;
 
-	if (udp->attached && cb)
+	//if (udp->attached && cb)
+	if (cb)
 	    (*cb)(user_data, udp->rtcp_pkt, bytes_read);
 
@@ -650,5 +658,5 @@
 
     /* Must not be "attached" to existing application */
-    PJ_ASSERT_RETURN(!udp->attached, PJ_EINVALIDOP);
+    //PJ_ASSERT_RETURN(!udp->attached, PJ_EINVALIDOP);
 
     /* Lock the ioqueue keys to make sure that callbacks are
@@ -686,5 +694,5 @@
 
     /* Last, mark transport as attached */
-    udp->attached = PJ_TRUE;
+    //udp->attached = PJ_TRUE;
 
     /* Reset source RTP & RTCP addresses and counter */
@@ -693,4 +701,5 @@
     udp->rtp_src_cnt = 0;
     udp->rtcp_src_cnt = 0;
+    udp->rem_rtp_cnt = 0;
 
     /* Set buffer size for RTP socket */
@@ -752,5 +761,6 @@
     pj_assert(tp);
 
-    if (udp->attached) {
+    //if (udp->attached) {
+    if (1) {
 	int i;
 
@@ -768,5 +778,5 @@
 
 	/* First, mark transport as unattached */
-	udp->attached = PJ_FALSE;
+	//udp->attached = PJ_FALSE;
 
 	/* Clear up application infos from transport */
@@ -801,5 +811,5 @@
 
     /* Must be attached */
-    PJ_ASSERT_RETURN(udp->attached, PJ_EINVALIDOP);
+    //PJ_ASSERT_RETURN(udp->attached, PJ_EINVALIDOP);
 
     /* Check that the size is supported */
@@ -862,5 +872,5 @@
     pj_status_t status;
 
-    PJ_ASSERT_RETURN(udp->attached, PJ_EINVALIDOP);
+    //PJ_ASSERT_RETURN(udp->attached, PJ_EINVALIDOP);
 
     if (addr == NULL) {
Index: /pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
===================================================================
--- /pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 5596)
+++ /pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 5597)
@@ -707,5 +707,6 @@
      * to connect the call's media to sound device. When ICE is used,
      * this callback will also be called to report ICE negotiation
-     * failure.
+     * failure. When DTLS-SRTP is used, this callback will also be called
+     * to report DTLS negotiation failure.
      *
      * @param call_id	The call index.
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 5596)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 5597)
@@ -1275,4 +1275,5 @@
 	const pjmedia_sdp_media *m = sdp->media[i];
 	const pjmedia_sdp_conn *c;
+	static const pj_str_t ID_RTP_SAVP = { "RTP/SAVP", 8 };
 
 	/* Skip different media */
@@ -1285,5 +1286,5 @@
 
 	/* Supported transports */
-	if (pj_stricmp2(&m->desc.transport, "RTP/SAVP")==0) {
+	if (pj_stristr(&m->desc.transport, &ID_RTP_SAVP)) {
 	    switch (use_srtp) {
 	    case PJMEDIA_SRTP_MANDATORY:
@@ -1494,4 +1495,32 @@
 }
 
+
+/* This callback is called when SRTP negotiation completes */
+static void on_srtp_nego_complete(pjmedia_transport *tp, 
+				  pj_status_t result)
+{
+    pjsua_call_media *call_med = (pjsua_call_media*)tp->user_data;
+    pjsua_call *call;
+
+    if (!call_med)
+	return;
+
+    call = call_med->call;
+    PJ_PERROR(4,(THIS_FILE, result,
+		 "Call %d: Media %d: SRTP negotiation completes",
+	         call->index, call_med->idx));
+
+    if (result != PJ_SUCCESS) {
+	call_med->state = PJSUA_CALL_MEDIA_ERROR;
+	call_med->dir = PJMEDIA_DIR_NONE;
+	if (call && pjsua_var.ua_cfg.cb.on_call_media_state) {
+	    /* Defer the callback to a timer */
+	    pjsua_schedule_timer2(&ice_failed_nego_cb,
+				  (void*)(pj_ssize_t)call->index, 1);
+	}
+    }
+}
+
+
 /* Callback to resume pjsua_call_media_init() after media transport
  * creation is completed.
@@ -1547,4 +1576,6 @@
 	pjmedia_srtp_setting_default(&srtp_opt);
 	srtp_opt.close_member_tp = PJ_TRUE;
+	srtp_opt.cb.on_srtp_nego_complete = &on_srtp_nego_complete;
+	srtp_opt.user_data = call_med;
 
 	/* If media session has been ever established, let's use remote's 
