* @return
*/
private Message parseMessage(SipcNotify notify)
{
String body = notify.getBody()!=null?notify.getBody().toSendString():""; //防止产生NULL错误
Message msg = null;
SipcHeader contentHeader = notify.getHeader(SipcHeader.CONTENT_TYPE);
if(contentHeader!=null) {
String value = contentHeader.getValue();
if(Message.TYPE_PLAIN.equals(value)){
msg = new Message(body, Message.TYPE_PLAIN);
}else if(Message.TYPE_HTML.equals(value)){
msg = new Message(body, Message.TYPE_HTML);
}else{
msg = new Message(body, Message.TYPE_PLAIN);
}
}else {
msg = new Message(body, Message.TYPE_PLAIN); //默认为普通文本
}
return msg;
}