Sippet v0.6.2 Sippet.Core behaviour View Source

A behaviour module for implementing the Sippet.Core.

The Sippet.Core designates a particular type of SIP entity, i.e., specific to either a stateful or stateless proxy, a user agent or registrar.

Link to this section Summary

Functions

Dispatches the network transport error to the registered Sippet.Core implementation

Dispatches the received request to the registered Sippet.Core implementation

Dispatches the received response to the registered Sippet.Core implementation

Callbacks

Receives an error from the server or client transaction

Receives a new incoming request from a remote host, or ACK

Receives a response for a sent request

Link to this section Functions

Link to this function

receive_error(reason, client_or_server_key) View Source
receive_error(
  reason :: term(),
  Sippet.Transactions.Client.t() | Sippet.Transactions.Server.t()
) :: any()

Dispatches the network transport error to the registered Sippet.Core implementation.

Link to this function

receive_request(incoming_request, server_key) View Source
receive_request(Sippet.Message.request(), Sippet.Transactions.Server.t() | nil) ::
  any()

Dispatches the received request to the registered Sippet.Core implementation.

Link to this function

receive_response(incoming_response, client_key) View Source
receive_response(
  Sippet.Message.response(),
  Sippet.Transactions.Client.t() | nil
) :: any()

Dispatches the received response to the registered Sippet.Core implementation.

Link to this section Callbacks

Link to this callback

receive_error(reason, client_or_server_key) View Source
receive_error(
  reason :: term(),
  client_or_server_key ::
    Sippet.Transactions.Client.t() | Sippet.Transactions.Server.t()
) :: any()

Receives an error from the server or client transaction.

The function receive_error/2 is called from the client or server transaction process created when sending or receiving requests.

Link to this callback

receive_request(incoming_request, server_key) View Source
receive_request(
  incoming_request :: Sippet.Message.request(),
  server_key :: Sippet.Transactions.Server.t() | nil
) :: any()

Receives a new incoming request from a remote host, or ACK.

The server_key indicates the name of the transaction created when the request was received. If it is an ACK, then the server_key is nil.

The function receive_request/2 is called from the server transaction process when the parameter server_key is not nil, and from the transport process (possibly a poolboy worker process), when the server_key is nil.

Link to this callback

receive_response(incoming_response, client_key) View Source
receive_response(
  incoming_response :: Sippet.Message.response(),
  client_key :: Sippet.Transactions.Client.t() | nil
) :: any()

Receives a response for a sent request.

The client_key indicates the name of the transaction created when the request was sent using Sippet.Transactions.send_request/1.

The function receive_response/2 is called from the client transaction process when the parameter client_key is not nil, and from the transport process (possibly a poolboy worker process), when the client_key is nil.