ExSDP.Origin (ExSDP v0.7.0) View Source

This module represents the Origin field of SDP that represents the originator of the session.

If the username is set to - the originating host does not support the concept of user IDs.

The username MUST NOT contain spaces.

For more details please see RFC4566 Section 5.2

Link to this section Summary

Functions

Increments session_version field.

Returns new origin struct.

Link to this section Types

Specs

t() :: %ExSDP.Origin{
  address: ExSDP.Address.t(),
  network_type: binary(),
  session_id: integer(),
  session_version: integer(),
  username: binary()
}

Link to this section Functions

Specs

bump_version(t()) :: {:ok, t()}

Increments session_version field.

Can be used while sending offer/answer again.

Specs

new(
  username: binary(),
  session_id: integer(),
  session_version: integer(),
  address: ExSDP.Address.t()
) :: t()

Returns new origin struct.

By default:

  • username is -
  • session_id is random 64 bit number
  • session_version is 0
  • address is {127, 0, 0, 1}

Specs

parse(binary()) :: {:ok, t()} | {:error, :invalid_addrtype | :invalid_address}