Example: flex_rtmp_connect, flex_rtmp_send, flex_rtmp_receive, and flex_rtmp_disconnect

The following example shows a session with an RTMP remote host. The script connects to, sends a request to, receives a response from, and disconnects from an RTMP server.

Action() {
    flex_rtmp_connect("connect_step0", 
        "Host=myServer:2037", 
        "Snapshot=t151.inf", 
        "ConnectionID=12", 
        MESSAGE, 
        "ChunkStreamID=3", 
        "DataType=invoke", 
        "StreamID=0", 
        "Argument=<arguments><string>connect</string><number>1</number><object>"
        "<string name=\"app\"/><string name=\"flashVer\">WIN 10,0,12,36</string"
        "><string name=\"swfUrl\">http://myServer.devlab.ad/weborb30/"
        "examples/flex/messaging/flex2msmq/Flex2MSMQ.swf</string><string name="
        "\"tcUrl\">rtmp://myServer.devlab.ad:2037</string><boolean name=\""
        "fpad\">false</boolean><number name=\"capabilities\">15</number><number"
        " name=\"audioCodecs\">3191</number><number name=\"videoCodecs\">252</"
        "number><number name=\"videoFunction\">1</number><string name=\""
        "pageUrl\">http://myServer.devlab.ad/weborb30/examples/flex/"
        "messaging/flex2msmq/index.htm</string><number name=\"objectEncoding\""
        ">3</number></object></arguments>", 
        LAST );  
    flex_rtmp_receive("recv_step0", 
        "ConnectionID=12", 
        "Snapshot=t152.inf", 
        CHANNEL, 
        "ChunkStreamID=3", 
        LAST );  
    flex_rtmp_send("send_step0", 
        "ConnectionID=12", 
        "Snapshot=t153.inf", 
        MESSAGE, 
        "ChunkStreamID=3", 
        "DataType=flex message", 
        "StreamID=0", 
        "Argument=<arguments><null/><number>2</number><null/><AMF3><object>"
        "<object-class className=\"flex.messaging.messages.AsyncMessage\">"
        "<object-class-member memberName=\"correlationId\"/>"
        "<object-class-member memberName=\"destination\"/><object-class-member "
        "memberName=\"timestamp\"/><object-class-member memberName=\"body\"/>"
        "<object-class-member memberName=\"clientId\"/><object-class-member "
        "memberName=\"timeToLive\"/><object-class-member memberName=\""
        "messageId\"/><object-class-member memberName=\"headers\"/></"
        "object-class><object-content><object-member memberName=\""
        "correlationId\"><string/></object-member><object-member memberName=\""
        "destination\"><string>ExampleDestination</string></object-member>"
        "<object-member memberName=\"timestamp\"><integer>0</integer></"
        "object-member><object-member memberName=\"body\"><string>hello</string"
        "></object-member><object-member memberName=\"clientId\"><null/></"
        "object-member><object-member memberName=\"timeToLive\"><integer>0</"
        "integer></object-member><object-member memberName=\"messageId\">"
        "<string>B9F9C2AA-7CF7-A31F-C156-9287E4EBB587</string></object-member>"
        "<object-member memberName=\"headers\"><object><object-class className="
        "\"\"/><object-content/><object-dynamic-content><object-dynamic-member "
        "dynamicMemberName=\"DSSubtopic\"><string>test-session</string></"
        "object-dynamic-member><object-dynamic-member dynamicMemberName=\""
        "DSEndpoint\"><string>weborb-rtmp</string></object-dynamic-member></"
        "object-dynamic-content></object></object-member></object-content></"
        "object></AMF3></arguments>", 
        LAST );
    flex_rtmp_disconnect("disconnect_step0", 
        "ConnectionID=12", 
        LAST );
}