Parrot.Sip.Handler behaviour (Parrot Platform v0.0.1-alpha.3)

Parrot SIP Stack SIP stack handler

Summary

Types

handler()

@type handler() :: %Parrot.Sip.Handler{
  args: term(),
  log_level: atom() | nil,
  module: module(),
  sip_trace: boolean() | nil
}

transp_request_ret()

@type transp_request_ret() :: :noreply | :process_transaction

Callbacks

process_ack(t, any)

@callback process_ack(Parrot.Sip.Message.t(), any()) :: :ok

transaction(t, t, any)

@callback transaction(Parrot.Sip.Transaction.t(), Parrot.Sip.Message.t(), any()) ::
  :process_uas | :ok

transaction_stop(t, any, any)

@callback transaction_stop(Parrot.Sip.Transaction.t(), any(), any()) :: :ok

transp_request(t, any)

@callback transp_request(Parrot.Sip.Message.t(), any()) :: :process_transaction | :noreply

uas_cancel(id, any)

@callback uas_cancel(Parrot.Sip.UAS.id(), any()) :: :ok

uas_request(t, t, any)

@callback uas_request(Parrot.Sip.UAS.t(), Parrot.Sip.Message.t(), any()) :: :ok

Functions

args(handler)

@spec args(handler()) :: any()

new(module, args, opts \\ [])

@spec new(module(), any(), keyword()) :: handler()

process_ack(sip_msg, handler)

@spec process_ack(Parrot.Sip.Message.t(), handler()) :: :ok

transaction(trans, sip_msg, handler)

@spec transaction(Parrot.Sip.Transaction.t(), Parrot.Sip.Message.t(), handler()) ::
  :ok | :process_uas

transaction_stop(trans, trans_result, handler)

@spec transaction_stop(Parrot.Sip.Transaction.t(), term(), handler()) :: :ok

transp_request(msg, handler)

@spec transp_request(Parrot.Sip.Message.t(), handler()) :: transp_request_ret()

uas_cancel(uas_id, handler)

@spec uas_cancel(Parrot.Sip.UAS.id(), handler()) :: :ok

uas_request(uas, req_sip_msg, handler)

@spec uas_request(Parrot.Sip.UAS.t(), Parrot.Sip.Message.t(), handler()) :: :ok