via.setPort(port); via.setTransport(transport);
/** * Get the Via header to assign for this message processor. The topmost via * header of the outoging messages use this. * * @return the ViaHeader to be used by the messages sent via this message processor. */ public Via getViaHeader() { try { Via via = new Via(); if (this.sentByHostPort != null) { via.setSentBy(sentByHostPort); via.setTransport(this.getTransport()); } else { Host host = new Host(); host.setHostname(this.getIpAddress().getHostAddress()); via.setHost(host); via.setPort(this.getPort()); via.setTransport(this.getTransport()); } return via; } catch (ParseException ex) { ex.printStackTrace(); return null; } catch (InvalidArgumentException ex) { ex.printStackTrace(); return null; } } public ListeningPointImpl getListeningPoint() {
topmostVia.setPort(listeningPoint.getPort()); branchId = sipRequest.getTopmostVia().getBranch();