/** * @param originalRequest the originalRequest to set */ public void setOriginalRequest(SipServletRequestImpl originalRequest) { this.originalRequest = originalRequest; if(originalRequest == null && recordRouteURI != null) { recordRouteURIString = recordRouteURI.toString(); recordRouteURI = null; } }
public void setOutboundInterface(InetAddress inetAddress) { if(inetAddress == null) { throw new NullPointerException("outbound Interface param shouldn't be null"); } String address = inetAddress.getHostAddress(); List<SipURI> list = this.sipFactoryImpl.getSipNetworkInterfaceManager().getOutboundInterfaces(); SipURI networkInterface = null; for(SipURI networkInterfaceURI : list) { if(networkInterfaceURI.toString().contains(address)) { networkInterface = networkInterfaceURI; break; } } if(networkInterface == null) throw new IllegalArgumentException("Network interface for " + inetAddress.getHostAddress() + " not found"); outboundInterface = networkInterface; }
public void setOutboundInterface(InetSocketAddress inetSocketAddress) { if(inetSocketAddress == null) { throw new NullPointerException("outbound Interface param shouldn't be null"); } String address = inetSocketAddress.getAddress().getHostAddress() + ":" + inetSocketAddress.getPort(); List<SipURI> list = this.sipFactoryImpl.getSipNetworkInterfaceManager().getOutboundInterfaces(); SipURI networkInterface = null; for(SipURI networkInterfaceURI : list) { if(networkInterfaceURI.toString().contains(address)) { networkInterface = networkInterfaceURI; break; } } if(networkInterface == null) throw new IllegalArgumentException("Network interface for " + address + " not found"); outboundInterface = networkInterface; }
public void setOutboundInterface(InetSocketAddress inetSocketAddress) { if(!isValid()) { throw new IllegalStateException("the session has been invalidated"); } if(inetSocketAddress == null) { throw new NullPointerException("parameter is null"); } String address = inetSocketAddress.getAddress().getHostAddress() + ":" + inetSocketAddress.getPort(); List<SipURI> list = sipFactory.getSipNetworkInterfaceManager().getOutboundInterfaces(); SipURI networkInterface = null; for(SipURI networkInterfaceURI : list) { if(networkInterfaceURI.toString().contains(address)) { networkInterface = networkInterfaceURI; break; } } if(networkInterface == null) throw new IllegalArgumentException("Network interface for " + address + " not found"); try { outboundInterface = new SipURIImpl(SipFactoryImpl.addressFactory.createSipURI(null, address), ModifiableRule.NotModifiable).toString(); } catch (ParseException e) { logger.error("couldn't parse the SipURI from USER[" + null + "] HOST[" + address + "]", e); throw new IllegalArgumentException("Could not create SIP URI user = " + null + " host = " + address); } }
/** * {@inheritDoc} */ public void setOutboundInterface(InetSocketAddress inetSocketAddress) { if(inetSocketAddress == null) { throw new NullPointerException("outbound Interface param shouldn't be null"); } checkSessionValidity(); String address = inetSocketAddress.getAddress().getHostAddress() + ":" + inetSocketAddress.getPort(); List<SipURI> list = proxy.getSipFactoryImpl().getSipNetworkInterfaceManager().getOutboundInterfaces(); SipURI networkInterface = null; for(SipURI networkInterfaceURI : list) { if(networkInterfaceURI.toString().contains(address)) { networkInterface = networkInterfaceURI; break; } } if(networkInterface == null) throw new IllegalArgumentException("Network interface for " + outboundInterface + " not found"); outboundInterface = proxy.getSipFactoryImpl().createSipURI(null, address); }
public void setOutboundInterface(InetAddress inetAddress) { if(!isValid()) { throw new IllegalStateException("the session has been invalidated"); } if(inetAddress == null) { throw new NullPointerException("parameter is null"); } String address = inetAddress.getHostAddress(); List<SipURI> list = sipFactory.getSipNetworkInterfaceManager().getOutboundInterfaces(); SipURI networkInterface = null; for(SipURI networkInterfaceURI : list) { if(networkInterfaceURI.toString().contains(address)) { networkInterface = networkInterfaceURI; break; } } if(networkInterface == null) throw new IllegalArgumentException("Network interface for " + address + " not found"); try { outboundInterface = new SipURIImpl(SipFactoryImpl.addressFactory.createSipURI(null, address), ModifiableRule.NotModifiable).toString(); } catch (ParseException e) { logger.error("couldn't parse the SipURI from USER[" + null + "] HOST[" + address + "]", e); throw new IllegalArgumentException("Could not create SIP URI user = " + null + " host = " + address); } }
public void checkAndCleanProxy() { // https://telestax.atlassian.net/browse/MSS-153 optimize performance by cleaning up the original request to reduce the retained mem size if(this.transactionMap.size() == 0 && originalRequest != null) { if(logger.isDebugEnabled()) { logger.debug("Cleaning Proxy to optimize perf " + this); } originalRequest.cleanUp(); originalRequest.cleanUpLastResponses(); originalRequest = null; if(recordRouteURI != null) { recordRouteURIString = recordRouteURI.toString(); recordRouteURI = null; } if(finalBranchForSubsequentRequests != null) { if(logger.isDebugEnabled()) { logger.debug("Cleaning proxy finalBranchForSubsequentRequests to optimize perf " + this); } finalBranchForSubsequentRequests.cancelTimer(); finalBranchForSubsequentRequests.setResponse(null); finalBranchForSubsequentRequests.setOriginalRequest(null); finalBranchForSubsequentRequests.setOutgoingRequest(null); } } }
/** * {@inheritDoc} */ public void setOutboundInterface(InetAddress inetAddress) { if(inetAddress == null) { throw new NullPointerException("outbound Interface param shouldn't be null"); } checkSessionValidity(); String address = inetAddress.getHostAddress(); List<SipURI> list = proxy.getSipFactoryImpl().getSipNetworkInterfaceManager().getOutboundInterfaces(); SipURI networkInterface = null; for(SipURI networkInterfaceURI : list) { if(networkInterfaceURI.toString().contains(address)) { networkInterface = networkInterfaceURI; break; } } if(networkInterface == null) throw new IllegalArgumentException("Network interface for " + outboundInterface + " not found"); outboundInterface = proxy.getSipFactoryImpl().createSipURI(null, address); }
public void setOutboundInterface(SipURI outboundInterface) { if(!isValid()) { throw new IllegalStateException("the session has been invalidated"); } if(outboundInterface == null) { throw new NullPointerException("parameter is null"); } List<SipURI> list = sipFactory.getSipNetworkInterfaceManager().getOutboundInterfaces(); SipURI networkInterface = null; for(SipURI networkInterfaceURI : list) { if(networkInterfaceURI.equals(outboundInterface)) { networkInterface = networkInterfaceURI; break; } } if(networkInterface == null) throw new IllegalArgumentException("Network interface for " + outboundInterface + " not found"); this.outboundInterface = outboundInterface.toString(); if(outboundInterface.getTransportParam() != null) { this.transport = outboundInterface.getTransportParam(); } }
message.pushRoute((SipURI)uri); if(logger.isDebugEnabled()) { logger.debug("added ROUTE parVal =" + uri.toString());
uri.setTransportParam("udp"); return uri.toString();
builder.setDateCreated(DateTime.now()); builder.setAccountSid(fromClient.getAccountSid()); builder.setTo(to.toString()); builder.setCallerName(fromClient.getFriendlyName()); builder.setFrom(fromClient.getFriendlyName()); incomingSession.setAttribute(CDR_FROM, fromClient.getLogin()); outgoingSession.setAttribute(CDR_FROM, fromClient.getLogin()); incomingSession.setAttribute(CDR_TO, to.toString()); outgoingSession.setAttribute(CDR_TO, to.toString());
Header routeHeader = SipFactoryImpl.headerFactory.createHeader(RouteHeader.NAME, sipURI.toString());
Header routeHeader = SipFactoryImpl.headerFactory.createHeader(RouteHeader.NAME, sipURI.toString()); request.addHeader(routeHeader);