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

VoIP App structure complete

parent f291c39c
Linphone/Bin/
Linphone/obj/
Linphone/*/Thumbs.db
\ No newline at end of file
*/Bin/
*/obj/
*/*/Thumbs.db
*/ARM/
*/x86/
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.20506</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{27439D4F-29EF-48D7-8F2D-76F64BAAE175}</ProjectGuid>
<ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Linphone.Agents</RootNamespace>
<AssemblyName>Linphone.Agents</AssemblyName>
<TargetFrameworkIdentifier>WindowsPhone</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
<SilverlightApplication>false</SilverlightApplication>
<ValidateXaml>true</ValidateXaml>
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<BackgroundAgentType>AgentLibrary</BackgroundAgentType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Bin\Debug</OutputPath>
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Bin\Release</OutputPath>
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Bin\x86\Debug</OutputPath>
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Bin\x86\Release</OutputPath>
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Bin\ARM\Debug</OutputPath>
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Bin\ARM\Release</OutputPath>
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="LinphoneCallInProgressAgent.cs" />
<Compile Include="LinphoneForegroundLifeTimeAgent.cs" />
<Compile Include="LinphoneScheduledAgent.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RegistrationHelper.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BackEnd\BackEnd.vcxproj">
<Project>{C8D75245-FFCF-4932-A228-C9CC8BB60B03}</Project>
<Name>BackEnd</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
<ProjectExtensions />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{C089C8C0-30E0-4E22-80C0-CE093F111A43}">
<SilverlightMobileCSProjectFlavor>
<FullDeploy>True</FullDeploy>
<DebuggerType>Managed</DebuggerType>
<Tombstone>False</Tombstone>
</SilverlightMobileCSProjectFlavor>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>
\ No newline at end of file
using Microsoft.Phone.Networking.Voip;
using System.Diagnostics;
namespace Linphone.Agents
{
public class LinphoneCallInProgressAgent : VoipCallInProgressAgent
{
public LinphoneCallInProgressAgent() : base()
{
}
protected override void OnFirstCallStarting()
{
Debug.WriteLine("[LinphoneCallInProgressAgent] The first call has started.");
}
protected override void OnCancel()
{
Debug.WriteLine("[LinphoneCallInProgressAgent] The last call has ended. Calling NotifyComplete");
base.NotifyComplete();
}
}
using Microsoft.Phone.Networking.Voip;
using Linphone.BackEnd;
using Linphone.BackEnd.OutOfProcess;
using System.Diagnostics;
namespace Linphone.Agents
{
public class LinphoneCallInProgressAgent : VoipCallInProgressAgent
{
public LinphoneCallInProgressAgent() : base()
{
Globals.Instance.StartServer(RegistrationHelper.OutOfProcServerClassNames);
}
protected override void OnFirstCallStarting()
{
Debug.WriteLine("[LinphoneCallInProgressAgent] The first call has started.");
}
protected override void OnCancel()
{
Debug.WriteLine("[LinphoneCallInProgressAgent] The last call has ended. Calling NotifyComplete");
base.NotifyComplete();
}
}
}
\ No newline at end of file
using Microsoft.Phone.Networking.Voip;
using System.Diagnostics;
namespace Linphone.Agents
{
public class LinphoneForegroundLifeTimeAgent : VoipForegroundLifetimeAgent
{
public LinphoneForegroundLifeTimeAgent() : base()
{
}
protected override void OnLaunched()
{
Debug.WriteLine("[LinphoneForegroundLifeTimeAgent] The UI has entered the foreground.");
}
protected override void OnCancel()
{
Debug.WriteLine("[LinphoneForegroundLifeTimeAgent] The UI is leaving the foreground");
base.NotifyComplete();
}
}
using Microsoft.Phone.Networking.Voip;
using System.Diagnostics;
using Linphone.BackEnd;
using System.Threading;
using Linphone.BackEnd.OutOfProcess;
namespace Linphone.Agents
{
public class LinphoneForegroundLifeTimeAgent : VoipForegroundLifetimeAgent
{
public LinphoneForegroundLifeTimeAgent() : base()
{
}
protected override void OnLaunched()
{
Debug.WriteLine("[LinphoneForegroundLifeTimeAgent] The UI has entered the foreground.");
Globals.Instance.StartServer(RegistrationHelper.OutOfProcServerClassNames);
}
protected override void OnCancel()
{
Debug.WriteLine("[LinphoneForegroundLifeTimeAgent] The UI is leaving the foreground");
uint currentProcessId = Globals.GetCurrentProcessId();
string backgroundProcessReadyEventName = Globals.GetBackgroundProcessReadyEventName(currentProcessId);
using (EventWaitHandle backgroundProcessReadyEvent = new EventWaitHandle(initialState: false, mode: EventResetMode.ManualReset, name: backgroundProcessReadyEventName))
{
backgroundProcessReadyEvent.WaitOne();
Debug.WriteLine("[LinphoneForegroundLifeTimeAgent] Background process {0} is ready", currentProcessId);
}
base.NotifyComplete();
}
}
}
\ No newline at end of file
using Microsoft.Phone.Networking.Voip;
using Microsoft.Phone.Scheduler;
using System.Diagnostics;
namespace Linphone.Agents
{
class LinphoneScheduledAgent : ScheduledTaskAgent
{
// Indicates if this agent instance is handling an incoming call or not
private bool isIncomingCallAgent;
// Strings used in tracing
private const string keepAliveAgentId = "KeepAliveAgent";
private const string incomingCallAgentId = "IncomingCallAgent";
public LinphoneScheduledAgent()
{
}
protected override void OnInvoke(ScheduledTask task)
{
Debug.WriteLine("[LinphoneScheduledAgent] ScheduledAgentImpl has been invoked with argument of type {0}.", task.GetType());
VoipHttpIncomingCallTask incomingCallTask = task as VoipHttpIncomingCallTask;
if (incomingCallTask != null)
{
isIncomingCallAgent = true;
}
else
{
VoipKeepAliveTask keepAliveTask = task as VoipKeepAliveTask;
if (keepAliveTask != null)
{
isIncomingCallAgent = false;
}
}
}
protected override void OnCancel()
{
Debug.WriteLine("[{0}] Cancel requested.", this.isIncomingCallAgent ? LinphoneScheduledAgent.incomingCallAgentId : LinphoneScheduledAgent.keepAliveAgentId);
base.NotifyComplete();
}
}
}
using Microsoft.Phone.Networking.Voip;
using Microsoft.Phone.Scheduler;
using Linphone.BackEnd;
using Linphone.BackEnd.OutOfProcess;
using System.Diagnostics;
namespace Linphone
{
class LinphoneScheduledAgent : ScheduledTaskAgent
{
// Indicates if this agent instance is handling an incoming call or not
private bool isIncomingCallAgent;
// Strings used in tracing
private const string keepAliveAgentId = "KeepAliveAgent";
private const string incomingCallAgentId = "IncomingCallAgent";
public LinphoneScheduledAgent()
{
}
protected override void OnInvoke(ScheduledTask task)
{
Debug.WriteLine("[LinphoneScheduledAgent] ScheduledAgentImpl has been invoked with argument of type {0}.", task.GetType());
Globals.Instance.StartServer(RegistrationHelper.OutOfProcServerClassNames);
VoipHttpIncomingCallTask incomingCallTask = task as VoipHttpIncomingCallTask;
if (incomingCallTask != null)
{
isIncomingCallAgent = true;
}
else
{
VoipKeepAliveTask keepAliveTask = task as VoipKeepAliveTask;
if (keepAliveTask != null)
{
isIncomingCallAgent = false;
}
}
}
private void OnIncomingCallDialogDismissed()
{
Debug.WriteLine("[IncomingCallAgent] Incoming call processing is now complete.");
base.NotifyComplete();
}
protected override void OnCancel()
{
Debug.WriteLine("[{0}] Cancel requested.", this.isIncomingCallAgent ? LinphoneScheduledAgent.incomingCallAgentId : LinphoneScheduledAgent.keepAliveAgentId);
base.NotifyComplete();
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Resources;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Agents")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Agents")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("27439d4f-29ef-48d7-8f2d-76f64baae175")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]
//------------------------------------------------------------------------------
// <auto-generated>
// Ce code a été généré par un outil.
// Version du runtime :4.0.30319.18010
//
// 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 {
internal sealed class RegistrationHelper {
internal static string[] OutOfProcServerClassNames = new string[] {
"Linphone.BackEnd.OutOfProcess.Server"};
}
}
#include "ApiLock.h"
namespace Linphone
{
namespace BackEnd
{
// A mutex used to protect objects accessible from the API surface exposed by this DLL
std::recursive_mutex g_apiLock;
}
}
#pragma once
#include <mutex>
namespace Linphone
{
namespace BackEnd
{
// A mutex used to protect objects accessible from the API surface exposed by this DLL
extern std::recursive_mutex g_apiLock;
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{c8d75245-ffcf-4932-a228-c9cc8bb60b03}</ProjectGuid>
<RootNamespace>Linphone.BackEnd</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>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110_wp80</PlatformToolset>
<MidlEnv>arm32</MidlEnv>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_wp80</PlatformToolset>
<MidlEnv>arm32</MidlEnv>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<TargetName>$(RootNamespace)</TargetName>
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
<OutDir>$(SolutionDir)$(PlatformTarget)\$(Configuration)\$(MSBuildProjectName)\</OutDir>
<IntDir>$(PlatformTarget)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<TargetName>$(RootNamespace)</TargetName>
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
<OutDir>$(SolutionDir)$(PlatformTarget)\$(Configuration)\$(MSBuildProjectName)\</OutDir>
<IntDir>$(PlatformTarget)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<PreprocessorDefinitions>_WINRT_DLL;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<PreprocessorDefinitions>_WINRT_DLL;WIN32_LEAN_AND_MEAN;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</CompileAsWinRT>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<AdditionalDependencies>windowsphonecore.lib;runtimeobject.lib;PhoneAudioSes.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>ole32.lib</IgnoreSpecificDefaultLibraries>
<GenerateWindowsMetadata Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</GenerateWindowsMetadata>
<GenerateWindowsMetadata Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</GenerateWindowsMetadata>
</Link>
<CustomBuildStep>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
pushd "$(OutDir)"
WinMdIdl.exe "$(OutDir)$(RootNamespace).winmd"
MIdl.exe /env $(MidlEnv) /winrt /ns_prefix /metadata_dir "$(FrameworkSdkDir)Windows Metadata" /out "$(SolutionDir)$(ProjectName)ProxyStub" "$(OutDir)$(RootNamespace).idl"
MIdl.exe /env $(MidlEnv) /winrt /ns_prefix /metadata_dir "$(FrameworkSdkDir)Windows Metadata" /out "$(SolutionDir)$(ProjectName)ProxyStub" "$(OutDir)$(RootNamespace).OutOfProcess.idl"
"$(ProjectDir)OopServerRegistrationHelper.exe" /winmd:"$(OutDir)$(RootNamespace).winmd" /dll_name:$(TargetName) /namespace:$(RootNamespace).OutOfProcess /app_manifest:"$(SolutionDir)Linphone\Properties\WMAppManifest.xml" /helper_dir:"$(SolutionDir)Agents"
popd</Command>
</CustomBuildStep>
<CustomBuildStep>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">$(OutDir)$(RootNamespace).idl;$(OutDir)$(RootNamespace).OutOfProcess.idl;$(SolutionDir)$(ProjectName)ProxyStub\dlldata.c;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace)_i.c;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace)_p.c;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace).h;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace).OutOfProcess.h;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace).OutOfProcess_i.c;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace).OutOfProcess_p.c;$(SolutionDir)Agents\RegistrationHelper.cs;%(Outputs)</Outputs>
</CustomBuildStep>
<CustomBuildStep>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
pushd "$(OutDir)"
WinMdIdl.exe "$(OutDir)$(RootNamespace).winmd"
MIdl.exe /env $(MidlEnv) /winrt /ns_prefix /metadata_dir "$(FrameworkSdkDir)Windows Metadata" /out "$(SolutionDir)$(ProjectName)ProxyStub" "$(OutDir)$(RootNamespace).idl"
MIdl.exe /env $(MidlEnv) /winrt /ns_prefix /metadata_dir "$(FrameworkSdkDir)Windows Metadata" /out "$(SolutionDir)$(ProjectName)ProxyStub" "$(OutDir)$(RootNamespace).OutOfProcess.idl"
"$(ProjectDir)OopServerRegistrationHelper.exe" /winmd:"$(OutDir)$(RootNamespace).winmd" /dll_name:$(TargetName) /namespace:$(RootNamespace).OutOfProcess /app_manifest:"$(SolutionDir)Linphone\Properties\WMAppManifest.xml" /helper_dir:"$(SolutionDir)Agents"
popd</Command>
</CustomBuildStep>
<CustomBuildStep>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">$(OutDir)$(RootNamespace).idl;$(OutDir)$(RootNamespace).OutOfProcess.idl;$(SolutionDir)$(ProjectName)ProxyStub\dlldata.c;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace)_i.c;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace)_p.c;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace).h;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace).OutOfProcess.h;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace).OutOfProcess_i.c;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace).OutOfProcess_p.c;$(SolutionDir)Agents\RegistrationHelper.cs;%(Outputs)</Outputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemGroup>
<Reference Include="Windows">
<IsWinMDFile>true</IsWinMDFile>
</Reference>
<Reference Include="platform.winmd">
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="ApiLock.h" />
<ClInclude Include="CallController.h" />
<ClInclude Include="Globals.h" />
<ClInclude Include="Server.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="ApiLock.cpp" />
<ClCompile Include="CallController.cpp" />
<ClCompile Include="Globals.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="OopServerRegistrationHelper.exe">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</DeploymentContent>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</DeploymentContent>
</None>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<FullDeploy>true</FullDeploy>
</PropertyGroup>
</Project>
\ No newline at end of file
#include "CallController.h"
#include "Server.h"
using namespace Linphone::BackEnd;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Phone::Media::Devices;
using namespace Windows::Phone::Networking::Voip;
CallController::CallController()
{
}
CallController::~CallController()
{
}
#pragma once
#include <windows.phone.networking.voip.h>
#include "ApiLock.h"
namespace Linphone
{
namespace BackEnd
{
// Forward declaration
ref class Globals;
// A class that provides methods and properties related to VoIP calls.
// It wraps Windows.Phone.Networking.Voip.VoipCallCoordinator, and provides app-specific call functionality.
public ref class CallController sealed
{
public:
private:
// Only the server can create an instance of this object
friend ref class Linphone::BackEnd::Globals;
// Constructor and destructor
CallController();
~CallController();
};
}
}
This diff is collapsed.
#pragma once
#include <roapi.h>
namespace Linphone
{
namespace BackEnd
{
// Forward declarations
ref class CallController;
// A singleton container that is used to hold other global singletons and background process-wide static state.
// Another purpose of this class is to start the out-of-process WinRT server, so that the UI process
// managed code can instantiate WinRT objects in this process.
public ref class Globals sealed
{
public:
// Start the out-of-process WinRT server, so that the UI process can instantiate WinRT objects in this process.
void StartServer(const Platform::Array<Platform::String^>^ outOfProcServerClassNames);
// Do some app-specific periodic tasks, to let the remote server know that this endpoint is still alive.
void DoPeriodicKeepAlive();
// Get the process id of the current process
static unsigned int GetCurrentProcessId();
// Get the name of the event that indicates if the UI is connected to the background process or not
static Platform::String^ GetUiDisconnectedEventName(unsigned int backgroundProcessId);
// Get the name of the event that indicates if the background process is ready or not
static Platform::String^ GetBackgroundProcessReadyEventName(unsigned int backgroundProcessId);
// Get the single instance of this class
static property Globals^ Instance
{
Globals^ get();
}
// Get the call controller singleton object
property Linphone::BackEnd::CallController^ CallController
{
Linphone::BackEnd::CallController^ get();
}
private:
// Default constructor
Globals();
// Destructor
~Globals();
// Name of the event that indicates if another instance of the VoIP background process exists or not
static const LPCWSTR noOtherBackgroundProcessEventName;
// Name of the event that indicates if the UI is connected to the background process or not
static const LPCWSTR uiDisconnectedEventName;
// Name of the event that indicates if the background process is ready or not
static const LPCWSTR backgroundProcessReadyEventName;
// The single instance of this class
static Globals^ singleton;
// Indicates if the out-of-process server has started or not
bool started;
// A cookie that is used to unregister remotely activatable objects in this process
RO_REGISTRATION_COOKIE serverRegistrationCookie;
// An event that indicates if another instance of the background process exists or not
HANDLE noOtherBackgroundProcessEvent;
// An event that indicates that the background process is ready
HANDLE backgroundReadyEvent;
// The call controller object
Linphone::BackEnd::CallController^ callController;
};
}
}
#pragma once
#include <windows.h>
#include "Globals.h"
namespace Linphone
{
namespace BackEnd
{
namespace OutOfProcess
{
// A remotely activatable class that is used by the UI process and managed code within
// the VoIP background process to get access to native objects that exist in the VoIP background process.
public ref class Server sealed
{