Exemplo n.º 1
0
/**
 * 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  method - new value of the <code>maddr</code> parameter
 * @throws ParseException which signals that an error has been reached
 * unexpectedly while parsing the mAddr value.
 */
func (this *Via) SetMAddr(mAddr string) (ParseException error) {
	if mAddr == "" {
		return errors.New("NullPointerException: GoSIP Exception, Via, setMAddr(), the mAddr parameter is null.")
	}
	host := core.NewHost(mAddr)
	//host.SetAddress(mAddr)
	//println(host.String())
	this.SetParameter(ParameterNames_MADDR, host.String())
	return nil
}
Exemplo n.º 2
0
/**
 * Set the host part of this ViaHeader to the newly supplied <code>host</code>
 * parameter.
 *
 * @return host - the new interger value of the host of this ViaHeader
 * @throws ParseException which signals that an error has been reached
 * unexpectedly while parsing the host value.
 */
func (this *Via) SetHostFromString(host string) (ParseException error) {
	if this.sentBy == nil {
		this.sentBy = core.NewHostPort()
	}
	//try {
	h := core.NewHost(host)
	this.sentBy.SetHost(h)
	//}
	//catch(Exception e) {
	//    throw new  NullPointerException(" host parameter is null");
	//}
	return nil
}
Exemplo n.º 3
0
/** Returns the host part of this SipURI.
 *
 * @return  the host part of this SipURI
 */
func (this *SipURIImpl) SetHostString(host string) {
	h := core.NewHost(host)
	this.SetHost(h)
}