diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96d4530 --- /dev/null +++ b/.gitignore @@ -0,0 +1,91 @@ +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/.NETFramework,Version=v4.5.2.AssemblyAttributes.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/BBjTapiClient.csproj.FileListAbsolute.txt +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/BBjTapiClient.csproj.CoreCompileInputs.cache +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/BBjTapiClient.csproj.CopyComplete +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/BBjTapiClient.Properties.Resources.resources +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/BBjTAPIClient_MarkupCompile.lref +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/BBjTAPIClient_MarkupCompile.cache +WindowsDotNet/BBjTapiClient/atapi/obj/x86/Debug %25252528x64%25252529/Atapi.csprojAssemblyReference.cache +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/pages/extras.g.i.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/pages/extras.g.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/pages/extras.baml +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/pages/binding.g.i.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/pages/binding.g.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/pages/binding.baml +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/TempPE/Properties.Resources.Designer.cs.dll +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/StyleDictionary.baml +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/MainWindow.g.i.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/MainWindow.g.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/MainWindow.baml +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/F13243757CF6F252D719226C6A14A5A16CA22C41.costura.atapi.dll.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/EE42A33D152F01109E9AA6875E9B2A106160AA64.costura.atapi.pdb.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/B55079E4E269D39ED452CD47E199CDFDADE6D7BB.costura.atapi.pdb.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/BBjTAPIClient_MarkupCompile.i.cache +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/BBjTAPIClient_MarkupCompile.cache +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/BBjTAPIClient.pdb +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/BBjTAPIClient.g.resources +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/BBjTAPIClient.exe +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/App.g.i.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/App.g.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/.NETFramework,Version=v4.5.2.AssemblyAttributes.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/pages/extras.g.i.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/pages/extras.g.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/pages/extras.baml +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/pages/binding.g.i.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/pages/binding.g.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/pages/binding.baml +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/StyleDictionary.baml +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/MainWindow.g.i.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/MainWindow.g.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/MainWindow.baml +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/Costura/FF0EDDF0E6EF75A228D7475C0FA3486FCFB9294D.costura.atapi.dll.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/Costura/B50D3DF27A15A70C812E5F000D315BDA9D47E675.costura.atapi.pdb.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/Costura/50456168A82C93DE2CFD3CE75F1406D56F89540B.costura.costura.dll.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/BBjTapiClient.csprojAssemblyReference.cache +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/BBjTapiClient.csproj.GenerateResource.cache +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/BBjTapiClient.csproj.Fody.CopyLocal.cache +WindowsDotNet/BBjTapiClient/atapi/obj/x86/Release (x64)/.NETFramework,Version=v4.5.2.AssemblyAttributes.cs +WindowsDotNet/BBjTapiClient/atapi/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache +WindowsDotNet/BBjTapiClient/atapi/obj/x86/Debug/Atapi.csprojAssemblyReference.cache +WindowsDotNet/BBjTapiClient/atapi/obj/x86/Debug/.NETFramework,Version=v4.5.2.AssemblyAttributes.cs +WindowsDotNet/BBjTapiClient/atapi/obj/x86/Debug (x64)/Atapi.pdb +WindowsDotNet/BBjTapiClient/atapi/obj/x86/Debug (x64)/Atapi.dll +WindowsDotNet/BBjTapiClient/atapi/obj/x86/Debug (x64)/Atapi.csproj.FileListAbsolute.txt +WindowsDotNet/BBjTapiClient/atapi/obj/x86/Debug (x64)/Atapi.csproj.CoreCompileInputs.cache +WindowsDotNet/BBjTapiClient/atapi/obj/x86/Debug (x64)/.NETFramework,Version=v4.5.2.AssemblyAttributes.cs +WindowsDotNet/BBjTapiClient/atapi/obj/x86/Debug %25252528x64%25252529/DesignTimeResolveAssemblyReferencesInput.cache +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/B542E5BD954733D32553E16D5505D5C26721D6AF.costura.atapi.pdb.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/AA2E2B65C2BE97468CB42EF38BFA30625015542C.costura.atapi.dll.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/9BFDF4C79AB5B438468DC49A9733524F5CB71E09.costura.atapi.dll.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/991C6533103EFA161769799D2EED7804A48DA7E4.costura.atapi.pdb.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/920DC1E34E7F64B5AB3997079263A6094CA2EE0F.costura.atapi.pdb.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/8CD26BD4B8A68D82A65F55FE2FD415086CF408E6.costura.atapi.pdb.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/89762A3B31524B374584C5E49349049F751F3F71.costura.atapi.dll.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/8645B4ECC96AF50DB81186BD1C1986BED2E4BEE2.costura.atapi.dll.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/81316CBAFFC1C97F0B041AA621C13D5CCB2A5D2C.costura.atapi.pdb.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/6456B7D51D42D6C34DA4E968367CE3DE64D4E0AD.costura.atapi.pdb.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/53B1C37F5A7C4DA6490D7C084E0641505B2E3990.costura.atapi.dll.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/50456168A82C93DE2CFD3CE75F1406D56F89540B.costura.costura.dll.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/4B902158CC2C682F71304268BD277FE95BEB65CB.costura.atapi.dll.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/40193D11705578032D482B96B309402EB74ACAB7.costura.atapi.dll.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/3212F3C7B33DC166347A34460F63FCEB12A69B92.costura.atapi.dll.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/29DEC49529C07E70DD624F6CBCE1DAF948190507.costura.atapi.pdb.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/1A97730EFFEAFF0E47F7B97BCAFD6312241074F4.costura.atapi.dll.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/Costura/07860258828B76AB379E4944034F69FAE6493DB8.costura.atapi.pdb.compressed +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/BBjTapiClient.csprojAssemblyReference.cache +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/BBjTapiClient.csproj.GenerateResource.cache +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/BBjTapiClient.csproj.Fody.CopyLocal.cache +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/BBjTapiClient.csproj.FileListAbsolute.txt +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/BBjTapiClient.csproj.CoreCompileInputs.cache +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/BBjTapiClient.csproj.CopyComplete +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/BBjTapiClient.Properties.Resources.resources +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Release/BBjTAPIClient_MarkupCompile.lref +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/BBjTAPIClient.exe +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/App.g.i.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/App.g.cs +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/BBjTAPIClient.pdb +WindowsDotNet/BBjTapiClient/BBjTapiClient/obj/Debug/BBjTAPIClient.g.resources +WindowsDotNet/BBjTapiClient/atapi/obj/x86/Release (x64)/Atapi.csprojAssemblyReference.cache diff --git a/WindowsDotNet/BBjTapiClient/.vs/BBjTapiClient/v16/.suo b/WindowsDotNet/BBjTapiClient/.vs/BBjTapiClient/v16/.suo new file mode 100644 index 0000000..9c08951 Binary files /dev/null and b/WindowsDotNet/BBjTapiClient/.vs/BBjTapiClient/v16/.suo differ diff --git a/WindowsDotNet/BBjTapiClient/BBjTapiClient/App.xaml.cs b/WindowsDotNet/BBjTapiClient/BBjTapiClient/App.xaml.cs index 84ae5ee..5afc5e3 100644 --- a/WindowsDotNet/BBjTapiClient/BBjTapiClient/App.xaml.cs +++ b/WindowsDotNet/BBjTapiClient/BBjTapiClient/App.xaml.cs @@ -13,6 +13,7 @@ using BBjTapiClient.utils; using BBjTapiClient.viewmodels; using System.Windows.Controls; +using System.IO; namespace BBjTapiClient { @@ -27,11 +28,16 @@ public partial class App : Application public static bool isPreparationPhase = true; public static bool isShuttingDown = false; public static bool isRefreshingTapiSession = false; + public static bool isTapiInitRan = false; /* logging */ public static MainWindow mainWin; public static int logCount = 0; public static string lastMessage = ""; + private static bool isCtemp = false; + private static string cTempLogFilename = String.Format("C:\\Temp\\BBjTapiClientNet.{0}.txt", DateTime.Now.Ticks); + private static string cTempLogFilenameMask = String.Format("C:\\Temp\\BBjTapiClientNet.*"); + private static StreamWriter streamLogWriter; /* engine */ public static Tapi tapi; // adapter = "atapi" @@ -66,10 +72,6 @@ public static Settings Setup public static bool isMgrInitializationPhase = false; public static int mgrInitializationPhaseCounter = 0; - /* termination flag retrieved from BBjTapi.bbj for instance */ - /* This might be true if the admin shuts down remotly all active BBjTapiCientNet.exe Clients */ - //public static bool terminationFlag = false; - /* open a page */ public static void displayPage(string pageName) { @@ -99,7 +101,7 @@ public static void minimize() delegate () { mainWin.BtnMinimize_Click(null, null); - } + } ); } @@ -107,11 +109,17 @@ public static void minimize() public static void terminate() { + if (streamLogWriter != null) + { + streamLogWriter.Close(); + streamLogWriter.Dispose(); + streamLogWriter = null; + } mainWin.btnTerminate.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Send, (Action) delegate () { mainWin.BtnTerminate_Click(null, null); // SHUT DOWN APPLICATION - } + } ); } @@ -120,6 +128,16 @@ public static void terminate() /* log information */ public static void log(String message) { + if (streamLogWriter == null && isCtemp) + { + streamLogWriter = new StreamWriter(cTempLogFilename, true, System.Text.Encoding.Default); + } + if (streamLogWriter != null) + { + streamLogWriter.WriteLine(message); + streamLogWriter.Flush(); + } + int maxVisibleLines = 512; if (message != lastMessage) { lastMessage = message; @@ -133,7 +151,7 @@ public static void log(String message) mainWin.logbox.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Send, (Action) delegate () { - if (logCount > 255) + if (logCount > maxVisibleLines) mainWin.logbox.Items.RemoveAt(0); mainWin.logbox.Items.Add(item); mainWin.logbox.SelectedIndex = mainWin.logbox.Items.Count - 1; @@ -143,18 +161,23 @@ public static void log(String message) } backlog.Clear(); } - mainWin.logbox.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Send, (Action) - delegate () - { - if (logCount > 255) - mainWin.logbox.Items.RemoveAt(0); - mainWin.logbox.Items.Add(line); - mainWin.logbox.SelectedIndex = mainWin.logbox.Items.Count - 1; - mainWin.logbox.ScrollIntoView(mainWin.logbox.SelectedItem); - isWorkoutBacklog = true; - } - ); - logCount++; + if (mainWin != null) + { + mainWin.logbox.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Send, (Action) + delegate () + { + if (logCount > maxVisibleLines) + mainWin.logbox.Items.RemoveAt(0); + mainWin.logbox.Items.Add(line); + mainWin.logbox.SelectedIndex = mainWin.logbox.Items.Count - 1; + mainWin.logbox.ScrollIntoView(mainWin.logbox.SelectedItem); + isWorkoutBacklog = true; + } + ); + logCount++; + } + else + backlog.Add(line); } catch { @@ -164,15 +187,69 @@ public static void log(String message) } + /* + * CleanUpFolder + */ + private void CleanUpFolder() + { + App.log($"CleanUpFolder {cTempLogFilenameMask} and removing files older than 16 days."); + try + { + string[] files = Directory.GetFiles(@"C:\Temp\", "BBjTapiClientNet.*", SearchOption.TopDirectoryOnly); + if (files.Length > 0) + { + foreach (var file in files) + { + try + { + FileInfo fi = new FileInfo(file); + TimeSpan age = DateTime.Now.Subtract(fi.CreationTime); + if (age.Days > 16) + { + try + { + File.Delete(file); + App.log("Removing of obsolete file '" + file + "' done."); + } + catch (Exception ex) + { + App.log("Unable to delete file '" + file + "' Exception : " + ex.Message); + } + } + } + catch (Exception ex) + { + App.log("Unable to get age of file '" + file + "' Exception : " + ex.Message); + } + } + } + } + catch (Exception ex) + { + App.log("Unable to get files of folder 'C:/Temp/' using pattern 'BBjTapiClientNet.*'. Exception : " + ex.Message); + } + } + + /* start - process arguments */ private void Application_Startup(object sender, StartupEventArgs e) { + isCtemp = Directory.Exists(@"C:\Temp\"); + if (isCtemp) + CleanUpFolder(); + else + App.log(@"C:\Temp\ does not exist. No logging will be saved in C:\Temp\. The logging is only available at runtime in the buffer of the client in this situation."); tapi = new Tapi(); network = new Network(); registry = new RegEdit(); + setup = new Settings(); // sets defaults, load setup from registry, override setup with values given by the starting args + //#if !DEBUG registry.readAll(); // try to override the defaults with the values stored in the registry + //#endif string arg, value; + string myServer = "", myPort = "", myLine = "", myAddress = "", myExtension = ""; + string prevArg = ""; bool isShowPossibleArgs = false; if (e.Args.Length > 0) { @@ -191,22 +268,27 @@ private void Application_Startup(object sender, StartupEventArgs e) switch (arg.Substring(0, 2)) { case "-S": - App.Setup.Server = value; + prevArg = "-S"; + myServer = value; break; case "-P": - App.Setup.Port = value; + prevArg = "-P"; + myPort = value; break; case "-E": - App.Setup.Extension = value; + prevArg = "-E"; + myExtension = value; break; case "-D": - App.Setup.Line = value; + prevArg = "-D"; + myLine = value; break; case "-A": - App.Setup.Address = value; + prevArg = "-A"; + myAddress = value; break; default: - App.log("Unknown arg received: " + arg); + App.log($"Unknown arg received: '{arg}'."); isShowPossibleArgs = true; break; } @@ -215,19 +297,77 @@ private void Application_Startup(object sender, StartupEventArgs e) if (arg.Length > 6) { if (arg.Substring(0, 6) == "-debug") + { App.Setup.Debugfilename = arg.Substring(6); + App.log("Using Start-Argument -debug"); + } + } + } + else + { + App.log($"Invalid arg format: {arg}. The previous type of arg was '{prevArg}'."); + if (prevArg != "") + { + if (prevArg == "-S") + { + myServer = myServer + " " + arg; + App.log($"Appending '{arg}' to the previous -S(ERVER) setting separated by a blank character"); + } + if (prevArg == "-E") + { + myExtension = myExtension + " " + arg; + App.log($"Appending '{arg}' to the previous -E(XTENSION) setting separated by a blank character"); + } + if (prevArg == "-D") + { + myLine = myLine + " " + arg; + App.log($"Appending '{arg}' to the previous -D(EVICE) setting separated by a blank character"); + } + if (prevArg == "-A") + { + myAddress = myAddress + " " + arg; + App.log($"Appending '{arg}' to the previous -A(DDRESS) setting separated by a blank character"); + } } } + } + if (myServer != "") + { + if (myServer != "localhost") + { + App.Setup.Server = myServer; + App.log($"Using Start-Argument -S of value '{myServer}'. This is the BBjTapi.bbj bound Host Address."); + } else { - App.log("Invalid arg format: " + arg); + App.log($"Ignoring Start-Argument -S of value '{myServer}' foreseen for the BBjTapi.bbj binding, because it's the default. Keeping an optional deviant address read from registry."); } } + if (myPort != "") + { + App.Setup.Port = myPort; + App.log($"Using Start-Argument -P of value '{myPort}'. This is the BBjTapi.bbj bound Port number."); + } + if (myExtension != "") + { + App.Setup.Extension = myExtension; + App.log($"Using Start-Argument -E of value '{myExtension}'. This is the BBj collaborating Extension."); + } + if (myLine != "") + { + App.Setup.Line = myLine; + App.log($"Using Start-Argument -D of value '{myLine}'. This is the major TAPI Line/Device."); + } + if (myAddress != "") + { + App.Setup.Address = myAddress; + App.log($"Using Start-Argument -A of value '{myAddress}'. This is the minor TAPI Address of the Line/Device."); + } } else startAppSilent = false; // if no args are given, show a BalloonTip briefly. if (isShowPossibleArgs) - App.log("Valid args are : -S.., -P.., -E.., -D.., -A.., -debug.."); + App.log("Valid args are : -S.., -P.., -E.., -D.., -A.., -debug.. (Server,Port,Extension,Device,Address)"); } diff --git a/WindowsDotNet/BBjTapiClient/BBjTapiClient/MainWindow.xaml b/WindowsDotNet/BBjTapiClient/BBjTapiClient/MainWindow.xaml index 99111fc..bdff7a5 100644 --- a/WindowsDotNet/BBjTapiClient/BBjTapiClient/MainWindow.xaml +++ b/WindowsDotNet/BBjTapiClient/BBjTapiClient/MainWindow.xaml @@ -7,7 +7,7 @@ xmlns:local="clr-namespace:BBjTapiClient" xmlns:project="clr-namespace:BBjTapiClient" mc:Ignorable="d" - Title="" Height="600" Width="800" Closing="mainWin_Closing" Closed="mainWin_Closed" Loaded="mainWin_Loaded" MinWidth="800" MinHeight="600" Visibility="Hidden"> + Title="" Height="600" Width="800" Closing="mainWin_Closing" Closed="mainWin_Closed" Loaded="mainWin_Loaded" MinWidth="800" MinHeight="600" Visibility="Visible" WindowStartupLocation="CenterScreen"> diff --git a/WindowsDotNet/BBjTapiClient/BBjTapiClient/MainWindow.xaml.cs b/WindowsDotNet/BBjTapiClient/BBjTapiClient/MainWindow.xaml.cs index da047f2..9ccd07a 100644 --- a/WindowsDotNet/BBjTapiClient/BBjTapiClient/MainWindow.xaml.cs +++ b/WindowsDotNet/BBjTapiClient/BBjTapiClient/MainWindow.xaml.cs @@ -1,22 +1,7 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - using System.Windows.Forms; -using System.Drawing.Imaging; using System.Timers; -using System.Threading; using JulMar.Atapi; using System.Reflection; @@ -150,7 +135,7 @@ private void mainWin_Closing(object sender, System.ComponentModel.CancelEventArg e.Cancel = cancelShutDown; } } - + /* triggered by close() - final cleanup activities */ private void mainWin_Closed(object sender, EventArgs e) @@ -188,16 +173,16 @@ public void closeApplication(bool isHarderTermination) { var text = "TIMEOUT! READ CAREFULLY!" + " THE TAPI MANAGER INITIALIZATION PROCESS TAKES TOO LONG!" + - " PLEASE ENSURE A CLOSED CONFIGURATION OF THE TELEPHONY SERVICE PROVIDER MAINTENANCE!" + - " MEANS, IF YOU HAVE OPENED THE WINDOWS SYSTEM CONTROL PANEL BEFORE AND HAVE MOVED TO PHONE AND MODEM" + - " DETAILS, YOU HAVE TO CLOSE THEM."+ - " DO DESTROY THIS TAPI CLIENT NOW! RESTART IT AFTER THE UPPER INSTRUCTIONS HAVE BEEN FOLLOWED!"; + " PLEASE ENSURE A CLOSED CONFIGURATION OF THE TELEPHONY SERVICE PROVIDER MAINTENANCE IN YOUR WINDOWS OPERATING SYSTEM ENVIRONMENT!" + + " MEANS, IF YOU HAVE OPENED THE WINDOWS SYSTEM CONTROL PANEL OVERVIEW TO CONCRETE CHECK THE PHONE AND MODEM" + + " DETAILS, THEN CLOSE IT! THE OPENED TAPI DETAILS ARE PREVENTING THIS APPLICATION FROM CONSUMING THE WINDOWS TAPI SETTINGS!" + + " DO NOW DESTROY THIS TAPI BBJ CLIENT! RESTART THE BBJ TAPI CLIENT AFTER CLOSING ALL WINDOWS CONTROL PANEL TAPI OPTIONS (PHONE AND MODEM)!"; System.Windows.MessageBox.Show(text); App.terminate(); } } else - { + { try { Close(); @@ -211,7 +196,7 @@ public void closeApplication(bool isHarderTermination) #endregion #region miscellaneous - + /* tray icon balloon tip */ public void showBalloonTip(string text) { @@ -253,7 +238,7 @@ private void setMainWindowTitle() /* if the app run silently in the background as usual - this method won't be called */ private void mainWin_Loaded(object sender, RoutedEventArgs e) { - App.tapi.init(); // CRITICAL + App.tapi.init(true); // CRITICAL //raiseAppTapiInit = true; // execute App.tapi.init() in the time to ensure an displayed window! } @@ -283,18 +268,14 @@ private void stopTimer() } - /* check if BBjTapi was started in the time being / if the connection is available now */ + /* check if BBjTapi was started in the time being / if the connection is available now / this timer event is raised every 2 seconds */ private void raiseTimer(object sender, ElapsedEventArgs e) { - // if (raiseAppTapiInit) - // { - // raiseAppTapiInit = false; - // App.tapi.init(); // CRITICAL - PROCESS MAY HANG - get lines -- display lines - // } if (App.isMgrInitializationPhase) { - App.mgrInitializationPhaseCounter++; - if (App.mgrInitializationPhaseCounter==8) + App.mgrInitializationPhaseCounter++; // +1 for each 2 seconds + /* due to AVAYA TAPI compatibility increase the timeout from 8x2 seconds to 12x2 seconds */ + if (App.mgrInitializationPhaseCounter == 14) { /* timeout of mgr.Initialize() */ App.isMgrInitializationPhase = false; @@ -309,7 +290,7 @@ private void raiseTimer(object sender, ElapsedEventArgs e) { tickCounter++; /* this program may only run once using this EXTENSION - avoid parallel processing of the same Extension */ - if (App.mutex==null && App.Setup.Extension!= "") + if (App.mutex == null && App.Setup.Extension != "") { App.mutex = new System.Threading.Mutex(true, "BBjTAPIClient.Net.Extension" + App.Setup.Extension, out App.createdNewMutex); /** the App.createdNewMutex should prevent from further parallel processing the same extension on the same server */ @@ -328,7 +309,7 @@ private void raiseTimer(object sender, ElapsedEventArgs e) App.network.initialize(); // async embedded - continues before initialize call is completed - is okay here } /* attempt to connect tapi line from time to time */ - if (App.Setup.IsTapiSessionConnected == false && tickCounter>0 && tickCounter % 5 == 0) + if (App.Setup.IsTapiSessionConnected == false && tickCounter > 0 && tickCounter % 5 == 0) App.isRefreshingTapiSession = true; /* refresh tapi line session */ if (App.isRefreshingTapiSession) diff --git a/WindowsDotNet/BBjTapiClient/BBjTapiClient/Properties/AssemblyInfo.cs b/WindowsDotNet/BBjTapiClient/BBjTapiClient/Properties/AssemblyInfo.cs index 7edb4bb..4c80fbe 100644 --- a/WindowsDotNet/BBjTapiClient/BBjTapiClient/Properties/AssemblyInfo.cs +++ b/WindowsDotNet/BBjTapiClient/BBjTapiClient/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("BASIS Europe")] [assembly: AssemblyProduct("BBjTapiClient")] -[assembly: AssemblyCopyright("Copyright © 2018 BASIS Europe. All rights reserved.")] +[assembly: AssemblyCopyright("Copyright © 2021 BASIS Europe. All rights reserved. DotNet implemntation by RVDH of DAGOCAR.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -51,5 +51,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.2.0")] -[assembly: AssemblyFileVersion("1.1.2.0")] +[assembly: AssemblyVersion("1.2.3.0")] +[assembly: AssemblyFileVersion("1.2.3.0")] diff --git a/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Debug/BBjTAPIClient.exe b/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Debug/BBjTAPIClient.exe index e8a8d7c..808a9aa 100644 Binary files a/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Debug/BBjTAPIClient.exe and b/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Debug/BBjTAPIClient.exe differ diff --git a/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Debug/BBjTAPIClient.pdb b/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Debug/BBjTAPIClient.pdb index b35d8e7..928ffae 100644 Binary files a/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Debug/BBjTAPIClient.pdb and b/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Debug/BBjTAPIClient.pdb differ diff --git a/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Release/BBjTAPIClient.exe b/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Release/BBjTAPIClient.exe index beda9df..7ddd84a 100644 Binary files a/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Release/BBjTAPIClient.exe and b/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Release/BBjTAPIClient.exe differ diff --git a/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Release/BBjTAPIClient.pdb b/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Release/BBjTAPIClient.pdb deleted file mode 100644 index 12c6c73..0000000 Binary files a/WindowsDotNet/BBjTapiClient/BBjTapiClient/bin/Release/BBjTAPIClient.pdb and /dev/null differ diff --git a/WindowsDotNet/BBjTapiClient/BBjTapiClient/pages/binding.xaml.cs b/WindowsDotNet/BBjTapiClient/BBjTapiClient/pages/binding.xaml.cs index 97db523..8f0aba5 100644 --- a/WindowsDotNet/BBjTapiClient/BBjTapiClient/pages/binding.xaml.cs +++ b/WindowsDotNet/BBjTapiClient/BBjTapiClient/pages/binding.xaml.cs @@ -1,17 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; +using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; namespace BBjTapiClient.pages { @@ -33,19 +21,25 @@ public binding() InitializeComponent(); } + // major LINE/DEVICE SELECTOR private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!isSuppressLineRefresh) { + isSuppressAddressRefresh = isSuppressLineRefresh; ComboBox cb = (ComboBox)sender; App.tapi.setCurrentLine((string)cb.SelectedItem); App.isRefreshingTapiSession = true; // impulse for re-connecting - Addresses.Text = App.tapi.currentAddress.Address; // refresh the address - mostly the only one available within the TAPI LINE + if (App.tapi.currentAddress != null) + Addresses.Text = App.tapi.currentAddress.Address; // refresh the address - mostly the only one available within the TAPI LINE + else + App.log($"Unable to fill combo box named 'Adresses'. The TAPI object 'currentAddress' is NULL."); App.Setup.Line = (string)cb.SelectedItem; } isSuppressLineRefresh = false; } + // minor ADDRESS SELECTOR private void ComboBox_SelectionChanged_1(object sender, SelectionChangedEventArgs e) { if (!isSuppressAddressRefresh) @@ -61,16 +55,15 @@ private void ComboBox_SelectionChanged_1(object sender, SelectionChangedEventArg private void Page_Loaded(object sender, RoutedEventArgs e) { - //App.isBindingPageLoaded = true; if (Lines.Text == "") { if (App.Setup.Address != "") { + isSuppressLineRefresh = true; isSuppressAddressRefresh = true; Addresses.Text = App.Setup.Address; + Lines.Text = App.Setup.Line; } - isSuppressLineRefresh = true; - Lines.Text = App.Setup.Line; }; } diff --git a/WindowsDotNet/BBjTapiClient/BBjTapiClient/utils/RegEdit.cs b/WindowsDotNet/BBjTapiClient/BBjTapiClient/utils/RegEdit.cs index 4d39682..29d050d 100644 --- a/WindowsDotNet/BBjTapiClient/BBjTapiClient/utils/RegEdit.cs +++ b/WindowsDotNet/BBjTapiClient/BBjTapiClient/utils/RegEdit.cs @@ -101,7 +101,7 @@ public void readAll() if (value != "") { App.Setup.Line = value; - App.log(String.Format("Read Line '{0}' from registry", value)); + App.log(String.Format("Read the major Line/Device '{0}' from registry", value)); exi = true; } @@ -109,7 +109,7 @@ public void readAll() if (value != "") { App.Setup.Address = value; - App.log(String.Format("Read Address '{0}' from registry", value)); + App.log(String.Format("Read the minor Address '{0}' of the Line/Device from registry", value)); exi = true; } @@ -117,7 +117,7 @@ public void readAll() if (value != "") { App.Setup.Extension = value; - App.log(String.Format("Read Extension '{0}' from registry", value)); + App.log(String.Format("Read collaborating BBj Extension '{0}' from registry", value)); exi = true; } @@ -125,7 +125,7 @@ public void readAll() if (value != "") { App.Setup.Server = value; - App.log(String.Format("Read Host '{0}' from registry", value)); + App.log(String.Format("Read BBjTapi.bbj bound Host '{0}' from registry", value)); exi = true; } @@ -133,7 +133,7 @@ public void readAll() if (value != "") { App.Setup.Port = value; - App.log(String.Format("Read Port '{0}' from registry", value)); + App.log(String.Format("Read BBjTapi.bbj bound Port '{0}' from registry", value)); exi = true; } if (exi) diff --git a/WindowsDotNet/BBjTapiClient/BBjTapiClient/utils/Tapi.cs b/WindowsDotNet/BBjTapiClient/BBjTapiClient/utils/Tapi.cs index 1b1323e..2155a1b 100644 --- a/WindowsDotNet/BBjTapiClient/BBjTapiClient/utils/Tapi.cs +++ b/WindowsDotNet/BBjTapiClient/BBjTapiClient/utils/Tapi.cs @@ -25,7 +25,7 @@ public class Tapi : IDisposable private ITapiCall currentIncomingCall; string callNumberAsSoonAsPossible = ""; public string allLinesAndAddresses = ""; - + /* changed event states */ bool lastCanMakeCall = false; bool lastLocked = false; @@ -46,13 +46,15 @@ public Tapi() /* is called when main win is loaded */ - public void init() + public void init(bool isInFrontend) { + App.log($"init(isInFrontEnd={isInFrontend})"); App.isMgrInitializationPhase = true; bool didInitalize = false; try { didInitalize = mgr.Initialize(); // CRITICAL - will remain in an endless loop, if the windows system CONTROL PANEL is opened and the current bound TAPI DRIVER configuration is opened! + App.log($"tapi mgmt initialize state (didInitalize) is '{didInitalize}'"); } catch (Exception ex) { @@ -61,8 +63,11 @@ public void init() App.isMgrInitializationPhase = false; if (didInitalize) { - App.Setup.Lines.Clear(); - App.Setup.Addresses.Clear(); + if (isInFrontend) + { + App.Setup.Lines.Clear(); + App.Setup.Addresses.Clear(); + } currentLine = null; currentAddress = null; addressCollection = null; @@ -73,11 +78,13 @@ public void init() App.log(String.Format("{0}x TSP (Telephony service provider) lines detected", lineCollection.Count())); foreach (TapiLine line in lineCollection) { - App.Setup.Lines.Add(line.Name); + if (isInFrontend) + App.Setup.Lines.Add(line.Name); //line.Changed += Line_Changed; //line.NewCall += Line_NewCall; //line.Ringing += Line_Ringing; allLinesAndAddresses += "|" + line.Name; + App.log(String.Format("Okay, line '{0}' detected and added to buffer", line.Name)); if (line.Addresses != null) { if (line.Addresses.Count() > 0) @@ -85,10 +92,11 @@ public void init() foreach (TapiAddress adr in line.Addresses) { allLinesAndAddresses += "~" + adr.Address; + App.log(String.Format("Okay, assigning address of '{0}' to line of '{1}'", adr.Address, line.Name)); } } else - App.log(String.Format("Line '{0}' addresses are empty!", line.Name)); + App.log(String.Format("Unable to assign address to line '{0}'! Address is not available!", line.Name)); } else App.log(String.Format("Line '{0}' addresses collection is NULL!", line.Name)); @@ -96,18 +104,29 @@ public void init() if (allLinesAndAddresses != "") allLinesAndAddresses = allLinesAndAddresses.Substring(1); - if (App.Setup.Line != "") + if (isInFrontend) + { + if (App.Setup.Line != "") + setCurrentLine(App.Setup.Line); + if (App.Setup.Address != "") + setCurrentAddress(App.Setup.Address); + } + else + { setCurrentLine(App.Setup.Line); - if (App.Setup.Address != "") setCurrentAddress(App.Setup.Address); + } App.isRefreshingTapiSession = true; // start session } + else + App.log($"tapi mgmt initialize failed"); + App.isTapiInitRan = true; } /* is called when the item in the Device combobox has been changed */ - public void setCurrentLine(string lineName) + public void setCurrentLine(string lineName, bool isFrontend = true) { if (lineCollection.Count() > 0) { @@ -124,21 +143,28 @@ public void setCurrentLine(string lineName) currentLine.Ringing += Line_Ringing; App.log(String.Format("Selected TAPI line - current line is '{0}'", currentLine.Name)); addressCollection = (TapiAddress[])item.Addresses; - App.Setup.Addresses.Clear(); + if (isFrontend) + App.Setup.Addresses.Clear(); if (addressCollection.Count() == 1) { App.log(String.Format("Selected TAPI line includes one address {0}", addressCollection[0].Address)); - App.Setup.Addresses.Clear(); - App.Setup.Addresses.Add(addressCollection[0].Address); // refresh Addresses combobox content + if (isFrontend) + { + App.Setup.Addresses.Clear(); + App.Setup.Addresses.Add(addressCollection[0].Address); // refresh Addresses combobox content + } setCurrentAddress(addressCollection[0].Address); } else { App.log(String.Format("Selected TAPI line includes {0}x addresses", addressCollection.Count())); - App.Setup.Addresses.Clear(); - foreach (var address in addressCollection) + if (isFrontend) { - App.Setup.Addresses.Add(address.Address); // refresh Addresses combobox content + App.Setup.Addresses.Clear(); + foreach (var address in addressCollection) + { + App.Setup.Addresses.Add(address.Address); // refresh Addresses combobox content + } } } App.registry.write("Device", currentLine.Name); @@ -178,7 +204,7 @@ private void CurrentAddress_CallStateChanged(object sender, CallStateEventArgs e string value = ""; value = Enum.GetName(typeof(CallState), e.CallState); - if (value!=null && value!="") + if (value != null && value != "") divState += String.Format("- CallState '{0}'", value); value = Enum.GetName(typeof(CallState), e.OldCallState); @@ -210,7 +236,7 @@ private void CurrentAddress_CallStateChanged(object sender, CallStateEventArgs e divState += String.Format("- CallReason '{0}'", value); value = e.Call.ConnectedId; - if (value != null && value != "") + if (value != null && value != "") divState += String.Format("- ConnectedId '{0}'", e.Call.ConnectedId); value = e.Call.ConnectedName; @@ -240,7 +266,7 @@ private void CurrentAddress_CallStateChanged(object sender, CallStateEventArgs e if (value != null && value != "") divState += String.Format("- UserInfo '{0}'", value); - if (divState!=lastAddressDetailStates) + if (divState != lastAddressDetailStates) App.log("TAPI Adress state changed " + divState); lastAddressDetailStates = divState; } @@ -266,7 +292,7 @@ public void startSession() try { currentLine.Open(currentLine.Capabilities.MediaModes); - App.log(String.Format("Opened TAPI line '{0}' (MediaModes)",currentLine.Name)); + App.log(String.Format("Opened TAPI line '{0}' (MediaModes)", currentLine.Name)); hasBeenOpened = true; } catch (TapiException te) @@ -283,7 +309,7 @@ public void startSession() try { currentLine.Open(MediaModes.DataModem); - App.log(String.Format("Opened TAPI line '{0}' (alternative DataModem)",currentLine.Name)); + App.log(String.Format("Opened TAPI line '{0}' (alternative DataModem)", currentLine.Name)); hasBeenOpened = true; } catch (TapiException te) @@ -358,11 +384,21 @@ public void dropCall() } catch (Exception ex) { - App.log("TAPI address - Unable to drop call. " + ex.Message); + App.log("TAPI address - Unable to drop call. currentOutgoingCall.Drop() Exception : " + ex.Message); + if (ex.InnerException != null) + if (ex.InnerException.Message != null) + if (ex.InnerException.Message != ex.Message) + App.log($"TAPI address - currentOutgoingCall.Drop(); Inner Exception : {ex.InnerException.Message}"); } } + else + App.log($"TAPI address - currentOutgoingCall.Line.IsOpen is false - can't performing 'drop a call'."); } + else + App.log($"TAPI address - currentOutgoingCall.Line is null - can't performing 'drop a call'."); } + else + App.log($"TAPI address - currentOutgoingCall is null - can't performing 'drop a call'."); } /* make outgoing call */ @@ -371,27 +407,55 @@ public void makeCall(string plainPhoneNumber) App.log("TAPI address - Making outgoing call to '" + plainPhoneNumber + "'"); if (currentAddress != null) { + //App.log("TAPI address - Code 2101280742 - okay, currentAddress is not null"); if (currentAddress.Address != "") { + //App.log("TAPI address - Code 2101280743 - okay, currentAddress.Address is not empty"); if (!App.Setup.CanMakeCall) { + App.log($"TAPI address - App.Setup.CanMakeCall is false - can't perform outgoing call - calling dropCall() now."); dropCall(); callNumberAsSoonAsPossible = plainPhoneNumber; } else { - try - { - currentOutgoingCall = currentAddress.MakeCall(plainPhoneNumber); - App.log(String.Format("TAPI address - Made call to '{0}'", plainPhoneNumber)); - } - catch (Exception ex) + //App.log("TAPI address - Code 2101280744 - okay, App.Setup.CanMakeCall is true"); + if (currentAddress.Status == null) + App.log("TAPI address - currentAddress.Status is null - can't perform outgoing call"); + else { - App.log(ex.Message); + //App.log("TAPI address - Code 2101280758 - okay, currentAddress.Status is not null"); + bool mayMakeCall = currentAddress.Status.CanMakeCall; + if (!mayMakeCall) + App.log("TAPI address - currentAddress.Status.CanMakeCall is false - can't perform outgoing call"); + else + { + //App.log("TAPI address - Code 2101280759 - okay, currentAddress.Status.CanMakeCall is true"); + try + { + //App.log("TAPI address - Code 2101280745 - okay, doing currentOutgoingCall = currentAddress.MakeCall(plainPhoneNumber);"); + var x = currentAddress.Status.CanMakeCall; + currentOutgoingCall = currentAddress.MakeCall(plainPhoneNumber); + App.log(String.Format("TAPI address - Made call to '{0}'", plainPhoneNumber)); + } + catch (Exception ex) + { + App.log($"TAPI address - currentAddress.MakeCall('{plainPhoneNumber}'); Exception : {ex.Message}"); + if (ex.InnerException != null) + if (ex.InnerException.Message != null) + if (ex.InnerException.Message != ex.Message) + App.log($"TAPI address - currentAddress.MakeCall('{plainPhoneNumber}'); Inner Exception : {ex.InnerException.Message}"); + } + } } } } + else + App.log($"TAPI address - currentAddress.Address is empty - can't perform outgoing call"); } + else + App.log($"TAPI address - currentAddress is null - can't perform outgoing call"); + } @@ -413,7 +477,7 @@ private void Line_NewCall(object sender, NewCallEventArgs e) string callingPhoneNumber = currentIncomingCall.CallerId; App.log(String.Format("TAPI line - Incoming call event - Caller ID '{0}' - Called ID '{1}' - Privilege '{2}' - Call '{3}'", currentIncomingCall.CallerId, currentIncomingCall.CalledId, e.Privilege, e.Call)); App.network.incomingCall(callingPhoneNumber); - e.Call.Line.Monitor(); + e.Call.Line.Monitor(); //currentIncomingCall.Line.Close(); //currentIncomingCall.Line.Dispose(); //currentIncomingCall.Dispose(); @@ -474,7 +538,7 @@ private void refreshStateFlags() state = currentLine.Status.Connected; if (state != lastConnected) divStates += String.Format("- Connected '{0}'", state); - lastConnected= state; + lastConnected = state; App.Setup.IsTapiSessionConnected = state; // must have state = currentLine.Status.Locked; @@ -483,19 +547,19 @@ private void refreshStateFlags() lastLocked = state; state = currentLine.Status.MessageWaitingLampState; - if (state!=lastLampState) + if (state != lastLampState) divStates += String.Format("- Waiting Lamp '{0}'", state); lastLampState = state; state = currentLine.Status.InService; - if (state!=lastInService) + if (state != lastInService) divStates += String.Format("- In Service '{0}'", state); - lastInService= state; + lastInService = state; //state = (currentLine.Capabilities.SupportsForwarding && currentLine.IsOpen); //App.log(String.Format("TAPI line support forwarding state is {0}", state)); - if (divStates!=lastLineStates && divStates!="") + if (divStates != lastLineStates && divStates != "") App.log(String.Format("TAPI Line {0}", divStates)); lastLineStates = divStates; @@ -504,18 +568,18 @@ private void refreshStateFlags() lastCanMakeCall = App.Setup.CanMakeCall; if (App.Setup.CanMakeCall != lastCanMakeCall) divStates += String.Format("- Can make call '{0}'", state); - + state = (currentAddress != null && currentAddress.Status.CanPickupCall); - if (state!=lastCanPickUpCall) + if (state != lastCanPickUpCall) divStates += String.Format("- Can pick up call '{0}'", state); - lastCanPickUpCall= state; + lastCanPickUpCall = state; App.Setup.CanMakeCall = (currentLine.Status.Connected && currentAddress != null && currentAddress.Status.CanMakeCall); //state = (currentAddress != null && currentAddress.Status.CanUnparkCall); //App.log(String.Format("TAPI address can unpark call state is {0}", state)); - if (divStates!=lastAddressStates && divStates!="") + if (divStates != lastAddressStates && divStates != "") App.log(String.Format("TAPI Address {0}", divStates)); lastAddressStates = divStates; diff --git a/WindowsDotNet/BBjTapiClient/BBjTapiClient/viewmodels/Settings.cs b/WindowsDotNet/BBjTapiClient/BBjTapiClient/viewmodels/Settings.cs index 08523e1..afdcb9f 100644 --- a/WindowsDotNet/BBjTapiClient/BBjTapiClient/viewmodels/Settings.cs +++ b/WindowsDotNet/BBjTapiClient/BBjTapiClient/viewmodels/Settings.cs @@ -70,7 +70,6 @@ public string Server App.network.disconnect(); App.network.initialize(); // method code continues before call is completed - is okay here } - } } diff --git a/WindowsDotNet/BBjTapiClient/atapi/bin/x64/Debug/Atapi.dll b/WindowsDotNet/BBjTapiClient/atapi/bin/x64/Debug/Atapi.dll index 1250ad9..8f1f98d 100644 Binary files a/WindowsDotNet/BBjTapiClient/atapi/bin/x64/Debug/Atapi.dll and b/WindowsDotNet/BBjTapiClient/atapi/bin/x64/Debug/Atapi.dll differ diff --git a/WindowsDotNet/BBjTapiClient/atapi/bin/x64/Debug/Atapi.pdb b/WindowsDotNet/BBjTapiClient/atapi/bin/x64/Debug/Atapi.pdb deleted file mode 100644 index 913d8b9..0000000 Binary files a/WindowsDotNet/BBjTapiClient/atapi/bin/x64/Debug/Atapi.pdb and /dev/null differ diff --git a/WindowsDotNet/binary/BBjTAPIClient.exe b/WindowsDotNet/binary/BBjTAPIClient.exe index b8c263f..cdce794 100644 Binary files a/WindowsDotNet/binary/BBjTAPIClient.exe and b/WindowsDotNet/binary/BBjTAPIClient.exe differ diff --git a/WindowsDotNet/readme.txt b/WindowsDotNet/readme.txt index c99f2a4..856a14f 100644 --- a/WindowsDotNet/readme.txt +++ b/WindowsDotNet/readme.txt @@ -1,5 +1,5 @@ - built under .Net V.4.5.2 -- built using VisualStudio Community 2017 +- built using VisualStudio Professional 2019 - BBjTAPIClient.Net project makes use of the nuget package Costura.Fody. The Costura.Fody package has been installed in the BBjTAPIClient project to embed simply the atapi.dll into the executable.