Skip to content

Commit 4c199b0

Browse files
authored
refer can be canceled by multiple reasons (#743)
1 parent d5d1e09 commit 4c199b0

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

pkg/sip/inbound.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,8 +2216,9 @@ func (c *sipInbound) TransferCall(ctx context.Context, transferTo string, header
22162216
case <-ctx.Done():
22172217
return psrpc.NewErrorf(psrpc.Canceled, "refer canceled")
22182218
case <-callDone:
2219-
// At this point, REFER was accepted, but we received a BYE, nothing to do, also not an error
2220-
c.log.Infow("refer canceled by BYE from remote")
2219+
// REFER was accepted (2xx) but the call ended before it completed —
2220+
// remote BYE, room deletion, or local hangup.
2221+
c.log.Infow("refer canceled: call ended before transfer completed")
22212222
return nil
22222223
case err := <-c.referDone:
22232224
if err != nil {

pkg/sip/outbound.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,8 +1246,9 @@ func (c *sipOutbound) transferCall(ctx context.Context, transferTo string, heade
12461246
case <-ctx.Done():
12471247
return psrpc.NewErrorf(psrpc.Canceled, "refer canceled")
12481248
case <-callDone:
1249-
// At this point, REFER was accepted, but we received a BYE, nothing to do, also not an error
1250-
c.log.Infow("refer canceled by BYE from remote")
1249+
// REFER was accepted (2xx) but the call ended before it completed —
1250+
// remote BYE, room deletion, or local hangup.
1251+
c.log.Infow("refer canceled: call ended before transfer completed")
12511252
return nil
12521253
case err := <-c.referDone:
12531254
if err != nil {

0 commit comments

Comments
 (0)