fix: invite无应答发生crash问题

This commit is contained in:
ydajiang
2025-05-15 14:23:19 +08:00
parent da60991939
commit f78b909923
2 changed files with 4 additions and 2 deletions

View File

@@ -157,6 +157,9 @@ func (d *Device) Invite(inviteType InviteType, streamId StreamID, channelId, sta
if err != nil {
return nil, nil, err
} else if dialogRequest == nil {
// invite 没有收到任何应答
return nil, nil, fmt.Errorf("invite request timeout")
} else if "active" == setup {
// 如果是TCP主动拉流, 还需要将拉流地址告知给流媒体服务
var answer *sdp.SDP

View File

@@ -72,10 +72,9 @@ func (s *streamManager) Remove(id StreamID) *Stream {
if ok && stream.Dialog != nil {
callID, _ := stream.Dialog.CallID()
delete(s.callIds, callID.Value())
return stream
}
return nil
return stream
}
func (s *streamManager) RemoveWithCallId(id string) *Stream {