Java Reference
In-Depth Information
Upon receiving a SIP method or header in the form of a String ,the
translation layer matches it to a single concrete native SIP stack class
or, more likely, to a number of interoperable native classes with an
equivalent target functionality. The native peers instantiate and use the
native SIP stack classes depending on the state and context of the peered
Java object. To optimize the performance, the String parameters are
serialized before they are passed from Java to the native layer. Incoming
data is deserialized before it is passed from native to Java code.
There are also considerable differences in the abstraction details and
implementation idioms. JSR-180 SIP was designed to be generic and
portable over many phones. The abstraction level is very high and, as
a consequence, it does not provide support for various configuration
details of components specific to Symbian OS. For example, SIP user
profiles (which are stored in the phone's memory and can be configured
manually by the user or over the air by the network operator) do not have
an equivalent abstraction in JSR-180 SIP. The native SIP stack explicitly
uses an IAP entry in the communications database that is a logical
summary of how to get connectivity access using a special protocol or
bearer type; again, that usage does not have any equivalent in Java ME.
To fill any gaps, the JSR-180 implementation contains internal logic
which handles and resolves such configuration issues when using the
underlying native SIP API; for example, deciding which SIP profile to use
according to the mandatory SIP headers set by the application, and using
an IAP assigned to the MIDlet suite by the user in the phone settings.
In addition, there is another example of a big difference between the
Java API and the native SIP stack, in accepting SIP requests outside a SIP
dialog. In JSR-180 SIP, applications can use the SipConnectionNo-
tifier , which queues received messages. In order to receive incoming
requests, the application calls the acceptAndOpen() method, which
returns a SipServerConnection instance when a SIP message is
received.
The following snippet of code illustrates the usage of SipConnec-
tionNotifier :
private void startListener() {
try {
if (scn != null)
{
scn.close();
} // listen to requests on port 5060
scn = (SipConnectionNotifier) Connector.open("sip:5060");
scn.setListener(this);
} catch (IOException ex)
{
// handle IOException
}
}
 
Search WWH ::




Custom Search