diff --git a/daemon/call.c b/daemon/call.c index b86592297..e2e3ce062 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1819,6 +1819,16 @@ static void __update_media_id(struct call_media *media, struct call_media *other static void __update_media_protocol(struct call_media *media, struct call_media *other_media, struct stream_params *sp, struct sdp_ng_flags *flags) { + // is the media type still the same? + if (str_cmp_str(&other_media->type, &sp->type)) { + ilog(LOG_DEBUG, "Updating media type from '" STR_FORMAT "' to '" STR_FORMAT "'", + STR_FMT(&other_media->type), STR_FMT(&sp->type)); + call_str_cpy(other_media->call, &other_media->type, &sp->type); + other_media->type_id = codec_get_type(&other_media->type); + call_str_cpy(media->call, &media->type, &sp->type); + media->type_id = other_media->type_id; + } + /* deduct protocol from stream parameters received */ if (other_media->protocol != sp->protocol) { other_media->protocol = sp->protocol; diff --git a/include/call.h b/include/call.h index 267420bb7..f838be9e0 100644 --- a/include/call.h +++ b/include/call.h @@ -295,8 +295,8 @@ struct call_media { unsigned int index; /* RO */ unsigned int unique_id; /* RO */ - str type; /* RO */ - enum media_type type_id; // RO + str type; + enum media_type type_id; const struct transport_protocol *protocol; sockfamily_t *desired_family; const struct logical_intf *logical_intf; diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index 2791b7948..ab71d7176 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -3879,7 +3879,7 @@ o=- 1545997027 1 IN IP4 198.51.100.7 s=tester c=IN IP4 198.51.100.7 t=0 0 -m=audio 7304 udptl t38 +m=image 7304 udptl t38 a=T38FaxVersion:0 a=T38MaxBitRate:14400 a=T38FaxRateManagement:transferredTCF @@ -3893,7 +3893,7 @@ s=tester c=IN IP4 203.0.113.1 t=0 0 a=rtpengine:LOOPER -m=audio PORT udptl t38 +m=image PORT udptl t38 a=T38FaxVersion:0 a=T38MaxBitRate:14400 a=T38FaxRateManagement:transferredTCF @@ -3912,7 +3912,7 @@ o=- 1545997027 1 IN IP4 198.51.100.5 s=tester c=IN IP4 198.51.100.5 t=0 0 -m=audio 7300 udptl t38 +m=image 7300 udptl t38 a=T38FaxVersion:0 a=T38MaxBitRate:14400 a=T38FaxRateManagement:transferredTCF @@ -3927,7 +3927,7 @@ s=tester c=IN IP4 203.0.113.1 t=0 0 a=rtpengine:LOOPER -m=audio PORT udptl t38 +m=image PORT udptl t38 a=T38FaxVersion:0 a=T38MaxBitRate:14400 a=T38FaxRateManagement:transferredTCF