Commit cb5165c9 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fix issues

parent 5cda3039
......@@ -75,7 +75,7 @@
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</CompileAsWinRT>
<GenerateXMLDocumentationFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</GenerateXMLDocumentationFiles>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">$(ProjectDir)../submodules\oRTP\include;$(ProjectDir)../submodules/mediastreamer2/include;$(ProjectDir)../submodules/linphone;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Async</ExceptionHandling>
<ExceptionHandling Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">SyncCThrow</ExceptionHandling>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
......
#pragma once
#include "LinphoneCore.h"
#include "ApiLock.h"
namespace Linphone
{
......
......@@ -58,26 +58,34 @@ void Linphone::Core::LinphoneCore::SetContext(Platform::Object^ object)
void Linphone::Core::LinphoneCore::ClearProxyConfigs()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
linphone_core_clear_proxy_config(this->lc);
}
void Linphone::Core::LinphoneCore::AddProxyConfig(Linphone::Core::LinphoneProxyConfig^ proxyCfg)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
linphone_core_add_proxy_config(this->lc, proxyCfg->proxy_config);
}
void Linphone::Core::LinphoneCore::SetDefaultProxyConfig(Linphone::Core::LinphoneProxyConfig^ proxyCfg)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
linphone_core_set_default_proxy(this->lc, proxyCfg->proxy_config);
}
Linphone::Core::LinphoneProxyConfig^ Linphone::Core::LinphoneCore::GetDefaultProxyConfig()
{
return nullptr;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
::LinphoneProxyConfig *proxy=NULL;
linphone_core_get_default_proxy(this->lc,&proxy);
Linphone::Core::LinphoneProxyConfig^ defaultProxy = reinterpret_cast<Linphone::Core::LinphoneProxyConfig^>(proxy);
return defaultProxy;
}
Linphone::Core::LinphoneProxyConfig^ Linphone::Core::LinphoneCore::CreateEmptyProxyConfig()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
Linphone::Core::LinphoneProxyConfig^ proxyConfig = ref new Linphone::Core::LinphoneProxyConfig();
return proxyConfig;
}
......@@ -89,16 +97,19 @@ Windows::Foundation::Collections::IVector<Linphone::Core::LinphoneProxyConfig^>^
void Linphone::Core::LinphoneCore::ClearAuthInfos()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
linphone_core_clear_all_auth_info(this->lc);
}
void Linphone::Core::LinphoneCore::AddAuthInfo(Linphone::Core::LinphoneAuthInfo^ info)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
linphone_core_add_auth_info(this->lc, info->auth_info);
}
Linphone::Core::LinphoneAuthInfo^ Linphone::Core::LinphoneCore::CreateAuthInfo(Platform::String^ username, Platform::String^ userid, Platform::String^ password, Platform::String^ ha1, Platform::String^ realm)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
Linphone::Core::LinphoneAuthInfo^ authInfo = ref new Linphone::Core::LinphoneAuthInfo(username, userid, password, ha1, realm);
return authInfo;
}
......@@ -698,5 +709,5 @@ void Linphone::Core::LinphoneCore::Init()
Linphone::Core::LinphoneCore::~LinphoneCore()
{
delete(this->lc);
}
......@@ -142,5 +142,5 @@ Linphone::Core::LinphoneProxyConfig::LinphoneProxyConfig()
Linphone::Core::LinphoneProxyConfig::~LinphoneProxyConfig()
{
delete(this->proxy_config);
}
\ No newline at end of file
#pragma once
#include "LinphoneCore.h"
#include "ApiLock.h"
namespace Linphone
{
......
No preview for this file type
......@@ -90,6 +90,7 @@ namespace Linphone
{
Debug.WriteLine("[Linphone] Launching");
LinphoneManager.Instance.ConnectBackgroundProcessToInterface();
LinphoneManager.Instance.EnableDebug(SettingsManager.isDebugEnabled);
}
// Code to execute when the application is activated (brought to foreground)
......@@ -98,6 +99,7 @@ namespace Linphone
{
Debug.WriteLine("[Linphone] Activated");
LinphoneManager.Instance.ConnectBackgroundProcessToInterface();
LinphoneManager.Instance.EnableDebug(SettingsManager.isDebugEnabled);
}
// Code to execute when the application is deactivated (sent to background)
......
......@@ -204,7 +204,7 @@ namespace Linphone.Model
/// </summary>
public void InitLinphoneCore()
{
if (LinphoneCore != null)
if (server.LinphoneCore != null)
return;
server.LinphoneCoreFactory.CreateLinphoneCore(this);
......@@ -228,8 +228,9 @@ namespace Linphone.Model
LinphoneCore.Iterate();
}
catch (Exception)
catch
{
Debug.WriteLine("[LinphoneManager] Exception during iterate...");
timer.Dispose();
}
}
......
......@@ -43,7 +43,6 @@ namespace Linphone
base.OnNavigatedTo(e);
StatusBar = status;
LinphoneManager.Instance.EnableDebug(SettingsManager.isDebugEnabled);
// Create LinphoneCore if not created yet, otherwise do nothing
LinphoneManager.Instance.InitLinphoneCore();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment