[Live-devel] not able to respond to SET_PARAMETER
Paul Clark
paul at packetship.com
Mon Dec 8 02:18:06 PST 2008
venugopalpaikr wrote:
> Hi,
> I am modifying Live555 to respond to Windows Media Player. While trying
> to establish the session WMP sends SET_PARAMETER. The actual response to
> SET_PARAMETER should be
>
> RTSP/1.0 200 OK
> Content-Type: application/x-rtsp-udp-packetpair;charset=UTF-8
> Content-Length: 43
> Date: Mon, 01 Dec 2008 05:28:27 GMT
> CSeq: 3
> Session: 13114845032829158031;timeout=60
> Server: WMServer/9.5.6001.18000
>
> type: high-entropy-packetpair variable-size*
>
> The end of message should be at d asterisk sign as shown above.
>
Do you mean it shouldn't have a CRLF on the end? That seems mighty
fussy of the client!
> I have written the response for SET_PARAMETER as shown :
>
> void RTSPServer::RTSPClientSession::Call_SET_PARAMETER(char const* cseq) {
>
> unsigned char ResponseBuffer[10000];
>
> snprintf((char*)ResponseBuffer,sizeof ResponseBuffer,"RTSP/1.0 200
> OK\r\nContent-Type:
> application/x-rtsp-udp-packetpair;charset=UTF-8\r\n%sCSeq: %s\r\nSession:
> %d;timeout=60\r\nServer: WMServer/9.5.6001.18000\r\n\r\n",dateHeader(),cseq,
> fOurSessionId);
>
This "\r\n\r\n" is correct - the blank line splits the header section
from the response body.
> memset(fResponseBuffer,0,RTSP_BUFFER_SIZE);
>
> send(fClientSocket,(char const*)ResponseBuffer,
> strlen((char*)ResponseBuffer), 0);
>
> snprintf((char*)ResponseBuffer,sizeof ResponseBuffer,"type:
> high-entropy-packetpair variable-size\r\n");
>
(*) You're adding a CRLF here.
> send(fClientSocket, (char const*)ResponseBuffer,
> strlen((char*)ResponseBuffer), 0);
>
> memset(fResponseBuffer,0,RTSP_BUFFER_SIZE);
>
Not sure why you are resetting this buffer twice (or at all, actually!).
> }
>
> the response is as shown below
> RTSP/1.0 200 OK
> Content-Type: application/x-rtsp-udp-packetpair;charset=UTF-8
> Date: Fri, Jan 02 1970 22:53:22 GMT
> CSeq: 3
> Session: 1;timeout=60
> Server: WMServer/9.5.6001.18000
>
> type: high-entropy-packetpair variable-size
>
> *
> the message ends at the asterisk sign which i don't want. Am not able to
> replicate the response properly. How should i modify the code? if i don't
> use "\r\n\r\n" the response gets appended to the Teardown response and is
> sent along with it when a Teardown request is received.
>
You're explicitly sending the final CRLF at (*) above; do you think
you're getting another one as well? I can't see how not sending the
double CRLF earlier could affect what the server sends back, but I guess
WMP's response parser might get confused if it doesn't see the end of
headers - where are you tracing this output?
Regards
Paul
--
Paul Clark
Packet Ship Technologies Limited
http://www.packetship.com
More information about the live-devel
mailing list