Commit 0194cab7 authored by Sylvain Berfini's avatar Sylvain Berfini

Fix for PN in contact params

parent e62d2702
......@@ -192,7 +192,7 @@ namespace Linphone
private void PushChannel_ErrorOccurred(object sender, NotificationChannelErrorEventArgs e)
{
Debug.WriteLine("[Linphone] Push channel error {0}", e.Message);
}
private const string incomingCallTaskName = "Linphone.IncomingCallTask";
......
......@@ -273,15 +273,7 @@ namespace Linphone.Model
}
server.LinphoneCore.SetUserAgent(DefaultValues.UserAgent, XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("Version").Value);
if (server.LinphoneCore.GetDefaultProxyConfig() != null)
{
string host, token;
host = ((App)App.Current).PushChannelUri.Host;
token = ((App)App.Current).PushChannelUri.AbsolutePath;
SIPAccountSettingsManager sipAccount = new SIPAccountSettingsManager();
sipAccount.Load();
server.LinphoneCore.GetDefaultProxyConfig().SetContactParameters("app-id=" + host + ";pn-type=wp;pn-tok=\"" + token + "\"");
}
AddPushInformationsToContactParams();
lastNetworkState = DeviceNetworkInformation.IsNetworkAvailable;
server.LinphoneCore.SetNetworkReachable(lastNetworkState);
......@@ -290,6 +282,20 @@ namespace Linphone.Model
isLinphoneRunning = true;
}
/// <summary>
/// Sets the push notif infos into proxy config contacts params
/// </summary>
public void AddPushInformationsToContactParams()
{
if (server.LinphoneCore.GetDefaultProxyConfig() != null)
{
string host, token;
host = ((App)App.Current).PushChannelUri.Host;
token = ((App)App.Current).PushChannelUri.AbsolutePath;
server.LinphoneCore.GetDefaultProxyConfig().SetContactParameters("app-id=" + host + ";pn-type=wp;pn-tok=" + token);
}
}
/// <summary>
/// Configures the Logger
/// </summary>
......@@ -729,10 +735,14 @@ namespace Linphone.Model
BaseModel.UIDispatcher.BeginInvoke(() =>
{
Logger.Msg("[LinphoneManager] Registration state changed: " + state.ToString() + ", message=" + message + " for identity " + config.GetIdentity());
LastKnownState = state;
if (BasePage.StatusBar != null)
BasePage.StatusBar.RefreshStatus(state);
try
{
Logger.Msg("[LinphoneManager] Registration state changed: " + state.ToString() + ", message=" + message + " for identity " + config.GetIdentity());
LastKnownState = state;
if (BasePage.StatusBar != null)
BasePage.StatusBar.RefreshStatus(state);
}
catch (Exception) { }
});
}
......
......@@ -367,7 +367,7 @@ namespace Linphone.Model
public void Save()
{
bool AccountChanged = ValueChanged(UsernameKeyName) || ValueChanged(PasswordKeyName) || ValueChanged(DomainKeyName)
|| ValueChanged(ProxyKeyName) || ValueChanged(OutboundProxyKeyName);
|| ValueChanged(ProxyKeyName) || ValueChanged(OutboundProxyKeyName) || ValueChanged(DisplayNameKeyName);
if (AccountChanged)
{
......@@ -433,6 +433,7 @@ namespace Linphone.Model
lc.AddProxyConfig(cfg);
lc.SetDefaultProxyConfig(cfg);
LinphoneManager.Instance.AddPushInformationsToContactParams();
}
}
}
......
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