esmpp - Erlang/OTP SMPP Client

Build StatusHex.pm

esmpp connects erlang applications to SMSCs via the SMPP v3.4 protocol.

Supported Commands

Other commands will be supported in the future versions.

OTP Version

Required: OTP 18 and later

Setup

esmpp can be added as a dependency via hex.pm

{deps, [
  {esmpp, "0.0.13"}
]}. 

Then include esmpp in your application’s .app.src file

{applications, [
  kernel,
  stdlib,
  esmpp
]}.

Usage

Simply call esmpp:start_link/1 with the following options as map:

{ok, C} = esmpp:start_link(#{
   mode => transceiver,
   host => "127.0.0.1",
   port => 2775,
   system_id => "smppclient",
   password => "password",
   system_type => "Test",
   callback_dr => {mymodule, myfunction}
}).

Sending SMS

SMS messages are sent by calling esmpp:send_sms/4, esmpp:send_sms/5, or esmpp:send_sms/6. The first four parameters are as follows:

The last parameter in esmpp:send_sms/5 is an optional map with the following possible keys:

The last parameter in esmpp:send_sms/6 is another optional map of the optional parameters to be passed in the last part of the submit_sm packet. Complete information is at the generated documentation inside doc/

Ids = esmpp:send_sms(C, <<"12345">>, <<"639473371390">>, <<"Hello">>).

Return Type

All functions return a list of message id tuples:

[{message_id, MessageId}]

MessageId is a (binary) string that was associated to the submitted message in the SMPP server.

UCS2/UTF-16 Support

Messages that are outside the standard GSM 03.38 character set are automatically detected and encoded with UTF-16. This includes emojis.

Long Messages

Long messages are automatically concatenated when they exceed the standard 140 byte limit.

TODOs