CallController.h 3.08 KB
Newer Older
1
#pragma once
2

3
#include <windows.phone.networking.voip.h>
4
#include "CallControllerListener.h"
5 6 7 8
#include "ApiLock.h"

namespace Linphone
{
9
    namespace Core
10
    {
11 12 13 14
        ref class Globals;
 
        // A method that is called back when the incoming call dialog has been dismissed. 
        // This callback is used to complete the incoming call agent. 
15
        public delegate void IncomingCallViewDismissedCallback(); 
16 17 18 19 20 21

        // 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:
22 23
			// Start processing an incoming call. Called by managed code in this process (the VoIP agent host process). 
            // Returns true if the incoming call processing was started, false otherwise. 
24
            bool OnIncomingCallReceived(Platform::String^ contactName, Platform::String^ contactNumber, IncomingCallViewDismissedCallback^ incomingCallViewDismissedCallback); 
25
 
26
			void EndCall(Windows::Phone::Networking::Voip::VoipPhoneCall^ call);
27

28
			Windows::Phone::Networking::Voip::VoipPhoneCall^ NewOutgoingCall(Platform::String^ number, Platform::String^ name);
29

30
			void SetCallControllerListener(CallControllerListener^ listener);
31
        private:
32
            friend ref class Linphone::Core::Globals;
33 34

			CallControllerListener^ callControllerListener;
35
 
36
            Platform::String^ voipServiceName; 
37 38

			Platform::String^ callerNumber;
39 40
			
            // The relative URI to the call-in-progress page 
41
            Platform::String^ callInProgressPageUri; 
42 43 44 45 46 47 48 49 50
			
            // The URI to the contact image, jpg or png, 1mb max ! 
            Windows::Foundation::Uri^ defaultContactImageUri; 
 
            // The URI to the linphone icon, 128kb max ! 
            Windows::Foundation::Uri^ linphoneImageUri; 

            Windows::Foundation::Uri^ ringtoneUri; 

51 52
            Windows::Phone::Networking::Voip::VoipCallCoordinator^ callCoordinator; 

53 54
			IncomingCallViewDismissedCallback^ onIncomingCallViewDismissed;

55 56 57 58 59
			 // 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); 
 
            // Called by the VoipCallCoordinator when the user rejects an incoming call. 
            void OnRejectCallRequested(Windows::Phone::Networking::Voip::VoipPhoneCall^ sender, Windows::Phone::Networking::Voip::CallRejectEventArgs^ args); 
60
 
61 62
            Windows::Foundation::TypedEventHandler<Windows::Phone::Networking::Voip::VoipPhoneCall^, Windows::Phone::Networking::Voip::CallAnswerEventArgs^>^ acceptCallRequestedHandler; 
            Windows::Foundation::TypedEventHandler<Windows::Phone::Networking::Voip::VoipPhoneCall^, Windows::Phone::Networking::Voip::CallRejectEventArgs^>^ rejectCallRequestedHandler; 
63 64 65 66 67 68
            
            CallController();
            ~CallController();
        };
    }
}