MM1 Send and Receive MMS

MM1 Send and Receive MMS SearchSearch
Author Message
nshinka kaputu
New member
Username: Nshinkak

Post Number: 1
Registered: 09-2009
Posted on Tuesday, September 08, 2009 - 02:57 pm:   

Please help...! am so new to now.sms and i need guidance. am trying to congfigure now.sms to send and receive MMS through a GSM modem. I somehow managed to send MMS, but seems not to be receiving any MMS. I also want to be also to pass the received MMS to a database (more like what mmsreceive.php operates). how can i go about this..... please help
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 1208
Registered: 08-2008
Posted on Tuesday, September 08, 2009 - 06:47 pm:   

Hi,

What is the GSM modem that you are using?

Is NowSMS able to receive any SMS messages?

(I ask this because one common problem is that the GSM modem implementation in most Nokia phones does not support receiving messages via the modem interface. A dedicated modem device is required.)

Enable the SMSDEBUG.LOG (checkbox on the "Serial #" page of the configuration dialog). Send both an SMS and an MMS message in to the modem.

Post a reply with the SMSDEBUG.LOG, and that should tell us more about what is happening.

--
Des
NowSMS Support
nshinka kaputu
New member
Username: Nshinkak

Post Number: 2
Registered: 09-2009
Posted on Wednesday, September 09, 2009 - 09:16 am:   

Des,

The GSM modem am using is a SonyEricsson Device 616 USB WMC modem (Mobile Phone) and NowSMS is able to receive SMS messages.
application/octet-streamMMSCDEBUG
MMSCDEBUG.LOG (54.3 k)
application/octet-streamSMSDEBUG
SMSDEBUG.LOG (18.5 k)

Please check the attached logfiles.

Thank you
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 1215
Registered: 08-2008
Posted on Wednesday, September 09, 2009 - 02:57 pm:   

Hi,

When using a SonyEricsson mobile phone as a modem with NowSMS, you can usually send and receive SMS messages. You can send MMS messages, but you will not be able to receive them.

The reason for this is because the MMS client on the mobile phone always intercepts the MMS notification, so it does not get forwarded to the GSM modem interface.

To be able to receive MMS messages, you need to use a dedicated modem device instead of a phone. The dedicated modem device doesn't have an MMS client on it, so the MMS notification will be routed to NowSMS.

Option ICON and GlobeTrotter modems are good USB stick modems that are available in most countries. (I personally use the Option ICON 322.)

Customers have also been telling us good things about the Novatel MC950D, and various Huawei and ZTE models.

The SonyEricsson MD300 also works well, but requires an update for NowSMS to work properly (update is at http://www.nowsms.com/download/nowsmsupdate.zip).

I see that you were able to configure NowSMS to route a message to your PHP script locally.

It also appears that there are SMS messages waiting on the phone that NowSMS is not retrieving. Make sure that "Receive SMS Messages" is enabled in the modem definition in NowSMS.

--
Des
NowSMS Support
nshinka kaputu
New member
Username: Nshinkak

Post Number: 3
Registered: 09-2009
Posted on Thursday, September 10, 2009 - 03:10 pm:   

Hello, thank you. i finally managed to use a Huawei Modem and was able to receive mms messages.

Now, i need help on how i can edit the mmsreceive.php script to able to post the received mms content to a mysql database.

I have created a table called mms_messages, in which i want to log all received mms's.

Images, videos or other files attached should also be write to the database.

Thank you...
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 1237
Registered: 08-2008
Posted on Thursday, September 10, 2009 - 07:09 pm:   

Hi,

The PHP script will receive each MMS file object in a temporary file.

You'll see this loop that processes each object:

/* Repeat for each object/file within the MMS message */
foreach ($_FILES["MMSFile"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES["MMSFile"]["tmp_name"][$key];

At this point, $tmp_name points to the name of a temporary file which holds the data for this particular upload.

If you look at the script in more detail, you'll also see where we parse out the original filename, and the original MIME content type.

In the case of text/plain, we use file_get_contents to read the data in from the file.

For other types, we use move_uploaded_file to save the uploaded file to a permanent location.

In your case, you'd probably want to use file_get_contents in binary mode for all content types other than text.

The PHP web site is a good reference for more information:

http://us.php.net/manual/en/features.file-upload.php

--
Des
NowSMS Support