9. Examples included in library release.

9.1. PDU samples.

The library has an example for each PDU on SMPP-3.4 protocol. The applications are executed without parameters and the idea is to test the API functions through a serie of steps.

  1. To declare two variables of the same type and to assign values to one of them.

  2. Apply a PDU dump to the first data structure. It will show all data components of de object data.

  3. Pack the structure into a buffer and dump it.

  4. Unpack this buffer over the second variable defined in the first point.

  5. Do a dump of the second structure.

9.2. An ESME basic.

We have added a little ESME that submits a message. The sintax to run the ESME is.

[rtremsal@localhost bin]$ ./esme 
Error in parameters
usage: ./esme  -c file.xml [-h]
    -c /path/to/file.xml: config file path.
    -h : Help, show this message.

[rtremsal@localhost bin]$ more esme.xml 
<?xml version="1.0"?>
<config>
    <conn_tcp host="127.0.0.1" port="9090"/>
    <conn_smpp system_id="sytem" password="asdfg34" system_type="type01"/>
    <smpp_msg src="5565" dst="0911110000" msg="Este es un ejemplo 01"/>
</config>
    

The config file has parameters to made the connection tcp, the connection smpp and the parameters to send a message. This application is ejecuted by:

[rtremsal@localhost bin]$ ./esme -c esme.xml 
Error in connect(127.0.0.1:9090)
Error in tcp connect.
    
[rtremsal@localhost bin]$ ./esme -c esme.xml 
-----------------------------------------------------------
SENDING PDU 
command_length                [00000029] - [41]
command_id                    [00000002] - [BIND_TRANSMITTER]
command_status                [00000000] - [ESME_ROK]
:
:
:
-----------------------------------------------------------
RECEIVE BUFFER 
   00 00 00 10 80 00 00 06   00 00 00 00 00 00 00 03   ........ ........

RECEIVE PDU 
command_length                [00000010] - [16]
command_id                    [80000006] - [UNBIND_RESP]
command_status                [00000000] - [ESME_ROK]
sequence_number               [00000003] - [3]
    

In the first case, a smpp server is not present, then there was an error in the tcp level. In the second case, helped by a test smpp client program sctt - (SMPP Client Test Tool). available in SMS Forum (http://www.smsforum.com).

In the second case, the internal operations that allow sending a message are:

Although this example is very basic it allow us to see in detail the function of the library inside an ESME.