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
liblinphone
Commits
2eb63047
Commit
2eb63047
authored
Jan 20, 2017
by
Sylvain Berfini
🎩
Browse files
Improved performances by preventing parsing addresses for nothing
parent
54081aae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
9 deletions
+1
-9
coreapi/friend.c
coreapi/friend.c
+1
-9
No files found.
coreapi/friend.c
View file @
2eb63047
...
...
@@ -1689,9 +1689,7 @@ LinphoneSubscriptionState linphone_friend_get_subscription_state(const LinphoneF
const
char
*
linphone_friend_phone_number_to_sip_uri
(
LinphoneFriend
*
lf
,
const
char
*
phone_number
)
{
LinphoneFriendPhoneNumberSipUri
*
lfpnsu
;
LinphoneAddress
*
addr
;
char
*
normalized_number
;
char
*
uri
;
char
*
full_uri
;
LinphoneProxyConfig
*
proxy_config
;
bctbx_list_t
*
iterator
=
lf
->
phone_number_sip_uri_map
;
...
...
@@ -1717,14 +1715,8 @@ const char * linphone_friend_phone_number_to_sip_uri(LinphoneFriend *lf, const c
if
(
strstr
(
phone_number
,
"tel:"
)
==
phone_number
)
phone_number
+=
4
;
/* Remove the "tel:" prefix if it is present. */
normalized_number
=
linphone_proxy_config_normalize_phone_number
(
proxy_config
,
phone_number
);
if
(
!
normalized_number
)
return
NULL
;
uri
=
ms_strdup_printf
(
"sip:%s@%s"
,
normalized_number
,
linphone_proxy_config_get_domain
(
proxy_config
));
full_
uri
=
ms_strdup_printf
(
"sip:%s@%s
;user=phone
"
,
normalized_number
,
linphone_proxy_config_get_domain
(
proxy_config
));
ms_free
(
normalized_number
);
addr
=
linphone_core_create_address
(
linphone_friend_get_core
(
lf
),
uri
);
ms_free
(
uri
);
if
(
!
addr
)
return
NULL
;
linphone_address_set_uri_param
(
addr
,
"user"
,
"phone"
);
full_uri
=
linphone_address_as_string_uri_only
(
addr
);
linphone_address_unref
(
addr
);
lfpnsu
=
ms_new0
(
LinphoneFriendPhoneNumberSipUri
,
1
);
lfpnsu
->
number
=
ms_strdup
(
phone_number
);
lfpnsu
->
uri
=
full_uri
;
...
...
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