diff --git a/MSVC/ring-daemon.vcxproj b/MSVC/ring-daemon.vcxproj
index db6fb68402d0262aa1cb60aed523d785c8d2eb5b..11fdfa2bddf1767d8ce4b57d23f9fd0d3a76f9c9 100644
--- a/MSVC/ring-daemon.vcxproj
+++ b/MSVC/ring-daemon.vcxproj
@@ -418,7 +418,7 @@
       <SDLCheck>
       </SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)..\contrib\build\FFmpegInterop\ffmpeg\Build\Windows10\x64\include;$(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\iax;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\ringdht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\ringdht\eth;$(ProjectDir)..\contrib\build;$(ProjectDir)..\contrib\build\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party\speex\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\boost;$(ProjectDir)..\contrib\build\cryptopp;$(ProjectDir)..\contrib\build\restbed\source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>BOOST_SYSTEM_NO_DEPRECATED;PJ_OS_HAS_CHECK_STACK=1;STATIC_GETOPT;_USE_MATH_DEFINES;PCRE_STATIC;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;HAVE_CONFIG_H;WIN32_LEAN_AND_MEAN;RING_UWP;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>BOOST_SYSTEM_NO_DEPRECATED;PJ_OS_HAS_CHECK_STACK=1;STATIC_GETOPT;_USE_MATH_DEFINES;PCRE_STATIC;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;HAVE_CONFIG_H;WIN32_LEAN_AND_MEAN;RING_UWP;WIN32_NATIVE;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <DisableSpecificWarnings>4996;4503;4180;4244;4267;</DisableSpecificWarnings>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
@@ -444,7 +444,7 @@
       </Command>
     </PreBuildEvent>
     <Lib>
-      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;advapi32.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;libsamplerate.lib;libsndfile.lib;libgnutls.lib;lib_json.lib;opendht.lib;argon.lib;blake.lib;pcre.lib;yaml-cpp.lib;portaudio-UWP.lib;libupnp.lib;cryptlib.lib;boost_system.lib;boost_random.lib;pjsip-core-x86_64-x64-vc14-Release.lib;pjsip-simple-x86_64-x64-vc14-Release.lib;pjsua2-lib-x86_64-x64-vc14-Release.lib;pjsua-lib-x86_64-x64-vc14-Release.lib;pjsip-ua-x86_64-x64-vc14-Release.lib;pjmedia-codec-x86_64-x64-vc14-Release.lib;pjmedia-x86_64-x64-vc14-Release.lib;pjlib-util-x86_64-x64-vc14-Release.lib;libspeex-x86_64-x64-vc14-Release.lib;pjlib-x86_64-x64-vc14-Release.lib;pjnath-x86_64-x64-vc14-Release.lib;restbed.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;advapi32.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;libsamplerate.lib;libgnutls.lib;lib_json.lib;opendht.lib;argon.lib;blake.lib;pcre.lib;yaml-cpp.lib;portaudio-UWP.lib;libupnp.lib;cryptlib.lib;boost_system.lib;boost_random.lib;pjsip-core-x86_64-x64-vc14-Release.lib;pjsip-simple-x86_64-x64-vc14-Release.lib;pjsua2-lib-x86_64-x64-vc14-Release.lib;pjsua-lib-x86_64-x64-vc14-Release.lib;pjsip-ua-x86_64-x64-vc14-Release.lib;pjmedia-codec-x86_64-x64-vc14-Release.lib;pjmedia-x86_64-x64-vc14-Release.lib;pjlib-util-x86_64-x64-vc14-Release.lib;libspeex-x86_64-x64-vc14-Release.lib;pjlib-x86_64-x64-vc14-Release.lib;pjnath-x86_64-x64-vc14-Release.lib;restbed.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>$(ProjectDir)..\contrib\build\FFmpegInterop\ffmpeg\Build\Windows10\x64\bin;$(ProjectDir)..\contrib\build\lib\x64;$(ProjectDir)..\contrib\build\boost\stage\lib;$(ProjectDir)..\contrib\build\pjproject\pjsip\lib;$(ProjectDir)..\contrib\build\pjproject\pjmedia\lib;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\lib;$(ProjectDir)..\contrib\build\pjproject\third_party\lib;$(ProjectDir)..\contrib\build\pjproject\pjlib\lib;$(ProjectDir)..\contrib\build\pjproject\pjnath\lib;$(ProjectDir)..\contrib\build\libnatpmp\msvc\x64\Release;$(ProjectDir)..\contrib\build\restbed\build\Release;$(ProjectDir)..\contrib\build\restbed\dependency\openssl\out32dll</AdditionalLibraryDirectories>
       <AdditionalOptions>/ignore:4006 /ignore:4221 %(AdditionalOptions)</AdditionalOptions>
       <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
@@ -466,7 +466,9 @@
     <ClInclude Include="..\src\config\serializable.h" />
     <ClInclude Include="..\src\config\yamlparser.h" />
     <ClInclude Include="..\src\dirent.h" />
-    <ClInclude Include="..\src\dlfcn.h" />
+    <ClInclude Include="..\src\dlfcn.h">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLib|x64'">false</ExcludedFromBuild>
+    </ClInclude>
     <ClInclude Include="..\src\dring\account_const.h" />
     <ClInclude Include="..\src\dring\callmanager_interface.h" />
     <ClInclude Include="..\src\dring\call_const.h" />
@@ -530,8 +532,12 @@
     <ClInclude Include="..\src\media\video\video_scaler.h" />
     <ClInclude Include="..\src\media\video\video_sender.h" />
     <ClInclude Include="..\src\noncopyable.h" />
-    <ClInclude Include="..\src\plugin_loader.h" />
-    <ClInclude Include="..\src\plugin_manager.h" />
+    <ClInclude Include="..\src\plugin_loader.h">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLib|x64'">false</ExcludedFromBuild>
+    </ClInclude>
+    <ClInclude Include="..\src\plugin_manager.h">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLib|x64'">false</ExcludedFromBuild>
+    </ClInclude>
     <ClInclude Include="..\src\preferences.h" />
     <ClInclude Include="..\src\rational.h" />
     <ClInclude Include="..\src\registration_states.h" />
@@ -573,8 +579,8 @@
     <ClInclude Include="..\src\sip\siptransport.h" />
     <ClInclude Include="..\src\sip\sipvoiplink.h" />
     <ClInclude Include="..\src\sip\sip_utils.h" />
+    <ClInclude Include="..\src\smartools.h" />
     <ClInclude Include="..\src\string_utils.h" />
-    <ClInclude Include="..\src\sys_time.h" />
     <ClInclude Include="..\src\threadloop.h" />
     <ClInclude Include="..\src\thread_pool.h" />
     <ClInclude Include="..\src\upnp\upnp_context.h" />
@@ -583,6 +589,7 @@
     <ClInclude Include="..\src\utf8_utils.h" />
     <ClInclude Include="..\src\winsyslog.h" />
     <ClInclude Include="config.h" />
+    <ClInclude Include="sys_time.h" />
     <ClInclude Include="unistd.h" />
   </ItemGroup>
   <ItemGroup>
@@ -600,7 +607,9 @@
     <ClCompile Include="..\src\client\videomanager.cpp" />
     <ClCompile Include="..\src\conference.cpp" />
     <ClCompile Include="..\src\config\yamlparser.cpp" />
-    <ClCompile Include="..\src\dlfcn.c" />
+    <ClCompile Include="..\src\dlfcn.c">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLib|x64'">false</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="..\src\fileutils.cpp" />
     <ClCompile Include="..\src\hooks\urlhook.cpp" />
     <ClCompile Include="..\src\ice_transport.cpp" />
@@ -648,8 +657,12 @@
     <ClCompile Include="..\src\media\video\video_rtp_session.cpp" />
     <ClCompile Include="..\src\media\video\video_scaler.cpp" />
     <ClCompile Include="..\src\media\video\video_sender.cpp" />
-    <ClCompile Include="..\src\plugin_loader_dl.cpp" />
-    <ClCompile Include="..\src\plugin_manager.cpp" />
+    <ClCompile Include="..\src\plugin_loader_dl.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLib|x64'">false</ExcludedFromBuild>
+    </ClCompile>
+    <ClCompile Include="..\src\plugin_manager.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLib|x64'">false</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="..\src\preferences.cpp" />
     <ClCompile Include="..\src\ringdht\eth\libdevcore\Common.cpp" />
     <ClCompile Include="..\src\ringdht\eth\libdevcore\CommonData.cpp" />
@@ -682,6 +695,7 @@
     <ClCompile Include="..\src\sip\siptransport.cpp" />
     <ClCompile Include="..\src\sip\sipvoiplink.cpp" />
     <ClCompile Include="..\src\sip\sip_utils.cpp" />
+    <ClCompile Include="..\src\smartools.cpp" />
     <ClCompile Include="..\src\string_utils.cpp" />
     <ClCompile Include="..\src\threadloop.cpp" />
     <ClCompile Include="..\src\thread_pool.cpp" />
diff --git a/MSVC/ring-daemon.vcxproj.filters b/MSVC/ring-daemon.vcxproj.filters
index 1220c5235517a941b5a252a4a24ac06598e8b3ec..4db6d88601bdd4425370c0af87b5766c3c59468a 100644
--- a/MSVC/ring-daemon.vcxproj.filters
+++ b/MSVC/ring-daemon.vcxproj.filters
@@ -337,12 +337,6 @@
     <ClInclude Include="..\src\noncopyable.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\src\plugin_loader.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="..\src\plugin_manager.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\src\preferences.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -364,9 +358,6 @@
     <ClInclude Include="..\src\string_utils.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\src\sys_time.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\src\threadloop.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -514,6 +505,18 @@
     <ClInclude Include="..\src\compiler_intrinsics.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="sys_time.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\src\plugin_loader.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\src\plugin_manager.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\src\smartools.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\src\preferences.cpp">
@@ -828,5 +831,8 @@
     <ClCompile Include="..\src\ringdht\namedirectory.cpp">
       <Filter>Source Files\ringdht</Filter>
     </ClCompile>
+    <ClCompile Include="..\src\smartools.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/contrib/src/ffmpeg/fetch_and_patch.bat b/contrib/src/ffmpeg/fetch_and_patch.bat
index 08167348c6fcb33b41dcb3bc8c562939b1b2b48c..4988f2a14910a857ea4ef2babc81d8b36f6b63dc 100644
--- a/contrib/src/ffmpeg/fetch_and_patch.bat
+++ b/contrib/src/ffmpeg/fetch_and_patch.bat
@@ -9,4 +9,7 @@ cd %BUILD%
 
 git clone --recursive %FFMPEG_URL%
 
+cd FFmpegInterop\ffmpeg
+git apply --reject --whitespace=fix %SRC%\ffmpeg\0004-avformat-fix-find_stream_info-not-considering-extradata.patch
+
 cd %SRC%
\ No newline at end of file
diff --git a/src/call.h b/src/call.h
index b139f4a819102a74d69d3f4a95fc964eb40ed660..27784aa03e91c5cfa21c870e2455c69f03b5c563 100644
--- a/src/call.h
+++ b/src/call.h
@@ -46,7 +46,7 @@ namespace ring {
 
 class VoIPLink;
 class Account;
-class AccountVideoCodecInfo;
+struct AccountVideoCodecInfo;
 
 template <class T> using CallMap = std::map<std::string, std::shared_ptr<T> >;
 
diff --git a/src/dlfcn.c b/src/dlfcn.c
index 3ade181716ff77c5c7273132f0bb4532c44a9f58..5493c5f0c59271c776cb5d45aa8e0c709bc4aa7c 100644
--- a/src/dlfcn.c
+++ b/src/dlfcn.c
@@ -1,3 +1,4 @@
+
 /*
 * dlfcn-win32
 * Copyright (c) 2007 Ramiro Polla
@@ -135,7 +136,9 @@ void *dlopen( const char *file, int mode )
 	UINT uMode;
 	current_error = NULL;
 /* Do not let Windows display the critical-error-handler message box */
+#ifndef RING_UWP
 	uMode = SetErrorMode( SEM_FAILCRITICALERRORS );
+#endif
 	if( file == 0 )
 	{
 /* POSIX says that if the value of file is 0, a handle on a global
@@ -146,7 +149,9 @@ void *dlopen( const char *file, int mode )
 * symbols only from the original program file. For objects loaded with
 * the RTLD_GLOBAL flag, we create our own list later on.
 */
+#ifndef RING_UWP
 hModule = GetModuleHandle( NULL );
+#endif
 if( !hModule )
 	save_err_ptr_str( file );
 }
@@ -170,8 +175,10 @@ else
 * to UNIX's search paths (start with system folders instead of current
 * folder).
 */
+#ifndef RING_UWP
 hModule = LoadLibraryEx( (LPSTR) lpFileName, NULL,
 	LOAD_WITH_ALTERED_SEARCH_PATH );
+#endif
 /* If the object was loaded with RTLD_GLOBAL, add it to list of global
 * objects, so that its symbols may be retrieved even if the handle for
 * the original program file is passed. POSIX says that if the same
@@ -185,7 +192,9 @@ else if( (mode & RTLD_GLOBAL) )
 	global_add( hModule );
 }
 /* Return to previous state of the error-mode bit flags. */
+#ifndef RING_UWP
 SetErrorMode( uMode );
+#endif
 return (void *) hModule;
 }
 int dlclose( void *handle )
@@ -216,7 +225,9 @@ void *dlsym( void *handle, const char *name )
 /* If the handle for the original program file is passed, also search
 * in all globally loaded objects.
 */
+#ifndef RING_UWP
 hModule = GetModuleHandle( NULL );
+#endif
 if( hModule == handle )
 {
 	global_object *pobject;
diff --git a/src/logger.cpp b/src/logger.cpp
index 3e8d94b687a7d17c98b81e370fcae45b9fb255de..4822ea1f452b6486cda7d26b45fe61d9dfcacef2 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -212,7 +212,7 @@ vlogger(const int level, const char *format, va_list ap)
             format = sep + 2;
             fputs(getHeader(ctx.c_str()).c_str(), stderr);
 #ifdef RING_UWP
-            char tmp[2048];
+            char tmp[4096];
             vsprintf(tmp, format, ap);
             ring::emitSignal<DRing::DebugSignal::MessageSend>(getHeader(ctx.c_str()).c_str() + std::string(tmp));
 #endif
diff --git a/src/media/media_encoder.h b/src/media/media_encoder.h
index 871cae4ee23df4f964a778ee44620a9822f72bff..8e8d23c135d396e5fd1b0147cdca11354445fca6 100644
--- a/src/media/media_encoder.h
+++ b/src/media/media_encoder.h
@@ -47,8 +47,8 @@ namespace ring {
 
 class AudioBuffer;
 class MediaIOHandle;
-class MediaDescription;
-class AccountCodecInfo;
+struct MediaDescription;
+struct AccountCodecInfo;
 
 class MediaEncoderException : public std::runtime_error {
     public:
diff --git a/src/media/video/video_sender.h b/src/media/video/video_sender.h
index 151a8c68b6309be360e3e500525065b30b531b72..4bb2285016a04fd887ab255568ae053d909b37d2 100644
--- a/src/media/video/video_sender.h
+++ b/src/media/video/video_sender.h
@@ -34,7 +34,7 @@
 // Forward declarations
 namespace ring {
 class SocketPair;
-class AccountVideoCodecInfo;
+struct AccountVideoCodecInfo;
 }
 
 namespace ring { namespace video {
diff --git a/src/ringdht/ringaccount.cpp b/src/ringdht/ringaccount.cpp
index 0a4f6e64ab783bbd97bbba5dc5a89ec12220e4e4..632cbbf581be6022fea7f14742374e7c9a96642f 100644
--- a/src/ringdht/ringaccount.cpp
+++ b/src/ringdht/ringaccount.cpp
@@ -1140,7 +1140,7 @@ RingAccount::revokeDevice(const std::string& password, const std::string& device
                     [fa,sthis,password](const std::shared_ptr<dht::crypto::Certificate>& crt) mutable
     {
         sthis->foundAccountDevice(crt);
-        auto a = fa->get();
+        ArchiveContent a = fa->get();
         // Add revoked device to the revocation list and resign it
         if (not a.revoked)
             a.revoked = std::make_shared<decltype(a.revoked)::element_type>();
@@ -1986,6 +1986,7 @@ RingAccount::doRegister_()
         auto dht_log_level = Manager::instance().dhtLogLevel.load();
         if (dht_log_level > 0) {
             static auto silent = [](char const* /*m*/, va_list /*args*/) {};
+#ifndef RING_UWP
             static auto log_error = [](char const* m, va_list args) { vlogger(LOG_ERR, m, args); };
             static auto log_warn = [](char const* m, va_list args) { vlogger(LOG_WARNING, m, args); };
             static auto log_debug = [](char const* m, va_list args) { vlogger(LOG_DEBUG, m, args); };
@@ -1993,6 +1994,15 @@ RingAccount::doRegister_()
                 log_error,
                 (dht_log_level > 1) ? log_warn : silent,
                 (dht_log_level > 2) ? log_debug : silent);
+#else
+            static auto log_all = [](char const* m, va_list args) {
+                char tmp[2048];
+                vsprintf(tmp, m, args);
+                auto now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
+                ring::emitSignal<DRing::DebugSignal::MessageSend>(std::to_string(now) + " " + std::string(tmp));
+            };
+            dht_.setLoggers(log_all, log_all, silent);
+#endif
         }
 
         dht_.importValues(loadValues());
diff --git a/src/security/tls_session.h b/src/security/tls_session.h
index 28e905d92c0c0b6505db378ecae5bb7f48dfe43f..745f0291248678687358dac4d2d2fa5d5ed4db32 100644
--- a/src/security/tls_session.h
+++ b/src/security/tls_session.h
@@ -46,8 +46,8 @@ class IceSocket;
 } // namespace ring
 
 namespace dht { namespace crypto {
-class Certificate;
-class PrivateKey;
+struct Certificate;
+struct PrivateKey;
 }} // namespace dht::crypto
 
 namespace ring { namespace tls {
@@ -65,6 +65,10 @@ public:
     DhParams() = default;
     DhParams(DhParams&&) = default;
 
+    DhParams& operator =(const DhParams& other){
+        return *this;
+    }
+
     /** Take ownership of gnutls_dh_params */
     explicit DhParams(gnutls_dh_params_t p) : params_(p, gnutls_dh_params_deinit) {};
 
diff --git a/src/security/tlsvalidator.cpp b/src/security/tlsvalidator.cpp
index 0ddc91520636adb4a2f83b3742750723dda8962a..7a39ba8f2b6cb46baad4880f3fde51bb09e3e513 100644
--- a/src/security/tlsvalidator.cpp
+++ b/src/security/tlsvalidator.cpp
@@ -55,11 +55,17 @@
 #include <netinet/in.h>
 #include <netdb.h>
 #else
+#ifndef RING_UWP
 #define close(x) closesocket(x)
 #endif
+#endif
 #include <unistd.h>
 #include <fcntl.h>
 
+#ifdef RING_UWP
+#include "windirent.h"
+#endif
+
 namespace ring { namespace tls {
 
 //Map the internal ring Enum class of the exported names
diff --git a/src/sip/sdp.cpp b/src/sip/sdp.cpp
index 044fa6ab4cf1bf81b8b9bcb453e37752e81f70bc..12ee18f5320eb7bc717036fcf2488b9ba1604285 100644
--- a/src/sip/sdp.cpp
+++ b/src/sip/sdp.cpp
@@ -122,7 +122,7 @@ Sdp::findCodecByPayload(const unsigned payloadType)
 static void
 randomFill(std::vector<uint8_t>& dest)
 {
-    std::uniform_int_distribution<uint8_t> rand_byte(0, 255);
+    std::uniform_int_distribution<int> rand_byte{ 0, std::numeric_limits<uint8_t>::max() };
     random_device rdev;
     std::generate(dest.begin(), dest.end(), std::bind(rand_byte, std::ref(rdev)));
 }
diff --git a/src/sip/sipaccount.cpp b/src/sip/sipaccount.cpp
index 1a20364d009747168f67f54a0f1c17060a0c2df8..06a5477f56a7906c309495d530504a908c0d48e5 100644
--- a/src/sip/sipaccount.cpp
+++ b/src/sip/sipaccount.cpp
@@ -1294,6 +1294,8 @@ std::string SIPAccount::getLoginName()
 #ifndef _WIN32
     struct passwd * user_info = getpwuid(getuid());
     return user_info ? user_info->pw_name : "";
+#elif defined (RING_UWP)
+    return "Unknown";
 #else
     TCHAR username[UNLEN + 1];
     DWORD size = UNLEN + 1;
diff --git a/src/sip/sipaccount.h b/src/sip/sipaccount.h
index 367147e3a0e8cc97b25dc097c68460aac39d44c2..d8a311eaf67a034da65dc6606e71df2c2ccfb41f 100644
--- a/src/sip/sipaccount.h
+++ b/src/sip/sipaccount.h
@@ -464,9 +464,15 @@ class SIPAccount : public SIPAccountBase {
          *      The type of this instance is given in template argument.
          *      This type can be any base class of SIPCall class (included).
          */
+#ifndef RING_UWP
         template <class T=SIPCall>
         std::shared_ptr<enable_if_base_of<T, SIPCall> >
-        newOutgoingCall(const std::string& toUrl);
+        newOutgoingCall(const std::string& toUrl);
+#else
+        template <class T>
+        std::shared_ptr<T>
+        newOutgoingCall(const std::string& toUrl);
+#endif
 
         /**
          * Create incoming SIPCall.
diff --git a/src/sip/siptransport.cpp b/src/sip/siptransport.cpp
index c0860ae1b17017af3c1df3fffa386cf1bbb9d01b..3e2ca56863047de22ac17639bd0d14be8906e28c 100644
--- a/src/sip/siptransport.cpp
+++ b/src/sip/siptransport.cpp
@@ -387,9 +387,9 @@ SipTransportBroker::getTlsTransport(const std::shared_ptr<TlsListener>& l, const
         remoteAddr.setPort(pjsip_transport_get_default_port_for_type(l->get()->type));
 
     RING_DBG("Get new TLS transport to %s", remoteAddr.toString(true).c_str());
-    pjsip_tpselector sel {PJSIP_TPSELECTOR_LISTENER, {
-        .listener = l->get()
-    }};
+    pjsip_tpselector sel;
+    sel.type = PJSIP_TPSELECTOR_LISTENER;
+    sel.u.listener = l->get();
 
     pjsip_tx_data tx_data;
     tx_data.dest_info.name = pj_str_t{(char*)remote_name.data(), (pj_ssize_t)remote_name.size()};
diff --git a/src/sip/sipvoiplink.cpp b/src/sip/sipvoiplink.cpp
index f613d079eedf12b917666fac288e053bf97f02d5..c9288b75afb70a495fc1f431e73730b016992e36 100644
--- a/src/sip/sipvoiplink.cpp
+++ b/src/sip/sipvoiplink.cpp
@@ -605,7 +605,7 @@ SIPVoIPLink::~SIPVoIPLink()
     for (int timeout = 0;
          pjsip_tsx_layer_get_tsx_count() and timeout < MAX_TIMEOUT_ON_LEAVING;
          timeout++)
-        sleep(1);
+        std::this_thread::sleep_for(std::chrono::seconds(1));
 
     pjsip_tpmgr_set_state_cb(pjsip_endpt_get_tpmgr(endpt_), nullptr);
     Manager::instance().unregisterEventHandler((uintptr_t)this);
diff --git a/src/upnp/upnp_context.cpp b/src/upnp/upnp_context.cpp
index 324de1cad1b26ba6a025c6c6225d2e585185358c..ecfe88a664c69a2a06266da2340d6a5e7ee5bb09 100644
--- a/src/upnp/upnp_context.cpp
+++ b/src/upnp/upnp_context.cpp
@@ -22,13 +22,6 @@
 #include "config.h"
 #endif
 
-#include "upnp_context.h"
-
-#if HAVE_LIBUPNP
-#include <upnp/upnp.h>
-#include <upnp/upnptools.h>
-#endif
-
 #if HAVE_LIBNATPMP
 #include <natpmp.h>
 #endif
@@ -50,6 +43,8 @@ using random_device = dht::crypto::random_device;
 #include <chrono>
 #include <cstdlib> // for std::free
 
+#include "upnp_context.h"
+
 namespace ring { namespace upnp {
 
 /**