示例#1
0
        /// <summary>
        /// Sets the push notif infos into proxy config contacts params
        /// </summary>
        public void AddPushInformationsToContactParams()
        {
            if (server.LinphoneCore.DefaultProxyConfig != null)
            {
                string host = null, token = null;
                try
                {
                    host  = ((App)App.Current).PushChannelUri.Host;
                    token = ((App)App.Current).PushChannelUri.AbsolutePath;
                }
                catch { }

                if (host == null || token == null)
                {
                    Logger.Warn("Can't set the PN params: {0} {1}\r\n", host, token);
                    return;
                }

                if (Customs.AddPasswordInUriContactsParams)
                {
                    SIPAccountSettingsManager sip = new SIPAccountSettingsManager();
                    sip.Load();
                    server.LinphoneCore.DefaultProxyConfig.ContactUriParameters = "pwd=" + sip.Password + ";app-id=" + host + ";pn-type=wp;pn-tok=" + token;
                }
                else
                {
                    server.LinphoneCore.DefaultProxyConfig.ContactUriParameters = "app-id=" + host + ";pn-type=wp;pn-tok=" + token;
                }
            }
        }