# `Sippy.Config`
[🔗](https://pushin.eu/hermanverschooten/sippy/blob/v0.1.0/lib/sippy/config.ex#L1)

Settings for talking to the PBX, built with `Sippy.config/1`.

Options:

  * `:pbx_host` - PBX hostname or IP address (required)
  * `:pbx_port` - PBX SIP port (default: `5060`)
  * `:username` - SIP username (required)
  * `:password` - SIP password (required)
  * `:auth_id` - SIP authentication ID, when it differs from the username
    (default: `:username`)
  * `:extension` - extension number (default: `:username`)
  * `:display_name` - display name in the From header (default: `"Sippy"`)
  * `:local_port` - local UDP port for SIP, `0` picks a free one
    (default: `5061`)
  * `:register_expires` - requested registration lifetime in seconds
    (default: `300`)
  * `:register_retry_interval` - milliseconds before the first retry after
    a failed registration; doubles on every further failure up to 10
    minutes (default: `30_000`)
  * `:max_pending_calls` - incoming calls kept ringing at once; further
    INVITEs get `486 Busy Here` (default: `16`)
  * `:pending_call_timeout` - milliseconds an incoming call may ring
    unanswered before it is ended with `480 Temporarily Unavailable`
    (default: `180_000`)
  * `:trusted_sources` - IP addresses or hostnames Sippy accepts SIP
    from; everything else is dropped (default: the addresses of
    `:pbx_host`). List the PBX too when setting it.

Unknown options raise an `ArgumentError`.

# `t`

```elixir
@type t() :: %Sippy.Config{
  auth_id: String.t(),
  display_name: String.t(),
  extension: String.t(),
  local_port: :inet.port_number(),
  max_pending_calls: non_neg_integer(),
  password: String.t(),
  pbx_host: String.t(),
  pbx_port: :inet.port_number(),
  pending_call_timeout: pos_integer(),
  register_expires: pos_integer(),
  register_retry_interval: pos_integer(),
  trusted_sources: [String.t() | :inet.ip4_address()] | nil,
  username: String.t()
}
```

# `new`

```elixir
@spec new(keyword()) :: t()
```

Builds a configuration from options, see the module documentation.

---

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