RingTones over SMPP

RingTones over SMPP SearchSearch
Author Message
Antoine Megalla
Posted on Saturday, June 14, 2003 - 09:42 pm:   

I have been trying to send RingTones using the "now SMS" SMPP interface with no luck for a while now.

I am using a GSM through a COM port as my SMSC.
I managed to send text messages successfully, but not the ringtones (or any other binary message).

I am using Logica SMPP API in my connection.

Here is the the code I am using:

private void ringToneTest()
{
// let's assume that the session is already created
// and the application is already bound to the smsc
// we'll send the data as submit_sm PDU
try
{

SubmitSM request = new SubmitSM();

// set the source and destination phone numbers
request.setSourceAddr("0121111111");
request.setDestAddr("+20122222222");

request.setProtocolId((byte) 0);

// create a buffer for the message payload
ByteBuffer message = new ByteBuffer();

// UDH is needed to tell the mobile phone details
// how to deliver the data in the message payload
// first goes UDH length -- this UDH will have 6 bytes
message.appendByte((byte)6);

// then goes IE -- information element
// IE Identifier -- 5 means that the following will
// be destination and originator port numbers
message.appendByte((byte)5);

// IE Data Length -- the length of the IE
// two ports per two bytes = 4
message.appendByte((byte)4);

// the destination port -- port where ringing tone is received
// on Nokia phones
message.appendShort((short)0x1581);

// originator port (unused in fact)
message.appendShort((short)0x1581);

ByteBuffer toneData = loadByteBuffer("c:/test.ott");

// simply append the ring tone data to the message payload
message.appendBuffer(toneData);

// we send all the data as a message payload

request.setMessagePayload(message);

request.setEsmClass((byte)(Data.SM_UDH_GSM));

// the coding is GSM specific
request.setDataCoding((byte)0x0f5);



SubmitSMResp response;

System.out.println("ring tone request " + request.debugString());

response = session.submit(request);


}
catch (Exception e)
{
e.printStackTrace();
}

}

public ByteBuffer loadByteBuffer(String fileName)
throws FileNotFoundException,IOException
{
FileInputStream is = new FileInputStream(fileName);
byte[] data = new byte[is.available()];
is.read(data);
is.close();
return new ByteBuffer(data);
}


I am using a data coding value of 0xF5, and I set the UDH to true (values 0x40) with data "06050415811581", I put the ringtone data in the message payload.

I get no errors from the "now SMS" gateway, but the message never gets delivered to my Nokia mobile phone.

Can you please help me on that issue.

Thank you and best regards.
Kent Williams
Posted on Monday, June 16, 2003 - 03:35 am:   

Antoine,

Without actually seeing the SMPP packet that gets generated, that all looks correct to me.

I would suggest putting NowSMS into debug mode so that we can see the SMPP packet that is actually generated by that code.

To do this, manually edit SMSGW.INI. Under the [SMSGW] section header, add Debug=Yes. Then restart the NowSMS gateway service.

Repeat your message submission.

Then we would like to see the information that is displayed in the SMPPDEBUG.LOG and the SMSDEBUG.LOG.

You can either post the information here, or send the files via e-mail to nowsms@now.co.uk.

- Kent Williams
Now Wireless Support