Browse code

rtpengine: add support for new T.38 options

Richard Fuchs authored on 25/03/2020 13:00:40
Showing 1 changed files
... ...
@@ -118,6 +118,7 @@ enum {
118 118
 struct ng_flags_parse {
119 119
 	int via, to, packetize, transport, directional;
120 120
 	bencode_item_t *dict, *flags, *direction, *replace, *rtcp_mux, *sdes,
121
+		       *t38,
121 122
 		       *codec, *codec_strip, *codec_offer, *codec_transcode, *codec_mask;
122 123
 	str call_id, from_tag, to_tag;
123 124
 };
... ...
@@ -2125,6 +2126,10 @@ static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg, enu
2125 2125
 			bencode_list_add_str(ng_flags->sdes, &s);
2126 2126
 			goto next;
2127 2127
 		}
2128
+		if (str_key_val_prefix(&key, "T38", &val, &s) || str_key_val_prefix(&key, "T.38", &val, &s)) {
2129
+			bencode_list_add_str(ng_flags->t38, &s);
2130
+			goto next;
2131
+		}
2128 2132
 		if (str_key_val_prefix(&key, "rtcp-mux", &val, &s)) {
2129 2133
 			bencode_list_add_str(ng_flags->rtcp_mux, &s);
2130 2134
 			goto next;
... ...
@@ -2402,6 +2407,7 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
2402 2402
 		ng_flags.replace = bencode_list(bencbuf);
2403 2403
 		ng_flags.rtcp_mux = bencode_list(bencbuf);
2404 2404
 		ng_flags.sdes = bencode_list(bencbuf);
2405
+		ng_flags.t38 = bencode_list(bencbuf);
2405 2406
 		ng_flags.codec = bencode_dictionary(bencbuf);
2406 2407
 
2407 2408
 		if (read_sdp_pvar!= NULL) {
... ...
@@ -2455,6 +2461,8 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
2455 2455
 		bencode_dictionary_add(ng_flags.dict, "rtcp-mux", ng_flags.rtcp_mux);
2456 2456
 	if (ng_flags.sdes && ng_flags.sdes->child)
2457 2457
 		bencode_dictionary_add(ng_flags.dict, "SDES", ng_flags.sdes);
2458
+	if (ng_flags.t38 && ng_flags.t38->child)
2459
+		bencode_dictionary_add(ng_flags.dict, "T.38", ng_flags.t38);
2458 2460
 
2459 2461
 	bencode_dictionary_add_str(ng_flags.dict, "call-id", &ng_flags.call_id);
2460 2462