Commit 813a989a authored by Sylvain Berfini's avatar Sylvain Berfini

Moved Transport setting from Advanced to Account + fix for video setting +...

Moved Transport setting from Advanced to Account + fix for video setting + some missing functions added in C# wrapper
parent dfc95c10
......@@ -22,7 +22,7 @@ namespace Linphone.Agents
// Do not enable these for releases !!!
#if DEBUG
public const bool AllowTCPRemote = true;
public const bool ShowWizardUntilAccountConfigured = true;
public const bool ShowWizardUntilAccountConfigured = false;
#else
public const bool AllowTCPRemote = false;
public const bool ShowWizardUntilAccountConfigured = false;
......
......@@ -172,5 +172,13 @@ namespace Linphone
LinphoneReasonUnauthorized = 10, /**<Operation is unauthorized because missing credential*/
LinphoneReasonNotAcceptable = 11 /**<Operation like call update rejected by peer*/
};
public enum class LinphoneTransport : int
{
LinphoneTransportUDP = 0,
LinphoneTransportTCP = 1,
LinphoneTransportTLS = 2,
LinphoneTransportDTLS = 3
};
}
}
\ No newline at end of file
......@@ -21,6 +21,24 @@ int Linphone::Core::LinphoneAddress::GetPort()
return linphone_address_get_port(this->address);
}
Linphone::Core::LinphoneTransport Linphone::Core::LinphoneAddress::GetTransport()
{
LinphoneTransportType transport = linphone_address_get_transport(this->address);
switch (transport)
{
case LinphoneTransportUdp:
return LinphoneTransport::LinphoneTransportUDP;
case LinphoneTransportTcp:
return LinphoneTransport::LinphoneTransportTCP;
case LinphoneTransportTls:
return LinphoneTransport::LinphoneTransportTLS;
case LinphoneTransportDtls:
return LinphoneTransport::LinphoneTransportDTLS;
default:
return LinphoneTransport::LinphoneTransportUDP;
}
}
void Linphone::Core::LinphoneAddress::SetDisplayName(Platform::String^ name)
{
const char *cc = Linphone::Core::Utils::pstoccs(name);
......@@ -47,6 +65,25 @@ void Linphone::Core::LinphoneAddress::SetPort(int port)
linphone_address_set_port(this->address, port);
}
void Linphone::Core::LinphoneAddress::SetTransport(Linphone::Core::LinphoneTransport transport)
{
LinphoneTransportType transportType = LinphoneTransportUdp;
if (transport == LinphoneTransport::LinphoneTransportTCP)
{
transportType = LinphoneTransportTcp;
}
else if (transport == LinphoneTransport::LinphoneTransportTLS)
{
transportType = LinphoneTransportTls;
}
else if (transport == LinphoneTransport::LinphoneTransportDTLS)
{
transportType = LinphoneTransportDtls;
}
linphone_address_set_transport(this->address, transportType);
}
void Linphone::Core::LinphoneAddress::Clean()
{
linphone_address_clean(this->address);
......
......@@ -55,6 +55,12 @@ namespace Linphone
/// <returns>The port part of the address or 0 if not set</returns>
int GetPort();
/// <summary>
/// Gets the transport of the address.
/// </summary>
/// <returns>The transport if specified. If not set, it will return UDP.</returns>
LinphoneTransport GetTransport();
/// <summary>
/// Sets the human display name of the address.
/// </summary>
......@@ -79,6 +85,12 @@ namespace Linphone
/// <param name="port">The port to set to the address</param>
void SetPort(int port);
/// <summary>
/// Sets the transport in the address.
/// </summary>
/// <param name="transport">The transport to set.</param>
void SetTransport(LinphoneTransport transport);
void Clean();
/// <summary>
......
......@@ -1330,6 +1330,22 @@ Platform::Boolean Linphone::Core::LinphoneCore::IsVideoEnabled()
return enabled;
}
Platform::Boolean Linphone::Core::LinphoneCore::IsVideoCaptureEnabled()
{
gApiLock.Lock();
Platform::Boolean enabled = (linphone_core_video_capture_enabled(this->lc) == TRUE);
gApiLock.Unlock();
return enabled;
}
Platform::Boolean Linphone::Core::LinphoneCore::IsVideoDisplayEnabled()
{
gApiLock.Lock();
Platform::Boolean enabled = (linphone_core_video_display_enabled(this->lc) == TRUE);
gApiLock.Unlock();
return enabled;
}
void Linphone::Core::LinphoneCore::EnableVideo(Platform::Boolean enableCapture, Platform::Boolean enableDisplay)
{
gApiLock.Lock();
......@@ -1337,6 +1353,20 @@ void Linphone::Core::LinphoneCore::EnableVideo(Platform::Boolean enableCapture,
gApiLock.Unlock();
}
void Linphone::Core::LinphoneCore::EnableVideoCapture(Platform::Boolean enable)
{
gApiLock.Lock();
linphone_core_enable_video_capture(this->lc, enable);
gApiLock.Unlock();
}
void Linphone::Core::LinphoneCore::EnableVideoDisplay(Platform::Boolean enable)
{
gApiLock.Lock();
linphone_core_enable_video_display(this->lc, enable);
gApiLock.Unlock();
}
int Linphone::Core::LinphoneCore::GetNativeVideoWindowId()
{
gApiLock.Lock();
......
......@@ -978,12 +978,14 @@ namespace Linphone
Windows::Foundation::Collections::IVector<Platform::Object^>^ GetVideoCodecs();
/// <summary>
/// Deprecated!
/// Tells whether video is enabled or not.
/// </summary>
/// <returns>true if video is enabled, false otherwise</returns>
Platform::Boolean IsVideoEnabled();
/// <summary>
/// Deprecated!
/// Enables video.
/// This method does not have any effect during calls. It just indicates LinphoneCore to
/// initiate future calls with video or not. The two boolean parameters indicate in which
......@@ -993,6 +995,32 @@ namespace Linphone
/// <param name="enableDisplay">Indicates whether video display should be shown</param>
void EnableVideo(Platform::Boolean enableCapture, Platform::Boolean enableDisplay);
/// <summary>
/// Tells whether video capture is enabled.
/// </summary>
/// <returns>TRUE if video capture is enabled, FALSE if disabled.</returns>
Platform::Boolean IsVideoCaptureEnabled();
/// <summary>
/// Tells whether video display is enabled.
/// </summary>
/// <returns>TRUE if video capture is enabled, FALSE if disabled.</returns>
Platform::Boolean IsVideoDisplayEnabled();
/// <summary>
/// Enable or disable video capture.
///This function does not have any effect during calls. It just indicates the LinphoneCore to initiate future calls with video capture or not.
/// </summary>
/// <param name="enable">TRUE to enable video capture, FALSE to disable it.</param>
void EnableVideoCapture(Platform::Boolean enable);
/// <summary>
/// Enable or disable video display.
/// This function does not have any effect during calls. It just indicates the LinphoneCore to initiate future calls with video display or not.
/// </summary>
/// <param name="enable">TRUE to enable video display, FALSE to disable it.</param>
void EnableVideoDisplay(Platform::Boolean enable);
/// <summary>
/// Gets the native video window id.
/// </summary>
......
......@@ -2,7 +2,6 @@
firewall_policy=0
[sip]
sip_random_port=1
default_proxy=0
[rtp]
......
......@@ -22,8 +22,6 @@ nortp_timeout=30
dtmf_player_amp=0.1
[video]
capture=0
display=0
displaytype=MSWP8Dis
[misc]
......
This diff is collapsed.
......@@ -39,6 +39,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical" Grid.Row="0" Margin="0,10,0,0">
......@@ -100,7 +101,14 @@
</TextBox>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Row="4" Margin="0,10,0,0">
<toolkit:ListPicker
Grid.Row="4"
x:Name="Transport"
SelectionMode="Single"
Header="{Binding Path=LocalizedResources.TransportSetting, Source={StaticResource LocalizedStrings}}">
</toolkit:ListPicker>
<StackPanel Orientation="Vertical" Grid.Row="5" Margin="0,10,0,0">
<TextBlock
Style="{StaticResource PhoneTextSubtleStyle}"
Text="{Binding Path=LocalizedResources.SIPProxy, Source={StaticResource LocalizedStrings}}">
......@@ -111,14 +119,14 @@
</TextBox>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Row="5" Margin="0,10,0,0">
<StackPanel Orientation="Vertical" Grid.Row="6" Margin="0,10,0,0">
<toolkit:ToggleSwitch
x:Name="OutboundProxy"
Header="{Binding Path=LocalizedResources.SIPOutboundProxy, Source={StaticResource LocalizedStrings}}">
</toolkit:ToggleSwitch>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Row="6" Margin="0,10,0,0">
<StackPanel Orientation="Vertical" Grid.Row="7" Margin="0,10,0,0">
<TextBlock
Style="{StaticResource PhoneTextSubtleStyle}"
Text="{Binding Path=LocalizedResources.DisplayName, Source={StaticResource LocalizedStrings}}">
......
......@@ -2,6 +2,7 @@
using Linphone.Resources;
using Microsoft.Phone.Shell;
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Input;
using System.Windows.Navigation;
......@@ -33,6 +34,15 @@ namespace Linphone.Views
Proxy.Text = _settings.Proxy;
OutboundProxy.IsChecked = _settings.OutboundProxy;
DisplayName.Text = _settings.DisplayName;
List<string> transports = new List<string>
{
AppResources.TransportUDP,
AppResources.TransportTCP,
AppResources.TransportTLS
};
Transport.ItemsSource = transports;
Transport.SelectedItem = _settings.Transport;
}
/// <summary>
......@@ -68,6 +78,7 @@ namespace Linphone.Views
_settings.Proxy = Proxy.Text;
_settings.OutboundProxy = OutboundProxy.IsChecked;
_settings.DisplayName = DisplayName.Text;
_settings.Transport = Transport.SelectedItem.ToString();
_settings.Save();
NavigationService.GoBack();
......
......@@ -22,12 +22,6 @@
<phone:PivotItem Header="{Binding Path=LocalizedResources.NetworkMenu, Source={StaticResource LocalizedStrings}}">
<ScrollViewer>
<StackPanel Orientation="Vertical">
<toolkit:ListPicker
x:Name="Transport"
SelectionMode="Single"
Header="{Binding Path=LocalizedResources.TransportSetting, Source={StaticResource LocalizedStrings}}">
</toolkit:ListPicker>
<toolkit:ListPicker
x:Name="MediaEncryption"
SelectionMode="Single"
......
......@@ -69,15 +69,6 @@ namespace Linphone.Views
tunnelPort.Text = _networkSettings.TunnelPort;
tunnelServer.Text = _networkSettings.TunnelServer;
List<string> transports = new List<string>
{
AppResources.TransportUDP,
AppResources.TransportTCP,
AppResources.TransportTLS
};
Transport.ItemsSource = transports;
Transport.SelectedItem = _networkSettings.Transport;
TunnelPanel.Visibility = LinphoneManager.Instance.LinphoneCore.IsTunnelAvailable() && Customs.IsTunnelEnabled ? Visibility.Visible : Visibility.Collapsed; //Hidden properties for now
List<string> debugModes = new List<string>
......@@ -130,7 +121,6 @@ namespace Linphone.Views
_networkSettings.TunnelMode = tunnelMode.SelectedItem.ToString();
_networkSettings.TunnelServer = tunnelServer.Text;
_networkSettings.TunnelPort = tunnelPort.Text;
_networkSettings.Transport = Transport.SelectedItem.ToString();
_networkSettings.Save();
_chatSettings.VibrateOnIncomingMessage = vibrator.IsChecked;
......
......@@ -63,15 +63,15 @@ namespace Linphone.Views
_settings.Domain = Domain.Text;
if (Domain.Text.Equals("sip.linphone.org"))
{
_settings.Proxy = "sip.linphone.org:5223";
_settings.Proxy = "<sip:sip.linphone.org:5223;transport=tls>";
_settings.Transport = AppResources.TransportTLS;
_settings.OutboundProxy = true;
networkSettings.Transport = "TLS";
networkSettings.StunServer = "sip.linphone.org";
networkSettings.FWPolicy = "ICE";
networkSettings.StunServer = "stun.linphone.org";
networkSettings.FWPolicy = AppResources.FirewallPolicyIce;
}
_settings.Save();
networkSettings.Save();
_settings.Save();
NavigationService.Navigate(new Uri("/Views/Dialer.xaml", UriKind.RelativeOrAbsolute));
NavigationService.RemoveBackEntry(); // Prevent a back to this screen from the dialer
......
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