/push/startup always succeeds even if an invalid rtmpURL is specified

sangsoo

Member
Hello.
I use /push/startup api for youtube streaming.
The startup restapi call always succeeds, even if an invalid rtmpURL is specified.

-----Version info-----
wcs_version=5.2.936-1265f2a5d691e1a98306d0c6f3628d752ed9f438
wcs_client_version=2.0.167-c9ff2641d916675b0f8bbd6436ee3b71c08b3fb6

1. request body
{​
"streamName": "cf58",​
"rtmpUrl": "rtmp://x.rtmp.youtube.com/live2/u12321233rk5e-f7uv",​
"rtmpTransponderFullUrl": true​
}​

2. response body, 200 OK
{​
"mediaSessionId": "pfg4ua4eu1ts20j0ci64mk5p9h",​
"streamName": "u12321233rk5e-f7uv",​
"rtmpUrl": "rtmp://x.rtmp.youtube.com/live2",​
"rtmpFlashVersion": "LNX 76.219.189.0",​
"rtmpTransponderStreamNamePrefix": "",​
"width": 0,​
"height": 0,​
"fps": 0,​
"keyFrameInterval": 0,​
"rtmpTransponderKframeInterval": 60,​
"muted": false,​
"soundEnabled": false,​
"rtmpTransponderForceKframeInterval": true,​
"rtmpTransponderFullUrl": true​
}​

3. Symptoms
1) The startup api succeeds even if you use the the wrong stream key value ("u12321233rk5e-f7uv") for the rtmpUrl value.​
2) Re-publish in server log is stopped immediately after playing.​
3) youtube streaming fails, but startup RestAPI succeeds.​

Is it possible to handle errors in startup api?
A handling (Fail) is required for specifying an invalid rtmpURL.
As an alternative, I checked push/find_all immediately without delay after calling the push/startup api, but it was all 200 ok, so I couldn't use it.
Of course, if you give it some delay, find_all will return a 404 (stop).

How do I deal with it? Please comment.
Thanks.
 
Good day.
Is it possible to handle errors in startup api?
If you've specified an RTMP server address which cannot be resolved, /push/startup returns 409 Confilct
But, if you've specified right RTMP server address but a wrong stream key, the connection is establishing successfully and asynchronously. So you have to use /push/find_all with a pause.
Another option is to use REST hook /ConnectionStatusEvent in flashStreamingApp backend application. When Youtube drops the connection due to wrong stream key, this hook will show status DISCONNECTED:
Code:
3:25:26,006 INFO            RestClient - API-ASYNC-pool-13-thread-1 SEND REST OBJECT ==>
URL:http://localhost:8081/apps/EchoApp/ConnectionStatusEvent
OBJECT:
{
  "nodeId" : "qg4BeHzYSAtkhUkXgnSMEUZpsshaLPL5@95.191.130.39",
  "appKey" : "flashStreamingApp",
  "sessionId" : "/192.168.1.39:33002/127.0.0.1:1935",
  "status" : "DISCONNECTED",
  "info" : "Normal disconnect"
}
 
Top