Commit aa68890d authored by urbant's avatar urbant
Browse files

RFC 3262 headers

parent 2db718a2
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -734,6 +734,8 @@ private:
		SIP_HEADER_ADD (User-Agent,	,	userAgent,	USER_AGENT_E);
		SIP_HEADER_ADD (Warning,	,	warning,	WARNING_E);
		SIP_HEADER_ADD (WWW-Authenticate,		,	wwwAuthenticate,	WWW_AUTHENTICATE_E);
		SIP_HEADER_ADD (RSeq,		,	rSeq,		RSEQ_E);
		SIP_HEADER_ADD (RAck,		,	rAck,		RACK_E);
		{
			mEntries.push_back(Entry("", "", MessageHeader::id_undefinedHeader_List, ""));
			Entry& e = *mEntries.rbegin();
@@ -1992,4 +1994,33 @@ void WarnAgent::PreDecode (Buffer& buffer) throw (DecodeError)
		SetHypChosenId (id_hostPort);
}

void RSeq::PreDecode (Buffer& buffer) throw (DecodeError)
{
	Get_responseNum().SetFormat(Integer::AsciiDecimal);
}

void RAck::PreDecode (Buffer& buffer) throw (DecodeError)
{
	Get_responseNum().SetFormat(Integer::AsciiDecimal);
	Get_seqNumber().SetFormat(Integer::AsciiDecimal);
}

void RAck::PreDecodeField (int id, Buffer& buffer) throw (DecodeError)
{
	static Regex reg_separator ("^[ ]");
	static Regex reg_method ("^" SIPREG_TOKEN);
	switch (id) { 
		case id_seqNumber:
			reg_separator.AssertMatch (buffer, this);
			reg_separator.MovePast (buffer);
			break;
		case id_method:
			reg_separator.AssertMatch (buffer, this);
			reg_separator.MovePast (buffer);
			reg_method.AssertMatch (buffer, this);
			SetHypFieldLength (id, reg_method.GetMatchedLength());
			break;
	}
}

}} // namespaces