Commit 076a255b authored by Ghislain MARY's avatar Ghislain MARY

Improve documentation and implement missing linphone core listeners.

parent 006ccb34
......@@ -10,10 +10,32 @@ namespace Linphone
ref class Globals;
class BackgroundModeLoggerPrivate;
/// <summary>
/// Object to log the application traces while in background mode.
/// It can log to several destinations:
/// - the debugger output (needs to run the application from Visual Studio)
/// - a file (stored in the Isolated Storage space of the application)
/// - remote computer using a TCP connection (needs an application to get the logs on the remote computer)
/// </summary>
public ref class BackgroundModeLogger sealed : OutputTraceListener
{
public:
/// <summary>
/// Method called to output a trace to the logs.
/// </summary>
/// <param name="level">The level of the trace to output</param>
/// <param name="msg">The message to ouput</param>
virtual void OutputTrace(OutputTraceLevel level, Platform::String^ msg);
/// <summary>
/// Configures the logger to enabled/disable logging and define the destination of the logs.
/// If dest is OutputTraceDest::Debugger, the option is useless and can be null.
/// If dest is OutputTraceDest::File, the option is the path of the file to write to.
/// If dest is OutputTraceDest::TCPRemote, the option is the host and port of the computer to send the logs to (e.g. "192.168.0.17:38954")
/// </summary>
/// <param name="enable">Tells whether to enable or disable logging</param>
/// <param name="dest">Tells the destination of the logs</param>
/// <param name="option">Aditional configuration parameter that depends on the configured destination</param>
void Configure(bool enable, OutputTraceDest dest, Platform::String^ option);
private:
......
......@@ -24,16 +24,24 @@ namespace Linphone
/// <summary>
/// Starts the system incoming call view.
/// </summary>
/// <param name="call">The incoming LinphoneCall to notify</param>
/// <param name="contactName">The display name of the caller</param>
/// <param name="contactNumber">The number or SIP URI of the caller</param>
/// <param name="incomingCallViewDismissedCallback">The callback to be called if the notified incoming call is dismissed by the user</param>
/// <returns>The system VoipPhoneCall that has been notified</returns>
Windows::Phone::Networking::Voip::VoipPhoneCall^ OnIncomingCallReceived(LinphoneCall^ call, Platform::String^ contactName, Platform::String^ contactNumber, IncomingCallViewDismissedCallback^ incomingCallViewDismissedCallback);
/// <summary>
/// Terminate the native VoipPhoneCall.
/// </summary>
/// <param name="call">The VoipPhoneCall to be terminated</param>
void EndCall(Windows::Phone::Networking::Voip::VoipPhoneCall^ call);
/// <summary>
/// Starts an outgoing call using native VoipPhoneCall.
/// </summary>
/// <param name="number">The number of SIP URI to call</param>
/// <returns>The system VoipPhoneCall that has been initiated</returns>
Windows::Phone::Networking::Voip::VoipPhoneCall^ NewOutgoingCall(Platform::String^ number);
/// <summary>
......
......@@ -4,6 +4,9 @@ namespace Linphone
{
namespace Core
{
/// <summary>
/// Presence statuses.
/// </summary>
public enum class OnlineStatus : int
{
Offline = 0,
......@@ -19,6 +22,9 @@ namespace Linphone
Pending = 10
};
/// <summary>
/// Direction of a call, either Outgoing or Incoming.
/// </summary>
public enum class CallDirection : int
{
Outgoing,
......@@ -48,6 +54,9 @@ namespace Linphone
RegistrationFailed = 4
};
/// <summary>
/// Types of media encryption.
/// </summary>
public enum class MediaEncryption : int
{
None = 0,
......@@ -55,6 +64,9 @@ namespace Linphone
ZRTP = 2
};
/// <summary>
/// Policy to use to work around the issues caused by NAT (Network Address Translation).
/// </summary>
public enum class FirewallPolicy : int
{
NoFirewall = 0,
......@@ -63,6 +75,9 @@ namespace Linphone
UseIce = 3
};
/// <summary>
/// Statuses of the echo canceller calibration process.
/// </summary>
public enum class EcCalibratorStatus : int
{
InProgress = 0,
......
......@@ -29,45 +29,74 @@ namespace Linphone
{
public:
/// <summary>
/// Human display name
/// Gets the human display name of the address.
/// For example for the "Alice &lt;sip:alice@example.net&gt;" URI, it will return "Alice".
/// </summary>
/// <returns>
/// an empty string if not set
/// </returns>
/// <returns>The human display name or an empty string if not set</returns>
Platform::String^ GetDisplayName();
/// <returns>
/// an empty string if not set
/// </returns>
/// <summary>
/// Gets the username part of the address.
/// For example for the "Alice &lt;sip:alice@example.net&gt;" URI, it will return "alice".
/// </summary>
/// <returns>The username part of the address or an empty string if not set</returns>
Platform::String^ GetUserName();
/// <returns>
/// an empty string if not set
/// </returns>
/// <summary>
/// Gets the domain part of the address.
/// For example for the "Alice &lt;sip:alice@example.net&gt;" URI, it will return "example.net".
/// </summary>
/// <returns>The domain part of the address or an empty string if not set</returns>
Platform::String^ GetDomain();
/// <summary>
/// Gets the port part of the address.
/// </summary>
/// <returns>The port part of the address or 0 if not set</returns>
int GetPort();
/// <summary>
/// Sets the human display name of the address.
/// </summary>
/// <param name="name">The human display name to set to the address</param>
void SetDisplayName(Platform::String^ name);
/// <summary>
/// Sets the username part of the address.
/// </summary>
/// <param name="username">The username to set to the address</param>
void SetUserName(Platform::String^ username);
/// <summary>
/// Sets the domain part of the address.
/// </summary>
/// <param name="domain">The domain to set to the address</param>
void SetDomain(Platform::String^ domain);
/// <summary>
/// Sets the port part of the address.
/// </summary>
/// <param name="port">The port to set to the address</param>
void SetPort(int port);
void Clean();
/// <returns>
/// the address as a string
/// </returns>
/// <summary>
/// Gets the string representation of the address.
/// </summary>
/// <returns>The address as a string</returns>
Platform::String^ AsString();
/// <returns>
/// the address without display name as a string
/// </returns>
/// <summary>
/// Gets the string representation of the URI part of the address (without the display name).
/// </summary>
/// <returns>The address without display name as a string</returns>
Platform::String^ AsStringUriOnly();
/// <summary>
/// Same as AsString.
/// </summary>
/// <seealso cref="AsString()" />
Platform::String^ ToString();
private:
......
......@@ -20,24 +20,64 @@ namespace Linphone
public ref class LinphoneAuthInfo sealed
{
public:
/// <summary>
/// Gets the authentication username.
/// </summary>
/// <returns>The authentication username</returns>
Platform::String^ GetUsername();
/// <summary>
/// Sets the authentication username.
/// </summary>
/// <param name="username">The authentication username</param>
void SetUsername(Platform::String^ username);
/// <summary>
/// Gets the authentication userid.
/// </summary>
/// <returns>The authentication userid</returns>
Platform::String^ GetUserId();
/// <summary>
/// Sets the authentication userid.
/// </summary>
/// <param name="userid">The authentication userid</param>
void SetUserId(Platform::String^ userid);
/// <summary>
/// Gets the authentication password.
/// </summary>
/// <returns>The authentication password</returns>
Platform::String^ GetPassword();
/// <summary>
/// Sets the authentication password.
/// </summary>
/// <param name="password">The authentication password</param>
void SetPassword(Platform::String^ password);
/// <summary>
/// Gets the authentication realm.
/// </summary>
/// <returns>The authentication realm</returns>
Platform::String^ GetRealm();
/// <summary>
/// Sets the authentication realm.
/// </summary>
/// <param name="realm">The authentication realm</param>
void SetRealm(Platform::String^ realm);
/// <summary>
/// Gets the authentication ha1.
/// </summary>
/// <returns>The authentication ha1</returns>
Platform::String^ GetHa1();
/// <summary>
/// Sets the authentication ha1.
/// </summary>
/// <param name="ha1">The authentication ha1</param>
void SetHa1(Platform::String^ ha1);
private:
......
......@@ -23,38 +23,74 @@ namespace Linphone
/// <summary>
/// Gets the LinphoneCallState of the call (StreamRunning, IncomingReceived, OutgoingProgress, ...).
/// </summary>
/// <returns>The LinphoneCallState of the call</returns>
LinphoneCallState GetState();
/// <summary>
/// Gets the remote LinphoneAddress.
/// </summary>
/// <returns>The remote address of the call</returns>
LinphoneAddress^ GetRemoteAddress();
/// <summary>
/// Returns the CallDirection (Outgoing or incoming).
/// </summary>
/// <returns>The direction of the call</returns>
CallDirection GetDirection();
/// <summary>
/// Gets the LinphoneCallLog associated with this call.
/// </summary>
/// <returns>The LinphoneCallLog associated with the call</returns>
LinphoneCallLog^ GetCallLog();
/// <summary>
/// Gets the audio stats associated with this call.
/// Gets the audio statistics associated with this call.
/// </summary>
/// <returns>The audio statistics associated with the call</returns>
LinphoneCallStats^ GetAudioStats();
/// <summary>
/// This is usefull for example to know if far end supports video or encryption.
/// Gets the call parameters given by the remote peer.
/// This is useful for example to know if far end supports video or encryption.
/// </summary>
/// <returns>The call parameters given by the remote peer</returns>
LinphoneCallParams^ GetRemoteParams();
/// <summary>
/// Gets a copy of the current local call parameters.
/// </summary>
/// <returns>A copy of the current local call parameters</returns>
LinphoneCallParams^ GetCurrentParamsCopy();
/// <summary>
/// Enable or disable the echo cancellation.
/// </summary>
/// <param name="enable">A boolean value telling whether to enable or to disable the echo cancellation</param>
void EnableEchoCancellation(Platform::Boolean enable);
/// <summary>
/// Tells whether echo cancellation is enabled or not.
/// </summary>
/// <returns>true if echo cancellation is enabled, false otherwise</returns>
Platform::Boolean IsEchoCancellationEnabled();
/// <summary>
/// Enable or disable the echo limiter.
/// </summary>
/// <param name="enable">A boolean value telling whether to enable or to disable the echo limiter</param>
void EnableEchoLimiter(Platform::Boolean enable);
/// <summary>
/// Tells whether echo limitation is enabled or not.
/// </summary>
/// <returns>true if echo limitation is enabled, false otherwise</returns>
Platform::Boolean IsEchoLimiterEnabled();
/// <summary>
/// Gets the current duration of the call in seconds.
/// </summary>
/// <returns>The current duration of the call in seconds</returns>
int GetDuration();
/// <summary>
......@@ -78,23 +114,20 @@ namespace Linphone
/// Returns call quality averaged over all the duration of the call.
/// See GetCurrentQuality for more details about quality mesurement.
/// </summary>
/// <returns>Average quality over all the duration of the call</returns>
float GetAverageQuality();
/// <summary>
/// Used by ZRTP encryption mechanism.
/// </summary>
/// <returns>
/// SAS associated to the main stream [voice].
/// </returns>
/// <returns>SAS associated to the main stream [voice]</returns>
Platform::String^ GetAuthenticationToken();
/// <summary>
/// Used by ZRTP mechanism.
/// SAS can verified manually by the user or automatically using a previously shared secret.
/// </summary>
/// <returns>
/// true if the main stream [voice] SAS was verified.
/// </returns>
/// <returns>true if the main stream [voice] SAS was verified</returns>
Platform::Boolean IsAuthenticationTokenVerified();
/// <summary>
......@@ -103,9 +136,29 @@ namespace Linphone
/// <param name="verified">true when displayed SAS is correct</param>
void SetAuthenticationTokenVerified(Platform::Boolean verified);
/// <summary>
/// Tells whether the call is in conference or not.
/// </summary>
/// <returns>A boolean value telling whether the call is in conference</returns>
Platform::Boolean IsInConference();
/// <summary>
/// Gets the measured sound volume played locally (received from remote).
/// It is expressed in dbm0.
/// </summary>
/// <returns>The play volume in dbm0.</returns>
float GetPlayVolume();
/// <summary>
/// Gets the far end's user agent description string, if available.
/// </summary>
/// <returns>The remote user agent as a string</returns>
Platform::String^ GetRemoteUserAgent();
/// <summary>
/// Gets the far end's sip contact as a string, if available.
/// </summary>
/// <returns>The remote sip contact as a string</returns>
Platform::String^ GetRemoteContact();
/// <summary>
......
......@@ -19,31 +19,37 @@ namespace Linphone
/// <summary>
/// Gets the LinphoneAddress of the caller.
/// </summary>
/// <returns>The address of the caller</returns>
LinphoneAddress^ GetFrom();
/// <summary>
/// Gets the LinphoneAddress of the callee.
/// </summary>
/// <returns>The address of the callee</returns>
LinphoneAddress^ GetTo();
/// <summary>
/// Gets the CallDirection of the call (Incoming or Outgoing).
/// </summary>
/// <returns>The direction of the call</returns>
CallDirection GetDirection();
/// <summary>
/// Gets the LinphoneCallStatus of the call (Success, Aborted, Missed or Declined).
/// </summary>
/// <returns>The status of the call</returns>
LinphoneCallStatus GetStatus();
/// <summary>
/// Returns the start date/time of the call in seconds elpsed since January first 1970.
/// </summary>
/// <returns>The start date/time of the call</returns>
int64 GetStartDate();
/// <summary>
/// Returns the call duration in seconds.
/// </summary>
/// <returns>The duration of the call in seconds</returns>
int GetCallDuration();
/// <summary>
......
......@@ -25,16 +25,19 @@ namespace Linphone
/// <summary>
/// Returns the MediaEncryption of the call (None, SRTP or ZRTP).
/// </summary>
/// <returns>The media encryption of the call</returns>
MediaEncryption GetMediaEncryption();
/// <summary>
/// Sets the MediaEncryption (None, SRTP or ZRTP).
/// </summary>
/// <param name="menc">The media encryption to use for the call</param>
void SetMediaEncryption(MediaEncryption menc);
/// <summary>
/// Returns the PayloadType currently in use for the audio stream.
/// </summary>
/// <returns>The payload type currently in use for the audio stream</returns>
PayloadType^ GetUsedAudioCodec();
/// <summary>
......@@ -43,12 +46,14 @@ namespace Linphone
/// Tyically, ptime (packetization time) will be increased, audio codecs's output bitrate will be targetted to 20kbits/s provided that it is achievable by the codec selected after SDP handshake.
/// Video is automatically disabled.
/// </summary>
/// <param name="enable">A boolean value telling whether to enable the low bandwidth mode</param>
void EnableLowBandwidth(Platform::Boolean enable);
/// <summary>
/// Gets if the low bandwidth mode is enabled.
/// See EnableLowBandwidth(boolean enable).
/// </summary>
/// <returns>A boolean value telling whether the low bandwidth mode is enabled or not</returns>
Platform::Boolean IsLowBandwidthEnabled();
private:
......
......@@ -84,19 +84,14 @@ Linphone::Core::LinphoneCallStats::LinphoneCallStats(::LinphoneCall *call, Linph
} else {
stats = linphone_call_get_video_stats(this->call);
}
this->mediaType = (Linphone::Core::MediaType) stats->type;
this->iceState = (Linphone::Core::IceState) stats->ice_state;
this->downloadBandwidth = stats->download_bandwidth;
this->uploadBandwidth = stats->upload_bandwidth;
this->senderLossRate = UpdateSenderLossRate(stats);
this->receiverLossRate = UpdateReceiverLossRate(stats);
this->senderInterarrivalJitter = UpdateSenderInterarrivalJitter(stats);
this->receiverInterarrivalJitter = UpdateReceiverInterarrivalJitter(stats);
this->roundTripDelay = stats->round_trip_delay;
this->cumulativeLatePackets = UpdateLatePacketsCumulativeNumber(stats);
this->jitterBufferSize = stats->jitter_stats.jitter_buffer_size_ms;
this->localLossRate = stats->local_loss_rate;
this->localLateRate = stats->local_late_rate;
FillStats(stats);
gApiLock.Unlock();
}
Linphone::Core::LinphoneCallStats::LinphoneCallStats(::LinphoneCallStats *callStats)
{
gApiLock.Lock();
FillStats(callStats);
gApiLock.Unlock();
}
......@@ -240,3 +235,20 @@ int64 Linphone::Core::LinphoneCallStats::UpdateLatePacketsCumulativeNumber(const
return rtp_stats.outoftime;
}
void Linphone::Core::LinphoneCallStats::FillStats(const ::LinphoneCallStats *stats)
{
this->mediaType = (Linphone::Core::MediaType) stats->type;
this->iceState = (Linphone::Core::IceState) stats->ice_state;
this->downloadBandwidth = stats->download_bandwidth;
this->uploadBandwidth = stats->upload_bandwidth;
this->senderLossRate = UpdateSenderLossRate(stats);
this->receiverLossRate = UpdateReceiverLossRate(stats);
this->senderInterarrivalJitter = UpdateSenderInterarrivalJitter(stats);
this->receiverInterarrivalJitter = UpdateReceiverInterarrivalJitter(stats);
this->roundTripDelay = stats->round_trip_delay;
this->cumulativeLatePackets = UpdateLatePacketsCumulativeNumber(stats);
this->jitterBufferSize = stats->jitter_stats.jitter_buffer_size_ms;
this->localLossRate = stats->local_loss_rate;
this->localLateRate = stats->local_late_rate;
}
\ No newline at end of file
......@@ -109,6 +109,7 @@ namespace Linphone
friend ref class Linphone::Core::LinphoneCore;
LinphoneCallStats(::LinphoneCall *call, Linphone::Core::MediaType mediaType);
LinphoneCallStats(::LinphoneCallStats *callStats);
~LinphoneCallStats();
float Linphone::Core::LinphoneCallStats::UpdateSenderLossRate(const ::LinphoneCallStats *stats);
......@@ -116,6 +117,7 @@ namespace Linphone
float Linphone::Core::LinphoneCallStats::UpdateSenderInterarrivalJitter(const ::LinphoneCallStats *stats);
float Linphone::Core::LinphoneCallStats::UpdateReceiverInterarrivalJitter(const ::LinphoneCallStats *stats);
int64 Linphone::Core::LinphoneCallStats::UpdateLatePacketsCumulativeNumber(const ::LinphoneCallStats *stats);
void Linphone::Core::LinphoneCallStats::FillStats(const ::LinphoneCallStats *stats);
::LinphoneCall *call;
MediaType mediaType;
......
......@@ -1127,8 +1127,7 @@ void call_state_changed(::LinphoneCore *lc, ::LinphoneCall *call, ::LinphoneCall
}
Linphone::Core::LinphoneCoreListener^ listener = Linphone::Core::Globals::Instance->LinphoneCore->CoreListener;
if (listener != nullptr)
{
if (listener != nullptr) {
listener->CallState(lCall, state);
}
Linphone::Core::gApiLock.LeaveListener();
......@@ -1138,8 +1137,7 @@ void registration_state_changed(::LinphoneCore *lc, ::LinphoneProxyConfig *cfg,
{
Linphone::Core::gApiLock.EnterListener();
Linphone::Core::LinphoneCoreListener^ listener = Linphone::Core::Globals::Instance->LinphoneCore->CoreListener;
if (listener != nullptr)
{
if (listener != nullptr) {
Linphone::Core::RegistrationState state = (Linphone::Core::RegistrationState) cstate;
Linphone::Core::RefToPtrProxy<Linphone::Core::LinphoneProxyConfig^> *proxy = reinterpret_cast< Linphone::Core::RefToPtrProxy<Linphone::Core::LinphoneProxyConfig^> *>(linphone_proxy_config_get_user_data(cfg));
Linphone::Core::LinphoneProxyConfig^ config = (proxy) ? proxy->Ref() : nullptr;
......@@ -1152,8 +1150,7 @@ void global_state_changed(::LinphoneCore *lc, ::LinphoneGlobalState gstate, cons
{
Linphone::Core::gApiLock.EnterListener();
Linphone::Core::LinphoneCoreListener^ listener = Linphone::Core::Globals::Instance->LinphoneCore->CoreListener;
if (listener != nullptr)
{
if (listener != nullptr) {
Linphone::Core::GlobalState state = (Linphone::Core::GlobalState) gstate;
listener->GlobalState(state, Linphone::Core::Utils::cctops(msg));
}
......@@ -1164,13 +1161,67 @@ void auth_info_requested(LinphoneCore *lc, const char *realm, const char *userna
{
Linphone::Core::gApiLock.EnterListener();
Linphone::Core::LinphoneCoreListener^ listener = Linphone::Core::Globals::Instance->LinphoneCore->CoreListener;
if (listener != nullptr)
{
if (listener != nullptr) {
listener->AuthInfoRequested(Linphone::Core::Utils::cctops(realm), Linphone::Core::Utils::cctops(username));
}
Linphone::Core::gApiLock.LeaveListener();
}
void dtmf_received(LinphoneCore *lc, LinphoneCall *call, int dtmf)
{
Linphone::Core::gApiLock.EnterListener();
Linphone::Core::RefToPtrProxy<Linphone::Core::LinphoneCall^> *proxy = reinterpret_cast< Linphone::Core::RefToPtrProxy<Linphone::Core::LinphoneCall^> *>(linphone_call_get_user_pointer(call));
Linphone::Core::LinphoneCall^ lCall = (proxy) ? proxy->Ref() : nullptr;
if (lCall == nullptr) {
lCall = (Linphone::Core::LinphoneCall^)Linphone::Core::Utils::CreateLinphoneCall(call);
}
if (lCall != nullptr) {
Linphone::Core::LinphoneCoreListener^ listener = Linphone::Core::Globals::Instance->LinphoneCore->CoreListener;
if (listener != nullptr) {
char cdtmf = (char)dtmf;
char16 wdtmf;
mbtowc(&wdtmf, &cdtmf, 1);
listener->DTMFReceived(lCall, wdtmf);
}
}
Linphone::Core::gApiLock.LeaveListener();
}
void call_encryption_changed(LinphoneCore *lc, LinphoneCall *call, bool_t on, const char *authentication_token)
{
Linphone::Core::gApiLock.EnterListener();
Linphone::Core::RefToPtrProxy<Linphone::Core::LinphoneCall^> *proxy = reinterpret_cast< Linphone::Core::RefToPtrProxy<Linphone::Core::LinphoneCall^> *>(linphone_call_get_user_pointer(call));
Linphone::Core::LinphoneCall^ lCall = (proxy) ? proxy->Ref() : nullptr;
if (lCall == nullptr) {
lCall = (Linphone::Core::LinphoneCall^)Linphone::Core::Utils::CreateLinphoneCall(call);
}
if (lCall != nullptr) {
Linphone::Core::LinphoneCoreListener^ listener = Linphone::Core::Globals::Instance->LinphoneCore->CoreListener;
if (listener != nullptr) {
listener->CallEncryptionChanged(lCall, (on == TRUE), Linphone::Core::Utils::cctops(authentication_token));
}
}
Linphone::Core::gApiLock.LeaveListener();
}
void call_stats_updated(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallStats *stats)
{
Linphone::Core::gApiLock.EnterListener();
Linphone::Core::RefToPtrProxy<Linphone::Core::LinphoneCall^> *proxy = reinterpret_cast< Linphone::Core::RefToPtrProxy<Linphone::Core::LinphoneCall^> *>(linphone_call_get_user_pointer(call));
Linphone::Core::LinphoneCall^ lCall = (proxy) ? proxy->Ref() : nullptr;
if (lCall == nullptr) {
lCall = (Linphone::Core::LinphoneCall^)Linphone::Core::Utils::CreateLinphoneCall(call);
}
Linphone::Core::LinphoneCallStats^ lStats = (Linphone::Core::LinphoneCallStats^)Linphone::Core::Utils::CreateLinphoneCallStats((void *)stats);
if ((lCall != nullptr) && (lStats != nullptr)) {
Linphone::Core::LinphoneCoreListener^ listener = Linphone::Core::Globals::Instance->LinphoneCore->CoreListener;
if (listener != nullptr) {
listener->CallStatsUpdated(lCall, lStats);
}
}
Linphone::Core::gApiLock.LeaveListener();
}
Linphone::Core::LinphoneCore::LinphoneCore(LinphoneCoreListener^ coreListener) :
lc(nullptr),
listener(coreListener)
......@@ -1193,6 +1244,9 @@ void Linphone::Core::LinphoneCore::Init()
vtable->registration_state_changed = registration_state_changed;
vtable->call_state_changed = call_state_changed;
vtable->auth_info_requested = auth_info_requested;
vtable->dtmf_received = dtmf_received;
vtable->call_encryption_changed = call_encryption_changed;
vtable->call_stats_updated = call_stats_updated;
this->lc = linphone_core_new_with_config(vtable, config ? config->config : NULL, NULL);
RefToPtrProxy<LinphoneCore^> *proxy = new RefToPtrProxy<LinphoneCore^>(this);
......
......@@ -13,41 +13,99 @@ namespace Linphone
ref class LinphoneAddress;
ref class LpConfig;
/// <summary>
/// Definition of the OutputTraceListener interface. The classes that are to be used to ouput trace logs must implement this interface.
/// </summary>
public interface class OutputTraceListener
{
public:
/// <summary>
/// The method to implement to be able to output trace logs.
/// </summary>
/// <param name="level">The log level of the trace to output</param>
/// <param name="msg">The trace message to ouput</param>
void OutputTrace(OutputTraceLevel level, Platform::String^ msg);
};
/// <summary>
/// Class whose role is to create instances of other classes : LinphoneCore, LpConfig, AuthInfo and LinphoneAddress.
/// </summary>
public ref class LinphoneCoreFactory sealed
{
public:
/// <summary>
/// Gets the LinphoneCore instance.
/// </summary>
property LinphoneCore^ LinphoneCore
{
Linphone::Core::LinphoneCore^ get();
}
/// <summary>
/// The listener class to output trace logs.
/// </summary>
property OutputTraceListener^ OutputTraceListener
{
Linphone::Core::OutputTraceListener^ get();
void set(Linphone::Core::OutputTraceListener^ listener);
}
/// <summary>
/// Creates a LinphoneCore instance.
/// To access the created LinphoneCore use the LinphoneCoreFactory::LinphoneCore property.
/// </summary>
/// <param name="listener">The listener class that will handle the callbacks from the native linphone core</param>
/// <seealso cref="CreateLinphoneCore(LinphoneCoreListener^, LpConfig^)"/>
void CreateLinphoneCore(LinphoneCoreListener^ listener);
/// <summary>
/// Creates a LinphoneCore instance given an existing LpConfig.
/// To access the created LinphoneCore use the LinphoneCoreFactory::LinphoneCore property.
/// </summary>
/// <param name="listener">The listener class that will handle the callbacks from the native linphone core</param>
/// <param name="config">The LpConfig to use for the configuration of the created LinphoneCore</param>
/// <seealso cref="CreateLinphoneCore(LinphoneCoreListener^)"/>
void CreateLinphoneCore(LinphoneCoreListener^ listener, LpConfig^ config);
/// <summary>
/// Creates a LpConfig.
/// </summary>
/// <param name="configPath">The path of the user configuration file that must be readable and writable</param>
/// <param name="factoryConfigPath">The path of the factory configuration file that needs only to be readable</param>
/// <returns>The LpConfig that has been created</returns>
LpConfig^ CreateLpConfig(Platform::String^ configPath, Platform::String^ factoryConfigPath);
/// <summary>
/// Creates a LinphoneAuthInfo.
/// </summary>
/// <param name="username">The authentication username</param>
/// <param name="userid">The authentication userid</param>
/// <param name="password">The authentication password</param>
/// <param name="ha1">The authentication ha1</param>
/// <param name="realm">The authentication realm</param>
/// <returns>The LinphoneAuthInfo that has been created</returns>
LinphoneAuthInfo^ CreateAuthInfo(Platform::String^ username, Platform::String^ userid, Platform::String^ password, Platform::String^ ha1, Platform::String^ realm);
/// <summary>
/// Creates a LinphoneAddress.
/// </summary>
/// <param name="username">The username part of the address</param>
/// <param name="domain">The domain part of the address</param>
/// <param name="displayName">The display name of the address</param>
/// <returns>The LinphoneAddress that has been created</returns>
LinphoneAddress^ CreateLinphoneAddress(Platform::String^ username, Platform::String^ domain, Platform::String^ displayName);
/// <summary>
/// Constructs a LinphoneAddress object by parsing the user supplied address, given as a string.
/// </summary>
/// <param name="uri">address, should be like "sip:joe@sip.linphone.org"</param>
/// <returns>The LinphoneAddress that has been created</returns>
LinphoneAddress^ CreateLinphoneAddress(Platform::String^ uri);
/// <summary>
/// Sets the global log level of the application.
/// </summary>
/// <param name="logLevel">The log level to use</param>
void SetLogLevel(OutputTraceLevel logLevel);