Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

Implement of method ANNOUNCE #11

Open
zyfdegh opened this issue Aug 23, 2017 · 1 comment
Open

Implement of method ANNOUNCE #11

zyfdegh opened this issue Aug 23, 2017 · 1 comment

Comments

@zyfdegh
Copy link

zyfdegh commented Aug 23, 2017

I tried to push video steams to dorsvr server but the server refused the ANNOUNCE requests and returned a 405 Method Not Allowed error.

I was using a streamer(encoder) called Larix Broadcaster v1.0.31 on my Android device. It tried to push camera clips to the server, but failed due to a unknown connection failure.

On the other hand, VLC player cannot open the rtsp link.

These logs are printed

We use port 80 for optional RTSP-over-HTTP tunneling, or for HTTP live streaming (for indexed Transport Stream files only).
This server's URL: rtsp://172.17.0.1:8554/<filename>.
2017/08/23 14:33:38 [I] Received 88 new bytes of request data.
2017/08/23 14:33:38 [I] Received a complete OPTIONS request:
OPTIONS rtsp://192.168.10.187:8554/hwcam RTSP/1.0
CSeq: 1
User-Agent: Larix/1.0.31


2017/08/23 14:33:38 [I] send response:
RTSP/1.0 200 OK
CSeq: 1
Date: 2017-08-23 14:33:38.390808291 +0800 CST
Public: [OPTIONS DESCRIBE SETUP TEARDOWN PLAY PAUSE RECORD GET_PARAMETER SET_PARAMETER]


2017/08/23 14:33:38 [I] Received 536 new bytes of request data.
2017/08/23 14:33:38 [I] Received a complete ANNOUNCE request:
ANNOUNCE rtsp://192.168.10.187:8554/hwcam RTSP/1.0
Content-Type: application/sdp
CSeq: 2
User-Agent: Larix/1.0.31
Content-Length: 395

v=0
m=video 0 RTP/AVP/TCP 96
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z0LgHqtAUB7QgAAAAwCAAAAecCAAPQkAAehJaxsDxQqo,KM48gA==; profile-level-id=42e01e
a=control:streamid=0
m=audio 0 RTP/AVP/TCP 97
a=rtpmap:97 mpeg4-generic/44100/1
a=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1208
a=control:streamid=1

2017/08/23 14:33:38 [I] send response:
RTSP/1.0 405 Method Not Allowed
CSeq: 2
Date: 2017-08-23 14:33:38.39978622 +0800 CST
Allow: [OPTIONS DESCRIBE SETUP TEARDOWN PLAY PAUSE RECORD GET_PARAMETER SET_PARAMETER]


2017/08/23 14:33:38 [I] default: EOF
2017/08/23 14:33:38 [I] end connection[192.168.10.139:42475].

Has anyone ever got a similar error? How can I do with it? Many thanks.

@zyfdegh
Copy link
Author

zyfdegh commented Aug 23, 2017

I have checked the source codes and found the ANNOUNCE method is solved as a unsupported command.

switch requestString.CmdName {
case "OPTIONS":
c.handleCommandOptions()
case "DESCRIBE":
c.handleCommandDescribe(requestString.UrlPreSuffix, requestString.UrlSuffix, reqStr)
case "SETUP":
{
if sessionIDStr == "" {
for {
sessionIDStr = fmt.Sprintf("%08X", gs.OurRandom32())
if _, existed = c.server.getClientSession(sessionIDStr); !existed {
break
}
}
clientSession = c.newClientSession(sessionIDStr)
c.server.addClientSession(sessionIDStr, clientSession)
} else {
if clientSession, existed = c.server.getClientSession(sessionIDStr); !existed {
c.handleCommandSessionNotFound()
}
}
if clientSession != nil {
clientSession.handleCommandSetup(requestString.UrlPreSuffix, requestString.UrlSuffix, reqStr)
}
}
case "PLAY", "PAUSE", "TEARDOWN", "GET_PARAMETER", "SET_PARAMETER":
{
if clientSession, existed = c.server.getClientSession(sessionIDStr); existed {
clientSession.handleCommandWithinSession(requestString.CmdName,
requestString.UrlPreSuffix, requestString.UrlSuffix, reqStr)
} else {
c.handleCommandSessionNotFound()
}
}
case "RECORD":
default:
c.handleCommandNotSupported()
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant