Revision 71a04f89 plugins/janus_voicemail.c

View differences:

plugins/janus_voicemail.c
176 176

  
177 177
/* Useful stuff */
178 178
static volatile gint initialized = 0, stopping = 0;
179
static gboolean notify_events = TRUE;
179 180
static janus_callbacks *gateway = NULL;
180 181
static GThread *handler_thread;
181 182
static GThread *watchdog;
......
338 339
		janus_config_item *base = janus_config_get_item_drilldown(config, "general", "base");
339 340
		if(base && base->value)
340 341
			recordings_base = g_strdup(base->value);
342
		janus_config_item *events = janus_config_get_item_drilldown(config, "general", "events");
343
		if(events != NULL && events->value != NULL)
344
			notify_events = janus_is_true(events->value);
345
		if(!notify_events && callback->events_is_enabled()) {
346
			JANUS_LOG(LOG_WARN, "Notification of events to handlers disabled for %s\n", JANUS_VOICEMAIL_NAME);
347
		}
341 348
		/* Done */
342 349
		janus_config_destroy(config);
343 350
		config = NULL;
......
739 746
			json_object_set_new(event, "voicemail", json_string("event"));
740 747
			json_object_set_new(event, "status", json_string(session->started ? "started" : "starting"));
741 748
			/* Also notify event handlers */
742
			if(gateway->events_is_enabled()) {
749
			if(notify_events && gateway->events_is_enabled()) {
743 750
				json_t *info = json_object();
744 751
				json_object_set_new(info, "event", json_string("starting"));
745 752
				gateway->notify_event(session->handle, info);
......
762 769
			g_snprintf(url, 1024, "%s/janus-voicemail-%"SCNu64".opus", recordings_base, session->recording_id);
763 770
			json_object_set_new(event, "recording", json_string(url));
764 771
			/* Also notify event handlers */
765
			if(gateway->events_is_enabled()) {
772
			if(notify_events && gateway->events_is_enabled()) {
766 773
				json_t *info = json_object();
767 774
				json_object_set_new(info, "event", json_string("done"));
768 775
				gateway->notify_event(session->handle, info);

Also available in: Unified diff