Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package belle-sip for openSUSE:Factory 
checked in at 2022-03-01 19:07:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/belle-sip (Old)
 and      /work/SRC/openSUSE:Factory/.belle-sip.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "belle-sip"

Tue Mar  1 19:07:02 2022 rev:25 rq:958305 version:5.1.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/belle-sip/belle-sip.changes      2022-02-02 
22:45:02.150058794 +0100
+++ /work/SRC/openSUSE:Factory/.belle-sip.new.1958/belle-sip.changes    
2022-03-01 19:07:03.488174586 +0100
@@ -1,0 +2,8 @@
+Tue Mar  1 15:27:39 UTC 2022 - Paolo Stivanin <[email protected]>
+
+- Update to 5.1.0:
+  * Multipart boundaries are random and used-once.
+  * Avoid using V4MAPPED formatted IP addresses in CONNECT http requests,
+    because http proxies may not be always IPv6-capable.
+
+-------------------------------------------------------------------

Old:
----
  belle-sip-5.0.67.tar.bz2

New:
----
  belle-sip-5.1.0.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ belle-sip.spec ++++++
--- /var/tmp/diff_new_pack.uc3hlB/_old  2022-03-01 19:07:04.172174564 +0100
+++ /var/tmp/diff_new_pack.uc3hlB/_new  2022-03-01 19:07:04.176174564 +0100
@@ -20,7 +20,7 @@
 %define soname  libbellesip
 %define sover   1
 Name:           belle-sip
-Version:        5.0.67
+Version:        5.1.0
 Release:        0
 Summary:        C object-oriented SIP Stack
 License:        GPL-3.0-only

++++++ belle-sip-5.0.67.tar.bz2 -> belle-sip-5.1.0.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/CHANGELOG.md 
new/belle-sip-5.1.0/CHANGELOG.md
--- old/belle-sip-5.0.67/CHANGELOG.md   2021-12-14 09:08:31.000000000 +0100
+++ new/belle-sip-5.1.0/CHANGELOG.md    2022-02-03 15:07:52.000000000 +0100
@@ -6,7 +6,12 @@
 
 ## [Unreleased]
 
+## [5.1.0] - 2022-02-14
 
+### Fixed
+- Multipart boundaries are random and used-once.
+- Avoid using V4MAPPED formatted IP addresses in CONNECT http requests, because
+  http proxies may not be always IPv6-capable.
 
 ## [5.0.0] - 2021-07-08
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/CMakeLists.txt 
new/belle-sip-5.1.0/CMakeLists.txt
--- old/belle-sip-5.0.67/CMakeLists.txt 2021-12-14 09:08:31.000000000 +0100
+++ new/belle-sip-5.1.0/CMakeLists.txt  2022-02-03 15:07:52.000000000 +0100
@@ -28,7 +28,7 @@
     cmake_policy(SET CMP0077 NEW)
 endif()
 
-project(belle-sip VERSION 5.0.0 LANGUAGES C CXX)
+project(belle-sip VERSION 5.1.0 LANGUAGES C CXX)
 
 set(PACKAGE "${PROJECT_NAME}")
 set(PACKAGE_NAME "${PROJECT_NAME}")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/include/belle-sip/belle-sdp.h 
new/belle-sip-5.1.0/include/belle-sip/belle-sdp.h
--- old/belle-sip-5.0.67/include/belle-sip/belle-sdp.h  2021-12-14 
09:08:31.000000000 +0100
+++ new/belle-sip-5.1.0/include/belle-sip/belle-sdp.h   2022-02-03 
15:07:52.000000000 +0100
@@ -64,6 +64,36 @@
 #define BELLE_SDP_RAW_ATTRIBUTE(t) BELLE_SDP_CAST(t,belle_sdp_raw_attribute_t)
 
 
/***************************************************************************************
+ * RFC4574 Attributes
+ *
+ 
**************************************************************************************/
+
+// label
+
+typedef struct _belle_sdp_label_attribute belle_sdp_label_attribute_t;
+BELLESIP_EXPORT belle_sdp_label_attribute_t* 
belle_sdp_label_attribute_new(void);
+BELLESIP_EXPORT belle_sdp_label_attribute_t* 
belle_sdp_label_attribute_parse(const char* attribute);
+BELLESIP_EXPORT belle_sdp_label_attribute_t* 
belle_sdp_label_attribute_create(void);
+BELLESIP_EXPORT const char* belle_sdp_label_attribute_get_pointer(const 
belle_sdp_label_attribute_t* attribute);
+BELLESIP_EXPORT void 
belle_sdp_label_attribute_set_pointer(belle_sdp_label_attribute_t* attribute, 
const char* pointer);
+#define BELLE_SDP_LABEL_ATTRIBUTE(t) 
BELLE_SDP_CAST(t,belle_sdp_label_attribute_t)
+
+/***************************************************************************************
+ * RFC4796 Attributes
+ *
+ 
**************************************************************************************/
+
+// content
+
+typedef struct _belle_sdp_content_attribute belle_sdp_content_attribute_t;
+BELLESIP_EXPORT belle_sdp_content_attribute_t* 
belle_sdp_content_attribute_parse(const char* attribute);
+BELLESIP_EXPORT belle_sdp_content_attribute_t* 
belle_sdp_content_attribute_new(void);
+BELLESIP_EXPORT belle_sdp_content_attribute_t* 
belle_sdp_content_attribute_create(void);
+BELLESIP_EXPORT void 
belle_sdp_content_attribute_add_media_tag(belle_sdp_content_attribute_t* 
attribute, const char* media_tag);
+BELLESIP_EXPORT belle_sip_list_t* 
belle_sdp_content_attribute_get_media_tags(belle_sdp_content_attribute_t* 
attribute);
+#define BELLE_SDP_CONTENT_ATTRIBUTE(t) 
BELLE_SDP_CAST(t,belle_sdp_content_attribute_t)
+
+/***************************************************************************************
  * RFC5939 Attributes
  *
  
**************************************************************************************/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/include/belle-sip/headers.h 
new/belle-sip-5.1.0/include/belle-sip/headers.h
--- old/belle-sip-5.0.67/include/belle-sip/headers.h    2021-12-14 
09:08:31.000000000 +0100
+++ new/belle-sip-5.1.0/include/belle-sip/headers.h     2022-02-03 
15:07:52.000000000 +0100
@@ -111,6 +111,7 @@
 BELLESIP_EXPORT belle_sip_header_t* belle_sip_header_parse (const char* 
header);
 BELLESIP_EXPORT belle_sip_header_t* belle_sip_header_create (const char* 
name,const char* value);
 BELLESIP_EXPORT belle_sip_header_t* belle_http_header_create (const char* 
name,const char* value);
+BELLESIP_EXPORT belle_sip_header_t* belle_sip_header_get_next(const 
belle_sip_header_t* headers);
 BELLESIP_EXPORT const char* belle_sip_header_get_name (const 
belle_sip_header_t* obj);
 BELLESIP_EXPORT void belle_sip_header_set_name (belle_sip_header_t* obj,const 
char* value);
 BELLESIP_EXPORT belle_sip_error_code 
belle_sip_header_marshal(belle_sip_header_t* header, char* buff, size_t 
buff_size, size_t *offset);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/include/belle-sip/types.h 
new/belle-sip-5.1.0/include/belle-sip/types.h
--- old/belle-sip-5.0.67/include/belle-sip/types.h      2021-12-14 
09:08:31.000000000 +0100
+++ new/belle-sip-5.1.0/include/belle-sip/types.h       2022-02-03 
15:07:52.000000000 +0100
@@ -106,6 +106,8 @@
        BELLE_SIP_TYPE_ID(belle_sdp_repeate_time_t),
        BELLE_SIP_TYPE_ID(belle_sdp_rtcp_fb_attribute_t),
        BELLE_SIP_TYPE_ID(belle_sdp_rtcp_xr_attribute_t),
+       BELLE_SIP_TYPE_ID(belle_sdp_label_attribute_t),
+       BELLE_SIP_TYPE_ID(belle_sdp_content_attribute_t),
        BELLE_SIP_TYPE_ID(belle_sdp_csup_attribute_t),
        BELLE_SIP_TYPE_ID(belle_sdp_creq_attribute_t),
        BELLE_SIP_TYPE_ID(belle_sdp_tcap_attribute_t),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/include/belle-sip/utils.h 
new/belle-sip-5.1.0/include/belle-sip/utils.h
--- old/belle-sip-5.0.67/include/belle-sip/utils.h      2021-12-14 
09:08:31.000000000 +0100
+++ new/belle-sip-5.1.0/include/belle-sip/utils.h       2022-02-03 
15:07:52.000000000 +0100
@@ -111,6 +111,7 @@
 #define belle_sip_set_log_level(level) 
bctbx_set_log_level(BELLE_SIP_LOG_DOMAIN,level);
 
 BELLESIP_EXPORT char * belle_sip_random_token(char *ret, size_t size);
+BELLESIP_EXPORT char * belle_sip_random_token_with_charset(char *ret, size_t 
size, const char * charset, size_t charset_length);
 
 BELLESIP_EXPORT unsigned char * belle_sip_random_bytes(unsigned char *ret, 
size_t size);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/src/belle_sdp_impl.cc 
new/belle-sip-5.1.0/src/belle_sdp_impl.cc
--- old/belle-sip-5.0.67/src/belle_sdp_impl.cc  2021-12-14 09:08:31.000000000 
+0100
+++ new/belle-sip-5.1.0/src/belle_sdp_impl.cc   2022-02-03 15:07:52.000000000 
+0100
@@ -59,6 +59,8 @@
 static struct attribute_name_func_pair attribute_table[] = {
        { "rtcp-fb", (attribute_parse_func)belle_sdp_rtcp_fb_attribute_parse },
        { "rtcp-xr", (attribute_parse_func)belle_sdp_rtcp_xr_attribute_parse },
+       { "content", (attribute_parse_func)belle_sdp_content_attribute_parse },
+       { "label", (attribute_parse_func)belle_sdp_label_attribute_parse },
        { "creq", (attribute_parse_func)belle_sdp_creq_attribute_parse },
        { "csup", (attribute_parse_func)belle_sdp_csup_attribute_parse },
        { "tcap", (attribute_parse_func)belle_sdp_tcap_attribute_parse },
@@ -205,6 +207,96 @@
 }
 
 
/***************************************************************************************
+ * RFC4574 Attributes
+ *
+ 
**************************************************************************************/
+
+struct _belle_sdp_label_attribute {
+       belle_sdp_attribute_t base;
+       const char* pointer;
+};
+
+static void belle_sdp_label_attribute_init(belle_sdp_label_attribute_t* 
attribute) {
+       belle_sdp_attribute_set_name(BELLE_SDP_ATTRIBUTE(attribute), "label");
+}
+
+void belle_sdp_label_attribute_destroy(belle_sdp_label_attribute_t* attribute) 
{
+       DESTROY_STRING(attribute,pointer)
+}
+void belle_sdp_label_attribute_clone(belle_sdp_label_attribute_t* attribute, 
const belle_sdp_label_attribute_t *orig) {
+       belle_sdp_label_attribute_set_pointer(attribute, 
belle_sdp_label_attribute_get_pointer(orig));
+}
+
+belle_sip_error_code 
belle_sdp_label_attribute_marshal(belle_sdp_label_attribute_t* attribute, char 
* buff, size_t buff_size, size_t *offset) {
+       belle_sip_error_code error = belle_sip_snprintf(
+               buff, buff_size, offset,
+               "a=label:%s",
+               attribute->pointer
+       );
+
+       return error;
+}
+
+BELLE_SDP_NEW_WITH_CTR(label_attribute,belle_sdp_attribute)
+BELLE_SDP_BELR_PARSE(label_attribute)
+GET_SET_STRING(belle_sdp_label_attribute,pointer)
+
+/***************************************************************************************
+ * RFC4796 Attributes
+ *
+ 
**************************************************************************************/
+
+// content
+
+struct _belle_sdp_content_attribute {
+       belle_sdp_attribute_t base;
+       belle_sip_list_t* media_tags;
+};
+
+void belle_sdp_content_attribute_destroy(belle_sdp_content_attribute_t* 
attribute) {
+       belle_sip_list_free_with_data(attribute->media_tags, belle_sip_free);
+}
+
+void belle_sdp_content_attribute_clone(belle_sdp_content_attribute_t* 
attribute, const belle_sdp_content_attribute_t *orig) {
+       attribute->media_tags = belle_sip_list_copy_with_data(orig->media_tags, 
belle_sip_string_copyfunc);
+}
+
+belle_sip_error_code 
belle_sdp_content_attribute_marshal(belle_sdp_content_attribute_t* attribute, 
char * buff, size_t buff_size, size_t *offset) {
+       belle_sip_list_t* media_tags=attribute->media_tags;
+
+       belle_sip_error_code error = 
belle_sip_snprintf(buff,buff_size,offset,"a=content:");
+       if (error != BELLE_SIP_OK) return error;
+
+       int i = 0;
+       for (;media_tags != NULL;media_tags = media_tags->next){
+               error = belle_sip_snprintf(
+                       buff, buff_size, offset,
+                       "%s%s",
+                       i++ == 0 ? "" : ",",
+                       (const char*)media_tags->data
+               );
+               if (error != BELLE_SIP_OK) return error;
+       }
+
+       return error;
+}
+
+void belle_sdp_content_attribute_add_media_tag(belle_sdp_content_attribute_t* 
attribute, const char* media_tag) {
+       attribute->media_tags = belle_sip_list_append(attribute->media_tags, 
belle_sip_strdup(media_tag));
+}
+
+belle_sip_list_t* 
belle_sdp_content_attribute_get_media_tags(belle_sdp_content_attribute_t* 
attribute) {
+       return attribute->media_tags;
+}
+
+static void belle_sdp_content_attribute_init(belle_sdp_content_attribute_t* 
attribute) {
+       belle_sdp_attribute_set_name(BELLE_SDP_ATTRIBUTE(attribute), "content");
+}
+
+BELLE_SDP_NEW_WITH_CTR(content_attribute,belle_sdp_attribute)
+BELLE_SDP_BELR_PARSE(content_attribute)
+
+/***************************************************************************************
  * RFC5939 Attributes
  *
  
**************************************************************************************/
@@ -1088,6 +1180,8 @@
         */
        if (SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, "rtcp-fb", 
belle_sdp_rtcp_fb_attribute_t)
                || SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, 
"rtcp-xr", belle_sdp_rtcp_xr_attribute_t)
+               || SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, 
"content", belle_sdp_content_attribute_t)
+               || SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, "label", 
belle_sdp_label_attribute_t)
                || SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, "creq", 
belle_sdp_creq_attribute_t)
                || SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, "csup", 
belle_sdp_csup_attribute_t)
                || SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, "tcap", 
belle_sdp_tcap_attribute_t)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/src/belle_sip_internal.h 
new/belle-sip-5.1.0/src/belle_sip_internal.h
--- old/belle-sip-5.0.67/src/belle_sip_internal.h       2021-12-14 
09:08:31.000000000 +0100
+++ new/belle-sip-5.1.0/src/belle_sip_internal.h        2022-02-03 
15:07:52.000000000 +0100
@@ -207,6 +207,8 @@
 BELLE_SIP_DECLARE_VPTR(belle_sdp_repeate_time_t);
 BELLE_SIP_DECLARE_VPTR(belle_sdp_rtcp_fb_attribute_t);
 BELLE_SIP_DECLARE_VPTR(belle_sdp_rtcp_xr_attribute_t);
+BELLE_SIP_DECLARE_VPTR(belle_sdp_content_attribute_t);
+BELLE_SIP_DECLARE_VPTR(belle_sdp_label_attribute_t);
 BELLE_SIP_DECLARE_VPTR(belle_sdp_creq_attribute_t);
 BELLE_SIP_DECLARE_VPTR(belle_sdp_csup_attribute_t);
 BELLE_SIP_DECLARE_VPTR(belle_sdp_tcap_attribute_t);
@@ -655,7 +657,6 @@
 /*
  * SIP and http messages
 **/
-#define BELLESIP_MULTIPART_BOUNDARY 
"---------------------------14737809831466499882746641449"
 
 void belle_sip_message_init(belle_sip_message_t *message);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/src/belle_sip_utils.c 
new/belle-sip-5.1.0/src/belle_sip_utils.c
--- old/belle-sip-5.0.67/src/belle_sip_utils.c  2021-12-14 09:08:31.000000000 
+0100
+++ new/belle-sip-5.1.0/src/belle_sip_utils.c   2022-02-03 15:07:52.000000000 
+0100
@@ -210,10 +210,14 @@
  * Write a random text token of supplied size.
 **/
 char * belle_sip_random_token(char *ret, size_t size){
+       return belle_sip_random_token_with_charset(ret, size, symbols, 64);
+}
+
+char * belle_sip_random_token_with_charset(char *ret, size_t size, const char 
* charset, size_t charset_length){
        unsigned int i;
        belle_sip_random_bytes((unsigned char *)ret, size-1);
        for(i=0;i<size-1;++i){
-               ret[i]=symbols[ret[i] & 63];
+               ret[i]=charset[ret[i] % charset_length];
        }
        ret[i]=0;
        return ret;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/src/bodyhandler.c 
new/belle-sip-5.1.0/src/bodyhandler.c
--- old/belle-sip-5.0.67/src/bodyhandler.c      2021-12-14 09:08:31.000000000 
+0100
+++ new/belle-sip-5.1.0/src/bodyhandler.c       2022-02-03 15:07:52.000000000 
+0100
@@ -827,11 +827,15 @@
        obj->user_bh = NULL;
        if (expected_size != BCTBX_VFS_ERROR) {
                obj->base.expected_size = (size_t)expected_size;
+               belle_sip_message("file body handler created for file [%s] with 
size [%zu]", filepath, obj->base.expected_size);
+       } else {
+               belle_sip_message("file body handler created for file [%s] with 
unknown size", filepath);
        }
        obj->buffer.size=0;
        obj->buffer.index=0;
        obj->buffer.data=NULL;
        obj->buffer.next_offset=0;
+       
        return obj;
 }
 
@@ -1004,6 +1008,8 @@
        }
 BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_END
 
+static const char *boundary_charset = 
"aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789-";
+
 static void 
belle_sip_multipart_body_handler_set_boundary(belle_sip_multipart_body_handler_t
 *obj, const char *boundary) {
        if (obj->boundary != NULL) {
                belle_sip_free(obj->boundary);
@@ -1011,7 +1017,8 @@
        if (boundary != NULL) {
                obj->boundary = belle_sip_strdup(boundary);
        } else {
-               obj->boundary = belle_sip_strdup(BELLESIP_MULTIPART_BOUNDARY);
+               char random_token[60];// Use a random boundary to reduce the 
probability of having the same boundary in file (like uploading file logs with 
file transfer).
+               obj->boundary = belle_sip_strdup_printf("----------%s", 
belle_sip_random_token_with_charset(random_token, sizeof(random_token), 
boundary_charset, 63));
        }
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/src/parserutils.h 
new/belle-sip-5.1.0/src/parserutils.h
--- old/belle-sip-5.0.67/src/parserutils.h      2021-12-14 09:08:31.000000000 
+0100
+++ new/belle-sip-5.1.0/src/parserutils.h       2022-02-03 15:07:52.000000000 
+0100
@@ -39,7 +39,6 @@
 #define ANTLR3_LOG_EXCEPTION() belle_sip_message("[\%s] reason [\%s] at 
line[\%u] position[\%d]",(const char*)EXCEPTION->name,(const 
char*)EXCEPTION->message,EXCEPTION->line,EXCEPTION->charPositionInLine);
 
 
-BELLESIP_EXPORT belle_sip_header_t* belle_sip_header_get_next(const 
belle_sip_header_t* headers);
 BELLESIP_EXPORT void belle_sip_header_set_next(belle_sip_header_t* 
header,belle_sip_header_t* next);
 
 belle_sip_param_pair_t* belle_sip_param_pair_new(const char* name,const char* 
value);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/src/sdp/parser.cc 
new/belle-sip-5.1.0/src/sdp/parser.cc
--- old/belle-sip-5.0.67/src/sdp/parser.cc      2021-12-14 09:08:31.000000000 
+0100
+++ new/belle-sip-5.1.0/src/sdp/parser.cc       2022-02-03 15:07:52.000000000 
+0100
@@ -55,6 +55,12 @@
            ->setCollector("media-description", 
make_fn(&belle_sdp_session_description_add_media_description))
            ->setCollector("attribute", 
make_fn(&belle_sdp_session_description_add_attribute_holder));
 
+    _parser->setHandler("content-attribute", 
make_fn(&belle_sdp_content_attribute_new))
+           ->setCollector("mediacnt", 
make_fn(&belle_sdp_content_attribute_add_media_tag));
+
+    _parser->setHandler("label-attribute", 
make_fn(&belle_sdp_label_attribute_new))
+           ->setCollector("pointer", 
make_fn(&belle_sdp_label_attribute_set_pointer));
+
     _parser->setHandler("csup-attribute", 
make_fn(&belle_sdp_csup_attribute_new))
            ->setCollector("option-tag", 
make_fn(&belle_sdp_csup_attribute_add_option_tag));
 
@@ -118,6 +124,8 @@
            ->setCollector("voip-metrics", 
make_fn(&belle_sdp_rtcp_xr_attribute_enable_voip_metrics));
 
     _parser->setHandler("attribute", make_fn(&belle_sdp_attribute_holder_new))
+           ->setCollector("label-attribute", 
make_fn(&belle_sdp_attribute_holder_set_attribute))
+           ->setCollector("content-attribute", 
make_fn(&belle_sdp_attribute_holder_set_attribute))
            ->setCollector("acfg-attribute", 
make_fn(&belle_sdp_attribute_holder_set_attribute))
            ->setCollector("creq-attribute", 
make_fn(&belle_sdp_attribute_holder_set_attribute))
            ->setCollector("csup-attribute", 
make_fn(&belle_sdp_attribute_holder_set_attribute))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/src/sdp/sdp.txt 
new/belle-sip-5.1.0/src/sdp/sdp.txt
--- old/belle-sip-5.0.67/src/sdp/sdp.txt        2021-12-14 09:08:31.000000000 
+0100
+++ new/belle-sip-5.1.0/src/sdp/sdp.txt 2022-02-03 15:07:52.000000000 +0100
@@ -139,6 +139,7 @@
                     / tcap-attribute / creq-attribute
                     / pcfg-attribute / acfg-attribute
                     / rtcp-fb-attribute / rtcp-xr-attribute
+                    / label-attribute / content-attribute
                     / raw-attribute
 raw-attribute       = %x61 "=" default-attribute
 default-attribute   = (att-field ":" att-value) / att-field
@@ -456,3 +457,16 @@
 att-cap-num       = 1*10(DIGIT)
 ext-cap-name      = 1*(ALPHA / DIGIT)
 ext-cap-list      = 1*VCHAR
+
+; RFC4796
+
+content-attribute   = %x61 "=" "content:" mediacnt-tag
+mediacnt-tag        = mediacnt *("," mediacnt)
+mediacnt            = "slides" / "speaker" / "sl" / "main"
+                             / "alt" / mediacnt-ext
+mediacnt-ext        = token
+
+; RFC4574
+
+label-attribute     = %x61 "=" "label:" pointer
+pointer             = token
Binary files old/belle-sip-5.0.67/src/sdp/sdp_grammar and 
new/belle-sip-5.1.0/src/sdp/sdp_grammar differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/src/transports/tls_channel.c 
new/belle-sip-5.1.0/src/transports/tls_channel.c
--- old/belle-sip-5.0.67/src/transports/tls_channel.c   2021-12-14 
09:08:31.000000000 +0100
+++ new/belle-sip-5.1.0/src/transports/tls_channel.c    2022-02-03 
15:07:52.000000000 +0100
@@ -557,10 +557,18 @@
        char *host_ip;
        char url_ipport[64];
        int port;
-       
bctbx_addrinfo_to_printable_ip_address(channel->current_peer,url_ipport,sizeof(url_ipport));
-       bctbx_addrinfo_to_ip_address(channel->current_peer,ip,sizeof(ip),&port);
+       struct sockaddr_storage connect_addr;
+       socklen_t connect_addr_len = sizeof(connect_addr);
+       
+       /* In case the connection address is a V4MAPPED, transform it as a pure 
v4 address.
+        * Indeed, some old http proxy implementations don't support IPv6 
targets, so don't attempt
+        * to use it if it is not strictly necessary. */
+       bctbx_sockaddr_remove_v4_mapping(channel->current_peer->ai_addr, 
(struct sockaddr*) &connect_addr, &connect_addr_len);
+       
+       bctbx_sockaddr_to_printable_ip_address((struct sockaddr*)&connect_addr, 
connect_addr_len, url_ipport,sizeof(url_ipport));
+       bctbx_sockaddr_to_ip_address((struct sockaddr*)&connect_addr, 
connect_addr_len, ip, sizeof(ip), &port);
 
-       if (channel->current_peer->ai_family == AF_INET6) {
+       if (connect_addr.ss_family == AF_INET6) {
                host_ip = belle_sip_strdup_printf("[%s]",ip);
        } else {
                host_ip = belle_sip_strdup_printf("%s",ip); /*just to simplify 
code*/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/belle-sip-5.0.67/tester/belle_sdp_tester.c 
new/belle-sip-5.1.0/tester/belle_sdp_tester.c
--- old/belle-sip-5.0.67/tester/belle_sdp_tester.c      2021-12-14 
09:08:31.000000000 +0100
+++ new/belle-sip-5.1.0/tester/belle_sdp_tester.c       2022-02-03 
15:07:52.000000000 +0100
@@ -76,6 +76,60 @@
        belle_sip_object_unref(BELLE_SIP_OBJECT(lAttribute));
 }
 
+static void test_label_attribute(void) {
+       const char* line = "a=label:2";
+
+       belle_sdp_label_attribute_t* lAttribute;
+
+       lAttribute = belle_sdp_label_attribute_parse(line);
+       
BC_ASSERT_STRING_EQUAL(belle_sdp_attribute_get_name(BELLE_SDP_ATTRIBUTE(lAttribute)),
 "label");
+       char * obj_string = 
belle_sip_object_to_string(BELLE_SIP_OBJECT(lAttribute));
+       BC_ASSERT_STRING_EQUAL(obj_string, line);
+       belle_sip_free(obj_string);
+
+       belle_sdp_label_attribute_t* clone = BELLE_SDP_LABEL_ATTRIBUTE(
+               belle_sip_object_clone(BELLE_SIP_OBJECT(lAttribute))
+       );
+       char * clone_obj_string = belle_sip_object_to_string(clone);
+       BC_ASSERT_STRING_EQUAL(clone_obj_string, line);
+       belle_sip_free(clone_obj_string);
+       belle_sip_object_unref(BELLE_SIP_OBJECT(clone));
+
+       
BC_ASSERT_STRING_EQUAL(belle_sdp_label_attribute_get_pointer(lAttribute), "2");
+       belle_sip_object_unref(BELLE_SIP_OBJECT(lAttribute));
+}
+
+static void test_content_attribute(void) {
+       belle_sdp_content_attribute_t* lAttribute;
+       belle_sip_list_t* list;
+       int i = 0;
+       const char* fmt[] = {"slides","speaker","sl","main"};
+       const char* line = "a=content:slides,speaker,sl,main";
+
+       lAttribute = belle_sdp_content_attribute_parse(line);
+       char * obj_string = 
belle_sip_object_to_string(BELLE_SIP_OBJECT(lAttribute));
+       BC_ASSERT_STRING_EQUAL(obj_string, line);
+       belle_sip_free(obj_string);
+
+       belle_sdp_content_attribute_t* clone = BELLE_SDP_CONTENT_ATTRIBUTE(
+               belle_sip_object_clone(BELLE_SIP_OBJECT(lAttribute))
+       );
+       char * clone_obj_string = belle_sip_object_to_string(clone);
+       BC_ASSERT_STRING_EQUAL(clone_obj_string, line);
+       belle_sip_free(clone_obj_string);
+       belle_sip_object_unref(BELLE_SIP_OBJECT(clone));
+
+       
BC_ASSERT_STRING_EQUAL(belle_sdp_attribute_get_name(BELLE_SDP_ATTRIBUTE(lAttribute)),
 "content");
+
+       list = belle_sdp_content_attribute_get_media_tags(lAttribute);
+       BC_ASSERT_PTR_NOT_NULL(list);
+       for(; list!=NULL; list=list->next){
+               BC_ASSERT_STRING_EQUAL(list->data, fmt[i++]);
+       }
+
+       belle_sip_object_unref(BELLE_SIP_OBJECT(lAttribute));
+}
+
 static void test_csup_attribute(void) {
        belle_sdp_csup_attribute_t* lAttribute;
        belle_sip_list_t* list;
@@ -171,7 +225,6 @@
 }
 
 static void test_acap_attribute_base(const char* line, int id, const char * 
name, const char * value) {
-
        belle_sdp_acap_attribute_t* lAttribute;
 
        lAttribute = belle_sdp_acap_attribute_parse(line);
@@ -521,7 +574,9 @@
        belle_sip_free(l_raw_media);
 }
 
-const char* media_description_attr[] ={"98 nack rpsi"
+const char* media_description_attr[] ={"2"
+                       ,"speaker"
+                       ,"98 nack rpsi"
                        ,"rcvr-rtt=all:10"
                        ,"4 key-mgmt:mikey AQAFgM"
                        ,"2147483647 key-mgmt:mikey YjKBgNn"
@@ -537,7 +592,9 @@
                        ,"2 t=6 a=2147483647"
                        ,"98 CIF=1;QCIF=1"};
 
-const char* media_description_attr_2[] ={"98 nack rpsi"
+const char* media_description_attr_2[] ={"2"
+                       ,"speaker"
+                       ,"98 nack rpsi"
                        ,"2 t=6 a=2147483647"
                        ,"rcvr-rtt=all:10"
                        ,"4 key-mgmt:mikey AQAFgM"
@@ -593,6 +650,8 @@
                                                "i=Hey\r\n"\
                                                "c=IN IP4 192.168.0.18\r\n"\
                                                "b=AS:380\r\n"\
+                                               "a=label:2\r\n"\
+                                               "a=content:speaker\r\n"\
                                                "a=rtcp-fb:98 nack rpsi\r\n"\
                                                "a=rtcp-xr:rcvr-rtt=all:10\r\n"\
                                                "a=acap:4 key-mgmt:mikey 
AQAFgM\r\n"\
@@ -643,6 +702,8 @@
                                                "m=video 8078 RTP/AVP 99 97 
98\r\n"\
                                                "c=IN IP4 192.168.0.18\r\n"\
                                                "b=AS:380\r\n"\
+                                               "a=label:2\r\n"\
+                                               "a=content:speaker\r\n"\
                                                "a=rtcp-fb:98 nack rpsi\r\n"\
                                                "a=rtcp-xr:rcvr-rtt=all:10\r\n"\
                                                "a=acap:4 key-mgmt:mikey 
AQAFgM\r\n"\
@@ -724,6 +785,8 @@
                                                "m=video 8078 RTP/AVP 99 97 
98\r\n"\
                                                "c=IN IP4 192.168.0.18\r\n"\
                                                "b=AS:380\r\n"\
+                                               "a=label:2\r\n"\
+                                               "a=content:speaker\r\n"\
                                                "a=rtcp-fb:98 nack rpsi\r\n"\
                                                "a=acfg:2 t=6 a=2147483647\r\n"\
                                                "a=rtcp-xr:rcvr-rtt=all:10\r\n"\
@@ -824,6 +887,8 @@
                                                "m=video 8078 RTP/AVP 99 97 
98\r\n"\
                                                "c=IN IP4 192.168.0.18\r\n"\
                                                "b=AS:380\r\n"\
+                                               "a=label:2\r\n"\
+                                               "a=content:speaker\r\n"\
                                                "a=rtcp-fb:98 nack rpsi\r\n"\
                                                "a=rtcp-xr:rcvr-rtt=all:10\r\n"\
                                                "a=acap:4 key-mgmt:mikey 
AQAFgM\r\n"\
@@ -869,7 +934,7 @@
 
        
BC_ASSERT_PTR_NOT_NULL(belle_sdp_session_description_get_connection(l_session_description));
        
BC_ASSERT_EQUAL(belle_sdp_session_description_get_bandwidth(l_session_description,"AS"),
 380, int, "%d");
-       
+
        
BC_ASSERT_PTR_NOT_NULL(belle_sdp_session_description_get_time_descriptions(l_session_description));
        
BC_ASSERT_EQUAL(belle_sdp_time_get_start(belle_sdp_time_description_get_time((belle_sdp_time_description_t*)(belle_sdp_session_description_get_time_descriptions(l_session_description)->data))),0,
 int, "%d");
        
BC_ASSERT_EQUAL(belle_sdp_time_get_stop(belle_sdp_time_description_get_time((belle_sdp_time_description_t*)(belle_sdp_session_description_get_time_descriptions(l_session_description)->data))),0,
 int, "%d");
@@ -1066,6 +1131,8 @@
        TEST_NO_TAG("a= (attribute)", test_attribute),
        TEST_NO_TAG("a= (attribute) 2", test_attribute_2),
        TEST_NO_TAG("a=rtcp-xr", test_rtcp_xr_attribute),
+       TEST_NO_TAG("a= (label)", test_label_attribute),
+       TEST_NO_TAG("a= (content)", test_content_attribute),
        TEST_NO_TAG("a= (csup)", test_csup_attribute),
        TEST_NO_TAG("a= (creq)", test_creq_attribute),
        TEST_NO_TAG("a= (tcap)", test_tcap_attribute),

Reply via email to