Skip to content

Commit

Permalink
更新readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
chatop committed Dec 30, 2020
1 parent 9335ff3 commit 41531d4
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 11 deletions.
1 change: 1 addition & 0 deletions GB28181.SIPSorcery/Core/SIP/SIPTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,7 @@ private void SIPMessageReceived(SIPChannel sipChannel, SIPEndPoint remoteEndPoin
{
SIPTransportResponseReceived?.Invoke(sipChannel.SIPChannelEndPoint,
remoteEndPoint, sipResponse);
Logger.Logger.Debug("===========>收到消息\r\n"+sipResponse.ToString());
}
}
catch (SIPValidationException sipValidationException)
Expand Down
2 changes: 1 addition & 1 deletion GB28181.SIPSorcery/Servers/SIPMessage/SIPMessageCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ private void CatalogHandle(SIPEndPoint localEP, SIPEndPoint remoteEP, SIPRequest
}
catch (Exception ex)
{
Logger.Logger.Error("CatalogHandle Exception. ->" + ex.Message);
Logger.Logger.Error("CatalogHandle Exception. ->" + ex.Message+"\r\n"+ex.StackTrace);
}
}

Expand Down
23 changes: 22 additions & 1 deletion GB28181.SIPSorcery/Servers/SIPMonitor/SIPMonitorCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,26 @@ public int RealVideoReq(uint streamid, out string callid, string rtpServerIp, us
callid = callId;
Logger.Logger.Debug("RealVideoReq: DeviceId=" + DeviceId);
SIPURI remoteUri = new SIPURI(DeviceId, RemoteEndPoint.ToHost(), "");
Logger.Logger.Debug(" SIPURI remoteUri = new SIPURI(DeviceId, RemoteEndPoint.ToHost(), \"\")\r\n"+
"DeviceId:"+DeviceId+" RemoteEndPoint.ToHost():"+ RemoteEndPoint.ToHost());


SIPURI localUri = new SIPURI(_sipMsgCoreService.LocalSIPId, _sipMsgCoreService.LocalEP.ToHost(), "");
Logger.Logger.Debug("SIPURI localUri = new SIPURI(_sipMsgCoreService.LocalSIPId, _sipMsgCoreService.LocalEP.ToHost(), \"\")\r\n"+
"_sipMsgCoreService.LocalSIPId:"+_sipMsgCoreService.LocalSIPId+" sipMsgCoreService.LocalEP.ToHost():"+ _sipMsgCoreService.LocalEP.ToHost());
SIPFromHeader from = new SIPFromHeader(null, localUri, fromTag);
Logger.Logger.Debug("SIPFromHeader from = new SIPFromHeader(null, localUri, fromTag)\r\n"+
"localUri:"+localUri+" fromTag:"+fromTag);
SIPToHeader to = new SIPToHeader(null, remoteUri, null);
Logger.Logger.Debug("SIPToHeader to = new SIPToHeader(null, remoteUri, null)\r\n"+
"remoteUri:"+remoteUri);
SIPRequest sipRequest = _sipTransport.GetRequest(SIPMethodsEnum.INVITE, remoteUri);

Logger.Logger.Debug("SIPRequest sipRequest = _sipTransport.GetRequest(SIPMethodsEnum.INVITE, remoteUri)\r\n"+
"SIPMethodsEnum.INVITE:"+SIPMethodsEnum.INVITE.ToString()+" remoteUri:"+remoteUri);
var contactHeader = new SIPContactHeader(null, localUri);
Logger.Logger.Debug("var contactHeader = new SIPContactHeader(null, localUri)\r\n"+
"localUri:"+localUri);

sipRequest.Header.Contact.Clear();
sipRequest.Header.Contact.Add(contactHeader);

Expand All @@ -136,9 +148,15 @@ public int RealVideoReq(uint streamid, out string callid, string rtpServerIp, us
sipRequest.Header.CSeq = cSeq;
sipRequest.Header.CallId = callId;
sipRequest.Header.Subject = SetSubject();
Logger.Logger.Debug("sipRequest.Header.Subject = SetSubject()\r\n"+
sipRequest.Header.Subject);
sipRequest.Header.ContentType = SIPHeader.ContentTypes.Application_SDP;
sipRequest.Body = SetMediaReq(rtpServerIp, rtpServerPort, streamid.ToString(), tcp);
Logger.Logger.Debug("SipRequest.body\r\n"+
sipRequest.Body);
_sipMsgCoreService.SendReliableRequest(RemoteEndPoint, sipRequest);
Logger.Logger.Debug("LastSipRequest\r\n"+
sipRequest.ToString());
_reqSession = sipRequest;


Expand Down Expand Up @@ -301,6 +319,8 @@ public void ByeVideoReq(out string _callid, bool needResult = false)
{
_syncRequestContext.TryAdd(_reqSession.Header.CallId, byeReq);
}

Logger.Logger.Debug("请求停止invite->\r\n"+byeReq.ToString());

_sipMsgCoreService.SendReliableRequest(RemoteEndPoint, byeReq);
}
Expand Down Expand Up @@ -1649,6 +1669,7 @@ public void PtzContrl(out string _callid, PTZCommand ucommand, int dwSpeed, bool
}


Logger.Logger.Debug("---------->发送ptz控制\r\n"+ptzReq.ToString());
_sipMsgCoreService.SendRequest(RemoteEndPoint, ptzReq);
}

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
# Wiki已开通,具体使用说明请详细参考Wiki中的内容
- https://github.com/chatop2020/StreamNode-GB28181/wiki/StreamNode-GB28181%E4%BB%8B%E7%BB%8D

# 感谢热心网友(linshangqiang)维护的StreamNode-GB28181的接口使用手册
- https://github.com/linshangqiang/AKStream-Readme


# 采用StreamNode-GB28181接口管理平台实现的WEB管理平台展示(此平台不是StreamNode-GB28181的组件之一)
- 视频广场
![QQ20201116-150115@2x.png](https://i.loli.net/2020/11/16/dho7kcjfrwp6Vmq.png)
Expand Down
2 changes: 1 addition & 1 deletion StreamMediaServerKeeper/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ static Common()
}
catch (Exception ex)
{
KillSelf(ex.Message);
KillSelf(ex.Message+"\r\n"+ex.StackTrace);
}

new Thread(new ThreadStart(delegate
Expand Down
1 change: 0 additions & 1 deletion StreamMediaServerKeeper/CutMergeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ static CutMergeService()
{
foreach (var value in CutMergeTaskList.GetConsumingEnumerable())
{
// CutMergeTaskStatusList.Add(value);
var taskReturn = CutMerge(value);
if (taskReturn != null)
{
Expand Down
6 changes: 0 additions & 6 deletions StreamMediaServerKeeper/FFmpegGetDuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ private static bool ifNotMp4(string ffmpegBinPath, string videoFilePath, out str
{
ProcessHelper tmpProcessHelper = new ProcessHelper(null, null, null);
if (tmpProcessHelper.RunProcess(ffmpegBinPath, args, 60 * 1000 * 5, out string std, out string err))
// if (ProcessShell.Run(ffmpegCmd, 60 * 1000 * 5, out string std, out string err))
{
if (!string.IsNullOrEmpty(std) || !string.IsNullOrEmpty(err))
{
Expand Down Expand Up @@ -65,7 +64,6 @@ public static bool GetDuration(string ffmpegBinPath, string videoFilePath, out l
string args = " -i " + videoFilePath;
ProcessHelper tmpProcessHelper = new ProcessHelper(null, null, null);
if (tmpProcessHelper.RunProcess(ffmpegBinPath, args, 1000, out string std, out string err))
//if (ProcessShell.Run(cmd, 1000, out string std, out string err))
{
if (!string.IsNullOrEmpty(std) || !string.IsNullOrEmpty(err))
{
Expand Down Expand Up @@ -99,14 +97,10 @@ public static bool GetDuration(string ffmpegBinPath, string videoFilePath, out l
{
sec = int.Parse(tmpArr[2]);
}

hour = hour * 3600; //换成秒数
min = min * 60;
sec = sec + hour + min; //合计秒数
duartion = sec * 1000 + (msec * 10); //算成毫秒
/*
LogWriter.WriteLog("获取视频时长:" + duartion.ToString() + "毫秒", videoFilePath);
*/
return true;
}
}
Expand Down
2 changes: 2 additions & 0 deletions StreamNodeCtrlApis/WebHookApis/MediaServerCtrlApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ private static CameraEx getCameraFromSipDevice(uint streamId, string mediaServer
private static bool getCameraSessionInfoEx(ref CameraSession session)
{
uint tmpStreamid = Convert.ToUInt32("0x" + session.StreamId, 16); //16进制返转成uint型
Logger.Logger.Debug("getCameraSessionInfoEx->tmpStreamid:"+tmpStreamid+" session.StreamId:"+session.StreamId );
//先查一下在不在28181列表中
var cameraEx = getCameraFromSipDevice(tmpStreamid, session.MediaServerId, session.App, session.Vhost);
if (cameraEx != null)
Expand All @@ -98,6 +99,7 @@ private static bool getCameraSessionInfoEx(ref CameraSession session)
}
else //应该是直播流,鉴权还要完善
{
Logger.Logger.Debug("没有找到Sip设备,此推流设备可能是直播设备->\r\n"+JsonHelper.ToJson(session));
session.CameraType = CameraType.LiveCast;
session.ClientType = ClientType.Livecast;
session.CameraEx = null;
Expand Down
2 changes: 1 addition & 1 deletion StreamNodeWebApi/Controllers/WebHookController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public ResToWebHookOnStreamNoneReader OnStreamNoneReader(ReqForWebHookOnStreamNo
.MediaServerId!.Equals(req.MediaServerId))
{
Common.PlayerSessions[i] = null!;
break;

}
}

Expand Down

0 comments on commit 41531d4

Please sign in to comment.