]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
send muted members as recvonly on RFC4575 data
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 7 Apr 2014 15:51:23 +0000 (20:51 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 7 Apr 2014 15:51:29 +0000 (20:51 +0500)
src/mod/applications/mod_conference/mod_conference.c

index 6066ed3343830857ced1596c37fef617eb7b0f84..7f72df2ec968cee550a2122b68ea54a97c8bc7f1 100644 (file)
@@ -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)) {