Hi Johan,

 

I’m trying to send an SMS from our Vodacom SMS gateway to a Sony Ericsson K750 with my Midlet installed.

Our gateway seems to reject messages with this format: <msisdn>:<port>

 

Enrico

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Johan Meyer
Sent: 16 November 2005 01:47 PM
To: [email protected]
Subject: [CTJUG Forum] Re: MIDP 2.0 Push Registry

 

Ok you managed to confuse me. Do you want to know how to send a SMS from the phone to a specific port on another phone using J2ME? If yes this example will show you how to do that. So if you want to send a sms to port 1234 on the mobile phone with number +0831234567 you will do the following:

 

String destination = “+0831234567:1234”;

 

Then send it. See the examples mentioned in previous email.

 

BUT

 

If you want to know how to do this from your SMS gateway you will have to tell me what gateway you are using. I know Saicom is using the TC45 or soes development for the TC45 so see the TC45_ATC_v0100a.pdf  document.

 

Hope this helps


From: [email protected] [mailto:[email protected]] On Behalf Of Enrico Goosen
Sent: Wednesday, November 16, 2005 1:26 PM
To: [email protected]
Subject: [CTJUG Forum] Re: MIDP 2.0 Push Registry

 

Hi Johan,

 

I’m not interested in how to listen for an SMS on a specific port.

I need to know how to send an SMS to a phone’s specific port.

My JAD file includes an entry for starting my Midlet when an SMS arrives on a specific port.

So the AMS should startup my Midlet, then it’s the Midlets responsibility to deal with the SMS or not.

We have an SMS gateway, but I don’t know how to send an SMS to a msisdn+port?

 

Regards,

Enrico


From: [email protected] [mailto:[email protected]] On Behalf Of Johan Meyer
Sent: 16 November 2005 01:12 PM
To: [email protected]
Subject: [CTJUG Forum] Re: MIDP 2.0 Push Registry

 

Hello

Take a look at the examples in the WTK2.2 installations. They have got an SMS send examples which shows you how to set the port and the reveiving sms number. Its basically     number:port

 

But the example will explain it better.

 

Some code from the SMSSender.java class:

 

        String address = destinationAddress + ":" + smsPort;

          

        MessageConnection smsconn = null;

        try {

            /** Open the message connection. */

            smsconn = (MessageConnection)Connector.open(address);

 

            TextMessage txtmessage = (TextMessage)smsconn.newMessage(MessageConnection.TEXT_MESSAGE);

            txtmessage.setAddress(address);

            txtmessage.setPayloadText(messageBox.getString());

            smsconn.send(txtmessage);

 

Johan

 


From: [email protected] [mailto:[email protected]] On Behalf Of Enrico Goosen
Sent: Wednesday, November 16, 2005 12:16 PM
To: [email protected]
Subject: [CTJUG Forum] Re: MIDP 2.0 Push Registry

 

Hi Johan (or anyone else in this forum),

 

How can I send an SMS to a specific port on a mobile phone?

I’ve added a Push Registry entry into my JAD file to autostart my Midlet on receipt of an SMS on port 5003.

MIDlet-Push-1: sms://:5003,hello.Main,*

 

In case you’re wondering why I’m using a specific port instead of just specifying the sender’s number (msisdn), the Midlet will not install if I specify the number instead of the port.

 

Regards,

Enrico

 

 


From: [email protected] [mailto:[email protected]] On Behalf Of Johan Meyer
Sent: 15 November 2005 03:25 PM
To: [email protected]
Subject: [CTJUG Forum] Re: MIDP 2.0 Push Registry

 

cool

 


From: [email protected] [mailto:[email protected]] On Behalf Of Enrico Goosen
Sent: Tuesday, November 15, 2005 3:22 PM
To: [email protected]
Subject: [CTJUG Forum] Re: MIDP 2.0 Push Registry

 

Hi Johan,

 

I quickly scanned the following article:

http://developers.sun.com/techtopics/mobility/midp/articles/pushreg/

…and it indicates that you can create an inbound connection based on a static address (as you indicated previously)

OR

Based on a dynamic address (system assigned address). See note below.

 

When using a system-assigned address, you must publish this address so that external systems can connect to your application. If you're using a ServerSocketConnection or a UDPDatagramConnection you can get the dynamically assigned address from the getLocalAddress() and getLocalPort() methods. You can also retrieve the hostname assigned to your device, by invoking System.getProperty("microedition.hostname"). To publish the dynamic address on an external system you can simply use HTTP.

 

Push Registry may not suck after all.

Now, I need to see if I can autostart my Midlet so that it can publish its address to the server, without bothering the user.

 

Laterz,

Enrico


From: [email protected] [mailto:[email protected]] On Behalf Of Johan Meyer
Sent: 15 November 2005 02:56 PM
To: [email protected]
Subject: [CTJUG Forum] Re: MIDP 2.0 Push Registry

 

Hello

Yes by the looks of it that is the case. So a plain socket connection will be the easiest.

Johan

 


From: [email protected] [mailto:[email protected]] On Behalf Of Enrico Goosen
Sent: Tuesday, November 15, 2005 2:48 PM
To: [email protected]
Subject: [CTJUG Forum] Re: MIDP 2.0 Push Registry

 

Hi Johan,

 

Are you saying that Push Registry will only work if your phone has a static IP address, which it can publish to the Server?

That sucks.

 

Guess I’ll have to establish a plain old socket connection from the midlet, and let the server route traffic between connected devices.

 

Thanks,

Enrico

 


From: [email protected] [mailto:[email protected]] On Behalf Of Johan Meyer
Sent: 15 November 2005 02:39 PM
To: [email protected]
Subject: [CTJUG Forum] Re: MIDP 2.0 Push Registry

 

Enrico

You cannot do Socket PUSH if you do not have the IP address of the phone. You can contact MTN or Vodacom and chat with them about getting a static IP for your phone. This will cost you x amount of money and would not help you much. It would be useless for a chat application, can’t expect all your users to do this.

 

Getting the phones IP can easily be done by making a connection to the server and the server sending the IP back to the phone. But remember the IP will change every time you make a new GPRS connection. Plus this might not be your true IP.

 

Johan

 


From: [email protected] [mailto:[email protected]] On Behalf Of Enrico Goosen
Sent: Tuesday, November 15, 2005 2:22 PM
To: [email protected]
Subject: [CTJUG Forum] MIDP 2.0 Push Registry

 

Hi all,

 

I’m thinking of writing a mobile chat application using MIDP 2.0 Push Registry, but I have a question.

 

If your Midlet is supposed to startup on receipt of an incoming socket connection, how will you be able to establish a socket connection with a mobile phone if you don’t know its IP address?

Does the Midlet automatically publish its IP address to the Server, when the user switches on the phone?

OR

Must the user start the Midlet, at which point it publishes its IP address to the server?

How do you obtain the phone’s IP address from within the Midlet?

 

Regards,

 

Enrico Goosen

Software Developer

SAICOM TECHNOLOGY

TEL:       +2721 555 0726

FAX:     +2721 555 0821

CEL:     +2783 305 5676

EMAIL: [EMAIL PROTECTED]

 

Reply via email to