1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-06-28 22:59:30 +00:00

sip: origin: Honor preferred codecs for incoming calls

This enables proper negotiation of the codec when answering calls, which
previously also responded with codecs that were not part of the users
preferred ones.

Fixes: #413
This commit is contained in:
eladyn 2022-05-29 17:32:55 +02:00 committed by Evangelos Ribeiro Tzaras
parent b713141384
commit fec3451cd0

View file

@ -590,9 +590,21 @@ sip_i_state (int status,
}
if (r_sdp) {
g_autoptr (GList) codecs =
g_autoptr (GList) remote_codecs =
calls_sip_media_manager_get_codecs_from_sdp (origin->media_manager,
r_sdp->sdp_media);
GList *preferred_codecs = calls_sip_media_manager_codec_candidates (origin->media_manager);
g_autoptr (GList) codecs = NULL;
GList *node;
for (node = remote_codecs; node != NULL; node = node->next) {
MediaCodecInfo *codec = node->data;
if (g_list_find (preferred_codecs, codec)) {
g_debug ("Found common codec: %s", codec->name);
codecs = g_list_append (codecs, codec);
}
}
g_autoptr (CallsSdpCryptoContext) ctx = NULL;
const char *session_ip = NULL;
const char *media_ip = NULL;