]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9455 #resolve [Doubled posts in the chat window ]
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 2 Nov 2016 21:00:49 +0000 (16:00 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 2 Nov 2016 21:00:49 +0000 (16:00 -0500)
src/mod/endpoints/mod_verto/mod_verto.c

index 9fcf229315d34263aa9bd0f0f9f7fa8b3782dcb8..0c359f38b36587b44db9dff1b5db3b55ffece54a 100644 (file)
@@ -3859,7 +3859,7 @@ static switch_bool_t verto__broadcast_func(const char *method, cJSON *params, js
        char *json_text = NULL;
        switch_bool_t r = SWITCH_FALSE;
        const char *event_channel = cJSON_GetObjectCstr(params, "eventChannel");
-       cJSON *jevent;
+       cJSON *jevent, *broadcast;
        const char *display = NULL;
 
        *response = cJSON_CreateObject();
@@ -3886,9 +3886,14 @@ static switch_bool_t verto__broadcast_func(const char *method, cJSON *params, js
        }
 
        jevent = cJSON_Duplicate(params, 1);
-       write_event(event_channel, NULL, jevent);
-       switch_event_channel_broadcast(event_channel, &jevent, modname, globals.event_channel_id);
+       
+       broadcast = cJSON_GetObjectItem(params, "localBroadcast");
 
+       if (broadcast && broadcast->type == cJSON_True) {
+               write_event(event_channel, NULL, jevent);
+       } else {
+               switch_event_channel_broadcast(event_channel, &jevent, modname, globals.event_channel_id);
+       }
 
        if (jsock->profile->mcast_pub.sock != ws_sock_invalid) {
                if ((json_text = cJSON_PrintUnformatted(params))) {