Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chatop2020 committed Nov 20, 2023
1 parent eac3365 commit 00bf02b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
29 changes: 29 additions & 0 deletions AKStreamKeeper/MediaServerInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,8 @@ public bool SetConfig(out ResponseStruct rs)
Uri AKStreamWebUri = new Uri(Common.AkStreamKeeperConfig.AkStreamWebRegisterUrl);
string h = AKStreamWebUri.Host.Trim();
string p = AKStreamWebUri.Port.ToString();
string h2 = _akStreamKeeperConfig.IpV4Address;
string h3 = _akStreamKeeperConfig.Candidate;

if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && File.Exists("/etc/hostname"))
{
Expand Down Expand Up @@ -943,6 +945,33 @@ public bool SetConfig(out ResponseStruct rs)
_zlmNewConfig.Http.Allow_Ip_Range += "," + h;
}
}

if (_zlmNewConfig != null && _zlmNewConfig.Http != null &&
!_zlmNewConfig.Http.Allow_Ip_Range.Contains(h2) && UtilsHelper.IsIpAddr(h2))
{
if (_zlmNewConfig.Http.Allow_Ip_Range.EndsWith(","))
{
_zlmNewConfig.Http.Allow_Ip_Range += h2;
}
else
{
_zlmNewConfig.Http.Allow_Ip_Range += "," + h2;
}
}

if (_zlmNewConfig != null && _zlmNewConfig.Http != null &&
!_zlmNewConfig.Http.Allow_Ip_Range.Contains(h3) && UtilsHelper.IsIpAddr(h3))
{
if (_zlmNewConfig.Http.Allow_Ip_Range.EndsWith(","))
{
_zlmNewConfig.Http.Allow_Ip_Range += h3;
}
else
{
_zlmNewConfig.Http.Allow_Ip_Range += "," + h3;
}
}


_zlmNewConfig.Hook.On_Shell_Login =
$"http://{h}:{p}/MediaServer/WebHook/OnShellLogin"; //shell鉴权
Expand Down
6 changes: 5 additions & 1 deletion Test_GB28181Client/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
using LibGB28181SipClient;
using System;
using LibGB28181SipClient;

namespace Test_GB28181Client
{
class Program
{
static void Main(string[] args)
{

Console.WriteLine("{0}", ("dxper".Equals("net")).ToString().ToUpper());

SipClient sipClient = new SipClient();
}
}
Expand Down

0 comments on commit 00bf02b

Please sign in to comment.