Browse Source

MT#57719 Stop using call subscriptions: `call_block_silence_media()`

Start using media subscriptions instead of call subscriptions
in the `call_block_silence_media()`, because older concept
gets deprecated.

Change-Id: I0ac0378a99d69017d34f8f949d7f3228bfa5b07a
dzenichev/fictitious
Donat Zenichev 2 years ago
parent
commit
1fd6d5f3a3
1 changed files with 22 additions and 6 deletions
  1. +22
    -6
      daemon/call_interfaces.c

+ 22
- 6
daemon/call_interfaces.c View File

@ -3048,14 +3048,30 @@ static const char *call_block_silence_media(bencode_item_t *input, bool on_off,
else if (flags.all == ALL_OFFER_ANSWER || flags.all == ALL_NON_OFFER_ANSWER else if (flags.all == ALL_OFFER_ANSWER || flags.all == ALL_NON_OFFER_ANSWER
|| flags.all == ALL_FLOWS) || flags.all == ALL_FLOWS)
{ {
for (GList *l = monologue->subscribers.head; l; l = l->next) {
struct call_subscription *cs = l->data;
if (flags.all == ALL_OFFER_ANSWER && !cs->attrs.offer_answer)
continue;
else if (flags.all == ALL_NON_OFFER_ANSWER && cs->attrs.offer_answer)
for (int i = 0; i < monologue->medias->len; i++)
{
struct call_media * media = monologue->medias->pdata[i];
if (!media)
continue; continue;
g_queue_push_tail(&sinks, cs->monologue);
for (GList * sub = media->media_subscribers.head; sub; sub = sub->next)
{
struct media_subscription * ms = sub->data;
struct call_media * other_media = ms->media;
if (!other_media ||
(flags.all == ALL_OFFER_ANSWER && !ms->attrs.offer_answer) ||
(flags.all == ALL_NON_OFFER_ANSWER && ms->attrs.offer_answer))
{
continue;
}
/* avoid duplications */
if (ms->monologue && !g_queue_find(&sinks, ms->monologue))
g_queue_push_tail(&sinks, ms->monologue);
}
} }
if (!sinks.length) { if (!sinks.length) {
ilog(LOG_WARN, "No eligible subscriptions found for '" STR_FORMAT_M "' " ilog(LOG_WARN, "No eligible subscriptions found for '" STR_FORMAT_M "' "
"for media %s", "for media %s",


Loading…
Cancel
Save