Documentation
¶
Overview ¶
Package controlapi defines the HTTP contract between the split SIP signaling server and one or more RTP media servers.
Index ¶
- Constants
- func HealthOK(w http.ResponseWriter, _ *http.Request)
- func LegPath(callID string) string
- func LegStartPath(callID string) string
- func NodePath(nodeID string) string
- type ErrorBody
- type HealthResponse
- type NodeInfo
- type PrepareLegRequest
- type PrepareLegResponse
- type RegisterNodeRequest
- type RegisterNodeResponse
Constants ¶
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 LegStartPath ¶
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 ¶
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 ¶
RegisterNodeResponse acknowledges registration / heartbeat.