Revision 84c1291c events.c

View differences:

events.c
60 60
	json_t *event = json_object();
61 61
	json_object_set_new(event, "type", json_integer(type));
62 62
	json_object_set_new(event, "timestamp", json_integer(janus_get_monotonic_time()));
63
	json_object_set_new(event, "session_id", json_integer(session_id));
63
	if(type != JANUS_EVENT_TYPE_CORE)	/* Core events don't have a session ID */
64
		json_object_set_new(event, "session_id", json_integer(session_id));
64 65
	json_t *body = NULL;
65
	if(type != JANUS_EVENT_TYPE_WEBRTC)
66
	if(type != JANUS_EVENT_TYPE_WEBRTC && type != JANUS_EVENT_TYPE_CORE)
66 67
		body = json_object();
67 68

  
68 69
	/* Each type may require different arguments */
......
120 121
			json_object_set(body, "data", data);
121 122
			break;
122 123
		}
124
		case JANUS_EVENT_TYPE_CORE: {
125
			/* For core-related events, there's a json_t object with info on what happened */
126
			body = va_arg(args, json_t *);
127
			break;
128
		}
123 129
		default:
124 130
			JANUS_LOG(LOG_WARN, "Unknown event type '%d'\n", type);
125 131
			json_decref(event);

Also available in: Unified diff