Wireshark-bugs: [Wireshark-bugs] [Bug 4627] New: The decoded MediaServerControl xml output is no

Date: Mon, 29 Mar 2010 07:48:45 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4627

           Summary: The decoded MediaServerControl xml output is not
                    correctly formatted
           Product: Wireshark
           Version: 1.2.6
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Low
         Component: TShark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: ml@xxxxxxxxxx


Created an attachment (id=4462)
 --> (https://bugs.wireshark.org/bugzilla/attachment.cgi?id=4462)
This file contains 2 packages with MediaServerControl payload, that are not
represented correctly

Build Information:
$ tshark -v
TShark 1.2.6 (SVN Rev 31702)

Copyright 1998-2010 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled with GLib 2.22.3, with WinPcap (version unknown), with libz 1.2.3,
without POSIX capabilities, without libpcre, with SMI 0.4.8, with c-ares 1.7.0,
with Lua 5.1, with GnuTLS 2.8.5, with Gcrypt 1.4.5, with MIT Kerberos, with
GeoIP.

Running on Windows XP Service Pack 2, build 2600, with WinPcap version 4.1.1
(packet.dll version 4.1.0.1753), based on libpcap version 1.0 branch 1_0_rel0b
(20091008), GnuTLS 2.8.5, Gcrypt 1.4.5.

Built using Microsoft Visual C++ 9.0 build 30729

--
When a packet contains a MediaServerControl payload, it is not presented
correctly.  The decoded output looks as follows (only the relevant xml part):

Message 1)

    Message Body
        Media Server Control Markup Language - draft 07
            <?xml
                version="1.0"
                encoding="utf-8"
                ?>
            <MediaServerControl>
                version="1.0"
                <response>
                    id="813"\r\n   request="playcollect"\r\n   code="200"\r\n  
text="OK"\r\n   reason="timeout"\r\n   playduration="14660"\r\n  
playoffset="14660"\r\n   name=""\r\n   
                    </response>
                </MediaServerControl>


Message 2)
    Message Body
        Media Server Control Markup Language - draft 07
            <?xml
                version="1.0"
                encoding="utf-8"
                ?>
            <MediaServerControl>
                version="1.0"
                <request>
                    <playcollect>
                        id="813"
                        cleardigits="yes"
                        barge="yes"
                        firstdigittimer="5000"
                        interdigittimer="2000"
                        extradigittimer="1000"
                        escapekey="*"
                        returnkey="#"
                        <prompt>
                            locale="fr_BE"
                            <audio/>
                                url="file://annc/LastUnansIncCall.wav"
                            <audio/>
                                url="file://annc/WasReceivedFrom.wav"
                            <variable/>
                                type="digit"
                                subtype="gen"
                                value="3284467105"
                            <audio/>
                                url="file://annc/ToReturnThisCall.wav"
                            <variable/>
                                type="number"
                                subtype="crd"
                                value="1"
                            <audio/>
                                url="file://annc/Now.wav"
                            </prompt>
                        <regex/>
                            type="mgcpdigitmap"
                            value="x"
                        </playcollect>
                    </request>
                </MediaServerControl>


The expected output is:

Message 1):
<?xml version="1.0" encoding="utf-8" ?>
<MediaServerControl version="1.0">
  <response id="813" request="playcollect" code="200" text="OK"
reason="timeout" playduration="14660" playoffset="14660" name="">
  </response>
</MediaServerControl>


Message 2)
<?xml version="1.0" encoding="utf-8" ?>
<MediaServerControl version="1.0">
    <request>
        <playcollect id="813" cleardigits="yes" barge="yes"
firstdigittimer="5000" interdigittimer="2000" extradigittimer="1000"
escapekey="*" returnkey="#">
            <prompt locale="fr_BE">
                <audio url="file://annc/LastUnansIncCall.wav"/>
                <audio url="file://annc/WasReceivedFrom.wav"/>
                <variable type="digit" subtype="gen" value="3284467105"/>
                <audio url="file://annc/ToReturnThisCall.wav"/>
                <variable type="number" subtype="crd" value="1"/>
                <audio url="file://annc/Now.wav"/>
            </prompt>
            <pattern>
               <regex name="mgcpdigitmap" value="x"/>
            </pattern>
        </playcollect>
    </request>
</MediaServerControl>

The most important change is that the attributes are inside the tag and
not outside the tag.  The "wrong" Message 1, also shows \r\n, which do not
need to be there.

Pcap file attached.

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.