Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/sip/outbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func (c *Client) newCall(ctx context.Context, tid traceid.ID, conf *config.Confi
call.media.DisableOut() // disabled until we get 200
if err := call.connectToRoom(ctx, room, c.getRoom); err != nil {
call.close(ctx, errors.Wrap(err, "room join failed"), callDropped, "join-failed", livekit.DisconnectReason_UNKNOWN_REASON)
return nil, fmt.Errorf("update room failed: %w", err)
return nil, psrpc.NewError(psrpc.Internal, fmt.Errorf("update room failed: %w", err))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just clarifying.. this will still be a 500 right ? I agree that it should be the case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it'll be a 5xx 👍

}

c.cmu.Lock()
Expand Down Expand Up @@ -393,9 +393,14 @@ func (c *outboundCall) connectSIP(ctx context.Context, tid traceid.ID) error {
status, desc, reason = callRejected, "busy", livekit.DisconnectReason_USER_REJECTED
reportErr = nil
}
} else if errors.Is(err, sdp.ErrNoCommonMedia) {
status, desc, reason = callRejected, "no-common-codec", livekit.DisconnectReason_MEDIA_FAILURE
reportErr = nil
err = psrpc.NewError(psrpc.FailedPrecondition, err)
} else if errors.Is(err, sdp.ErrNoCommonCrypto) {
status, desc, reason = callRejected, "encryption-required", livekit.DisconnectReason_MEDIA_FAILURE
reportErr = nil
err = psrpc.NewError(psrpc.FailedPrecondition, err)
}
c.close(ctx, reportErr, status, desc, reason)
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/sip/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ func (s *Service) validateCallProvider(state *CallState) error {

// Check if provider is internal and prevent transfer is enabled
if state.callInfo.ProviderInfo.Type == livekit.ProviderType_PROVIDER_TYPE_INTERNAL && state.callInfo.ProviderInfo.PreventTransfer {
return fmt.Errorf("we don't yet support transfers for this phone number type")
return psrpc.NewErrorf(psrpc.Unimplemented, "we don't yet support transfers for this phone number type")
}

return nil
Expand Down
Loading