public void setHeader(String name, String value) {
		if(logger.isDebugEnabled()) {
        	logger.debug("setHeader - name=" + name + ", value=" + value);
        }

		if(name == null) {
			throw new NullPointerException ("name parameter is null");
		}
		if(value == null) {
			throw new NullPointerException ("value parameter is null");
		}
		if (isSystemHeader(getModifiableRule(name))) {
			throw new IllegalArgumentException(name + " is a system header !");
		}
		checkCommitted();

		try {
			// Dealing with Allow:INVITE, ACK, CANCEL, OPTIONS, BYE kind of headers
			if(JainSipUtils.LIST_HEADER_NAMES.contains(name)) {
				this.message.removeHeader(name);
				List<Header> headers = SipFactory.getInstance().createHeaderFactory()
					.createHeaders(name + ":" + value);
				for (Header header : headers) {
					this.message.addHeader(header);
				}
			} else {
				// dealing with non list headers and extension header
				Header header = SipFactory.getInstance().createHeaderFactory()
					.createHeader(name, value);
				this.message.setHeader(header);
			}
		} catch (Exception e) {
			throw new IllegalArgumentException("Error creating header!", e);
		}
	}
public void setHeader ( String name , String value ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "setHeader - name=" + name + ", value=" + value ) ; } if ( name == null ) { throw new NullPointerException ( "name parameter is null" ) ; } if ( value == null ) { throw new NullPointerException ( "value parameter is null" ) ; } if ( isSystemHeader ( getModifiableRule ( name ) ) ) { throw new IllegalArgumentException ( name + " is a system header !" ) ; } checkCommitted ( ) ; try { if ( JainSipUtils . LIST_HEADER_NAMES . contains ( name ) ) { this . message . removeHeader ( name ) ; List < Header > headers = SipFactory . getInstance ( ) . createHeaderFactory ( ) . createHeaders ( name + ":" + value ) ; for ( Header header : headers ) { this . message . addHeader ( header ) ; } } else { Header header = SipFactory . getInstance ( ) . createHeaderFactory ( ) . createHeader ( name , value ) ; this . message . setHeader ( header ) ; } } catch ( Exception e ) { throw new IllegalArgumentException ( "Error creating header!" , e ) ; } }
/*
(non-Javadoc)
@see javax.servlet.sip.SipServletMessage#setHeader(java.lang.String, java.lang.String)