From 5799bf0bf770419880e3ecce66dd36ee8ceff1a0 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Wed, 21 Jan 2026 06:03:12 -0500 Subject: [PATCH 1/5] add telephony reporters Signed-off-by: shishir gowda --- .../telelphonycallobs/gen_reporter.go | 73 +++++++++++++++ .../telelphonycallobs/gen_reporter_noop.go | 91 +++++++++++++++++++ observability/telelphonycallobs/gen_source.go | 60 ++++++++++++ 3 files changed, 224 insertions(+) create mode 100644 observability/telelphonycallobs/gen_reporter.go create mode 100644 observability/telelphonycallobs/gen_reporter_noop.go create mode 100644 observability/telelphonycallobs/gen_source.go diff --git a/observability/telelphonycallobs/gen_reporter.go b/observability/telelphonycallobs/gen_reporter.go new file mode 100644 index 000000000..f336a076b --- /dev/null +++ b/observability/telelphonycallobs/gen_reporter.go @@ -0,0 +1,73 @@ +// Code generated; DO NOT EDIT. + +package telelphonycallobs + +import ( + "time" +) + +const Version_A2HD0O8 = true + +type KeyResolver interface { + Resolve(string) + Reset() +} + +type Reporter interface { + WithProject(id string) ProjectReporter + WithDeferredProject() (ProjectReporter, KeyResolver) +} + +type ProjectTx interface{} + +type ProjectReporter interface { + RegisterFunc(func(ts time.Time, tx ProjectTx) bool) + Tx(func(tx ProjectTx)) + TxAt(time.Time, func(tx ProjectTx)) + WithCall(id string) CallReporter + WithDeferredCall() (CallReporter, KeyResolver) + ProjectTx +} + +type CallTx interface { + ReportStartTime(v time.Time) + ReportEndTime(v time.Time) + ReportDuration(v uint64) + ReportDurationMinutes(v uint16) + ReportTrunkID(v string) + ReportDispatchID(v string) + ReportCalleeNumber(v string) + ReportCalleeHost(v string) + ReportCallerNumber(v string) + ReportCallerHost(v string) + ReportDirection(v CallDirection) + ReportTransport(v CallTransport) + ReportProviderCallID(v string) + ReportProviderName(v string) + ReportRoomID(v string) + ReportRoomName(v string) + ReportParticipantIdentity(v string) + ReportError(v string) + ReportStatus(v CallStatus) + ReportResponseCode(v uint16) + ReportDisconnectReason(v string) + ReportTransferID(v string) + ReportTransferTo(v string) + ReportTransferDuration(v uint32) + ReportTransferStatus(v CallTransferStatus) + ReportTransferStatusCode(v uint16) + ReportTransferError(v string) + ReportCodec(v string) + ReportRegion(v string) + ReportPcapLink(v string) + ReportAttributes(v string) + ReportFeatures(v uint16) + ReportEncryption(v CallEncryption) +} + +type CallReporter interface { + RegisterFunc(func(ts time.Time, tx CallTx) bool) + Tx(func(tx CallTx)) + TxAt(time.Time, func(tx CallTx)) + CallTx +} diff --git a/observability/telelphonycallobs/gen_reporter_noop.go b/observability/telelphonycallobs/gen_reporter_noop.go new file mode 100644 index 000000000..0ec2541ea --- /dev/null +++ b/observability/telelphonycallobs/gen_reporter_noop.go @@ -0,0 +1,91 @@ +// Code generated; DO NOT EDIT. + +package telelphonycallobs + +import ( + "time" +) + +var ( + _ Reporter = (*noopReporter)(nil) + _ ProjectReporter = (*noopProjectReporter)(nil) + _ CallReporter = (*noopCallReporter)(nil) +) + +type noopKeyResolver struct{} + +func (noopKeyResolver) Resolve(string) {} +func (noopKeyResolver) Reset() {} + +type noopReporter struct{} + +func NewNoopReporter() Reporter { + return &noopReporter{} +} + +func (r *noopReporter) WithProject(id string) ProjectReporter { + return &noopProjectReporter{} +} + +func (r *noopReporter) WithDeferredProject() (ProjectReporter, KeyResolver) { + return &noopProjectReporter{}, noopKeyResolver{} +} + +type noopProjectReporter struct{} + +func NewNoopProjectReporter() ProjectReporter { + return &noopProjectReporter{} +} + +func (r *noopProjectReporter) RegisterFunc(f func(ts time.Time, tx ProjectTx) bool) {} +func (r *noopProjectReporter) Tx(f func(ProjectTx)) {} +func (r *noopProjectReporter) TxAt(ts time.Time, f func(ProjectTx)) {} +func (r *noopProjectReporter) WithCall(id string) CallReporter { + return &noopCallReporter{} +} +func (r *noopProjectReporter) WithDeferredCall() (CallReporter, KeyResolver) { + return &noopCallReporter{}, noopKeyResolver{} +} + +type noopCallReporter struct{} + +func NewNoopCallReporter() CallReporter { + return &noopCallReporter{} +} + +func (r *noopCallReporter) RegisterFunc(f func(ts time.Time, tx CallTx) bool) {} +func (r *noopCallReporter) Tx(f func(CallTx)) {} +func (r *noopCallReporter) TxAt(ts time.Time, f func(CallTx)) {} +func (r *noopCallReporter) ReportStartTime(v time.Time) {} +func (r *noopCallReporter) ReportEndTime(v time.Time) {} +func (r *noopCallReporter) ReportDuration(v uint64) {} +func (r *noopCallReporter) ReportDurationMinutes(v uint16) {} +func (r *noopCallReporter) ReportTrunkID(v string) {} +func (r *noopCallReporter) ReportDispatchID(v string) {} +func (r *noopCallReporter) ReportCalleeNumber(v string) {} +func (r *noopCallReporter) ReportCalleeHost(v string) {} +func (r *noopCallReporter) ReportCallerNumber(v string) {} +func (r *noopCallReporter) ReportCallerHost(v string) {} +func (r *noopCallReporter) ReportDirection(v CallDirection) {} +func (r *noopCallReporter) ReportTransport(v CallTransport) {} +func (r *noopCallReporter) ReportProviderCallID(v string) {} +func (r *noopCallReporter) ReportProviderName(v string) {} +func (r *noopCallReporter) ReportRoomID(v string) {} +func (r *noopCallReporter) ReportRoomName(v string) {} +func (r *noopCallReporter) ReportParticipantIdentity(v string) {} +func (r *noopCallReporter) ReportError(v string) {} +func (r *noopCallReporter) ReportStatus(v CallStatus) {} +func (r *noopCallReporter) ReportResponseCode(v uint16) {} +func (r *noopCallReporter) ReportDisconnectReason(v string) {} +func (r *noopCallReporter) ReportTransferID(v string) {} +func (r *noopCallReporter) ReportTransferTo(v string) {} +func (r *noopCallReporter) ReportTransferDuration(v uint32) {} +func (r *noopCallReporter) ReportTransferStatus(v CallTransferStatus) {} +func (r *noopCallReporter) ReportTransferStatusCode(v uint16) {} +func (r *noopCallReporter) ReportTransferError(v string) {} +func (r *noopCallReporter) ReportCodec(v string) {} +func (r *noopCallReporter) ReportRegion(v string) {} +func (r *noopCallReporter) ReportPcapLink(v string) {} +func (r *noopCallReporter) ReportAttributes(v string) {} +func (r *noopCallReporter) ReportFeatures(v uint16) {} +func (r *noopCallReporter) ReportEncryption(v CallEncryption) {} diff --git a/observability/telelphonycallobs/gen_source.go b/observability/telelphonycallobs/gen_source.go new file mode 100644 index 000000000..5a526d63d --- /dev/null +++ b/observability/telelphonycallobs/gen_source.go @@ -0,0 +1,60 @@ +// Code generated; DO NOT EDIT. +package telelphonycallobs + +type CallDirection string + +const ( + CallDirectionUndefined CallDirection = "" + CallDirectionUnknown CallDirection = "unknown" + CallDirectionInbound CallDirection = "inbound" + CallDirectionOutbound CallDirection = "outbound" +) + +type CallTransport string + +const ( + CallTransportUndefined CallTransport = "" + CallTransportAuto CallTransport = "auto" + CallTransportUDP CallTransport = "udp" + CallTransportTCP CallTransport = "tcp" + CallTransportTLS CallTransport = "tls" +) + +type CallStatus string + +const ( + CallStatusUndefined CallStatus = "" + CallStatusActive CallStatus = "active" + CallStatusCallIncoming CallStatus = "call_incoming" + CallStatusParticipantJoined CallStatus = "participant_joined" + CallStatusDisconnected CallStatus = "disconnected" + CallStatusError CallStatus = "error" +) + +type CallTransferStatus string + +const ( + CallTransferStatusUndefined CallTransferStatus = "" + CallTransferStatusOngoing CallTransferStatus = "ongoing" + CallTransferStatusSuccess CallTransferStatus = "success" + CallTransferStatusFailed CallTransferStatus = "failed" +) + +type CallEncryption string + +const ( + CallEncryptionUndefined CallEncryption = "" + CallEncryptionDisable CallEncryption = "disable" + CallEncryptionAllow CallEncryption = "allow" + CallEncryptionRequire CallEncryption = "require" +) + +type Rollup string + +const ( + RollupUndefined Rollup = "" + RollupProject Rollup = "project" + RollupCallIndex Rollup = "call_index" + RollupStartTimeIndex Rollup = "start_time_index" + RollupEndTimeIndex Rollup = "end_time_index" +) From c0525c4ae587e3591030aa2e3e8297eb3e50d3ae Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Wed, 21 Jan 2026 06:04:32 -0500 Subject: [PATCH 2/5] update reporter interface Signed-off-by: shishir gowda --- observability/reporter.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/observability/reporter.go b/observability/reporter.go index b29872a55..132c20cd0 100644 --- a/observability/reporter.go +++ b/observability/reporter.go @@ -18,6 +18,7 @@ type Reporter interface { Connector() any // any is a placeholder for the connector type Egress() egressobs.Reporter Ingress() any + TelephonyCall() telephonyobs.Reporter Close() } @@ -55,5 +56,9 @@ func (reporter) Ingress() any { return nil } +func (reporter) TelephonyCall() telephonyobs.Reporter { + return telephonyobs.NewNoopReporter() +} + func (reporter) Close() { } From b573bab99ce12295d159d7f28f9c51e31c961eaf Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Wed, 21 Jan 2026 06:15:30 -0500 Subject: [PATCH 3/5] update schema Signed-off-by: shishir gowda --- observability/reporter.go | 3 ++- observability/telelphonycallobs/gen_reporter.go | 3 ++- observability/telelphonycallobs/gen_reporter_noop.go | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/observability/reporter.go b/observability/reporter.go index 132c20cd0..7767fe3cf 100644 --- a/observability/reporter.go +++ b/observability/reporter.go @@ -5,6 +5,7 @@ import ( "github.com/livekit/protocol/observability/egressobs" "github.com/livekit/protocol/observability/gatewayobs" "github.com/livekit/protocol/observability/roomobs" + "github.com/livekit/protocol/observability/telephonycallobs" "github.com/livekit/protocol/observability/telephonyobs" ) @@ -18,7 +19,7 @@ type Reporter interface { Connector() any // any is a placeholder for the connector type Egress() egressobs.Reporter Ingress() any - TelephonyCall() telephonyobs.Reporter + TelephonyCall() telephonycallobs.Reporter Close() } diff --git a/observability/telelphonycallobs/gen_reporter.go b/observability/telelphonycallobs/gen_reporter.go index f336a076b..873f1a0c5 100644 --- a/observability/telelphonycallobs/gen_reporter.go +++ b/observability/telelphonycallobs/gen_reporter.go @@ -6,7 +6,7 @@ import ( "time" ) -const Version_A2HD0O8 = true +const Version_J8004V8 = true type KeyResolver interface { Resolve(string) @@ -44,6 +44,7 @@ type CallTx interface { ReportTransport(v CallTransport) ReportProviderCallID(v string) ReportProviderName(v string) + ReportSIPCallID(v string) ReportRoomID(v string) ReportRoomName(v string) ReportParticipantIdentity(v string) diff --git a/observability/telelphonycallobs/gen_reporter_noop.go b/observability/telelphonycallobs/gen_reporter_noop.go index 0ec2541ea..7b41ddc48 100644 --- a/observability/telelphonycallobs/gen_reporter_noop.go +++ b/observability/telelphonycallobs/gen_reporter_noop.go @@ -70,6 +70,7 @@ func (r *noopCallReporter) ReportDirection(v CallDirection) {} func (r *noopCallReporter) ReportTransport(v CallTransport) {} func (r *noopCallReporter) ReportProviderCallID(v string) {} func (r *noopCallReporter) ReportProviderName(v string) {} +func (r *noopCallReporter) ReportSIPCallID(v string) {} func (r *noopCallReporter) ReportRoomID(v string) {} func (r *noopCallReporter) ReportRoomName(v string) {} func (r *noopCallReporter) ReportParticipantIdentity(v string) {} From fb36dfd2930d38d98ed1ed119f1e7cc8f05ed1a9 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Wed, 21 Jan 2026 06:18:30 -0500 Subject: [PATCH 4/5] remove reporter - tmp Signed-off-by: shishir gowda --- observability/reporter.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/observability/reporter.go b/observability/reporter.go index 7767fe3cf..b29872a55 100644 --- a/observability/reporter.go +++ b/observability/reporter.go @@ -5,7 +5,6 @@ import ( "github.com/livekit/protocol/observability/egressobs" "github.com/livekit/protocol/observability/gatewayobs" "github.com/livekit/protocol/observability/roomobs" - "github.com/livekit/protocol/observability/telephonycallobs" "github.com/livekit/protocol/observability/telephonyobs" ) @@ -19,7 +18,6 @@ type Reporter interface { Connector() any // any is a placeholder for the connector type Egress() egressobs.Reporter Ingress() any - TelephonyCall() telephonycallobs.Reporter Close() } @@ -57,9 +55,5 @@ func (reporter) Ingress() any { return nil } -func (reporter) TelephonyCall() telephonyobs.Reporter { - return telephonyobs.NewNoopReporter() -} - func (reporter) Close() { } From f85b359506e26d7be41fc5d0e039c2a4950c8573 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Wed, 21 Jan 2026 14:03:32 -0500 Subject: [PATCH 5/5] fix typo --- .../telephonycallobs/gen_reporter.go | 74 +++++++++++++++ .../telephonycallobs/gen_reporter_noop.go | 92 +++++++++++++++++++ observability/telephonycallobs/gen_source.go | 60 ++++++++++++ 3 files changed, 226 insertions(+) create mode 100644 observability/telephonycallobs/gen_reporter.go create mode 100644 observability/telephonycallobs/gen_reporter_noop.go create mode 100644 observability/telephonycallobs/gen_source.go diff --git a/observability/telephonycallobs/gen_reporter.go b/observability/telephonycallobs/gen_reporter.go new file mode 100644 index 000000000..966e2bb14 --- /dev/null +++ b/observability/telephonycallobs/gen_reporter.go @@ -0,0 +1,74 @@ +// Code generated; DO NOT EDIT. + +package telephonycallobs + +import ( + "time" +) + +const Version_J8004V8 = true + +type KeyResolver interface { + Resolve(string) + Reset() +} + +type Reporter interface { + WithProject(id string) ProjectReporter + WithDeferredProject() (ProjectReporter, KeyResolver) +} + +type ProjectTx interface{} + +type ProjectReporter interface { + RegisterFunc(func(ts time.Time, tx ProjectTx) bool) + Tx(func(tx ProjectTx)) + TxAt(time.Time, func(tx ProjectTx)) + WithCall(id string) CallReporter + WithDeferredCall() (CallReporter, KeyResolver) + ProjectTx +} + +type CallTx interface { + ReportStartTime(v time.Time) + ReportEndTime(v time.Time) + ReportDuration(v uint64) + ReportDurationMinutes(v uint16) + ReportTrunkID(v string) + ReportDispatchID(v string) + ReportCalleeNumber(v string) + ReportCalleeHost(v string) + ReportCallerNumber(v string) + ReportCallerHost(v string) + ReportDirection(v CallDirection) + ReportTransport(v CallTransport) + ReportProviderCallID(v string) + ReportProviderName(v string) + ReportSIPCallID(v string) + ReportRoomID(v string) + ReportRoomName(v string) + ReportParticipantIdentity(v string) + ReportError(v string) + ReportStatus(v CallStatus) + ReportResponseCode(v uint16) + ReportDisconnectReason(v string) + ReportTransferID(v string) + ReportTransferTo(v string) + ReportTransferDuration(v uint32) + ReportTransferStatus(v CallTransferStatus) + ReportTransferStatusCode(v uint16) + ReportTransferError(v string) + ReportCodec(v string) + ReportRegion(v string) + ReportPcapLink(v string) + ReportAttributes(v string) + ReportFeatures(v uint16) + ReportEncryption(v CallEncryption) +} + +type CallReporter interface { + RegisterFunc(func(ts time.Time, tx CallTx) bool) + Tx(func(tx CallTx)) + TxAt(time.Time, func(tx CallTx)) + CallTx +} diff --git a/observability/telephonycallobs/gen_reporter_noop.go b/observability/telephonycallobs/gen_reporter_noop.go new file mode 100644 index 000000000..c7398c069 --- /dev/null +++ b/observability/telephonycallobs/gen_reporter_noop.go @@ -0,0 +1,92 @@ +// Code generated; DO NOT EDIT. + +package telephonycallobs + +import ( + "time" +) + +var ( + _ Reporter = (*noopReporter)(nil) + _ ProjectReporter = (*noopProjectReporter)(nil) + _ CallReporter = (*noopCallReporter)(nil) +) + +type noopKeyResolver struct{} + +func (noopKeyResolver) Resolve(string) {} +func (noopKeyResolver) Reset() {} + +type noopReporter struct{} + +func NewNoopReporter() Reporter { + return &noopReporter{} +} + +func (r *noopReporter) WithProject(id string) ProjectReporter { + return &noopProjectReporter{} +} + +func (r *noopReporter) WithDeferredProject() (ProjectReporter, KeyResolver) { + return &noopProjectReporter{}, noopKeyResolver{} +} + +type noopProjectReporter struct{} + +func NewNoopProjectReporter() ProjectReporter { + return &noopProjectReporter{} +} + +func (r *noopProjectReporter) RegisterFunc(f func(ts time.Time, tx ProjectTx) bool) {} +func (r *noopProjectReporter) Tx(f func(ProjectTx)) {} +func (r *noopProjectReporter) TxAt(ts time.Time, f func(ProjectTx)) {} +func (r *noopProjectReporter) WithCall(id string) CallReporter { + return &noopCallReporter{} +} +func (r *noopProjectReporter) WithDeferredCall() (CallReporter, KeyResolver) { + return &noopCallReporter{}, noopKeyResolver{} +} + +type noopCallReporter struct{} + +func NewNoopCallReporter() CallReporter { + return &noopCallReporter{} +} + +func (r *noopCallReporter) RegisterFunc(f func(ts time.Time, tx CallTx) bool) {} +func (r *noopCallReporter) Tx(f func(CallTx)) {} +func (r *noopCallReporter) TxAt(ts time.Time, f func(CallTx)) {} +func (r *noopCallReporter) ReportStartTime(v time.Time) {} +func (r *noopCallReporter) ReportEndTime(v time.Time) {} +func (r *noopCallReporter) ReportDuration(v uint64) {} +func (r *noopCallReporter) ReportDurationMinutes(v uint16) {} +func (r *noopCallReporter) ReportTrunkID(v string) {} +func (r *noopCallReporter) ReportDispatchID(v string) {} +func (r *noopCallReporter) ReportCalleeNumber(v string) {} +func (r *noopCallReporter) ReportCalleeHost(v string) {} +func (r *noopCallReporter) ReportCallerNumber(v string) {} +func (r *noopCallReporter) ReportCallerHost(v string) {} +func (r *noopCallReporter) ReportDirection(v CallDirection) {} +func (r *noopCallReporter) ReportTransport(v CallTransport) {} +func (r *noopCallReporter) ReportProviderCallID(v string) {} +func (r *noopCallReporter) ReportProviderName(v string) {} +func (r *noopCallReporter) ReportSIPCallID(v string) {} +func (r *noopCallReporter) ReportRoomID(v string) {} +func (r *noopCallReporter) ReportRoomName(v string) {} +func (r *noopCallReporter) ReportParticipantIdentity(v string) {} +func (r *noopCallReporter) ReportError(v string) {} +func (r *noopCallReporter) ReportStatus(v CallStatus) {} +func (r *noopCallReporter) ReportResponseCode(v uint16) {} +func (r *noopCallReporter) ReportDisconnectReason(v string) {} +func (r *noopCallReporter) ReportTransferID(v string) {} +func (r *noopCallReporter) ReportTransferTo(v string) {} +func (r *noopCallReporter) ReportTransferDuration(v uint32) {} +func (r *noopCallReporter) ReportTransferStatus(v CallTransferStatus) {} +func (r *noopCallReporter) ReportTransferStatusCode(v uint16) {} +func (r *noopCallReporter) ReportTransferError(v string) {} +func (r *noopCallReporter) ReportCodec(v string) {} +func (r *noopCallReporter) ReportRegion(v string) {} +func (r *noopCallReporter) ReportPcapLink(v string) {} +func (r *noopCallReporter) ReportAttributes(v string) {} +func (r *noopCallReporter) ReportFeatures(v uint16) {} +func (r *noopCallReporter) ReportEncryption(v CallEncryption) {} diff --git a/observability/telephonycallobs/gen_source.go b/observability/telephonycallobs/gen_source.go new file mode 100644 index 000000000..6acb1f332 --- /dev/null +++ b/observability/telephonycallobs/gen_source.go @@ -0,0 +1,60 @@ +// Code generated; DO NOT EDIT. +package telephonycallobs + +type CallDirection string + +const ( + CallDirectionUndefined CallDirection = "" + CallDirectionUnknown CallDirection = "unknown" + CallDirectionInbound CallDirection = "inbound" + CallDirectionOutbound CallDirection = "outbound" +) + +type CallTransport string + +const ( + CallTransportUndefined CallTransport = "" + CallTransportAuto CallTransport = "auto" + CallTransportUDP CallTransport = "udp" + CallTransportTCP CallTransport = "tcp" + CallTransportTLS CallTransport = "tls" +) + +type CallStatus string + +const ( + CallStatusUndefined CallStatus = "" + CallStatusActive CallStatus = "active" + CallStatusCallIncoming CallStatus = "call_incoming" + CallStatusParticipantJoined CallStatus = "participant_joined" + CallStatusDisconnected CallStatus = "disconnected" + CallStatusError CallStatus = "error" +) + +type CallTransferStatus string + +const ( + CallTransferStatusUndefined CallTransferStatus = "" + CallTransferStatusOngoing CallTransferStatus = "ongoing" + CallTransferStatusSuccess CallTransferStatus = "success" + CallTransferStatusFailed CallTransferStatus = "failed" +) + +type CallEncryption string + +const ( + CallEncryptionUndefined CallEncryption = "" + CallEncryptionDisable CallEncryption = "disable" + CallEncryptionAllow CallEncryption = "allow" + CallEncryptionRequire CallEncryption = "require" +) + +type Rollup string + +const ( + RollupUndefined Rollup = "" + RollupProject Rollup = "project" + RollupCallIndex Rollup = "call_index" + RollupStartTimeIndex Rollup = "start_time_index" + RollupEndTimeIndex Rollup = "end_time_index" +)