-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathBackgroundTask.cpp
executable file
·44 lines (34 loc) · 1.53 KB
/
BackgroundTask.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "BackgroundTask.h"
#include "Globals.h"
#include "CallController.h"
using namespace PhoneVoIPApp::BackEnd;
using namespace Windows::ApplicationModel::Background;
using namespace Windows::Phone::Networking::Voip;
using namespace Windows::Foundation;
using namespace Platform;
using namespace Windows::Phone::Media::Devices;
BackgroundTask::BackgroundTask()
{
}
void BackgroundTask::Run(IBackgroundTaskInstance^ taskInstance){
return;
VoipCallCoordinator^ callCoordinator = Windows::Phone::Networking::Voip::VoipCallCoordinator::GetDefault();
Windows::Phone::Networking::Voip::VoipPhoneCall^ incomingCall;
String^ installFolder = String::Concat(Windows::ApplicationModel::Package::Current->InstalledLocation->Path, "\\");
TimeSpan timeout;
timeout.Duration = 90 * 10 * 1000 * 1000; // in 100ns units
callCoordinator->RequestNewIncomingCall(
ref new String(L"/Views/ShellView.xaml"),
ref new String(L"test contact"),
ref new String(L"test number"),
ref new Uri(installFolder, "Assets\\DefaultContactImage.png"),
ref new String(L"PhoneVoIPApp"),
ref new Uri(installFolder, "Assets\\ApplicationIcon.png"),
ref new String(L"call details"), // Was this call forwarded/delegated to this user on behalf of someone else? At this time, we won't use this field
ref new Uri(installFolder, "Assets\\Ringtone.wma"),
VoipCallMedia::Audio,
timeout, // Maximum amount of time to ring for
&incomingCall);
}
void BackgroundTask::IncomingCallDissmissed(){
}