Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 6 additions & 35 deletions NEventSocket.sln
Original file line number Diff line number Diff line change
@@ -1,51 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NEventSocket", "src\NEventSocket\NEventSocket.csproj", "{83DCA19D-3FF7-4E60-A066-BAE1C5A7B65E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{E15B83EF-2CE1-4479-A457-D340DCA80869}"
ProjectSection(SolutionItems) = preProject
BREAKING CHANGES.md = BREAKING CHANGES.md
default.ps1 = default.ps1
src\NEventSocket\NEventSocket.nuspec = src\NEventSocket\NEventSocket.nuspec
Settings.StyleCop = Settings.StyleCop
SharedAssemblyInfo.cs = SharedAssemblyInfo.cs
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{8A973BD1-83E8-4794-A81A-538CC7069BDC}"
ProjectSection(SolutionItems) = preProject
test\Settings.StyleCop = test\Settings.StyleCop
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NEventSocket.Tests", "test\NEventSocket.Tests\NEventSocket.Tests.csproj", "{731A678B-6827-468A-BFA1-AB2533947D61}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NEventSocket.Examples", "src\NEventSocket.Examples\NEventSocket.Examples.csproj", "{D64BAE1E-EB6C-4149-91DC-8EB7A06C8374}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NEventSocket", "src\NEventSocket\NEventSocket.xproj", "{2197E806-F41A-40F0-A720-D45FE5C9ED77}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{83DCA19D-3FF7-4E60-A066-BAE1C5A7B65E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{83DCA19D-3FF7-4E60-A066-BAE1C5A7B65E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{83DCA19D-3FF7-4E60-A066-BAE1C5A7B65E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{83DCA19D-3FF7-4E60-A066-BAE1C5A7B65E}.Release|Any CPU.Build.0 = Release|Any CPU
{731A678B-6827-468A-BFA1-AB2533947D61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{731A678B-6827-468A-BFA1-AB2533947D61}.Debug|Any CPU.Build.0 = Debug|Any CPU
{731A678B-6827-468A-BFA1-AB2533947D61}.Release|Any CPU.ActiveCfg = Release|Any CPU
{731A678B-6827-468A-BFA1-AB2533947D61}.Release|Any CPU.Build.0 = Release|Any CPU
{D64BAE1E-EB6C-4149-91DC-8EB7A06C8374}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D64BAE1E-EB6C-4149-91DC-8EB7A06C8374}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D64BAE1E-EB6C-4149-91DC-8EB7A06C8374}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D64BAE1E-EB6C-4149-91DC-8EB7A06C8374}.Release|Any CPU.Build.0 = Release|Any CPU
{2197E806-F41A-40F0-A720-D45FE5C9ED77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2197E806-F41A-40F0-A720-D45FE5C9ED77}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2197E806-F41A-40F0-A720-D45FE5C9ED77}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2197E806-F41A-40F0-A720-D45FE5C9ED77}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{731A678B-6827-468A-BFA1-AB2533947D61} = {8A973BD1-83E8-4794-A81A-538CC7069BDC}
EndGlobalSection
EndGlobal
36 changes: 35 additions & 1 deletion src/NEventSocket/App_Packages/LibLog.4.2/LibLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#pragma warning disable 1591

using System.Diagnostics.CodeAnalysis;
using System.Linq;

[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "NEventSocket.Logging")]
[assembly: SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "NEventSocket.Logging.Logger.#Invoke(NEventSocket.Logging.LogLevel,System.Func`1<System.String>,System.Exception,System.Object[])")]
Expand Down Expand Up @@ -506,10 +507,14 @@ static ILog For<T>()
#else
internal
#endif
static ILog GetCurrentClassLogger()
static ILog GetCurrentClassLogger([CallerMemberName]string name="")
{
#if NETSTANDARD16
return GetLogger(name);
#else
var stackFrame = new StackFrame(1, false);
return GetLogger(stackFrame.GetMethod().DeclaringType);
#endif
}
#endif

Expand Down Expand Up @@ -690,6 +695,7 @@ public bool Log(LogLevel logLevel, Func<string> messageFunc, Exception exception
return false;
}
#if !LIBLOG_PORTABLE

var envVar = Environment.GetEnvironmentVariable(LogProvider.DisableLoggingEnvironmentVariable);

if (envVar != null && envVar.Equals("true", StringComparison.OrdinalIgnoreCase))
Expand Down Expand Up @@ -1205,9 +1211,24 @@ public bool Log(LogLevel logLevel, Func<string> messageFunc, Exception exception
lock (CallerStackBoundaryTypeSync)
{
#if !LIBLOG_PORTABLE
#if NETSTANDARD16
StackTrace stack = new StackTrace(exception, true);
#else
StackTrace stack = new StackTrace();
#endif
Type thisType = GetType();
s_callerStackBoundaryType = Type.GetType("LoggerExecutionWrapper");
#if NETSTANDARD16
var frames = stack.GetFrames();
for (var i = 1; i < frames.Length; i++)
{
if (!IsInTypeHierarchy(thisType, frames[i].GetMethod().DeclaringType))
{
s_callerStackBoundaryType = frames[i - 1].GetMethod().DeclaringType;
break;
}
}
#else
for (var i = 1; i < stack.FrameCount; i++)
{
if (!IsInTypeHierarchy(thisType, stack.GetFrame(i).GetMethod().DeclaringType))
Expand All @@ -1216,6 +1237,7 @@ public bool Log(LogLevel logLevel, Func<string> messageFunc, Exception exception
break;
}
}
#endif
#else
s_callerStackBoundaryType = typeof (LoggerExecutionWrapper);
#endif
Expand Down Expand Up @@ -1996,8 +2018,12 @@ internal static Type GetBaseTypePortable(this Type type)
{
#if LIBLOG_PORTABLE
return type.GetTypeInfo().BaseType;
#else
#if NETSTANDARD16
return type.GetTypeInfo().BaseType;
#else
return type.BaseType;
#endif
#endif
}

Expand All @@ -2016,16 +2042,24 @@ internal static MethodInfo GetSetMethod(this PropertyInfo propertyInfo)
#if !LIBLOG_PORTABLE
internal static object CreateDelegate(this MethodInfo methodInfo, Type delegateType)
{
#if NETSTANDARD16
return null;
#else
return Delegate.CreateDelegate(delegateType, methodInfo);
#endif
}
#endif

internal static Assembly GetAssemblyPortable(this Type type)
{
#if LIBLOG_PORTABLE
return type.GetTypeInfo().Assembly;
#else
#if NETSTANDARD16
return type.GetTypeInfo().Assembly;
#else
return type.Assembly;
#endif
#endif
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/NEventSocket/Channels/BasicChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public async Task<IDisposable> PlayUntilCancelled(string file)
if (!CanPlayBackAudio)
{
Log.Warn(() => "Channel [{0}] attempted to play hold music when not answered".Fmt(UUID));
return Task.FromResult(new DisposableAction());
return new DisposableAction();
}

// essentially, we'll do a playback application call without waiting for the ChannelExecuteComplete event
Expand Down
7 changes: 7 additions & 0 deletions src/NEventSocket/InboundSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,16 @@ public class InboundSocket : EventSocket
{
private static readonly ILog Log = LogProvider.GetCurrentClassLogger();

#if NETSTANDARD16
private InboundSocket(string host, int port, TimeSpan? timeout = null) : base(new TcpClient(), timeout)
{
this.tcpClient.ConnectAsync(host, port).Wait();
}
#else
private InboundSocket(string host, int port, TimeSpan? timeout = null) : base(new TcpClient(host, port), timeout)
{
}
#endif

/// <summary>
/// Connects to FreeSwitch and authenticates
Expand Down
5 changes: 4 additions & 1 deletion src/NEventSocket/InboundSocketConnectionFailedException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ public InboundSocketConnectionFailedException(string message, Exception innerExc
/// </summary>
/// <param name="info">The information.</param>
/// <param name="context">The context.</param>
protected InboundSocketConnectionFailedException(SerializationInfo info, StreamingContext context) : base(info, context)
protected InboundSocketConnectionFailedException(SerializationInfo info, StreamingContext context)
#if NET451
: base(info, context)
#endif
{
}
}
Expand Down
Loading