Skip to content

Commit

Permalink
Close output in case of success
Browse files Browse the repository at this point in the history
  • Loading branch information
biglittlebigben committed Oct 22, 2024
1 parent af37c40 commit a657692
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/sip/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,8 @@ func (c *inboundCall) transferCall(ctx context.Context, transferTo string, dialt
defer func() {
if err != nil && !c.done.Load() {
c.lkRoom.SwapOutput(w)
} else {
w.Close()
}
}()

Expand Down
2 changes: 2 additions & 0 deletions pkg/sip/outbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,8 @@ func (c *outboundCall) transferCall(ctx context.Context, transferTo string, dial
defer func() {
if err != nil && !c.stopped.IsBroken() {
c.lkRoom.SwapOutput(w)
} else {
w.Close()
}
}()

Expand Down

0 comments on commit a657692

Please sign in to comment.