Perhaps the responses for xmlrpc have to be reviewed. I am not sure it
can be fixed all in xmlrpc module or commands have to be reviewed as well.
What comes in my mind now, for a solution in xmlrpc module, is to wrap
always the data in the response in an array.
Anyhow, everyone is welcome to contribute on properly formatting the
response based on xmlrpc specs. The extension came via SER, so I am not
sure who developed it initially.
Cheers,
Daniel
On 04/03/14 21:52, Juha Heinanen wrote:
i tried make xmlrpc query on pkg.stats, but my xmlrpc
lib was not able
to parse the response (below). according to xmlrpc spec:
The body of the response is a single XML structure, a
<methodResponse>, which can contain a single <params> which contains a
single <param> which contains a single <value>.
according to the spec <value> is scalar value or <struct> or <array>.
in sip proxy response below, there a several <struct>s in the <value>,
which according to my understanding is violation of the spec.
instead, the response should be like this:
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value>
<struct>...</struct>
</value>
<value>
<struct>...</struct>
</value>
...
</data>
</array>
</param>
</methodResponse>
comments?
-- juha
--------------------------------------------------------------------------
Received the following response:
HTTP/1.0 200 OK
Via: SIP/2.0/TCP 127.0.0.1:36643
Server: OpenXg SIP Proxy (4.1.1-2 (i386/linux))
Content-Length: 6311
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value><struct><member><name>entry</name><value><int>0</int></value></member><member><name>pid</name><value><int>5846</int></value></member><member><name>rank</name><value><int>0</int></value></member><member><name>used</name><value><int>4553004</int></value></member><member><name>free</name><value><int>559936</int></value></member><member><name>real_used</name><value><int>5731520</int></value></member></struct>
<struct><member><name>entry</name><value><int>1</int></value></member><member><name>pid</name><value><int>5848</int></value></member><member><name>rank</name><value><int>1</int></value></member><member><name>used</name><value><int>4557328</int></value></member><member><name>free</name><value><int>554652</int></value></member><member><name>real_used</name><value><int>5736804</int></value></member></struct>
<struct><member><name>entry</name><value><int>2</int></value></member><member><name>pid</name><value><int>5849</int></value></member><member><name>rank</name><value><int>2</int></value></member><member><name>used</name><value><int>4557328</int></value></member><member><name>free</name><value><int>554652</int></value></member><member><name>real_used</name><value><int>5736804</int></value></member></struct>
<struct><member><name>entry</name><value><int>3</int></value></member><member><name>pid</name><value><int>5850</int></value></member><member><name>rank</name><value><int>3</int></value></member><member><name>used</name><value><int>4557328</int></value></member><member><name>free</name><value><int>554652</int></value></member><member><name>real_used</name><value><int>5736804</int></value></member></struct>
<struct><member><name>entry</name><value><int>4</int></value></member><member><name>pid</name><value><int>5851</int></value></member><member><name>rank</name><value><int>4</int></value></member><member><name>used</name><value><int>4557328</int></value></member><member><name>free</name><value><int>554652</int></value></member><member><name>real_used</name><value><int>5736804</int></value></member></struct>
<struct><member><name>entry</name><value><int>5</int></value></member><member><name>pid</name><value><int>5852</int></value></member><member><name>rank</name><value><int>4294967295</int></value></member><member><name>used</name><value><int>4556356</int></value></member><member><name>free</name><value><int>556296</int></value></member><member><name>real_used</name><value><int>5735160</int></value></member></struct>
<struct><member><name>entry</name><value><int>6</int></value></member><member><name>pid</name><value><int>5853</int></value></member><member><name>rank</name><value><int>4294967295</int></value></member><member><name>used</name><value><int>4556356</int></value></member><member><name>free</name><value><int>556296</int></value></member><member><name>real_used</name><value><int>5735160</int></value></member></struct>
<struct><member><name>entry</name><value><int>7</int></value></member><member><name>pid</name><value><int>5854</int></value></member><member><name>rank</name><value><int>4294967294</int></value></member><member><name>used</name><value><int>4563012</int></value></member><member><name>free</name><value><int>549112</int></value></member><member><name>real_used</name><value><int>5742344</int></value></member></struct>
<struct><member><name>entry</name><value><int>8</int></value></member><member><name>pid</name><value><int>5857</int></value></member><member><name>rank</name><value><int>4294967295</int></value></member><member><name>used</name><value><int>4556368</int></value></member><member><name>free</name><value><int>556236</int></value></member><member><name>real_used</name><value><int>5735220</int></value></member></struct>
<struct><member><name>entry</name><value><int>9</int></value></member><member><name>pid</name><value><int>5863</int></value></member><member><name>rank</name><value><int>4294967295</int></value></member><member><name>used</name><value><int>4556368</int></value></member><member><name>free</name><value><int>556236</int></value></member><member><name>real_used</name><value><int>5735220</int></value></member></struct>
<struct><member><name>entry</name><value><int>10</int></value></member><member><name>pid</name><value><int>5873</int></value></member><member><name>rank</name><value><int>4294967295</int></value></member><member><name>used</name><value><int>4557616</int></value></member><member><name>free</name><value><int>554844</int></value></member><member><name>real_used</name><value><int>5736612</int></value></member></struct>
<struct><member><name>entry</name><value><int>11</int></value></member><member><name>pid</name><value><int>5876</int></value></member><member><name>rank</name><value><int>5</int></value></member><member><name>used</name><value><int>4642360</int></value></member><member><name>free</name><value><int>467988</int></value></member><member><name>real_used</name><value><int>5823468</int></value></member></struct>
<struct><member><name>entry</name><value><int>12</int></value></member><member><name>pid</name><value><int>5877</int></value></member><member><name>rank</name><value><int>6</int></value></member><member><name>used</name><value><int>4618200</int></value></member><member><name>free</name><value><int>493396</int></value></member><member><name>real_used</name><value><int>5798060</int></value></member></struct>
<struct><member><name>entry</name><value><int>13</int></value></member><member><name>pid</name><value><int>5878</int></value></member><member><name>rank</name><value><int>7</int></value></member><member><name>used</name><value><int>4618200</int></value></member><member><name>free</name><value><int>493396</int></value></member><member><name>real_used</name><value><int>5798060</int></value></member></struct>
<struct><member><name>entry</name><value><int>14</int></value></member><member><name>pid</name><value><int>5884</int></value></member><member><name>rank</name><value><int>4294967292</int></value></member><member><name>used</name><value><int>4035956</int></value></member><member><name>free</name><value><int>497228</int></value></member><member><name>real_used</name><value><int>5307880</int></value></member></struct>
</value>
</param>
</params>
</methodResponse>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla -
http://www.asipto.com
http://twitter.com/#!/miconda -
http://www.linkedin.com/in/miconda