Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Erlang UCP/EMI gateway
Erlang
branch: master

This branch is 12 commits behind jtendo:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
conf.sample
include
src
Makefile
README.md
rebar.config

README.md

Erlang UCP Gateway

Project status

Actually it's more of a SMSC client than a real gateway at the moment.

Tested with SMSC LogicaCMG's EMI/UCP interface 4.6

If you like this project, you might also be interested in jtendo UCP Simulator

Usage

  1. Install:

    rebar get-deps compile or add a rebar dependency to your application

  2. Edit sample configuration located in conf.sample directory

  3. Move the configuration folder to the right spot:

    $ mv conf.sample conf
    

    or

    $ mv conf.sample yourapp/conf
    
  4. Typical API usage:

    a) Send messages:

    Pid = ucp_conn_pool:get_active_connection(),
    Message = "Hello world", %% binary messages are also supported
    Opts = [
      {split, true},
      {notification_request, true}
    ],
    ucp_conn:send_message(Pid, Msisdn, Message, Opts).
    

    The interface is asynchronous. Currently, messages are send using "one-shot" mode, requiring SMSC to ack. This will be made optional.

    b) Receive messages:

    -module(my_receiver).
    -behaviour(gen_event).
    
    %% (...)
    
    attach() ->
        ucp_event:add_handler(?MODULE).
    
    handle_event({sms, Msg = {Recipient, Sender, Data}}, State) ->
        io:format("Received: ~p~n", [Msg]),
        {ok, State};
    
    %% (...)
    
    
    License
    -------
    BSD License -- http://www.opensource.org/licenses/bsd-license.php
    
    
    TODO
    ----
    
    - Documentation
    - Detailed examples
    - Message routing
    - Allow message buffering in SMSC
    - ...
    
Something went wrong with that request. Please try again.