mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-28 14:14:16 +00:00
[core, mod_verto] add visibility filter to verto
This commit is contained in:
1 parent
46903fb13e
commit
4e84b34d30
2 files changed
+22
-3
No files matched your search
@@ -672,8 +672,24 @@ static void write_event(const char *event_channel, jsock_t *use_jsock, cJSON *ev
|
||||
|
||||
for(np = head->node; np; np = np->next) {
|
||||
cJSON *msg = NULL, *params;
|
||||
|
||||
|
||||
if (!use_jsock || use_jsock == np->jsock) {
|
||||
const char *visibility;
|
||||
//char *tmp;
|
||||
|
||||
if ((visibility = cJSON_GetObjectCstr(event, "contentVisibility"))) {
|
||||
if (strcasecmp(visibility, "public") &&
|
||||
((use_jsock && use_jsock->id && !strncasecmp(use_jsock->id, "guest", 5)) ||
|
||||
(np->jsock->id && !strncasecmp(np->jsock->id, "guest", 5)))) {
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
//tmp = cJSON_Print(event);
|
||||
//printf("%s\n", tmp);
|
||||
//free(tmp);
|
||||
|
||||
|
||||
params = cJSON_Duplicate(event, 1);
|
||||
cJSON_AddItemToObject(params, "eventSerno", cJSON_CreateNumber(np->serno++));
|
||||
cJSON_AddItemToObject(params, "subscribedChannel", cJSON_CreateString(head->event_channel));
|
||||
|
||||
Reference in new issue
Block a user