Browse code

rtpengine: fix wrong codec action strings being used

Richard Fuchs authored on 26/10/2020 18:19:09
Showing 1 changed files
... ...
@@ -2084,7 +2084,7 @@ static const char *transports[] = {
2084 2084
 };
2085 2085
 
2086 2086
 static int parse_codec_flag(struct ng_flags_parse *ng_flags, const str *key, const str *val,
2087
-		const char *cmp1, const char *cmp2,
2087
+		const char *cmp1, const char *cmp2, const char *dictstr,
2088 2088
 		bencode_item_t **dictp)
2089 2089
 {
2090 2090
 	str s;
... ...
@@ -2098,7 +2098,7 @@ static int parse_codec_flag(struct ng_flags_parse *ng_flags, const str *key, con
2098 2098
 
2099 2099
 	if (!*dictp) {
2100 2100
 		*dictp = bencode_list(ng_flags->dict->buffer);
2101
-		bencode_dictionary_add(ng_flags->codec, "transcode",
2101
+		bencode_dictionary_add(ng_flags->codec, dictstr,
2102 2102
 			*dictp);
2103 2103
 	}
2104 2104
 	bencode_list_add_str(*dictp, &s);
... ...
@@ -2159,17 +2159,17 @@ static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg, enu
2159 2159
 			goto next;
2160 2160
 		}
2161 2161
 
2162
-		if (parse_codec_flag(ng_flags, &key, &val, "transcode", "codec-transcode", &ng_flags->codec_transcode))
2162
+		if (parse_codec_flag(ng_flags, &key, &val, "transcode", "codec-transcode", "transcode", &ng_flags->codec_transcode))
2163 2163
 			goto next;
2164
-		if (parse_codec_flag(ng_flags, &key, &val, "codec-strip", NULL, &ng_flags->codec_strip))
2164
+		if (parse_codec_flag(ng_flags, &key, &val, "codec-strip", NULL, "strip", &ng_flags->codec_strip))
2165 2165
 			goto next;
2166
-		if (parse_codec_flag(ng_flags, &key, &val, "codec-offer", NULL, &ng_flags->codec_offer))
2166
+		if (parse_codec_flag(ng_flags, &key, &val, "codec-offer", NULL, "offer", &ng_flags->codec_offer))
2167 2167
 			goto next;
2168
-		if (parse_codec_flag(ng_flags, &key, &val, "codec-mask", NULL, &ng_flags->codec_mask))
2168
+		if (parse_codec_flag(ng_flags, &key, &val, "codec-mask", NULL, "mask", &ng_flags->codec_mask))
2169 2169
 			goto next;
2170
-		if (parse_codec_flag(ng_flags, &key, &val, "codec-set", NULL, &ng_flags->codec_set))
2170
+		if (parse_codec_flag(ng_flags, &key, &val, "codec-set", NULL, "set", &ng_flags->codec_set))
2171 2171
 			goto next;
2172
-		if (parse_codec_flag(ng_flags, &key, &val, "codec-except", NULL, &ng_flags->codec_except))
2172
+		if (parse_codec_flag(ng_flags, &key, &val, "codec-except", NULL, "except", &ng_flags->codec_except))
2173 2173
 			goto next;
2174 2174
 
2175 2175
 		/* check for specially handled items */