To send sms to a specific port number ( eg: port in your j2me application ) you have to add following extra parameter to kannel send sms url
which will specify the User Data Header of the sms. For example following url will send the sms to port 6579
http://127.0.0.1:13013/cgi-bin/sendsms?username=[kannel user]&password=[kannel passwd]&to=[to phone number]&text=[message text]&udh=%06%05%04%19%B3
As you can see udh is a url-encoded string and it have a standard format as follows;
[how long the UDH is] [the format used to specify ports numbers] [the port number length] [destination port number] [source port number]
As a practical example, say I want to create a UDH to send a sms to port 2948, the UDH will be:
06 05 04 0B 84 23 F0 -> 06%05%04%0B%84%23%F0
* 06 means "hey read the following 6 bytes"
* 05 is the format for numbers, in this case hexadecimal numbers
* 04 will tell the UDH that each port is represented using 4 character
* 0B84 is the destination port in hexadecimal, 2948 (decimal representation)
* 23F0 is the source port in hexadecimal, 9200 (decimal representation) or 23F0 (hexadecimal representation).
You have to keep in mind that after adding udh to the url, sms will be transfred as a binary messaage.