From c98fb0bd0ead19a903468601d42d18fa1f29768c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 7 Apr 2014 20:51:23 +0500 Subject: [PATCH] send muted members as recvonly on RFC4575 data --- .../mod_conference/mod_conference.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 6066ed3343..7f72df2ec9 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -643,6 +643,21 @@ static void conference_cdr_rejected(conference_obj_t *conference, switch_channel rp->cp = switch_caller_profile_dup(conference->pool, cp); } +static const char *audio_flow(conference_member_t *member) +{ + const char *flow = "sendrecv"; + + if (!switch_test_flag(member, MFLAG_CAN_SPEAK)) { + flow = "recvonly"; + } + + if (member->channel && switch_channel_test_flag(member->channel, CF_HOLD)) { + flow = "sendonly"; + } + + return flow; +} + static char *conference_rfc4579_render(conference_obj_t *conference, switch_event_t *event, switch_event_t *revent) { switch_xml_t xml, x_tag, x_tag1, x_tag2, x_tag3, x_tag4; @@ -856,7 +871,7 @@ static char *conference_rfc4579_render(conference_obj_t *conference, switch_even if (!(x_tag4 = switch_xml_add_child_d(x_tag3, "status", off4++))) { abort(); } - switch_xml_set_txt_d(x_tag4, switch_channel_test_flag(channel, CF_HOLD) ? "sendonly" : "sendrecv"); + switch_xml_set_txt_d(x_tag4, audio_flow(np->member)); if (switch_channel_test_flag(channel, CF_VIDEO)) { @@ -1247,7 +1262,7 @@ static cJSON *conference_json_render(conference_obj_t *conference, cJSON *req) json_add_child_string(juser, "rtpAudioSSRC", var); } - json_add_child_string(juser, "rtpAudioDirection", switch_channel_test_flag(channel, CF_HOLD) ? "sendonly" : "sendrecv"); + json_add_child_string(juser, "rtpAudioDirection", audio_flow(np->member)); if (switch_channel_test_flag(channel, CF_VIDEO)) {