×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    10

    MIDlet, pdu, sms and gsm modem...

    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
    Last edited by fwoehl; 2005-11-22 at 18:55. Reason: update

  2. #2
    Regular Contributor
    Join Date
    Oct 2005
    Location
    London, UK
    Posts
    235

    Re: MIDlet, pdu, sms and gsm modem...

    Ok let me get this straight, your pc is sending the sms out on port 16666 and your phone is listening on port 3333?? They need to be the same port number, phone should listen to same port pc sends message with.

    Viru Doshi
    ~ No Style Without Substance ~

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    10

    Re: MIDlet, pdu, sms and gsm modem...

    Quote Originally Posted by ViruDoshi
    Ok let me get this straight, your pc is sending the sms out on port 16666 and your phone is listening on port 3333?? They need to be the same port number, phone should listen to same port pc sends message with.

    Viru Doshi
    I apologize...In fact I made some tests with port 3333 and port 16666, this is only a paste error in the post...

    In addition: If I try to dynamicaly allocate the port in the MIDlet the result is the same...

    FRED

  4. #4
    Registered User
    Join Date
    Jul 2008
    Posts
    2

    Re: MIDlet, pdu, sms and gsm modem...

    Hi,
    May I ask a same question,
    What is the function of source port? and why is it usually 0000?
    tanx.

  5. #5
    Registered User
    Join Date
    Feb 2009
    Posts
    6

    Re: MIDlet, pdu, sms and gsm modem...

    It seems to me that the function of the source port is useful in the case where the sender expects a reply. The source port should correspond to a port the sender is listening on.

    Regards,
    Jeroen
    Sending out an SMS

Similar Threads

  1. Replies: 1
    Last Post: 2007-02-09, 12:21
  2. Receiving SMS from GSM Modem
    By ghostxp in forum General Messaging
    Replies: 3
    Last Post: 2006-01-05, 19:57
  3. Sending PDU SMS with port for Midlet
    By fwoehl in forum General Messaging
    Replies: 1
    Last Post: 2005-11-21, 17:29
  4. Replies: 1
    Last Post: 2002-10-31, 11:35
  5. Replies: 2
    Last Post: 2002-06-17, 09:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×