summaryrefslogtreecommitdiff
path: root/res/res_ari_events.c
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-09-04 12:25:07 -0500
committerMatt Jordan <mjordan@digium.com>2015-09-22 09:59:47 -0500
commitb99a7052621700a1aa641a1c24308f5873275fc8 (patch)
treee54d4410b334fb3059d8240d1c188434af56a8df /res/res_ari_events.c
parent47813cc51c3eae674482490e9b5bd5fcc4780fa5 (diff)
ARI: Add the ability to subscribe to all events
This patch adds the ability to subscribe to all events. There are two possible ways to accomplish this: (1) On initial WebSocket connection. This patch adds a new query parameter, 'subscribeAll'. If present and True, Asterisk will subscribe the applications to all ARI events. (2) Via the applications resource. When subscribing in this manner, an ARI client should merely specify a blank resource name, i.e., 'channels:' instead of 'channels:12354'. This will subscribe the application to all resources of the 'channels' type. ASTERISK-24870 #close Change-Id: I4a943b4db24442cf28bc64b24bfd541249790ad6
Diffstat (limited to 'res/res_ari_events.c')
-rw-r--r--res/res_ari_events.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/res/res_ari_events.c b/res/res_ari_events.c
index 4b2b151aa..e4fda0a54 100644
--- a/res/res_ari_events.c
+++ b/res/res_ari_events.c
@@ -111,6 +111,9 @@ static int ast_ari_events_event_websocket_ws_attempted_cb(struct ast_tcptls_sess
args.app[j] = (vals[j]);
}
} else
+ if (strcmp(i->name, "subscribeAll") == 0) {
+ args.subscribe_all = ast_true(i->value);
+ } else
{}
}
@@ -209,6 +212,9 @@ static void ast_ari_events_event_websocket_ws_established_cb(struct ast_websocke
args.app[j] = (vals[j]);
}
} else
+ if (strcmp(i->name, "subscribeAll") == 0) {
+ args.subscribe_all = ast_true(i->value);
+ } else
{}
}