Skip to content

Commit

Permalink
Fix race when playing dial tones. (#228)
Browse files Browse the repository at this point in the history
(cherry picked from commit 44fe89c)
  • Loading branch information
dennwc committed Nov 18, 2024
1 parent 4b0b3cb commit 1c22c9a
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 @@ -274,7 +274,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 1c22c9a

Please sign in to comment.