{
  "id": "sngrep",
  "name": "sngrep",
  "homepage": "https://github.com/irontec/sngrep",
  "description": "sngrep is a tool for displaying SIP calls message flows from terminal.",
  "executables": [
    "sngrep"
  ],
  "dotfiles": {
    "paths": [
      "~/.sngreprc"
    ],
    "exclude": [],
    "secret": []
  },
  "commands": {
    "format": 1,
    "label": "Capture SIP traffic",
    "description": "Capture live SIP traffic or read a pcap file in the sngrep viewer. HEP/Homer, TLS key and config-file options are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": false,
      "short_attached": true,
      "short_bundles": true
    },
    "source": [
      {
        "id": "sngrep-man",
        "kind": "manual",
        "url": "https://manpages.debian.org/unstable/sngrep/sngrep.8.en.html",
        "revision": "Debian sngrep(8) 1.9.0",
        "evidence": "sngrep [-hVcivNqrD] [-IO pcap_dump ] [-d dev ] [-l limit ] [-B buffer ] [-k keyfile ] [-f config_file ] [-F] [-T text_file ] [-t] [-P] [-R] [-LHE capture_url ] [ <match expression> ] [ <bpf filter> ]\n-c\nOnly display dialogs starting with an INVITE request.\n-r\nCapture RTP packets payload.\n-i\nMake match expression case insensitive.\n-v\nInvert match expression.\n-I pcap_dump\nRead packets from pcap file instead of network devices.\n-O pcap_dump\nSave all captured packets to a pcap file.\n-d dev\nUse this capture device instead of default (any).\n-l limit\nSet capture limit to N dialogs.\n-R\nRotate calls when capture limit has been reached.\n-N\nDon't display sngrep interface, just capture.\n-q\nDon't print captured dialogs in no interface mode.\n-F\nDo not read configuration from default config file."
      }
    ],
    "field": [
      {
        "id": "device",
        "label": "Capture device",
        "description": "any, a device like eth0, or a comma-separated list.",
        "type": "string",
        "option": [
          "-d"
        ],
        "sources": [
          "sngrep-man"
        ]
      },
      {
        "id": "read_pcap",
        "label": "Read from pcap file",
        "type": "path",
        "option": [
          "-I"
        ],
        "path": {
          "kind": "file",
          "role": "input"
        },
        "sources": [
          "sngrep-man"
        ]
      },
      {
        "id": "write_pcap",
        "label": "Save capture to pcap file",
        "type": "path",
        "option": [
          "-O"
        ],
        "path": {
          "kind": "file",
          "role": "output"
        },
        "effect": "overwrite",
        "sources": [
          "sngrep-man"
        ]
      },
      {
        "id": "limit",
        "label": "Dialog limit",
        "type": "integer",
        "option": [
          "-l"
        ],
        "sources": [
          "sngrep-man"
        ]
      },
      {
        "id": "invites_only",
        "label": "Only dialogs starting with INVITE",
        "type": "boolean",
        "option": [
          "-c"
        ],
        "sources": [
          "sngrep-man"
        ]
      },
      {
        "id": "rtp",
        "label": "Capture RTP payload",
        "type": "boolean",
        "option": [
          "-r"
        ],
        "sources": [
          "sngrep-man"
        ]
      },
      {
        "id": "no_interface",
        "label": "Capture only, no interface",
        "type": "boolean",
        "option": [
          "-N"
        ],
        "sources": [
          "sngrep-man"
        ]
      },
      {
        "id": "quiet",
        "label": "Quiet (with no interface)",
        "type": "boolean",
        "option": [
          "-q"
        ],
        "sources": [
          "sngrep-man"
        ]
      },
      {
        "id": "case_insensitive",
        "label": "Case-insensitive match",
        "type": "boolean",
        "option": [
          "-i"
        ],
        "sources": [
          "sngrep-man"
        ]
      },
      {
        "id": "invert",
        "label": "Invert match",
        "type": "boolean",
        "option": [
          "-v"
        ],
        "sources": [
          "sngrep-man"
        ]
      },
      {
        "id": "no_config",
        "label": "Ignore default config file",
        "type": "boolean",
        "option": [
          "-F"
        ],
        "sources": [
          "sngrep-man"
        ]
      },
      {
        "id": "match",
        "label": "Match expression",
        "description": "Matched against message payloads.",
        "type": "string",
        "position": 0,
        "sources": [
          "sngrep-man"
        ]
      },
      {
        "id": "bpf",
        "label": "BPF filter",
        "description": "For example: port 5060. Needs a match expression first (use \"\" for none).",
        "type": "string",
        "position": 1,
        "sources": [
          "sngrep-man"
        ]
      }
    ],
    "task": [
      {
        "id": "live",
        "label": "Watch a device",
        "fields": [
          "device",
          "invites_only",
          "match",
          "case_insensitive"
        ],
        "required": []
      },
      {
        "id": "pcap",
        "label": "Open a pcap file",
        "fields": [
          "read_pcap",
          "match",
          "case_insensitive",
          "invert"
        ],
        "required": [
          "read_pcap"
        ]
      },
      {
        "id": "record",
        "label": "Record to pcap",
        "set": {
          "no_interface": [
            true
          ]
        },
        "fields": [
          "device",
          "write_pcap",
          "no_interface",
          "quiet"
        ],
        "required": [
          "write_pcap"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "device",
          "read_pcap",
          "write_pcap",
          "invites_only",
          "match"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "limit",
          "rtp",
          "no_interface",
          "quiet",
          "case_insensitive",
          "invert",
          "no_config",
          "bpf"
        ]
      }
    ]
  }
}
