Package net.java.sip.communicator.impl.protocol.jabber.extensions.jingle

Examples of net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.JingleIQ


  public void handleSessionInitiate(JingleIQ jiq) {
    if( state == SessionState.CLOSED )
      return;
    ack(jiq);
    peerJid = jiq.getFrom();
    JingleIQ iq = JinglePacketFactory.createCancel(myJid, peerJid, sessionId);
    connection.sendPacket(iq);
    closeSession(Reason.DECLINE);
  }
View Full Code Here


         
          // display incoming jingle packets
          connection.addPacketListener( new PacketListener() {
            @Override
            public void processPacket(Packet packet) {
              JingleIQ j = (JingleIQ) packet;
              System.out.println( RECEIVER + "[jingle packet]: " + j.getSID() + " : " + j.getAction() );
            }},
            new PacketFilter() {
            @Override
            public boolean accept(Packet packet) {
              return packet.getClass() == JingleIQ.class;
View Full Code Here

          // Use Ice and JingleSessionManager to initiate session:
          log( CALLER, "Ringing" );
          List<ContentPacketExtension> contentList = jsm.createContentList(SendersEnum.both);
          iceAgent.addLocalCandidateToContents(contentList);
         
                JingleIQ sessionInitIQ = JinglePacketFactory.createSessionInitiate(
                    connection.getUser(),
                    receiverJid,
                    JingleIQ.generateSID(),
                    contentList );
               
                System.out.println( "CALLER: sending jingle request: " + sessionInitIQ.toXML() );
               
                connection.sendPacket(sessionInitIQ);
         
                // now hang out until the user requests that we exit.
                // The rest of the call will be handled by the CallerJingleSession we created above.
View Full Code Here

        iceAgent.createStreams(jingleStreamManager.getMediaNames());

        iceAgent.addAgentStateChangeListener(this);
        iceAgent.addLocalCandidateToContents(acceptedContent);
 
        JingleIQ iq = JinglePacketFactory.createSessionAccept(myJid, peerJid, sessionId, acceptedContent);
        connection.sendPacket(iq);
        state = SessionState.NEGOTIATING_TRANSPORT;
       
        iceAgent.addRemoteCandidates( jiq );
        iceAgent.startConnectivityEstablishment();
      } else {
        System.out.println("Rejecting call!");
        // it didn't match. Reject the call.
        closeSession(Reason.DECLINE);
      }
    } catch( IOException ioe ) {
      System.out.println("An error occured. Rejecting call!");
      JingleIQ iq = JinglePacketFactory.createCancel(myJid, peerJid, sessionId);
      connection.sendPacket(iq);
      closeSession(Reason.FAILED_APPLICATION);
    } catch( IllegalArgumentException iae ) {
      System.out.println("An error occured. Rejecting call!");
      JingleIQ iq = JinglePacketFactory.createCancel(myJid, peerJid, sessionId);
      connection.sendPacket(iq);
      closeSession(Reason.FAILED_APPLICATION);
    }
  }
View Full Code Here

          //display all incoming packets
          connection.addPacketListener( new PacketListener() {
            @Override
            public void processPacket(Packet packet) {
              ifpacket.getClass() == JingleIQ.class ) {
                JingleIQ j = (JingleIQ) packet;
                System.out.println( resource + " <---- : [jingle packet] " + j.getSID() + " : " + j.getAction() + " : " + packet.toXML() );
              } else {
                System.out.println( resource + " <---- : " + packet.toXML() );
              }
            }},
            new PacketFilter() {
View Full Code Here

        iceAgent.createStreams(jingleStreamManager.getMediaNames());

        iceAgent.addAgentStateChangeListener(this);
        iceAgent.addLocalCandidateToContents(acceptedContent);

        JingleIQ iq = JinglePacketFactory.createSessionAccept(myJid, peerJid, sessionId, acceptedContent);
        connection.sendPacket(iq);
        state = SessionState.NEGOTIATING_TRANSPORT;
       
        iceAgent.addRemoteCandidates( jiq );
        iceAgent.startConnectivityEstablishment();
        active = true;
        break;
      case DONOTANSWER:
        System.out.println("Rejecting call (busy).");
        closeSession(Reason.BUSY);
        break;
      }
    } catch( IOException ioe ) {
      System.out.println("An error occured. Rejecting call!");
      JingleIQ iq = JinglePacketFactory.createCancel(myJid, peerJid, sessionId);
      connection.sendPacket(iq);
      closeSession(Reason.FAILED_APPLICATION);
    } catch( IllegalArgumentException iae ) {
      System.out.println("An error occured. Rejecting call!");
      JingleIQ iq = JinglePacketFactory.createCancel(myJid, peerJid, sessionId);
      connection.sendPacket(iq);
      closeSession(Reason.FAILED_APPLICATION);
    } catch( Exception e ) {
      System.out.println("An error occured. Rejecting call!");
      JingleIQ iq = JinglePacketFactory.createCancel(myJid, peerJid, sessionId);
      connection.sendPacket(iq);
      closeSession(Reason.FAILED_APPLICATION);
    }
  }
View Full Code Here

    iceAgent.createStreams(jingleStreamManager.getMediaNames());

    List<ContentPacketExtension> contentList = jingleStreamManager.createContentList(SendersEnum.both);
    iceAgent.addLocalCandidateToContents(contentList);
   
        JingleIQ sessionInitIQ = JinglePacketFactory.createSessionInitiate(
            connection.getUser(),
            targetJid,
            JingleIQ.generateSID(),
            contentList );
       
View Full Code Here

    connection.addPacketListener( this, this );
  }
 
  @Override
  public void processPacket(Packet packet) {
    JingleIQ jiq = (JingleIQ) packet;
   
    String sid = jiq.getSID();
    JingleSession js = jingleSessions.get(sid);
    if( js == null )
      js = deadSessions.get(sid);
    if( js == null ) {
      js = createJingleSession( sid, jiq );
      jingleSessions.put( sid, js );
    }
    switch( jiq.getAction() ) {
    case CONTENT_ACCEPT:
      js.handleContentAcept( jiq );
      break;
    case CONTENT_ADD:
      js.handleContentAdd( jiq );
View Full Code Here

          //display all incoming packets
          connection.addPacketListener( new PacketListener() {
            @Override
            public void processPacket(Packet packet) {
              if( packet.getClass() == JingleIQ.class ) {
                JingleIQ jiq = (JingleIQ) packet ;
                System.out.println( resource + " <----- [jingle packet]: " + jiq.getSID() + " : " + jiq.getAction() );
              } else {
                System.out.println( resource + " <----- : " + packet.toXML() );
              }
            }},
            new PacketFilter() {
View Full Code Here

TOP

Related Classes of net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.JingleIQ

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.