Packages
parrot_platform
0.0.1-alpha.3
Elixir libraries and OTP behaviours for building telecom applications with SIP protocol and media handling
Current section
Files
Jump to
Current section
Files
lib/parrot/sip/dialog/supervisor.ex
defmodule Parrot.Sip.Dialog.Supervisor do
use DynamicSupervisor
def start_link(args) do
DynamicSupervisor.start_link(__MODULE__, args, name: __MODULE__)
end
def start_child(args) do
spec = {Parrot.Sip.DialogStatem, args}
DynamicSupervisor.start_child(__MODULE__, spec)
end
def num_active do
DynamicSupervisor.count_children(__MODULE__)[:active]
end
@impl true
def init([]) do
DynamicSupervisor.init(
strategy: :one_for_one,
max_restarts: 1000,
max_seconds: 1
)
end
end