Skip to content

Commit

Permalink
ecall: ensure to update mute props every time a fresh call is started…
Browse files Browse the repository at this point in the history
…/answered
  • Loading branch information
z-dule committed Sep 23, 2021
1 parent 5cb7ce4 commit accad47
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/ecall/ecall.c
Original file line number Diff line number Diff line change
Expand Up @@ -2084,6 +2084,24 @@ int ecall_create_econn(struct ecall *ecall)
return err;
}

static void update_mute_props(struct ecall *ecall)
{
const char *muted_string;
bool muted;
int err = 0;

if (!ecall->props_local)
return;

muted = msystem_get_muted();

muted_string = muted ? "true" : "false";
err = econn_props_update(ecall->props_local, "muted", muted_string);
if (err) {
warning("ecall(%p): econn_props_update(muted)",
" failed (%m)\n", ecall, err);
}
}

int ecall_start(struct ecall *ecall, enum icall_call_type call_type,
bool audio_cbr)
Expand Down Expand Up @@ -2134,7 +2152,9 @@ int ecall_start(struct ecall *ecall, enum icall_call_type call_type,
}

IFLOW_CALL(ecall->flow, set_audio_cbr, audio_cbr);


update_mute_props(ecall);

if (ecall->props_local &&
(call_type == ICALL_CALL_TYPE_VIDEO
&& ecall->vstate == ICALL_VIDEO_STATE_STARTED)) {
Expand Down Expand Up @@ -2177,7 +2197,6 @@ int ecall_answer(struct ecall *ecall, enum icall_call_type call_type,
#ifdef ECALL_CBR_ALWAYS_ON
audio_cbr = true;
#endif


info("ecall(%p): answer on pending econn %p call_type=%d\n", ecall, ecall->econn, call_type);

Expand Down Expand Up @@ -2215,6 +2234,7 @@ int ecall_answer(struct ecall *ecall, enum icall_call_type call_type,
}
}
#endif
update_mute_props(ecall);

err = generate_or_gather_answer(ecall, ecall->econn);
if (err) {
Expand Down

0 comments on commit accad47

Please sign in to comment.