Revision 1d31e31f plugins/janus_echotest.c

View differences:

plugins/janus_echotest.c
910 910
		g_free(event_text);
911 911
		janus_echotest_message_free(msg);
912 912

  
913
		/* Just to showcase how you can notify handlers, let's update them on our configuration */
914
		json_t *info = json_object();
915
		json_object_set_new(info, "audio_active", json_string(session->audio_active ? "true" : "false"));
916
		json_object_set_new(info, "video_active", json_string(session->video_active ? "true" : "false"));
917
		json_object_set_new(info, "bitrate", json_integer(session->bitrate));
918
		if(session->arc || session->vrc) {
919
			json_t *recording = json_object();
920
			if(session->arc && session->arc->filename)
921
				json_object_set_new(recording, "audio", json_string(session->arc->filename));
922
			if(session->vrc && session->vrc->filename)
923
				json_object_set_new(recording, "video", json_string(session->vrc->filename));
924
			json_object_set_new(info, "recording", recording);
925
		}
926
		gateway->notify_event(session->handle, info);
913
		//~ if(gateway->events_is_enabled()) {
914
			/* Just to showcase how you can notify handlers, let's update them on our configuration */
915
			json_t *info = json_object();
916
			json_object_set_new(info, "audio_active", json_string(session->audio_active ? "true" : "false"));
917
			json_object_set_new(info, "video_active", json_string(session->video_active ? "true" : "false"));
918
			json_object_set_new(info, "bitrate", json_integer(session->bitrate));
919
			if(session->arc || session->vrc) {
920
				json_t *recording = json_object();
921
				if(session->arc && session->arc->filename)
922
					json_object_set_new(recording, "audio", json_string(session->arc->filename));
923
				if(session->vrc && session->vrc->filename)
924
					json_object_set_new(recording, "video", json_string(session->vrc->filename));
925
				json_object_set_new(info, "recording", recording);
926
			}
927
			gateway->notify_event(session->handle, info);
928
		//~ }
927 929

  
928 930
		/* Done, on to the next request */
929 931
		continue;

Also available in: Unified diff