How to send MMS message via gateway's web menu interface

How to send MMS message via gateway's web menu interface SearchSearch
Author Message
Mark Liao
New member
Username: Markliao

Post Number: 1
Registered: 12-2008
Posted on Friday, December 26, 2008 - 08:24 am:   

Hi!
I meet a problem when I try to sending MMS message. After doing some settings and testing, I finally can send MMS message by using the "Send MMS Message" form and a GSM modem. And I can get the MMS message with my cell phone.

Then I start to create my VC++ program to sending MMS message. In the VC++, there are several classes that can help me to post data to the web menu interface. Here is my coding.


CInternetSession httpSession("My Client");
CHttpConnection* phttpConnection = NULL;
CHttpFile* phttpFile = NULL;

// connect to the gateway with user name and password
phttpConnection = httpSession.GetHttpConnection("192.168.10.39", (INTERNET_PORT)8800, "admin", "admin");

// post data
phttpFile = phttpConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST, "Send%20MMS%20Message.htm");
phttpFile->AddRequestHeaders(m_csHeader_Text);
phttpFile->SendRequest(NULL, 0, chContent, iContentLen);

// get the return code
phttpFile->QueryInfoStatusCode(dwReturnCode);



The header and content that I post are here.


POST /Send%20MMS%20Message.htm HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*
Referer: http://192.168.10.39:8800/Send%20MMS%20Message.htm
Content-Type: multipart/form-data; boundary=---------------------------7d826c2f50100
Host: 192.168.10.39:8800
nUser-Agent: VCApp
Content-Length: 679
Connection: Keep-Alive
Cache-Control: no-cache
Authorization: Basic YWRtaW46YWRtaW4=

-----------------------------7d826c2f50100
Content-Disposition: form-data; name="PhoneNumber"

0919984176
-----------------------------7d826c2f50100
Content-Disposition: form-data; name="MMSFrom"

Mark Liao
-----------------------------7d826c2f50100
Content-Disposition: form-data; name="MMSSubject"

MMS test
-----------------------------7d826c2f50100
Content-Disposition: form-data; name="MMSText"

This is test.
-----------------------------7d826c2f50100
Content-Disposition: form-data; name="Submit"

Submit
-----------------------------7d826c2f50100--



I post the data to the gateway and get the return code "200". The return code tell me that this post is successful. However, I can not receive the MMS message with my phone. I check the "MMSCDEBUG.LOG" file and find that there is no any log about my MMS sending.

Do I need to doing more settings to make it work? OR do I miss something? I search the board but can not find anything related the VC++ programming with sending MMS message. Can someone give me some advices?
Sajid Ahmed
New member
Username: Sajid

Post Number: 9
Registered: 10-2008
Posted on Friday, December 26, 2008 - 09:11 am:   

Hi Markliao,

I too unable to make it out using Java.Can you please guide me how you achived mms .
Your Comments:
After doing some settings and testing, I finally can send MMS message by using the "Send MMS Message" form and a GSM modem. And I can get the MMS message with my cell phone.
please refer http://www.nowsms.com/messages/index.htm for more details.
Please ping me on sajidbigler@gmail.com. i need your help to get content on my mobile using nowsms,GSM modem with an sample MMS.

if we try programitically how we need to send mms.anout mime-types,boundries actual binary content etc smile if any....

Thanks & Regards,

Sajid
Sajid Ahmed
New member
Username: Sajid

Post Number: 10
Registered: 10-2008
Posted on Friday, December 26, 2008 - 11:41 am:   

Hi,

if mimeType=application/vnd.oma.drm.message how can be a mms message displayed.
Can someone help me to understand what mime-types and content-types do we need to send so that it can be delivered as MMS

Thanks & Regards,
Sajid
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7711
Registered: 10-2002
Posted on Friday, December 26, 2008 - 03:24 pm:   

Hi Mark,

Let's take a look at the SMSDEBUG.LOG.

When you post using the web form (or multipart/form-data), the SMS gateway service is handling this web interface.

If the SMSDEBUG.LOG doesn't show us what's wrong, then is it possible for you to get a hex dump of your POST. It looks good to me based upon what you've included above, but maybe there is something subtle that I am missing and would notice in a hex dump of the POST.

-bn
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7712
Registered: 10-2002
Posted on Friday, December 26, 2008 - 03:28 pm:   


quote:

if mimeType=application/vnd.oma.drm.message how can be a mms message displayed.
Can someone help me to understand what mime-types and content-types do we need to send so that it can be delivered as MMS




Hi Sajid,

I don't understand the context in which you are asking this question.

application/vnd.oma.drm.message is a MIME content type for a DRM protected object that could be one of the objects inside of an MMS message.

-bn
Mark Liao
New member
Username: Markliao

Post Number: 2
Registered: 12-2008
Posted on Monday, January 05, 2009 - 06:10 am:   

Hi Bryce,

I followed your opinion and checked both SMSDEBUG.LOG and MMSCDEBUG.LOG files. After sending a text MMS message through the web form successfully, I found the Message Content in the SMSDEBUG.LOG like below:


PhoneNumber=0919984176&MMSFrom=Mark+Liao&MMSSubject=Send+Text+MMS+001&MMSText=Th is+is+sending+Text+MMS+message+test.&MMSFile=&MMSFile=&MMSFile=&MMSFile=&MMSFile =&MMSFile=&MMSFile=&MMSFile=&MMSFile=&MMSFile=&MMSDeliveryReport=No&MMSReadRepor t=No&MMSPriority=Normal&MMSMessageClass=Personal&MMSForwardLock=No&DRMRestrict=N o&DRMRestrictTextXML=&DRMConstraintCount=&DRMConstraintStart=&DRMConstraintEnd=& DRMConstraintInterval=&MMSHEADERS=&Submit=Submit&


So, I changed the Message Content to the above format in my program and sent it through VC++ coding. After a moment, I got the MMS message in my cell phone. I know nothing about the HTTP command or connection. And I don't konw why this format can work. I only know that sending a text message to the cell phone is not a problem for me now.

However, I still can not figure out how to send an image message through my program. I checked the SMSDEBUG.LOG file again and tried to find an answer. Inside the file, I only saw something like below:


PhoneNumber=0919984176&MMSFrom=Mark+Liao&MMSSubject=Send+Image+MMS+002&MMSText=T his+is+sending+Image+MMS+message+test.&MMSFile=Blue hills.jpg&MMSFile=&MMSFile=&MMSFile=&MMSFile=&MMSFile=&MMSFile=&MMSFile=&MMSFile =&MMSFile=&MMSDeliveryReport=No&MMSReadReport=No&MMSPriority=Normal&MMSMessageCl ass=Personal&MMSForwardLock=No&DRMRestrict=No&DRMRestrictTextXML=&DRMConstraintC ount=&DRMConstraintStart=&DRMConstraintEnd=&DRMConstraintInterval=&MMSHEADERS=&S ubmit=Submit&
15:56:24:218 [12] Debug: 1 recipient entries
15:56:24:218 [12] ThreadProcessConnection: Blue hills.jpg
15:56:24:218 [12] ThreadProcessConnection: Blue hills.jpg
15:56:24:375 [12] HttpResponseWait: Ok


Unlike sending a text message, I only found the image file name in the Message Content, but I can not find the image raw data.

I want to know what kind format the Message Content will be while sending an image message. Where should I put the image binary data in the Message Content?

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

Post Number: 356
Registered: 08-2008
Posted on Monday, January 05, 2009 - 06:44 pm:   

Hi Mark,

The URL format in SMSDEBUG.LOG is a little deceptive for an MMS message submission.

The SMSDEBUG.LOG doesn't actually show the raw "multipart/form-data" HTTP POST submission.

When NowSMS receives a "multipart/form-data" HTTP POST transaction, there is some internal logic within NowSMS that parses the data and then reformats it as an HTTP GET URL. The SMSDEBUG.LOG is showing this HTTP GET URL instead of the raw data.

When this transformation happens, the "MMSFILE" references that are displayed in the SMSDEBUG.LOG actually point to temporary files on the NowSMS server ... which are created when the "multipart/form-data" POST is parsed.

I think we'd need to take a look at a raw HTTP POST using a tool like Wireshark (or the older version of the product Ethereal) in order to troubleshoot this further.

Your example of the raw HTTP POST above looks good.

If you were to include a file component, you would see an added section that looks like this:

-----------------------------7d826c2f50100
Content-Disposition: form-data; name="MMSFile"; filename="originalfilename.ext"
Content-Type: content/type

<raw content data here>



NowSMS looks for "filename=" to be present to tell it that there is raw content data present.


As an alternative to all of this, you can use an HTTP GET URL, but for the MMSFILE parameters, include an HTTP URL reference so that NowSMS can fetch the content from another web server. (e.g., &MMSFILE=http://www.nowsms.com/media/logo.png).

--
Des
NowSMS Support