Commit 8a5473bc authored by Ghislain MARY's avatar Ghislain MARY

Improve sample UI.

parent dc744e42
......@@ -46,7 +46,7 @@
</Grid.ColumnDefinitions>
<TextBlock x:Name="ContactTextBlock" HorizontalAlignment="Left" Margin="8,0" TextWrapping="Wrap" VerticalAlignment="Center" Text="Contact:"/>
<TextBox x:Name="ContactTextBox" Margin="8" TextWrapping="Wrap" VerticalAlignment="Center" d:LayoutOverrides="Width" Grid.Column="1"/>
<Button x:Name="CallButton" Content="Call" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="8,0" Grid.Row="1" d:LayoutOverrides="Height, TopPosition, BottomPosition" Click="CallButton_Click"/>
<Button x:Name="CallButton" Content="Call / Hangup" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="8,0" Grid.Row="1" d:LayoutOverrides="Height, TopPosition, BottomPosition" Click="CallButton_Click"/>
<TextBlock x:Name="CallStateTextBlock" Margin="8,8,5,8" TextWrapping="Wrap" Grid.Row="1" Grid.Column="1" Text="{Binding Instance.CallStateText}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</StackPanel>
......
......@@ -36,24 +36,35 @@ namespace Linphone
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
Core.LogLevel = OutputTraceLevel.Message;
LinphoneManager.Instance.Dispatcher = Dispatcher;
LinphoneManager.Instance.Core.IsIterateEnabled = true;
}
private void CallButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
string contact = ContactTextBox.Text;
if (contact.Length > 0)
Core core = LinphoneManager.Instance.Core;
if (core.CallsNb == 0)
{
if (!contact.StartsWith("sip:"))
string contact = ContactTextBox.Text;
if (contact.Length > 0)
{
contact = string.Format("sip:{0}", contact);
if (!contact.StartsWith("sip:"))
{
contact = string.Format("sip:{0}", contact);
}
Address address = core.CreateAddress(contact);
if (address != null)
{
core.InviteAddress(address);
}
}
Core core = LinphoneManager.Instance.Core;
Address address = core.CreateAddress(contact);
if (address != null)
}
else
{
foreach (Call c in core.Calls)
{
core.InviteAddress(address);
core.TerminateCall(c);
}
}
}
......@@ -68,9 +79,14 @@ namespace Linphone
core.AddAuthInfo(authInfo);
proxy.Identity = string.Format("sip:{0}@{1}", UsernameTextBox.Text, ServerTextBox.Text);
proxy.ServerAddr = ServerTextBox.Text;
Address addr = core.CreateAddress(proxy.ServerAddr);
addr.Transport = Transport.TCP;
proxy.ServerAddr = addr.AsString();
proxy.Route = addr.AsString();
proxy.IsRegisterEnabled = true;
core.AddProxyConfig(proxy);
core.DefaultProxyConfig = proxy;
core.VideoPolicy = new VideoPolicy(false, false);
}
}
}
......
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