From: <hor...@us...> - 2011-12-06 15:15:49
|
Revision: 4366 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4366&view=rev Author: horned-reaper Date: 2011-12-06 15:15:37 +0000 (Tue, 06 Dec 2011) Log Message: ----------- Modified Paths: -------------- trunk/plugins/FritzBox/Build/Build.log trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/PhoneBook.cs trunk/plugins/FritzBox/FritzBox/FritzManager/BackGroundWorker.cs trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs trunk/plugins/FritzBox/FritzBox/FritzManager/InversSearchOert.cs trunk/plugins/FritzBox/FritzBox/FritzManager/PhonebookItem.cs trunk/plugins/FritzBox/FritzBox/FritzManager/VBReader.cs trunk/plugins/FritzBox/FritzBox/Settings.cs trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb trunk/plugins/FritzBox/MpeRelease/FritzBox.mpe1 trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.pdb Removed Paths: ------------- trunk/plugins/FritzBox/FritzBox/Resources/ContactImages/ trunk/plugins/FritzBox/FritzBox/Resources/MpeRelease/ trunk/plugins/FritzBox/FritzBox/docs/Changes.txt Modified: trunk/plugins/FritzBox/Build/Build.log =================================================================== --- trunk/plugins/FritzBox/Build/Build.log 2011-12-04 13:48:39 UTC (rev 4365) +++ trunk/plugins/FritzBox/Build/Build.log 2011-12-06 15:15:37 UTC (rev 4366) @@ -1,16 +1,12 @@ Running : C:\Program Files\TortoiseSVN\bin\SubWCRev.exe -SVN Version: 4364 -Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\MP2version\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\Tools\FritzBoxConfigTester\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\Tools\FritzBoxDebugger\Properties\AssemblyInfo.cs +Unable to determine SVN version. Try with a SVN cleanup! +Local SVN not up to date Microsoft (R) Build Engine Version 3.5.30729.1 [Microsoft .NET Framework, Version 2.0.50727.3625] Copyright (C) Microsoft Corporation 2007. All rights reserved. -Build started 04.12.2011 14:47:03. +Build started 06.12.2011 12:15:32. Project "D:\FritzBox\FritzBox.sln" on node 0 (Rebuild target(s)). Building solution configuration "Release|Mixed Platforms". Project "D:\FritzBox\FritzBox.sln" (1) is building "D:\FritzBox\FritzBox\FritzBox.csproj" (2) on node 0 (Rebuild target(s)). @@ -105,13 +101,8 @@ 2 Warning(s) 0 Error(s) -Time Elapsed 00:00:02.62 +Time Elapsed 00:00:02.48 Reverting to build 0 -Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\MP2version\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\Tools\FritzBoxConfigTester\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\Tools\FritzBoxDebugger\Properties\AssemblyInfo.cs ..\FritzBox\bin\Release\FritzBox.dll 1 File(s) copied ..\FritzBox\Resources\speexdec.exe @@ -190,6 +181,6 @@ ..\FritzBox\Languages\Unsupported\strings_zh-CN.xml 36 File(s) copied MpeMaker version: 1.2.1.0 -Build started at 14:47:07 +Build started at 12:15:37 Building "D:\FritzBox\MpeRelease\FritzBox.xmp2" Output: "..\MpeRelease\FritzBox.mpe1" Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2011-12-04 13:48:39 UTC (rev 4365) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2011-12-06 15:15:37 UTC (rev 4366) @@ -46,6 +46,14 @@ PhoneBook = 2 } + internal enum CallListFilter + { + All = 0, + Incoming = 1, + Outgoing = 2, + Rejected = 3 + } + [PluginIcons("FritzBox.FritzBox.png", "FritzBox.FritzBoxDisabled.png")] public class FritzBox : GUIWindow, ISetupForm, IPlugin { @@ -152,7 +160,7 @@ if (!_showNotify) { - Log.Info("external process is running. Notify is queued and will be shown later"); + Log.Info("External process is running. Notify is queued and will be shown later"); _notifyQueue.Add(callAction); return; } @@ -182,7 +190,7 @@ } break; default: - Log.Error("incorrect callAction.Type"); + Log.Error("Incorrect callAction.Type"); break; } } @@ -214,7 +222,7 @@ if (_tempNotify != null) { - Log.Info("yet another dialog is active. action is sent to queue"); + Log.Info("Yet another dialog is active. Action is sent to queue"); if (_actionList.Count < Settings.MaxNotifies - 1) _actionList.Add(callAction); @@ -269,45 +277,43 @@ #region Helper Methods - private string GetCallerImage(string callerId) + private string GetCallerImage(string callerID) { // search image for caller - if (Settings.ExtensiveLogging) - Log.Info("searching image for callerId: " + callerId); + if (Settings.ExtensiveLogging) Log.Info("Searching image for caller ID: " + callerID); string filePath; // use new image path - filePath = Utils.GetCoverArt(ContactPicturesFolder, callerId); + filePath = Utils.GetCoverArt(ContactPicturesFolder, callerID); if (!String.IsNullOrEmpty(filePath)) return filePath; - Log.Info("found image not in: " + ContactPicturesFolder); + Log.Info("Found no image in: " + ContactPicturesFolder); // use old image path - filePath = Utils.GetCoverArt(YacFolder, callerId); + filePath = Utils.GetCoverArt(YacFolder, callerID); if (!String.IsNullOrEmpty(filePath)) return filePath; - Log.Info("found image not in: " + YacFolder); + Log.Info("Found no image in: " + YacFolder); return String.Empty; } private string GetCallerImage(Caller caller) { - if (caller.ID == "") - return UnknownCallerImage; + if (caller.ID == "") return UnknownCallerImage; else { string strImage = GetCallerImage(caller.Name); if (File.Exists(strImage)) { - if (Settings.ExtensiveLogging) Log.Info("found image for caller: " + strImage); - else Log.Info("found image for caller"); + if (Settings.ExtensiveLogging) Log.Info("Found image for caller: " + strImage); + else Log.Info("Found image for caller"); return strImage; } else { - Log.Info("found NO image for caller"); + Log.Info("Found no image for caller"); return MissingCallerImage; } } @@ -317,18 +323,18 @@ { if (!Settings.FilterMSN) { - Log.Info("MSN filter is disabled."); + Log.Info("MSN filter is disabled"); return true; } if (Settings.MSNList.Contains(mSN)) { - Log.Info("MSN is on list."); + Log.Info("MSN is on the list"); return true; } else { - Log.Info("MSN is not on list. Notify won't be shown."); + Log.Info("MSN is not on the list. Notify won't be shown"); return false; } } @@ -337,7 +343,7 @@ { if (!PhoneBook.Enabled) { - Log.Info("Phone book is disabled. Notify will be shown."); + Log.Info("Phone book is disabled. Notify will be shown"); return true; } else if (caller.Show) return true; @@ -513,14 +519,6 @@ #region Nested type: Filter - private enum Filter - { - All = 0, - Incoming = 1, - Outgoing = 2, - Rejected = 3 - } - #endregion #region Nested type: View @@ -564,7 +562,7 @@ // list of call items (callers) private List<CallItem> callItemList; // filter on callitems used in list view - private Filter currentFilter = Filter.All; + private CallListFilter currentFilter = CallListFilter.All; // what kind of items is shown (callers, phoneBook, voicebox) private FritzBoxGuiMode currentMode = FritzBoxGuiMode.CallList; // state of facede view @@ -634,7 +632,8 @@ Stop(); // persist some props for next time - Log.Debug("DeInit called: persisting current props"); + Log.Debug("DeInit called: Persisting current props"); + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlwriter.SetValue("FritzManager", "currentMode", (int)currentFilter); @@ -653,22 +652,21 @@ { phoneBookPath = Config.GetFolder(Config.Dir.Config) + "\\fritzmanagerPhonebook.xml"; mediaPortalLanguage = xmlreader.GetValue("gui", "language"); + passwd = Settings.FmPassword; - vBPath = xmlreader.GetValue("FritzManager", "vBPath"); - dialport = xmlreader.GetValue("FritzManager", "dialport"); - useInversSearch = xmlreader.GetValueAsBool("FritzManager", "useInversSearch", true); - areacode = xmlreader.GetValue("FritzManager", "defaultAreacode"); + vBPath = Settings.FmVBPath; + dialport = Settings.FmDialPort; + useInversSearch = Settings.FmUseInversSearch; + areacode = Settings.FmDefaultAreacode; - string str = xmlreader.GetValue("FritzManager", "currentMode"); + //currentMode = (FritzBoxGuiMode)System.Enum.Parse(typeof(FritzBoxGuiMode), Settings.FmCurrentMode); + //currentFilter = (CallListFilter)System.Enum.Parse(typeof(CallListFilter), Settings.FmcurrentFilter); + + currentMode = Settings.FmCurrentMode; + currentFilter = Settings.FmCurrentFilter; - if (str != null && str != "") currentMode = (FritzBoxGuiMode)System.Enum.Parse(typeof(FritzBoxGuiMode), str); + int interval = Settings.FmUpdateInterval; - str = xmlreader.GetValue("FritzManager", "currentFilter"); - - if (str != null && str != "") currentFilter = (Filter)System.Enum.Parse(typeof(Filter), str); - - int interval = xmlreader.GetValueAsInt("FritzManager", "updateInterval", 0); - if (interval != 0) { thePlugin = this; @@ -864,7 +862,7 @@ if (item != null) { - Log.Debug("replacing label {0} with {1}", item.Label2, name); + Log.Debug("Replacing label {0} with {1}", item.Label2, name); string l = name; if (l.Length > 30) l = name.Substring(0, 30); @@ -938,7 +936,7 @@ } } } - else Log.Debug("no FRITZ!Box phone book items found"); + else Log.Debug("No FRITZ!Box phone book items found"); } /// <summary> @@ -1059,9 +1057,9 @@ i++; - if (currentFilter == Filter.Rejected) if (item.type != 2) continue; - if (currentFilter == Filter.Incoming) if (item.type != 1) continue; - if (currentFilter == Filter.Outgoing) if (item.type != 3) continue; + if (currentFilter == CallListFilter.Rejected) if (item.type != 2) continue; + if (currentFilter == CallListFilter.Incoming) if (item.type != 1) continue; + if (currentFilter == CallListFilter.Outgoing) if (item.type != 3) continue; elem.Label = item.timestamp.ToString(format, ci) + " - " + item.duration.ToString("HH:mm", ci); PhonebookItem pi = phoneBook[item.number]; @@ -1232,17 +1230,17 @@ { switch (currentFilter) { - case Filter.All: - currentFilter = Filter.Incoming; + case CallListFilter.All: + currentFilter = CallListFilter.Incoming; break; - case Filter.Incoming: - currentFilter = Filter.Outgoing; + case CallListFilter.Incoming: + currentFilter = CallListFilter.Outgoing; break; - case Filter.Outgoing: - currentFilter = Filter.Rejected; + case CallListFilter.Outgoing: + currentFilter = CallListFilter.Rejected; break; - case Filter.Rejected: - currentFilter = Filter.All; + case CallListFilter.Rejected: + currentFilter = CallListFilter.All; break; } @@ -1351,16 +1349,16 @@ switch (currentFilter) { - case Filter.All: + case CallListFilter.All: strLine = GUILocalizeStrings.Get(14); // 14 = All break; - case Filter.Incoming: + case CallListFilter.Incoming: strLine = GUILocalizeStrings.Get(15); // 15 = Incoming break; - case Filter.Outgoing: + case CallListFilter.Outgoing: strLine = GUILocalizeStrings.Get(16); // 16 = Outgoing break; - case Filter.Rejected: + case CallListFilter.Rejected: strLine = GUILocalizeStrings.Get(17); // 17 = Rejected break; } Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs 2011-12-04 13:48:39 UTC (rev 4365) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs 2011-12-06 15:15:37 UTC (rev 4366) @@ -308,29 +308,29 @@ FritzBoxClient.LogEvent += OnLogAction; - Log.Debug("FRITZ!Box: Connection test: Start"); + Log.Debug("Connection test: Start"); // set current settings FritzBoxClient.Address = textBoxAddress.Text; FritzBoxClient.Port = (int)numericUpDownPort.Value; // port test - Log.Debug("FRITZ!Box: Connection test: Start port test"); + Log.Debug("Connection test: Start port test"); if (FritzBoxClient.TestConnection()) { // if port test was successful start client - Log.Debug("FRITZ!Box: Connection test: Start client"); + Log.Debug("Connection test: Start client"); FritzBoxClient.StartClient(); FritzBoxClient.LogEvent -= OnLogAction; // stopping client - Log.Debug("FRITZ!Box: Connection test: Stop client"); + Log.Debug("Connection test: Stop client"); FritzBoxClient.StopClient(); } else FritzBoxClient.LogEvent -= OnLogAction; - Log.Debug("FRITZ!Box: Connection test: End"); + Log.Debug("Connection test: End"); } #endregion @@ -418,10 +418,7 @@ SetTextCallback d = OnLogAction; Invoke(d, new object[] { logLevel, logMessage }); } - else - { - labelHelp.Text += logMessage + Environment.NewLine; - } + else labelHelp.Text += logMessage + Environment.NewLine; } #region Nested type: SetTextCallback Modified: trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs 2011-12-04 13:48:39 UTC (rev 4365) +++ trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs 2011-12-06 15:15:37 UTC (rev 4366) @@ -29,378 +29,378 @@ namespace FritzBox { - public static class FritzBoxClient - { - #region class StateObject - - public enum LogLevel + public static class FritzBoxClient { - Info, - Warning, - Error, - Debug, - HeavyDebug, - } + #region class StateObject - /// <summary> - /// State object for receiving data from remote device. - /// </summary> - private class StateObject - { - /// <summary> - /// Size of receive buffer. - /// </summary> - public const int BufferSize = 256; + public enum LogLevel + { + Info, + Warning, + Error, + Debug, + HeavyDebug, + } - /// <summary> - /// Receive buffer. - /// </summary> - public readonly byte[] buffer = new byte[BufferSize]; + /// <summary> + /// State object for receiving data from remote device. + /// </summary> + private class StateObject + { + /// <summary> + /// Size of receive buffer. + /// </summary> + public const int BufferSize = 256; - /// <summary> - /// Received data string. - /// </summary> - public StringBuilder sb = new StringBuilder(); + /// <summary> + /// Receive buffer. + /// </summary> + public readonly byte[] buffer = new byte[BufferSize]; - /// <summary> - /// Client socket. - /// </summary> - public Socket workSocket; - } + /// <summary> + /// Received data string. + /// </summary> + public StringBuilder sb = new StringBuilder(); - #endregion + /// <summary> + /// Client socket. + /// </summary> + public Socket workSocket; + } - #region Delegates + #endregion - public delegate void CallEventHandler(CallAction callAction); + #region Delegates - public delegate void LogEventHandler(LogLevel logLevel, string logMessage); + public delegate void CallEventHandler(CallAction callAction); - #endregion + public delegate void LogEventHandler(LogLevel logLevel, string logMessage); - private static readonly TimeSpan minConnectWaitTime = new TimeSpan(0, 10, 0); + #endregion - private static Socket _client; - private static DateTime _connectionFailed; + private static readonly TimeSpan minConnectWaitTime = new TimeSpan(0, 10, 0); - #region Properties + private static Socket _client; + private static DateTime _connectionFailed; - static FritzBoxClient() - { - Address = "fritz.box"; - Port = 1012; - } + #region Properties - public static string Address { get; set; } - public static int Port { get; set; } + static FritzBoxClient() + { + Address = "fritz.box"; + Port = 1012; + } - #endregion + public static string Address { get; set; } + public static int Port { get; set; } - public static event CallEventHandler CallEvent; + #endregion - public static event LogEventHandler LogEvent; + public static event CallEventHandler CallEvent; - #region Public methods + public static event LogEventHandler LogEvent; - public static void StartClient() - { - try - { - _connectionFailed = DateTime.MinValue; + #region Public methods - Thread thread = new Thread(Connect); - thread.Start(); - } - catch (Exception ex) - { - Log(ex); - } - } + public static void StartClient() + { + try + { + _connectionFailed = DateTime.MinValue; - public static void StopClient() - { - try - { - if (_client != null) + Thread thread = new Thread(Connect); + thread.Start(); + } + catch (Exception ex) + { + Log(ex); + } + } + + public static void StopClient() { - // Release the socket. - _client.Shutdown(SocketShutdown.Both); - _client.Close(); + try + { + if (_client != null) + { + // Release the socket. + _client.Shutdown(SocketShutdown.Both); + _client.Close(); + } + } + catch (Exception ex) + { + Log(LogLevel.Error, "Error on stopping client: " + ex.Message); + } } - } - catch (Exception ex) - { - Log(LogLevel.Error, "Error on stopping client: " + ex.Message); - } - } - public static bool TestConnection() - { - try + public static bool TestConnection() { - Log(LogLevel.Info, "Testing address ({0}) and port ({1})", Address, Port); + try + { + Log(LogLevel.Info, "Testing address ({0}) and port ({1})", Address, Port); - TcpClient tcpClient; + TcpClient tcpClient; - try - { - tcpClient = new TcpClient(Address, Port); + try + { + tcpClient = new TcpClient(Address, Port); + } + catch (Exception) + { + Log(LogLevel.Error, + "Address & port test failed! :(" + Environment.NewLine + + " Did you enter correct connection information?" + Environment.NewLine + + " Are you using the latest FRITZ!Box firmware?" + Environment.NewLine + + " Did you open the port on your FRITZ!Box? If not call #96*5* from your phone."); + + return false; + } + + tcpClient.Close(); + + Log(LogLevel.Info, "Testing address & port succeeded."); + + return true; } - catch (Exception) + catch (Exception ex) { - Log(LogLevel.Error, - "Address & port test failed! :(" + Environment.NewLine + - " Did you enter correct connection information?" + Environment.NewLine + - " Are you using the latest FRITZ!Box firmware?" + Environment.NewLine + - " Did you open the port on your FRITZ!Box? If not call #96*5* from your phone."); + Log(ex); return false; } + } - tcpClient.Close(); + #endregion - Log(LogLevel.Info, "Testing address & port succeeded."); + #region Private methods - return true; - } - catch (Exception ex) + private static void ReConnect() { - Log(ex); + try + { + _connectionFailed = DateTime.Now; - return false; + Thread thread = new Thread(Connect); + thread.Start(); + } + catch (Exception ex) + { + Log(ex); + } } - } - #endregion + private static void Connect() + { + // Enforce a minimum wait time between connects. + DateTime nextconnect = _connectionFailed.Add(minConnectWaitTime); - #region Private methods + if (DateTime.Now < nextconnect) + { + TimeSpan waittime = nextconnect - DateTime.Now; + Log(LogLevel.Debug, "Avoiding too much reconnects, sleeping until {0}", nextconnect.ToString()); + Thread.Sleep(waittime); + } - private static void ReConnect() - { - try - { - _connectionFailed = DateTime.Now; + try + { + //Establish the remote endpoint for the socket. + //The name of the + //remote device is "host.contoso.com". + IPHostEntry ipHostInfo = Dns.GetHostEntry(Address); + IPAddress ipAddress = ipHostInfo.AddressList[0]; + IPEndPoint remoteEP = new IPEndPoint(ipAddress, Port); - Thread thread = new Thread(Connect); - thread.Start(); - } - catch (Exception ex) - { - Log(ex); - } - } + // Create a TCP/IP socket. + _client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); - private static void Connect() - { - // Enforce a minimum wait time between connects. - DateTime nextconnect = _connectionFailed.Add(minConnectWaitTime); - if (DateTime.Now < nextconnect) - { - TimeSpan waittime = nextconnect - DateTime.Now; - Log(LogLevel.Debug, "Avoiding too much reconnects, sleeping until {0}.", nextconnect.ToString()); - Thread.Sleep(waittime); - } + // Connect to the remote endpoint. + _client.BeginConnect(Address, Port, ConnectCallback, _client); + } + catch (SocketException) + { + Log(LogLevel.Debug, "Connect: SocketException"); + Log(LogLevel.Info, "FRITZ!BOX connection lost, trying to reconnect."); + ReConnect(); + } + catch (Exception ex) + { + Log(ex); + } + } - try - { - //Establish the remote endpoint for the socket. - //The name of the - //remote device is "host.contoso.com". - IPHostEntry ipHostInfo = Dns.GetHostEntry(Address); - IPAddress ipAddress = ipHostInfo.AddressList[0]; - IPEndPoint remoteEP = new IPEndPoint(ipAddress, Port); + private static void ConnectCallback(IAsyncResult ar) + { + try + { + // Retrieve the socket from the state object. + Socket client = (Socket)ar.AsyncState; - // Create a TCP/IP socket. - _client = new Socket(AddressFamily.InterNetwork, - SocketType.Stream, ProtocolType.Tcp); + // Complete the connection. + client.EndConnect(ar); - // Connect to the remote endpoint. - _client.BeginConnect(Address, Port, ConnectCallback, _client); - } - catch (SocketException) - { - Log(LogLevel.Debug, "Connect: SocketException"); - Log(LogLevel.Info, "FRITZ!BOX connection lost, trying to reconnect."); - ReConnect(); - } - catch (Exception ex) - { - Log(ex); - } - } + Log(LogLevel.Debug, "Socket connected to {0}", + client.RemoteEndPoint.ToString()); - private static void ConnectCallback(IAsyncResult ar) - { - try - { - // Retrieve the socket from the state object. - Socket client = (Socket) ar.AsyncState; + Receive(client); + } + catch (SocketException) + { + Log(LogLevel.Debug, "Connect: SocketException"); + Log(LogLevel.Info, "FRITZ!BOX connection lost, trying to reconnect."); + ReConnect(); + } + catch (Exception ex) + { + Log(ex); + } + } - // Complete the connection. - client.EndConnect(ar); - Log(LogLevel.Debug, "Socket connected to {0}", - client.RemoteEndPoint.ToString()); + private static void Receive(Socket client) + { + try + { + // Create the state object. + //Log(LogLevel.HeavyDebug, "StateObject state = new StateObject();"); + StateObject state = new StateObject(); + //Log(LogLevel.HeavyDebug, "state.workSocket = client;"); + state.workSocket = client; - Receive(client); - } - catch (SocketException) - { - Log(LogLevel.Debug, "Connect: SocketException"); - Log(LogLevel.Info, "FRITZ!BOX connection lost, trying to reconnect."); - ReConnect(); - } - catch (Exception ex) - { - Log(ex); - } - } + //Log(LogLevel.HeavyDebug, "Available {0}", client.Available); + //Log(LogLevel.HeavyDebug, "Connected {0}", client.Connected); + //Log(LogLevel.HeavyDebug, "IsBound {0}", client.IsBound); + //Log(LogLevel.HeavyDebug, "{0}", client.Connected); + // Begin receiving the data from the remote device. + //Log(LogLevel.HeavyDebug, "client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0,"); + client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReceiveCallback), state); + } + catch (SocketException ex) + { + Log(LogLevel.HeavyDebug, "{0}", ex.NativeErrorCode); + Log(LogLevel.HeavyDebug, "{0}", ex.SocketErrorCode); + Log(LogLevel.HeavyDebug, "{0}", ex.Data); + Log(LogLevel.HeavyDebug, "{0}", ex.ErrorCode); + Log(LogLevel.HeavyDebug, "{0}", ex.InnerException); + Log(LogLevel.HeavyDebug, ex.Message); + Log(LogLevel.HeavyDebug, ex.Source); + Log(LogLevel.HeavyDebug, ex.StackTrace); + Log(LogLevel.Debug, "Receive: SocketException"); + Log(LogLevel.Info, "FRITZ!BOX connection lost, trying to reconnect."); + ReConnect(); + } + catch (Exception ex) + { + Log(ex); + } + } - private static void Receive(Socket client) - { - try - { - // Create the state object. - //Log(LogLevel.HeavyDebug, "StateObject state = new StateObject();"); - StateObject state = new StateObject(); - //Log(LogLevel.HeavyDebug, "state.workSocket = client;"); - state.workSocket = client; + private static void ReceiveCallback(IAsyncResult ar) + { + try + { + // Retrieve the state object and the client socket + // from the asynchronous state object. + StateObject state = (StateObject)ar.AsyncState; + Socket client = state.workSocket; - //Log(LogLevel.HeavyDebug, "Available {0}", client.Available); - //Log(LogLevel.HeavyDebug, "Connected {0}", client.Connected); - //Log(LogLevel.HeavyDebug, "IsBound {0}", client.IsBound); - //Log(LogLevel.HeavyDebug, "{0}", client.Connected); + // Read data from the remote device. + int bytesRead = client.EndReceive(ar); - // Begin receiving the data from the remote device. - //Log(LogLevel.HeavyDebug, "client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0,"); - client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, - new AsyncCallback(ReceiveCallback), state); - } - catch (SocketException ex) - { - Log(LogLevel.HeavyDebug, "{0}", ex.NativeErrorCode); - Log(LogLevel.HeavyDebug, "{0}", ex.SocketErrorCode); - Log(LogLevel.HeavyDebug, "{0}", ex.Data); - Log(LogLevel.HeavyDebug, "{0}", ex.ErrorCode); - Log(LogLevel.HeavyDebug, "{0}", ex.InnerException); - Log(LogLevel.HeavyDebug, ex.Message); - Log(LogLevel.HeavyDebug, ex.Source); - Log(LogLevel.HeavyDebug, ex.StackTrace); - Log(LogLevel.Debug, "Receive: SocketException"); - Log(LogLevel.Info, "FRITZ!BOX connection lost, trying to reconnect."); - ReConnect(); - } - catch (Exception ex) - { - Log(ex); - } - } + if (bytesRead > 0) + { + // There might be more data, so store the data received so far. + string data = Encoding.ASCII.GetString(state.buffer, 0, bytesRead); + Log(LogLevel.HeavyDebug, "ReceiveCallback : received data: {0}", data); + //Log.Debug();"ReceiveCallback : received data: {0}", data - private static void ReceiveCallback(IAsyncResult ar) - { - try - { - // Retrieve the state object and the client socket - // from the asynchronous state object. - StateObject state = (StateObject)ar.AsyncState; - Socket client = state.workSocket; + // data-stream can be in following format: + // incoming calls: DateTime;RING;ConnectionID;CallerID;MSN;??POTS??; + // outgoing calls: DateTime;CALL;ConnectionID;??Nebenstelle??;MSN;CallerID;??POTS??; + // connection started: DateTime;CONNECT;ConnectionID;??Nebenstelle??;CallerID; + // connection closed: DateTime;DISCONNECT;ConnectionID;ConnectedTime; - // Read data from the remote device. - int bytesRead = client.EndReceive(ar); + // DateTime format: + // 12.12.06 12:12:12 + // dd.MM.yy hh:mm:ss - if (bytesRead > 0) - { - // There might be more data, so store the data received so far. - string data = Encoding.ASCII.GetString(state.buffer, 0, bytesRead); - Log(LogLevel.HeavyDebug, "ReceiveCallback : received data: {0}", data); - //Log.Debug();"ReceiveCallback : received data: {0}", data + string[] strList = data.Trim().Split(';'); + CallAction callAction = new CallAction(); - // data-stream can be in following format: - // incoming calls: DateTime;RING;ConnectionID;CallerID;MSN;??POTS??; - // outgoing calls: DateTime;CALL;ConnectionID;??Nebenstelle??;MSN;CallerID;??POTS??; - // connection started: DateTime;CONNECT;ConnectionID;??Nebenstelle??;CallerID; - // connection closed: DateTime;DISCONNECT;ConnectionID;ConnectedTime; + // time when action happens + callAction.Time = DateTime.Parse(strList[0], new CultureInfo("de-DE", false)); - // DateTime format: - // 12.12.06 12:12:12 - // dd.MM.yy hh:mm:ss + // set the type of the callAction + switch (strList[1]) + { + case "RING": + callAction.Type = CallAction.CallType.Incoming; - string[] strList = data.Trim().Split(';'); - CallAction callAction = new CallAction(); + // sets the callerID + callAction.Caller.ID = strList[3]; + callAction.MSN = strList[4]; + break; + case "CALL": + callAction.Type = CallAction.CallType.Outgoing; - // time when action happens - callAction.Time = DateTime.Parse(strList[0], new CultureInfo("de-DE", false)); + // sets the callerID + callAction.Caller.ID = strList[5]; + callAction.MSN = strList[4]; + break; + case "CONNECT": + callAction.Type = CallAction.CallType.ConnectionStarted; - // set the type of the callAction - switch (strList[1]) + // sets the callerID + callAction.Caller.ID = strList[4]; + break; + case "DISCONNECT": + callAction.Type = CallAction.CallType.ConnectionClosed; + break; + default: + callAction = null; + break; + } + + // continue to listen to the fb + client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReceiveCallback), state); + + if (CallEvent != null) CallEvent(callAction); + } + else { - case "RING": - callAction.Type = CallAction.CallType.Incoming; - // sets the callerID - callAction.Caller.ID = strList[3]; - callAction.MSN = strList[4]; - break; - case "CALL": - callAction.Type = CallAction.CallType.Outgoing; - // sets the callerID - callAction.Caller.ID = strList[5]; - callAction.MSN = strList[4]; - break; - case "CONNECT": - callAction.Type = CallAction.CallType.ConnectionStarted; - // sets the callerID - callAction.Caller.ID = strList[4]; - break; - case "DISCONNECT": - callAction.Type = CallAction.CallType.ConnectionClosed; - break; - default: - callAction = null; - break; + Log(LogLevel.Debug, "ReceiveCallback: No bytes to read"); + Log(LogLevel.Info, "FRITZ!BOX connection lost, trying to reconnect."); + ReConnect(); } - - // continue to listen to the fb - client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReceiveCallback), state); - - if (CallEvent != null) CallEvent(callAction); } - else + catch (ObjectDisposedException) { - Log(LogLevel.Debug, "ReceiveCallback: no bytes to read"); + Log(LogLevel.Debug, "ReceiveCallback: ObjectDisposedException"); + Log(LogLevel.Info, "FRITZ!BOX connection shut down."); + } + catch (SocketException) + { + Log(LogLevel.Debug, "ReceiveCallback: SocketException"); Log(LogLevel.Info, "FRITZ!BOX connection lost, trying to reconnect."); ReConnect(); } + catch (Exception ex) + { + Log(ex); + } } - catch (ObjectDisposedException) + + private static void Log(LogLevel logLevel, string format, params object[] arg) { - Log(LogLevel.Debug, "ReceiveCallback: ObjectDisposedException"); - Log(LogLevel.Info, "FRITZ!BOX connection shut down."); + if (LogEvent != null) LogEvent(logLevel, String.Format(format, arg)); } - catch (SocketException) + + private static void Log(Exception ex) { - Log(LogLevel.Debug, "ReceiveCallback: SocketException"); - Log(LogLevel.Info, "FRITZ!BOX connection lost, trying to reconnect."); - ReConnect(); + if (LogEvent != null) LogEvent(LogLevel.Error, ex.ToString()); } - catch (Exception ex) - { - Log(ex); - } - } - private static void Log(LogLevel logLevel, string format, params object[] arg) - { - if (LogEvent != null) - LogEvent(logLevel, String.Format(format, arg)); + #endregion } - - private static void Log(Exception ex) - { - if (LogEvent != null) - LogEvent(LogLevel.Error, ex.ToString()); - } - - #endregion - } } \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/PhoneBook.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/PhoneBook.cs 2011-12-04 13:48:39 UTC (rev 4365) +++ trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/PhoneBook.cs 2011-12-06 15:15:37 UTC (rev 4366) @@ -61,6 +61,7 @@ return _contacts; } + set { _contacts = value; } } @@ -202,7 +203,7 @@ catch (Exception e) { // Let the user know what went wrong. - Log.Error("the file could not be read: {0}", e.Message); + Log.Error("The file could not be read: {0}", e.Message); return 0; } } @@ -219,7 +220,7 @@ PhonebookItem item = phonebook[caller.ID]; if (item != null) { - Log.Info("caller is identified by FritzBox Manager internal phone book as {0}", item.name); + Log.Info("Caller is identified by FritzBox Manager internal phone book as {0}", item.name); return new Caller(caller.ID, item.name, true); } return GetCaller(caller); @@ -235,7 +236,7 @@ if (Contacts.Count == 0) { - Log.Info("phone book is empty. Caller is added to the phone book"); + Log.Info("Phone book is empty. Caller is added to the phone book"); Contacts.Add(caller); } else @@ -249,7 +250,7 @@ if (contact.ID == caller.ID) { - Log.Info("caller is identified by phone book as {0}", contact.Name); + Log.Info("Caller is identified by phone book as {0}", contact.Name); caller = contact; foundCaller = true; } @@ -283,7 +284,7 @@ } catch { - Log.Info("country and area code could not be queried from Windows"); + Log.Info("Country and area code could not be queried from Windows. MSN only works limited"); } } Modified: trunk/plugins/FritzBox/FritzBox/FritzManager/BackGroundWorker.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzManager/BackGroundWorker.cs 2011-12-04 13:48:39 UTC (rev 4365) +++ trunk/plugins/FritzBox/FritzBox/FritzManager/BackGroundWorker.cs 2011-12-06 15:15:37 UTC (rev 4366) @@ -32,7 +32,7 @@ public void Run() { - Log.Debug("starting"); + Log.Debug("Starting"); while (running) { @@ -41,7 +41,7 @@ switch (task.action) { case Task.TaskAction.LoadCallItems: - Log.Debug("loading call items"); + Log.Debug("Loading call items"); byte[] data = fritz.loadCallListData(false); @@ -54,7 +54,7 @@ string info = ""; string name = number; - Log.Debug("invers lookup for{0}", number); + Log.Debug("Inverse lookup for {0}", number); if (plugin.phoneBook[number].name != null) name = plugin.phoneBook[number].name; else name = search.LookupNumber((string)task.param[0], out info); @@ -68,7 +68,7 @@ public void stop() { - Log.Debug("stopping"); + Log.Debug("Stopping"); running = false; } } Modified: trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs 2011-12-04 13:48:39 UTC (rev 4365) +++ trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs 2011-12-06 15:15:37 UTC (rev 4366) @@ -1,10 +1,4 @@ -/* - * Erstellt mit SharpDevelop. - * Benutzer: srinke - * Datum: 11.12.2009 - * Zeit: 08:01 - */ -using System; +using System; using System.IO; using System.Net; using System.Security.Cryptography; @@ -20,7 +14,7 @@ { private string hostname; private string baseurl; - private bool loggedIn; + private bool _loggedIn; private string passwd; private string cacheDir; private string cacheFileName; @@ -41,43 +35,52 @@ this.dialport = dialport; } - public bool alreadyLoggedIn() + public bool loggedIn { - return loggedIn; + get + { + return _loggedIn; + } } - public bool login() + public void login() { - if (alreadyLoggedIn()) return true; - string challenge = getChallenge(); - string md5in = challenge + "-" + passwd; - MD5 md5 = new MD5CryptoServiceProvider(); - byte[] hash = md5.ComputeHash(Encoding.GetEncoding("UTF-16LE").GetBytes(md5in)); - string response = challenge + "-" + BitConverter.ToString(hash).Replace("-", string.Empty).ToLower(); - string sid = PostRequest(baseurl, "login:command/response=" + response + "&getpage=../html/de/menus/menu2.html"); + if (!_loggedIn) + { + string challenge = getChallenge(); + string md5in = challenge + "-" + passwd; + MD5 md5 = new MD5CryptoServiceProvider(); + byte[] hash = md5.ComputeHash(Encoding.GetEncoding("UTF-16LE").GetBytes(md5in)); + string response = challenge + "-" + BitConverter.ToString(hash).Replace("-", string.Empty).ToLower(); + string sid = PostRequest(baseurl, "login:command/response=" + response + "&getpage=../html/de/menus/menu2.html"); - if (sid == "") return false; - - // name="sid" value="" - Regex exp = new Regex("name=\"sid\" value=\"([0-9a-z]*)\"", RegexOptions.Multiline); - MatchCollection matchList = exp.Matches(sid); - sid = matchList[0].Groups[1].Value; - this.sid = sid; - loggedIn = true; - return sid != null; + if (sid != "") + { + // name="sid" value="" + Regex exp = new Regex("name=\"sid\" value=\"([0-9a-z]*)\"", RegexOptions.Multiline); + MatchCollection matchList = exp.Matches(sid); + sid = matchList[0].Groups[1].Value; + this.sid = sid; + _loggedIn = sid != null; + } + else _loggedIn = false; + } } public void keepAlive() { - if (!loggedIn) return; + if (!_loggedIn) return; + string refreshUrl = baseurl + "?sid=" + sid + "&getpage=../html/de/menus/menu2.html"; WebClient client = new WebClient(); + client.DownloadData(refreshUrl); } public void refresh() { - if (!loggedIn) login(); + if (!_loggedIn) login(); + TimeSpan ts = (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0)); long unixTime = Convert.ToInt32(ts.TotalSeconds); string refreshUrl = baseurl + "?sid=" + sid + @@ -88,7 +91,8 @@ //"&logger=settings/filter=2"+ //"&time=settings/time="+Convert.ToString(unixTime)+",-0"; - Log.Debug("sending refresh request, time=" + Convert.ToString(unixTime)); + Log.Debug("Sending refresh request, time = " + Convert.ToString(unixTime)); + try { WebClient client = new WebClient(); @@ -96,7 +100,8 @@ } catch (Exception e) { - Log.Debug("no connection to FritzBox: " + e.Message); + Log.Debug("No connection to FRITZ!Box: " + e.Message); + _loggedIn = false; } } @@ -104,40 +109,43 @@ { byte[] result = { 0 } ; - if (!loggedIn) login(); + if (!_loggedIn) login(); - if (alreadyLoggedIn() && (forceReload || DateTime.Now.Subtract(lastCallListUpdate).Minutes > 2)) + if (!String.IsNullOrEmpty(passwd) && (forceReload || DateTime.Now.Subtract(lastCallListUpdate).Minutes > 2)) { - // direct download from FRITZ!Box - Log.Debug("trying to load call list directly from FRITZ!Box..."); - - try + if (_loggedIn) { - result = loadCallListDataInternal(); - } - catch - { - Log.Debug("could not load call list from FRITZ!Box"); - } - } - else - { - // download from local cache - Log.Debug("trying to load call list from local cache..."); + // direct download from FRITZ!Box + Log.Debug("Trying to load call list directly from FRITZ!Box"); - lock (cacheSync) - { try { - if (File.Exists(cacheFileName)) result = File.ReadAllBytes(cacheFileName); + result = loadCallListDataInternal(); } catch { - Log.Debug("locally cached call list could not be loaded"); + Log.Debug("Could not load call list from FRITZ!Box"); } } + else + { + // download from local cache + Log.Debug("Trying to load call list from local cache"); - //if (result == null) result = loadCallListDataInternal(); + lock (cacheSync) + { + try + { + if (File.Exists(cacheFileName)) result = File.ReadAllBytes(cacheFileName); + } + catch + { + Log.Debug("Locally cached call list could not be loaded"); + } + } + + //if (result == null) result = loadCallListDataInternal(); + } } return result; @@ -145,9 +153,9 @@ public string loadPhoneBook() { - if (!loggedIn) login(); + if (!_loggedIn) login(); - if (alreadyLoggedIn()) + if (_loggedIn) { try { @@ -175,13 +183,13 @@ } catch { - Log.Debug("error on loading phone book"); + Log.Debug("Error on loading phone book"); return ""; } } else { - Log.Debug("no connection to FRITZ!Box. Phone book cannot be loaded"); + Log.Debug("No connection to FRITZ!Box. Phone book cannot be loaded"); return ""; } } @@ -280,7 +288,7 @@ } catch (Exception e) { - Log.Debug("no connection to FritzBox: " + e.Message); + Log.Debug("No connection to FRITZ!Box: " + e.Message); return ""; } } Modified: trunk/plugins/FritzBox/FritzBox/FritzManager/InversSearchOert.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzManager/InversSearchOert.cs 2011-12-04 13:48:39 UTC (rev 4365) +++ trunk/plugins/FritzBox/FritzBox/FritzManager/InversSearchOert.cs 2011-12-06 15:15:37 UTC (rev 4366) @@ -34,10 +34,7 @@ string lookup = nr; info = ""; string response = null; - if (!nr.StartsWith("0")) - { - lookup = defaultAreacode + nr; - } + if (!nr.StartsWith("0")) lookup = defaultAreacode + nr; try { WebClient client = new WebClient(); @@ -51,13 +48,13 @@ } catch (Exception e) { - Log.Debug("exception {0}", e); + Log.Debug("Exception: {0}", e); return name; } if (response.IndexOf("war leider nicht erfolgreich") >= 0) { - Log.Warn("InversSearchOert -> No entry for number [" + lookup + "] found."); + Log.Warn("No entry for number [" + lookup + "] found"); return name; } else @@ -73,15 +70,16 @@ MatchCollection matchList = exp.Matches(response); if (matchList.Count == 0) { - Log.Warn("InversSearchOert -> RegEx doesnt match"); + Log.Warn("RegEx doesn't match"); return name; } name = matchList[0].Groups[1].Value; Log.Debug("Found {0} for {1}", name, lookup); - } // else + } + return name; } #endregion - } // class -} // namespace \ No newline at end of file + } +} \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/FritzManager/PhonebookItem.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzManager/PhonebookItem.cs 2011-12-04 13:48:39 UTC (rev 4365) +++ trunk/plugins/FritzBox/FritzBox/FritzManager/PhonebookItem.cs 2011-12-06 15:15:37 UTC (rev 4366) @@ -51,7 +51,7 @@ } else { - Log.Debug("Could not load FritzManager phone book, file {0} not found", fileName); + Log.Debug("Could not load FritzManager phone book. File {0} cannot be found", fileName); } return result; Modified: trunk/plugins/FritzBox/FritzBox/FritzManager/VBReader.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzManager/VBReader.cs 2011-12-04 13:48:39 UTC (rev 4365) +++ trunk/plugins/FritzBox/FritzBox/FritzManager/VBReader.cs 2011-12-06 15:15:37 UTC (rev 4366) @@ -23,7 +23,7 @@ if (File.Exists(meta)) { - Log.Debug("reading voice box items from {0}", meta); + Log.Debug("Reading voice box items from {0}", meta); FileStream stream = File.OpenRead(meta); MyBinaryReader r = new MyBinaryReader(stream); @@ -71,12 +71,9 @@ item.mynumber = r.ReadCString(); stream.Position = pos; result.Add(item); - Log.Debug("found voice box item {0}", item); + Log.Debug("Found voice box item {0}", item); } - else - { - Log.Debug("bad length inidcator: {0}", len); - } + else Log.Debug("Bad length inidcator: {0}", len); p++; } @@ -91,7 +88,7 @@ Log.Debug("Exception {0}", e.Message); } } - else Log.Debug("voice box path is not set. Voice box cannot be loaded"); + else Log.Debug("Voice box path is not set. Voice box cannot be loaded"); return result; } Modified: trunk/plugins/FritzBox/FritzBox/Settings.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/Settings.cs 2011-12-04 13:48:39 UTC (rev 4365) +++ trunk/plugins/FritzBox/FritzBox/Settings.cs 2011-12-06 15:15:37 UTC (rev 4366) @@ -27,224 +27,206 @@ using MediaPortal.Configuration; using MediaPortal.ServiceImplementations; using System.IO; +using FritzManager; namespace FritzBox { - internal static class Settings - { - #region Variables and constants + internal static class Settings + { + static Logger Log = LoggerFactory.getLogger("Settings"); - private const string PLUGIN_NAME = "FRITZ!Box"; + #region Variables and constants - private static List<String> _msnList; + private const string PLUGIN_NAME = "FRITZ!Box"; - private const string encryptionPassphrase = "j/§=sFf)39=Jd&wVZj37"; + private static List<String> _msnList; - #endregion Variables and constants + private const string encryptionPassphrase = "j/§=sFf)39=Jd&wVZj37"; - #region Properties + #endregion Variables and constants - public static bool ExtensiveLogging { get; set; } + #region Properties - /// <summary> - /// stop media when an event happend - /// </summary> - public static bool StopMedia { get; set; } + public static bool ExtensiveLogging { get; set; } - /// <summary> - /// resume media when notify is closed - /// </summary> - publ... [truncated message content] |