Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
belle-sip
Commits
edc8f040
Commit
edc8f040
authored
Sep 29, 2014
by
jehan
Browse files
allow display name of type (token LWS)* instead of just token
parent
2023a23a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
src/grammars/belle_sip_message.g
src/grammars/belle_sip_message.g
+3
-1
tester/belle_sip_headers_tester.c
tester/belle_sip_headers_tester.c
+2
-2
No files found.
src/grammars/belle_sip_message.g
View file @
edc8f040
...
...
@@ -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_
token
s
{belle_sip_header_address_set_displayname(object,(const char*)($
display_name_
token
s
.text->chars));}
| quoted_string
{
char* unescaped_char = belle_sip_string_to_backslash_less_unescaped_string((const char*)($quoted_string.text->chars));
...
...
tester/belle_sip_headers_tester.c
View file @
edc8f040
...
...
@@ -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"
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment