Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
biglittlebigben committed Oct 22, 2024
1 parent a657692 commit 47b4452
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/sip/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ func (c *inboundCall) handleDTMF(tone dtmf.Event) {
}
}

func (c *inboundCall) transferCall(ctx context.Context, transferTo string, dialtone bool) error {
func (c *inboundCall) transferCall(ctx context.Context, transferTo string, dialtone bool) (retErr error) {
var err error

if dialtone && c.started.IsBroken() && !c.done.Load() {
Expand All @@ -785,7 +785,7 @@ func (c *inboundCall) transferCall(ctx context.Context, transferTo string, dialt
w := c.lkRoom.SwapOutput(nil)

defer func() {
if err != nil && !c.done.Load() {
if retErr != nil && !c.done.Load() {
c.lkRoom.SwapOutput(w)
} else {
w.Close()
Expand Down
4 changes: 2 additions & 2 deletions pkg/sip/outbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func (c *outboundCall) handleDTMF(ev dtmf.Event) {
}, lksdk.WithDataPublishReliable(true))
}

func (c *outboundCall) transferCall(ctx context.Context, transferTo string, dialtone bool) error {
func (c *outboundCall) transferCall(ctx context.Context, transferTo string, dialtone bool) (retErr error) {
var err error

if dialtone && c.started.IsBroken() && !c.stopped.IsBroken() {
Expand All @@ -444,7 +444,7 @@ func (c *outboundCall) transferCall(ctx context.Context, transferTo string, dial
w := c.lkRoom.SwapOutput(nil)

defer func() {
if err != nil && !c.stopped.IsBroken() {
if retErr != nil && !c.stopped.IsBroken() {
c.lkRoom.SwapOutput(w)
} else {
w.Close()
Expand Down

0 comments on commit 47b4452

Please sign in to comment.