SMSJ
by Jean-Marc Autexier, October 2004


Index


Features


Installation

I assume you have java installed on your system and java.exe is in the path. If not, edit smsj.vbs with your preffered editor and change the „cmdline“ in order to access your javaw.exe.
This application use the folowing third party libs:

Versions

V0.0.2 (02.10.2004) – download  V0.0.1 (01.10.2004) initial version - download

Screenshots

Main frame

Configuration dialog


Status dialog




Theory

I had to do some changes to jsmsengine. Here is the description:

There is no way to manipulate each bit of the  first octect. You can find a description of the first octet here.

Bit no 7 6 5 4 3 2 1 0
Name TP-RP TP-UDHI TP-SRR TP-VPF TP-VPF TP-RD TP-MTI TP-MTI

Anr interesing bit is TP-SRR (Status report request). When set, you will get a SMS back when it has been delivered). The answer-SMS will have the field TP-SRI set in the first octet. One can use the message number or a text in user data to correlate both SMS.

Bit no 7 6 5 4 3 2 1 0
Name TP-RP TP-UDHI TP-SRI (unused) (unused) TP-MMS TP-MTI TP-MTI

Here is some sample code of jsmsengine changes.
public class CMessage
{
// Some constants to allow setting of bits
public static final int MESSAGE_ENCODING_7BIT = 1;
public static final int MESSAGE_ENCODING_8BIT = 2;
public static final int MESSAGE_ENCODING_UNICODE = 3;

public static final int TYPE_INCOMING = 1;
public static final int TYPE_OUTGOING = 2;

// SC->MS direction
public static final String TYPE_SMS_DELIVER = "00";
public static final String TYPE_SMS_STATUS_REPORT = "10";
public static final String TYPE_SMS_SUBMIT_REPORT = "01";
public static final String TYPE_RESERVED = "11";

// MS->SC direction
public static final String TYPE_SMS_DELIVER_REPORT = "00";
public static final String TYPE_SMS_COMMAND = "10";
public static final String TYPE_SMS_SUBMIT = "01";

// VALIDITY
public static final String VPF_NO = "00";
public static final String VPF_RELATIVE = "10";
public static final String VPF_ENHANCED = "01";
public static final String VPF_ABSOLUT = "11";


protected String protocolType = "00";

// The first octect
protected BitSet tpOctet = new BitSet();

/**
* Get the defined protocol type.
*
*/
public String getProtocolType()
{
return protocolType;
}

/**
* Set protocol type for this message.
* for now this just set the String as protocol type as I don't know all protocol types.
* Later on, constants may be available
*
* @param protocolType The protocoltype, standard is "00".
*/
public void setProtocolType(String protocolType)
{
this.protocolType = protocolType;
}

/**
* Set replayPath (TP-RP) bit in first octet. TP-RP says if a reply is requested
* from the receiving mobile station.
*
* @param bool set or unset replay path bit
*/
public void setReplayPath(boolean bool)
{
if ( bool)
tpOctet.set(7);
else
tpOctet.clear(7);
}

/**
* Return replay path bit
**/
public boolean isReplayPath()
{
return tpOctet.get(7);
}

/**
* Set TP-UDHI bit. Describes what the User Data field will contain.
* - 1 the User Data field contain a User Data Header in addition to the short message
* - 0 UDHI contains just the short message.
* See user data field (not yet implemented)
*
* @param bool set or unset UDHI field
*/
public void setUserDataHeaderIndicator(boolean bool)
{
if ( bool)
tpOctet.set(6);
else
tpOctet.clear(6);
}

/**
* Return value of UDHI bit
**/
public boolean isUserDataHeaderIndicator()
{
return tpOctet.get(6);
}

/**
* Set the status report bit. Basically requests another type of SMS to be
* returned to the Mobile after the SMS-SUBMIT is sent to the Service Centre.
*
* @param bool set or unset status report field
*/
public void setStatusReport(boolean bool) {
if (bool)
tpOctet.set(5);
else
tpOctet.clear(5);
}

/**
* return value of status report bit
*
* @return
*/
public boolean isStatusReport()
{
return tpOctet.get(5);
}

}
COutgoingMessage and CIncomingMessage have been changed similary to allow setting and extraction of forst octect bits.
One can download modified classes here: CMessage, COutgoingMessage, CIncomingMessage.


Some technical stuff

I will write here things I learned during development:
Lasr change June 2005