View Source ExSDP.Origin (ExSDP v0.11.0)

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

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

Link to this section Functions

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

Increments session_version field.

Can be used while sending offer/answer again.

@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}
@spec parse(binary()) :: {:ok, t()} | {:error, :invalid_addrtype | :invalid_address}