code: public void setContent(Object content, String contentType)
  			throws UnsupportedEncodingException {
  		// https://code.google.com/p/sipservlets/issues/detail?id=202
  		if(getSipSession().getProxy() == null) {
  			checkMessageState();
  		}
  		checkContentType(contentType);
  		checkCommitted();
  
  		if(contentType != null && contentType.length() > 0) {
  			this.addHeader(ContentTypeHeader.NAME, contentType);
  			ContentTypeHeader contentTypeHeader = (ContentTypeHeader)this.message.getHeader(ContentTypeHeader.NAME);
  			String charset = this.getCharacterEncoding();
  			try {
  			    // https://code.google.com/p/sipservlets/issues/detail?id=169
  				if(contentType.contains(CONTENT_TYPE_MULTIPART) && content instanceof Multipart) {
  					// Fix for Issue 2667 : Correct Handling of MimeMultipart
  					Multipart multipart = (Multipart) content;
  					OutputStream os = new ByteArrayOutputStream();
  					multipart.writeTo(os);
  					this.message.setContent(os.toString(), contentTypeHeader);
  				} else {
  					Object tmpContent = content;
  					if(tmpContent instanceof String  && charset != null) {
  						//test for unsupportedencoding exception
  						new String("testEncoding".getBytes(charset));
  						tmpContent = new String(((String)tmpContent).getBytes());
  					}
  					this.message.setContent(content, contentTypeHeader);
  				}
  			} catch (UnsupportedEncodingException uee) {
  				throw uee;
  			} catch (Exception e) {
  				throw new IllegalArgumentException("Parse error reading content " + content + " with content type " + contentType, e);
  			}
  		}
  	}
docs: /*
  (non-Javadoc)
  @see javax.servlet.sip.SipServletMessage#setContent(java.lang.Object, java.lang.String)