/** * Set the RPort flag parameter */ public void setRPort(){ // Fix for Issue 309 by jorabin try { this.setParameter(Via.RPORT,null); } catch (ParseException e) { e.printStackTrace(); // should not occur } }
/** * Sets the received parameter of ViaHeader. * * @param received - the newly supplied received parameter. * @throws ParseException which signals that an error has been reached * unexpectedly while parsing the received value. */ public void setReceived(String received) throws ParseException { if (received == null) throw new NullPointerException( "JAIN-SIP Exception, " + "Via, setReceived(), the received parameter is null."); setParameter(ParameterNames.RECEIVED, received); }
/** * Sets the branch parameter of the ViaHeader to the newly supplied * branch value. * * @param branch - the new string branch parmameter of the ViaHeader. * @throws ParseException which signals that an error has been reached * unexpectedly while parsing the branch value. */ public void setBranch(String branch) throws ParseException { if (branch == null || branch.length()==0) throw new NullPointerException( "JAIN-SIP Exception, " + "Via, setBranch(), the branch parameter is null or length 0."); setParameter(ParameterNames.BRANCH, branch); }
/** * Sets the value of the ttl parameter. The ttl parameter specifies the * time-to-live value when packets are sent using UDP multicast. * * @param ttl - new value of the ttl parameter * @throws InvalidArgumentException if supplied value is less than zero or * greater than 255, excluding -1 the default not set value. */ public void setTTL(int ttl) throws InvalidArgumentException { if (ttl < 0 && ttl != -1) throw new InvalidArgumentException( "JAIN-SIP Exception" + ", Via, setTTL(), the ttl parameter is < 0"); setParameter(new NameValue(ParameterNames.TTL, Integer.valueOf(ttl))); }
/** * Sets the value of the <code>maddr</code> parameter of this ViaHeader. The * maddr parameter indicates the server address to be contacted for this * user, overriding any address derived from the host field. * * @param mAddr new value of the <code>maddr</code> parameter * @throws ParseException which signals that an error has been reached * unexpectedly while parsing the mAddr value. */ public void setMAddr(String mAddr) throws ParseException { if (mAddr == null) throw new NullPointerException( "JAIN-SIP Exception, " + "Via, setMAddr(), the mAddr parameter is null."); Host host = new Host(); host.setAddress(mAddr); NameValue nameValue = new NameValue(ParameterNames.MADDR, host); setParameter(nameValue); }
public Object clone() { Via retval = (Via) super.clone(); if (this.sentProtocol != null) retval.sentProtocol = (Protocol) this.sentProtocol.clone(); if (this.sentBy != null) retval.sentBy = (HostPort) this.sentBy.clone(); if ( this.getRPort() != -1) retval.setParameter(RPORT,this.getRPort()); return retval; }
|| !hop.getHost().equals( this.peerAddress.getHostAddress())) { topMostVia.setParameter(Via.RECEIVED, this.peerAddress .getHostAddress()); topMostVia.setParameter(Via.RPORT, Integer .toString(this.peerPacketSourcePort));
v.setParameter(nameValue); this.lexer.SPorHT();
v.setParameter(nameValue); this.lexer.SPorHT();
|| !hop.getHost().equals( this.peerAddress.getHostAddress())) { v.setParameter(Via.RECEIVED, this.peerAddress .getHostAddress()); v.setParameter(Via.RPORT, Integer.toString(this.peerPort)); } catch (java.text.ParseException ex) { InternalErrorHandler.handleException(ex);