Examples of Jingle


Examples of nu.fw.jeti.plugins.jingle.packet.Jingle

         * @return a Jingle packet
         * @throws XMPPException an exception
         * @see org.jivesoftware.smackx.jingle.JingleNegotiator.State#eventAccept(org.jivesoftware.smackx.packet.Jingle)
         */
        public Jingle eventAccept(Jingle jin) throws XMPPException {
            Jingle response = null;

            // Parse the Jingle and get the accepted candidate
            ArrayList accepted = obtainCandidatesList(jin);
            if (!accepted.isEmpty()) {

View Full Code Here

Examples of nu.fw.jeti.plugins.jingle.packet.Jingle

    public JingleProvider(JingleManager manager) {
      this.manager = manager;
    }

    public void startHandling(Attributes attr){
      jingle = new Jingle(manager);
        // Get some attributes for the <jingle> element
      jingle.setSid(attr.getValue("sid"));
      jingle.setAction(Jingle.Action.getAction(attr.getValue("action")));
        try  {
          jingle.setInitiator(JID.checkedJIDFromString(attr.getValue("initiator")));
View Full Code Here

Examples of nu.fw.jeti.plugins.jingle.packet.Jingle

    backend.addListener(IQResultListener.class,new IQResultListener(){
      public void iqResult(InfoQuery iq) {
        for (JingleSession session : manager.getAllSessions()){
          try {
            session.respond(new Jingle(iq));
          } catch (XMPPException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
        }
View Full Code Here

Examples of nu.fw.jeti.plugins.jingle.packet.Jingle

     * appropriate error packet.
     *
     * @param request the request to be rejected.
     */
    protected void rejectIncomingJingleSession(JingleSessionRequest request) {
        Jingle initiation = request.getJingle();

        Jingle rejection = JingleSession.createError(initiation.getPacketID(), initiation
                .getFrom(), initiation.getTo(), 403, "Declined");
        connection.send(new InfoQuery(rejection.getFrom(),rejection.getPacketID(),rejection.getError()));
    }
View Full Code Here

Examples of nu.fw.jeti.plugins.jingle.packet.Jingle

        /**
         * Create an invitation packet.
         */
        public Jingle eventInvite() {
            // Create an invitation packet, saving the Packet ID, for any ACK
            return new Jingle(Jingle.Action.SESSIONINITIATE);
        }
View Full Code Here

Examples of nu.fw.jeti.plugins.jingle.packet.Jingle

                        .getBestRemoteCandidate();

                // Ok, send a packet saying that we accept this session
                // with the audio payload type and the transport
                // candidate
                Jingle jout = new Jingle(Jingle.Action.SESSIONACCEPT);
                jout.addDescription(new JingleContentDescription.Audio(
                        new JinglePayloadType(bestCommonAudioPt)));
                jout.addTransport(getTransportNeg().getJingleTransport(
                        bestRemoteCandidate));

                // Send the "accept" and wait for the ACK
                addExpectedId(jout.getPacketID());
                sendFormattedJingle(jout);
            }
        }
View Full Code Here

Examples of nu.fw.jeti.plugins.jingle.packet.Jingle

        // Establish the default state
        setState(accepting);

        //updatePacketListener();

        Jingle packet = initialJingleSessionRequest.getJingle();
        if (packet != null) {

            // Initialize the session information
            setSid(packet.getSid());

            respond(packet);
        }
        else {
            throw new XMPPException(
View Full Code Here

Examples of nu.fw.jeti.plugins.jingle.packet.Jingle

                        .getAcceptedLocalCandidate();

                if (bestCommonAudioPt != null && bestRemoteCandidate != null
                        && acceptedLocalCandidate != null) {
                    // Ok, send a packet saying that we accept this session
                    Jingle jout = new Jingle(Jingle.Action.SESSIONACCEPT);

                    // ... with the audio payload type and the transport
                    // candidate
                    jout.addDescription(new JingleContentDescription.Audio(
                            new JinglePayloadType(bestCommonAudioPt)));
                    jout.addTransport(getTransportNeg().getJingleTransport(
                            bestRemoteCandidate));

                    addExpectedId(jout.getPacketID());
                    sendFormattedJingle(jout);
                }
            }
        }
View Full Code Here

Examples of org.jivesoftware.smackx.packet.Jingle

                    }
                    removeExpectedId(iq.getPacketID());
                }
            } else if (iq instanceof Jingle) {
                // It is not an error: it is a Jingle packet...
                Jingle jin = (Jingle) iq;
                JingleActionEnum action = jin.getAction();

                // Depending on the state we're in we'll get different processing actions.
                // (See Design Patterns AKA GoF State behavioral pattern.)
                response = getSessionState().processJingle(this, jin, action);
            }
View Full Code Here

Examples of org.jivesoftware.smackx.packet.Jingle

                    if (iq.getFrom() == null || !iq.getFrom().equals(other == null ? "" : other)) {
                        return false;
                    }

                    if (iq instanceof Jingle) {
                        Jingle jin = (Jingle) iq;

                        String sid = jin.getSid();
                        if (sid == null || !sid.equals(getSid())) {
                            LOGGER.debug("Ignored Jingle(SID) " + sid + "|" + getSid() + " :" + iq.toXML());
                            return false;
                        }
                        String ini = jin.getInitiator();
                        if (!ini.equals(getInitiator())) {
                            LOGGER.debug("Ignored Jingle(INI): " + iq.toXML());
                            return false;
                        }
                    } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.