Wireless Messaging API SMS port

Wireless Messaging API SMS port SearchSearch

SMS & MMS Technical Forum » NowSMS Support - SMS Issues (Product Support Only) » Archive through May 12, 2004 » Wireless Messaging API SMS port « Previous || Next »
Author Message
Jonathan
Unregistered guest
Posted on Tuesday, January 06, 2004 - 07:30 am:   

There is a thing called "SMS port" as described in http://www-106.ibm.com/developerworks/java/library/wi-p2pmsg/ and I am trying to SEND to this specific port on SMS using NowSMS. Is there a way to do this? We are successful for peer-to-peer send and receive. We would like to send SMS to a specific SMS port using NowSMS to the mobile phone.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1517
Registered: 10-2002
Posted on Tuesday, January 06, 2004 - 06:28 pm:   

Hi Jonathan,

I don't have any experiencing using that J2ME API, however I would expect that it uses the standard approach for SMS port addressing.

Send a binary message, specify a user data header (UDH) of:

060504xxxxyyyy

Where xxxx is the destination port in hex, and yyyy is the source port in hex. (If the source port is not important, replace it with 0's.)

However, next comes a challenge.

I'm not sure what this Wireless Messaging API expects for the message content. That is, if a text message is being sent, is the text message 7-bit packed?

When you send a binary message with NowSMS, we require that after the UDH, the message data be in binary format (hex string), rather than text.

So the question is, say you wanted to send the message "test" ... to port 3333. The UDH would be 06050433333333 (I set the destination and source ports to 3333).

But how does the API expect the text to be encoded?

If you set the DCS to 8, you could send the text in Unicode format, specifying a string of 0074006500730074 (Unicode hex string representation of "text").

Or you could set the DCS to 4, and specify a string of 74657374 as the message data (hex string for 8 bit encoding of "text").

Those approaches would probably work. The default DCS of 0, however, expects a packed 7-bit encoding. In this case, the string would be F4F29C0E ... but it is too difficult to explain how I calculated this. (I had one of our engineers modify NowSMS so that you could mix UDH with a text message, and this was the encoding that this new version of NowSMS produced for a message with the UDH that I mentioned above.)

So, I've rambled a bit, but try the following ... (assuming a destination port of 3333)

Message #1:

UDH=06050433333333
Data=0074006500730074
DCS=8

Message #2:
UDH=06050433333333
Data=74657374
DCS=4

Message #3:

UDH=06050433333333
Data=F4F29C0E
DCS=0




-bn
Jonathan
Unregistered guest
Posted on Wednesday, January 07, 2004 - 12:58 am:   

Dear Bryce, You are DA man! The message fomat #3 worked. Now we can interact between Java app and NowSMS. One thing though. Could you explain how to get the packed 7-bit data from the text?

One more thing.. 06050433333333 should be 0605040D05 for the UDH.

Thank you for your help.
Jonathan
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1530
Registered: 10-2002
Posted on Wednesday, January 07, 2004 - 04:06 pm:   

Hi Jonathan,

The UDH is going to vary based upon the port that you want to interact with. However, as several of the fields in the UDH are length related, you should not shorten it. (The first byte, 06 is a length parameter of the overall UDH, and the third byte, 04 is a length for that particular field.)

7-bit packing is a bit difficult. I didn't calculate it manually myself ... instead, I used an update to NowSMS, and then extracted the data from the log file. The packing algorithm is defined in the ETSI GSM 03.38 specification.

The update can be downloaded at http://www.nowsms.com/download/nowsms5-patch4a.zip.

In this update, if you include a UDH, NowSMS will analyse the Text or Data parameter. If it is a hex string, then NowSMS will send it as a binary message. If it is not a hex string, then NowSMS will perform the 7-bit packing to send out the message.

-bn
Jonathan
Unregistered guest
Posted on Thursday, January 08, 2004 - 01:19 am:   

Great! Thank you very much for your help. This will work out well.
James
Unregistered guest
Posted on Sunday, February 01, 2004 - 09:43 am:   

Hi Guys,

We are looking for a way to send and SMS from a gateway to mobile phones which have applications listening on particular port, does now SMS support this? The above seems to be pure pier to pier, what we need is gateway-phone:port.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1772
Registered: 10-2002
Posted on Monday, February 02, 2004 - 07:09 pm:   

Hi James,

You're in the right place, the above example is sending a message to a specific port.

In particular, focus on the following part of the explanation:


quote:

Send a binary message, specify a user data header (UDH) of:

060504xxxxyyyy

Where xxxx is the destination port in hex, and yyyy is the source port in hex. (If the source port is not important, replace it with 0's.)




Even if the source port is not needed for your application, you do have to specify it.

Note that the patch referenced above is built into the v5.01 release of NowSMS, so it simplifies the process of sending a text message to a particular port. If you include a UDH, NowSMS will analyse the Text or Data parameter. If it is a hex string, then NowSMS will send it as a binary message. If it is not a hex string, then NowSMS will perform the 7-bit packing to send out the message.

-bn
Anonymous
 
Posted on Friday, March 05, 2004 - 10:42 pm:   

This is great info, but I wonder if you can tell me how to supply the destination port via SMPP?

I tried just including the optional parameter "destination_port" in the Submit message to the NowSMS SMSC, but the SMS message always ends up just going to my phone's text message inbox, not to my application.

When I send a binary message through the web interface to NowSMS and supply the User Data Header to indicate my target port, it DOES launch my application on my phone.

Are there additional params I need to be including in my SMPP message other than just destination_port?
Anonymous
 
Posted on Saturday, March 06, 2004 - 01:46 pm:   

Hi,
I have the same issue. My j2me application sends a SMS, then nowsms will execute a command and send a response using the 2-way function. Basically the only way i can read the response through my application is if a my port number(6222) is defined when sending.
How is this done??????

Thanks
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1992
Registered: 10-2002
Posted on Tuesday, March 09, 2004 - 02:01 pm:   


quote:

This is great info, but I wonder if you can tell me how to supply the destination port via SMPP?

I tried just including the optional parameter "destination_port" in the Submit message to the NowSMS SMSC, but the SMS message always ends up just going to my phone's text message inbox, not to my application.




NowSMS (and many other SMPP servers) don't support the "destination_port" optional parameter.

Basically, what you want to do is build the UDH (user data header) that includes the port (just like you do when you submit via the web interface). Include this UDH as the start of the "short_message" parameter (with any data following it), and set the "esm_class" to 0x40 to indicate that UDH is present.

We are adding support for the "source_port" and "destination_port" optional parameters in the next release, but since you already know how to create the UDH for sending via the web interface, this approach should work for you with the current release.

-bn
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1993
Registered: 10-2002
Posted on Tuesday, March 09, 2004 - 02:05 pm:   


quote:

I have the same issue. My j2me application sends a SMS, then nowsms will execute a command and send a response using the 2-way function. Basically the only way i can read the response through my application is if a my port number(6222) is defined when sending.
How is this done??????




Make sure that you are using NowSMS v5.01 or later (v5.01 is the current download on the web site at the time of this message posting).

Submit the message to NowSMS with a UDH parameter of 06050462226222 (I'm assuming that 6222 is a hex port number, if it is decimal change this to 060504184E184E).

Since you are sending the message in response to a 2-way command, this can be a little tricky. The 2-way facility assumes that a reply is going to be in text format, but this type of response requires binary encoding. To send a binary message in response to a 2-way command, see the information at the following link:

http://www.nowsms.com/support/bulletins/tb-nowsms-003.htm

-bn

Anonymous
 
Posted on Tuesday, March 09, 2004 - 04:07 pm:   

Bryce, thanks for your quick reply about setting the destination port by building the User Data Header and setting the esme_class. That works fine.

I also found that in order for my text to be read correctly by an application on a J2ME phone I had to use UCS2 encoding for the User Data ( and convert the String I want to send into a byte array like so: byte[] myBytes = myString.getBytes("UTF-16BE"); ).
Anonymous
 
Posted on Tuesday, March 09, 2004 - 04:52 pm:   

How do you send this binary SMS including the UDH,
through a URL?
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2015
Registered: 10-2002
Posted on Tuesday, March 09, 2004 - 05:43 pm:   


quote:

I also found that in order for my text to be read correctly by an application on a J2ME phone I had to use UCS2 encoding for the User Data ( and convert the String I want to send into a byte array like so: byte[] myBytes = myString.getBytes("UTF-16BE"); ).




Interesting. That is not consistent with Jonathan's results earlier in this thread. (Above Message #1 used UCS2, Message #2 used 8-bit, Message #3 used GSM 7-bit packing.)

7-bit packing is a bit tough when UDH is included. That's why in v5.01 we added automatic detection in NowSMS to determine whether the "text/data" parameter included a text string or a string of hex characters.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2016
Registered: 10-2002
Posted on Tuesday, March 09, 2004 - 05:44 pm:   


quote:

How do you send this binary SMS including the UDH, through a URL?




We're talking about using NowSMS, right?

Here are the links to the URL formats:

http://www.nowsms.com/documentation/ProductDocumentation/sending_messages/sendin g_binary_messages.htm

http://www.nowsms.com/documentation/ProductDocumentation/sending_messages/url_pa rameters_for_sending_messages.htm
Anonymous
 
Posted on Thursday, March 11, 2004 - 06:36 am:   

how can i send multiple sms from my web application.can anybody help me.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2075
Registered: 10-2002
Posted on Thursday, March 11, 2004 - 05:07 pm:   


quote:

how can i send multiple sms from my web application.can anybody help me.




Using the Now SMS/MMS Gateway, your application issues HTTP requests to the gateway to send messages.

This is described in the following links:

http://www.nowsms.com/documentation/ProductDocumentation/sending_messages/sendin g_text_messages.htm

http://www.nowsms.com/documentation/ProductDocumentation/sending_messages/url_pa rameters_for_sending_messages.htm

Routing received messages to your web application is described in the following links:

http://www.nowsms.com/documentation/ProductDocumentation/2_way_sms_support.htm

http://www.nowsms.com/support/bulletins/tb-nowsms-003.htm


NowSMS is middleware software for connecting to SMS and MMS networks, and performing SMS message formatting tasks. It is not a bulk SMS service, nor is it a replacement for an SMS service provider.

You cannot actually send any messages from the Now SMS/MMS Gateway without a connecting to an SMS service provider, or a GSM modem:

http://www.nowsms.com/support/faq.htm#WhatdoIneedtoinstallyoursoftware

If your question is not related to the Now SMS/MMS Gateway product, then for general information on SMS and MMS technologies, please see the following:

http://support.nowsms.com/discus/messages/1/3257.html
Karla Reyes
Unregistered guest
Posted on Thursday, March 18, 2004 - 06:42 am:   

hi,

i am developing a j2me application which can view open office email attachments on a mobile phone. i am using jwsdp1.3 as my server, apache james as a mail server and sun one studio for j2me. i am connecting to an imap store to view my inbox folder on my webmail.

i have tested my application only with the j2me toolkit.

how can i connect the gateway with my application and with the server?

how can i configure nowsms as a gateway to test it on a real gsm phone? how will i configure the gateway to "log-in and view my inbox" from the gsm phone?


thanks..}
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2168
Registered: 10-2002
Posted on Thursday, March 18, 2004 - 07:54 pm:   

Duplicate. Last question also posted here: http://support.nowsms.com/discus/messages/1/2409.html

I'm sorry, but I don't understand how NowSMS fits into your configuration, and what you are trying to do with NowSMS. Please clarify.
Anonymous
 
Posted on Thursday, March 25, 2004 - 06:33 pm:   

From the NowSMS web interface, there are 3 fields for the SMS message:
(1). Phone Number
(2). Text
(3). Message type

In which field, should the user specify a user data header (UDH), such as 060504xxxyyyy.

Assuming I try to send an SMS to a phone with the phone number as 9876543210, with the following data "test SMS message" to a destination port 3333. In which field, should the user mix UDH and with the text? How can we indicate which part is for the UDH, Data and DCS?

Anonymous
 
Posted on Thursday, March 25, 2004 - 06:35 pm:   

From the NowSMS web interface, there are 3 fields for the SMS message:
(1). Phone Number
(2). Text
(3). Message type

In which field, should the user specify a user data header (UDH), such as 060504xxxyyyy.

Assuming I try to send an SMS to a phone with the phone number as 9876543210, with the following data "test SMS message" to a destination port 3333. In which field, should the user mix UDH and with the text? How can we indicate which part is for the UDH, Data and DCS?

Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2223
Registered: 10-2002
Posted on Monday, March 29, 2004 - 06:47 pm:   

If you are submitting the message through the web form, you would use the "Send Binary Message Other" form.

This form has a separate field for "UDH".

Specify your text in the "Binary Data" field. (NowSMS will auto-detect that this is text instead of a hex string of data.)

Leave the PID and DCS as blank, unless you are converting the text to a binary encoding before submitting.

-bn
Anonymous
 
Posted on Thursday, April 01, 2004 - 07:47 am:   

i want the source of a smpp C library on sco unixware7.1.
can you provide me with the link where i can get it
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2234
Registered: 10-2002
Posted on Thursday, April 01, 2004 - 05:30 pm:   


quote:

i want the source of a smpp C library on sco unixware7.1.
can you provide me with the link where i can get it




Sorry, no I cannot.

You can find some tools at http://www.smpp.org and http://opensmpp.logica.com. But I don't know of C libraries.
Peter Thompson
New member
Username: Ee8prt

Post Number: 6
Registered: 03-2004
Posted on Tuesday, April 20, 2004 - 01:00 pm:   

hi,

I've tried the various encoding schemes presented here, but my J2ME client still displays the text incorectly.

The closest I got was it displaying 'est' using the 1st. and 2nd enconding schemes suggested.
using the 3rd scheme (7-bit packing) I just got strange characters. (when trying to send the string 'text' as suggested)

Could anyone suggest something here?


thanks,


Pete
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2319
Registered: 10-2002
Posted on Tuesday, April 20, 2004 - 06:49 pm:   

Hi Pete,

I wonder if different J2ME clients have different issues in the type of encoding that they can support. I don't have enough experience in this area to comment.

In any event, it sounds like you're losing the first character of the message in the 1st and 2nd encoding schemes. (That is a typo in the earlier message ... the text string being sent out is "test", not "text".)

It sounds like something is off in the UDH you are submitting ... and that is throwing things off by a byte (which will seriously confuse 7-bit packed text).

Are you submitting through NowSMS? If so, to what type of SMSC?

-bn
Peter Thompson
New member
Username: Ee8prt

Post Number: 7
Registered: 03-2004
Posted on Wednesday, April 21, 2004 - 06:03 am:   

Hi,

I was using a Nokia D211 card, but tried a Ericsson T68 as the SMSC connection and it doesn't seem to loose the first letter.

Strange :-)


Pete
Govind
Unregistered guest
Posted on Wednesday, April 21, 2004 - 02:17 pm:   

How can I read a SMS ( or file) by J2ME API.Exact requirement is I have received some date via SMS (or file)on my mobile,now I want to read this data sent in the SMS (or file) from my J2ME application.
Govind
Unregistered guest
Posted on Wednesday, April 21, 2004 - 02:19 pm:   

How can I read a SMS(or file) by J2ME API.Exact requirement is,I have received some data via SMS (or file)on my mobile, now I want to read this data sent in the SMS (or file) from my J2ME application.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2351
Registered: 10-2002
Posted on Thursday, April 22, 2004 - 03:02 pm:   

Pete,

That is very interesting. Nokia makes some very good products, but something about that D211 is just not right. (I've been biased against it, because it does not allow an application to receive SMS messages over the GSM modem interface.)

I'm glad to hear that it is working for you now with the T68.

-bn
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2352
Registered: 10-2002
Posted on Thursday, April 22, 2004 - 03:07 pm:   

Hi Govind,

My understanding is that the J2ME API only allows your application to receive SMS messages that are addressed to a particular port.

The application cannot process any arbitrary received message, only ones that are sent to the port number of the application.

Using NowSMS v5.01 or later, the following technique can be used to send a message to a specific port.

Send a binary message, specify a user data header (UDH) of:

060504xxxxyyyy

Where xxxx is the destination port in hex, and yyyy is the source port in hex. (If the source port is not important, replace it with 0's.)

In the "Binary Data" field, specify the text of your message (and NowSMS will automatically convert it to the appropriate binary format for sending).

To submit it via a URL directly (instead of via the form), you would issue the following:

http://serverip:port/?phone=phonenum&udh=06050433330000&text=this+is+a+test

The above example sends a message to port 3333 (hex value, decimal value = 13107). The source port is 0.

The text of the message is "this is a test", it has just been URL escaped for encoding in a URL.

-bn

Topics Topics Search Last 30 Days Login Login / Register Logout Logout