Skip to main content
A Peer is a trusted SIP service, such as Asterisk or FreeSWITCH, that registers with Routr under an Address of Record (AOR). Several instances can register under the same AOR, and Routr load balances calls across them.

Fields

The API response also includes accessControlList and credentials, the objects the refs point to.

Constraints

  • name is required and must be 1 to 60 characters.
  • username is required and can’t contain spaces. In YAML it must be 4 to 60 characters. In pgdata it must be unique across Peers.
  • aor must start with sip: or backend:. The backend: prefix is deprecated; simpledata logs a warning and you should use sip:. Up to 323 characters.
  • contactAddr must be a valid FQDN or IP address. Up to 20 characters.
  • least-sessions needs the Location Service to run on Redis. It also needs each instance to report its active session count in the X-Session-Count header of its REGISTER. See SIP headers.
  • Session affinity applies to calls from the PSTN to a Number whose aorLink is this Peer’s aor. The affinity value comes from the header named in the Number’s sessionAffinityHeader.
In YAML, simpledata does not load spec.accessControlListRef for Peers. Through the API, pgdata stores it.

YAML example

The following Peer balances calls across Asterisk instances that register as asterisk.

rctl equivalent

Run the interactive create command and answer the prompts.
See rctl peers for the prompts and the other actions.

SDK equivalent

The following call creates the same Peer through the API.
For how the algorithms choose an instance, see Load balancing.