Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pkg/sip/media_port.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,11 @@ func (p *MediaPort) SetConfig(c *MediaConf) error {
)

p.port.SetDst(c.Remote)
if p.opts.IgnorePreanswerData {
// this needs to happen before the SRTP session is created, otherwise the read deadline will be
// overwritten and we may get stuck in the discard loop
p.port.stopDiscarding()
}
var (
sess rtp.Session
err error
Expand Down Expand Up @@ -784,9 +789,6 @@ func (p *MediaPort) setupOutput(tid traceid.ID) error {
if p.closed.IsBroken() {
return errors.New("media is already closed")
}
if p.opts.IgnorePreanswerData {
p.port.stopDiscarding()
}
go p.rtpLoop(tid, p.sess)
w, err := p.sess.OpenWriteStream()
if err != nil {
Expand Down
Loading