diff --git a/pkg/sip/inbound.go b/pkg/sip/inbound.go index 7b6e04a..cf9b5ca 100644 --- a/pkg/sip/inbound.go +++ b/pkg/sip/inbound.go @@ -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() } }() diff --git a/pkg/sip/outbound.go b/pkg/sip/outbound.go index 6d0f811..83c7e5a 100644 --- a/pkg/sip/outbound.go +++ b/pkg/sip/outbound.go @@ -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() } }()