NetConnection.Connect.Rejected doesn't support description
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
This look optional parameter so I will test it before and then merge it.
I did a little change to PR and merged it. PR closed.
thx
which file is this code merged in and this piece of code is only to publish to wowza right? @pedroSG94
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.