Browse Source

TT#45472 support updating media ID strings

Change-Id: I8c8f42419d81fb3e08ecbbf09999d2be4f2ac93f
changes/93/25393/2
Richard Fuchs 7 years ago
parent
commit
3dc7d1b3ed
1 changed files with 23 additions and 0 deletions
  1. +23
    -0
      daemon/call.c

+ 23
- 0
daemon/call.c View File

@ -1703,6 +1703,24 @@ static void __update_media_id(struct call_media *media, struct call_media *other
g_hash_table_insert(other_ml->media_ids, &other_media->media_id, g_hash_table_insert(other_ml->media_ids, &other_media->media_id,
other_media); other_media);
} }
else {
// RFC 5888 allows changing the media ID in a re-invite
// (section 9.1), so handle this here.
if (sp->media_id.s) {
if (str_cmp_str(&other_media->media_id, &sp->media_id)) {
// mismatch - update
g_hash_table_remove(other_ml->media_ids, &other_media->media_id);
call_str_cpy(call, &other_media->media_id, &sp->media_id);
g_hash_table_insert(other_ml->media_ids, &other_media->media_id,
other_media);
}
}
else {
// we already have a media ID, but re-invite offer did not specify
// one. we keep what we already have.
;
}
}
if (!media->media_id.s) { if (!media->media_id.s) {
// outgoing side: we copy from the other side // outgoing side: we copy from the other side
if (other_media->media_id.s) if (other_media->media_id.s)
@ -1716,6 +1734,11 @@ static void __update_media_id(struct call_media *media, struct call_media *other
if (media->media_id.s) if (media->media_id.s)
g_hash_table_insert(ml->media_ids, &media->media_id, media); g_hash_table_insert(ml->media_ids, &media->media_id, media);
} }
else {
// we already have a media ID. keep what we have and ignore what's
// happening on the other side.
;
}
} }
else if (flags->opmode == OP_ANSWER) { else if (flags->opmode == OP_ANSWER) {
// in normal cases, if the answer contains a media ID, it must match // in normal cases, if the answer contains a media ID, it must match


Loading…
Cancel
Save