   end
 
   @doc """
-  Returns the string representation of the given `URI` struct.
+  Returns the string representation of the given `Sippet.URI` struct.
       iex> Sippet.URI.to_string(Sippet.URI.parse("sip:foo@bar.com"))
       "sip:foo@bar.com"
       iex> Sippet.URI.to_string(%URI{scheme: "foo", host: "bar.baz"})

  """
  @spec decode_headers(binary) :: map
  def decode_headers(headers, map \\ %{}) do
    cond do
      headers == "" -> map
      String.starts_with?(headers, "?") ->
        decode_headers_into_map(
            String.slice(headers, 1, String.length(headers)-1), map)
      :otherwise ->
        raise ArgumentError,
            "decode_headers/1 string has to start with ';', "
            <> "got: #{inspect headers}"
    end
  end

  defp decode_headers_into_map(headers, map) do
    case decode_next_pair(headers, "&") do
      nil -> map
      {{key, value}, rest} ->
        decode_headers_into_map(rest, Map.put(map, key, value))
    end
  end

  @doc """

  @doc """
  Checks if the character is an "param-unreserved" character in a SIP-URI.
  ## Examples
      iex> Sippet.URI.char_param_unreserved?(?~)
      false
  """
  @spec char_param_unreserved?(char) :: boolean
  def char_param_unreserved?(char) when char in 0..0x10FFFF do
