code
stringlengths
73
34.1k
label
stringclasses
1 value
public final boolean isViaHeaderExternal(ViaHeader viaHeader) { if (viaHeader != null) { return isExternal(viaHeader.getHost(), viaHeader.getPort(), viaHeader.getTransport()); } return true; }
java
public final boolean isExternal(String host, int port, String transport) { if(logger.isDebugEnabled()) { logger.debug("isExternal - host=" + host + ", port=" + port + ", transport=" + transport); } boolean isExternal = true; MobicentsExtendedListeningPoint listeningPoint = sipNetworkInterfaceManager.findMatc...
java
private void resetOutboundInterfaces() { List<SipURI> outboundInterfaces = sipNetworkInterfaceManager.getOutboundInterfaces(); for (SipContext sipContext : applicationDeployed.values()) { sipContext.getServletContext().setAttribute(javax.servlet.sip.SipServlet.OUTBOUND_INTERFACES, outboundInterfaces); } ...
java
public void creditGranted(long amount, boolean finalUnits) throws Exception { if (CURRENT_STATE == SENT_INITIAL_RESERVATION) { CURRENT_STATE = GRANTED_INITIAL_RESERVATION; if (logger.isInfoEnabled()) { logger.info("credit granted : "); } doInviteChargingAllowed(this.inviteRequest); } }
java
public void recycle(){ proxyConfig.isProxyConfigSet = false; sessionConfig.isSessionConfigSet = false; loginConfig.isLoginConfigSet = false; servletSelection.isMainServlet = false; servletSelection.isServletMapping = false; }
java
private JBossConvergedSipMetaData mergeSipMetaDataAndSipAnnMetaData(final DeploymentUnit deploymentUnit) { final WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); SipMetaData sipMetaData = deploymentUnit.getAttachment(SipMetaData.ATTACHMENT_KEY); SipAnnotationMetaD...
java
private final void forwardResponseStatefully(final SipServletResponseImpl sipServletResponse) { final Response response = sipServletResponse.getResponse(); final ListIterator<ViaHeader> viaHeadersLeft = response.getHeaders(ViaHeader.NAME); // we cannot remove the via header on the original response (and we don't ...
java
public void startNextUntriedBranch() { if(this.parallel) throw new IllegalStateException("This method is only for sequantial proxying"); for(final MobicentsProxyBranch pbi: this.proxyBranches.values()) { // Issue http://code.google.com/p/mobicents/issues/detail?id=2461 // don't start the ...
java
public static DeploymentUnit getSipContextAnchorDu(final DeploymentUnit du) { // attach context to top-level deploymentUnit so it can be used to get context resources (SipFactory, etc.) DeploymentUnit parentDu = du.getParent(); if (parentDu == null) { // this is a war only deployment...
java
private void pushRoute(javax.sip.address.SipURI sipUri) { if(!isInitial() && getSipSession().getProxy() == null) { //as per JSR 289 Section 11.1.3 Pushing Route Header Field Values // pushRoute can only be done on the initial requests. // Subsequent requests within a dialog follow the route set. // Any at...
java
private javax.sip.address.URI resolveSipOutbound(final javax.sip.address.URI uriToResolve) { if (!uriToResolve.isSipURI()) { return uriToResolve; } final javax.sip.address.SipURI sipURI = (javax.sip.address.SipURI) uriToResolve; if (sipURI.getParameter(MessageDispatcher.SIP_OUTBOUND_PARAM_OB) == null) { ...
java
private void updateLinkedRequestAppDataMapping(final ClientTransaction ctx, Dialog dialog) { if(logger.isDebugEnabled()) { logger.debug("updateLinkedRequestAppDataMapping"); } final Transaction linkedTransaction = linkedRequest.getTransaction(); final Dialog linkedDialog = linkedRequest.getDialog(); //k...
java
private void addInfoForRoutingBackToContainer(SipApplicationRouterInfo routerInfo, String applicationSessionId, String applicationName) throws ParseException, SipException { final Request request = (Request) super.message; final javax.sip.address.SipURI sipURI = JainSipUtils.createRecordRouteURI( sipFactoryImpl...
java
private static RoutingState checkRoutingState(SipServletRequestImpl sipServletRequest, Dialog dialog) { // 2. Ongoing Transaction Detection - Employ methods of Section 17.2.3 in RFC 3261 //to see if the request matches an existing transaction. //If it does, stop. The request is not an initial request. if(dialog...
java
public MobicentsExtendedListeningPoint findMatchingListeningPoint(String transport, final boolean strict) { String tmpTransport = transport; if(tmpTransport == null) { tmpTransport = ListeningPoint.UDP; } Set<MobicentsExtendedListeningPoint> extendedListeningPoints = transportMappingCacheMap.get(tmpTransport...
java
public MobicentsExtendedListeningPoint findMatchingListeningPoint(final String ipAddress, int port, String transport) { String tmpTransport = transport; int portChecked = checkPortRange(port, tmpTransport); if(tmpTransport == null) { tmpTransport = ListeningPoint.UDP; } // we check first if a listening...
java
protected void computeOutboundInterfaces() { if(logger.isDebugEnabled()) { logger.debug("Outbound Interface List : "); } List<SipURI> newlyComputedOutboundInterfaces = new CopyOnWriteArrayList<SipURI>(); Set<String> newlyComputedOutboundInterfacesIpAddresses = new CopyOnWriteArraySet<String>(); Iterator<Mo...
java
private DatagramSocket initRandomPortSocket() { int bindRetries = 5; int currentlyTriedPort = getRandomPortNumber(JainSipUtils.MIN_PORT_NUMBER, JainSipUtils.MAX_PORT_NUMBER); DatagramSocket resultSocket = null; // we'll first try to bind to a random port. if this fails we'll try ...
java
public void setToTag(String toTag, boolean recomputeSessionId) { this.toTag = toTag; if(toTag != null && recomputeSessionId) { // Issue 2365 : to tag needed for getApplicationSession().getSipSession(<sessionId>) to return forked session and not the parent one computeToString(); } }
java
public static void removeSipSubcontext(Context envCtx) { try { envCtx.destroySubcontext(SIP_SUBCONTEXT); } catch (NamingException e) { logger.error(sm.getString("naming.unbindFailed", e)); } }
java
public static void addSipSubcontext(Context envCtx) { try { envCtx.createSubcontext(SIP_SUBCONTEXT); } catch (NamingException e) { logger.error(sm.getString("naming.bindFailed", e)); } }
java
public static void removeAppNameSubContext(Context envCtx, String appName) { if(envCtx != null) { try { javax.naming.Context sipContext = (javax.naming.Context)envCtx.lookup(SIP_SUBCONTEXT); sipContext.destroySubcontext(appName); } catch (NamingException e) { logger.error(sm.getString("naming....
java
public static void removeSipSessionsUtil(Context envCtx, String appName, SipSessionsUtil sipSessionsUtil) { if(envCtx != null) { try { javax.naming.Context sipContext = (javax.naming.Context)envCtx.lookup(SIP_SUBCONTEXT + "/" + appName); sipContext.unbind(SIP_SESSIONS_UTIL_JNDI_NAME); } catch (Nami...
java
public static void removeTimerService(Context envCtx, String appName, TimerService timerService) { if(envCtx != null) { try { javax.naming.Context sipContext = (javax.naming.Context)envCtx.lookup(SIP_SUBCONTEXT + "/" + appName); sipContext.unbind(TIMER_SERVICE_JNDI_NAME); } catch (NamingException e...
java
public static void removeSipFactory(Context envCtx, String appName, SipFactory sipFactory) { if(envCtx != null) { try { javax.naming.Context sipContext = (javax.naming.Context)envCtx.lookup(SIP_SUBCONTEXT + "/" + appName); sipContext.unbind(SIP_FACTORY_JNDI_NAME); } catch (NamingException e) { ...
java
protected void handleSipOutbound(final SipServletRequestImpl sipServletRequest) { // if this is not a dialog creating request, then bail out right away if (!JainSipUtils.DIALOG_CREATING_METHODS.contains(sipServletRequest.getMethod())) { return; } final Request request = (Request) sipServletRequest.getM...
java
protected void registerSipConnector(Connector connector) { try { ObjectName objectName = createSipConnectorObjectName(connector, getName(), "SipConnector"); Registry.getRegistry(null, null) .registerComponent(connector, objectName, null); //TODO connector.setController(objectName); ...
java
public void initializeSystemPortProperties() { for (Connector connector : connectors) { if(connector.getProtocol().contains("HTTP")) { if(connector.getSecure()) { System.setProperty("org.mobicents.properties.sslPort", Integer.toString(connector.getPort())); } else { System.setProperty("org.mobice...
java
public static String[] getMissingSipMethods(Collection<String> sipMethods) { String[] methods = {}; if (sipMethods.size() > 0 && sipMethods.containsAll(ALL_SIP_METHODS) == false) { HashSet<String> missingMethods = new HashSet<String>(ALL_SIP_METHODS); missingMethods.removeAll(sip...
java
private Set<String> getAllComponentClasses(DeploymentUnit deploymentUnit, CompositeIndex index, SipMetaData sipMetaData, SipAnnotationMetaData sipAnnotationMetaData) { final Set<String> classes = new HashSet<String>(); if (sipAnnotationMetaData != null) { for (Map.Entry<String, S...
java
public void addSipServletResponse(SipServletResponseImpl sipServletResponse) { if(sipServletResponses == null) { sipServletResponses = new CopyOnWriteArraySet<SipServletResponseImpl>(); } sipServletResponses.add(sipServletResponse); }
java
public void setMaxActiveSipSessions(int max) { int oldMaxActiveSipSessions = this.sipManagerDelegate.getMaxActiveSipSessions(); this.sipManagerDelegate.setMaxActiveSipSessions(max); support.firePropertyChange("maxActiveSipSessions", Integer.valueOf( oldMaxActiveSipSessions), Integer.valueOf( this.sipManag...
java
public void setMaxActiveSipApplicationSessions(int max) { int oldMaxActiveSipApplicationSessions = this.sipManagerDelegate.getMaxActiveSipApplicationSessions(); this.sipManagerDelegate.setMaxActiveSipApplicationSessions(max); support .firePropertyChange( "maxActiveSipApplicationSessions", Integer....
java
public static boolean findPackageInfoinDirectory(File file) { if(file.getName().equals("package-info.class")) { FileInputStream stream = null; try { stream = new FileInputStream (file); if(findSipApplicationAnnotation(stream)) return true; } catch (Exception e) {} finally { try { stream.c...
java
public static boolean findSipApplicationAnnotation(InputStream stream) { try { byte[] rawClassBytes; rawClassBytes = new byte[stream.available()]; stream.read(rawClassBytes); boolean one = contains(rawClassBytes, SIP_APPLICATION_BYTES); boolean two = contains(rawClassBytes, ANNOTATION_BYTES); if(one...
java
public String auth_getSession(String authToken) throws FacebookException, IOException { if (null != this._sessionKey) { return this._sessionKey; } Document d = this.callMethod(FacebookMethod.AUTH_GET_SESSION, new Pai...
java
protected URL extractURL(Document doc) throws IOException { String url = doc.getFirstChild().getTextContent(); return (null == url || "".equals(url)) ? null : new URL(url); }
java
private static void stripEmptyTextNodes(Node n) { NodeList children = n.getChildNodes(); int length = children.getLength(); for (int i = 0; i < length; i++) { Node c = children.item(i); if (!c.hasChildNodes() && c.getNodeType() == Node.TEXT_NODE && c.getTextContent().trim().length() == 0...
java
public static void printDom(Node n, String prefix) { String outString = prefix; if (n.getNodeType() == Node.TEXT_NODE) { outString += "'" + n.getTextContent().trim() + "'"; } else { outString += n.getNodeName(); } System.out.println(outString); NodeList children = n.getChildNodes(); ...
java
public void run() { final MobicentsSipApplicationSession sipApplicationSession = getApplicationSession(); SipContext sipContext = sipApplicationSession.getSipContext(); if(logger.isDebugEnabled()) { logger.debug("running Servlet Timer " + id + " for sip application session " + sipApplicationSession);...
java
private void estimateNextExecution() { synchronized (TIMER_LOCK) { if (fixedDelay) { scheduledExecutionTime = period + System.currentTimeMillis(); } else { if (firstExecution == 0) { // save timestamp of first execution firstExecution = scheduledExecutionTime; } long now = Sys...
java
public void addPermission(String path) { if (path == null) { return; } if (securityManager != null) { Permission permission = null; if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) { if (!path.endsWith("/")) { ...
java
public void addPermission(Permission permission) { if ((securityManager != null) && (permission != null)) { permissionList.add(permission); } }
java
public void stop() throws LifecycleException { // Clearing references should be done before setting started to // false, due to possible side effects clearReferences(); // Annotations dont need a running app. //started = false; int length = files.length; for (i...
java
protected void clearReferences() { // Unregister any JDBC drivers loaded by this classloader Enumeration drivers = DriverManager.getDrivers(); while (drivers.hasMoreElements()) { Driver driver = (Driver) drivers.nextElement(); if (driver.getClass().getClassLoader() == th...
java
protected boolean loadedByThisOrChild(Class clazz) { boolean result = false; for (ClassLoader classLoader = clazz.getClassLoader(); null != classLoader; classLoader = classLoader.getParent()) { if (classLoader.equals(this)) { result = true; ...
java
protected Class findClassInternal(String name) throws ClassNotFoundException { if (!validate(name)) throw new ClassNotFoundException(name); String tempPath = name.replace('.', '/'); String classPath = tempPath + ".class"; ResourceEntry entry = null; entry ...
java
protected ResourceEntry findResourceInternal(File file, String path){ ResourceEntry entry = new ResourceEntry(); try { entry.source = getURI(new File(file, path)); entry.codeBase = getURL(new File(file, path), false); } catch (MalformedURLException e) { return...
java
protected boolean filter(String name) { if (name == null) return false; // Looking up the package String packageName = null; int pos = name.lastIndexOf('.'); if (pos != -1) packageName = name.substring(0, pos); else return false; ...
java
protected static void deleteDir(File dir) { String files[] = dir.list(); if (files == null) { files = new String[0]; } for (int i = 0; i < files.length; i++) { File file = new File(dir, files[i]); if (file.isDirectory()) { deleteDir(fi...
java
private final static String basePhoneNumber(String number) throws ParseException { StringBuffer s = new StringBuffer(); Lexer lexer = new Lexer("sip_urlLexer", number); int lc = 0; while (lexer.hasMoreChars()) { char w = lexer.lookAhead(0); if (Lexer.isDigit(w) || w == '-' || w == '.' ...
java
private static Properties loadProperties(String defaultsName, String propertiesName) throws IOException { Properties bundle = new Properties(); ClassLoader loader = SecurityActions.getContextClassLoader(); URL defaultUrl = null; URL url = null; // First check for local visibility...
java
protected static String removeQuotes(String quotedString, boolean quotesRequired) { // support both quoted and non-quoted if (quotedString.length() > 0 && quotedString.charAt(0) != '"' && !quotesRequired) { return quotedString; } else if (quotedString.length() > 2) { retu...
java
protected synchronized MessageDigest getDigest() { if (this.digest == null) { try { this.digest = MessageDigest.getInstance(algorithm); } catch (NoSuchAlgorithmException e) { try { this.digest = MessageDigest.getInstance(DEFAULT_ALGORIT...
java
protected synchronized Random getRandom() { if (this.random == null) { try { Class clazz = Class.forName(randomClass); this.random = (Random) clazz.newInstance(); long seed = System.currentTimeMillis(); char[] entropy = getEntropy().toC...
java
public static int getAddressOutboundness(String address) { if(address.startsWith("127.0")) return 0; if(address.startsWith("192.168")) return 1; if(address.startsWith("10.")) return 2; if(address.startsWith("172.16") || address.startsWith("172.17") || address.startsWith("172.18") || address.startsWith("172...
java
public ViaHeader createViaHeader(String branch, boolean usePublicAddress) { try { String host = getIpAddress(usePublicAddress); ViaHeader via = SipFactoryImpl.headerFactory.createViaHeader(host, port, transport, branch); return via; } catch (ParseException ex) { ...
java
public javax.sip.address.SipURI createRecordRouteURI(boolean usePublicAddress) { try { String host = getIpAddress(usePublicAddress); SipURI sipUri = SipFactoryImpl.addressFactory.createSipURI(null, host); sipUri.setPort(port); sipUri.setTransportParam(transport); // Do we want to add an ID here? ...
java
public void removeCorrespondingSipApplicationSession(MobicentsSipApplicationSessionKey sipApplicationSession) { joinApplicationSession.remove(sipApplicationSession); replacesApplicationSession.remove(sipApplicationSession); Iterator<MobicentsSipApplicationSessionKey> it = joinApplicationSession.values().iterat...
java
public void notifySipSessionListeners(SipSessionEventType sipSessionEventType) { MobicentsSipApplicationSession sipApplicationSession = getSipApplicationSession(); if(sipApplicationSession != null) { SipContext sipContext = sipApplicationSession.getSipContext(); List<SipSessionListener> sipSessionListeners = ...
java
protected boolean hasOngoingTransaction() { if(!isSupervisedMode()) { return false; } else { if(ongoingTransactions != null) { for (Transaction transaction : ongoingTransactions) { if(TransactionState.CALLING.equals(transaction.getState()) || TransactionState.TRYING.equals(transaction.getState(...
java
public void addOngoingTransaction(Transaction transaction) { if(transaction != null && ongoingTransactions != null && !isReadyToInvalidate() ) { boolean added = this.ongoingTransactions.add(transaction); if(added) { if(logger.isDebugEnabled()) { logger.debug("transaction "+ transaction +" has been ad...
java
public void removeOngoingTransaction(Transaction transaction) { boolean removed = false; if(this.ongoingTransactions != null) { removed = this.ongoingTransactions.remove(transaction); } // if(sessionCreatingTransactionRequest != null && sessionCreatingTransactionRequest.getMessage() != null && JainSipUtils.D...
java
public void onReadyToInvalidate() { if (isB2BUAOrphan()) { logger.debug("Session is B2BUA Orphaned, lets invalidate"); setReadyToInvalidate(true); } if (!readyToInvalidate) { logger.debug("Session not ready to invalidate, wait next chance."); ret...
java
public void setAckReceived(long cSeq, boolean ackReceived) { if(logger.isDebugEnabled()) { logger.debug("setting AckReceived to : " + ackReceived + " for CSeq " + cSeq); } acksReceived.put(cSeq, ackReceived); if(ackReceived) { cleanupAcksReceived(cSeq); } }
java
protected boolean isAckReceived(long cSeq) { if(acksReceived == null) { // http://code.google.com/p/sipservlets/issues/detail?id=152 // if there is no map, it means that the session was already destroyed and it is a retransmission return true; } Boolean ackReceived = acksReceived.get(cSeq); if(logger.i...
java
protected void cleanupAcksReceived(long remoteCSeq) { List<Long> toBeRemoved = new ArrayList<Long>(); final Iterator<Entry<Long, Boolean>> cSeqs = acksReceived.entrySet().iterator(); while (cSeqs.hasNext()) { final Entry<Long, Boolean> entry = cSeqs.next(); final long cSeq = entry.getKey(); final boolean...
java
public boolean validateCSeq(MobicentsSipServletRequest sipServletRequest) { final Request request = (Request) sipServletRequest.getMessage(); final long localCseq = cseq; final long remoteCSeq = ((CSeqHeader) request.getHeader(CSeqHeader.NAME)).getSeqNumber(); final String method = request.getMethod(); final...
java
protected void doMessage(SipServletRequest request) throws ServletException, IOException { request.createResponse(SipServletResponse.SC_OK).send(); Object message = request.getContent(); String from = request.getFrom().getURI().toString(); logg...
java
protected void doErrorResponse(SipServletResponse response) throws ServletException, IOException { //The receiver of the message probably dropped off. Remove //him from the list. String receiver = response.getTo().toString(); removeUser(receiver); }
java
private static MimeMultipart getContentAsMimeMultipart(ContentTypeHeader contentTypeHeader, byte[] rawContent) { // Issue 1123 : http://code.google.com/p/mobicents/issues/detail?id=1123 : Multipart type is supported String delimiter = contentTypeHeader.getParameter(MULTIPART_BOUNDARY); String start = contentTypeH...
java
public final MobicentsSipSession getSipSession() { if(logger.isDebugEnabled()) { logger.debug("getSipSession"); } if(sipSession == null && sessionKey == null) { sessionKey = getSipSessionKey(); if(logger.isDebugEnabled()) { logger.debug("sessionKey is " + sessionKey); } if(sessionKey == null) ...
java
protected ModifiableRule retrieveModifiableOverriden() { ModifiableRule overridenRule = null; //use local var to prevent potential concurent cleanup SipSession session = getSession(); if (session != null && session.getServletContext() != null) { String ove...
java
protected static String getFullHeaderName(String headerName) { String fullName = null; if (JainSipUtils.HEADER_COMPACT_2_FULL_NAMES_MAPPINGS.containsKey(headerName)) { fullName = JainSipUtils.HEADER_COMPACT_2_FULL_NAMES_MAPPINGS.get(headerName); } else { fullName = headerName; } if (logger.isDebugEnabl...
java
public static String getCompactName(String headerName) { String compactName = null; if (JainSipUtils.HEADER_COMPACT_2_FULL_NAMES_MAPPINGS.containsKey(headerName)) { compactName = JainSipUtils.HEADER_COMPACT_2_FULL_NAMES_MAPPINGS.get(headerName); } else { // This can be null if there is no mapping!!! com...
java
protected boolean containsRel100(Message message) { ListIterator<SIPHeader> requireHeaders = message.getHeaders(RequireHeader.NAME); if(requireHeaders != null) { while (requireHeaders.hasNext()) { if(REL100_OPTION_TAG.equals(requireHeaders.next().getValue())) { return true; } } } ListIterator...
java
protected void processConcurrencyAnnotation(Class clazz) { if(sipContext.getConcurrencyControlMode() == null) { Package pack = clazz.getPackage(); if(pack != null) { ConcurrencyControl concurrencyControl = pack.getAnnotation(ConcurrencyControl.class); if(concurrencyControl != null) { if(lo...
java
public void sendHeartBeat(String ipAddress, int port) throws Exception { MBeanServer mbeanServer = getMBeanServer(); Set<ObjectName> queryNames = mbeanServer.queryNames(new ObjectName("*:type=Service,*"), null); for(ObjectName objectName : queryNames) { mbeanServer.invoke(objectName, "sendHeartB...
java
protected void doRequest(javax.servlet.sip.SipServletRequest req) throws javax.servlet.ServletException, java.io.IOException{ String m = req.getMethod(); if ("INVITE".equals(m)) doInvite(req); else if ("ACK".equals(m)) doAck(req); else if ("OPTIONS".equals(m)) doOptions(req); else if ("BYE".equals...
java
protected void doResponse(javax.servlet.sip.SipServletResponse resp) throws javax.servlet.ServletException, java.io.IOException{ int status = resp.getStatus(); if (status < 200) { doProvisionalResponse(resp); } else { if (status < 300) { doSuccessResponse(resp); } else if (status < 400) { d...
java
public static String decode(String uri) { if(logger.isDebugEnabled()) { logger.debug("uri to decode " + uri); } if(uri == null) { // fix by Hauke D. Issue 410 // throw new NullPointerException("uri cannot be null !"); return null; } //optimization for uri with...
java
private void dispatchOutsideContainer(SipServletRequestImpl sipServletRequest) throws DispatcherException { final Request request = (Request) sipServletRequest.getMessage(); if(logger.isInfoEnabled()) { logger.info("Dispatching the request event outside the container"); } //check if the request point to anot...
java
private final MobicentsSipApplicationSession retrieveTargetedApplication( String targetedApplicationKey) { if (logger.isDebugEnabled()){ logger.debug("retrieveTargetedApplication - targetedApplicationKey=" + targetedApplicationKey); } if( targetedApplicationKey != null && targetedApplicationKey.l...
java
private MobicentsSipSession retrieveSipSession(Dialog dialog) { if(dialog != null) { Iterator<SipContext> iterator = sipApplicationDispatcher.findSipApplications(); while(iterator.hasNext()) { SipContext sipContext = iterator.next(); SipManager sipManager = sipContext.getSipManager(); Iterat...
java
public String getBasePath() { String docBase = null; Container container = this; while (container != null) { if (container instanceof Host) break; container = container.getParent(); } File file = new File(getDocBase()); if (!file.is...
java
private String getNamingContextName() { if (namingContextName == null) { Container parent = getParent(); if (parent == null) { namingContextName = getName(); } else { Stack<String> stk = new Stack<String>(); StringBuffer buff = new StringBuffer(); while (parent != null) { stk.pus...
java
public JSONObject jsonify() { JSONObject ret = new JSONObject(); if (null != this._attributesString) { for (Map.Entry<ApplicationProperty,CharSequence> entry: this._attributesString.entrySet()) { ret.put(entry.getKey().propertyName(), entry.getValue().toString()); } } if (null != thi...
java
public MobicentsSipSession removeSipSession(final MobicentsSipSessionKey key) { if(logger.isDebugEnabled()) { logger.debug("Removing a sip session with the key : " + key); } return sipSessions.remove(key); }
java
public MobicentsSipApplicationSession removeSipApplicationSession(final MobicentsSipApplicationSessionKey key) { if(logger.isDebugEnabled()) { logger.debug("Removing a sip application session with the key : " + key); } MobicentsSipApplicationSession sipApplicationSession = sipApplicationSessions.remove(key); ...
java
public MobicentsSipApplicationSession getSipApplicationSession(final SipApplicationSessionKey key, final boolean create) { if(logger.isDebugEnabled()) { logger.debug("getSipApplicationSession with key=" + key); } MobicentsSipApplicationSession sipApplicationSessionImpl = null; //first we check if the app ses...
java
public MobicentsSipSession getSipSession(final SipSessionKey key, final boolean create, final SipFactoryImpl sipFactoryImpl, final MobicentsSipApplicationSession sipApplicationSessionImpl) { if(logger.isDebugEnabled()) { logger.debug("getSipSession - key=" + key + ", create=" + create + ", sipApplicationSessionImp...
java
public MobicentsSipApplicationSession findSipApplicationSession(HttpSession httpSession) { for (MobicentsSipApplicationSession sipApplicationSessionImpl : sipApplicationSessions.values()) { if(sipApplicationSessionImpl.findHttpSession(httpSession.getId()) != null) { return sipApplicationSessionImpl; } ...
java
public void removeAllSessions() { List<SipSessionKey> sipSessionsToRemove = new ArrayList<SipSessionKey>(); for (SipSessionKey sipSessionKey : sipSessions.keySet()) { sipSessionsToRemove.add(sipSessionKey); } for (SipSessionKey sipSessionKey : sipSessionsToRemove) { removeSipSession(sipSessionKey); }...
java
public MobicentsSipApplicationSession createApplicationSession(SipContext sipContext) { if (logger.isDebugEnabled()) { logger.debug("Creating new application session for sip context "+ sipContext.getApplicationName()); } //call id not needed anymore since the sipappsessionkey is not a callid anymore but a rand...
java
private static void validateCreation(String method, SipApplicationSession app) { if (method.equals(Request.ACK)) { throw new IllegalArgumentException( "Wrong method to create request with[" + Request.ACK + "]!"); } if (method.equals(Request.PRACK)) { throw new IllegalArgumentException( "Wrong met...
java
public void init() { defaultApplicationRouterParser.init(); try { defaultSipApplicationRouterInfos = defaultApplicationRouterParser.parse(); } catch (ParseException e) { log.fatal("Impossible to parse the default application router configuration file", e); ...
java
public static void pushRunAsIdentity(final RunAsIdentity principal) { AccessController.doPrivileged(new PrivilegedAction<Void>() { @Override public Void run() { SecurityContext sc = getSecurityContext(); if (sc == null) throw MESSAGES....
java
public static RunAs popRunAsIdentity() { return AccessController.doPrivileged(new PrivilegedAction<RunAs>() { @Override public RunAs run() { SecurityContext sc = getSecurityContext(); if (sc == null) throw MESSAGES.noSecurityContext();...
java
public static String hashString(String input, int length) { MessageDigest md; try { md = MessageDigest.getInstance("SHA"); } catch (NoSuchAlgorithmException e) { throw new IllegalArgumentException("The SHA Algorithm could not be found", e); } byte[] bytes = input.getBytes(); md.update(bytes); String...
java
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); // Commented for http://code.google.com/p/sipservlets/issues/detail?id=168 // When no sip.xml but annotation...
java