Skip to content

Commit

Permalink
Fix race when playing dial tones. (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
dennwc authored Nov 18, 2024
1 parent 5a05221 commit 44fe89c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/sip/outbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,13 @@ func (c *outboundCall) dialSIP(ctx context.Context) error {
go func() {
rctx, span := tracer.Start(rctx, "tones.Play")
defer span.End()
tones.Play(rctx, c.lkRoomIn, ringVolume, tones.ETSIRinging)
c.mu.RLock()
dst := c.lkRoomIn
c.mu.RUnlock()
if dst == nil {
return
}
tones.Play(rctx, dst, ringVolume, tones.ETSIRinging)
}()
}
err := c.sipSignal(ctx)
Expand Down

0 comments on commit 44fe89c

Please sign in to comment.