# `ExSDP.Origin`
[🔗](https://github.com/membraneframework/ex_sdp/blob/v1.2.0/lib/ex_sdp/origin.ex#L1)

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](https://tools.ietf.org/html/rfc4566#section-5.2)

# `t`

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

# `bump_version`

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

Increments `session_version` field.

Can be used while sending offer/answer again.

# `new`

```elixir
@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`

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
