= ~~Getting Started: Building for UWP and Windows Phone 8.x~~ =
**Moved to https://docs.pjsip.org/en/latest/get-started/windows-phone/build_instructions.html**
[[TracNav(Getting-Started/TOC)]]
[[PageOutline(2-3,,inline)]]
== Build Preparation ==
1. [wiki:Getting-Started/Download-Source Get the source code], if you haven't already. UWP and WP8 support is available since PJSIP 2.6.
1. '''It is important that you create a config_site.h as described in [wiki:Getting-Started/Build-Preparation Build Preparation]'''
{{{
#!comment
* Set your [wiki:Getting-Started/Build-Preparation config_site.h] to the following:
{{{
#define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0
#define PJMEDIA_AUDIO_DEV_HAS_WMME 0
#define PJMEDIA_AUDIO_DEV_HAS_WASAPI 1
}}}
}}}
== Requirements ==
=== Tools and SDKs ===
* Microsoft Visual Studio 2015 Update 3
* [https://dev.windows.com/en-us/downloads/windows-10-sdk UWP SDK] for UWP/Windows 10 target.
* [http://dev.windowsphone.com/en-us/downloadsdk Windows Phone 8 SDK] for Windows Phone 8 target.
* Configuring device for development:
- for Windows 10, follow the instructions [https://msdn.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development here]
- for Windows Phone 8.x, follow the instructions [http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff769508(v=vs.105).aspx here]
=== Host requirements ===
For the host, the following are required:
* Operating System type : 64-bit Windows 8 Professional or higher.
== Building and running the Projects ==
=== UWP ===
Follow the steps below to build the libraries and sample application using Visual Studio 2015:
1. Using any text editor, open {{{build\vs\pjproject-vs14-api-def.props}}} and set {{{API_Family}}} to '''UWP''', i.e:
{{{
...
UWP
...
}}}
Note: if {{{pjproject-vs14.sln}}} solution is opened, you need to close and reopen the solution after changing API family.
1. Open {{{pjproject-vs14.sln}}} solution file.
1. Set solution platform to:
- '''ARM''' to build for UWP/Windows 10 device
- '''Win32''' to build for emulator
1. Set '''Voip''' as Startup Project.
1. Build the project. This will build '''Voip''' application and all libraries needed by '''Voip'''.
1. Run
=== Windows Phone 8.x ===
Follow the steps below to build the libraries and sample application using Visual Studio 2015:
1. Using any text editor, open {{{build\vs\pjproject-vs14-api-def.props}}} and set {{{API_Family}}} to '''Winphone8''', i.e:
{{{
...
Winphone8
...
}}}
Note: if {{{pjproject-vs14.sln}}} solution is opened, you need to close and reopen the solution after changing API family.
1. Open {{{pjproject-vs14.sln}}} solution file.
1. Set '''ARM''' as the solution platform.
1. Set '''pjsua_cli_wp''' as Startup Project.
1. Build the project. This will build '''pjsua_cli_wp''' application and all libraries needed by '''pjsua_cli_wp'''.
1. Run/deploy the '''pjsua_cli_wp''' application on a registered Windows phone device.
1. You will see telnet instructions on the device's screen. Telnet to this address to operate the application. See [wiki:PJSUA-CLI PJSUA CLI Manual] for command reference.
== Debugging Application ==
To Debug native(C/C++) part of the application:
* Set the '''Debugger type''' of project properties [Debug menu] to '''Native Only'''.
To Debug managed(C#) part of the application:
* Set the '''Debugger type''' of project properties [Debug menu] to '''Managed Only'''.
=== Assert Problem on Debugging Native Code ===
As described [http://blogs.msdn.com/b/andypennell/archive/2013/06/17/native-code-on-windows-phone-8-the-assert-problem.aspx here], assertion will cause process exiting (instead of just stopping). Adding the following code in the application would make process stopping on assertion:
{{{
#ifndef NDEBUG
signal(SIGABRT, [](int)
{
__debugbreak();
});
#endif
}}}
== Other References ==
* [http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206983%28v=vs.105%29.aspx VoIP apps for Windows Phone 8]
* Ticket #1900 about porting to Windows 10/UWP