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

Added part of missing API

parent 2c4df25c
......@@ -44,12 +44,12 @@ void Linphone::Core::LinphoneAddress::SetDomain(Platform::String^ domain)
void Linphone::Core::LinphoneAddress::SetPort(int port)
{
linphone_address_set_port_int(this->address, port);
}
void Linphone::Core::LinphoneAddress::Clean()
{
linphone_address_clean(this->address);
}
Platform::String^ Linphone::Core::LinphoneAddress::AsString()
......
......@@ -73,6 +73,7 @@ namespace Linphone
private:
friend class Linphone::Core::Utils;
friend ref class Linphone::Core::LinphoneCoreFactory;
friend ref class Linphone::Core::LinphoneCore;
LinphoneAddress(::LinphoneAddress *addr);
LinphoneAddress(const char *uri);
......
......@@ -12,11 +12,13 @@ using namespace Windows::Phone::Networking::Voip;
Linphone::Core::LinphoneCallState Linphone::Core::LinphoneCall::GetState()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return (Linphone::Core::LinphoneCallState)linphone_call_get_state(this->call);
}
Linphone::Core::LinphoneAddress^ Linphone::Core::LinphoneCall::GetRemoteAddress()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
const ::LinphoneAddress *addr = linphone_call_get_remote_address(this->call);
Linphone::Core::LinphoneAddress^ address = (Linphone::Core::LinphoneAddress^)Linphone::Core::Utils::CreateLinphoneAddress((void*)addr);
return address;
......@@ -24,106 +26,130 @@ Linphone::Core::LinphoneAddress^ Linphone::Core::LinphoneCall::GetRemoteAddress(
Linphone::Core::CallDirection Linphone::Core::LinphoneCall::GetDirection()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return (Linphone::Core::CallDirection)linphone_call_get_dir(this->call);
}
Linphone::Core::LinphoneCallLog^ Linphone::Core::LinphoneCall::GetCallLog()
{
return nullptr;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return (Linphone::Core::LinphoneCallLog^) Linphone::Core::Utils::CreateLinphoneCallLog(linphone_call_get_call_log(this->call));
}
Linphone::Core::LinphoneCallStats^ Linphone::Core::LinphoneCall::GetAudioStats()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
//TODO
return nullptr;
}
Linphone::Core::LinphoneCallParams^ Linphone::Core::LinphoneCall::GetRemoteParams()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
//TODO
return nullptr;
}
Linphone::Core::LinphoneCallParams^ Linphone::Core::LinphoneCall::GetCurrentParamsCopy()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
//TODO
return nullptr;
}
void Linphone::Core::LinphoneCall::EnableEchoCancellation(Platform::Boolean enable)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
linphone_call_enable_echo_cancellation(this->call, enable);
}
Platform::Boolean Linphone::Core::LinphoneCall::IsEchoCancellationEnabled()
{
return false;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return linphone_call_echo_cancellation_enabled(this->call);
}
void Linphone::Core::LinphoneCall::EnableEchoLimiter(Platform::Boolean enable)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
linphone_call_enable_echo_limiter(this->call, enable);
}
Platform::Boolean Linphone::Core::LinphoneCall::IsEchoLimiterEnabled()
{
return false;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return linphone_call_echo_limiter_enabled(this->call);
}
int Linphone::Core::LinphoneCall::GetDuration()
{
return -1;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return linphone_call_get_duration(this->call);;
}
float Linphone::Core::LinphoneCall::GetCurrentQuality()
{
return -1;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return linphone_call_get_current_quality(this->call);
}
float Linphone::Core::LinphoneCall::GetAverageQuality()
{
return -1;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return linphone_call_get_average_quality(this->call);
}
Platform::String^ Linphone::Core::LinphoneCall::GetAuthenticationToken()
{
return nullptr;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return Linphone::Core::Utils::cctops(linphone_call_get_authentication_token(this->call));
}
Platform::Boolean Linphone::Core::LinphoneCall::IsAuthenticationTokenVerified()
{
return false;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return linphone_call_get_authentication_token_verified(this->call);
}
void Linphone::Core::LinphoneCall::SetAuthenticationTokenVerified(Platform::Boolean verified)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
linphone_call_set_authentication_token_verified(this->call, verified);
}
Platform::Boolean Linphone::Core::LinphoneCall::IsInConference()
{
return false;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return linphone_call_is_in_conference(this->call);
}
float Linphone::Core::LinphoneCall::GetPlayVolume()
{
return -1;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return linphone_call_get_play_volume(this->call);
}
Platform::String^ Linphone::Core::LinphoneCall::GetRemoteUserAgent()
{
return nullptr;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return Linphone::Core::Utils::cctops(linphone_call_get_remote_user_agent(this->call));
}
Platform::String^ Linphone::Core::LinphoneCall::GetRemoteContact()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return Linphone::Core::Utils::cctops(linphone_call_get_remote_contact(this->call));
}
void Linphone::Core::LinphoneCall::CallContext::set(Platform::Object^ cc)
{
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
this->callContext = cc;
}
Platform::Object^ Linphone::Core::LinphoneCall::GetCallStartTimeFromContext()
{
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
if (this->callContext != nullptr) {
return ((Windows::Phone::Networking::Voip::VoipPhoneCall^)this->callContext)->StartTime;
}
......@@ -131,7 +157,8 @@ Platform::Object^ Linphone::Core::LinphoneCall::GetCallStartTimeFromContext()
}
Platform::Object^ Linphone::Core::LinphoneCall::CallContext::get()
{
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return this->callContext;
}
......
......@@ -5,30 +5,34 @@
void Linphone::Core::LinphoneCallParams::SetAudioBandwidth(int value)
{
//TODO
}
Linphone::Core::MediaEncryption Linphone::Core::LinphoneCallParams::GetMediaEncryption()
{
//TODO
return Linphone::Core::MediaEncryption::None;
}
void Linphone::Core::LinphoneCallParams::SetMediaEncryption(Linphone::Core::MediaEncryption menc)
{
//TODO
}
Linphone::Core::PayloadType^ Linphone::Core::LinphoneCallParams::GetUsedAudioCodec()
{
//TODO
return nullptr;
}
void Linphone::Core::LinphoneCallParams::EnableLowBandwidth(Platform::Boolean enable)
{
//TODO
}
Platform::Boolean Linphone::Core::LinphoneCallParams::IsLowBandwidthEnabled()
{
//TODO
return false;
}
......@@ -3,55 +3,66 @@
Linphone::Core::MediaType Linphone::Core::LinphoneCallStats::GetMediaType()
{
//TODO
return Linphone::Core::MediaType::Audio;
}
Linphone::Core::IceState Linphone::Core::LinphoneCallStats::GetIceState()
{
//TODO
return Linphone::Core::IceState::Failed;
}
float Linphone::Core::LinphoneCallStats::GetDownloadBandwidth()
{
//TODO
return -1;
}
float Linphone::Core::LinphoneCallStats::GetUploadBandwidth()
{
//TODO
return -1;
}
float Linphone::Core::LinphoneCallStats::GetSenderLossRate()
{
//TODO
return -1;
}
float Linphone::Core::LinphoneCallStats::GetReceiverLossRate()
{
//TODO
return -1;
}
float Linphone::Core::LinphoneCallStats::GetSenderInterarrivalJitter()
{
//TODO
return -1;
}
float Linphone::Core::LinphoneCallStats::GetReceiverInterarrivalJitter()
{
//TODO
return -1;
}
float Linphone::Core::LinphoneCallStats::GetRoundTripDelay()
{
//TODO
return -1;
}
int64 Linphone::Core::LinphoneCallStats::GetLatePacketsCumulativeNumber()
{
//TODO
return -1;
}
float Linphone::Core::LinphoneCallStats::GetJitterBufferSize()
{
//TODO
return -1;
}
This diff is collapsed.
......@@ -4,6 +4,8 @@
#include "LinphoneCoreListener.h"
#include "Utils.h"
#include "coreapi\linphonecore.h"
#include "coreapi\linphonecore_utils.h"
#include "coreapi\linphone_tunnel.h"
#include "coreapi\lpconfig.h"
namespace Linphone
......@@ -158,11 +160,6 @@ namespace Linphone
/// </returns>
LinphoneCall^ GetCurrentCall();
/// <returns>
/// nullptr if no call engaged yet.
/// </returns>
LinphoneAddress^ GetRemoteAddress();
/// <summary>
/// Returns true if at least a call is running, else returns false.
/// </summary>
......@@ -234,7 +231,8 @@ namespace Linphone
/// Returns true if the network has been set as reachable, else returns false.
/// </summary>
Platform::Boolean IsNetworkReachable();
void SetMicrophoneGain(float gain);
/// <summary>
/// Allow to control play level before entering the sound card.
/// </summary>
......@@ -398,11 +396,11 @@ namespace Linphone
void LeaveConference();
void AddToConference(LinphoneCall^ call);
void AddAllToConference();
void RemoveFromConference();
void RemoveFromConference(LinphoneCall^ call);
void TerminateConference();
int GetConferenceSize();
void TerminateAllCalls();
Windows::Foundation::Collections::IVector<LinphoneCall^>^ GetCalls();
Windows::Foundation::Collections::IVector<Platform::Object^>^ GetCalls();
int GetCallsNb();
LinphoneCall^ FindCallFromUri(Platform::String^ uri);
int GetMaxCalls();
......@@ -474,7 +472,6 @@ namespace Linphone
/// Once this time is elapsed (ringing included), the call is automatically hung up.
/// </summary>
void SetInCallTimeout(int timeout);
void SetMicrophoneGain(float gain);
/// <summary>
/// Set username and display name to use if no LinphoneProxyConfig is configured.
......
......@@ -42,12 +42,14 @@ static void LinphoneNativeOutputTraceHandler(OrtpLogLevel lev, const char *fmt,
void LinphoneCoreFactory::CreateLinphoneCore(Linphone::Core::LinphoneCoreListener^ listener)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
CreateLinphoneCore(listener, nullptr);
}
void LinphoneCoreFactory::CreateLinphoneCore(Linphone::Core::LinphoneCoreListener^ listener, Linphone::Core::LpConfig^ config)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
Utils::LinphoneCoreSetLogHandler(LinphoneNativeOutputTraceHandler);
this->linphoneCore = ref new Linphone::Core::LinphoneCore(listener, config);
this->linphoneCore->Init();
......@@ -55,16 +57,21 @@ void LinphoneCoreFactory::CreateLinphoneCore(Linphone::Core::LinphoneCoreListene
Linphone::Core::LpConfig^ LinphoneCoreFactory::CreateLpConfig(Platform::String^ configPath, Platform::String^ factoryConfigPath)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return dynamic_cast<LpConfig^>(Utils::CreateLpConfig(configPath, factoryConfigPath));
}
Linphone::Core::LinphoneAuthInfo^ LinphoneCoreFactory::CreateAuthInfo(Platform::String^ username, Platform::String^ password, Platform::String^ realm)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
//TODO
return nullptr;
}
Linphone::Core::LinphoneAddress^ LinphoneCoreFactory::CreateLinphoneAddress(Platform::String^ username, Platform::String^ domain, Platform::String^ displayName)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
//TODO
return nullptr;
}
......@@ -82,16 +89,19 @@ void LinphoneCoreFactory::SetLogLevel(OutputTraceLevel logLevel)
Linphone::Core::LinphoneCore^ LinphoneCoreFactory::LinphoneCore::get()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return this->linphoneCore;
}
Linphone::Core::OutputTraceListener^ LinphoneCoreFactory::OutputTraceListener::get()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return this->outputTraceListener;
}
void LinphoneCoreFactory::OutputTraceListener::set(Linphone::Core::OutputTraceListener^ listener)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
this->outputTraceListener = listener;
}
......
......@@ -18,15 +18,18 @@ void Linphone::Core::LinphoneProxyConfig::Done()
void Linphone::Core::LinphoneProxyConfig::SetIdentity(Platform::String^ displayname, Platform::String^ username, Platform::String^ domain)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
const char* cc_username = Utils::pstoccs(username);
const char* cc_domain = Utils::pstoccs(domain);
const char* cc_displayname = Utils::pstoccs(displayname);
::LinphoneAddress *addr = linphone_address_new(NULL);
linphone_address_set_username(addr, cc_username);
linphone_address_set_domain(addr, cc_domain);
linphone_address_set_display_name(addr, cc_displayname);
linphone_proxy_config_set_identity(this->proxy_config, linphone_address_as_string(addr));
linphone_address_destroy(addr);
delete(cc_username);
delete(cc_domain);
delete(cc_displayname);
......@@ -41,6 +44,7 @@ Platform::String^ Linphone::Core::LinphoneProxyConfig::GetIdentity()
void Linphone::Core::LinphoneProxyConfig::SetProxy(Platform::String^ proxyUri)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
const char* cc = Utils::pstoccs(proxyUri);
linphone_proxy_config_set_server_addr(this->proxy_config, cc);
delete(cc);
......@@ -61,6 +65,7 @@ Platform::Boolean Linphone::Core::LinphoneProxyConfig::IsRegisterEnabled()
Platform::String^ Linphone::Core::LinphoneProxyConfig::NormalizePhoneNumber(Platform::String^ phoneNumber)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
const char* cc = Utils::pstoccs(phoneNumber);
char* result = (char*) malloc(phoneNumber->Length());
int result_size = 0;
......@@ -68,12 +73,14 @@ Platform::String^ Linphone::Core::LinphoneProxyConfig::NormalizePhoneNumber(Plat
Platform::String^ val = Utils::cctops(result);
delete(cc);
delete(result);
return val;
}
void Linphone::Core::LinphoneProxyConfig::SetDialPrefix(Platform::String^ prefix)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
const char* cc = Utils::pstoccs(prefix);
linphone_proxy_config_set_dial_prefix(this->proxy_config, cc);
delete(cc);
......@@ -106,6 +113,7 @@ Platform::Boolean Linphone::Core::LinphoneProxyConfig::IsRegistered()
void Linphone::Core::LinphoneProxyConfig::SetRoute(Platform::String^ routeUri)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
const char* cc = Utils::pstoccs(routeUri);
linphone_proxy_config_set_route(this->proxy_config, cc);
delete(cc);
......@@ -125,7 +133,8 @@ void Linphone::Core::LinphoneProxyConfig::EnablePublish(Platform::Boolean enable
Platform::Boolean Linphone::Core::LinphoneProxyConfig::IsPublishEnabled()
{
return false;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return linphone_proxy_config_publish_enabled(this->proxy_config);
}
Linphone::Core::RegistrationState Linphone::Core::LinphoneProxyConfig::GetState()
......@@ -136,12 +145,14 @@ Linphone::Core::RegistrationState Linphone::Core::LinphoneProxyConfig::GetState(
void Linphone::Core::LinphoneProxyConfig::SetExpires(int delay)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
linphone_proxy_config_expires(this->proxy_config, delay);
}
void Linphone::Core::LinphoneProxyConfig::SetContactParameters(Platform::String^ params)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
const char* cc = Utils::pstoccs(params);
linphone_proxy_config_set_contact_parameters(this->proxy_config, cc);
delete(cc);
......@@ -149,17 +160,30 @@ void Linphone::Core::LinphoneProxyConfig::SetContactParameters(Platform::String^
int Linphone::Core::LinphoneProxyConfig::LookupCCCFromIso(Platform::String^ iso)
{
return -1;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
const char* isochar = Linphone::Core::Utils::pstoccs(iso);
int ccc = linphone_dial_plan_lookup_ccc_from_iso(isochar);
delete(isochar);
return ccc;
}
int Linphone::Core::LinphoneProxyConfig::LookupCCCFromE164(Platform::String^ e164)
{
return -1;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
const char* e164char = Linphone::Core::Utils::pstoccs(e164);
int ccc = linphone_dial_plan_lookup_ccc_from_e164(e164char);
delete(e164char);
return ccc;
}
Linphone::Core::LinphoneProxyConfig::LinphoneProxyConfig()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
this->proxy_config = linphone_proxy_config_new();
RefToPtrProxy<LinphoneProxyConfig^> *proxy = new RefToPtrProxy<LinphoneProxyConfig^>(this);
linphone_proxy_config_set_user_data(this->proxy_config, proxy);
......@@ -168,6 +192,7 @@ Linphone::Core::LinphoneProxyConfig::LinphoneProxyConfig()
Linphone::Core::LinphoneProxyConfig::LinphoneProxyConfig(::LinphoneProxyConfig* proxy_config)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
this->proxy_config = proxy_config;
RefToPtrProxy<LinphoneProxyConfig^> *proxy = new RefToPtrProxy<LinphoneProxyConfig^>(this);
linphone_proxy_config_set_user_data(this->proxy_config, proxy);
......@@ -176,6 +201,7 @@ Linphone::Core::LinphoneProxyConfig::LinphoneProxyConfig(::LinphoneProxyConfig*
Linphone::Core::LinphoneProxyConfig::~LinphoneProxyConfig()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
RefToPtrProxy<LinphoneProxyConfig^> *proxy = reinterpret_cast< RefToPtrProxy<LinphoneProxyConfig^> *>(linphone_proxy_config_get_user_data(this->proxy_config));
delete proxy;
}
......@@ -154,6 +154,7 @@ namespace Linphone
private:
friend ref class Linphone::Core::LinphoneCore;
friend class Linphone::Core::Utils;
LinphoneProxyConfig();
LinphoneProxyConfig(::LinphoneProxyConfig* proxy_config);
......
......@@ -2,6 +2,7 @@
#include "LinphoneCall.h"
#include "LinphoneAddress.h"
#include "LinphoneAuthInfo.h"
#include "LinphoneProxyConfig.h"
#include "LinphoneCallLog.h"
#include "LpConfig.h"
#include "PayloadType.h"
......@@ -88,6 +89,11 @@ Platform::Object^ Linphone::Core::Utils::CreateLinphoneAuthInfo(void *auth_info)
return ref new Linphone::Core::LinphoneAuthInfo((::LinphoneAuthInfo *)auth_info);
}
Platform::Object^ Linphone::Core::Utils::CreateLinphoneProxyConfig(void *proxy_config)
{
return ref new Linphone::Core::LinphoneProxyConfig((::LinphoneProxyConfig *)proxy_config);
}
Platform::Object^ Linphone::Core::Utils::CreateLinphoneCallLog(void* callLog)
{
return ref new Linphone::Core::LinphoneCallLog((::LinphoneCallLog*)callLog);
......
......@@ -71,6 +71,11 @@ namespace Linphone
/// </summary>
static Platform::Object^ CreateLinphoneAuthInfo(void *auth_info);
/// <summary>
/// Creates a C++/CX LinphoneProxyConfig object using pointer to C structure.
/// </summary>
static Platform::Object^ CreateLinphoneProxyConfig(void *proxy_config);
/// <summary>
/// Creates a C++/CX LinphoneCallLog object using pointer to C structure.
/// </summary>
......
linphone @ da89be1d
Subproject commit 71a7738d39aac992ffc4b69c777e61f1374fd258
Subproject commit da89be1d127cc89640830795ba71f7f841b9ecf6
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