Skip to content

TEL-886: Self review - #805

Merged
alexlivekit merged 8 commits into
tel-886/media-portfrom
tel-886/self-review
Aug 21, 2026
Merged

TEL-886: Self review#805
alexlivekit merged 8 commits into
tel-886/media-portfrom
tel-886/self-review

Conversation

@alexlivekit

@alexlivekit alexlivekit commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

To be added on top of #802
Remaining known issues:

@alexlivekit
alexlivekit requested a review from a team as a code owner August 21, 2026 07:53
@alexlivekit alexlivekit changed the title Tel 886/self review TEL-886: Self review Aug 21, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

Comment thread pkg/sip/inbound.go
Comment on lines +1042 to +1044
if err := c.joinRoom(ctx, disp.Room, status); err != nil {
return fmt.Errorf("failed joining room: %w", err)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly fail on media first, then join room

Comment thread pkg/sip/media_pipeline.go
codecInfo := mc.Audio.Codec.Info()
sink = msdk.ResampleWriter(sink, codecInfo.SampleRate)

if p.conf.stats != nil {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 160 already dereferences p.conf.stats

Comment on lines +128 to +133
type pcmCollector struct {
sampleRate int

mu sync.Mutex
buf msdk.PCM16Sample
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix data race in test by synchronizing the harness

Comment thread pkg/sip/media_port.go
Comment on lines +720 to 725
func (p *mediaPort) reportPeerCodecs(d sdp.MediaDesc, reinvite bool) {
if p.mon == nil {
return
}
p.mon.PeerSDP(peerCodecNames(d))
p.mon.PeerSDP(peerCodecNames(d), reinvite)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added reinvite label to metrics.

Comment thread pkg/sip/media_port.go
p.mu.Lock() // No concurrent rebuilding of the pipeline
defer p.mu.Unlock()

p.offer = nil

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nego done, can generate new offer, even if we don't apply last offer-answer exchange.

Comment thread pkg/sip/media_port.go
Comment on lines +919 to +920
audioToPort = nil
dtmfToPort = nil

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prevent restoring closed pipelines connectors at deferred funcs

Comment thread pkg/sip/media_port.go
Comment thread pkg/sip/media_port.go
return nil, err
}
if activateTimeout {
p.SetTimeout(p.opts.MediaTimeoutInitial, p.opts.MediaTimeout)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we're no longer arming the timeout in GenerateAnswer, do we need to invoke SetTimeout at some call sites in outbound.go or inbound.go?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outbound: no. We are still arming the timeout as part of ProcessAnswer().
inbound: Yes, and we are. It's part of the full review, but we are doing it as part of acceptCall()

@alexlivekit
alexlivekit merged commit eb1108b into tel-886/media-port Aug 21, 2026
2 checks passed
@alexlivekit
alexlivekit deleted the tel-886/self-review branch August 21, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants