RootEncoder icon indicating copy to clipboard operation
RootEncoder copied to clipboard

NetConnection.Connect.Rejected doesn't support description

Open digitalStyx opened this issue 8 years ago • 5 comments

Hi @pedroSG94

I wrote authorization mechanizm in module Wowza like:

public void publish(IClient client, RequestFunction function, AMFDataList params) {
		if (params.size() <= PARAM1 || null == client.getQueryStr() || client.getQueryStr().equals("")) {
			invokePrevious(client, function, params);
			return;
		}

		String streamId = params.getString(PARAM1);
		String[] partsStreamId = streamId.split("_");

		if (partsStreamId.length > 1) {
			String[] timeParts = partsStreamId[2].split("\\.");

			if (null != timeParts[0]) {
				long streamTime = 0;
				try {
					streamTime = Long.valueOf(timeParts[0]);
				} catch (Exception e) {
					e.printStackTrace();
				}
				if ((System.currentTimeMillis() - (60 * 60 * 1000)) > streamTime) {
					sendClientOnStatusError(client, "NetConnection.Connect.Rejected", "Authorized key is too old");
					client.setShutdownClient(true);
					return;
				}

				if (!client.getQueryStr().equals(generateStreamHash(partsStreamId[1], timeParts[0]))) {
					sendClientOnStatusError(client, "NetConnection.Connect.Rejected", "Invalid authorized key");
					client.setShutdownClient(true);
					return;
				}
			}
		}
		invokePrevious(client, function, params);
	}

and I need support field description in NetConnection error like this https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/pull/214 , could we add something?

This is in accordance with the documentation https://helpx.adobe.com/adobe-media-server/ssaslr/netconnection-class.html#netconnection_onstatus

digitalStyx avatar Aug 31 '18 14:08 digitalStyx

This look optional parameter so I will test it before and then merge it.

pedroSG94 avatar Sep 03 '18 06:09 pedroSG94

I did a little change to PR and merged it. PR closed.

pedroSG94 avatar Sep 03 '18 07:09 pedroSG94

thx

digitalStyx avatar Sep 03 '18 07:09 digitalStyx

which file is this code merged in and this piece of code is only to publish to wowza right? @pedroSG94

sagar1garg avatar Sep 09 '18 08:09 sagar1garg

This commit: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/commit/194060ec533ac69b3276ec72d220bce59c165742 It work if your server send description like digitalStyx did with wowza.

pedroSG94 avatar Sep 10 '18 06:09 pedroSG94