Running Mbuni as a MMSC

15 Jul

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: , , , , , ,

57 responses to “Running Mbuni as a MMSC

  1. Manas

    November 20, 2015 at 4:08 pm

    Hi Thilani,
    I have configured as instructed. But I got following lines in mail.log

    38F7EE0BA3: from=, size=688, nrcpt=1 (queue active)
    38F7EE0BA3: to=, relay=mbuni, delay=55856, delays=55856/0.01/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: /usr/local/bin/content-filter: 13: cd: can’t cd to /var/spool/filter /var/spool/filter does not exist )

  2. thilani

    November 20, 2015 at 7:07 pm

    you may create /var/spool/filter folder and give read write permission to postfix and mbuni user

  3. Manas

    November 21, 2015 at 7:56 pm

    Hi thilani,

    Thank you for your reply .. I have already done that and got MM4_forward.RES in mbuni. But in log it showing warning as got MM4_forward.RES message could not find the queue the queue number. But I have check queue number is present in global queue. Then I check and found its due to permision denied on global queue files. Can you please suggest what action I should take to over come this.


  4. thilani

    November 22, 2015 at 2:44 pm

    You may check whether mbuni process has read write access to global queue. if not set permission using chmod

  5. Manas

    December 10, 2015 at 5:31 pm

    Hi Thilani,

    Thanks for your support. I can now send MM4_forward.REQ and receive MM4_forward.RES.
    Now I am trying to get MM4_delivery_report.REQ. My mbuni setup is like below.

    mbuni-vasgw(mmsbox)mbuni-mmsc(mmsc)peer mmsc

    For requesting for DLR I needed to provide “X-Mms-delivery-report = yes” in my mms header. For that I have provided ‘dlr-url’ parameter in sendmms url. But thing is going that out of my understand.
    Let say I am sending mms from to MMS sending part is working fine and I am getting MMS on phone. After receiving MM4_forward.RES in mbuni, mbuni trying to send MM4_delivery_report.REQ from to …the log is like below

    2015-12-10 09:49:01 [14426] [10] INFO: mmsglobalsender.c:278 [MM2] [n/a] mmsc for “+1812827xxxx” resolved to: “”
    2015-12-10 09:49:01 [14426] [10] DEBUG: preparing to execute /usr/sbin/sendmail -f ‘+1803500yyyy/TYPE=PLMN’ ‘+1812827xxxx/’ < '/tmp/mms.0pmxKW' to send to email:
    2015-12-10 09:49:01 [14426] [10] DEBUG: WSP: wsp_pack_version_value: value `1.0', integer 0x0010
    2015-12-10 09:49:01 [14426] [10] INFO: mmsglobalsender.c:423 [MM2] [n/a] Queued Global Queue MMS Send [qf937.1.×426.30]: From +1803500yyyy/TYPE=PLMN, to +1812827xxxx/TYPE=PLMN, msgsize=29509: n/a.
    2015-12-10 09:49:01 [14426] [10] INFO: mmsglobalsender.c:462 [] [n/a] Processed in 0 secs
    2015-12-10 09:49:02 [14527] [0] INFO: Added logfile `/tmp/log/mbuni-mmsc.log’ with level `0′.
    2015-12-10 09:49:02 [14527] [0] INFO: Started access logfile `/tmp/log/mmsc-access.log’.
    2015-12-10 09:49:02 [14527] [0] WARNING: mmsc_cfg.c:388 [mmsc] [n/a] ‘short-code’ is deprecated, please use ‘short-codes’
    2015-12-10 09:49:02 [14527] [0] INFO: mmsfromemail.c:172 [MM4] [n/a] Received [message type: MM4_forward.RES] [transaction id: +1812827xxxx/TYPE=PLMN-mmsc-qf937.1.×426.30] [origin: ] [msgid: qf937.1.×426.30@mmsc]
    2015-12-10 09:49:02 [14527] [0] INFO: mmsfromemail.c:442 [MM4] [] Received MM4_forward.RES from proxy to +1812827xxxx/TYPE=PLMN from => qf937.1.x426.30, status: [Ok, Sender number matched in queue file]
    2015-12-10 09:49:02 [14527] [0] DEBUG: Immutable octet strings: 876.
    2015-12-10 09:49:06 [14426] [2] DEBUG: Queued to thread 1 for /tmp/spool/global/qf941.2.x426.34, sendt=1449740941, tnow=1449740946
    2015-12-10 09:49:06 [14426] [11] INFO: mmsglobalsender.c:278 [MM2] [n/a] mmsc for “+1803500yyyy” resolved to: “”
    2015-12-10 09:49:06 [14426] [11] DEBUG: preparing to execute /usr/sbin/sendmail -f ‘+1812827xxxx/TYPE=PLMN’ ‘+1803500yyyy/’ < '/tmp/mms.1QqOqb' to send to email:
    2015-12-10 09:49:06 [14426] [11] INFO: mmsglobalsender.c:423 [MM2] [n/a] Queued Global Queue MMS Send [qf941.2.x426.34]: From +1812827xxxx/TYPE=PLMN, to +1803500yyyy/TYPE=PLMN, msgsize=84: n/a.
    2015-12-10 09:49:06 [14426] [11] INFO: mmsglobalsender.c:462 [] [n/a] Processed in 0 secs

    But I think the MM4_delivery_report.REQ should come from peer mmsc.
    Why mbuni trying to send it ????
    Its confirm from network trace that mbuni trying to send this.

    Please suggest how to avoid this.

  6. Eric

    June 2, 2016 at 7:52 pm

    Hi thilani/ Manas,

    Am trying to cpnnect to an operator mmsc through MM4. Could you please share the sample config files you used to achieve this.



  7. Shofiqul Alam

    January 24, 2018 at 12:59 pm

    Hello thilani,while trying to make mbuni, it gives the following error

    /usr/bin/ld: /usr/local/lib/kannel/libwap.a(wsp_headers.o): relocation R_X86_64_32S against `.rodata’ can not be used when making a shared object; recompile with -fPIC
    /usr/local/lib/kannel/libwap.a: error adding symbols: Bad value

    i have tried with ./configure –with-cflags=-fPIC –enable-shared.

    but still error persists, can you tell what to do?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: