homer

package
v0.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alias

type Alias struct {
	ID        float64 `json:"id"`
	IP        string  `json:"ip"`
	Port      float64 `json:"port"`
	Mask      float64 `json:"mask"`
	Alias     string  `json:"alias"`
	Status    bool    `json:"status"`
	CaptureID string  `json:"captureID"`
}

Alias represents a Homer IP/port alias

type CallRecord

type CallRecord struct {
	ID         float64 `json:"id"`
	Date       int64   `json:"create_date"`
	MicroTS    int64   `json:"micro_ts"`
	Protocol   float64 `json:"protocol"`
	SourceIP   string  `json:"srcIp"`
	SourcePort float64 `json:"srcPort"`
	DestIP     string  `json:"dstIp"`
	DestPort   float64 `json:"dstPort"`
	CallID     string  `json:"sid"`
	Method     string  `json:"method"`
	MethodText string  `json:"method_text"`
	FromUser   string  `json:"from_user"`
	ToUser     string  `json:"to_user"`
	RuriUser   string  `json:"ruri_user"`
	Status     float64 `json:"status"`
	AliasSrc   string  `json:"aliasSrc"`
	AliasDst   string  `json:"aliasDst"`
	Table      string  `json:"table"`
}

CallRecord represents a single call in search results

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the Homer 7.x REST API

func NewClient

func NewClient(baseURL string) *Client

NewClient creates a new Homer API client

func (*Client) Authenticate

func (c *Client) Authenticate(username, password string) error

Authenticate logs in to Homer and stores the JWT token

func (*Client) ExportPCAP

func (c *Client) ExportPCAP(params SearchParams) ([]byte, error)

ExportPCAP exports call messages as a PCAP file

func (*Client) ListAliases

func (c *Client) ListAliases() ([]Alias, error)

ListAliases returns all configured IP/port aliases

func (*Client) SearchCalls

func (c *Client) SearchCalls(params SearchParams) (*SearchResult, error)

SearchCalls searches for SIP calls matching the given parameters

func (*Client) TestConnection

func (c *Client) TestConnection() error

TestConnection verifies the Homer API is reachable (unauthenticated health check)

type SearchParams

type SearchParams struct {
	From   time.Time
	To     time.Time
	Caller string
	Callee string
	CallID string
	Limit  int
}

SearchParams holds search query parameters for Homer API calls

type SearchResult

type SearchResult struct {
	Data []CallRecord `json:"data"`
}

SearchResult holds the response from a call search

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL