Revision 71a04f89 plugins/janus_recordplay.c

View differences:

plugins/janus_recordplay.c
341 341

  
342 342
/* Useful stuff */
343 343
static volatile gint initialized = 0, stopping = 0;
344
static gboolean notify_events = TRUE;
344 345
static janus_callbacks *gateway = NULL;
345 346
static GThread *handler_thread;
346 347
static GThread *watchdog;
......
538 539
		janus_config_item *path = janus_config_get_item_drilldown(config, "general", "path");
539 540
		if(path && path->value)
540 541
			recordings_path = g_strdup(path->value);
542
		janus_config_item *events = janus_config_get_item_drilldown(config, "general", "events");
543
		if(events != NULL && events->value != NULL)
544
			notify_events = janus_is_true(events->value);
545
		if(!notify_events && callback->events_is_enabled()) {
546
			JANUS_LOG(LOG_WARN, "Notification of events to handlers disabled for %s\n", JANUS_RECORDPLAY_NAME);
547
		}
541 548
		/* Done */
542 549
		janus_config_destroy(config);
543 550
		config = NULL;
......
1226 1233
			json_object_set_new(result, "status", json_string("recording"));
1227 1234
			json_object_set_new(result, "id", json_integer(id));
1228 1235
			/* Also notify event handlers */
1229
			if(gateway->events_is_enabled()) {
1236
			if(notify_events && gateway->events_is_enabled()) {
1230 1237
				json_t *info = json_object();
1231 1238
				json_object_set_new(info, "event", json_string("recording"));
1232 1239
				json_object_set_new(info, "id", json_integer(id));
......
1316 1323
			json_object_set_new(result, "status", json_string("preparing"));
1317 1324
			json_object_set_new(result, "id", json_integer(id_value));
1318 1325
			/* Also notify event handlers */
1319
			if(gateway->events_is_enabled()) {
1326
			if(notify_events && gateway->events_is_enabled()) {
1320 1327
				json_t *info = json_object();
1321 1328
				json_object_set_new(info, "event", json_string("playout"));
1322 1329
				json_object_set_new(info, "id", json_integer(id_value));
......
1342 1349
			result = json_object();
1343 1350
			json_object_set_new(result, "status", json_string("playing"));
1344 1351
			/* Also notify event handlers */
1345
			if(gateway->events_is_enabled()) {
1352
			if(notify_events && gateway->events_is_enabled()) {
1346 1353
				json_t *info = json_object();
1347 1354
				json_object_set_new(info, "event", json_string("playing"));
1348 1355
				json_object_set_new(info, "id", json_integer(session->recording->id));
......
1411 1418
			if(session->recording)
1412 1419
				json_object_set_new(result, "id", json_integer(session->recording->id));
1413 1420
			/* Also notify event handlers */
1414
			if(gateway->events_is_enabled()) {
1421
			if(notify_events && gateway->events_is_enabled()) {
1415 1422
				json_t *info = json_object();
1416 1423
				json_object_set_new(info, "event", json_string("stopped"));
1417 1424
				if(session->recording)

Also available in: Unified diff