Example: flex_rtmp_reg_save_param_xpath

In this example, flex_rtmp_reg_save_param_xpath is used to get the text property of the code string. The code string is the forth string under <object>.

flex_rtmp_connect("connect_step0",
…………………
        LAST);


/* Register a request to save the connection status from the response */
    flex_rtmp_reg_save_param_xpath("ParamName=NetConnection",
        "QueryString=/RTMPBody[1]/AMFPacket[1]/AMFHeaders[1]/Messages[1]"
                     "/Message[1]/object[1]/string[4]/text()[1]",
        "NotFound=error",
        LAST);


    flex_rtmp_receive("connection_response",
        "ConnectionID=20",
        "Snapshot=tRTMP15.inf",
        CHANNEL,
        "ChunkStreamID=3",
        LAST);
Output:
Action.c(68): The following RTMP messages have been received:
Action.c(68): RTMP header: ChunkStreamID:3  MessageStreamID:0  DataType:command message amf0 ,  RTMP message:
<AMFPacket>
    <AMFHeaders>
        <Messages>
            <Message>
                <string>_result</string>
                <number>1</number>
                <null/>
                <object>
                    <string name="id">6EA1D9B4-B82B-F978-A944-BEDEE798B70C</string>
                    <number name="objectEncoding">3</number>
                    <string name="level">status</string>
                    <null name="details"/>
                    <string name="description">Connection succeeded.</string>
                    <number name="DSMessagingVersion">1</number>
                    <string name="code">NetConnection.Connect.Success</string><!-- string[4] -->
                    <string name="DSrtmpId">6EA1D9B4-B81F-F793-6EBC-8A18CA57AD79</string>
                </object>
            </Message>
        </Messages>
    </AMFHeaders>
</AMFPacket>
Action.c(68): Notify: Saving Parameter "NetConnection = NetConnection.Connect.Success". Action.c(68): flex_rtmp_receive("connection_response") was successful