{"action":"created","issue":{"url":"https://api.github.com/repos/ZoneMinder/ZoneMinder/issues/685","labels_url":"https://api.github.com/repos/ZoneMinder/ZoneMinder/issues/685/labels{/name}","comments_url":"https://api.github.com/repos/ZoneMinder/ZoneMinder/issues/685/comments","events_url":"https://api.github.com/repos/ZoneMinder/ZoneMinder/issues/685/events","html_url":"https://github.com/ZoneMinder/ZoneMinder/issues/685","id":55709242,"number":685,"title":"RTSP fails when hostname is used for source","user":{"login":"dgilmour77","id":6298982,"avatar_url":"https://avatars.githubusercontent.com/u/6298982?v=3","gravatar_id":"","url":"https://api.github.com/users/dgilmour77","html_url":"https://github.com/dgilmour77","followers_url":"https://api.github.com/users/dgilmour77/followers","following_url":"https://api.github.com/users/dgilmour77/following{/other_user}","gists_url":"https://api.github.com/users/dgilmour77/gists{/gist_id}","starred_url":"https://api.github.com/users/dgilmour77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgilmour77/subscriptions","organizations_url":"https://api.github.com/users/dgilmour77/orgs","repos_url":"https://api.github.com/users/dgilmour77/repos","events_url":"https://api.github.com/users/dgilmour77/events{/privacy}","received_events_url":"https://api.github.com/users/dgilmour77/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ZoneMinder/ZoneMinder/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-01-28T03:22:20Z","updated_at":"2015-02-23T14:18:00Z","closed_at":null,"body":"ZM console allows an RTSP source URL to be entered as a host name, and will send the host name in the URL when performing an RTSP DESCRIBE.  However, when the source provides a control url, it may do so with an IP address, not a hostname.  This causes the logic added in the following fix:\r\n\r\nhttps://github.com/ZoneMinder/ZoneMinder/commit/e764938a0d652a0e24db0fa6dde416b583a281df\r\n\r\n...to fail, generating a 404 error in response to a SETUP.  This is shown in the following zmc log file based on 1.28+.  Close to the end of this log excerpt, it is clear that the URL passed along with the SETUP is malformed because the logic in the fix above does not support a hostname/IP mismatch:\r\n\r\n[begin log excerpt]\r\n\r\n01/27/15 19:01:40.085098 zmc_m1[3722].DB2-/home/david/zoneminder/src/zm_rtsp.cpp/74 [Received RTSP response: RTSP/1.0 200 OK\r\nServer: VLC/2.0.3\r\nContent-Length: 0\r\nCseq: 1\r\nPublic: DESCRIBE,SETUP,TEARDOWN,PLAY,PAUSE,GET_PARAMETER\r\n\r\n (124 bytes)]\r\n01/27/15 19:01:40.085215 zmc_m1[3722].DB2-/home/david/zoneminder/src/zm_rtsp.cpp/48 [Sending RTSP message: DESCRIBE rtsp://kam.gilmour.net:8554/cam.sdp RTSP/1.0\r\nUser-Agent: ZoneMinder/1.28.0\r\nCSeq: 2\r\n\r\n]\r\n01/27/15 19:01:41.086964 zmc_m1[3722].DB2-/home/david/zoneminder/src/zm_rtsp.cpp/74 [Received RTSP response: RTSP/1.0 200 OK\r\nServer: VLC/2.0.3\r\nDate: Wed, 28 Jan 2015 03:01:45 GMT\r\nContent-Type: application/sdp\r\nContent-Base: rtsp://192.168.1.54:8554/cam.sdp\r\nContent-Length: 355\r\nCache-Control: no-cache\r\nCseq: 2\r\n\r\nv=0\r\no=- 15596756719339326206 15596756719339326206 IN IP4 kam\r\ns=Unnamed\r\ni=N/A\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\na=tool:vlc 2.0.3\r\na=recvonly\r\na=type:broadcast\r\na=charset:UTF-8\r\na=control:rtsp://192.168.1.54:8554/cam.sdp\r\nm=video 0 RTP/AVP 96\r\nb=RR:0\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1\r\na=control:rtsp://192.168.1.54:8554/cam.sdp/trackID=0\r\n (564 bytes)]\r\n01/27/15 19:01:41.087106 zmc_m1[3722].DB1-/home/david/zoneminder/src/zm_rtsp.cpp/372 [Processing SDP 'v=0\r\no=- 15596756719339326206 15596756719339326206 IN IP4 kam\r\ns=Unnamed\r\ni=N/A\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\na=tool:vlc 2.0.3\r\na=recvonly\r\na=type:broadcast\r\na=charset:UTF-8\r\na=control:rtsp://192.168.1.54:8554/cam.sdp\r\nm=video 0 RTP/AVP 96\r\nb=RR:0\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1\r\na=control:rtsp://192.168.1.54:8554/cam.sdp/trackID=0\r\n']\r\n01/27/15 19:01:41.087146 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 'v=0']\r\n01/27/15 19:01:41.087164 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 'o=- 15596756719339326206 15596756719339326206 IN IP4 kam']\r\n01/27/15 19:01:41.087184 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 's=Unnamed']\r\n01/27/15 19:01:41.087253 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 'i=N/A']\r\n01/27/15 19:01:41.087265 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 'c=IN IP4 0.0.0.0']\r\n01/27/15 19:01:41.087283 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 't=0 0']\r\n01/27/15 19:01:41.087292 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 'a=tool:vlc 2.0.3']\r\n01/27/15 19:01:41.087305 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/321 [Ignoring general SDP attribute 'tool:vlc 2.0.3']\r\n01/27/15 19:01:41.087314 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 'a=recvonly']\r\n01/27/15 19:01:41.087324 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/321 [Ignoring general SDP attribute 'recvonly']\r\n01/27/15 19:01:41.087333 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 'a=type:broadcast']\r\n01/27/15 19:01:41.087343 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/321 [Ignoring general SDP attribute 'type:broadcast']\r\n01/27/15 19:01:41.087351 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 'a=charset:UTF-8']\r\n01/27/15 19:01:41.087362 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/321 [Ignoring general SDP attribute 'charset:UTF-8']\r\n01/27/15 19:01:41.087370 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 'a=control:rtsp://192.168.1.54:8554/cam.sdp']\r\n01/27/15 19:01:41.087381 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/321 [Ignoring general SDP attribute 'control:rtsp://192.168.1.54:8554/cam.sdp']\r\n01/27/15 19:01:41.087390 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 'm=video 0 RTP/AVP 96']\r\n01/27/15 19:01:41.087408 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 'b=RR:0']\r\n01/27/15 19:01:41.087420 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 'a=rtpmap:96 H264/90000']\r\n01/27/15 19:01:41.087438 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 'a=fmtp:96 packetization-mode=1']\r\n01/27/15 19:01:41.087457 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/301 [Ignoring SDP fmtp attribute 'packetization-mode' for media 'video']\r\n01/27/15 19:01:41.087468 zmc_m1[3722].DB3-/home/david/zoneminder/src/zm_sdp.cpp/168 [Processing SDP line 'a=control:rtsp://192.168.1.54:8554/cam.sdp/trackID=0']\r\n01/27/15 19:01:41.088258 zmc_m1[3722].DB1-/home/david/zoneminder/src/zm_sdp.cpp/382 [Looking for codec for video payload type 96 / H264]\r\n01/27/15 19:01:41.088274 zmc_m1[3722].DB1-/home/david/zoneminder/src/zm_sdp.cpp/422 [Got dynamic payload type 96, H264]\r\n01/27/15 19:01:41.088310 zmc_m1[3722].DB2-/home/david/zoneminder/src/zm_rtsp.cpp/48 [Sending RTSP message: SETUP rtsp://kam.gilmour.net:8554/cam.sdp/rtsp://192.168.1.54:8554/cam.sdp/trackID=0 RTSP/1.0\r\nTransport: RTP/AVP/TCP;unicast\r\nUser-Agent: ZoneMinder/1.28.0\r\nCSeq: 3\r\n\r\n]\r\n01/27/15 19:01:41.123788 zmc_m1[3722].DB2-/home/david/zoneminder/src/zm_rtsp.cpp/74 [Received RTSP response: RTSP/1.0 404 Not found\r\nContent-Length: 362\r\n\r\n\r\n\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/8087399-rtsp-fails-when-hostname-is-used-for-source?utm_campaign=plugin&utm_content=tracker%2F188329&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F188329&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/ZoneMinder/ZoneMinder/issues/comments/75547623","html_url":"https://github.com/ZoneMinder/ZoneMinder/issues/685#issuecomment-75547623","issue_url":"https://api.github.com/repos/ZoneMinder/ZoneMinder/issues/685","id":75547623,"user":{"login":"dgilmour77","id":6298982,"avatar_url":"https://avatars.githubusercontent.com/u/6298982?v=3","gravatar_id":"","url":"https://api.github.com/users/dgilmour77","html_url":"https://github.com/dgilmour77","followers_url":"https://api.github.com/users/dgilmour77/followers","following_url":"https://api.github.com/users/dgilmour77/following{/other_user}","gists_url":"https://api.github.com/users/dgilmour77/gists{/gist_id}","starred_url":"https://api.github.com/users/dgilmour77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgilmour77/subscriptions","organizations_url":"https://api.github.com/users/dgilmour77/orgs","repos_url":"https://api.github.com/users/dgilmour77/repos","events_url":"https://api.github.com/users/dgilmour77/events{/privacy}","received_events_url":"https://api.github.com/users/dgilmour77/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T14:18:00Z","updated_at":"2015-02-23T14:18:00Z","body":"Thanks for the help.  It’s really a nice system, now that I have it working.\r\n"}}