public MobicentsSipApplicationSession getSipApplicationSession() { return getSipSession().getSipApplicationSession(); }
public MobicentsSipSessionFacade(MobicentsSipSession sipSession) { this.sipSession = sipSession; this.sipSessionKey = sipSession.getKey(); this.sipAppSessionKey = sipSession.getSipApplicationSession().getKey(); }
/** * {@inheritDoc} */ public javax.servlet.RequestDispatcher getRequestDispatcher(String handler) { MobicentsSipServlet sipServletImpl = (MobicentsSipServlet) getSipSession().getSipApplicationSession().getSipContext().findSipServletByName(handler); if(sipServletImpl == null) { throw new IllegalArgumentException(handler + " is not a valid servlet name"); } return new SipRequestDispatcher(sipServletImpl); }
private void checkSessionValidity() { if(this.originalRequest.getSipSession().isValidInternal() && this.originalRequest.getSipSession().getSipApplicationSession().isValidInternal()) return; throw new IllegalStateException("Invalid session."); }
public void dispatchAndHandleExceptions () { try { dispatch(); } catch (Throwable t) { logger.error("Unexpected exception while processing message " + sipServletMessage, t); if(sipServletMessage instanceof SipServletRequestImpl) { SipServletRequestImpl sipServletRequest = (SipServletRequestImpl) sipServletMessage; if(!Request.ACK.equalsIgnoreCase(sipServletRequest.getMethod()) && !Request.PRACK.equalsIgnoreCase(sipServletRequest.getMethod())) { MessageDispatcher.sendErrorResponse(sipServletRequest.getSipSession().getSipApplicationSession().getSipContext().getSipApplicationDispatcher(), Response.SERVER_INTERNAL_ERROR, sipServletRequest, sipProvider); } } } }
proxy == null && lastInfoResponse != null) { final SipContext sipContext = sipSession.getSipApplicationSession().getSipContext(); final List<SipErrorListener> sipErrorListeners = sipContext.getListeners().getSipErrorListeners();
logger.debug(" trying to find linked session with key " + sipSessionKey + " for session " + mobicentsSipSession); MobicentsSipSession linkedSession = sipManager.getSipSession(sipSessionKey, false, null, mobicentsSipSession.getSipApplicationSession()); if(logger.isDebugEnabled()) { if(linkedSession != null) { linkedSession = sipManager.getSipSession(sipSessionKey, false, null, mobicentsSipSession.getSipApplicationSession()); logger.debug(" trying to find derived linked session with key " + sipSessionKey + " for session " + mobicentsSipSession); linkedSession = sipManager.getSipSession(sipSessionKey, false, null, mobicentsSipSession.getSipApplicationSession()); } catch (ParseException e) { logger.error("Couldn't parse linkedDerivedSessionId " + linkedDerivedSessionId + " linked to derived session " + mobicentsSipSession, e);
MobicentsSipApplicationSession sipApplicationSession = sipSession.getSipApplicationSession(); try { sipContext.enterSipApp(sipApplicationSession, sipSession, false, true);
final MobicentsSipApplicationSession sipApplicationSessionImpl = session.getSipApplicationSession(); final SipContext sipContext = sipApplicationSessionImpl.getSipContext(); final MobicentsSipServlet sipServletImpl = (MobicentsSipServlet) sipContext.findSipServletByName(sessionHandler);
public B2buaHelper getB2buaHelper() { checkReadOnly(); final MobicentsSipSession session = getSipSession(); if (session.getProxy() != null) throw new IllegalStateException("Proxy already present"); MobicentsB2BUAHelper b2buaHelper = session.getB2buaHelper(); if (b2buaHelper != null) return b2buaHelper; b2buaHelper = new B2buaHelperImpl(); b2buaHelper.setMobicentsSipFactory(sipFactoryImpl); b2buaHelper.setSipManager(session.getSipApplicationSession().getSipContext().getSipManager()); if(JainSipUtils.DIALOG_CREATING_METHODS.contains(getMethod())) { this.createDialog = true; // flag that we want to create a dialog for outgoing request. } session.setB2buaHelper(b2buaHelper); return b2buaHelper; }
/** * This callback is called when the remote side has been idle too long while * establishing the dialog. * @throws DispatcherException * */ public void onTimeout(ResponseType responseType) throws DispatcherException { if(!proxy.getAckReceived()) { this.cancel(); if(responseType == ResponseType.FINAL) { cancel1xxTimer(); } this.timedOut = true; if(originalRequest != null) { List<ProxyBranchListener> proxyBranchListeners = originalRequest.getSipSession().getSipApplicationSession().getSipContext().getListeners().getProxyBranchListeners(); if(proxyBranchListeners != null) { for (ProxyBranchListener proxyBranchListener : proxyBranchListeners) { proxyBranchListener.onProxyBranchResponseTimeout(responseType, this); } } } // Just do a timeout response proxy.onBranchTimeOut(this); logger.warn("Proxy branch has timed out"); } else { logger.debug("ACKed proxybranch has timeout"); } }
proxy == null && lastFinalResponse != null) { final SipContext sipContext = sipSession.getSipApplicationSession().getSipContext(); final List<SipErrorListener> sipErrorListeners = sipContext.getListeners().getSipErrorListeners();
public static void callServlet(MobicentsSipServletRequest request) throws ServletException, IOException { final MobicentsSipSession session = request.getSipSession(); final String sessionHandler = session.getHandler(); final MobicentsSipApplicationSession sipApplicationSessionImpl = session.getSipApplicationSession(); final SipContext sipContext = sipApplicationSessionImpl.getSipContext(); final MobicentsSipServlet sipServletImpl = sipContext.findSipServletByName(sessionHandler);
public void dispatch() throws DispatcherException { final SipServletRequestImpl sipServletRequest = (SipServletRequestImpl)sipServletMessage; final MobicentsSipSession sipSessionImpl = sipServletRequest.getSipSession(); final MobicentsSipApplicationSession appSession = sipSessionImpl.getSipApplicationSession(); final SipContext sipContext = appSession.getSipContext(); final Request request = (Request) sipServletRequest.getMessage();
final Request request = (Request) super.message; final MobicentsSipSession session = getSipSession(); final MobicentsSipApplicationSession sipApplicationSession = session.getSipApplicationSession(); final MobicentsProxy proxy = session.getProxy(); ViaHeader viaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME);
private void addChallengeResponse( WWWAuthenticateHeader wwwAuthHeader, String username, String password, String uri) { int nc = generateNcFromMessage(message); AuthorizationHeader authorization = getSipSession().getSipApplicationSession().getSipContext().getDigestAuthenticator().getAuthorizationHeader( getMethod(), uri, "", // TODO: What is this entity-body? wwwAuthHeader, username, password, wwwAuthHeader.getNonce(), nc); message.addHeader(authorization); }
public MobicentsSipApplicationSession getSipApplicationSession(boolean create) { MobicentsSipSession sipSession = getSipSession(); if(sipSession != null) { MobicentsSipApplicationSession sipApplicationSession = sipSession.getSipApplicationSession(); if(sipApplicationSession != null) { return sipApplicationSession;
MobicentsSipSession sipSessionImpl = getNewMobicentsSipSession(sessionKey, sipFactoryImpl, parentSipSession.getSipApplicationSession()); if(logger.isDebugEnabled()) { logger.debug("Created derived session " + sipSessionImpl + " with sessionKey " + sessionKey + " for parent session " + if(parentSipSession.getSipApplicationSession().getSipContext() != null) {
inviteRequest.getSipSession().getSipApplicationSession().getSipContext().getSipApplicationDispatcher().updateResponseStatistics(requestTerminatedResponse, false); } catch (SipException e) { throw new DispatcherException(Response.SERVER_INTERNAL_ERROR, "Impossible to send the 487 to the INVITE transaction corresponding to CANCEL", e);
final String branch = JainSipUtils.createBranch(session.getSipApplicationSession().getKey().getId(), sipApplicationDispatcher.getHashFromApplicationName(session.getSipApplicationSession().getKey().getApplicationName())); ViaHeader viaHeader = JainSipUtils.createViaHeader( sipFactoryImpl.getSipNetworkInterfaceManager(), prackRequest, branch, session.getOutboundInterface());