Commit 9243291c authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Correctly put phone numbers in resource list xml.

parent dd6f8869
...@@ -156,10 +156,20 @@ static char * create_resource_list_xml(const LinphoneFriendList *list) { ...@@ -156,10 +156,20 @@ static char * create_resource_list_xml(const LinphoneFriendList *list) {
iterator = numbers; iterator = numbers;
while (iterator) { while (iterator) {
const char *number = (const char *)bctbx_list_get_data(iterator); const char *number = (const char *)bctbx_list_get_data(iterator);
char *normalized_number = linphone_proxy_config_normalize_phone_number(proxy_config, number); char *normalized_number;
if (strstr(number, "tel:") == number) number += 4; /* Remove the "tel:" prefix if it is present. */
normalized_number = linphone_proxy_config_normalize_phone_number(proxy_config, number);
if (normalized_number) { if (normalized_number) {
char *uri = ms_strdup_printf("%s;user=phone", normalized_number); char *uri = ms_strdup_printf("sip:%s@%s", normalized_number, linphone_proxy_config_get_domain(proxy_config));
err = add_uri_entry(writer, err, uri); LinphoneAddress *addr = linphone_core_create_address(lf->lc, uri);
if (addr) {
char *full_uri;
linphone_address_set_uri_param(addr, "user", "phone");
full_uri = linphone_address_as_string_uri_only(addr);
err = add_uri_entry(writer, err, full_uri);
ms_free(full_uri);
linphone_address_unref(addr);
}
ms_free(uri); ms_free(uri);
ms_free(normalized_number); ms_free(normalized_number);
} }
......
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