src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java
/**
     * Creates a <tt>CallPeerJabberImpl</tt> from <tt>calleeJID</tt> and sends
     * them <tt>session-initiate</tt> IQ request.
     *
     * @param calleeJID the party that we would like to invite to this call.
     * @param discoverInfo any discovery information that we have for the jid
     * we are trying to reach and that we are passing in order to avoid having
     * to ask for it again.
     * @param sessionInitiateExtensions a collection of additional and optional
     * <tt>ExtensionElement</tt>s to be added to the <tt>session-initiate</tt>
     * {@link JingleIQ} which is to init this <tt>CallJabberImpl</tt>
     * @param supportedTransports the XML namespaces of the jingle transports
     * to use.
     *
     * @return the newly created <tt>CallPeerJabberImpl</tt> corresponding to
     * <tt>calleeJID</tt>. All following state change events will be
     * delivered through this call peer.
     *
     * @throws OperationFailedException with the corresponding code if we fail
     *  to create the call.
     */
Creates a CallPeerJabberImpl from calleeJID and sends
them session-initiate IQ request.

@param calleeJID the party that we would like to invite to this call.
@param discoverInfo any discovery information that we have for the jid
we are trying to reach and that we are passing in order to avoid having
to ask for it again.
@param sessionInitiateExtensions a collection of additional and optional
ExtensionElements to be added to the session-initiate
JingleIQ which is to init this CallJabberImpl
@param supportedTransports the XML namespaces of the jingle transports
to use.

@return the newly created CallPeerJabberImpl corresponding to
calleeJID. All following state change events will be
delivered through this call peer.

@throws OperationFailedException with the corresponding code if we fail
to create the call.
Creates a CallPeerJabberImpl from calleeJID and sends them session - initiate IQ request . @param calleeJID the party that we would like to invite to this call . @param discoverInfo any discovery information that we have for the jid we are trying to reach and that we are passing in order to avoid having to ask for it again . @param sessionInitiateExtensions a collection of additional and optional ExtensionElements to be added to the session - initiate JingleIQ which is to init this CallJabberImpl @param supportedTransports the XML namespaces of the jingle transports to use . @return the newly created CallPeerJabberImpl corresponding to calleeJID . All following state change events will be delivered through this call peer . @throws OperationFailedException with the corresponding code if we fail to create the call .
public CallPeerJabberImpl initiateSession(
            Jid calleeJID,
            DiscoverInfo discoverInfo,
            Iterable<ExtensionElement> sessionInitiateExtensions,
            Collection<String> supportedTransports)
        throws OperationFailedException
    {
        CallPeerJabberImpl callPeer = new CallPeerJabberImpl(calleeJID, this);
        callPeer.setDiscoveryInfo(discoverInfo);
        addCallPeer(callPeer);
        callPeer.setState(CallPeerState.INITIATING_CALL);
        if (getCallPeerCount() == 1)
            parentOpSet.fireCallEvent(CallEvent.CALL_INITIATED, this);
        CallPeerMediaHandlerJabberImpl mediaHandler
            = callPeer.getMediaHandler();
        mediaHandler.setSupportedTransports(supportedTransports);
        /* enable video if it is a video call */
        mediaHandler.setLocalVideoTransmissionEnabled(localVideoAllowed);
        /* enable remote-control if it is a desktop sharing session */
        mediaHandler.setLocalInputEvtAware(getLocalInputEvtAware());
        /*
         * Set call state to connecting so that the user interface would start
         * playing the tones. We do that here because we may be harvesting
         * STUN/TURN addresses in initiateSession() which would take a while.
         */
        callPeer.setState(CallPeerState.CONNECTING);
        boolean sessionInitiated = false;
        try
        {
            callPeer.initiateSession(sessionInitiateExtensions);
            sessionInitiated = true;
        }
        finally
        {
            if (!sessionInitiated)
                callPeer.setState(CallPeerState.FAILED);
        }
        return callPeer;
    }
public CallPeerJabberImpl initiateSession ( Jid calleeJID , DiscoverInfo discoverInfo , Iterable < ExtensionElement > sessionInitiateExtensions , Collection < String > supportedTransports ) throws OperationFailedException { CallPeerJabberImpl callPeer = new CallPeerJabberImpl ( calleeJID , this ) ; callPeer . setDiscoveryInfo ( discoverInfo ) ; addCallPeer ( callPeer ) ; callPeer . setState ( CallPeerState . INITIATING_CALL ) ; if ( getCallPeerCount ( ) == 1 ) parentOpSet . fireCallEvent ( CallEvent . CALL_INITIATED , this ) ; CallPeerMediaHandlerJabberImpl mediaHandler = callPeer . getMediaHandler ( ) ; mediaHandler . setSupportedTransports ( supportedTransports ) ; /* enable video if it is a video call */ mediaHandler . setLocalVideoTransmissionEnabled ( localVideoAllowed ) ; /* enable remote-control if it is a desktop sharing session */ mediaHandler . setLocalInputEvtAware ( getLocalInputEvtAware ( ) ) ; /*
         * Set call state to connecting so that the user interface would start
         * playing the tones. We do that here because we may be harvesting
         * STUN/TURN addresses in initiateSession() which would take a while.
         */ callPeer . setState ( CallPeerState . CONNECTING ) ; boolean sessionInitiated = false ; try { callPeer . initiateSession ( sessionInitiateExtensions ) ; sessionInitiated = true ; } finally { if ( ! sessionInitiated ) callPeer . setState ( CallPeerState . FAILED ) ; } return callPeer ; }
Creates a <tt>CallPeerJabberImpl</tt> from <tt>calleeJID</tt> and sends
 them <tt>session-initiate</tt> IQ request.
Creates a <tt > CallPeerJabberImpl< / tt > from <tt > calleeJID< / tt > and sends them <tt > session - initiate< / tt > IQ request .
// create the session-initiate IQ // If this was the first peer we added in this call, then the call is // new and we need to notify everyone of its creation. //set the supported transports before the transport manager is created // if initializing session fails, set peer to failed // if initialization throws an exception