Commit edc8f040 authored by jehan's avatar jehan
Browse files

allow display name of type (token LWS)* instead of just token

parent 2023a23a
......@@ -642,8 +642,10 @@ addr_spec[belle_sip_header_address_t* object]
paramless_addr_spec[belle_sip_header_address_t* object]
: lws? paramless_uri {belle_sip_header_address_set_uri(object,$paramless_uri.ret);} lws? ;//| absoluteURI;
display_name_tokens
:token (lws token)* ;
display_name[belle_sip_header_address_t* object]
: token {belle_sip_header_address_set_displayname(object,(const char*)($token.text->chars));}
: display_name_tokens {belle_sip_header_address_set_displayname(object,(const char*)($display_name_tokens.text->chars));}
| quoted_string
{
char* unescaped_char = belle_sip_string_to_backslash_less_unescaped_string((const char*)($quoted_string.text->chars));
......
......@@ -76,13 +76,13 @@ static void test_complex_contact_header(void) {
belle_sip_object_unref(BELLE_SIP_OBJECT(L_contact));
L_contact = belle_sip_header_contact_parse("Contact: toto <sip:titi.com>;expires=3600; q=0.7");
L_contact = belle_sip_header_contact_parse("Contact: super toto <sip:titi.com>;expires=3600; q=0.7");
l_raw_header = belle_sip_object_to_string(BELLE_SIP_OBJECT(L_contact));
belle_sip_object_unref(BELLE_SIP_OBJECT(L_contact));
L_contact = belle_sip_header_contact_parse(l_raw_header);
belle_sip_free(l_raw_header);
CU_ASSERT_STRING_EQUAL(belle_sip_header_address_get_displayname((belle_sip_header_address_t*)L_contact), "toto");
CU_ASSERT_STRING_EQUAL(belle_sip_header_address_get_displayname((belle_sip_header_address_t*)L_contact), "super toto");
belle_sip_object_unref(BELLE_SIP_OBJECT(L_contact));
CU_ASSERT_PTR_NULL(belle_sip_header_contact_parse("m:sip:titi.com, nimportequoi"));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment