Atlas Knowledge Base
Dashboard
SIP Media

SIP Media

The SIP Media service - carries the audio (RTP media) of SIP calls.

configuration
media
rtp
sbn-media
sip-media
sipmedia
telephony

SIP Media

The SIP Media service carries the audio of SIP calls. While the SIP Server sets up and signals a call, SIP Media handles the live voice - the media - between the caller and SBN Media.

Overview

A SIP call has two parts: the signaling (handled by the SIP Server) and the media, which is the live audio stream. SIP Media handles the media. It carries the audio used for two-way voice, for playing prompts, and for the alarm tones that the Alarm Receiver decodes.

For each call it works out the network path for the audio (the same way video does, using STUN and TURN), allocates the media ports, and can apply a jitter buffer and call limits. Many of its settings can be overridden for an individual line in the line configuration.

When a call has several related media streams - for example its two-way voice and a mixed audio stream - SBN Media generally keeps them on the same server. This keeps the audio local and reduces delay. It is a preference rather than a guarantee: if that server is unavailable when a related stream is needed, the stream may be created on another server instead.

When the audio is already in the format the other side needs, it is passed straight through without conversion, which uses very little processing. Only audio that has to be changed from one format to another - for example between a phone's format and the browser's - is transcoded, which uses more. This is why a server can carry many more calls that need no conversion than calls that do.

  1. Runs: When configured. A deployment can run more than one to carry more concurrent call audio.
  2. Required: Required for SIP call audio - telephony, two-way voice, and decoding alarm tones over the phone.
  3. Depends on: NATS, the SIP Server (which sets up the calls), and the TURN server (or an external TURN) for audio across firewalls.

Configuration

SIP Media is configured under the sipmedia namespace. View the defaults with ./sbn-media config eject and set host-specific overrides in sbn-media.local.yaml.

Media ports and addressing


Setting

Default

Description

sipmedia.minPort

10000

The lowest port used for call audio (RTP).

sipmedia.maxPort

65000

The highest port used for call audio (RTP).

sipmedia.address

empty

The address to bind to.

sipmedia.publicIP

empty

The public address to advertise to the far end. Looked up automatically when empty.

Call handling


Setting

Default

Description

sipmedia.mediaTimeout

60000

Disconnect a call after this many milliseconds with no audio.

sipmedia.maxCallDuration

1800000

The longest a call may last, in milliseconds (30 minutes). 0 means no limit.

sipmedia.symmetricRtp

disabled

How media ports are matched: disabled, enabled, or preemptive. Helps when the far end sends audio from a different port than it signalled.

sipmedia.jitterBufferPackets

0

Jitter buffer size, in packets. 0 turns it off.

Network path (STUN and TURN)


Setting

Default

Description

sipmedia.disableICE

false

Turn off the network-path negotiation.

sipmedia.stunServerURL

empty

An external STUN server to use.

sipmedia.turnServerURL / turnServerUsername / turnServerPassword

empty

An external TURN server. If not set, SBN Media's built-in TURN server is used.

Several of these can be set per line in the line configuration - the media timeout, the maximum call duration, and symmetricRtp - so a line can differ from the host defaults.

The media pipelines (sipmedia.sendPipeline / receivePipeline) are Innovative-managed and should not be changed. sipmedia.traceRTP logs the media packets for debugging and is expensive, so leave it off in normal operation.

Example:

sipmedia:
# The public address to advertise, if it is not detected correctly.
publicIP: "203.0.113.10"

# Disconnect after 60 seconds of silence; cap calls at 30 minutes.
mediaTimeout: 60000
maxCallDuration: 1800000

After changing these settings in sbn-media.local.yaml, apply them with ./sbn-media config reload. Changing the media port range requires restarting the service.

Capacity and stream limits

SIP Media is one of SBN Media's device-stream services, so its per-instance stream limit and scaling work the same as the others - see Device Streams (SBN-Media/Devices/device-streams). An instance carries media streams up to devicestream.maxStreams.sipmedia, or devicestream.defaultMaxStreams (1000) if that is not set, and new calls are routed to another instance once it is full. For SIP Media the practical ceiling is usually lower, bound by CPU, the media port range (sipmedia.minPort-maxPort), and the per-line call limits - and calls that pass through without transcoding use far less CPU than those that are transcoded.

FAQ

A call connects but there is no audio. What should I check?

This is almost always the media path. Confirm the media port range (10000-65000 by default) is open, and that sipmedia.publicIP advertises an address the far end can reach. On restrictive networks the TURN server must be reachable (see the TURN Server page). If the far end sends its audio from a different port than it signalled, set sipmedia.symmetricRtp to enabled or preemptive.

Calls are being cut off. Why?

Two limits can end a call: sipmedia.mediaTimeout drops a call after that many milliseconds with no audio (60 seconds by default), and sipmedia.maxCallDuration caps the total length (30 minutes by default; 0 removes the cap). Adjust them, or override them on the specific line.

Can I set these per line?

Yes. The media timeout, the maximum call duration, and symmetricRtp can be set per line in the line configuration, so one line can differ from the host defaults.

How many SIP Media services do I need?

One is enough to start. Each instance carries media streams up to devicestream.maxStreams.sipmedia (or devicestream.defaultMaxStreams, 1000, if that is not set), but the practical number is lower and bound by CPU, the media port range, and the per-line call limits. Run more instances to carry more concurrent call audio; the load is shared across them.

Related pages

  1. SBN Media Overview (SBN-Media/overview)
  2. Device Streams (SBN-Media/Devices/device-streams)
  3. Installing and Configuring SBN Media (SBN-Media/installation)
  4. SIP Server (SBN-Media/Telephony/sip-server)
  5. Line Configuration (SBN-Media/Configuration/line-configuration)
  6. TURN Server (SBN-Media/Telephony/turn-server)




Was this helpful?