Пример #1
0
func mainAction(c *cli.Context) {
	if len(c.Args()) == 0 {
		fmt.Println("You must specify a pcap filename")
		return
	}

	if c.String("to") != "" {
		Filters = append(Filters, PcapFilter{filterType: "to", value: c.String("to")})
	}

	if c.String("callId") != "" {
		Filters = append(Filters, PcapFilter{filterType: "callId", value: c.String("callId")})
	}

	err := createFilteredPcaps(c.Args()[0], c.String("outputDirectory"), c.Bool("debug"))

	if err != nil {
		log.Fatal(err)
	}
}
Пример #2
0
func hasFilters(c *cli.Context) bool {
	return c.String("to") != "" || c.String("callId") != "" || c.String("sipCode") != ""
}