Running Mbuni as a MMSC

Mbuni is an open source mms gateway.You can download Mbuni source code from Mbuni site.
Try to compile source and install.Go through mbuni documentation for installation instructions.
It is a must to install all the dependencies stated in documentation page.

mbuni installation will install several components.






we can run Mbuni as MMSC or as VAS gateway.

Lets see how
mbuni configured as a MMSC.

First we need to meet these requirements

Mbuni installation machine
1)should be globally accessible.So we need to assign a global ip and open a port.

2)It should be able to access internet

3)Running web server (optional)

4)SMPP connection or a GSM modem with SIM.

Mbuni source comes with .conf have to manually configure them.
Copy .conf files (you might find them in mbuni-1.4.0\mbuni-1.4.0\doc\examples) in to folder.

Ex /etc/mmsc.conf,/etc/mmsbox.conf

Lets take a look few important configuration parameters.
refer  mmsc .conf file using vi editor

vi /etc/mmsc.conf ip or hostname configured in hosts file
host-alias = This is used to shorten the message retrieval url
lets put some thing like
This should be configured in hosts file.located at /etc/hosts
In /etc/hosts configuration there should be a configuration like
x.x.x.x mmsc

x.x.x.x is (global) ip of your machine
when mbuni send out notification, in mbuni logs we can see that it is sending this url
LOG :::Preparing to notify client to fetch message at URL: http://mmsc/4-qf3440.1.x96.38@2/wx63
local-prefixes =according to mbuni documentation ,number prefixes that should be considered local.

Normally mobile number consists of  country code ,operator code ,followed by identification number.

Ex : +94 77 XXXXXXX

+94 = country code

77 = operator code

Send a mms to this number you need to put +9477 as local prefix.

storage-directory =This is where mbuni creates message queue.

since retrieval url is something like http://x.x.x.x/mms/mm1.we need to create a directory called ‘mms’inside a web server root directory
Ex :/usr/local/apache/htdocs/mms

sendsms-url = According to documentation
URL of the service through which SMS can be sent to a mobile subscriber .
This is some what similar to Kannel send-sms-url

Ex 1)http://x.x.x.x:port/cgi-bin/sendsms

x.x.x.x = Ip of kannel installed machine
port= sendsms-port in Kannel configuration
/cgi-bin/sendsms = sendsms-url in Kannel configuration

If using GSM modem with SIM,it should be configured in kannel configuration file under group smsc

group =smsc
smsc = TEST
modemtype =
device = /dev/ttyS0
speed = 9600


group = smsbox
bearerbox-host = localhost
sendsms-port = 12345
sendsms-url = /cgi-bin/sendsms
global-sender = 900


group = sendsms-user
username = foor
password = bar

Then mbuni sendsms-url must be like in example 2.Where we have to provide extra parameter smsc=TEST
TEST is the allowed-smsc-id .
If Kannel binds to an smpp account then the sendsms-url must be like in example 1.
sendsms-username ,sendsms-password
This is for authentication of sendsms url.
Insert same username ,pasword pair in Kannel ,”smskannel.conf “group = sendsms-user
sendsms-global-sender This maps with the kannel global-sender
Mms port
mms-port = 1981
This is the port mbuni listens for sending/receiving mms

List of IP addresses of hosts allowed to use/access the MM1Port

optimize-notification-size set true

go to mms/ folder. set read write file permission
chmod – R 777 mm1
Set read wite file permission of mms/mm1 directory,sub directories owns to daemon

Once set these parameters.Save the. conf file and exit from vi editor (press <Esc>:wq).

Now we have to start mmsproxy and mmsrelay components.

Try these commands

mmsproxy /etc/mmsc.conf  &

mmsrelay /etc/mmsc.conf  &

See logs and check for errors.

We can use sendmms component to test whether mms is delivered to mobile
Try this command

mmssend -f XXXX -t YYYY -m sample.mms -b /etc/mmsc.conf

-f = From number
-t = To number
-m = give binary mms file name with path
-b = configuration file name
After executing the command check mbuni logs.
make sure your SIM is activated for sending and receiving MMS.
You should get a notification mms. If you have correctly configured mbuni with Kannel & GSM Modem
When you received the notification sms try to download the MMS .For this we should connect to Mbuni installation machine via GPRS .If you are unable to download the message this is because mobile doesn’t know how to grab the message from
mbuni.So we need to modify MMS settings in our mobile

Here is sample MMS profile configuration for Samsung SGH-J200 model
Go to
Messages ->Message Settings->Multimedia Message->Multimedia Message Profile
Option ->new
Change these parameters
Set Name = mbuni (as you wish )
Access name = put your operator APN name here
Home url =http://x.x.x.x:mms_port/mms
According to above configurations x.x.x.x is the global ip of mbuni installed machine,
“mms_port” is mms port we configured in mmsc.conf
“mms” is the storage directory inside web server root directory

proxy address =If you connect to mbuni machine via proxy put that ip here.Otherwise mbuni machine ip
Port = proxy port if any otherwise mms_port

Try to download the mms now.This should download the mms into your mobile.
Check for mbuni logs.It will show any attempt that is made by the phone to fetch the message.

2009-07-17 08:30:32 [23422] [2] DEBUG: HTTP: Creating HTTPClient for `'.
2009-07-17 08:30:32 [23422] [2] DEBUG: HTTP: Created HTTPClient area 0xa00e328.
2009-07-17 08:30:33 [23422] [0] DEBUG: Request, ip=, base_client_addr=2001514, client_addr=2001514/TYPE=PLMN, url=http://mmsc/4-qf3440.1.x96.38@2/wx63
2009-07-17 08:30:33 [23422] [0] DEBUG: Started thread 5 (mmsproxy.c:(gwthread_func_t *)fetchmms_proxy)
2009-07-17 08:30:33 [23422] [5] DEBUG: Thread 5 (mmsproxy.c:(gwthread_func_t *)fetchmms_proxy) maps to pid 23422.
2009-07-17 08:30:33 [23422] [5] DEBUG: ---> Entered fetch interface: url=http://mmsc/4-qf3440.1.x96.38@2/wx63<---

In logs if you can’t see any attempt made by phone to download the message,Check for these
1:Make sure machine has a global ip and the mms port is not blocked.
2: Make sure the GPRS APN configured in your mms profile permits HTTP requests to other addresses
These are few reasons that I have come across where above configuration is not working .If still its not working update me:).


Posted by on July 15, 2009 in mmsc


Tags: , , , , , ,

Workers and supervisors

Herd of workers and supervisors :).In real world workers are doing the actual work and supervisors are monitoring the behaviour of workers

Well ,here it is about Erlang supervisors.In Erlang Workers are processes which perform the actual work whereas supervisors are processes which monitor the behaviour of workers.At the same time supervisor can restart the worker if something goes wrong.

Graphical representation of supervisor and worker.

Rectangular shape -supervisor
eclipse /circular shape -worker.
This is called supervision tree.
According to this supervision tree, there is one supervisor and under that supervisor there is one worker.
In Erlang there are different types of supervisors are defined according to their behavior.

They are




Leave a comment

Posted by on May 9, 2009 in technology


Tags: , , ,

Red & Green

I just look around.I found some interesting subjects around our home garden.
So here they come..

First it comes a rose. This is an early stage of the rose.So it has a color near to pink.

Few days later it ll look like this.

This is an Anthurium bud.This will take two or more days to come out .
This is a grown Anthurium … long lasting flower.Another colorful flower..We called it කුඩලු.(kudalu).

Don’t know the proper name of this flower.Ixora
Peppers ..

Aloe vera & ගොටුකොල.


Posted by on May 8, 2009 in Uncategorized


Tags: , , , , ,


Bulk loading data into Mnesia

Mnesia is a DBMS which comes with the erlang distribution.Which is appropriate for
telecommunication applications which are realtime and continues
Mnesia provides read,write operations which can be used to load and search data.

Here the problem is bulk loading of data into mnesia table
say 1 million records.[records which has about 12 attributes]
tables which are disc_copies and disc_only_copies

create tables,both disc_copies and disc_only_copies
In disc_copies table kept in RAM as well as on disc.Where as in disc_only_copies table kept on disc_only

mnesia_create_tables(NodeList) ->
case mnesia:start() of
ok ->
error_logger:error_report([“Mnesia start ok”]),

[{disc_only_copies, NodeList},{type, set},
{attributes, record_info(fields, person)}]),

[{disc_copies, NodeList},{type, set},
{attributes, record_info(fields, subscriber)}]);

{error, Reason} ->
error_logger:error_report([“Mnesia start error: “, Reason]),
{error, Reason}

For bulk writing we can use two functions. one is mnesia:dirty_write and other one is
mnesia transaction mechanism.
Dirty operations are performance wise better than transaction mechanism.Its because dirty operations are bypassing much of processing
In transaction mechanism action is either performed or aborted.

Use dirty method for loading data.

dirty_populate_disc_copy(Rec) ->

dirty_populate_disc_copy(N,NumProc) ->
From =N,
To= N-trunc(N/5),

NumProc > 0 ->
io:format(“From=~w To=~w Pocess=~w~n”,[From,To,NumProc]),
NumProc ==0 ->

Used 5 spawns to load data into mnesia tables.
specify integer value for Rec .It will load that number of records into mnesia table.
%% ——————————————————————-
%% Populate the subscriber table :disc_copies
%% ——————————————————————-

populate_subscriber(From,To,Option) ->
Stime =erlang:localtime(),
do_populate_subscriber(From, To,Option),
{_, RT} = statistics(runtime),
{_, WC} = statistics(wall_clock),
io:format(“Start=~p End=~p~n~n”, [Stime, Etime]),
io:format(“Run Time=~p Wall Clock Time=(~p) milliseconds~n”, [RT, WC]).

do_populate_subscriber(FId,TId,Option) when FId > TId ->
Name = “abcddddd”,
GroupId = random:uniform(100) – 1,
Subscr = #subscriber{subscriber_number = FId,
subscriber_name = Name,
group_id = GroupId,
variable_id = GroupId,
variable_name = “sports”,
marketing_value = “12.4454555”,
length_variable = false,
location = 9064949,
active_sessions = 450000,
changed_by = <>,
changed_time = <>,
suffix = “222222”
Option == dirty ->
Option == trans ->

do_populate_subscriber(_,_,_) ->
io:format(” totally ~p bytes~n”,
[mnesia:table_info(subscriber, memory) * 4]),

save_record_dirty(DB,Record) ->

Find the complete module here

Leave a comment

Posted by on January 15, 2009 in technology


Tags: , , , , ,

Final year project

We just finished the demonstration of our final year project.It was a character generating tool.
Which means superimposing characters and animation over the live video on the fly.
This is the project blog.


Tags: , ,

Ideas are not protected under Law

Yesterday we had our Professional practice lectures.The lecture was focused on legal issues in professional work.The lecturer was Mr Jayantha Fernando who is a Legal Advisor -ICT Agency of Sri Lanka.He pointed out that even if we have our own ideas it can be used by some other person.And it is not prevented by the law.


Posted by on February 20, 2008 in professional, technology


Tags: ,

Moments Of Life

Life has become more stressful than ever before.

Leave a comment

Posted by on February 20, 2008 in Life