Commit 8fb3a850 authored by berge's avatar berge
Browse files

bug fix in codec

parent 0a016d2c
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ bool is_tel_scheme (const char * pszScheme) {
#define SIPREG_QUOTED_STRING	"[\"]((" SIPREG_LWS ")|[]!#-[^-~" SIPCHARS_UTF8_NONASCII"]|(" SIPREG_QUOTED_PAIR "))*[\"]"
#define SIPREG_DISPLAY_NAME "((" SIPREG_TOKEN "(" SIPREG_LWS SIPREG_TOKEN ")*)|(" SIPREG_QUOTED_STRING "))"

#define SIPREG_COMMENT	"[(]((" SIPREG_LWS ")|[\\x021-\\x5B\\x5D-\\xFD]|(" SIPREG_QUOTED_PAIR "))*[)]"
#define SIPREG_COMMENT	"[(]((" SIPREG_LWS ")|[\\x21-\\x5B]|[\\x5D-\\xFD]|(" SIPREG_QUOTED_PAIR "))*[)]"

// IPv4
#define SIPREG_IP4	"([0-9]{1,3}\\.){3}[0-9]{1,3}"
@@ -785,6 +785,10 @@ void GenericParam::PostDecode (Buffer& buffer) throw (DecodeError)
				if (strcmp (par_name, "tag") == 0)
					goto skip_escape;
			}
			else if (strcmp (parent_type, "PChargingVector") == 0) {
			  if (strcmp (par_name, "icid-value") == 0)
					goto skip_escape;
			}
do_escape:
			normalise_escaped_string (value);
skip_escape: ;
@@ -2383,7 +2387,7 @@ void ServerVal_List::PreEncodeField (int field_id, Buffer& buffer) throw (Encode

void ServerVal_List::PreDecodeField (int id, Buffer& buffer) throw (DecodeError)
{
	static Regex reg_content ("^(" SIPREG_TOKEN "(" SIPREG_SLASH SIPREG_TOKEN ")?|" SIPREG_COMMENT ")");
	static Regex reg_content ("^((?:" SIPREG_TOKEN "(?:" SIPREG_SLASH SIPREG_TOKEN ")?)|" SIPREG_COMMENT ")");
	reg_content.AssertMatch(buffer, this);
	SetHypFieldLength(reg_content.GetMatchedLength());
}