controlapi

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package controlapi defines the HTTP contract between the split SIP signaling server and one or more RTP media servers.

Index

Constants

View Source
const (
	BasePath           = "/v1"
	HealthPath         = "/v1/health"
	LegsPath           = "/v1/legs"
	LegStartSuffix     = "/start"
	NodesPath          = "/v1/nodes"
	NodesRegisterPath  = "/v1/nodes/register"
	DefaultNodeTTLSecs = 45
)

Variables

This section is empty.

Functions

func HealthOK

func HealthOK(w http.ResponseWriter, _ *http.Request)

HealthOK is a trivial liveness handler (signaling-side probe fallback).

func LegPath

func LegPath(callID string) string

func LegStartPath

func LegStartPath(callID string) string

func NodePath

func NodePath(nodeID string) string

Types

type ErrorBody

type ErrorBody struct {
	Error string `json:"error"`
}

ErrorBody is returned on failed control API calls.

type HealthResponse

type HealthResponse struct {
	Status     string `json:"status"`
	NodeID     string `json:"node_id"`
	ActiveLegs int    `json:"active_legs"`
	MediaIP    string `json:"media_ip"`
}

HealthResponse is returned by each RTP media server for pool selection.

type NodeInfo

type NodeInfo struct {
	NodeID     string `json:"node_id"`
	ControlURL string `json:"control_url"`
	MediaIP    string `json:"media_ip"`
	ActiveLegs int    `json:"active_legs"`
	Healthy    bool   `json:"healthy"`
	Static     bool   `json:"static,omitempty"`
}

NodeInfo describes one RTP node known to the signaling server.

type PrepareLegRequest

type PrepareLegRequest struct {
	CallID   string `json:"call_id"`
	OfferSDP string `json:"offer_sdp"`
}

PrepareLegRequest is sent by the signaling server when an INVITE offer arrives.

type PrepareLegResponse

type PrepareLegResponse struct {
	CallID    string `json:"call_id"`
	NodeID    string `json:"node_id,omitempty"`
	MediaIP   string `json:"media_ip"`
	MediaPort int    `json:"media_port"`
	Codec     string `json:"codec"`
}

PrepareLegResponse tells signaling which c=/m= to place in the 200 OK SDP answer.

type RegisterNodeRequest

type RegisterNodeRequest struct {
	NodeID     string `json:"node_id"`
	ControlURL string `json:"control_url"`
	MediaIP    string `json:"media_ip"`
	ActiveLegs int    `json:"active_legs,omitempty"`
}

RegisterNodeRequest is sent by an RTP media server to join the signaling pool.

type RegisterNodeResponse

type RegisterNodeResponse struct {
	NodeID  string `json:"node_id"`
	TTLSecs int    `json:"ttl_sec"`
}

RegisterNodeResponse acknowledges registration / heartbeat.

Jump to

Keyboard shortcuts

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