Commit 171c3ad7 authored by baire's avatar baire
Browse files

hanle escaped chars in generic paraameter name only if it is in the SipUrl semicolon parameter list

parent 3e578351
Loading
Loading
Loading
Loading
+18 −15
Original line number Diff line number Diff line
@@ -798,8 +798,18 @@ void RequestLine::PostEncodeField (int field_id, Buffer& buffer) throw (EncodeEr

void GenericParam::PostDecode (Buffer& buffer) throw (DecodeError)
{
	Variable* param_list = GetParent();
	if (!param_list)
		return;
	
	Variable* parent = param_list->GetParent();
	if (!parent)
		return;
	const char* parent_type = parent->GetTypeName();

	if (strcmp (parent_type, "SipUrl") == 0) {
		normalise_escaped_string (Get_id());
	}

	if (IsPresent (id_paramValue))
	{
@@ -811,21 +821,14 @@ void GenericParam::PostDecode (Buffer& buffer) throw (DecodeError)
		} else {
			const char* par_name = Get_id().GetValue();
			
			Variable* param_list = GetParent();
			if (param_list) {
			    Variable* parent = param_list->GetParent();
			    if (parent) {
				const char* ptype = parent->GetTypeName();
			//TODO: add other unescaped params
				if (strcmp (ptype, "ViaBody") == 0) {
			if (strcmp (parent_type, "ViaBody") == 0) {
				if ((strcmp (par_name, "branch") == 0)
				 || (strcmp (par_name, "ttl") == 0)
				 || (strcmp (par_name, "maddr") == 0)
				 || (strcmp (par_name, "received") == 0))
					goto skip_escape;
			}
			    }
			}
do_escape:
			normalise_escaped_string (value);
skip_escape: ;