Module: kamailio
Branch: 6.0
Commit: 34614ff3cfadfe999fdc2815d47dec434bfb69b3
URL: 
https://github.com/kamailio/kamailio/commit/34614ff3cfadfe999fdc2815d47dec434bfb69b3

Author: Richard Fuchs <[email protected]>
Committer: Richard Fuchs <[email protected]>
Date: 2025-11-06T10:26:44-04:00

rtpengine: always set "flags"

Processing a trickle ICE SDP fragment requires the "flags" list to be
present, regardless of how other flags are being processed or if other
flags are even set at all. Create the "flags" list unconditionally as
it's a cheap operation and eliminates a few case distinctions in the
code.

(cherry picked from commit 2cd13758f172976c91fa814712e11ccb00a22397)

---

Modified: src/modules/rtpengine/rtpengine.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/34614ff3cfadfe999fdc2815d47dec434bfb69b3.diff
Patch: 
https://github.com/kamailio/kamailio/commit/34614ff3cfadfe999fdc2815d47dec434bfb69b3.patch

---

diff --git a/src/modules/rtpengine/rtpengine.c 
b/src/modules/rtpengine/rtpengine.c
index e28051ba57b..3d6fa1aee55 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -3354,9 +3354,6 @@ static bencode_item_t 
*rtpp_function_call(bencode_buffer_t *bencbuf,
        /* initialize some basic bencode items */
        if(!extra_dict) {
                ng_flags.dict = bencode_dictionary(bencbuf);
-               if(parse_by_module) {
-                       ng_flags.flags = bencode_list(bencbuf);
-               }
        } else {
                ng_flags.dict = extra_dict;
                ng_flags.flags = bencode_dictionary_get(ng_flags.dict, "flags");
@@ -3366,6 +3363,9 @@ static bencode_item_t 
*rtpp_function_call(bencode_buffer_t *bencbuf,
                }
        }
 
+       if (!ng_flags.flags)
+               ng_flags.flags = bencode_list(bencbuf);
+
        if(parse_by_module) {
                ng_flags.received_from = bencode_list(bencbuf);
        }
@@ -3440,9 +3440,6 @@ static bencode_item_t 
*rtpp_function_call(bencode_buffer_t *bencbuf,
                if(ng_flags.direction && ng_flags.direction->child)
                        bencode_dictionary_add(
                                        ng_flags.dict, "direction", 
ng_flags.direction);
-               /* flags */
-               if(ng_flags.flags && ng_flags.flags->child)
-                       bencode_dictionary_add(ng_flags.dict, "flags", 
ng_flags.flags);
                /* replace */
                if(ng_flags.replace && ng_flags.replace->child)
                        bencode_dictionary_add(ng_flags.dict, "replace", 
ng_flags.replace);
@@ -3522,6 +3519,10 @@ static bencode_item_t 
*rtpp_function_call(bencode_buffer_t *bencbuf,
                                sip_type_strings[msg->first_line.type]);
        }
 
+       /* flags */
+       if(ng_flags.flags && ng_flags.flags->child)
+               bencode_dictionary_add(ng_flags.dict, "flags", ng_flags.flags);
+
        /* add rtpp flags, if parsed by daemon */
        if(!parse_by_module && flags)
                bencode_dictionary_add_str(ng_flags.dict, "rtpp-flags", flags);

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to