Motorola E680 Technical Manual - Page 53

SMS Port Numbers

Page 53 highlights

14 JSR 120 - Wireless Messaging API The MessageConnection can be opened in either server or client mode. A server connection is opened by providing a URL that specifies an identifier (port number) for an application on the local device for incoming messages. (MessageConnection)Connector.open("sms://:6000"); Messages received with this identifier will then be delivered to the application by this connection. A server mode connection can be used for both sending and receiving messages. A client mode connection is opened by providing a URL which points to another device. A client mode connection can only be used for sending messages. (MessageConnection)Connector.open("sms://+441234567890 :6000"); SMS Port Numbers When a port number is present in the address, the TP-User-Data of the SMS will contain a User-Data-Header with the application port addressing scheme information element. When the recipient address does not contain a port number, the TP-User-Data will not contain the application port addressing header. The J2ME MIDlet cannot receive this kind of message, but the SMS will be handled in the usual manner for a standard SMS to the device. When a message identifying a port number is sent from a server type MessageConnection, the originating port number in the message is set to the port number of the MessageConnection. This allows the recipient to send a response to the message that will be received by this MessageConnection. However, when a client type MessageConnection is used for sending a message with a port number, the originating port number is set to an implementation specific value and any possible messages received to this port number are not delivered to the MessageConnection. Please refer to the section A.4.0 and A.6.0 of the JSR 120. When a MIDlet in server mode requests a port number (identifier) to use and it is the first MIDlet to request this identifier it will be allocated. If other applications apply for the same identifier then an IOException will be thrown when an attempt to open MessageConnection is made. If a system application is using this identifier, the MIDlet will not be allocated the identifier. The port numbers allowed for this request are restricted to SMS messages. In addition, a MIDlet is not allowed to send messages to certain restricted ports a SecurityException will be thrown if this is attempted. JSR 120 Section A.6.0 Restricted Ports: 2805, 2923, 2948, 2949, 5502, 5503, 5508, 5511, 5512, 9200, 9201, 9202, 9203, 9207, 49996, 49999. If you intend to use SMSC numbers then please review A.3.0 in the JSR 120 specification. The use of an SMSC would be used if the MIDlet had to determine what recipient number to use. 53

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107

14
JSR 120 – Wireless Messaging API
53
The
MessageConnection
can be opened in either server or client mode. A server
connection is opened by providing a URL that specifies an identifier (port number) for an
application on the local device for incoming messages.
(MessageConnection)Connector.open("sms://:6000");
Messages received with this identifier will then be delivered to the application by this
connection. A server mode connection can be used for both sending and receiving
messages. A client mode connection is opened by providing a URL which points to
another device. A client mode connection can only be used for sending messages.
(MessageConnection)Connector.open("sms://+441234567890
:6000");
SMS Port Numbers
When a port number is present in the address, the TP-User-Data of the SMS will contain
a User-Data-Header with the application port addressing scheme information element.
When the recipient address does not contain a port number, the TP-User-Data will not
contain the application port addressing header. The J2ME MIDlet cannot receive this kind
of message, but the SMS will be handled in the usual manner for a standard SMS to the
device.
When a message identifying a port number is sent from a server type
MessageConnection
, the originating port number in the message is set to the port
number of the
MessageConnection
. This allows the recipient to send a response to
the message that will be received by this
MessageConnection
.
However, when a client type
MessageConnection
is used for sending a message
with a port number, the originating port number is set to an implementation specific value
and any possible messages received to this port number are not delivered to the
MessageConnection
. Please refer to the section A.4.0 and A.6.0 of the JSR 120.
When a MIDlet in server mode requests a port number (identifier) to use and it is the first
MIDlet to request this identifier it will be allocated. If other applications apply for the same
identifier then an
IOException
will be thrown when an attempt to open
MessageConnection
is made. If a system application is using this identifier, the
MIDlet will not be allocated the identifier. The port numbers allowed for this request are
restricted to SMS messages. In addition, a MIDlet is not allowed to send messages to
certain restricted ports a
SecurityException
will be thrown if this is attempted.
JSR 120 Section A.6.0 Restricted Ports:
2805, 2923, 2948, 2949, 5502, 5503, 5508, 5511, 5512, 9200, 9201, 9202, 9203, 9207,
49996, 49999.
If you intend to use SMSC numbers then please review A.3.0 in the JSR 120
specification. The use of an SMSC would be used if the MIDlet had to determine what
recipient number to use.