Module submit_esme

Submit SM example.

Copyright © 2004 Enrique Marcote Peña

Version: 1.1, {09 Feb 2004} 11:26:50.

Behaviour: gen_esme.

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

Description

Submit SM example.

A very simple ESME for submitting short messages.

Function Index

code_change/3 gen_esme - code_change/2 callback implementation.
handle_alert_notification/3gen_esme - handle_alert_notification/3 callback implementation.
handle_call/3gen_esme - handle_call/3 callback implementation.
handle_cast/2 gen_esme - handle_cast/2 callback implementation.
handle_info/2 gen_esme - handle_info/2 callback implementation.
handle_listen_error/1gen_esme - handle_listen_error/1 callback implementation.
handle_operation/3gen_esme - handle_operation/3 callback implementation.
handle_outbind/3gen_esme - handle_outbind/3 callback implementation.
handle_unbind/3gen_esme - handle_unbind/3 callback implementation.
init/1 gen_esme - init/1 callback implementation.
start_link/0Starts the ESME server.
stop/0Stops the ESME server.
submit_sm/2Submits a Short Message with the text UserMessage to MobileNumber.
terminate/2 gen_esme - terminate/2 callback implementation.

Function Details

code_change/3

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

gen_esme - code_change/2 callback implementation.

Convert process state when code is changed.

handle_alert_notification/3

handle_alert_notification(X1::AlertNotification, From, State) -> Result

gen_esme - handle_alert_notification/3 callback implementation.

Handle alert_notification requests from the peer SMSC.

handle_call/3

handle_call(X1::Request, From, S::State) -> Result

gen_esme - handle_call/3 callback implementation.

Handling call messages.

See also: terminate/2.

handle_cast/2

handle_cast(Request, State) -> Result

gen_esme - handle_cast/2 callback implementation.

Handling cast messages.

See also: terminate/2.

handle_info/2

handle_info(Info, State) -> Result

gen_esme - 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_esme - handle_listen_error/1 callback implementation.

Handle listen failures.

handle_operation/3

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

gen_esme - handle_operation/3 callback implementation.

Handle deliver_sm and data_sm operations (from the peer SMSCs) to the callback ESME.

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 ESME in the response PDU, the callback should return the term {error, Error, ParamList}, where Error is the desired command_status error code.

handle_outbind/3

handle_outbind(X1::Outbind, From, State) -> Result

gen_esme - handle_outbind/3 callback implementation.

Handle oubind requests from the peer SMSC.

handle_unbind/3

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

gen_esme - handle_unbind/3 callback implementation.

Handle unbind requests from the peer SMSC.

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_esme - init/1 callback implementation.

Initiates the server.

start_link/0

start_link() -> Result

Starts the ESME server.

See also: gen_esme, start/0.

stop/0

stop() -> ok

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

Stops the ESME server.

See also: handle_call/3.

submit_sm/2

submit_sm(MobileNumber, UserMessage) -> ok

Submits a Short Message with the text UserMessage to MobileNumber.

terminate/2

terminate(Reason, S::State) -> ok

gen_esme - terminate/2 callback implementation.

Shutdown the ESME server.

Return value is ignored by gen_esme.