Module smsc_skel

SMSC Skeleton.

Copyright © 2004 Enrique Marcote Peña

Version: 1.1, { 6 Jul 2004} 11:26:49.

Behaviour: gen_smsc.

Authors: Enrique Marcote Peña (mpquique_at_users.sourceforge.net) [web site: http://oserl.sourceforge.net/].

Description

SMSC Skeleton.

You may use this skeleton as the starting point to implement your own SMSCs.

Function Index

code_change/3 gen_smsc - code_change/2 callback implementation.
handle_bind/3gen_smsc - handle_bind/3 callback implementation.
handle_call/3gen_smsc - handle_call/3 callback implementation.
handle_cast/2 gen_smsc - handle_cast/2 callback implementation.
handle_info/2 gen_smsc - handle_info/2 callback implementation.
handle_listen_error/1gen_smsc - handle_listen_error/1 callback implementation.
handle_operation/3gen_smsc - handle_operation/3 callback implementation.
handle_unbind/3gen_smsc - handle_unbind/3 callback implementation.
init/1 gen_smsc - init/1 callback implementation.
start_link/0Starts the SMSC server.
stop/0Stops the SMSC server.
terminate/2 gen_smsc - terminate/2 callback implementation.

Function Details

code_change/3

code_change(OldVsn, State, Extra) -> {ok, NewState}

gen_smsc - code_change/2 callback implementation.

Convert process state when code is changed.

handle_bind/3

handle_bind(X1::Bind, From, State) -> Result

gen_smsc - handle_bind/3 callback implementation.

Handle bind requests from the peer ESME.

The ParamList included in the response is used to construct the bind response PDU. If a command_status other than ESME_ROK is to be returned by the SMSC in the response PDU, the callback should return the term {error, Error, ParamList}, where Error is the desired command_status error code.

handle_call/3

handle_call(Request, From, State) -> Result

gen_smsc - handle_call/3 callback implementation.

Handling call messages.

See also: terminate/2.

handle_cast/2

handle_cast(Request, State) -> Result

gen_smsc - handle_cast/2 callback implementation.

Handling cast messages.

See also: terminate/2.

handle_info/2

handle_info(Info, State) -> Result

gen_smsc - handle_info/2 callback implementation.

Handling all non call/cast messages.

See also: terminate/2.

handle_listen_error/1

handle_listen_error(State) -> Result

gen_smsc - handle_listen_error/1 callback implementation.

Handle listen failures.

handle_operation/3

handle_operation(X1::Operation, From, S::State) -> Result

gen_smsc - handle_operation/3 callback implementation.

Handle broadcast_sm, cancel_broadcast_sm, cancel_sm, query_broadcast_sm, query_sm, replace_sm, submit_multi, submit_sm and data_sm operations from peer ESMEs.

The ParamList included in the response is used to construct the response PDU. If a command_status other than ESME_ROK is to be returned by the SMSC in the response PDU, the callback should return the term {error, Error, ParamList}, where Error is the desired command_status error code.

handle_unbind/3

handle_unbind(X1::Unbind, From, State) -> Result

gen_smsc - handle_unbind/3 callback implementation.

Handle unbind requests from the peer ESMEs.

If ok returned an unbind_resp with a ESME_ROK command_status is sent to the MC and the session moves into the unbound state. When {error, Error} is returned by the ESME, the response PDU sent by the session to the MC will have an Error command_status and the session will remain on it's current bound state (bound_rx, bound_tx or bound_trx).

init/1

init(X1::Args) -> Result

gen_smsc - init/1 callback implementation.

Initiates the server.

start_link/0

start_link() -> Result

Starts the SMSC server.

See also: gen_smsc, start/0.

stop/0

stop() -> ok

Equivalent to gen_smsc:call(SERVER, die, 10000).

Stops the SMSC server.

See also: handle_call/3.

terminate/2

terminate(Reason, State) -> ok

gen_smsc - terminate/2 callback implementation.

Shutdown the SMSC server.

Return value is ignored by gen_smsc.