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(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(SipURI outboundInterface) { if(outboundInterface == null) { throw new NullPointerException("outbound Interface param shouldn't be null"); } List<SipURI> list = this.sipFactoryImpl.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 = networkInterface; }
/** * {@inheritDoc} */ public void setAddToPath(boolean isAddToPath) { if(started) { throw new IllegalStateException("Cannot set a record route on an already started proxy"); } if(this.pathURI == null) { this.pathURI = new SipURIImpl (JainSipUtils.createRecordRouteURI( proxy.getSipFactoryImpl().getSipNetworkInterfaceManager(), null), ModifiableRule.NotModifiable); } this.isAddToPath = isAddToPath; }
public void setAddToPath(boolean p) { if(started) { throw new IllegalStateException("Cannot set a record route on an already started proxy"); } if(this.pathURI == null) { this.pathURI = new SipURIImpl ( JainSipUtils.createRecordRouteURI( sipFactoryImpl.getSipNetworkInterfaceManager(), null), ModifiableRule.Modifiable); pathURI.setLrParam(true); pathURI.setIsModifiable(ModifiableRule.NotModifiable); } addToPath = p; }
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(SipURI outboundInterface) { checkSessionValidity(); if(outboundInterface == null) { throw new NullPointerException("outbound Interface param shouldn't be null"); } List<SipURI> list = proxy.getSipFactoryImpl().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 = networkInterface; }
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 setRecordRoute(boolean rr) { if(started) { throw new IllegalStateException("Cannot set a record route on an already started proxy"); } if(rr) { Message message = null; if(originalRequest != null) { message = originalRequest.getMessage(); } // record route should be based on the original received message javax.sip.address.SipURI flowUri= originalRequest.getSipSession().getFlow(); if(flowUri != null) { this.recordRouteURIString = flowUri.toString(); if(logger.isDebugEnabled()) logger.debug("Using Session Flow URI as record route URI " + recordRouteURIString); } else { this.recordRouteURIString = JainSipUtils.createRecordRouteURI( sipFactoryImpl.getSipNetworkInterfaceManager(), message).toString(); } if(logger.isDebugEnabled()) { logger.debug("Record routing enabled for proxy, Record Route used will be : " + recordRouteURIString); } } this.recordRoutingEnabled = rr; }
/** * {@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(); } }
public String getLocalAddr() { final SIPTransaction sipTransaction = (SIPTransaction)getTransaction(); if(sipTransaction != null) { return sipTransaction.getHost(); } else { final String transport = JainSipUtils.findTransport(message); final MobicentsExtendedListeningPoint listeningPoint = sipFactoryImpl.getSipNetworkInterfaceManager().findMatchingListeningPoint(transport, false); return listeningPoint.getHost(true); } }
public int getLocalPort() { final SIPTransaction sipTransaction = (SIPTransaction)getTransaction(); if(sipTransaction != null) { return sipTransaction.getPort(); } else { final String transport = JainSipUtils.findTransport(message); final MobicentsExtendedListeningPoint listeningPoint = sipFactoryImpl.getSipNetworkInterfaceManager().findMatchingListeningPoint(transport, false); return listeningPoint.getPort(); } } // Fix for Issue 1552 http://code.google.com/p/mobicents/issues/detail?id=1552
MobicentsExtendedListeningPoint listeningPoint = mobicentsExtendedListeningPoint; if(mobicentsExtendedListeningPoint == null) { listeningPoint = getSipNetworkInterfaceManager().findMatchingListeningPoint(transport, false); if (logger.isDebugEnabled()) { logger.debug("mobicentsExtendedListeningPoint was null, found a listening point to use " + listeningPoint); boolean usePublicAddress = JainSipUtils.findUsePublicAddress(getSipNetworkInterfaceManager(), request, listeningPoint); String nodeHost= listeningPoint.getHost(usePublicAddress); if (logger.isDebugEnabled()) {
final SipNetworkInterfaceManager sipNetworkInterfaceManager = sipFactoryImpl.getSipNetworkInterfaceManager(); final Request request = (Request) super.message; final MobicentsSipSession session = getSipSession();
sipUri.setTransportParam(transport); MobicentsExtendedListeningPoint listeningPoint = getSipNetworkInterfaceManager().findMatchingListeningPoint(transport, false); sipUri.setParameter(MessageDispatcher.ROUTE_PARAM_NODE_HOST, listeningPoint.getHost(JainSipUtils.findUsePublicAddress(getSipNetworkInterfaceManager(), request, listeningPoint))); sipUri.setParameter(MessageDispatcher.ROUTE_PARAM_NODE_PORT, "" + listeningPoint.getPort());
public static void optimizeUriForInternalRoutingRequest(SipConnector sipConnector, javax.sip.address.SipURI sipUri, MobicentsSipSession session, SipFactoryImpl sipFactoryImpl, String transport) { SipNetworkInterfaceManager sipNetworkInterfaceManager = sipFactoryImpl.getSipNetworkInterfaceManager();
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()); prackRequest.addHeader(viaHeader);
final Request request = (Request) super.message; final javax.sip.address.SipURI sipURI = JainSipUtils.createRecordRouteURI( sipFactoryImpl.getSipNetworkInterfaceManager(), request); sipURI.setLrParam();