public int getExpires() { String expires = this.getParameter(EXPIRES_PARAM_NAME); if(expires != null) { // This is how the TCK expects to parse it. See AddressingServlet in TCK spec tests. return Integer.parseInt(expires); } else { // I think this is not needed. return ((SipURI)address.getURI()).getParameter(EXPIRES_PARAM_NAME) == null ? -1 : Integer.parseInt(((SipURI)address.getURI()).getParameter(EXPIRES_PARAM_NAME)); } } /*
String parameter = uriParameters.next(); if(!CONTACT_FORBIDDEN_PARAMETER.contains(parameter)) { String value = newSipURI.getParameter(parameter); newContactSipURI.setParameter(parameter, "".equals(value) ? null : value);
public float getQ() { String q = this.getParameter(Q_PARAM_NAME); if(q != null) { // This is how the TCK expects to parse it. See AddressingServlet in TCK spec tests. return Float.parseFloat(q); } else { // I think this is not needed. return ((SipURI)address.getURI()).getParameter(Q_PARAM_NAME) == null ? (float) -1.0 : Float.parseFloat(((SipURI)address.getURI()).getParameter(Q_PARAM_NAME)); } } /*
String pname = (String) i.next(); String p1 = a.getParameter(pname); String p2 = b.getParameter(pname);
public SipURI getSipURI(URI uri) { if(uri instanceof TelURL) { return lookupSipUri(((TelURL)uri).getPhoneNumber()); } else if(uri.isSipURI() && ((SipURI)uri).getParameter("user") != null && ((SipURI)uri).getParameter("user").equalsIgnoreCase("phone")) { String phoneNumber = ((SipURI)uri).getUser(); if(phoneNumber == null || phoneNumber.isEmpty()) { // https://code.google.com/p/sipservlets/issues/detail?id=236 throw new IllegalArgumentException("Phone Number can't be empty in following uri with phone parameter " + uri); } return lookupSipUri(phoneNumber); } else if (uri instanceof SipURI) { return (SipURI) uri; } return null; }
/** * Check to see if the uri to resolve contains a "ob" parameter and if so, try * and locate a "flow" for this uri. * * This is part of the RFC5626 implementation * * @param uriToResolve * @return the flow uri or if no flow was found, the same uri * that was passed into the method */ 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) { // no ob parameter, return return uriToResolve; } final MobicentsSipSession session = getSipSession(); final javax.sip.address.SipURI flow = session.getFlow(); if (flow != null) { if (logger.isDebugEnabled()) { logger.debug("Found a flow \"" + flow + "\" for the original uri \"" + uriToResolve + "\""); } return flow; } return uriToResolve; }
RouteHeader routeHeader = routeHeaders.next(); String serverId = ((SipURI)routeHeader .getAddress().getURI()). getParameter(MessageDispatcher.RR_PARAM_SERVER_NAME); String routeAppNameHashed = ((SipURI)routeHeader .getAddress().getURI()). getParameter(MessageDispatcher.RR_PARAM_APPLICATION_NAME); String routeAppName = null; if(routeAppNameHashed != null) {
RouteHeader routeHeader = routeHeaders.next(); String serverId = ((SipURI)routeHeader .getAddress().getURI()). getParameter(MessageDispatcher.RR_PARAM_SERVER_NAME); String routeAppNameHashed = ((SipURI)routeHeader .getAddress().getURI()). getParameter(MessageDispatcher.RR_PARAM_APPLICATION_NAME); String routeAppName = null; if(routeAppNameHashed != null) {
String serverId = sipUri.getParameter(MessageDispatcher.RR_PARAM_SERVER_NAME); String nextApp = sipUri.getParameter(MessageDispatcher.RR_PARAM_APPLICATION_NAME); final MobicentsSipApplicationSessionKey sipAppKey = getSipSession().getSipApplicationSession().getKey(); final String thisApp = sipFactoryImpl.getSipApplicationDispatcher().getHashFromApplicationName(sipAppKey.getApplicationName());
RouteHeader routeHeader = routeHeaders.next(); String routeServerId = ((javax.sip.address.SipURI)routeHeader .getAddress().getURI()). getParameter(MessageDispatcher.RR_PARAM_SERVER_NAME); String routeAppNameHashed = ((javax.sip.address.SipURI)routeHeader .getAddress().getURI()). getParameter(MessageDispatcher.RR_PARAM_APPLICATION_NAME); String routeAppName = null; if(routeAppNameHashed != null) {
+ remotePort + ";transport=" + transport + " due to a parse exception"); } else if(sipServletRequest.getPoppedRouteHeader() != null && (requestUri instanceof javax.sip.address.SipURI && ((javax.sip.address.SipURI)requestUri).getParameter(SIP_OUTBOUND_PARAM_OB) != null)) {
String nextApp = ((javax.sip.address.SipURI)rHeader.getAddress().getURI()).getParameter(MessageDispatcher.RR_PARAM_APPLICATION_NAME); String serverName = ((javax.sip.address.SipURI)rHeader.getAddress().getURI()).getParameter(MessageDispatcher.RR_PARAM_SERVER_NAME); if(sipFactoryImpl.getSipApplicationDispatcher().getApplicationServerId().equals(serverName) && nextApp != null) { String nextSipAppId = ((javax.sip.address.SipURI)rHeader.getAddress().getURI()).getParameter(MessageDispatcher.APP_ID); if(nextApp != null) { final MobicentsSipApplicationSessionKey sipAppKey = originalRequest.getSipSession().getSipApplicationSession().getKey();
if (uri.isSipURI()) { SipURI sipUri = (SipURI) uri; if(sipUri.getParameter(DNS_ROUTE) != null) { if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) logger.logDebug("Removing Route added by container to conform to RFC 3263 " + route);