SMS pdu and MIDLet

Login to reply to this topic.
Tue, 2005-11-22 19:37
Joined: 2005-11-22
Forum posts: 2
Hi,

I have some questions (and some trouble) about Wireless Messaging..

On one side I have a MIDlet running on a NOKIA Serie 40 2nd edition which send
sms to a server using a code like :

try {
   String addr = "sms://+2215461418" ;
   MessageConnection conn = ( MessageConnection )Connector.open( addr ) ;
   TextMessage msg = ( TextMessage )conn.newMessage( MessageConnection.TEXT_MESSAGE ) ;
   msg.setPayloadText( toSend ) ;
   conn.send( msg ) ;
   conn.close( ) ;
} catch( Exception e ) {
   e.printStackTrace( ) ;
}

On the other side, I receive (correctly) the SMS on a PC with a Siemens TC45 GSM Modem using AT commands in a java servlet...
Then, the PC need to send SMS to the MIDLet, so I need to use a port for the destination.
Using AT command and PDU coding with mt TC45, I send a PDU like :

0051000781255535F30000AA0A060504411A0000CF25

where 060504411A0000 means destination port 16666

When I send this PDU the MIDlet is supposed to receive it using a code like :

protected void startApp( ) {
...
   try {
      smsconn = ( MessageConnection )Connector.open( "sms://:16666" ) ;
           smsconn.setMessageListener( this ) ;
   } catch( Exception e ) {
      e.printStackTrace( ) ;
   }
...
}

public void notifyIncomingMessage( MessageConnection conn ) {
       try {
          Message m = smsconn.receive( ) ;
      ...
}

For information the JAD looks like :
MIDlet-Name: FREDMidlet
MIDlet-Version: 1.0
MIDlet-Vendor: FRED
MicroEdition-Profile: MIDP-2.0
MicroEdition-Configuration: CLDC-1.0
MIDlet-Jar-URL: FRED.jar
MIDlet-Jar-Size: 22753
MIDlet-Icon: /icone.gif
MIDlet-Push-1: sms://:16666, FREDMidlet, *
MIDlet-Permissions: javax.microedition.io.Connector.sms, javax.wireless.messaging.sms.send, javax.wireless.messaging.sms.receive
MIDlet-1: FREDMidlet, /icone.gif, FREDMidlet
   
The problem is the MIDlet never receive the SMS.
For information, if I change the PDU to :

0051000781255535F30000AA0A06050415810000CF25

where 06050415810000 means destination port 5505 which is the 'ringtones supply' port. In this case, the phone corectly
receive the notification of incomming ringtone, which means (for me) the sended pdu is good, so the problem is on the MIDlet side...

For information I try to take a look at the PushRegistry and try PushRegistry.listConnections( true ) the result is always null
because the MIDlet had never been setup for wake on receive... If try PushRegistry.listConnections( false ) I have the only entry "sms://:16666"

Q: Is an operator can filter ports to not allow other ports than well-known one ?
Q: Is my architecture right ?
Q: If the MIDLet send the SMS on a destination port, how the TC45 receive it ?
Q: What is the fonction of the 'source port' in PDU ? (except for information...)
Q: Any suggestions?

TIA
FRED


Thu, 2005-11-24 13:08
Joined: 2005-08-29
Forum posts: 30
Re: SMS pdu and MIDLet
HI!
u it self solve the proble, means when you send sms on the port number 5505 then sms received.
This is the correct port number so this message received.
you can use 50000 and above port number for sucessfully communication because less then 50000 port number are reserved.
ok
by
kk
Fri, 2005-11-25 17:32
Joined: 2005-11-22
Forum posts: 2
Re: SMS pdu and MIDLet
Hi,
Tanks for the answer,

I readed than :
The port numbers ranges from 0 to 65535 and are allocated for various purposes as follows;
VALUE   ALLOCATED
0-15999   As allocated by IANA (http://www.IANA.com/)
16000-16999   Available for allocation by applications
17000-65535   Reserved

This is because I use port 16666 bur I will try with 50111 for exemple this afteroom...

Thanks again,
FRED

  • Login to reply to this topic.