[PATCH] contrib/rtp: Fix default payload case

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Jacob Erlbeck jerlbeck at sysmocom.de
Wed Dec 18 11:43:18 UTC 2013


There is the wrong record field selection being used to extract the
default value. It returns the tuple offset instead of the value.

This patch fixes this.

Sponsored-by: On-Waves ehf
---
 openbsc/contrib/rtp/gen_rtp_header.erl |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/openbsc/contrib/rtp/gen_rtp_header.erl b/openbsc/contrib/rtp/gen_rtp_header.erl
index 9f980b0..cc4c61c 100755
--- a/openbsc/contrib/rtp/gen_rtp_header.erl
+++ b/openbsc/contrib/rtp/gen_rtp_header.erl
@@ -45,7 +45,9 @@ main([First | RemArgs], Opts) ->
 	InFile = proplists:get_value(file, Opts, undef),
 
         Payload = case {PayloadData, InFile} of
-	    {undef, undef} -> #rtp_packet.payload;
+	    {undef, undef} ->
+		% use default value
+		#rtp_packet{}#rtp_packet.payload;
 	    {P, undef} -> P;
 	    {_, File} ->
 		log(info, "Loading file '~s'~n", [File], Opts),
-- 
1.7.9.5





More information about the OpenBSC mailing list