View Source SMPPEX.ESME (smppex v3.2.4)
This is a module for launching an SMPPEX.Session implementation as an ESME.
To start an ESME one generally should do the following.
- Implement an
SMPPEX.Sessionbehaviour.
defmodule MyESMESession do
use SMPPEX.Session
# ...Callback implementation
end
- Launch it.
{:ok, esme_session} = SMPPEX.ESME.start_link("127.0.0.1",
2775,
{MyESMESession, some_args})
Summary
Functions
Starts an SMPPEX.Session implementation as an ESME entitiy,
i.e. makes a transport connection to host:port and starts an SMPPEX.Session
to handle the connection with the passed module.
Functions
@spec start_link( host :: term(), port :: non_neg_integer(), {module(), args :: term()}, opts :: Keyword.t() ) :: GenServer.on_start()
Starts an SMPPEX.Session implementation as an ESME entitiy,
i.e. makes a transport connection to host:port and starts an SMPPEX.Session
to handle the connection with the passed module.
The function does not return until ESME successfully connects to the specified
host and port and initializes or fails.
module is the callback module which should implement SMPPEX.ESME behaviour.
args is the argument passed to the init callback.
opts is a keyword list of different options:
:transportis Ranch transport used for TCP connection: either:ranch_tcp(the default) or:ranch_ssl;:session_moduleis a module to use as an alternative toSMPPEX.Sessionfor handling sessions (if needed). For example,SMPPEX.TelemetrySession.:timeoutis timeout for transport connect. The default is 5000 ms;:esme_optsis a keyword list of ESME options::enquire_link_limitis value for enquire_link SMPP timer, i.e. the interval of SMPP session inactivity after which enquire_link PDU is send to "ping" the connetion. The default value is 30000 ms;:enquire_link_resp_limitis the maximum time for which ESME waits for enquire_link PDU response. If the response is not received within this interval of time and no activity from the peer occurs, the session is then considered dead and the ESME stops. The default value is 30000 ms;:inactivity_limitis the maximum time for which the peer is allowed not to send PDUs (which are not response PDUs). If no such PDUs are received within this interval of time, ESME stops. The default is :infinity ms;:response_limitis the maximum time to wait for a response for a previously sent PDU. If the response is not received within this interval,handle_resp_timeoutcallback is triggered for the original pdu. If the response is received later, it is discarded. The default value is 60000 ms.:response_limit_resolutionis the maximum time after reachingresponse_limitfor which a PDU without a response is not collected. Setting to0will make PDUs without responses to be collected immediately afterresponse_limitms. Setting to greater values improve performance since such PDUs are collected in batches. The default value is 100 ms.:session_init_limitis the maximum time for the session to be unbound. If no bind request succeed within this interval of time, the session stops. The default value is 10000 ms;
:socket_optsis a keyword list of ranch socket options, see ranch's options for more information If:esme_optslist of options is ommited, all options take their default values. The wholeoptsargument may also be ommited in order to start ESME with the defaults. The returned value is either{:ok, pid}or{:error, reason}.