MMS Implementations

MMS Implementations SearchSearch
Author Message
Sajid Ahmed
New member
Username: Sajid

Post Number: 7
Registered: 10-2008
Posted on Tuesday, December 23, 2008 - 12:45 pm:   

Hi List,

Please find MMSSlide.java and ContentSlide.java files with this mail.using both java file i am trying to build mms message. the result is as follows....

Can we send mms using modem as i do for sms and wap?
In modem i insert my sim to reach operator smsc.will same work for mmsc?

messageId ********************1230014203031
messageClass ********************AUTO
messagePriority ********************NORMAL
senderVisibility ********************SHOW
deliveryReportRequired ********************true
readReportRequired ********************true
messageName ********************song
fromAddress ********************null
receipentsList ********************[+919985032322, sajidbigler@gmail.com]
userAgentsList ********************[.*SEC-SGHX160.*]
mmsSlideList ********************[MMSSlide@1198967]
smilData ********************[B@18c022c


**********************textContent contentSlide*********************
ContentId()*********************text_slide
ContentMimeType()*********************text/plain
ContentData().toString()*********************[B@18a3fe6
ContentData().length*********************14
contentSlide*********************

**********************audioSlide ********************

**********************contentSlide*********************
**********************ContentId()*********************TeenMaar-Bhutto.mp3
**********************ContentMimeType()*********************audio/mp3
**********************ContentData().toString()*********************[B@181f5b
**********************ContentData().length*********************9221504
**********************contentSlide*********************

********************** imageSlide ********************ContentSlide@1b2979e

**********************contentSlide*********************
**********************ContentId()*********************IMG_4276.JPG
**********************ContentMimeType()*********************image/jpeg
**********************ContentData().toString()*********************[B@1654
**********************ContentData().length*********************611059


.**********************Device Header******SEC-SGHX160.*

<smil>
<head>
<layout>
<root-layout width="160" height="140"/>
<region id="Image" width="160" height="120" left="0" top="0"/>
<region id="Text" width="160" height="20" left="0" top="120"/>
</layout>
</head>

<body>
<par dur="60s">
<text src="cid:text_slide" region="Text" />
<img src="cid:IMG_4276.JPG" region="Image" />
<audio src="cid:TeenMaar-Bhutto.mp3" />
</par>
</body>
</smil>

Please help me to integrate with nowmms server and clarify few questions:

1.what does src="cid: means in smil file. as i use predefined xsl to transform it.

2.how can i send mms using webinterface? i mean do you have a sample mms so that i can send using webinterface to see if its downloaded to my phone.

3.By going through the lots of documentaion still i dint get the actual functinality of now mms gateway.

I suppose when mms is send from the webUI or programitically or from gateway.its job of the now mms server to send mms notification right?

how all these happens.flow,sequece of all happenings while trasmitting mms from gateway to operator , to client and vise versa

4.What things should be taken care while sending and creating mms.

5.How is the flow or architecture in details

6.What attributes,elements were are expected in the message.

7.How can i invoke nowmms using mm7? ********This is what i need to achive***********

8.What are the possible protocals does nowsms supposrt and how we can make ,invoke or use them individually..

9.If i use http how can i do it.if its smil file where we add binary content is there another element as <presentation-part>?

10. How to make <presentation-part>?

what i understood is smile is for presentation if multiple contents we can make use of smil to do lots of animations.
if its single content i no need smil or say if i dont use smil(not mandatory i suppose)

11. How can i send message by using above information?

12.I really dint get from php or java examples that how the files are taken given the path and will they take binary or only file path.

13.I felt to add binary in bytes. or do we have any method to call web services which directly points to the content.

Please post all alternatives and your comments on my understading.
application/octet-streamContentSlide can be image/ringtone/video etc
ContentSlide.java (2.1 k)
application/octet-streamMMSSlide can be image/ringtone/video etc
MMSSlide.java (4.1 k)
Sajid Ahmed
New member
Username: Sajid

Post Number: 8
Registered: 10-2008
Posted on Wednesday, December 24, 2008 - 03:15 pm:   

Hi List,

If lets suppose we get the files (image,sound,video,text) in byte array.
some where we add binary content like bytes in mms in sone elent in smil or
if we send directly with out smil (please explain on both if smil and if not smile how to add binary to mms)

Now if its bytes then do we need normal bytes as binary attachment or utf-8 bytes as binary attachment or bytes converted in to hex format?

Again which bytes are need to be converted to hex i.e normal byte array(binary) or utf byte array (binary).

For more clarification please go through link and contents below


http://java.sun.com/docs/books/tutorial/i18n/text/string.html

import java.io.UnicodeFormatter;

String default = "String to convert";

//normal byte arry
byte[] normal = default.getBytes();//in byte array

printBytes(normal, "default");
//UTF byte array
byte[] utf8SrcBytes = default.getBytes("UTF8");//in byte array

printBytes(utf8SrcBytes, "default");

//converting normal byte arry to string utf-8
byte b1[] = new byte[]{1, 11, 2, 22, 33, 127};
String s = new String(b1, "utf-8");



public static void printBytes(byte[] array, String name) {
for (int k = 0; k < array.length; k++) {
System.out.println(name + "[" + k + "] = " + "0x" +
UnicodeFormatter.byteToHex(array[k]));
}
}



Thanks & Regards,

Sajid
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7714
Registered: 10-2002
Posted on Friday, December 26, 2008 - 04:06 pm:   

Hi Sajid,

I have no idea what that Java code is doing. It is not complete.

I don't know if it is building a binary MMS message, which would be transmitted via MM1 ... or if it is building an object to be transmitted via MM7.

I can answer a few of your questions, but I simply don't understand the Java code that you are using, and can't answer any questions about it.


quote:

1.what does src="cid: means in smil file. as i use predefined xsl to transform it.




It references another object in the MMS message. SMIL is the display/presentation language for an MMS message. If the object name is preferenced with "cid:", this means that it refers to the "Content-ID:" header of another object within the multipart SMIL message.

Personally, I would recommend against using the "cid:" prefix, because you are likely not generating the "Content-ID:" header of the final resulting MMS message. If you do not include the "cid:" prefix, then you are referencing the filename of the other object instead.


quote:

2.how can i send mms using webinterface? i mean do you have a sample mms so that i can send using webinterface to see if its downloaded to my phone.




There is nothing special for you to do.

Try first by just including some text, and don't attach any files.

Next, assuming that works, attach a GIF or JPEG image as one of the files.

The web interface will automatically build a simple SMIL file for you.


quote:

3.By going through the lots of documentaion still i dint get the actual functinality of now mms gateway.

I suppose when mms is send from the webUI or programitically or from gateway.its job of the now mms server to send mms notification right?

how all these happens.flow,sequece of all happenings while trasmitting mms from gateway to operator , to client and vise versa




There are a lot of different configurations.

For more background on how MMS works, please see http://www.nowsms.com/howmmsworks.htm.

To simplify the most common configurations for MMS with NowSMS, it would be one of the following:

a.) NowSMS acting as an MMSC, performing direct delivery of the MMS message. (Usually this is only possible when NowSMS is used as an operator MMSC, or when in a test environment.)

b.) NowSMS packaging messages for delivery via an operator MMSC. NowSMS might be doing this by submitting the messages to the mobile operator over a GSM modem, or you may have a value added service provider (VASP) connection to the mobile operator via MM7.


quote:

4.What things should be taken care while sending and creating mms.




This depends on what you are trying to accomplish.


quote:

5.How is the flow or architecture in details




This depends on the protocol that you are using. Good background information on how MMS works is at http://www.nowsms.com/howmmsworks.htm.


quote:

6.What attributes,elements were are expected in the message.




You can get an idea of this from the web form.

To/From/Subject are normally expected. (But you cannot override the From when sending via a GSM modem.)

Then there are one or more objects within the message. These objects could be any combination of text, images, video, or any other content types that might be supported by the mobile phone (such as Java midlets or Symbian apps, although operator MMSCs might block these).

There is also normally a SMIL presentation that dictates how the objects within the message are to be displayed to the recipient. If you do not include a SMIL object when submitting via NowSMS web interface, a default SMIL presentation will be generated.


quote:

7.How can i invoke nowmms using mm7? ********This is what i need to achive***********




Define an "MMSC VASP" in NowSMS. This is your account credentials for your application to connect to NowSMS and submit a message.

You perform an HTTP POST to the web port of the MMSC (not the HTTP/web port of the SMS gateway web interface). To identify that you are making an MM7 post, the HTTP POST URL must start with /mm7

To identify your "MMSC VASP" credentials, you can either include the credentials in the MM7 POST URL, (e.g., http://ip:port/mm7/account=password), or you can include an "Authorization:" header using HTTP Basic Authentication to specify these credentials.

More information and an example are here:

http://www.nowsms.com/documentation/ProductDocumentation/mms_notifications_and_c ontent/Submitting_MMS_Messages_MM7.htm


quote:

8.What are the possible protocals does nowsms supposrt and how we can make ,invoke or use them individually..




From an MMS perspective, there's MM1, EAIF, MM4, MM7, MM3 (SMTP). You use what you need.


quote:

9.If i use http how can i do it.if its smil file where we add binary content is there another element as <presentation-part>?




Refer back to the example referenced above.

The HTTP POST of the MM7 is a two-level multipart object.

The outer multipart object has part 1 being the MM7 XML. Part 2 is another inner (nested) multipart object.

The inner multipart object has all of the content objects that are part of the MMS message.

The example that I referenced above does not have any SMIL.

If you want to include SMIL, you change this header in the inner multipart object from:

Content-Type: multipart/mixed; boundary="StoryParts-74526-8432-2002-77645"

to:

Content-Type: multipart/related; boundary="StoryParts-74526-8432-2002-77645"; type="application/smil"; start=<smilpart>

Then, for one of the parts within this inner multipart, you include a part with a "Content-Type: application/smil" and "Content-ID: <smilpart>". (The content-type "application/smil" is required ... the start/content-id value can be something other than "<smilpart>", I just used that as an example.)


quote:

10. How to make <presentation-part>?

what i understood is smile is for presentation if multiple contents we can make use of smil to do lots of animations.
if its single content i no need smil or say if i dont use smil(not mandatory i suppose)




You must learn SMIL. You will need to do some web searching to learn more about it.

But keep in mind that MMS only uses a very basic implementation of SMIL. There is not much animation that you can do with it. A simple animated GIF may give you more of what you want.


quote:

11. How can i send message by using above information?




Submitting a message via MM7 is done via HTTP POST, as described above.


quote:

12.I really dint get from php or java examples that how the files are taken given the path and will they take binary or only file path.




Files that are part of the MMS message are contained within the message itself, they are not referenced externally.

These files/objects are part of a multipart object of some sort. The format of this multipart object depends on the protocol being used.


quote:

13.I felt to add binary in bytes. or do we have any method to call web services which directly points to the content.




I don't understand the question ... and I don't understand the follow-up post.
Sajid Ahmed
New member
Username: Sajid

Post Number: 11
Registered: 10-2008
Posted on Sunday, December 28, 2008 - 09:03 am:   

Hi Bryce,

Thanks for your quick response.

Bryce :
I don't know if it is building a binary MMS message, which would be transmitted via MM1 ... or if it is building an object to be transmitted via MM7.

Sajid :
Using above code i am tring to build complete mms message which can be delivered to nowsms gateway.if i want to trasmit data using mm1 then binary data is constructed then the data should be UFT-8 format? or the binary should be converted into hexadeciaml format? or plain binary is enough?In these lines i was trying to express if the data is in binary which type of binary is considered

String default = "String to convert";

//normal byte arry
byte[] normal = default.getBytes();//in byte array

printBytes(normal, "default");
//UTF byte array
byte[] utf8SrcBytes = default.getBytes("UTF8");//in byte array

printBytes(utf8SrcBytes, "default");

//converting normal byte arry to string utf-8
byte b1[] = new byte[]{1, 11, 2, 22, 33, 127};
String s = new String(b1, "utf-8");

The below line converts binary data to hexdecimail format
UnicodeFormatter.byteToHex(array[k]));

So,what binary data(normal binary,UTF-8 binary or hexadeciamal(from normal binary)or hexadeciamal(from UTF-8 binary)))should be considered as the binary attachment of mms which needs to be send using mm1.
sending mms can be done using mm1 or we can even using mm7?reciveing mms can be done by only mm7 ?
Lests suppose i am using mm1 then i have constructed mms(header,content,smil,binary content,boundaries where ever needed)to post to nowsms,what exact formation of mms(header,content,smil,binary content,boundaries where ever needed) shold be constructed and what all configurations need on nowsms gateway.

if we are connecting operator via nowsms to send mms then where/what settings need to be done and what needs to be expected from operator so that we can do all settings..

if we are connecting directly nowsms for sending mms then where/what settings need to be done and will nowsms will take care of connecting to operator or it will be delivering messages directly with out operator as the vechicle to deliver mms.So whatnowsms gateway will provide for doing this.is this included in purchase of nowsms or we need extra setting/amount to enable nowsms/mms as mmsc?

Bryce:
It references another object in the MMS message. SMIL is the display/presentation language for an MMS message. If the object name is preferenced with "cid:", this means that it refers to the "Content-ID:" header of another object within the multipart SMIL message.

Personally, I would recommend against using the "cid:" prefix, because you are likely not generating the "Content-ID:" header of the final resulting MMS message. If you do not include the "cid:" prefix, then you are referencing the filename of the other object instead.




Sajid:
for example <mm7:TransactionID xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-M M7-1-3" env:mustUnderstand="1">
above element has xmlns:mm7 so mm7 is the prefix where cid: is defined
how do cid: refer to the actual object?normally if i supose cid: is the prefix then how its pointing to actual location of data(binary content).if we go with normal file name and give path like c:\mms\image.jpg then it gets from that perticular location but how cid: refer to the actual location of binary content?

here i want to understand how actaul data is send to nowsms if its smil.is there any special element to place binary or will it determine from cid: ?

Bryce:
From an MMS perspective, there's MM1, EAIF, MM4, MM7, MM3 (SMTP). You use what you need.

Sajid :
Nowsms Perspective.What are the possible protocals does nowsms supposrt and how we can make ,invoke or use them individually..

Bryce:
I don't understand the question ... and I don't understand the follow-up post.

Sajid:
I felt to add binary in bytes(if i use mm1). or if i use mm7(how to invoke webservice of nowsms or operator)
this link gives basic about this
http://www.nowsms.com/documentation/ProductDocumentation/mms_notifications_and_c ontent/Submitting_MMS_Messages_MM7.htm
according to this we can send mms using mm7 and normal binary can be attached
in Envelope we have header and body which is understood but
--NextPart_000_0028_01C19839.84698430
Content-Type: multipart/mixed; boundary="StoryParts-74526-8432-2002-77645"
Content-ID:<SaturnPics-01020930@news.tnn.com>

--StoryParts-74526-8432-2002-77645
Content-Type: text/plain; charset="us-ascii"

Science news, new Saturn pictures...

--StoryParts-74526-8432-2002-77645
Content-Type: image/gif
Content-ID:<saturn.gif>
Content-Transfer-Encoding: base64

R0lGODdhZAAwAOMAAAAAAIGJjGltcDE0OOfWo6Ochbi1n1pmcbGojpKbnP/lpW54fBMTE1RYXEFO

...

--StoryParts 74526-8432-2002-77645--
--NextPart_000_0028_01C19839.84698430--

Above details are not much clear.please eloborate on each attribute and any number of contents(in mms like image,sound,video,smil) can be attached in a given request so binary content of type base64 is added so we use Content-Transfer-Encoding: base64 ?it can be a not mal binary too then we no need to this tag?how to include if its normal binary?


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

Post Number: 7725
Registered: 10-2002
Posted on Wednesday, December 31, 2008 - 03:49 pm:   

Use UTF-8 for text.


quote:

if we are connecting operator via nowsms to send mms then where/what settings need to be done and what needs to be expected from operator so that we can do all settings..




See http://www.nowsms.com/howmmsworks.htm for more information about How MMS works.

To send messages via the operator MMSC, you either need a special account with the mobile operator (i.e., MM7) ... or you can send messages using a GSM modem.

See http://www.nowsms.com/howmmsworks.htm for more information about how to configure this type of connection.

(Note: I see from another thread that you are trying to use an older version of NowSMS. This type of connection is easier to do in newer versions as we have the operator settings for different operator MMSCs available via a drop-down list. You need to manually configure those settings in older versions. Some of those settings can be found here: http://blog.nowsms.com/2008/06/mobile-operator-mmsc-settings.html)



quote:

Above details are not much clear.please eloborate on each attribute and any number of contents(in mms like image,sound,video,smil) can be attached in a given request so binary content of type base64 is added so we use Content-Transfer-Encoding: base64 ?it can be a not mal binary too then we no need to this tag?how to include if its normal binary?




It's a MIME multipart message. Encoding is similar to what you would use for an e-mail message.

It is not necessary to use BASE64 encoding for binary content. The binary content could be included without any encoding (however, most examples from the specifications use BASE64 encoding for binary content).

The content of the MM7 HTTP POST is a two-level MIME multipart object.

The outer multipart object has part 1 being the MM7 XML. Part 2 is another inner (nested) multipart object.

The inner multipart object has all of the content objects that are part of the MMS message. One content objects within this MIME multipart could be SMIL, one or more could be text, one or more could be images, one or more could be video.

If MM7 and MIME multipart is confusing you ... you don't have to use MM7.

There is a proprietary URL interface in NowSMS that is described here:

http://www.nowsms.com/documentation/ProductDocumentation/mms_notifications_and_c ontent/Submitting_MMS_Messages_URL.htm

And here's an example of using that interface from a PHP script:

http://blog.nowsms.com/2008/11/nowsms-php-example-send-mms-message.html

And even simpler ... here is a command line script that can be used to send MMS:

http://blog.nowsms.com/2007/07/sending-mms-from-command-line.html

-bn