]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Allow JSON API commands to send third arg for muting
authorChad Phillips <chad@apartmentlines.com>
Thu, 23 Jul 2015 04:58:32 +0000 (21:58 -0700)
committerChad Phillips <chad@apartmentlines.com>
Thu, 23 Jul 2015 04:58:32 +0000 (21:58 -0700)
The mod_conference API supports passing an optional third arg for all
mute commands (mute, unmute, tmute, vmute, unvmute, tvmute). This patch
adds support for the optional third arg to the JSON API.

FS-7882 #resolve

src/mod/applications/mod_conference/conference_event.c

index 5494f9531a341c8c6ee07d0da7c0980876fb4e7a..7ac938543a871b60cb6737661c98db4250c0f5ca 100644 (file)
@@ -99,15 +99,19 @@ void conference_event_mod_channel_handler(const char *event_channel, cJSON *json
 
        SWITCH_STANDARD_STREAM(stream);
 
-       if (!strcasecmp(action, "kick") ||
-               !strcasecmp(action, "mute") ||
+       if (!strcasecmp(action, "kick")) {
+               exec = switch_mprintf("%s %s %s", conference_name, action, cid);
+       } else if (!strcasecmp(action, "mute") ||
                !strcasecmp(action, "unmute") ||
                !strcasecmp(action, "tmute") ||
                !strcasecmp(action, "vmute") ||
                !strcasecmp(action, "unvmute") ||
-               !strcasecmp(action, "tvmute")
-               ) {
-               exec = switch_mprintf("%s %s %s", conference_name, action, cid);
+               !strcasecmp(action, "tvmute")) {
+               if (argv[0]) {
+                 exec = switch_mprintf("%s %s %s %s", conference_name, action, cid, argv[0]);
+               } else {
+                 exec = switch_mprintf("%s %s %s", conference_name, action, cid);
+               }
        } else if (!strcasecmp(action, "volume_in") ||
                           !strcasecmp(action, "volume_out") ||
                           !strcasecmp(action, "vid-res-id") ||