diff --git a/coreapi/address.c b/coreapi/address.c index 35fbe2808..696ff0ba8 100644 --- a/coreapi/address.c +++ b/coreapi/address.c @@ -178,6 +178,10 @@ void linphone_address_set_header(LinphoneAddress *addr, const char *header_name, sal_address_set_header(addr,header_name,header_value); } +const char *linphone_address_get_header(const LinphoneAddress *addr, const char *name){ + return sal_address_get_header(addr,name); +} + bool_t linphone_address_has_param(const LinphoneAddress *addr, const char *name) { return sal_address_has_param(addr, name); } diff --git a/coreapi/bellesip_sal/sal_address_impl.c b/coreapi/bellesip_sal/sal_address_impl.c index 6a9afe9d5..dbeb9b8e0 100644 --- a/coreapi/bellesip_sal/sal_address_impl.c +++ b/coreapi/bellesip_sal/sal_address_impl.c @@ -236,6 +236,11 @@ void sal_address_set_header(SalAddress *addr, const char *header_name, const cha belle_sip_uri_set_header(belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(addr)),header_name, header_value); } + +const char* sal_address_get_header(const SalAddress *addr, const char *name){ + return belle_sip_uri_get_header(belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(addr)),name); +} + void sal_address_set_transport(SalAddress* addr,SalTransport transport){ if (!sal_address_is_secure(addr)){ SAL_ADDRESS_SET(addr,transport_param,sal_transport_to_string(transport)); diff --git a/include/linphone/address.h b/include/linphone/address.h index f7eef3f5c..f92ff36f3 100644 --- a/include/linphone/address.h +++ b/include/linphone/address.h @@ -201,6 +201,12 @@ LINPHONE_PUBLIC const char *linphone_address_get_password(const LinphoneAddress **/ LINPHONE_PUBLIC void linphone_address_set_header(LinphoneAddress *addr, const char *header_name, const char *header_value); +/** + * Get the header encoded in the address. + * @param addr the address +**/ +LINPHONE_PUBLIC const char * linphone_address_get_header(const LinphoneAddress *addr, const char *name); + LINPHONE_PUBLIC bool_t linphone_address_has_param(const LinphoneAddress *addr, const char *name); LINPHONE_PUBLIC const char * linphone_address_get_param(const LinphoneAddress *addr, const char *name); diff --git a/include/sal/sal.h b/include/sal/sal.h index 0ca64c958..5a31f304b 100644 --- a/include/sal/sal.h +++ b/include/sal/sal.h @@ -145,6 +145,7 @@ bool_t sal_address_is_sip(const SalAddress *addr); void sal_address_set_password(SalAddress *addr, const char *passwd); const char *sal_address_get_password(const SalAddress *addr); void sal_address_set_header(SalAddress *addr, const char *header_name, const char *header_value); +const char *sal_address_get_header(const SalAddress *addr, const char *name); LINPHONE_PUBLIC Sal * sal_init(MSFactory *factory); LINPHONE_PUBLIC void sal_uninit(Sal* sal);