sipcapture / heplify

Portable and Lightweight HEP Capture Agent for HOMER
https://sipcapture.org
GNU Affero General Public License v3.0
185 stars 66 forks source link

Unable to set dump file name and certain dump directory #212

Closed dev-deeper closed 3 years ago

dev-deeper commented 3 years ago

When capturing traffic with rotation of the dump file, I cannot specify the name of the dump file. Also this creates subdirectories in format "year/month/day/". It hardcoded in dump/dump.go#L79:

func movePcap(tempName, outputPath string) error {
    dateString := time.Now().Format("2006/01/02/02.01.2006T15-04-05") + "_node" + strconv.Itoa(int(config.Cfg.HepNodeID)) + ".pcap"

I see two points here: 1) Maybe let the user specify the file name himself? 1) Do not create subdirectories if "-wf" (Path to write pcap file) option specified? For example, I just want to save my dump files in "/tmp/example_dir" dir without creating subdirs like "/tmp/example_dir/2021/04/22/<name>.pcap". In my opinion, this is confusing in the understanding of the "-wf" option.

lmangani commented 3 years ago

This is just a test feature but feel free to submit a PRs with improvements.

This said, I am personally very much against dumping all traffic and allowing illegal interception of calls with our oss toolset. This type of feature belongs in malicious tools, mass troubleshooting tools should not require or allow privacy invasion. Hopefully you just use RTP headers and this is not the case.