feat: Add timestamp to export filename and include network context

This commit is contained in:
Jose Luis Montañes Ojados
2026-01-19 21:49:04 +01:00
parent bdf6dfc1e1
commit b2ff043923

View File

@@ -630,7 +630,8 @@ func (m *Model) updateSubView(msg tea.Msg) (tea.Model, tea.Cmd) {
safeCallID = strings.ReplaceAll(safeCallID, ":", "_")
safeCallID = strings.ReplaceAll(safeCallID, "\\", "_")
filename := fmt.Sprintf("export_%s.log", safeCallID)
timestamp := time.Now().Format("20060102_150405")
filename := fmt.Sprintf("export_%s_%s.log", timestamp, safeCallID)
err := m.exportCallToLog(flow, filename)
if err != nil {
m.captureError = fmt.Sprintf("Export failed: %v", err)
@@ -1480,6 +1481,15 @@ func (m *Model) exportCallToLog(flow *sip.CallFlow, filename string) error {
fmt.Fprintf(f, " Destination: %s (%s:%d)\n\n", dstLabel, first.DestIP, first.DestPort)
}
// Network Map Context
if len(m.networkMap.Nodes) > 0 {
fmt.Fprintf(f, "Network Context:\n")
for _, node := range m.networkMap.Nodes {
fmt.Fprintf(f, " - %s (%s): %s\n", node.Name, node.Type, node.IP)
}
fmt.Fprintf(f, "\n")
}
// Transaction Flow
fmt.Fprintf(f, "Transaction Flow:\n")
fmt.Fprintf(f, "-----------------\n")