This commit is contained in:
Benjamin Pracht committed 2024-10-08 12:49:04 -07:00
1 parent b1b8f5a178
commit 5eb2cd1a90
2 files changed
+62

No files matched your search

+2
View File
@@ -2,6 +2,8 @@ module github.com/livekit/livekit-server
go 1.22.7
replace github.com/livekit/protocol => ../protocol
require (
github.com/bep/debounce v1.2.1
github.com/d5/tengo/v2 v2.17.0
+60
View File
@@ -502,6 +502,30 @@ func (t *telemetryService) IngressEnded(ctx context.Context, info *livekit.Ingre
})
}
func (t *telemetryService) SIPInboundTrunkCreated(ctx context.Context, in *livekit.SIPInboundTrunkInfo) {
t.enqueue(func() {
t.SendEvent(ctx, newSIPInboundTrunkEvent(livekit.AnalyticsEventType_SIP_INBOUND_TRUNK_CREATED, in))
})
}
func (t *telemetryService) SIPInboundTrunkDeleted(ctx context.Context, in *livekit.SIPInboundTrunkInfo) {
t.enqueue(func() {
t.SendEvent(ctx, newSIPInboundTrunkEvent(livekit.AnalyticsEventType_SIP_INBOUND_TRUNK_DELETED, in))
})
}
func (t *telemetryService) SIPOutboundTrunkCreated(ctx context.Context, out *livekit.SIPOutboundTrunkInfo) {
t.enqueue(func() {
t.SendEvent(ctx, newSIPOutboundTrunkEvent(livekit.AnalyticsEventType_SIP_OUTBOUND_TRUNK_CREATED, out))
})
}
func (t *telemetryService) SIPOutboundTrunkDeleted(ctx context.Context, out *livekit.SIPOutboundTrunkInfo) {
t.enqueue(func() {
t.SendEvent(ctx, newSIPOutboundTrunkEvent(livekit.AnalyticsEventType_SIP_OUTBOUND_TRUNK_DELETED, out))
})
}
// returns a livekit.Room with only name and sid filled out
// returns nil if room is not found
func (t *telemetryService) getRoomDetails(participantID livekit.ParticipantID) *livekit.Room {
@@ -565,3 +589,39 @@ func newIngressEvent(event livekit.AnalyticsEventType, ingress *livekit.IngressI
Ingress: ingress,
}
}
func newSIPInboundTrunkEvent(event livekit.AnalyticsEventType, in *livekit.SIPInboundTrunkInfo) *livekit.AnalyticsEvent {
return &livekit.AnalyticsEvent{
Type: event,
Timestamp: timestamppb.Now(),
SipTrunkId: in.SipTrunkId,
SipInboundTrunk: in,
}
}
func newSIPOutboundTrunkEvent(event livekit.AnalyticsEventType, out *livekit.SIPOutboundTrunkInfo) *livekit.AnalyticsEvent {
return &livekit.AnalyticsEvent{
Type: event,
Timestamp: timestamppb.Now(),
SipTrunkId: in.SipTrunkId,
SipOutboundTrunk: out,
}
}
func newSIPDispatchRuleEvent(event livekit.AnalyticsEventType, dispatchRule *livekit.SIPDispatchRuleInfo) *livekit.AnalyticsEvent {
return &livekit.AnalyticsEvent{
Type: event,
Timestamp: timestamppb.Now(),
SipDispatchRuleId: dispatchRule.SipDispatchRuleId,
SipDispatchRule: dispatchRule,
}
}
func newSIPCallEvent(event livekit.AnalyticsEventType, sipCall *livekit.SIPCallInfo) *livekit.AnalyticsEvent {
return &livekit.AnalyticsEvent{
Type: event,
Timestamp: timestamppb.Now(),
SipCallId: sipCall.CallId,
SipCall: sipCall,
}
}