[sip-comm-dev] how to use this sip-communicator on OSGi framwork for video calling


#1

Hello, I am new to sip-communicator.
How to use this sip-communicator on OSGi framework, such as knopflerfish
OSGi framwork, to implement video calling application!

Thanks to you!
Hope to get your help and instructions!

Best Regards!

···

----------------
Jerry


#2

Hello Jerry!

How to use this sip-communicator on OSGi framework, such as knopflerfish

OSGi framwork, to implement video calling application!

It seems that embedding SIP-Communicator is a popular request. I'm planning
to write up my experiences, but won't have time for the next few weeks.
Perhaps these few pointers will be helpful:

* Build the SIP-Communicator bundle JAR files and put them wherever
knoplerfish can find them.
* The file lib/felix.client.run.properties contains the configuration for
the felix OSGi framework used by SIP-Communicator as default. You'll have to
adapt it for knoplerfish. Especially important is the configuration of which
bundles will be started automatically.
* Since you want to embed the video calling application, you probably
already have your own GUI. You can therefore either write your own
implementation of net.java.sip.communicator.service.media.MediaService or
access the
net.java.sip.communicator.service.protocol.ProtocolProviderService directly.
The ProtocolProviderService allows you to get at a SIP service
implementation, which supports the OperationSetBasicTelephony, which allows
you to do video calls. Note however that there is currently no GUI
integration of a received video stream. If a video stream is received, a
window is popped up which shows the image.

Here is a code snippet which shows how to register a SIP accound, get a SIP
service implementation and use it to start an outgoing call.

import net.java.sip.communicator.service.protocol.OperationFailedException;
import
net.java.sip.communicator.service.protocol.OperationSetBasicTelephony;
import net.java.sip.communicator.service.protocol.ProtocolNames;
import net.java.sip.communicator.service.protocol.ProtocolProviderFactory;
import net.java.sip.communicator.service.protocol.ProtocolProviderService;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;

// register the SIP account. This has to be done only once
// since the account is stored in the config file.
ServiceReference[] refs = bundlecontext.getServiceReferences
  (ProtocolProviderFactory.class.getName(), "(" +
ProtocolProviderFactory.PROTOCOL
  + "=" + ProtocolNames.SIP + ")");
ProtocolProviderFactory factory = (ProtocolProviderFactory)
  bundlecontext.getService(refs[0]);
Map account = new HashMap();
account.put(ProtocolProviderFactory.USER_ID, "foo");
account.put(ProtocolProviderFactory.PASSWORD, "abc123");
account.put(ProtocolProviderFactory.DISPLAY_NAME, "Mr. Foo");
account.put(ProtocolProviderFactory.SERVER_ADDRESS, "sip-provider.com");
account.put(ProtocolProviderFactory.SERVER_PORT, "5060");
factory.installAccount("My Account", account);

// Get the SIP service implementation
refs = bundlecontext.getServiceReferences
  (ProtocolProviderService.class.getName(), "(" +
ProtocolProviderFactory.PROTOCOL
  + "=" + ProtocolNames.SIP + ")");
ProtocolProviderService sip = (ProtocolProviderService)
bundlecontext.getService(refs[0]);
        
// Start an outgoing call
OperationSetBasicTelephony tel = (OperationSetBasicTelephony)
  sip.getOperationSet(OperationSetBasicTelephony.class);
tel.createCall("sip:foo@bar.com");

I hope this helps.

Regards
Michael Koch