Commit 1137d8eb authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fix for incall view on incoming call

parent ec712065
No preview for this file type
......@@ -29,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.
......@@ -70,6 +72,7 @@ namespace Linphone
public virtual void OnNavigatedTo(NavigationEventArgs nea)
{
LinphoneManager.Instance.CallListener = this;
UIDispatcher = this.Page.Dispatcher;
}
/// <summary>
......
......@@ -374,32 +374,35 @@ namespace Linphone.Model
String number = call.GetRemoteAddress().AsStringUriOnly();
Debug.WriteLine("[LinphoneManager] Incoming received: " + contact + " (" + number + ")");
VoipPhoneCall vcall = null;
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("/Linphone;component/Views/InCall.xaml?sip=" + number, contact, number, contactUri, "Linphone", iconUri, "", ringtoneUri, VoipCallMedia.Audio, fifteenSecs, out vcall);
vcall.AnswerRequested += ((c, eventargs) =>
{
Debug.WriteLine("[LinphoneManager] Call accepted");
vcall.NotifyCallActive();
LinphoneCore.AcceptCall(call);
if (CallListener != null)
CallListener.NewCallStarted(number);
});
vcall.RejectRequested += ((c, eventargs) =>
{
Debug.WriteLine("[LinphoneManager] Call rejected");
vcall.NotifyCallEnded();
LinphoneCore.TerminateCall(call);
});
call.CallContext = vcall;
LinphoneCore.Call = call;
BaseModel.UIDispatcher.BeginInvoke(() =>
{
VoipPhoneCall vcall = null;
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("/Linphone;component/Views/InCall.xaml?sip=" + number, contact, number, contactUri, "Linphone", iconUri, "", ringtoneUri, VoipCallMedia.Audio, fifteenSecs, out vcall);
vcall.AnswerRequested += ((c, eventargs) =>
{
Debug.WriteLine("[LinphoneManager] Call accepted");
vcall.NotifyCallActive();
LinphoneCore.AcceptCall(call);
if (CallListener != null)
CallListener.NewCallStarted(number);
});
vcall.RejectRequested += ((c, eventargs) =>
{
Debug.WriteLine("[LinphoneManager] Call rejected");
vcall.NotifyCallEnded();
LinphoneCore.TerminateCall(call);
});
call.CallContext = vcall;
LinphoneCore.Call = call;
});
}
else if (state == LinphoneCallState.CallEnd ||
state == LinphoneCallState.Error ||
......
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