Package com.ericsson.ssa.sip

Examples of com.ericsson.ssa.sip.SipSessionImplBase


     * @throws RemoteLockException
     */
    private void createSession(SipServletRequestImpl req,
            SipApplicationSessionImpl appSess, String handlerName,
            URI subscriberURI) {
        SipSessionImplBase s = (SipSessionImplBase) req.getSessionImpl();

        if (s == null) {
            // check if we are spiraling: look up early dialog
            String id = DialogSet.createKey(req.getCallId(),
                    req.getFromImpl().getParameter(AddressImpl.TAG_PARAM));
            DialogSet existingDs = DialogSet.getEarlyDialog(id);

            if (existingDs != null) {
                // spiraling indeed!
                req.setDialog(existingDs.createAdditionalDialogFragment());
            } else {
                // not spiraling
                // creates a new sip session and dialog structure
                DialogSet ds = new DialogSet(req.getMethod(), req.getCallId(), req.getFromImpl(),
                        req.getBeKey(), SipFactoryImpl.isDialogCreational(req.getMethod()));               
                req.setDialog(ds.getInitialDialogFragment());
                DialogSet.registerEarlyDialog(req);
            }
        }

        // creates a new sip session
        DialogFragment d = req.getDialog();
        s = m_SipSessionManager.createSipSession(d.getDialogSet(), req.getToImpl(),
                appSess, handlerName);
        // Initial request from outside the container.
        // So, swap the local-remote.
        s.swapLocalRemote();
        if (handlerName != null && !handlerName.equals("")) {
            TargettedRequestHandler.linkCorrespondingSession(req, s);
        }
        s.setSubscriberURI(subscriberURI);

        req.setSession(s);

        final DialogLifeCycle dialogLifeCycle = d.getDialogLifeCycle();
        dialogLifeCycle.associateTransaction(req.getTransactionId());
View Full Code Here


            logger.log(Level.FINEST, "ENTER: " + this + ", df: " + df);
        }

        try {
            for (Iterator<PathNode> it = df.getCallee2CallerPath(); it.hasNext();) {
                SipSessionImplBase ss = (SipSessionImplBase) it.next().getSipSession();

                if ((ss == null) || !ss.isValid()) {
                    /**
                     * Issue 860 : If the session is already invalidated and
                     * removed from theSessionManager by a different thread,
                     * then we should not proceed further.
                     */
                    unlock();

                    return;
                }

                SipApplicationSessionImpl sas = (SipApplicationSessionImpl) ss.getApplicationSession();

                if (sas != null) {
                    if (dialogLocks == null) {
                        dialogLocks = new HashSet<SipApplicationSessionImpl>();
                    }

                    if (dialogLocks.add(sas)) {
                        sas.lockForegroundWithRetry();
                    }
                } else {
                    if (logger.isLoggable(Level.FINE)) {
                        logger.log(Level.FINE, "attempted to lock df {0} but it has no sas. Not obtaining the lock", new Object[] {
                                df
                            });
                    }
                    throw new IncompleteDialogException("Sip Application could not be found for for Sip Session with ID: "+ss.getId());
                }

                // Check that we still have the SAS (could theoretically have migrated between first loading above and
                // before we got the lock). Just force a load and the RemoteLockRuntimeException.
                ss.getApplicationSessionImpl();

                if (logger.isLoggable(Level.FINER)) {
                    logger.log(Level.FINER, "Locked SipApplicationSession: " + sas);
                }
            }
View Full Code Here

TOP

Related Classes of com.ericsson.ssa.sip.SipSessionImplBase

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.