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

Added UserPointer to LinphoneCall to store VoipPhoneCall objects + Renamed...

Added UserPointer to LinphoneCall to store VoipPhoneCall objects + Renamed BackEnd namespace to Core
parent 0fa8ba66
......@@ -5,6 +5,6 @@
*/*/*/Thumbs.db
*/ARM/
*/x86/
BackEndProxyStub/Linphone.BackEnd*
CoreProxyStub/Linphone.Core*
ARM/
Linphone.sdf
\ No newline at end of file
......@@ -90,7 +90,7 @@
<Compile Include="RegistrationHelper.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BackEnd\BackEnd.vcxproj">
<ProjectReference Include="..\Core\Core.vcxproj">
<Project>{C8D75245-FFCF-4932-A228-C9CC8BB60B03}</Project>
<Name>BackEnd</Name>
</ProjectReference>
......
using Microsoft.Phone.Networking.Voip;
using Linphone.BackEnd;
using Linphone.BackEnd.OutOfProcess;
using Linphone.Core;
using Linphone.Core.OutOfProcess;
using System.Diagnostics;
namespace Linphone.Agents
......
using Microsoft.Phone.Networking.Voip;
using System.Diagnostics;
using Linphone.BackEnd;
using Linphone.Core;
using System.Threading;
using Linphone.BackEnd.OutOfProcess;
using Linphone.Core.OutOfProcess;
namespace Linphone.Agents
{
......
using Microsoft.Phone.Networking.Voip;
using Microsoft.Phone.Scheduler;
using Linphone.BackEnd;
using Linphone.BackEnd.OutOfProcess;
using Linphone.Core;
using Linphone.Core.OutOfProcess;
using System.Diagnostics;
using System.IO;
using System.Xml.Serialization;
......@@ -36,7 +36,7 @@ namespace Linphone.Agents
String callerName = "", callerNumber = "";
Debug.WriteLine("[{0}] Incoming call from caller {1}, number {2}", "KeepAliveAgent", callerName, callerNumber);
bool incomingCallProcessingStarted = BackEnd.Globals.Instance.CallController.OnIncomingCallReceived(callerName, "+33609668573", this.OnIncomingCallViewDismissed);
bool incomingCallProcessingStarted = Globals.Instance.CallController.OnIncomingCallReceived(callerName, "+33609668573", this.OnIncomingCallViewDismissed);
if (!incomingCallProcessingStarted)
{
......
//------------------------------------------------------------------------------
// <auto-generated>
// Ce code a été généré par un outil.
// Version du runtime :4.0.30319.18010
// Version du runtime :4.0.30319.18033
//
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
// le code est régénéré.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Linphone.BackEnd.OutOfProcess {
namespace Linphone.Core.OutOfProcess {
internal sealed class RegistrationHelper {
internal static string[] OutOfProcServerClassNames = new string[] {
"Linphone.BackEnd.OutOfProcess.Server"};
"Linphone.Core.OutOfProcess.Server"};
}
}
......@@ -2,7 +2,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
// A mutex used to protect objects accessible from the API surface exposed by this DLL
std::recursive_mutex g_apiLock;
......
......@@ -3,7 +3,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
// A mutex used to protect objects accessible from the API surface exposed by this DLL
extern std::recursive_mutex g_apiLock;
......
#include "CallController.h"
#include "Server.h"
using namespace Linphone::BackEnd;
using namespace Linphone::Core;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Phone::Networking::Voip;
......@@ -57,7 +57,6 @@ void CallController::OnAcceptCallRequested(VoipPhoneCall^ incomingCall, CallAnsw
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
incomingCall->NotifyCallActive();
this->currentCall = incomingCall;
if (this->onIncomingCallViewDismissed != nullptr)
this->onIncomingCallViewDismissed();
......@@ -78,28 +77,20 @@ void CallController::OnRejectCallRequested(VoipPhoneCall^ incomingCall, CallReje
this->callerNumber = nullptr;
}
void CallController::EndCurrentCall()
void CallController::EndCall(VoipPhoneCall^ call)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
if (this->currentCall == nullptr)
return;
this->currentCall->NotifyCallEnded();
call->NotifyCallEnded();
if (this->callControllerListener != nullptr)
this->callControllerListener->CallEnded();
this->currentCall = nullptr;
}
Platform::Boolean CallController::NewOutgoingCall(Platform::String^ number, Platform::String^ name)
VoipPhoneCall^ CallController::NewOutgoingCall(Platform::String^ number, Platform::String^ name)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
if (this->currentCall != nullptr)
return false;
VoipPhoneCall^ outgoingCall = nullptr;
this->callCoordinator->RequestNewOutgoingCall(
......@@ -110,13 +101,12 @@ Platform::Boolean CallController::NewOutgoingCall(Platform::String^ number, Plat
&outgoingCall);
outgoingCall->NotifyCallActive();
this->currentCall = outgoingCall;
this->callerNumber = number;
if (this->callControllerListener != nullptr)
this->callControllerListener->NewCallStarted(number);
return true;
return outgoingCall;
}
CallController::CallController() :
......
......@@ -6,7 +6,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
ref class Globals;
......@@ -23,13 +23,13 @@ namespace Linphone
// Returns true if the incoming call processing was started, false otherwise.
bool OnIncomingCallReceived(Platform::String^ contactName, Platform::String^ contactNumber, IncomingCallViewDismissedCallback^ incomingCallViewDismissedCallback);
void EndCurrentCall();
void EndCall(Windows::Phone::Networking::Voip::VoipPhoneCall^ call);
Platform::Boolean NewOutgoingCall(Platform::String^ number, Platform::String^ name);
Windows::Phone::Networking::Voip::VoipPhoneCall^ NewOutgoingCall(Platform::String^ number, Platform::String^ name);
void SetCallControllerListener(CallControllerListener^ listener);
private:
friend ref class Linphone::BackEnd::Globals;
friend ref class Linphone::Core::Globals;
CallControllerListener^ callControllerListener;
......@@ -52,8 +52,6 @@ namespace Linphone
IncomingCallViewDismissedCallback^ onIncomingCallViewDismissed;
Windows::Phone::Networking::Voip::VoipPhoneCall^ currentCall;
// Called by the VoipCallCoordinator when the user accepts an incoming call.
void OnAcceptCallRequested(Windows::Phone::Networking::Voip::VoipPhoneCall^ sender, Windows::Phone::Networking::Voip::CallAnswerEventArgs^ args);
......
......@@ -2,7 +2,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
public interface class CallControllerListener
{
......
......@@ -2,7 +2,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
public enum class CallDirection : int
{
......
......@@ -12,14 +12,14 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{c8d75245-ffcf-4932-a228-c9cc8bb60b03}</ProjectGuid>
<RootNamespace>Linphone.BackEnd</RootNamespace>
<RootNamespace>Linphone.Core</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and '$(VisualStudioVersion)' == ''">$(VCTargetsPath11)</VCTargetsPath>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<TargetPlatformIdentifier>Windows Phone</TargetPlatformIdentifier>
<TargetPlatformVersion>8.0</TargetPlatformVersion>
<WinMDAssembly>true</WinMDAssembly>
<ProjectName>BackEnd</ProjectName>
<ProjectName>Core</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
......
......@@ -9,7 +9,7 @@
#include "LinphoneCoreFactory.h"
#include "LinphoneCore.h"
using namespace Linphone::BackEnd;
using namespace Linphone::Core;
using namespace Windows::Foundation;
using namespace Windows::Phone::Media::Capture;
......@@ -134,7 +134,7 @@ CallController^ Globals::CallController::get()
if (this->callController == nullptr)
{
this->callController = ref new Linphone::BackEnd::CallController();
this->callController = ref new Linphone::Core::CallController();
}
}
......@@ -150,7 +150,7 @@ LinphoneCoreFactory^ Globals::LinphoneCoreFactory::get()
if (this->linphoneCoreFactory == nullptr)
{
this->linphoneCoreFactory = ref new Linphone::BackEnd::LinphoneCoreFactory();
this->linphoneCoreFactory = ref new Linphone::Core::LinphoneCoreFactory();
}
}
......@@ -205,7 +205,7 @@ Globals::Globals() :
}
// Initialize the call controller
this->callController = ref new Linphone::BackEnd::CallController();
this->callController = ref new Linphone::Core::CallController();
}
Globals::~Globals()
......
......@@ -4,7 +4,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
ref class CallController;
ref class LinphoneCoreFactory;
......@@ -32,19 +32,19 @@ namespace Linphone
Globals^ get();
}
property Linphone::BackEnd::CallController^ CallController
property CallController^ CallController
{
Linphone::BackEnd::CallController^ get();
Linphone::Core::CallController^ get();
}
property Linphone::BackEnd::LinphoneCoreFactory^ LinphoneCoreFactory
property LinphoneCoreFactory^ LinphoneCoreFactory
{
Linphone::BackEnd::LinphoneCoreFactory^ get();
Linphone::Core::LinphoneCoreFactory^ get();
}
property Linphone::BackEnd::LinphoneCore^ LinphoneCore
property LinphoneCore^ LinphoneCore
{
Linphone::BackEnd::LinphoneCore^ get();
Linphone::Core::LinphoneCore^ get();
}
private:
......@@ -73,9 +73,9 @@ namespace Linphone
// An event that indicates that the background process is ready
HANDLE backgroundReadyEvent;
Linphone::BackEnd::CallController^ callController;
Linphone::Core::CallController^ callController;
Linphone::BackEnd::LinphoneCoreFactory^ linphoneCoreFactory;
Linphone::Core::LinphoneCoreFactory^ linphoneCoreFactory;
};
}
}
#include "LinphoneAddress.h"
#include "Server.h"
using namespace Linphone::BackEnd;
using namespace Linphone::Core;
Platform::String^ LinphoneAddress::GetDisplayName()
{
......
......@@ -2,7 +2,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
public ref class LinphoneAddress sealed
{
......
#include "LinphoneAuthInfo.h"
#include "Server.h"
using namespace Linphone::BackEnd;
using namespace Linphone::Core;
Platform::String^ LinphoneAuthInfo::GetUsername()
{
......
......@@ -2,7 +2,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
public ref class LinphoneAuthInfo sealed
{
......
......@@ -6,7 +6,7 @@
#include "LinphoneCallParams.h"
#include "Server.h"
using namespace Linphone::BackEnd;
using namespace Linphone::Core;
LinphoneCallState LinphoneCall::GetState()
{
......@@ -112,3 +112,13 @@ Platform::String^ LinphoneCall::GetRemoteContact()
{
return nullptr;
}
void LinphoneCall::UserPointer::set(Platform::Object^ up)
{
this->userPointer = up;
}
Platform::Object^ LinphoneCall::UserPointer::get()
{
return this->userPointer;
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
ref class LinphoneAddress;
ref class LinphoneCallLog;
......@@ -61,6 +61,15 @@ namespace Linphone
float GetPlayVolume();
Platform::String^ GetRemoteUserAgent();
Platform::String^ GetRemoteContact();
property Platform::Object^ UserPointer
{
Platform::Object^ get();
void set(Platform::Object^ up);
}
private:
Platform::Object^ userPointer;
};
}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
#include "CallDirection.h"
#include "Server.h"
using namespace Linphone::BackEnd;
using namespace Linphone::Core;
LinphoneAddress^ LinphoneCallLog::GetFrom()
{
......
......@@ -4,7 +4,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
ref class LinphoneAddress;
......
......@@ -3,7 +3,7 @@
#include "PayloadType.h"
#include "Server.h"
using namespace Linphone::BackEnd;
using namespace Linphone::Core;
void LinphoneCallParams::SetAudioBandwidth()
{
......
......@@ -4,7 +4,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
ref class PayloadType;
......
#include "LinphoneCallStats.h"
#include "Server.h"
using namespace Linphone::BackEnd;
using namespace Linphone::Core;
MediaType LinphoneCallStats::GetMediaType()
{
......
......@@ -2,7 +2,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
public enum class MediaType : int
{
......
......@@ -10,7 +10,7 @@
#include "Server.h"
#include "CallController.h"
using namespace Linphone::BackEnd;
using namespace Linphone::Core;
using namespace Platform;
Transports::Transports()
......
......@@ -4,7 +4,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
ref class LinphoneCoreFactory;
ref class LinphoneProxyConfig;
......@@ -217,7 +217,7 @@ namespace Linphone
LpConfig^ GetConfig();
private:
friend ref class Linphone::BackEnd::LinphoneCoreFactory;
friend ref class Linphone::Core::LinphoneCoreFactory;
LinphoneCore();
~LinphoneCore();
......
......@@ -3,7 +3,7 @@
#include "LinphoneCoreListener.h"
#include "Server.h"
using namespace Linphone::BackEnd;
using namespace Linphone::Core;
void LinphoneCoreFactory::SetDebugMode(Platform::Boolean enable, Platform::String^ tag)
{
......@@ -13,13 +13,13 @@ void LinphoneCoreFactory::SetDebugMode(Platform::Boolean enable, Platform::Strin
void LinphoneCoreFactory::CreateLinphoneCore(LinphoneCoreListener^ listener, Platform::String^ userConfig, Platform::String^ factoryConfig, Platform::Object^ userData)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
this->linphoneCore = ref new Linphone::BackEnd::LinphoneCore();
this->linphoneCore = ref new Linphone::Core::LinphoneCore();
}
void LinphoneCoreFactory::CreateLinphoneCore(LinphoneCoreListener^ listener)
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
this->linphoneCore = ref new Linphone::BackEnd::LinphoneCore();
this->linphoneCore = ref new Linphone::Core::LinphoneCore();
}
LinphoneAuthInfo^ LinphoneCoreFactory::CreateAuthInfo(Platform::String^ username, Platform::String^ password, Platform::String^ realm)
......
......@@ -5,7 +5,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
ref class Globals;
ref class LinphoneCore;
......@@ -15,9 +15,9 @@ namespace Linphone
public ref class LinphoneCoreFactory sealed
{
public:
property Linphone::BackEnd::LinphoneCore^ LinphoneCore
property LinphoneCore^ LinphoneCore
{
Linphone::BackEnd::LinphoneCore^ get();
Linphone::Core::LinphoneCore^ get();
}
void SetDebugMode(Platform::Boolean enable, Platform::String^ tag);
......@@ -31,9 +31,9 @@ namespace Linphone
LinphoneAddress^ CreateLinphoneAddress(Platform::String^ address);
private:
friend ref class Linphone::BackEnd::Globals;
friend ref class Linphone::Core::Globals;
Linphone::BackEnd::LinphoneCore^ linphoneCore;
Linphone::Core::LinphoneCore^ linphoneCore;
LinphoneCoreFactory();
~LinphoneCoreFactory();
......
......@@ -5,7 +5,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
public interface class LinphoneCoreListener
{
......
......@@ -2,7 +2,7 @@
#include "LinphoneCore.h"
#include "Server.h"
using namespace Linphone::BackEnd;
using namespace Linphone::Core;
void LinphoneProxyConfig::Edit()
{
......
......@@ -4,7 +4,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
public ref class LinphoneProxyConfig sealed
{
......
#include "LpConfig.h"
#include "Server.h"
using namespace Linphone::BackEnd;
using namespace Linphone::Core;
void LpConfig::SetInt(Platform::String^ section, Platform::String^ key, int value)
{
......
......@@ -2,7 +2,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
public ref class LpConfig sealed
{
......
......@@ -2,7 +2,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
public enum class OnlineStatus : int
{
......
#include "PayloadType.h"
#include "Server.h"
using namespace Linphone::BackEnd;
using namespace Linphone::Core;
Platform::String^ PayloadType::GetMime()
{
......
......@@ -2,7 +2,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
public ref class PayloadType sealed
{
......
......@@ -4,7 +4,7 @@
namespace Linphone
{
namespace BackEnd
namespace Core
{
namespace OutOfProcess
{
......@@ -23,7 +23,7 @@ namespace Linphone
property CallController^ CallController
{
Linphone::BackEnd::CallController^ get()
Linphone::Core::CallController^ get()
{
return Globals::Instance->CallController;
};
......@@ -31,7 +31,7 @@ namespace Linphone
property LinphoneCoreFactory^ LinphoneCoreFactory
{
Linphone::BackEnd::LinphoneCoreFactory^ get()
Linphone::Core::LinphoneCoreFactory^ get()
{
return Globals::Instance->LinphoneCoreFactory;
};
......@@ -39,7 +39,7 @@ namespace Linphone
property LinphoneCore^ LinphoneCore
{
Linphone::BackEnd::LinphoneCore^ get()
Linphone::Core::LinphoneCore^ get()
{
return Globals::Instance->LinphoneCore;
};
......
......@@ -20,12 +20,13 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{bbabeea1-494c-4618-96e3-399873a5558b}</ProjectGuid>
<RootNamespace>BackEndProxyStub</RootNamespace>
<RootNamespace>CoreProxyStub</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and '$(VisualStudioVersion)' == ''">$(VCTargetsPath11)</VCTargetsPath>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<TargetPlatformIdentifier>Windows Phone</TargetPlatformIdentifier>
<TargetPlatformVersion>8.0</TargetPlatformVersion>
<ProjectName>CoreProxyStub</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
......@@ -134,17 +135,17 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="dlldata.c" />
<ClCompile Include="Linphone.BackEnd.OutOfProcess_i.c" />
<ClCompile Include="Linphone.BackEnd.OutOfProcess_p.c" />
<ClCompile Include="Linphone.BackEnd_i.c" />
<ClCompile Include="Linphone.BackEnd_p.c" />
<ClCompile Include="Linphone.Core.OutOfProcess_i.c" />
<ClCompile Include="Linphone.Core.OutOfProcess_p.c" />
<ClCompile Include="Linphone.Core_i.c" />
<ClCompile Include="Linphone.Core_p.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Linphone.BackEnd.h" />
<ClInclude Include="Linphone.BackEnd.OutOfProcess.h" />
<ClInclude Include="Linphone.Core.h" />
<ClInclude Include="Linphone.Core.OutOfProcess.h" />
</ItemGroup>
<ItemGroup>
<None Include="BackEndProxyStub.def" />
<None Include="CoreProxyStub.def" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
......
......@@ -19,14 +19,14 @@
extern "C" {
#endif
EXTERN_PROXY_FILE( Linphone2EBackEnd )
EXTERN_PROXY_FILE( Linphone2EBackEnd2EOutOfProcess )
EXTERN_PROXY_FILE( Linphone2ECore )
EXTERN_PROXY_FILE( Linphone2ECore2EOutOfProcess )
PROXYFILE_LIST_START
/* Start of list */
REFERENCE_PROXY_FILE( Linphone2EBackEnd ),
REFERENCE_PROXY_FILE( Linphone2EBackEnd2EOutOfProcess ),
REFERENCE_PROXY_FILE( Linphone2ECore ),
REFERENCE_PROXY_FILE( Linphone2ECore2EOutOfProcess ),
/* End of list */
PROXYFILE_LIST_END
......
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Phone