return sal_address_get_display_name(u);
}
-/**
- * Returns the display name without quotes.
- * @note WARNING: the returned string must be freed by user.
-**/
-char *linphone_address_get_display_name_unquoted(const LinphoneAddress *addr){
- return sal_address_get_display_name_unquoted(addr);
-}
-
/**
* Returns the username.
**/
return sal_address_as_string_uri_only(u);
}
+static bool_t strings_equals(const char *s1, const char *s2){
+ if (s1==NULL && s2==NULL) return TRUE;
+ if (s1!=NULL && s2!=NULL && strcmp(s1,s2)==0) return TRUE;
+ return FALSE;
+}
+
+/**
+ * Compare two LinphoneAddress ignoring tags and headers, basically just domain, username, and port.
+ * Returns TRUE if they are equal.
+**/
+bool_t linphone_address_weak_equal(const LinphoneAddress *a1, const LinphoneAddress *a2){
+ const char *u1,*u2;
+ const char *h1,*h2;
+ int p1,p2;
+ u1=linphone_address_get_username(a1);
+ u2=linphone_address_get_username(a2);
+ p1=linphone_address_get_port_int(a1);
+ p2=linphone_address_get_port_int(a2);
+ h1=linphone_address_get_domain(a1);
+ h2=linphone_address_get_domain(a2);
+ return strings_equals(u1,u2) && strings_equals(h1,h2) && p1==p2;
+}
+
/**
* Destroys a LinphoneAddress object.
**/
sal_address_destroy(u);
}
+int linphone_address_get_port_int(const LinphoneAddress *u) {
+ return sal_address_get_port_int(u);
+}
+
+const char* linphone_address_get_port(const LinphoneAddress *u) {
+ return sal_address_get_port(u);
+}
/** @} */