connection.connect();
// setup service discovery and entity capabilities.
// this ensures that other software, such as Jitsi, knows that we support
// ice and so on
//ServiceDiscoveryManager.setIdentityName("Java Bells");
ServiceDiscoveryManager disco = ServiceDiscoveryManager.getInstanceFor(connection);
EntityCapsManager ecm = EntityCapsManager.getInstanceFor(connection);
ecm.enableEntityCaps();
disco.addFeature("http://jabber.org/protocol/disco#info");
disco.addFeature("urn:xmpp:jingle:1");
disco.addFeature("urn:xmpp:jingle:transports:ice-udp:1");
disco.addFeature("urn:xmpp:jingle:apps:rtp:1");
disco.addFeature("urn:xmpp:jingle:apps:rtp:audio");
disco.addFeature("urn:xmpp:jingle:apps:rtp:video");
// Handle all incoming Jingle packets with a Jingle Packet Handler.
// The main thing we need to do is ensure that created Jingle sessions
// are of our ReceiverJingleSession type.
new JinglePacketHandler(connection) {