Via header entry. Port of NkSIP's nksip_parse_via.
transport is an atom for known transports or the raw string otherwise.
port is nil when absent. Parameters are {name, value} tuples, with
nil value for flags (like rport).
Summary
Functions
Serializes a Via entry.
Gets a parameter, case-insensitively.
Parses a comma-separated list of Via entries, or a list of such binaries.
Types
@type t() :: %Caracola.Via{ domain: String.t(), params: [Caracola.URI.param()], port: :inet.port_number() | nil, transport: transport() }
A Via header.
@type transport() :: :udp | :tcp | :tls | :sctp | :ws | :wss | String.t()
A transport of a Via header.
Functions
Serializes a Via entry.
Gets a parameter, case-insensitively.
Parses a comma-separated list of Via entries, or a list of such binaries.
iex> {:ok, [via]} = Caracola.Via.parse("SIP/2.0/UDP host:5060;branch=z9hG4bK1;rport")
iex> {via.transport, via.domain, via.port, via.params}
{:udp, "host", 5060, [{"branch", "z9hG4bK1"}, {"rport", nil}]}