I can send mms notification via sms, but only valid in NOKIA7650 AN...

I can send mms notification via sms, but only valid in NOKIA7650 AN... SearchSearch
Author Message
Anonymous
 
Posted on Sunday, February 01, 2004 - 02:09 pm:   

I can I can send mms notification via sms,but the problem is that only Nokia 7650 and 3650 whose operating system is symbian can reach the correct url to download my mms file,other mobile types shows download error and I find they(other mobile types) can't find the correct url address in mms notification,can anyone tell me what's wrong with my code, it's written in java:
public class MMSNotify {

public static String GetUrlASCII(String url) {

char[] c = url.toCharArray();

String res="";

for (int i = 0; i < url.length(); i ++ ) {
res += Integer.toHexString((int)(c[i]));
}

return res.toUpperCase();
}

public static String GetSubjectASCII(String subject) {

byte[] c = null;

try{
c = subject.getBytes("UTF8");
} catch(Exception e) {
e.printStackTrace();
}

String res = "";

for (int i = 0; i < c.length; i ++ ) {
if (c[i] < 128 && c[i] > 0) {
res += Integer.toHexString(c[i]);
} else {
res += Integer.toHexString(c[i]).substring(6);
}
}

return res.toUpperCase();
}

public static int makeMMSNotify(String subject,String url,char[] out) {

String mmsHead = "0605040B8423F00006226170706C69636174696F6E2F766E642E7761702E6D6D732D6D657373616 76500AF848C829861008D9096";

String mmsMiddle = "EA7F";

String mmsTail = "8A808E011E880681043DD9D6F383";


subject=GetSubjectASCII(subject);

url=GetUrlASCII(url);

int ilensubject = (subject.length()/2 + 1 + 2);
if (ilensubject < 16) {
mmsHead = mmsHead + "0";
}

mmsHead = mmsHead + Integer.toHexString(ilensubject) + mmsMiddle;
mmsHead = mmsHead + subject + "00";
mmsHead = mmsHead + mmsTail;

char[] sASCII = (mmsHead + url).toCharArray();
int ilen = (mmsHead + url).length();
int i = 0;
byte j = 0;
char ibyte = 0;

for(i = 0;i < ilen; i = i + 2) {
if(sASCII[i] >= (char)('0') && sASCII[i] <= (char)('9'))
ibyte = (char)(sASCII[i] - '0');
if(sASCII[i] >= (char)('A') && sASCII[i] <= (char)('F'))
ibyte = (char)(sASCII[i] - 'A' + 10);
out[j] = (char)(ibyte << 4);
if(sASCII[i + 1] >= (char)('0') && sASCII[i + 1] <= (char)('9'))
ibyte = (char)(sASCII[i + 1] - '0');
if(sASCII[i + 1] >= (char)('A') && sASCII[i + 1] <= (char)('F'))
ibyte = (char)(sASCII[i + 1] - 'A' + 10);
out[j] += ibyte;
j++;
}
out[j] = (char)0;
return (int)(j + 1);
}
}
3x.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1784
Registered: 10-2002
Posted on Monday, February 02, 2004 - 08:17 pm:   

Sorry, I don't have time to analyse your code. But I would suggest that you compare the output of your code to the MMS notification in the following example:

http://support.nowsms.com/discus/messages/12/2411.html

However, it sounds like the phone is actually receiving the notification ... so there may not be anything wrong with your notification format. It may instead be that either the MMS settings on the other mobile phones are not configured correctly, or the default MMS settings for the mobile operator block message delivery from external MMSCs (which is quite common).
-bn