SMPPEX.Session.terminate

You're seeing just the callback terminate, go back to SMPPEX.Session module for more information.
Link to this callback

terminate(reason, lost_pdus, state)

View Source

Specs

terminate(reason(), lost_pdus :: [SMPPEX.Pdu.t()], state()) ::
  :stop | {:stop, [SMPPEX.Pdu.t()], state()}

Invoked when the session process is about to exit.

lost_pdus contain a list of nonresp pdus sent by the session to the peer and which have not yet received a response.

The returned value is either :stop or {:stop, last_pdus, state}, where last_pdus is a list of PDUs which will be sent to the peer before socket close, and state is the new state. For example, an ESME can send an unbind PDU or an MC can send negative resps for pending submit_sms if needed.

This callback is called from the underlying GenServer terminate callbacks, so it has all the corresponding caveats, for example, sometimes it may not be called, see GenServer.terminate/2 docs.