Examples of JipletSession


Examples of org.cafesip.jiplet.JipletSession

        {
            RequestEvent req_event = requestEvent.getRequestEvent();
            Request req_msg = req_event.getRequest();
            SipProvider provider = (SipProvider) req_event.getSource();

            JipletSession session = null;
            if (req_msg.getMethod().equals(Request.INVITE) == true)
            {
                session = requestEvent.getSession(true);
                synchronized (callIdLock)
                {
                    callId++;
                    info ("SIP session " + callId + " created.");
                    session.setAttribute("callId", new Integer(callId));
                    ListeningPoint lp = provider.getListeningPoints()[0];
                    session.setAttribute("requestSourceIp", new String(lp.getIPAddress()));
                    session.setAttribute("requestSourcePort", new Integer(lp.getPort()));
                }
            }
            else
            {
                session = requestEvent.getSession(false);
                if (session != null)
                {
                    Integer c = (Integer) session.getAttribute("callId");
                    if (c != null)
                    {
                        info("SIP request message  received for  session " + c);
                    }
                }
               
                if (req_msg.getMethod().equals(Request.BYE) == true)
                {
                    if (session != null)
                    {
                        session.invalidate();
                    }
                }
            }
           
            // Act as a stateless proxy. Forward the message to the phone.
View Full Code Here

Examples of org.cafesip.jiplet.JipletSession

    {
        //   print the trace provided by the base-class.
        super.processResponse(responseEvent);

        SipProvider provider = getSipProvider(getListeningPointDefault());
        JipletSession session = responseEvent.getSession(false);
        if (session != null)
        {
            Integer c = (Integer) session.getAttribute("callId");
            if (c != null)
            {
                info("SIP request message  received for  session " + c);
            }
           
            String sourceIp = (String) session.getAttribute("requestSourceIp");
            if (sourceIp != null)
            {
                int sourcePort = ((Integer) session.getAttribute("requestSourcePort")).intValue();
                provider = getSipProvider(sourceIp, sourcePort);
            }
        }

        try
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.