Commit 36350389 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fix incoming call request

parent 087bab9e
......@@ -37,6 +37,17 @@ namespace Linphone
return Globals::Instance->LinphoneCore;
};
}
/// <summary>
/// Returns the install location of the app, used to get the uri of resources needed for the incoming call view
/// </summary>
property Platform::String^ Path
{
Platform::String^ get()
{
return Windows::ApplicationModel::Package::Current->InstalledLocation->Path;
};
}
};
}
}
......
No preview for this file type
......@@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Navigation;
using System.Windows.Threading;
namespace Linphone
{
......@@ -28,6 +29,8 @@ namespace Linphone
/// </summary>
public BasePage Page { get; set; }
public static Dispatcher UIDispatcher;
/// <summary>
/// Called when a call is starting.
/// Displays the InCall.xaml page.
......@@ -68,6 +71,7 @@ namespace Linphone
public virtual void OnNavigatedTo(NavigationEventArgs nea)
{
LinphoneManager.Instance.CallListener = this;
UIDispatcher = this.Page.Dispatcher;
}
/// <summary>
......
......@@ -12,6 +12,7 @@ using System.Threading;
using System.Threading.Tasks;
using Linphone.Resources;
using Windows.Phone.Networking.Voip;
using System.Windows.Media.Imaging;
namespace Linphone.Model
{
......@@ -299,7 +300,7 @@ namespace Linphone.Model
CallController.RequestNewOutgoingCall(sipAddress, "", "Linphone", VoipCallMedia.Audio, out call);
call.NotifyCallActive();
LinphoneCall LCall = LinphoneCore.Invite(sipAddress);
//LCall.CallContext = call;
LCall.CallContext = call;
if (CallListener != null)
CallListener.NewCallStarted(sipAddress);
......@@ -313,7 +314,7 @@ namespace Linphone.Model
//if (LinphoneCore.GetCallsNb() > 0)
//{
LinphoneCall call = LinphoneCore.GetCurrentCall();
call.CallContext.NotifyCallEnded();
((VoipPhoneCall)call.CallContext).NotifyCallEnded();
LinphoneCore.TerminateCall(call);
if (CallListener != null)
CallListener.CallEnded();
......@@ -373,11 +374,11 @@ namespace Linphone.Model
Debug.WriteLine("[LinphoneManager] Incoming received: " + contact + " (" + number + ")");
VoipPhoneCall vcall = null;
Uri contactUri = new Uri("ms-appx:///Assets/unknown.png", UriKind.Absolute);
Uri iconUri = new Uri("ms-appx:///Assets/pnicon.png", UriKind.Absolute);
Uri ringtoneUri = new Uri("ms-appx:///Assets/Sounds/Ringtone.wma", UriKind.Absolute);
Uri contactUri = new Uri(server.Path + "\\Assets\\unknown.png", UriKind.Absolute);
Uri iconUri = new Uri(server.Path + "\\Assets\\pnicon.png", UriKind.Absolute);
Uri ringtoneUri = new Uri(server.Path + "\\Assets\\Sounds\\Ringtone.wma", UriKind.Absolute);
CallController.RequestNewIncomingCall("/Views/InCall.xaml?sip=" + number, contact, number, contactUri, "Linphone", iconUri, "", ringtoneUri, VoipCallMedia.Audio, new TimeSpan(), out vcall);
CallController.RequestNewIncomingCall("/Views/InCall.xaml?sip=" + number, contact, number, contactUri, "Linphone", iconUri, "", ringtoneUri, VoipCallMedia.Audio, fifteenSecs, out vcall);
vcall.AnswerRequested += ((c, eventargs) =>
{
vcall.NotifyCallActive();
......@@ -397,7 +398,7 @@ namespace Linphone.Model
state == LinphoneCallState.Error ||
state == LinphoneCallState.Released)
{
call.CallContext.NotifyCallEnded();
((VoipPhoneCall)call.CallContext).NotifyCallEnded();
}
}
......
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