Module operation

SMPP Operation library.

Copyright © 2003 - 2004 Enrique Marcote Peña

Version: 1.0, {24 May 2003} 11:56:47.

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

Description

SMPP Operation library.

SMPP Operation PDU definitions.

Changes 0.1 -> 0.2

[10 Feb 2004] [17 Feb 2004] [01 Mar 2004]

Changes 0.2 -> 1.0

[10 Jun 2004] [16 Jun 2004]

Function Index

esme_pack/1Packs an SMPP PDU dictionary into the corresponding byte stream.
esme_unpack/1Unpacks a binary SMPP PDU into the corresponding PDU dictionary.
from_list/1Converts the Pdu to a list representation.
get_param/2Gets the value of a parameter from a PDU dictionary given the parameter name.
merge_params/2Merge two parameter lists.
new/3Creates a new PDU dictionary of type PdyType with the given InitParams and the default values defined for this PDU.
new/4Creates a new PDU dictionary of type PdyType with the given InitParams and the default values defined for this PDU.
pack/1Packs any SMPP PDU dictionary into the corresponding byte stream.
request_failure_code/1Returns the error status code associated to a request failure (Most of the requests have a generic failure code, otherwise ?ESME_RUNKNOWNERR is returned).
set_param/3Sets the value of a parameter on a PDU dictionary given the parameter name, the new PDU dictionary is returned.
smsc_pack/1Packs an SMPP PDU dictionary into the corresponding byte stream.
smsc_unpack/1Unpacks a binary SMPP PDU into the corresponding PDU dictionary.
to_list/1Converts the Pdu to a list representation.
unpack/1Unpacks a binary SMPP PDU into the corresponding PDU dictionary.

Function Details

esme_pack/1

esme_pack(Pdu) -> Result

Packs an SMPP PDU dictionary into the corresponding byte stream.

This function is optimized for ESME implementations, thus only handles operations issued by an ESME, any other PDU generates an ?ESME_RINVCMDID error code.

See also: pdu_syntax:pack/2.

esme_unpack/1

esme_unpack(BinaryPdu) -> Result

Unpacks a binary SMPP PDU into the corresponding PDU dictionary.

This function is optimized for ESME implementation, thus only capable of unpacking PDUs issued by a SMSC, any other PDU produces an ?ESME_RINVCMDID error code.

See also: pdu_syntax:unpack/2.

from_list/1

from_list(List) -> Pdu

Converts the Pdu to a list representation.

Notice that command_length is automatically added by packing functions, thus should not be included on the List.

% @see dict:from_list/1

get_param/2

get_param(ParamName, Pdu) -> ParamValue

Gets the value of a parameter from a PDU dictionary given the parameter name. If the parameter is not defined on the PDU the atom undefined is returned.

merge_params/2

merge_params(ParamList1, ParamList2) -> NewParamList

Merge two parameter lists. If an parameter appears on both lists, the value from the first list will be taken.

new/3

new(CommandId, SequenceNumber, InitParams) -> Pdu

Creates a new PDU dictionary of type PdyType with the given InitParams and the default values defined for this PDU.

The command_status is set to ESME_ROK.

See also: new/4.

new/4

new(CommandId, CommandStatus, SequenceNumber, InitParams) -> Pdu

Creates a new PDU dictionary of type PdyType with the given InitParams and the default values defined for this PDU.

The command_status is set to CommandStatus.

See also: new/3.

pack/1

pack(Pdu) -> Result

Packs any SMPP PDU dictionary into the corresponding byte stream. This function handles any operation.

Before using this function consider esme_pack/1 or smsc_pack/1. This generic packing function should only be used on special occasions (implementing a Routing Entity).

See also: esme_pack/1, smsc_pack/1, pdu_syntax:pack/2.

request_failure_code/1

request_failure_code(CommandId) -> CommandStatus

Returns the error status code associated to a request failure (Most of the requests have a generic failure code, otherwise ?ESME_RUNKNOWNERR is returned).

set_param/3

set_param(ParamName, ParamValue, Pdu) -> NewPdu

Sets the value of a parameter on a PDU dictionary given the parameter name, the new PDU dictionary is returned.

smsc_pack/1

smsc_pack(Pdu) -> Result

Packs an SMPP PDU dictionary into the corresponding byte stream.

This function is optimized for SMSC implementations, thus only handles operations issued by an SMSC, any other PDU generates an ?ESME_RINVCMDID error code.

See also: pdu_syntax:pack/2.

smsc_unpack/1

smsc_unpack(BinaryPdu) -> Result

Equivalent to unpack(BinaryPdu, ESME_ISSUED_OPERATIONS).

Unpacks a binary SMPP PDU into the corresponding PDU dictionary.

This function is optimized for SMSC implementation, thus only capable of unpacking PDUs issued by an ESME, any other PDU produces an ?ESME_RINVCMDID error code.

See also: unpack/2.

to_list/1

to_list(Pdu) -> List

Converts the Pdu to a list representation.

Notice that command_length won't be included on the resulting List.

% @see dict:to_list/1

unpack/1

unpack(BinaryPdu) -> Result

Unpacks a binary SMPP PDU into the corresponding PDU dictionary. This function handles any operation.

Before using this function consider esme_unpack/1 or smsc_unpack/1. This generic unpacking function should only be used on very special occasions (such us implementing a Routing Entity).

See also: esme_unpack/1, smsc_unpack/1, pdu_syntax:unpack/2.