[sr-dev] [kamailio/kamailio] rtpengine module added receive-from option to flags to managing rtpengine by a kamailio node behind dispatcher (PR #3230)

Richard Fuchs notifications at github.com
Wed Sep 7 14:32:53 CEST 2022


@rfuchs requested changes on this pull request.



> @@ -2529,6 +2551,7 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
 
 	body.s = NULL;
 	ng_flags.flags = bencode_list(bencbuf);
+	ng_flags.received-from = bencode_list(bencbuf);

Typo here (dash instead of underscore). Maybe at least try to compile it before submitting?

> @@ -2649,13 +2672,18 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
 		bencode_dictionary_add_str(ng_flags.dict, "via-branch", &viabranch);
 	}
 
-	item = bencode_list(bencbuf);
-	bencode_dictionary_add(ng_flags.dict, "received-from", item);
-	bencode_list_add_string(item, (msg->rcv.src_ip.af == AF_INET) ? "IP4" : (
-		(msg->rcv.src_ip.af == AF_INET6) ? "IP6" :
-		"?"
-	) );
-	bencode_list_add_string(item, ip_addr2a(&msg->rcv.src_ip));
+	if (ng_flags.received_from && ng_flags.received_from->child) {
+		bencode_dictionary_add(ng_flags.dict, "received-from", ng_flags.received_from);
+	}
+	else {
+		item = bencode_list(bencbuf);

Just a suggestion, but you could reuse `ng_flags.received_from` here instead of creating a new list item. But up to you.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3230#pullrequestreview-1099086127
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/3230/review/1099086127 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20220907/8d5f1841/attachment.htm>


More information about the sr-dev mailing list