Documentation
¶
Overview ¶
Package livekit provides the optional server-sdk-go/RoomIO backend for the stable warm-transfer workflow. Keeping it separate means TaskGroup and custom warm-transfer backends do not link native media dependencies.
Index ¶
- Constants
- type LiveKitConsultationFactory
- type LiveKitHoldFactory
- type LiveKitWarmTransferBackend
- func (b *LiveKitWarmTransferBackend[UserData]) CallerDisconnected() <-chan WarmTransferParticipantEvent
- func (b *LiveKitWarmTransferBackend[UserData]) CallerLocalIdentity(context.Context) (string, error)
- func (b *LiveKitWarmTransferBackend[UserData]) CallerPresent(context.Context) (bool, error)
- func (b *LiveKitWarmTransferBackend[UserData]) CallerRoomName(context.Context) (string, error)
- func (b *LiveKitWarmTransferBackend[UserData]) CaptureCallerIO(context.Context) (WarmTransferIOState, error)
- func (b *LiveKitWarmTransferBackend[UserData]) Close(ctx context.Context) error
- func (b *LiveKitWarmTransferBackend[UserData]) DeleteCallerRoomOnDisconnect(_ context.Context, room string) error
- func (b *LiveKitWarmTransferBackend[UserData]) DeleteRoom(ctx context.Context, room string) error
- func (b *LiveKitWarmTransferBackend[UserData]) Dial(ctx context.Context, request WarmTransferDialRequest) (WarmTransferConsultation, error)
- func (b *LiveKitWarmTransferBackend[UserData]) MoveParticipant(ctx context.Context, from, identity, to string) error
- func (b *LiveKitWarmTransferBackend[UserData]) RemoveParticipant(ctx context.Context, room, identity string) error
- func (b *LiveKitWarmTransferBackend[UserData]) SetCallerIO(_ context.Context, state WarmTransferIOState) error
- func (b *LiveKitWarmTransferBackend[UserData]) StartHold(ctx context.Context, audio WarmTransferHoldAudio) (WarmTransferHold, error)
- type LiveKitWarmTransferBackendOptions
- type WarmTransferBackend
- type WarmTransferConsultation
- type WarmTransferDialRequest
- type WarmTransferHold
- type WarmTransferHoldAudio
- type WarmTransferIOState
- type WarmTransferParticipantEvent
- type WarmTransferPostMergeBackend
- type WarmTransferSession
Constants ¶
const DefaultLiveKitCallerEventCapacity = 16
const DefaultWarmTransferCleanupTimeout = core.DefaultWarmTransferCleanupTimeout
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LiveKitConsultationFactory ¶
type LiveKitConsultationFactory[UserData any] func(context.Context, WarmTransferDialRequest, *lksdk.Room, *roomio.RTCBridge) (WarmTransferSession, *roomio.RoomIO, error)
LiveKitConsultationFactory is the escape hatch for specialized session ownership. The default factory creates a voice.AgentSession and RoomIO using ConsultationSessionOptions.
type LiveKitHoldFactory ¶
type LiveKitHoldFactory func(context.Context, *lksdk.Room, WarmTransferHoldAudio) (WarmTransferHold, error)
LiveKitHoldFactory starts application-owned hold audio on the caller room. The Go RTC SDK does not ship the agents-js built-in clip player, so this explicit boundary prevents silently substituting silence for the default.
type LiveKitWarmTransferBackend ¶
type LiveKitWarmTransferBackend[UserData any] struct { // contains filtered or unexported fields }
LiveKitWarmTransferBackend implements SIP dialing and room operations with server-sdk-go v2.18.1. It owns consultation rooms but never the caller room; caller E2EE state is therefore untouched. RoomConnectOptions configure E2EE for the separately-owned consultation room when required.
func NewLiveKitWarmTransferBackend ¶
func NewLiveKitWarmTransferBackend[UserData any](options LiveKitWarmTransferBackendOptions[UserData]) (*LiveKitWarmTransferBackend[UserData], error)
func (*LiveKitWarmTransferBackend[UserData]) CallerDisconnected ¶
func (b *LiveKitWarmTransferBackend[UserData]) CallerDisconnected() <-chan WarmTransferParticipantEvent
func (*LiveKitWarmTransferBackend[UserData]) CallerLocalIdentity ¶
func (b *LiveKitWarmTransferBackend[UserData]) CallerLocalIdentity(context.Context) (string, error)
func (*LiveKitWarmTransferBackend[UserData]) CallerPresent ¶
func (b *LiveKitWarmTransferBackend[UserData]) CallerPresent(context.Context) (bool, error)
func (*LiveKitWarmTransferBackend[UserData]) CallerRoomName ¶
func (b *LiveKitWarmTransferBackend[UserData]) CallerRoomName(context.Context) (string, error)
func (*LiveKitWarmTransferBackend[UserData]) CaptureCallerIO ¶
func (b *LiveKitWarmTransferBackend[UserData]) CaptureCallerIO(context.Context) (WarmTransferIOState, error)
func (*LiveKitWarmTransferBackend[UserData]) Close ¶
func (b *LiveKitWarmTransferBackend[UserData]) Close(ctx context.Context) error
func (*LiveKitWarmTransferBackend[UserData]) DeleteCallerRoomOnDisconnect ¶
func (b *LiveKitWarmTransferBackend[UserData]) DeleteCallerRoomOnDisconnect(_ context.Context, room string) error
func (*LiveKitWarmTransferBackend[UserData]) DeleteRoom ¶
func (b *LiveKitWarmTransferBackend[UserData]) DeleteRoom(ctx context.Context, room string) error
func (*LiveKitWarmTransferBackend[UserData]) Dial ¶
func (b *LiveKitWarmTransferBackend[UserData]) Dial(ctx context.Context, request WarmTransferDialRequest) (WarmTransferConsultation, error)
func (*LiveKitWarmTransferBackend[UserData]) MoveParticipant ¶
func (b *LiveKitWarmTransferBackend[UserData]) MoveParticipant(ctx context.Context, from, identity, to string) error
func (*LiveKitWarmTransferBackend[UserData]) RemoveParticipant ¶
func (b *LiveKitWarmTransferBackend[UserData]) RemoveParticipant(ctx context.Context, room, identity string) error
func (*LiveKitWarmTransferBackend[UserData]) SetCallerIO ¶
func (b *LiveKitWarmTransferBackend[UserData]) SetCallerIO(_ context.Context, state WarmTransferIOState) error
func (*LiveKitWarmTransferBackend[UserData]) StartHold ¶
func (b *LiveKitWarmTransferBackend[UserData]) StartHold(ctx context.Context, audio WarmTransferHoldAudio) (WarmTransferHold, error)
type LiveKitWarmTransferBackendOptions ¶
type LiveKitWarmTransferBackendOptions[UserData any] struct { // Job supplies URL/credentials/caller room. URL/APIKey/APISecret/CallerRoom // override it when set, which also permits use outside a worker job. Job *agents.JobContext[UserData] URL string APIKey string APISecret string CallerRoom *lksdk.Room CallerSession interface { Input() *voice.AgentInput Output() *voice.AgentOutput } // Prefer CallerBridge: the backend creates one filtered, bounded // subscription and does not process irrelevant RTC data. CallerEvents is for // externally-owned room callbacks. CallerBridge *roomio.RTCBridge CallerEvents <-chan WarmTransferParticipantEvent CallerEventCapacity int HoldFactory LiveKitHoldFactory ConsultationFactory LiveKitConsultationFactory[UserData] ConsultationSessionOptions voice.AgentSessionOptions[UserData] RoomConnectOptions []lksdk.ConnectOption RoomIOInput *roomio.RoomInputOptions RoomIOOutput *roomio.RoomOutputOptions ParentContext context.Context CloseTimeout time.Duration OnError func(error) }
type WarmTransferBackend ¶
type WarmTransferBackend = core.WarmTransferBackend
type WarmTransferConsultation ¶
type WarmTransferConsultation = core.WarmTransferConsultation
type WarmTransferDialRequest ¶
type WarmTransferDialRequest = core.WarmTransferDialRequest
type WarmTransferHold ¶
type WarmTransferHold = core.WarmTransferHold
type WarmTransferHoldAudio ¶
type WarmTransferHoldAudio = core.WarmTransferHoldAudio
type WarmTransferIOState ¶
type WarmTransferIOState = core.WarmTransferIOState
type WarmTransferParticipantEvent ¶
type WarmTransferParticipantEvent = core.WarmTransferParticipantEvent
type WarmTransferPostMergeBackend ¶
type WarmTransferPostMergeBackend = core.WarmTransferPostMergeBackend
type WarmTransferSession ¶
type WarmTransferSession = core.WarmTransferSession