LinphoneCore.h 6.88 KB
Newer Older
1 2
#pragma once

3 4
#include "OnlineStatus.h"

5 6
namespace Linphone
{
7
	namespace Core
8
	{
9
		ref class LinphoneCoreFactory;
10 11 12 13 14 15 16 17
		ref class LinphoneProxyConfig;
		ref class LinphoneAuthInfo;
		ref class LinphoneAddress;
		ref class LinphoneCall;
		ref class LinphoneCallParams;
		ref class LinphoneCallLog;
		ref class PayloadType;
		ref class LpConfig;
18

19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
		public enum class GlobalState : int
		{
			GlobalOff = 0,
			GlobalStartup = 1,
			GlobalOn = 2,
			GlobalShutdown = 3
		};

		public enum class RegistrationState : int
		{
			RegistrationNone = 0,
			RegistrationInProgress = 1,
			RegistrationOk = 2,
			RegistrationCleared = 3,
			RegistrationFailed = 4
		};

		public enum class MediaEncryption : int
Sylvain Berfini's avatar
Sylvain Berfini committed
37
		{
38 39 40
			None = 0,
			SRTP = 1,
			ZRTP = 2
Sylvain Berfini's avatar
Sylvain Berfini committed
41 42
		};

43
		public enum class FirewallPolicy : int
44
		{
45 46 47 48
			NoFirewall = 0,
			UseNatAddress = 1,
			UseStun = 2,
			UseIce = 3
49 50
		};

51
		public enum class EcCalibratorStatus : int
52
		{
53 54 55 56
			InProgress = 0,
			Done = 1,
			Failed = 2,
			DoneNoEcho = 3
57 58 59
		};

		public ref class Transports sealed
60 61
		{
		public:
62 63
			Transports();
			Transports(Transports^ t);
64 65
			Platform::String^ ToString();

66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
			property int UDP
            {
                int get();
            }
			property int TCP
            {
                int get();
            }
			property int TLS
            {
                int get();
            }
		private:
			int udp;
			int tcp;
			int tls;
		};

		public ref class LinphoneCore sealed
		{
		public:
			void ClearProxyConfigs();
88 89 90
			void AddProxyConfig(LinphoneProxyConfig^ proxyCfg);
			void SetDefaultProxyConfig(LinphoneProxyConfig^ proxyCfg);
			LinphoneProxyConfig^ GetDefaultProxyConfig();
91
			Windows::Foundation::Collections::IVector<LinphoneProxyConfig^>^ GetProxyConfigList();
92 93

			void ClearAuthInfos();
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
			void AddAuthInfo(LinphoneAuthInfo^ info);
			
			void Iterate();
			void Destroy();

			LinphoneAddress^ InterpretURL(Platform::String^ destination);
			LinphoneCall^ Invite(Platform::String^ destination);
			LinphoneCall^ InviteAddress(LinphoneAddress^ to);
			LinphoneCall^ InviteAddressWithParams(LinphoneAddress^ destination, LinphoneCallParams^ params);
			void TerminateCall(LinphoneCall^ call);
			LinphoneCall^ GetCurrentCall();
			LinphoneAddress^ GetRemoteAddress();
			Platform::Boolean IsInCall();
			Platform::Boolean IsIncomingInvitePending();
			void AcceptCall(LinphoneCall^ call);
			void AcceptCallWithParams(LinphoneCall^ call, LinphoneCallParams^ params);
			void AcceptCallUpdate(LinphoneCall^ call, LinphoneCallParams^ params);
			void DeferCallUpdate(LinphoneCall^ call);
			void UpdateCall(LinphoneCall^ call, LinphoneCallParams^ params);
			LinphoneCallParams^ CreateDefaultCallParameters();

115
			Windows::Foundation::Collections::IVector<LinphoneCallLog^>^ GetCallLogs();
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
			void ClearCallLogs();
			void RemoveCallLog(LinphoneCallLog^ log);

			void SetNetworkReachable(Platform::Boolean isReachable);
			Platform::Boolean IsNetworkReachable();

			void SetPlaybackGain(float gain);
			float GetPlaybackGain();
			void SetPlayLevel(int level);
			int GetPlayLevel();
			void MuteMic(Platform::Boolean isMuted);
			Platform::Boolean IsMicMuted();
			void EnableSpeaker(Platform::Boolean enable);
			Platform::Boolean IsSpeakerEnabled();

			void SendDTMF(char16 number);
			void PlayDTMF(char16 number, int duration);
			void StopDTMF();

			PayloadType^ FindPayloadType(Platform::String^ mime, int clockRate, int channels);
			PayloadType^ FindPayloadType(Platform::String^ mime, int clockRate);
			void EnablePayloadType(PayloadType^ pt, Platform::Boolean enable);
			Windows::Foundation::Collections::IVector<PayloadType^>^ GetAudioCodecs();

			void EnableEchoCancellation(Platform::Boolean enable);
			Platform::Boolean IsEchoCancellationEnabled();
			Platform::Boolean IsEchoLimiterEnabled();
			void StartEchoCalibration(Platform::Object^ data);
			void EnableEchoLimiter(Platform::Boolean enable);

			void SetSignalingTransportsPorts(Transports^ transports);
			Transports^ GetSignalingTransportsPorts();
			void EnableIPv6(Platform::Boolean enable);

150
			void SetPresenceInfo(int minuteAway, Platform::String^ alternativeContact, OnlineStatus status);
151 152 153 154

			void SetStunServer(Platform::String^ stun);
			Platform::String^ GetStunServer();

155 156
			void SetFirewallPolicy(FirewallPolicy policy);
			FirewallPolicy GetFirewallPolicy();
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188

			void SetRootCA(Platform::String^ path);
			void SetUploadBandwidth(int bw);
			void SetDownloadBandwidth(int bw);
			void SetDownloadPTime(int ptime);
			void SetUploadPTime(int ptime);

			void EnableKeepAlive(Platform::Boolean enable);
			Platform::Boolean IsKeepAliveEnabled();

			void SetPlayFile(Platform::String^ path);
			Platform::Boolean PauseCall(LinphoneCall^ call);
			Platform::Boolean ResumeCall(LinphoneCall^ call);
			Platform::Boolean PauseAllCalls();
			Platform::Boolean IsInConference();
			Platform::Boolean EnterConference();
			void LeaveConference();
			void AddToConference(LinphoneCall^ call);
			void AddAllToConference();
			void RemoveFromConference();
			void TerminateConference();
			int GetConferenceSize();
			void TerminateAllCalls();
			Windows::Foundation::Collections::IVector<LinphoneCall^>^ GetCalls();
			int GetCallsNb();
			LinphoneCall^ FindCallFromUri(Platform::String^ uri);
			int GetMaxCalls();
			void SetMaxCalls(int max);

			Platform::Boolean IsMyself(Platform::String^ uri);

			Platform::Boolean IsSoundResourcesLocked();
189 190 191
			Platform::Boolean IsMediaEncryptionSupported(MediaEncryption menc);
			void SetMediaEncryption(MediaEncryption menc);
			MediaEncryption GetMediaEncryption();
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
			void SetMediaEncryptionMandatory(Platform::Boolean yesno);
			Platform::Boolean IsMediaEncryptionMandatory();

			void EnableTunnel(Platform::Boolean enable);
			void TunnelAutoDetect();
			void TunnelCleanServers();
			void TunnelSetHttpProxy(Platform::String^ host, int port, Platform::String^ username, Platform::String^ password);
			void TunnelAddServerAndMirror(Platform::String^ host, int port, int udpMirrorPort, int roundTripDelay);
			Platform::Boolean IsTunnelAvailable();

			void SetUserAgent(Platform::String^ name, Platform::String^ version);
			void SetCPUCount(int count);
			int GetMissedCallsCount();
			void ResetMissedCallsCount();
			void RefreshRegisters();
			Platform::String^ GetVersion();

			void SetAudioPort(int port);
			void SetAudioPortRange(int minP, int maxP);
			void SetIncomingTimeout(int timeout);
			void SetInCallTimeout(int timeout);
			void SetMicrophoneGain(float gain);
			void SetPrimaryContact(Platform::String^ displayName, Platform::String^ userName);
			void SetUseSipInfoForDTMFs(Platform::Boolean use);
			void SetUseRFC2833ForDTMFs(Platform::Boolean use);
217

218
			LpConfig^ GetConfig();
219
		private:
220
			friend ref class Linphone::Core::LinphoneCoreFactory;
221

222
			LinphoneCore();
223 224 225 226
			~LinphoneCore();
		};
	}
}