Skip to content

Commit b7c458f

Browse files
authoredMay 13, 2024
Merge pull request #88 from jaysooong/master
gbmedia端口没有主动释放bug
2 parents a237916 + a9d2d0f commit b7c458f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed
 

‎gb28181/channel.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package gb28181
33
import (
44
"errors"
55
"fmt"
6-
"github.com/q191201771/naza/pkg/nazaatomic"
76
"net/http"
87
"strconv"
98
"strings"
109
"time"
1110

11+
"github.com/q191201771/naza/pkg/nazaatomic"
12+
1213
config "github.com/q191201771/lalmax/conf"
1314
"github.com/q191201771/lalmax/gb28181/mediaserver"
1415

@@ -204,6 +205,16 @@ func (channel *Channel) Invite(opt *InviteOptions, streamName string, playInfo *
204205
inviteRes, err := d.SipRequestForResponse(invite)
205206
if err != nil {
206207
nazalog.Error("invite failed, err:", err, " invite msg:", invite.String())
208+
209+
//jay 在media端口监听成功后,但是sip发送失败时
210+
if !playInfo.SinglePort {
211+
if channel.observer != nil {
212+
if err = channel.observer.OnStopMediaServer(playInfo.NetWork, playInfo.SinglePort, channel.device.ID, channel.ChannelId); err != nil {
213+
nazalog.Errorf("gb28181 MediaServer stop err:%s", err.Error())
214+
}
215+
}
216+
}
217+
207218
return http.StatusInternalServerError, err
208219
}
209220
code = int(inviteRes.StatusCode())

0 commit comments

Comments
 (0)