feat: Refine Call Detail UI to separate network info from transaction flow

This commit is contained in:
Jose Luis Montañes Ojados
2026-01-19 14:36:01 +01:00
parent 063650976b
commit 7375539def
2 changed files with 18 additions and 5 deletions

View File

@@ -629,20 +629,32 @@ func (m Model) renderCallDetail() string {
b.WriteString(fmt.Sprintf("State: %s\n", flow.State)) b.WriteString(fmt.Sprintf("State: %s\n", flow.State))
b.WriteString(fmt.Sprintf("Packets: %d\n\n", len(flow.Packets))) b.WriteString(fmt.Sprintf("Packets: %d\n\n", len(flow.Packets)))
// Network Summary Section
b.WriteString("Network Layer:\n")
// Find first packet to get initial IPs
if len(flow.Packets) > 0 {
first := flow.Packets[0]
srcLabel := m.networkMap.LabelForIP(first.SourceIP)
dstLabel := m.networkMap.LabelForIP(first.DestIP)
b.WriteString(fmt.Sprintf(" Source: %s (%s:%d)\n", srcLabel, first.SourceIP, first.SourcePort))
b.WriteString(fmt.Sprintf(" Destination: %s (%s:%d)\n", dstLabel, first.DestIP, first.DestPort))
}
b.WriteString("\n")
b.WriteString("Transaction Flow:\n") b.WriteString("Transaction Flow:\n")
for i, pkt := range flow.Packets { for i, pkt := range flow.Packets {
arrow := "→" arrow := "→"
if !pkt.IsRequest { // Simple direction indicator based on whether it matches initial source
if len(flow.Packets) > 0 && pkt.SourceIP != flow.Packets[0].SourceIP {
arrow = "←" arrow = "←"
} }
// Format timestamp // Format timestamp
ts := pkt.Timestamp.Format("15:04:05.000") ts := pkt.Timestamp.Format("15:04:05.000")
// Detailed packet info line // Clean packet info line (Timestamp + Arrow + Method/Status)
b.WriteString(fmt.Sprintf(" %d. [%s] %s %s %s:%d -> %s:%d\n", b.WriteString(fmt.Sprintf(" %d. [%s] %s %s\n", i+1, ts, arrow, pkt.Summary()))
i+1, ts, arrow, pkt.Summary(),
pkt.SourceIP, pkt.SourcePort, pkt.DestIP, pkt.DestPort))
// Show SDP info if present // Show SDP info if present
if pkt.SDP != nil { if pkt.SDP != nil {

View File

@@ -173,3 +173,4 @@
[14:33:09.310] [DEBUG] PcapReader: Packet 24 detected as SIP, parsing... [14:33:09.310] [DEBUG] PcapReader: Packet 24 detected as SIP, parsing...
[14:33:09.312] [INFO] PcapReader: Found SIP packet 24: 200 e9270b7c047542ef9af488d27b82162e [14:33:09.312] [INFO] PcapReader: Found SIP packet 24: 200 e9270b7c047542ef9af488d27b82162e
[14:33:09.314] [INFO] PcapReader: Finished reading. Total packets: 24, SIP packets: 24 [14:33:09.314] [INFO] PcapReader: Finished reading. Total packets: 24, SIP packets: 24
[14:35:22.258] [INFO] Telephony Inspector exited normally