# `XMediaLib.SDP.Origin`
[🔗](https://github.com/Lazarus404/xmedialib/blob/main/lib/sdp/types.ex#L25)

SDP origin line (`o=`) identifying the session creator and session id.

## What problem this solves

SDP `o=` identifies who created the session and assigns session id/version
numbers used during renegotiation. Parsers promote this line into a struct so
gateways can compare or rewrite origin fields when generating answers.

The origin line ties together username, session id/version (for renegotiation),
and the creator's network address. WebRTC stacks often use `-` as the username
and random session ids.

Wire form: `o=<username> <sess-id> <sess-version> <nettype> <addrtype> <unicast-address>`

## RFCs

* [RFC 8866](https://www.rfc-editor.org/rfc/rfc8866) pt.5.2

# `t`

```elixir
@type t() :: %XMediaLib.SDP.Origin{
  addr_type: String.t(),
  net_type: String.t(),
  session_id: String.t(),
  session_version: String.t(),
  unicast_address: String.t(),
  username: String.t()
}
```

Origin fields from `o=<username> <sess-id> <sess-version> <nettype> <addrtype> <unicast-address>`.

## Fields

* `:username` - creator login or `-` when unknown
* `:session_id` - numeric session identifier (string on the wire)
* `:session_version` - incremented when the session description changes
* `:net_type` - network type, usually `IN` (Internet)
* `:addr_type` - address family, e.g. `IP4` or `IP6`
* `:unicast_address` - address of the session originator

---

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