Commit 5e73ae7d authored by Sylvain Berfini's avatar Sylvain Berfini

Added DeclineCall method to LinphoneCore

parent b4db38df
......@@ -110,7 +110,7 @@ void CallController::OnRejectCallRequested(VoipPhoneCall^ incomingCall, CallReje
//This will call notifyCallEnded on the call state changed callback
if (this->call != nullptr)
Globals::Instance->LinphoneCore->TerminateCall(this->call);
Globals::Instance->LinphoneCore->DeclineCall(this->call, DeclineReason::LinphoneReasonBusy);
gApiLock.Unlock();
}
......@@ -158,12 +158,12 @@ VoipPhoneCall^ CallController::NewIncomingCallForCustomIncomingCallView(Platform
return incomingCall;
}
IncomingCallViewDismissedCallback^ CallController::IncomingCallViewDismissed::get()
IncomingCallViewDismissedCallback^ CallController::IncomingCallViewDismissed::get()
{
gApiLock.Lock();
IncomingCallViewDismissedCallback^ cb = this->onIncomingCallViewDismissed;
gApiLock.Unlock();
return cb;
IncomingCallViewDismissedCallback^ cb = this->onIncomingCallViewDismissed;
gApiLock.Unlock();
return cb;
}
void CallController::IncomingCallViewDismissed::set(IncomingCallViewDismissedCallback^ cb)
......
......@@ -29,10 +29,10 @@ namespace Linphone
{
Outgoing,
Incoming
};
/// <summary>
/// Linphone core states
};
/// <summary>
/// Linphone core states
/// </summary>
public enum class GlobalState : int
{
......@@ -42,8 +42,8 @@ namespace Linphone
GlobalShutdown = 3
};
/// <summary>
/// Proxy registration states
/// <summary>
/// Proxy registration states
/// </summary>
public enum class RegistrationState : int
{
......@@ -156,5 +156,21 @@ namespace Linphone
Delivered = 2,
NotDelivered = 3
};
public enum class DeclineReason : int
{
LinphoneReasonNone = 0,
LinphoneReasonNoResponse = 1, /**<No response received from remote*/
LinphoneReasonBadCredentials = 2, /**<Authentication failed due to bad*/
LinphoneReasonDeclined = 3, /**<The call has been declined*/
LinphoneReasonNotFound = 4, /**<Destination of the calls was not found.*/
LinphoneReasonNotAnswered = 5, /**<The call was not answered in time*/
LinphoneReasonBusy = 6, /**<Phone line was busy */
LinphoneReasonMedia = 7, /**<Incompatible media */
LinphoneReasonIOError = 8, /**<Transport error: connection failures, disconnections etc...*/
LinphoneReasonDoNotDisturb = 9, /**<Do not disturb reason*/
LinphoneReasonUnauthorized = 10, /**<Operation is unauthorized because missing credential*/
LinphoneReasonNotAcceptable = 11 /**<Operation like call update rejected by peer*/
};
}
}
\ No newline at end of file
......@@ -5,7 +5,7 @@
#include "LinphoneCallLog.h"
#include "LinphoneCallParams.h"
#include "LinphoneProxyConfig.h"
#include "LinphoneCoreListener.h"
#include "LinphoneCoreListener.h"
#include "LinphoneChatRoom.h"
#include "LpConfig.h"
#include "PayloadType.h"
......@@ -357,6 +357,13 @@ void Linphone::Core::LinphoneCore::TerminateCall(Linphone::Core::LinphoneCall^ c
gApiLock.Unlock();
}
void Linphone::Core::LinphoneCore::DeclineCall(Linphone::Core::LinphoneCall^ call, DeclineReason reason)
{
gApiLock.Lock();
linphone_core_decline_call(this->lc, call->call, (LinphoneReason)reason);
gApiLock.Unlock();
}
Linphone::Core::LinphoneCall^ Linphone::Core::LinphoneCore::GetCurrentCall()
{
gApiLock.Lock();
......@@ -596,7 +603,7 @@ bool Linphone::Core::LinphoneCore::PayloadTypeEnabled(PayloadType^ pt)
void Linphone::Core::LinphoneCore::EnablePayloadType(PayloadType^ pt, Platform::Boolean enable)
{
gApiLock.Lock();
::PayloadType *payload = pt->payload;
::PayloadType *payload = pt->payload;
linphone_core_enable_payload_type(this->lc, payload, enable);
gApiLock.Unlock();
}
......@@ -1302,7 +1309,7 @@ void Linphone::Core::LinphoneCore::SetVideoDevice(Platform::String^ device)
gApiLock.Unlock();
delete ccname;
}
IVector<Object^>^ Linphone::Core::LinphoneCore::GetVideoCodecs()
{
gApiLock.Lock();
......@@ -1359,7 +1366,7 @@ void Linphone::Core::LinphoneCore::EnableSelfView(Platform::Boolean enable)
linphone_core_enable_self_view(this->lc, enable);
gApiLock.Unlock();
}
Linphone::Core::LinphoneChatRoom^ Linphone::Core::LinphoneCore::CreateChatRoom(Platform::String^ to)
{
gApiLock.Lock();
......@@ -1370,10 +1377,10 @@ Linphone::Core::LinphoneChatRoom^ Linphone::Core::LinphoneCore::CreateChatRoom(P
return chatRoom;
}
Linphone::Core::LinphoneCoreListener^ Linphone::Core::LinphoneCore::CoreListener::get()
{
return this->listener;
Linphone::Core::LinphoneCoreListener^ Linphone::Core::LinphoneCore::CoreListener::get()
{
return this->listener;
}
void Linphone::Core::LinphoneCore::CoreListener::set(LinphoneCoreListener^ listener)
......@@ -1559,25 +1566,25 @@ Linphone::Core::LinphoneCore::LinphoneCore(LinphoneCoreListener^ coreListener, L
void Linphone::Core::LinphoneCore::Init()
{
LinphoneCoreVTable *vtable = (LinphoneCoreVTable*) malloc(sizeof(LinphoneCoreVTable));
LinphoneCoreVTable *vtable = (LinphoneCoreVTable*) malloc(sizeof(LinphoneCoreVTable));
memset (vtable, 0, sizeof(LinphoneCoreVTable));
vtable->global_state_changed = global_state_changed;
vtable->registration_state_changed = registration_state_changed;
vtable->call_state_changed = call_state_changed;
vtable->auth_info_requested = auth_info_requested;
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;
vtable->message_received = message_received;
vtable->call_stats_updated = call_stats_updated;
vtable->message_received = message_received;
this->lc = linphone_core_new_with_config(vtable, config ? config->config : NULL, NULL);
RefToPtrProxy<LinphoneCore^> *proxy = new RefToPtrProxy<LinphoneCore^>(this);
linphone_core_set_user_data(this->lc, proxy);
linphone_core_set_ring(this->lc, nullptr);
RefToPtrProxy<Mediastreamer2::WP8Video::IVideoRenderer^> *renderer = new RefToPtrProxy<Mediastreamer2::WP8Video::IVideoRenderer^>(Globals::Instance->VideoRenderer);
linphone_core_set_ring(this->lc, nullptr);
RefToPtrProxy<Mediastreamer2::WP8Video::IVideoRenderer^> *renderer = new RefToPtrProxy<Mediastreamer2::WP8Video::IVideoRenderer^>(Globals::Instance->VideoRenderer);
linphone_core_set_native_video_window_id(this->lc, (unsigned long)renderer);
// Launch iterate timer
TimeSpan period;
period.Duration = 20 * 10000;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment