This commit is contained in:
Meik
2025-11-11 11:03:42 +01:00
commit dc3e8a2e4c
582 changed files with 191465 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@@ -0,0 +1,259 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using IpPbx.CLMgrLib;
using C4IT.Logging;
using static C4IT.Logging.cLogManager;
using System.Runtime.Remoting.Channels;
namespace F4SD_PhoneMonitor
{
public delegate void ActiveCallMessage(string phone, string name, bool isOutgoing);
public class cCLMgrEvents
{
public ActiveCallMessage ActiveCallHandler;
private ClientLineMgrClass pCLMgr = null;
private ClientSdkEventSink MyEventSink = null;
private PubCLMgrLineDetails lastChangedLineDetails;
public bool Initialize()
{
var CM = MethodBase.GetCurrentMethod();
LogMethodBegin(CM);
try
{
lastChangedLineDetails.m_sPeerName = null;
lastChangedLineDetails.m_sPeerNumber = null;
pCLMgr = new ClientLineMgrClass();
if (pCLMgr == null)
{
LogEntry("Error conntection SwyxIt client interface. Terminating...", LogLevels.Fatal);
return false;
}
pCLMgr.GetVersion(out var Info);
if (Info.dwMajorVersion < 11)
{
LogEntry("Incompatible SwyxIt client version. Terminating...", LogLevels.Fatal);
return false;
}
MyEventSink = new ClientSdkEventSink();
MyEventSink.Connect(pCLMgr, new LineManagerMessageHandler(OnLineManagerMessage));
return true;
}
catch (Exception E)
{
LogException(E);
}
finally
{
LogMethodEnd(CM);
}
return false;
}
private void OnLineManagerMessage(ClientSdkEventArgs e)
{
var _msg = e.Msg.ToString();
if (int.TryParse(_msg, out _))
return;
var CM = MethodBase.GetCurrentMethod();
LogMethodBegin(CM);
try
{
LogEntry($"Client event signaled {e.Msg.ToString()}", LogLevels.Debug);
switch (e.Msg)
{
case CLMgrMessage.CLMgrLineStateChangedMessage:
IClientLinePub changedLinePub = (IClientLinePub)pCLMgr.DispGetLine(e.Param);
PubCLMgrLineDetails changedLineDetails;
changedLinePub.PubGetDetails(out changedLineDetails);
lastChangedLineDetails = changedLineDetails;
break;
case CLMgrMessage.CLMgrLineStateChangedMessageEx:
//Get Line
int line = e.Param & 0xff;
int high = e.Param >> 8;
LineState NewLineState;
//Get the LineState
NewLineState = (LineState)high;
LogEntry($"New line state: {NewLineState}", LogLevels.Debug);
if (NewLineState == LineState.Active)
{
if (lastChangedLineDetails.m_sPeerNumber != null)
{
var IsOutgoing = lastChangedLineDetails.m_bIsOutgoing == 1;
var _strDir = IsOutgoing ? "to" : "from";
LogEntry($"Active call {_strDir}: phone={lastChangedLineDetails.m_sPeerNumber}, name={lastChangedLineDetails.m_sPeerName}", LogLevels.Debug);
if (ActiveCallHandler != null)
ActiveCallHandler.Invoke(lastChangedLineDetails.m_sPeerNumber, lastChangedLineDetails.m_sPeerName, IsOutgoing);
}
}
break;
}
}
catch (Exception E)
{
LogException(E);
}
finally
{
LogMethodEnd(CM);
}
}
public void Disconnect()
{
var CM = MethodBase.GetCurrentMethod();
LogMethodBegin(CM);
try
{
if (MyEventSink != null)
MyEventSink.Disconnect();
}
catch (Exception E)
{
LogException(E);
}
finally
{
LogMethodEnd(CM);
}
}
}
public class ClientSdkEventArgs : EventArgs
{
public CLMgrMessage Msg;
public int Param;
public ClientSdkEventArgs(CLMgrMessage msg, int param)
{
Msg = msg;
Param = param;
}
}
public delegate void LineManagerMessageHandler(ClientSdkEventArgs e);
public class ClientSdkEventSink
{
private ClientLineMgrClass ConnectedLineManager;
private IClientLineMgrEventsPub_PubOnLineMgrNotificationEventHandler EventHandler;
private LineManagerMessageHandler LineManagerMessageDelegateOfForm;
public ClientSdkEventSink()
{
EventHandler = new IClientLineMgrEventsPub_PubOnLineMgrNotificationEventHandler(clmgr_EventSink);
}
public void Connect(ClientLineMgrClass lineManager, LineManagerMessageHandler lineManagerMessageDelegateOfForm)
{
ConnectedLineManager = lineManager;
LineManagerMessageDelegateOfForm = lineManagerMessageDelegateOfForm;
//add eventhandler for the PubOnlineMgrNotification Events
ConnectedLineManager.PubOnLineMgrNotification += EventHandler;
}
public void Disconnect()
{
//remove eventhandler for the PubOnlineMgrNotification Events
ConnectedLineManager.PubOnLineMgrNotification -= EventHandler;
ConnectedLineManager = null;
LineManagerMessageDelegateOfForm = null;
}
private void clmgr_EventSink(int msg, int param)
{
//this method receives the COM events from the client line manger
if ((LineManagerMessageDelegateOfForm != null))
{
LineManagerMessageDelegateOfForm?.Invoke(new ClientSdkEventArgs((CLMgrMessage)msg, param));
}
}
}
public enum CLMgrMessage
{
CLMgrLineStateChangedMessage = 0, //state of at least one line has changed
CLMgrLineSelectionChangedMessage = 1, //line in focus has changed
CLMgrLineDetailsChangedMessage = 2, //details of at least one line have changed
CLMgrCallDetailsMessage = 4, //details of last call are available, post mortem for logging purpose
CLMgrServerDownMessage = 5, //server goes down, keep line manager, wait for ServerUp message
CLMgrServerUpMessage = 6, //server is up again, keep interfaces to line manger
CLMgrWaveDeviceChanged = 7, //speaker / micro has been switched on / off
CLMgrGroupCallNotificationMessage = 8, //notification about group call
CLMgrNumberOfLinesChangedMessage = 10, //the number of lines has changed
CLMgrClientShutDownRequest = 11, //Client Line Manager requests client to shutdown and release all interfaces
CLMgrLineStateChangedMessageEx = 28, //state of certain line has changed, lParam: LOWORD: line index of line that changed its state (starting with 0) HIWORD: new state of this line
CLMgrSIPRegistrationStateChanged = 30, //registration state of SIP account has changed
//lParam: LOBYTE: Account index
// HIBYTE: new state
CLMgrWaveFilePlayed = 31, //wave file playback finished
//lParam: line index;
//if -1, the message is related to a LineMgr function PlaySoundFile or PlayToRtp
//if >=0 the message is related to a line function PlaySoundFile of line with this index
PubCLMgrFirstDataReceived = 32 //first RTP data received on line, might be silence
//lParam: line index;
}
public enum LineState
{
Inactive = 0, //line is inactive
HookOffInternal = 1, //off hook, internal dialtone
HookOffExternal = 2, //off hook, external dialtone
Ringing = 3, //incoming call, ringing
Dialing = 4, //outgoing call, we are dialing, no sound
Alerting = 5, //outgoing call, alerting = ringing on destination
Knocking = 6, //outgoing call, knocking = second call ringing on destination
Busy = 7, //outgoing call, destination is busy
Active = 8, //incoming / outgoing call, logical and physical connection is established
OnHold = 9, //incoming / outgoing call, logical connection is established, destination gets music on hold
ConferenceActive = 10, //incoming / outgoing conference, logical and physical connection is established
ConferenceOnHold = 11, //incoming / outgoing conference, logical connection is established, not physcically connected
Terminated = 12, //incoming / outgoing connection / call has been disconnected
Transferring = 13, //special LSOnHold, call is awaiting to be transferred, peer gets special music on hold
Disabled = 14 //special LSInactive: wrap up time
}
public enum DisconnectReason
{
Normal = 0,
Busy = 1,
Rejected = 2,
Cancelled = 3,
Transferred = 4,
JoinedConference = 5,
NoAnswer = 6,
TooLate = 7,
DirectCallImpossible = 8,
WrongNumber = 9,
Unreachable = 10,
CallDiverted = 11,
CallRoutingFailed = 12,
PermissionDenied = 13,
NetworkCongestion = 14,
NoChannelAvailable = 15,
NumberChanged = 16,
IncompatibleDestination = 17
}
}

View File

@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5721E81F-3C41-4C63-8EA0-EE8D1CE73778}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>F4SD_PhoneMonitor</RootNamespace>
<AssemblyName>F4SD-PhoneMonitor</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>false</Deterministic>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<ResolveComReferenceSilent>True</ResolveComReferenceSilent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>logo_FASD.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Demo%28Debug%29|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Demo%28Debug%29\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NewFeatures%28Debug%29|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\NewFeatures%28Debug%29\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Interop.CLMgr, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cf78dfa0a74454f8, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>False</EmbedInteropTypes>
<HintPath>.\Interop.CLMgr.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\C4IT FASD\_Common\C4IT.F4SD.TapiHelper.cs">
<Link>C4IT.F4SD.TapiHelper.cs</Link>
</Compile>
<Compile Include="..\FasdDesktopUi\Basics\NamedPipes.cs">
<Link>Common\NamedPipes.cs</Link>
</Compile>
<Compile Include="..\Shared\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="CLMgrEvents.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Interop.CLMgr.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="logo_FASD.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\F4SD-Logging\F4SD-Logging.csproj">
<Project>{7793f281-b226-4e20-b6f6-5d53d70f1dc1}</Project>
<Name>F4SD-Logging</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<COMReference Include="TAPI3Lib">
<Guid>{21D6D480-A88B-11D0-83DD-00AA003CCABD}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>False</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,10 @@
""
{
"FILE_VERSION" = "9237"
"ENLISTMENT_CHOICE" = "NEVER"
"PROJECT_FILE_RELATIVE_PATH" = ""
"NUMBER_OF_EXCLUDED_FILES" = "0"
"ORIGINAL_PROJECT_FILE_PATH" = ""
"NUMBER_OF_NESTED_PROJECTS" = "0"
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
}

Binary file not shown.

View File

@@ -0,0 +1,414 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO.Pipes;
using System.Text;
using System.Diagnostics;
using Microsoft.Win32;
using Newtonsoft.Json;
using C4IT.Logging;
using C4IT.F4SD.TAPI;
using static C4IT.Logging.cLogManager;
using FasdDesktopUi.Basics;
namespace F4SD_PhoneMonitor
{
static class Program
{
public static string sendPipeName = null;
public static string listenPipeName = null;
public static string tapiLine = null;
public static bool SignalOutgoingCall = false;
public static string ExternalCallPrefix = "";
public static bool IsSimulation = false;
public static int SendError = 0;
public static cCLMgrEvents lmg = null;
public static System.Timers.Timer timerPolling = new System.Timers.Timer(100);
public static cF4sdPipeServer pipeServer = null;
public static bool StopImmediate = false;
[STAThread]
static int Main(string[] args)
{
try
{
cLogManagerFile.CreateInstance(false, SubFolder: "Logs");
cLogManager.DefaultLogger.LogAssemblyInfo();
}
catch
{
return 1;
}
var CM = MethodBase.GetCurrentMethod();
LogMethodBegin(CM);
try
{
if (args.Length < 3 || args.Length > 6)
{
LogEntry("No valid pipe names at command line. Terminating...", LogLevels.Fatal);
return -1;
}
sendPipeName = args[0];
listenPipeName = args[1];
tapiLine = args[2];
if (args.Length >= 4)
ExternalCallPrefix = args[3];
if (args.Length >= 5)
{
if (args[4] == "1")
SignalOutgoingCall = true;
}
if (args.Length >= 6)
{
if (args[5] == "simulation")
IsSimulation = true;
}
if (tapiLine.ToLowerInvariant() == "swyxitnative")
{
if (!ConnectSwyxit())
return -1;
}
else
{
if (!ConnectTapi(tapiLine))
{
System.Environment.Exit(-1);
}
}
timerPolling.Elapsed += TimerPolling_Elapsed;
timerPolling.Start();
var SessionId = 0;
try
{
SessionId = Process.GetCurrentProcess().SessionId;
}
catch { }
pipeServer = new cF4sdPipeServer();
pipeServer.PipeMessage += PipeServer_PipeMessage;
pipeServer.Listen(listenPipeName, MaxSize: 255, LowerIntegrity: true);
LogEntry($"Start listening on named pipe '{listenPipeName}'...", LogLevels.Debug);
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.ApplicationExit += OnApplicationExit;
Application.Run();
return 0;
}
catch (Exception E)
{
LogException(E);
}
finally
{
LogMethodEnd(CM);
}
return -1;
}
static bool ConnectSwyxit()
{
var CM = MethodBase.GetCurrentMethod();
LogMethodBegin(CM);
try
{
var regObj = Registry.GetValue("HKEY_CLASSES_ROOT\\CLSID\\{F8E552F8-4C00-11D3-80BC-00105A653379}\\VersionIndependentProgID", null, null);
if (!(regObj is string strObj) || strObj.ToLowerInvariant() != "clmgr.clientlinemgr")
{
LogEntry("SwyxIt client seems not to be installed. Terminating...", LogLevels.Fatal);
return false;
}
lmg = new cCLMgrEvents();
if (!lmg.Initialize())
return false;
lmg.ActiveCallHandler += ActiveCallMessage;
return true;
}
catch (Exception E)
{
LogException(E);
}
finally
{
LogMethodEnd(CM);
}
return false;
}
static bool ConnectTapi(string Line)
{
var CM = MethodBase.GetCurrentMethod();
LogMethodBegin(CM);
try
{
C4TapiHelper.Instance = new C4TapiHelper();
C4TapiHelper.Instance.Initialize(TapiMessageHandler);
C4TapiHelper.Instance.GetLines();
if (C4TapiHelper.Instance.ConnectLine(Line))
return true;
}
catch (Exception E)
{
LogException(E);
}
finally
{
LogMethodEnd(CM);
}
return false;
}
private static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
{
LogEntry("User logout detected. Terminating...", LogLevels.Debug);
Application.Exit();
}
private static void TimerPolling_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
var CM = MethodBase.GetCurrentMethod();
LogMethodBegin(CM);
try
{
timerPolling.Stop();
if (StopImmediate)
{
Application.Exit();
return;
}
timerPolling.Interval = 10000;
bool res = false;
lock (sendPipeName)
{
res = Send("Hello", sendPipeName);
};
if (res)
SendError = 0;
else
{
SendError++;
if (SendError == 2)
Application.Exit();
}
}
catch (Exception E)
{
LogException(E);
}
finally
{
LogMethodEnd(CM);
}
timerPolling.Start();
}
static private void OnApplicationExit(object sender, EventArgs e)
{
var CM = MethodBase.GetCurrentMethod();
LogMethodBegin(CM);
try
{
timerPolling.Stop();
try
{
if (lmg != null)
{
lmg.ActiveCallHandler -= ActiveCallMessage;
lmg.Disconnect();
}
}
catch { }
try
{
if (C4TapiHelper.Instance != null)
{
C4TapiHelper.Instance.Dispose();
C4TapiHelper.Instance = null;
}
}
catch { }
if (pipeServer != null)
{
LogEntry("stopping pipe server...", LogLevels.Debug);
pipeServer.Stop();
pipeServer.Dispose();
pipeServer = null;
LogEntry("...finished.", LogLevels.Debug);
}
//Application.ApplicationExit -= OnApplicationExit;
}
catch (Exception E)
{
LogException(E);
}
finally
{
LogMethodEnd(CM);
}
}
static void ActiveCallMessage(string phone, string name, bool isOutgoing)
{
if (isOutgoing && !SignalOutgoingCall)
{
LogEntry("An outgoing call is signaled but signaling outgoing calls is not enabled.");
return;
}
if (sendPipeName == null)
return;
if (string.IsNullOrWhiteSpace(phone))
return;
if (name == null)
name = "";
var phone2 = phone.Trim();
if (!string.IsNullOrEmpty(ExternalCallPrefix) && phone2.StartsWith(ExternalCallPrefix))
phone2 = phone2.Remove(0,ExternalCallPrefix.Length);
if (phone2.StartsWith("+"))
{
var _r = Math.Min(phone2.Length, 3);
phone2 = phone2.Remove(0, _r);
}
else if (phone2.StartsWith("00"))
{
var _r = Math.Min(phone2.Length, 4);
phone2 = phone2.Remove(0, _r);
}
if (phone2.StartsWith("0"))
phone2 = phone2.Remove(0, 1);
var phone3 = "";
foreach (var C in phone2)
if ((C >= '0') && (C <= '9'))
phone3 += C;
var name2 = name.Trim();
var _strDir = isOutgoing ? "outgoing" : "incoming";
LogEntry($"Signaling {_strDir} call: phone={phone2}, name={name2}", LogLevels.Debug);
var Info = JsonConvert.SerializeObject(new cPhoneSearchParameters() { phone = phone3, name = name2 });
lock (sendPipeName)
{
Send($"phonesearch: {Info}", sendPipeName);
}
}
static public bool Send(string SendStr, string PipeName, int TimeOut = 1000)
{
try
{
if (IsSimulation)
{
LogEntry($"simulatied pipe send: {SendStr}");
return true;
}
NamedPipeClientStream pipeStream = new NamedPipeClientStream
(".", PipeName, PipeDirection.Out, PipeOptions.WriteThrough);
// The connect function will indefinitely wait for the pipe to become available
// If that is not acceptable specify a maximum waiting time (in ms)
pipeStream.Connect(TimeOut);
byte[] _buffer = Encoding.UTF8.GetBytes(SendStr);
pipeStream.Write(_buffer, 0, _buffer.Length);
pipeStream.Flush();
pipeStream.Close();
pipeStream.Dispose();
return true;
}
catch (TimeoutException oEX)
{
if (DefaultLogger.IsDebug)
cLogManager.DefaultLogger.LogException(oEX);
}
return false;
}
static private void PipeServer_PipeMessage(string Reply)
{
if (Reply.ToLowerInvariant() == "stop")
{
timerPolling.Stop();
StopImmediate = true;
timerPolling.Interval = 100;
timerPolling.Start();
}
}
private static void TapiMessageHandler(C4TapiHelper.C4TapiLineInfo lineInfo)
{
if (lineInfo.eventType == C4TapiHelper.eTapiEventType.connected)
{
var CM = MethodBase.GetCurrentMethod();
LogMethodBegin(CM);
try
{
ActiveCallMessage(lineInfo.participantPhoneNumber, lineInfo.participantName, lineInfo.IsOutbound);
}
catch (Exception E)
{
LogException(E);
}
finally
{
LogMethodEnd(CM);
}
}
}
public class cPhoneSearchParameters
{
public string phone { get; set; }
public string name { get; set; } = null;
}
}
}

View File

@@ -0,0 +1,11 @@
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
[assembly: AssemblyTitle("F4SD SwyxIt Phone call Monitor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("5721e81f-3c41-4c63-8ea0-ee8d1ce73778")]

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace F4SD_PhoneMonitor.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("F4SD_PhoneMonitor.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace F4SD_PhoneMonitor.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
</packages>