code: public int getInitialRemotePort() {
          // https://code.google.com/p/sipservlets/issues/detail?id=255 includes both ACK Support without tx and packet
          // source port
          if(getMethod().equalsIgnoreCase(Request.ACK)) {
              if(logger.isTraceEnabled()) {
                  logger.trace("ACK request trying to return the Via port as we don't have a transaction");
              }
              // replaced because wasn't giving correct info for ACK
              if(message == null ) {
                  return -1;
              }
              return ((SIPRequest)message).getPeerPacketSourcePort();
          } else if (message != null &&
                  message instanceof SIPRequest ) {
              //https://github.com/Mobicents/jain-sip/issues/42
              //take advantage of new message methods to extract port from msg
              return ((SIPRequest)message).getPeerPacketSourcePort();
          } else if(getTransaction() != null) {
              if(logger.isTraceEnabled()) {
                  logger.trace("transaction not null, returning packet source port");
              }
  			if(((SIPTransaction)getTransaction()).getPeerPacketSourceAddress() != null) {
  				return ((SIPTransaction)getTransaction()).getPeerPacketSourcePort();
  			} else {
  				return ((SIPTransaction)getTransaction()).getPeerPort();
  			}
  		}else {
              if(logger.isTraceEnabled()) {
                  logger.trace("transaction null, returning top via port");
              }
  			ViaHeader via = (ViaHeader) message.getHeader(ViaHeader.NAME);
  			if(via == null ||
  					// https://github.com/Mobicents/sip-servlets/issues/47
  					// check if the via is container generated, if it is then it means
  					// this is an outgoing request or response and thus should return null
  					!sipFactoryImpl.getSipApplicationDispatcher().isViaHeaderExternal(via) ) {
  				return -1;
  			} else {
  				return via.getPort()<=0 ? 5060 : via.getPort();
  			}
  		}
  
  	}
docs: {@inheritDoc}