fix: 拉流http hook失败问题

This commit is contained in:
ydajiang
2025-06-01 00:03:28 +08:00
parent 19ab406edd
commit ffc5a340eb
2 changed files with 11 additions and 11 deletions

20
api.go
View File

@@ -319,18 +319,18 @@ func (api *ApiServer) OnPublish(params *StreamParams, w http.ResponseWriter, r *
// 创建stream
if params.Protocol == SourceTypeGBTalk {
Sugar.Infof("对讲websocket已连接, stream: %s", params.Stream)
}
s := &Stream{
StreamID: params.Stream,
Protocol: params.Protocol,
}
s := &Stream{
StreamID: params.Stream,
Protocol: params.Protocol,
}
_, ok := StreamDao.SaveStream(s)
if !ok {
Sugar.Errorf("处理推流事件失败, stream已存在. id: %s", params.Stream)
w.WriteHeader(http.StatusBadRequest)
return
_, ok := StreamDao.SaveStream(s)
if !ok {
Sugar.Errorf("处理推流事件失败, stream已存在. id: %s", params.Stream)
w.WriteHeader(http.StatusBadRequest)
return
}
}
}

View File

@@ -108,7 +108,7 @@ func MSCreateGBSource(id, setup string, ssrc string, sessionName string) (string
},
}
response, err := Send("api/v1/gb28181/offer/create", v)
response, err := Send("api/v1/gb28181/source/create", v)
if err != nil {
return "", 0, nil, "", err
}