@@ -67,6 +67,8 @@ defmodule ExSDP.Attribute.FMTP do
67
67
:dtmf_tones ,
68
68
# RED
69
69
:redundant_payloads ,
70
+ # G7221
71
+ :bitrate ,
70
72
unknown: [ ]
71
73
]
72
74
@@ -115,6 +117,8 @@ defmodule ExSDP.Attribute.FMTP do
115
117
dtmf_tones: String . t ( ) | nil ,
116
118
# RED
117
119
redundant_payloads: [ RTPMapping . payload_type_t ( ) ] | nil ,
120
+ # G7221
121
+ bitrate: non_neg_integer ( ) | nil ,
118
122
# params that are currently not supported
119
123
unknown: [ String . t ( ) ]
120
124
}
@@ -326,6 +330,10 @@ defmodule ExSDP.Attribute.FMTP do
326
330
do: { rest , % { fmtp | repair_window: value } }
327
331
end
328
332
333
+ defp parse_param ( [ "bitrate=" <> value | rest ] , fmtp ) do
334
+ with { :ok , value } <- Utils . parse_numeric_string ( value ) , do: { rest , % { fmtp | bitrate: value } }
335
+ end
336
+
329
337
defp parse_param ( [ head | rest ] = params , fmtp ) do
330
338
# this is for non-key-value parameters as `key=value` format is not mandatory
331
339
cond do
@@ -430,7 +438,9 @@ defimpl String.Chars, for: ExSDP.Attribute.FMTP do
430
438
# Telephone Events
431
439
Serializer . maybe_serialize ( "dtmf-tones" , fmtp . dtmf_tones ) ,
432
440
# RED
433
- Serializer . maybe_serialize_list ( fmtp . redundant_payloads , "/" )
441
+ Serializer . maybe_serialize_list ( fmtp . redundant_payloads , "/" ) ,
442
+ # G7221
443
+ Serializer . maybe_serialize ( "bitrate" , fmtp . bitrate )
434
444
]
435
445
|> Enum . filter ( fn param -> param != "" end )
436
446
|> Enum . join ( ";" )
0 commit comments