Streaming: "stop" asyn. request - recevied an ack and there is no response in a session stopping state

Is there a reason for ignoring and not sending an error response?
“unpublish” async. request in the videoroom receives an error response.

janus_streaming.c 
	else if(!strcasecmp(request_text, "stop")) {
		janus_mutex_unlock(&sessions_mutex);
		if(g_atomic_int_get(&session->stopping) || !g_atomic_int_get(&session->started)) {
			/* Been there, done that: ignore */
			janus_streaming_message_free(msg);
			continue;
		}
		JANUS_LOG(LOG_VERB, "Stopping the streaming\n");
		...
	}
janus_videoroom.c
	else if(!strcasecmp(request_text, "unpublish")) {
		/* This participant wants to unpublish */
		if(!g_atomic_int_get(&participant->session->started)) {
			janus_refcount_decrease(&participant->ref);
			JANUS_LOG(LOG_ERR, "Can't unpublish, not published\n");
			error_code = JANUS_VIDEOROOM_ERROR_NOT_PUBLISHED;
			g_snprintf(error_cause, 512, "Can't unpublish, not published");
			goto error;
		}
		/* Tell the core to tear down the PeerConnection, hangup_media will do the rest */
		...
	}

I guess we could send an event back for consistency, yes, especially if the client stack does always expect something after an ACK.

2 Likes

Done in this commit: Send an 'idle' response when stopping a not-started mountpoint · meetecho/janus-gateway@5fa7376 · GitHub

2 Likes

Lorenzo, Thanks for replying.
I love Janus, so I named my character Janus in Diablo 4 Season 7. ^^

I will always be a supporter of Janus.

2 Likes