Browse Source

TT#76711 allow update of media type

Change-Id: I3e860fe8683be2d7b0cd3cc70d4f7e4b39a0e147
changes/84/38284/7
Richard Fuchs 6 years ago
parent
commit
2d78c36338
3 changed files with 16 additions and 6 deletions
  1. +10
    -0
      daemon/call.c
  2. +2
    -2
      include/call.h
  3. +4
    -4
      t/auto-daemon-tests.pl

+ 10
- 0
daemon/call.c View File

@ -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;


+ 2
- 2
include/call.h View File

@ -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;


+ 4
- 4
t/auto-daemon-tests.pl View File

@ -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


Loading…
Cancel
Save