Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
linphone-windows10
Commits
03ad0b7e
Commit
03ad0b7e
authored
Jan 26, 2017
by
Erwan Croze
👋🏻
Browse files
Fix: Start video renderer before accepte incoming call
parent
2645cdbd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
9 deletions
+34
-9
Linphone/App.xaml.cs
Linphone/App.xaml.cs
+7
-2
Linphone/Views/Dialer.xaml.cs
Linphone/Views/Dialer.xaml.cs
+4
-2
Linphone/Views/InCall.xaml.cs
Linphone/Views/InCall.xaml.cs
+18
-3
Linphone/Views/IncomingCall.xaml.cs
Linphone/Views/IncomingCall.xaml.cs
+5
-2
No files found.
Linphone/App.xaml.cs
View file @
03ad0b7e
...
...
@@ -24,6 +24,7 @@ using BelledonneCommunications.Linphone.Native;
using
Linphone.Model
;
using
System.Diagnostics
;
using
Windows.UI.Core
;
using
System.Collections.Generic
;
namespace
Linphone
{
...
...
@@ -96,7 +97,9 @@ namespace Linphone
public
void
NewCallStarted
(
string
callerNumber
)
{
Debug
.
WriteLine
(
"[CallListener] NewCallStarted "
+
callerNumber
);
rootFrame
.
Navigate
(
typeof
(
Views
.
InCall
),
callerNumber
);
List
<
String
>
parameters
=
new
List
<
String
>();
parameters
.
Add
(
callerNumber
);
rootFrame
.
Navigate
(
typeof
(
Views
.
InCall
),
parameters
);
}
public
void
PauseStateChanged
(
Call
call
,
bool
isCallPaused
,
bool
isCallPausedByRemote
)
...
...
@@ -228,7 +231,9 @@ namespace Linphone
if
(
addr
!=
null
&&
addr
.
AsStringUriOnly
().
Equals
(
call
.
RemoteAddress
.
AsStringUriOnly
()))
{
LinphoneManager
.
Instance
.
Core
.
AcceptCall
(
call
);
rootFrame
.
Navigate
(
typeof
(
Views
.
InCall
),
call
.
RemoteAddress
.
AsString
());
List
<
String
>
parameters
=
new
List
<
String
>();
parameters
.
Add
(
call
.
RemoteAddress
.
AsString
());
rootFrame
.
Navigate
(
typeof
(
Views
.
InCall
),
parameters
);
acceptCall
=
false
;
}
}
...
...
Linphone/Views/Dialer.xaml.cs
View file @
03ad0b7e
...
...
@@ -22,6 +22,7 @@ using BelledonneCommunications.Linphone.Native;
using
Windows.UI.Xaml
;
using
Windows.UI.Xaml.Input
;
using
System.ComponentModel
;
using
System.Collections.Generic
;
namespace
Linphone.Views
{
...
...
@@ -146,8 +147,9 @@ namespace Linphone.Views {
if
(
LinphoneManager
.
Instance
.
Core
.
CallsNb
>
0
)
{
Call
call
=
LinphoneManager
.
Instance
.
Core
.
CurrentCall
;
String
uri
=
call
.
RemoteAddress
.
AsStringUriOnly
();
Frame
.
Navigate
(
typeof
(
Views
.
InCall
),
uri
);
List
<
String
>
parameters
=
new
List
<
String
>();
parameters
.
Add
(
call
.
RemoteAddress
.
AsStringUriOnly
());
Frame
.
Navigate
(
typeof
(
Views
.
InCall
),
parameters
);
}
if
(
LinphoneManager
.
Instance
.
GetUnreadMessageCount
()
>
0
)
{
...
...
Linphone/Views/InCall.xaml.cs
View file @
03ad0b7e
...
...
@@ -17,6 +17,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
using
BelledonneCommunications.Linphone.Native
;
using
Linphone.Model
;
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Threading
;
using
Windows.ApplicationModel.Resources
;
...
...
@@ -53,7 +54,7 @@ namespace Linphone.Views {
VideoGrid
.
Visibility
=
Visibility
.
Collapsed
;
}
if
(
LinphoneManager
.
Instance
.
Core
.
CurrentCall
.
State
==
CallState
.
StreamsRunning
)
if
(
LinphoneManager
.
Instance
.
Core
.
CurrentCall
.
State
==
CallState
.
StreamsRunning
)
Status
.
Text
=
"00:00:00"
;
displayOrientation
=
ApplicationView
.
GetForCurrentView
().
Orientation
;
...
...
@@ -137,12 +138,17 @@ namespace Linphone.Views {
#
endregion
protected
override
void
OnNavigatedTo
(
NavigationEventArgs
nee
)
{
List
<
string
>
parameters
;
base
.
OnNavigatedTo
(
nee
);
parameters
=
nee
.
Parameter
as
List
<
string
>;
LinphoneManager
.
Instance
.
CallStateChangedEvent
+=
CallStateChanged
;
if
((
nee
.
Parameter
as
String
).
Contains
(
"sip"
))
{
String
calledNumber
=
nee
.
Parameter
as
String
;
if
(
parameters
==
null
)
return
;
if
(
parameters
.
Count
>=
1
&&
parameters
[
0
].
Contains
(
"sip"
))
{
String
calledNumber
=
parameters
[
0
];
Address
address
=
LinphoneManager
.
Instance
.
Core
.
InterpretURL
(
calledNumber
);
calledNumber
=
String
.
Format
(
"{0}@{1}"
,
address
.
UserName
,
address
.
Domain
);
Contact
.
Text
=
calledNumber
;
...
...
@@ -153,6 +159,15 @@ namespace Linphone.Views {
// cm.FindContact(calledNumber);
}
}
if
(
parameters
.
Count
>=
2
&&
parameters
[
1
].
Contains
(
"incomingCall"
))
{
if
(
LinphoneManager
.
Instance
.
Core
.
CurrentCall
!=
null
)
{
LinphoneManager
.
Instance
.
Core
.
AcceptCall
(
LinphoneManager
.
Instance
.
Core
.
CurrentCall
);
}
else
{
if
(
Frame
.
CanGoBack
)
{
Frame
.
GoBack
();
}
}
}
}
protected
override
void
OnNavigatedFrom
(
NavigationEventArgs
nee
)
{
...
...
Linphone/Views/IncomingCall.xaml.cs
View file @
03ad0b7e
...
...
@@ -22,6 +22,7 @@ using Windows.UI.Xaml.Navigation;
using
Windows.UI.Xaml
;
using
Windows.UI.Core
;
using
System.Diagnostics
;
using
System.Collections.Generic
;
namespace
Linphone.Views
{
...
...
@@ -103,8 +104,10 @@ namespace Linphone.Views {
private
void
Answer_Click
(
object
sender
,
RoutedEventArgs
e
)
{
if
(
LinphoneManager
.
Instance
.
Core
.
CurrentCall
!=
null
)
{
LinphoneManager
.
Instance
.
Core
.
AcceptCall
(
LinphoneManager
.
Instance
.
Core
.
CurrentCall
);
Frame
.
Navigate
(
typeof
(
Views
.
InCall
),
_callingNumber
);
List
<
string
>
parameters
=
new
List
<
string
>();
parameters
.
Add
(
_callingNumber
);
parameters
.
Add
(
"incomingCall"
);
Frame
.
Navigate
(
typeof
(
Views
.
InCall
),
parameters
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment