Example: rtmp tunneled functions

This example shows a simple tunneled transaction with a connection, requests, and disconnection.

web_add_auto_header("User-Agent", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 3.5.30729; InfoPath.2; .NET4.0C; .NET4.0E)");

web_add_auto_header("User-Agent", "Shockwave Flash");

flex_rtmp_tunneled_connect("connect_step1",
		"SessionId=1",
		"Gateway=http://123.123.123.123:1935",
		"SendIdentReq=Yes",
		"Snapshot=t21.inf",
		MESSAGE,
		"DataType=command message amf0",
		"ChunkStreamID=3",
		"MessageStreamID=0",
		"Argument=<arguments><string>connect</string><number>1</number><object>"
		"<string name=\"app\">vod</string><string name=\"flashVer\">WIN 10,3,"
		"181,14</string><string name=\"swfUrl\">http://myServer:8134/swfs/"
		"StrobeMediaPlayback.swf</string><string name=\"tcUrl\">rtmpt://myServer"
		":1935/vod</string><boolean name=\"fpad\">false</boolean><number name="
		"\"capabilities\">239</number><number name=\"audioCodecs\">3191</number"
		"><number name=\"videoCodecs\">252</number><number name=\""
		"videoFunction\">1</number><string name=\"pageUrl\">http://myServer:8134"
		"/index.html.rtmpt.short</string><number name=\"objectEncoding\">3</"
		"number></object></arguments>",
		LAST);

flex_rtmp_tunneled_send("send_step1",
		"SessionId=1",
		"Snapshot=t26.inf",
		MESSAGE,
		"DataType=window acknowledgment size",
		"WindowSize=2500000",
		LAST);

flex_rtmp_tunneled_send("send_step2",
		"SessionId=1",
		"Snapshot=t28.inf",
		MESSAGE,
		"DataType=command message amf3",
		"ChunkStreamID=3",
		"MessageStreamID=0",
		"Argument=<arguments><string>createStream</string><number>2</number>"
		"<null/></arguments>",
		LAST);

// Read the stream until at least 15 seconds of media
// have been downloaded.
flex_rtmp_tunneled_send("send_step3",
		"SessionId=1",
		"Snapshot=t31.inf",
		"ContinueToNextStepAfter=15000",
		MESSAGE,
		"DataType=command message amf3",
		"ChunkStreamID=8",
		"MessageStreamID=1",
		"Argument=<arguments><string>play</string><number>0</number><null/>"
		"<string>20051210-w50s</string><number>0</number><number>-1000</number>"
		"</arguments>",
	LAST);

// Seek the 35 second point in the media
// and play to the end.
flex_rtmp_tunneled_send(
	"send_step_custom0",
	"SessionID=1",
	"Snapshot=t32.inf",
	MESSAGE,
	"DataType=command message amf0",
	"ChunkStreamID=8",
	"MessageStreamID=1",
	"Argument="
		"<arguments>"
			"<string>seek</string>"
			"<number>0</number>"
			"<null></null>"
			"<number>35000</number>"
		"</arguments>",
	LAST);

flex_rtmp_tunneled_send("send_step5",
	"SessionId=1",
	"Snapshot=t63.inf",
	MESSAGE,
	"DataType=user control message",
	"EventType=set buffer length",
	"MessageStreamID=1",
	"BufferLength=100",
	LAST);

flex_rtmp_tunneled_send("send_step6",
	"SessionId=1",
	"Snapshot=t73.inf",
	MESSAGE,
	"DataType=command message amf3",
	"ChunkStreamID=3",
	"MessageStreamID=0",
	"Argument=<arguments><string>deleteStream</string><number>0</number>"
	"<null/><number>1</number></arguments>",
	LAST);

flex_rtmp_tunneled_disconnect("disconnect_step1",
	"SessionId=1",
	LAST);