@@ -1142,7 +1142,10 @@ void __codec_handlers_update(struct call_media *receiver, struct call_media *sin
1142
1142
if (!sink_pt ) {
1143
1143
// no matching/identical output codec. maybe we have the same output codec,
1144
1144
// but with a different payload type or a different format?
1145
- sink_pt = codec_store_find_compatible (& sink -> codecs , pt );
1145
+ if (!a .allow_asymmetric )
1146
+ sink_pt = codec_store_find_compatible (& sink -> codecs , pt );
1147
+ else
1148
+ sink_pt = pt ;
1146
1149
}
1147
1150
1148
1151
if (sink_pt && !pt -> codec_def -> supplemental ) {
@@ -1178,10 +1181,18 @@ void __codec_handlers_update(struct call_media *receiver, struct call_media *sin
1178
1181
1179
1182
sink_pt_fixed :;
1180
1183
// we have found a usable output codec. gather matching output supp codecs
1181
- struct rtp_payload_type * sink_dtmf_pt = __supp_payload_type (supplemental_sinks ,
1182
- sink_pt -> clock_rate , "telephone-event" );
1183
- struct rtp_payload_type * sink_cn_pt = __supp_payload_type (supplemental_sinks ,
1184
- sink_pt -> clock_rate , "CN" );
1184
+ struct rtp_payload_type * sink_dtmf_pt = NULL ;
1185
+ struct rtp_payload_type * sink_cn_pt = NULL ;
1186
+ if (!a .allow_asymmetric ) {
1187
+ sink_dtmf_pt = __supp_payload_type (supplemental_sinks ,
1188
+ sink_pt -> clock_rate , "telephone-event" );
1189
+ sink_cn_pt = __supp_payload_type (supplemental_sinks ,
1190
+ sink_pt -> clock_rate , "CN" );
1191
+ }
1192
+ else {
1193
+ sink_dtmf_pt = recv_dtmf_pt ;
1194
+ sink_cn_pt = recv_cn_pt ;
1195
+ }
1185
1196
struct rtp_payload_type * real_sink_dtmf_pt = NULL ; // for DTMF delay
1186
1197
1187
1198
// XXX synthesise missing supp codecs according to codec tracker XXX needed?
@@ -4962,6 +4973,8 @@ void __codec_store_populate(struct codec_store *dst, struct codec_store *src, st
4962
4973
pt -> payload_type );
4963
4974
continue ;
4964
4975
}
4976
+ if (orig_pt -> codec_def && orig_pt -> codec_def -> supplemental )
4977
+ orig_pt = NULL ;
4965
4978
}
4966
4979
ilogs (codec , LOG_DEBUG , "Adding codec " STR_FORMAT " (%i)" ,
4967
4980
STR_FMT (& pt -> encoding_with_params ),
@@ -5301,7 +5314,9 @@ void codec_store_transcode(struct codec_store *cs, GQueue *offer, struct codec_s
5301
5314
#endif
5302
5315
}
5303
5316
5304
- void codec_store_answer (struct codec_store * dst , struct codec_store * src , struct sdp_ng_flags * flags ) {
5317
+ void __codec_store_answer (struct codec_store * dst , struct codec_store * src , struct sdp_ng_flags * flags ,
5318
+ struct codec_store_args a )
5319
+ {
5305
5320
// retain existing setup for supplemental codecs, but start fresh otherwise
5306
5321
struct codec_store orig_dst ;
5307
5322
codec_store_move (& orig_dst , dst );
@@ -5408,6 +5423,8 @@ void codec_store_answer(struct codec_store *dst, struct codec_store *src, struct
5408
5423
// handle associated supplemental codecs
5409
5424
if (h -> cn_payload_type != -1 ) {
5410
5425
pt = g_hash_table_lookup (orig_dst .codecs , GINT_TO_POINTER (h -> cn_payload_type ));
5426
+ if (!pt && a .allow_asymmetric )
5427
+ pt = g_hash_table_lookup (src -> codecs , GINT_TO_POINTER (h -> cn_payload_type ));
5411
5428
if (!pt )
5412
5429
ilogs (codec , LOG_DEBUG , "CN payload type %i is missing" , h -> cn_payload_type );
5413
5430
else
@@ -5418,6 +5435,8 @@ void codec_store_answer(struct codec_store *dst, struct codec_store *src, struct
5418
5435
dtmf_payload_type = h -> real_dtmf_payload_type ;
5419
5436
if (dtmf_payload_type != -1 ) {
5420
5437
pt = g_hash_table_lookup (orig_dst .codecs , GINT_TO_POINTER (dtmf_payload_type ));
5438
+ if (!pt && a .allow_asymmetric )
5439
+ pt = g_hash_table_lookup (src -> codecs , GINT_TO_POINTER (dtmf_payload_type ));
5421
5440
if (!pt )
5422
5441
ilogs (codec , LOG_DEBUG , "DTMF payload type %i is missing" , dtmf_payload_type );
5423
5442
else
0 commit comments