Commit b2f5366f authored by baire's avatar baire
Browse files

support for content-type

parent 03b2cb9b
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -627,6 +627,7 @@ private:
		SIP_HEADER_ADD (Call-ID,	i,	callId,		CALL_ID_E);
		SIP_HEADER_ADD (CSeq,		 ,	cSeq,		CSEQ_E);
		SIP_HEADER_ADD (Content-Length,	l,	contentLength,	CONTENT_LENGTH_E);
		SIP_HEADER_ADD (Content-Type,	c,	contentType,	CONTENT_TYPE_E);
		{
			mEntries.push_back(Entry("", "", MessageHeader::id_undefinedHeader_List, ""));
			Entry& e = *mEntries.rbegin();
@@ -939,4 +940,15 @@ void ContentLength::PreDecode (Buffer& buffer) throw (DecodeError)
	Get_len().SetFormat(Integer::AsciiDecimal);
}

void ContentType::PreDecodeField (int id, Buffer& buffer) throw (DecodeError)
{
	static Regex reg_ctype ("^" SIPREG_TOKEN "/" SIPREG_TOKEN);
	if (id == id_mediaType)
	{
		reg_ctype.AssertMatch (buffer, this);
		SetHypFieldLength (id, reg_ctype.GetMatchedLength());
	}
	
}

}} // namespaces