View Source Membrane.RTC.Engine.Endpoint.SIP (Membrane RTC Engine SIP Endpoint v0.4.0)

An Endpoint responsible for:

  • registering at a SIP provider,
  • dialing a phone number,
  • receiving audio from the callee and forwarding it to other Endpoints,
  • mixing audio tracks from other Endpoints and sending them to the callee.

Limitations

  • Incoming calls are unsupported,
  • only the G.711 A-law audio codec is supported (SDP negotiation will fail if the SIP provider doesn't support it).

Setup

All SIP Endpoints share a single UDP socket for SIP signaling messages. By default, it is opened on 0.0.0.0:5060; this can be changed by adding the following line to your config.exs:

config :membrane_rtc_engine_sip, sip_address: "1.2.3.4", sip_port: 5061

The range of UDP ports (available to all SIP Endpoints) used for RTP media stream exchange can be modified by adding the following line to your config.exs:

config :membrane_rtc_engine_sip, port_range: {from, to}     # (both ends inclusive)

Bin options

Passed via struct Membrane.RTC.Engine.Endpoint.SIP.t/0

  • rtc_engine

    pid()

    Required
    PID of parent Engine

  • registrar_credentials

    RegistrarCredentials.t()

    Required
    Credentials needed to connect with the SIP registrar server

  • external_ip

    String.t()

    Required
    External IPv4 address of the machine running the Endpoint, required for SDP negotiation

  • register_interval_ms

    non_neg_integer()

    Default value: 45000
    Interval (in ms) in which keep-alive (keep-registered) REGISTER messages will be sent to the SIP registrar server

  • disconnect_if_alone

    boolean()

    Default value: true
    Whether the Endpoint should disconnect from the call when all incoming tracks are removed, i.e. when all other Endpoints publishing audio are removed from the Engine

Pads

:input

Accepted formats:

Membrane.RTP
Direction::input
Availability::on_request

:output

Accepted formats:

Membrane.RTP
Direction::output
Availability::on_request

Summary

Types

t()

Struct containing options for Membrane.RTC.Engine.Endpoint.SIP

Functions

Starts calling a specified number

Ends ongoing call or cancels call attempt

Returns description of options available for this module

Types

@type t() :: %Membrane.RTC.Engine.Endpoint.SIP{
  disconnect_if_alone: boolean(),
  external_ip: String.t(),
  register_interval_ms: non_neg_integer(),
  registrar_credentials:
    Membrane.RTC.Engine.Endpoint.SIP.RegistrarCredentials.t(),
  rtc_engine: pid()
}

Struct containing options for Membrane.RTC.Engine.Endpoint.SIP

Functions

Link to this function

dial(rtc_engine, endpoint_id, phone_number)

View Source
@spec dial(rtc_engine :: pid(), endpoint_id :: String.t(), phone_number :: String.t()) ::
  :ok

Starts calling a specified number

Link to this function

end_call(rtc_engine, endpoint_id)

View Source
@spec end_call(rtc_engine :: pid(), endpoint_id :: String.t()) :: :ok

Ends ongoing call or cancels call attempt

@spec options() :: keyword()

Returns description of options available for this module