/** * Attach a header (replacing the original header). * @param header SIPHeader that replaces a header of the same type. */ func (this *SIPMessage) SetHeader(h header.Header) (IllegalArgumentException error) { if h == nil { return errors.New("IllegalArgumentException: nil header!") } if hl, ok := h.(header.SIPHeaderLister); ok { // Ignore empty lists. if hl.Len() == 0 { return nil } } this.RemoveHeader(h.GetHeaderName()) return this.AttachHeader3(h, true, false) }