Thursday, January 24th 2008

Serving MMS messages with Apache
posted @ 7:29 am in [ Apache -Kannel -MBuni -MMS -Mobile -PHP ]

Now you would have thought after the number of years I’ve been playing around with MMS messages, using libraries like the Nokia MMS Java library to build them and servers like Kannel (SMS) and MBuni (MMS) to serve them, that we wouldn’t have any problems trying to serve MMS content ourselves using SMS binary push and .MMS encoded files.

Well, basically we did – and it all comes down to one thing – phones needing be specifically told that .MMS messages have a certain MIME type.

Some phones, the Motorola V3 Razor for example, automatically assume that all MMS messages are going to be an acceptable type, no matter what MIME type you serve them as. Therefore using a standard Apache server, a binary created MMS file (try the Nokia MMS Java library for Java, and MMSLib for PHP to build the messages) and a binary SMS push (either made yourself or using HTTP API’s such as Clickatell’s) these phones recieve the messages just fine.

However, a lot of other phones (notably Blackberry’s and Sony Ericsson’s) require specific instructions to treat the .mms file as type application/vnd.wap.mms-message

Therefore for these phones, add into the directory where the .mms files are stored the following .htaccess file and Apache will start serving the content in exactly the right way.

AddType application/vnd.wap.mms-message mms

Job done – and I bet if you’re reading because this is what you’re trying to do, we hopefully just saved you hours of going mad!

Leave a Reply