ExSDP.Origin (ExSDP v1.1.2)

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

Summary

Functions

Increments session_version field.

Returns new origin struct.

Types

t()

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

Functions

bump_version(origin)

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

Increments session_version field.

Can be used while sending offer/answer again.

new(opts \\ [])

@spec 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}

parse(origin_binary)

@spec parse(binary()) ::
  {:ok, t()}
  | {:error,
     :invalid_addrtype | :invalid_address | :too_few_fields | :too_many_fields}