diff --git a/pkg/calls/call.go b/pkg/calls/call.go index 44f0702..06b1951 100644 --- a/pkg/calls/call.go +++ b/pkg/calls/call.go @@ -91,7 +91,17 @@ func (c *Call) GetResourceName() string { } func (c *Call) String() string { - return fmt.Sprintf("%s to %d from %d", c.AudioName, c.Talkgroup, c.Source) + var from string + switch { + case c.Source != 0 && c.TalkerAlias != nil: + from = fmt.Sprintf(" from %s (%d)", *c.TalkerAlias, c.Source) + case c.Source != 0: + from = fmt.Sprintf(" from %d", c.Source) + case c.TalkerAlias != nil: + from = fmt.Sprintf(" from %s", *c.TalkerAlias) + } + + return fmt.Sprintf("%s to %d%s", c.AudioName, c.Talkgroup, from) } func (c *Call) ShouldStore() bool { diff --git a/pkg/rest/incidents.go b/pkg/rest/incidents.go index 36a018a..5b2dc40 100644 --- a/pkg/rest/incidents.go +++ b/pkg/rest/incidents.go @@ -229,8 +229,13 @@ func (ia *incidentsAPI) getCallsM3U(id ID, w http.ResponseWriter, r *http.Reques return } var from string - if c.Source != 0 { + switch { + case c.Source != 0 && c.TalkerAlias != nil: + from = fmt.Sprintf(" from %s (%d)", *c.TalkerAlias, c.Source) + case c.Source != 0: from = fmt.Sprintf(" from %d", c.Source) + case c.TalkerAlias != nil: + from = fmt.Sprintf(" from %s", *c.TalkerAlias) } callUrl.Path = urlRoot + c.ID.String() diff --git a/pkg/stats/stats.go b/pkg/stats/stats.go index 5504935..a82991c 100644 --- a/pkg/stats/stats.go +++ b/pkg/stats/stats.go @@ -10,7 +10,6 @@ import ( "dynatron.me/x/stillbox/pkg/calls" "dynatron.me/x/stillbox/pkg/calls/callstore" "dynatron.me/x/stillbox/pkg/services" - "github.com/rs/zerolog/log" ) const DefaultExpiration = 5 * time.Minute