Commit daab5efd authored by Ghislain MARY's avatar Ghislain MARY

Set LinphoneWP8 user-agent.

parent 01a5e8f5
using Linphone.Agents;
using Linphone.Core;
using Linphone.Core.OutOfProcess;
using Linphone.Resources;
using Microsoft.Phone.Net.NetworkInformation;
using Microsoft.Phone.Networking.Voip;
using System;
......@@ -9,6 +10,7 @@ using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading;
using System.Xml.Linq;
using Windows.Phone.Media.Devices;
using Windows.Phone.Networking.Voip;
......@@ -246,6 +248,8 @@ namespace Linphone.Model
server.LinphoneCore.CoreListener = this;
isLinphoneRunning = true;
// Set user-agent because it is not set if coming back from background mode
server.LinphoneCore.SetUserAgent(DefaultValues.UserAgent, XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("Version").Value);
return;
}
......@@ -254,6 +258,7 @@ namespace Linphone.Model
LpConfig config = server.LinphoneCoreFactory.CreateLpConfig(SettingsManager.GetConfigPath(), SettingsManager.GetFactoryConfigPath());
ConfigureLogger();
server.LinphoneCoreFactory.CreateLinphoneCore(this, config);
server.LinphoneCore.SetUserAgent(DefaultValues.UserAgent, XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("Version").Value);
server.LinphoneCore.SetRootCA("Assets/rootca.pem");
Logger.Msg("[LinphoneManager] LinphoneCore created");
......
......@@ -68,5 +68,14 @@ namespace Linphone.Resources {
return ResourceManager.GetString("KeepAlive", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to LinphoneWP8.
/// </summary>
internal static string UserAgent {
get {
return ResourceManager.GetString("UserAgent", resourceCulture);
}
}
}
}
......@@ -121,4 +121,8 @@
<value>3600</value>
<comment>Seconds for keep-alive task</comment>
</data>
<data name="UserAgent" xml:space="preserve">
<value>LinphoneWP8</value>
<comment>User-agent to be sent in SIP messages</comment>
</data>
</root>
\ No newline at end of file
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