MMS Diary ========= What is MMS? ------------ MMS stands for Multimedia Messaging Service and is a service for mobile phones to enable the user to send images, sounds, text messages and just about any other mime-type there is given that the mobile phone supports it. It is the successor of SMS. Many phones today come with digital cameras making it more and more attractive to take photos and send to friends from your phone. MMS is sent from the phone by using standard Internet protocols. When you hit send on your phone, after composing your message, it communicates with a WAP gateway which translates the WAP POST into a HTTP POST towards a server. That server is often called an MMS Proxy-Relay, MMC or MMS Server. The MMS Proxy-Relay is the interface and router in the system and MMS Server is generally meaning the server where you store MMS:es and can access them. The MMS Proxy-Relay and MMS Server is often combined into the same server and companies sometimes name this combination MMC, MMSC or something similar. The MMC in turn receives the message and stores it in its database. Then it decodes the message to find its destination address. The destination can be an email address or a phone number. In case of an email address the message is just encoded as an email with attachments and sent using SMTP over the Internet. If the destination is a phone number however it is handled differently. Then the MMC transmits a notification to the receiving phone with the help of the WAP gateway. This can be done in two ways - over SMS or over IP - but the common way to do it is over SMS. So the WAP gateway now transmits an SMS (or two) telling the receiving phone that it has an MMS to get. The receiving phone downloads it from the MMC using WAP GET which is translated to a regular HTTP GET by the WAP GW before it reaches the MMC. What is this? ------------- MMS Diary is a way to post messages to a web page by just using your MMS-enabled mobile phone. Entries in the diary can contain text, images and sound (such as voice recordings or a music file). Messages are posted in a bit of an unorthadox way though by (ab)using the MMS functionality in your phone. The script send.php, included in this package, pretends to be an MMS Proxy-Relay. What you need to do to use this is to set the URL to that script (on whatever host you install it) in your phone. So say for instance that you install the script in http://yourdomain.com/diary/send.php. Then you would insert that address as message server (it is called "Message Server" on the T68 - see INSTALL for help on setting up the phone) in your phone where you now have the operator's MMS Proxy-Relay. Of course, by doing so you cannot send "real" MMS:es anymore (till you change it back). Then all you need to do when you want to make a diary entry is to compose a message, with images, texts and sounds, and send it away and it will appear on the web page. The subject row in the MMS is translated to the header on the web page so write something sensible there. The to-address is not necessary since it won't be transmitted to anyone of course, but most phones complain if you don't write anything there so you need to write at least something there. So what's the point? -------------------- Well? Do you always have to have a point for doing something? I needed something to send messages back to family and friends when I was on holiday and this was a fun way of doing it. There are of course other solutions to this, email for instance since many phones now supports emails with attachments, but this was fun and composing an MMS with several images and texts was easier on my phone (Ericsson T68) than to write an email so this was best for me. Any limitations? ---------------- Yes, the size of MMS:es sent from a phone is limited by the phone software and memory capabilities. Several phones cannot transmit larger MMS:es than 30KB so it definitely limits the size of images you send. Copying ------- This package is released under the GNU General Public License - GPL. See the file COPYING. Installing ---------- See file INSTALL What phones does it work with? ------------------------------ Currently it has only been tested with the following phones: Phone Tester Comments/issues Ericsson T68, T310 Me Ericsson P800 Anonymous Nokia 7650 Welby McRoberts Nokia phones always send text encoded in utf-16 no matter what your language settings are. This caused problems in early releases. A quick fix for this is now implemented. The UTF-16 support is far from complete though Nokia 7250 Nicholas McClellan Sagem MyX-5m Marius Cristian Please let me know if it works for other phones as well. Security concerns ----------------- Please observe that there is NO access control. Anyone can post to your site as long as they can encode an MMS message. You could add some simple checks if you like. You could for instance check the from number in the mms (accessible through the MMSDecoder->from - variable after parsing in send.php) but this is really no security fix of course. You can also limit access to your page to only the wap-gw that you use but that is not secure either of course. Since the to-field and from-field is not used in this application (and not displayed anywhere either) you could actually use these fields as a userid-password-pair if you like. Sometimes, in some software versions, the phone inserts the from address automatically and sometimes the phone inserts an "insert-address-token" here for the wap-gw to insert the from number later on. I think the latter one is what is required by the standard but I'm not sure. Anyway, the from address is always the number of the sending phone so come up with a to-address (can be any text unless the phone software forces you to write either a number or an email address) as a password for that number and you are all set. Of course - the connection is not encrypted so people can still eavesdrop. UPDATE: the from-field is seldom sent (only in early versions of the T68). Instead it sends an "insert-address-token" which should be translated later. This translation is not possible though on a operator free "MMC" like this unless the Wap-GW forwards the MSISDN in the headers. Wap-gw:s seldom forwards MSISDN to unregistered sites unfortunately. It does not work for me with my operator. Can they have blocked me? ------------------------------------------------------------------- Some operators have a very weird view of the mobile internet. They only want to let their users use their parts - parts that give income to the operator. Operator's worst fear is to become a stupid bit-pipe and therefore some have choosen the path to restrict access to the Internet. This is done so that you, when connecting to Internet, get a local address (say 10.x.y.x something). The only way you can then access the Internet is through the wap gw the operator provides you with since NAT-ing seems to be through that gw as well. So far so good. That's only sane since the number of addresses are limited so NAT-ing should be no problem. But what they now also do is to block traffic to say, other MMC:s than their own. So they don't let you run your own MMC and you have to use the one they have provided you with, where you have to pay for whatever they decide an MMS costs. Vodafone is known to use this technique but if you have problems using this application then perhaps your operator does too. So what can you do? If you can access the Internet from your phone then perhaps using a gw on your own would let you do what you want on the net. But if you cannot then there is not much to do since your internet access is linked to your operator. Some operators can provide a GPRS APN for PC access and those are usually unrestricted. If your operator has one you can ask for the information around that and setup a wap-gw on your own (http://www.kannel.org). Another option is if you use GSM instead of GPRS (MMS works just fine over GSM as well). Then you can always use any ISP with the good old dial-up modem pools and connect using that instead. Then you will be free. Apart from this, if it all fails for you, the only thing you can do is to change to an operator which believes in a free Internet. Can you implement a real MMS Proxy-Relay/MMS Server using these files? ---------------------------------------------------------------------- Yes, of course. It would not be hard but it depends on your ambitions and if you want to go commercial or not. You will have to store the messages somewhere and encode it so that it is ready to be downloaded by a client (see available docs at http://www.wapforum.org). That is not much work since you don't have to extract the attachments as I do here in this application. The MMC in general doesn't have to touch the inner parts of the MMS unless it wants to add content on the fly or change content (like adjusting image sizes to suite the receiving terminal or add advertising banners). Of course, there are many boring little details to think of if you want to make a commercial system. Then you'll need to think of scaleability, about user provisioning, about charging, about providing API:s for application developers and about interoperability with other MMS Proxy-Relays and with lots and lots of different terminals to mention a few things. Things are much less boring if you do not charge for things. You will also have to send notifications some way or the other and unfortunately sending of SMS:es costs money so a completely cost free solution is not easy. A common way to implement push notifications for small scale things like this (if you don't go commercial with thousands of customers) is to just hook a mobile phone to the serial port on your PC and send SMS:es through that when an MMS arrives. To do push over IP you will need to know the IP address of the phone and you won't know that unless you have access to the network at the operator of the receiving terminal. If the wap-gw forwards the IP address of the accessing terminal (not many gw:s do that by default) you might be able to do a polling function - you wap in to the MMC and get the messages pushed to your current address. But that is not that conveniant. Where can I read about the protocols and formats regarding MMS? --------------------------------------------------------------- All the information you'll need can be found at http://www.wapforum.org How do I contact the author --------------------------- See http://hellkvist.org/about/ Have fun and happy hacking! Stefan Hellkvist