Discussion:
[SR-Users] XMLRPC problem
Kelvin Chua
2014-03-30 12:00:08 UTC
Permalink
i am currently having problems on xmlrpc
i am using node-xmlrpc and it fails when htable.dump returns more than 1
row.
i raised this issue on the node-xmlrpc group and this is the explanation i
got.

Each <value> node inside <param> is supposed to only have one child node,
so this looks like an invalid response. The<value> should (probably, i
don't know your use case) contain an <array> with <data> wrapped around the
structs. Seehttp://xmlrpc.scripting.com/spec.html

does this mean kamailio is not following standards?

here is the working response:

<methodResponse>
<params>
<param>
<value><struct><member><name>entry</name><value><int>6</int></value></member><member><name>size</name><value><int>1</int></value></member><member><name>slot</name><value><struct><member><name>item</name><value><struct><member><name>name</name><value><string>4::num</string></value></member><member><name>value</name><value><int>1</int></value></member></struct></value></member></struct></value></member></struct>
</value>
</param>
</params>
</methodResponse>


here is the non-working response:

<methodResponse>
<params>
<param>
<value><struct><member><name>entry</name><value><int>6</int></value></member><member><name>size</name><value><int>1</int></value></member><member><name>slot</name><value><struct><member><name>item</name><value><struct><member><name>name</name><value><string>4::num</string></value></member><member><name>value</name><value><int>1</int></value></member></struct></value></member></struct></value></member></struct>
<struct><member><name>entry</name><value><int>11</int></value></member><member><name>size</name><value><int>1</int></value></member><member><name>slot</name><value><struct><member><name>item</name><value><struct><member><name>name</name><value><string>3::num</string></value></member><member><name>value</name><value><int>1</int></value></member></struct></value></member></struct></value></member></struct>
</value>
</param>
</params>
</methodResponse>

Kelvin Chua
Juha Heinanen
2014-03-30 15:37:11 UTC
Permalink
Post by Kelvin Chua
i am currently having problems on xmlrpc
i am using node-xmlrpc and it fails when htable.dump returns more than 1
row.
i raised this issue on the node-xmlrpc group and this is the explanation i
got.
Each <value> node inside <param> is supposed to only have one child node,
so this looks like an invalid response. The<value> should (probably, i
don't know your use case) contain an <array> with <data> wrapped around the
structs. Seehttp://xmlrpc.scripting.com/spec.html
does this mean kamailio is not following standards?
see if this thread gives any glues:

http://lists.sip-router.org/pipermail/sr-users/2014-March/081865.html

-- juha
Kelvin Chua
2014-03-30 22:36:06 UTC
Permalink
thanks juha
i was able to apply the RET_ARRAY fix to htable.dump in 4.0.5
however unable to share the patch as htable_rpc[] is nowhere to be found on
trunk
was there any changes from 4.0.x to trunk with regards to rpc?

Kelvin Chua
Post by Juha Heinanen
Post by Kelvin Chua
i am currently having problems on xmlrpc
i am using node-xmlrpc and it fails when htable.dump returns more than 1
row.
i raised this issue on the node-xmlrpc group and this is the explanation
i
Post by Kelvin Chua
got.
Each <value> node inside <param> is supposed to only have one child node,
so this looks like an invalid response. The<value> should (probably, i
don't know your use case) contain an <array> with <data> wrapped around
the
Post by Kelvin Chua
structs. Seehttp://xmlrpc.scripting.com/spec.html
does this mean kamailio is not following standards?
http://lists.sip-router.org/pipermail/sr-users/2014-March/081865.html
-- juha
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Olle E. Johansson
2014-03-31 07:52:23 UTC
Permalink
Post by Juha Heinanen
Post by Kelvin Chua
i am currently having problems on xmlrpc
i am using node-xmlrpc and it fails when htable.dump returns more than 1
row.
i raised this issue on the node-xmlrpc group and this is the explanation i
got.
Each <value> node inside <param> is supposed to only have one child node,
so this looks like an invalid response. The<value> should (probably, i
don't know your use case) contain an <array> with <data> wrapped around the
structs. Seehttp://xmlrpc.scripting.com/spec.html
does this mean kamailio is not following standards?
http://lists.sip-router.org/pipermail/sr-users/2014-March/081865.html
As stated earlier Kamailio does not follow the XML-RPC standard. From time to time I tried to fix this, but got lost in the source code and never completed the work.

It is a problem when integrating with xmlrpc libraries.

/O
Juha Heinanen
2014-04-02 06:32:54 UTC
Permalink
Post by Kelvin Chua
i was able to apply the RET_ARRAY fix to htable.dump in 4.0.5
however unable to share the patch as htable_rpc[] is nowhere to be found on
trunk
was there any changes from 4.0.x to trunk with regards to rpc?
see

rpc_export_t htable_rpc[] = {
{"htable.dump", htable_rpc_dump, htable_dump_doc, 0},
{"htable.delete", htable_rpc_delete, htable_delete_doc, 0},
{"htable.get", htable_rpc_get, htable_get_doc, 0},
{"htable.sets", htable_rpc_sets, htable_sets_doc, 0},
{"htable.seti", htable_rpc_seti, htable_seti_doc, 0},
{"htable.listTables", htable_rpc_list, htable_list_doc, 0},
{"htable.reload", htable_rpc_reload, htable_reload_doc, 0},
{"htable.stats", htable_rpc_stats, htable_stats_doc, 0},
{0, 0, 0, 0}
};

in htable.c.

if you don't have write access to the repo, make the change and if it
works in your tests, i can apply the patch.

-- juha
Kelvin Chua
2014-08-16 06:53:11 UTC
Permalink
forgot to give feedback on this issue, here's a patch.

--- modules/htable/htable.c 2014-08-15 23:49:34.064455715 -0700
+++ modules/htable.c 2014-08-15 23:50:17.640626126 -0700
@@ -1105,7 +1105,7 @@
}

rpc_export_t htable_rpc[] = {
- {"htable.dump", htable_rpc_dump, htable_dump_doc, 0},
+ {"htable.dump", htable_rpc_dump, htable_dump_doc, RET_ARRAY},
{"htable.delete", htable_rpc_delete, htable_delete_doc, 0},
{"htable.get", htable_rpc_get, htable_get_doc, 0},
{"htable.sets", htable_rpc_sets, htable_sets_doc, 0},


Kelvin Chua
Post by Juha Heinanen
Post by Kelvin Chua
i was able to apply the RET_ARRAY fix to htable.dump in 4.0.5
however unable to share the patch as htable_rpc[] is nowhere to be found
on
Post by Kelvin Chua
trunk
was there any changes from 4.0.x to trunk with regards to rpc?
see
rpc_export_t htable_rpc[] = {
{"htable.dump", htable_rpc_dump, htable_dump_doc, 0},
{"htable.delete", htable_rpc_delete, htable_delete_doc, 0},
{"htable.get", htable_rpc_get, htable_get_doc, 0},
{"htable.sets", htable_rpc_sets, htable_sets_doc, 0},
{"htable.seti", htable_rpc_seti, htable_seti_doc, 0},
{"htable.listTables", htable_rpc_list, htable_list_doc, 0},
{"htable.reload", htable_rpc_reload, htable_reload_doc, 0},
{"htable.stats", htable_rpc_stats, htable_stats_doc, 0},
{0, 0, 0, 0}
};
in htable.c.
if you don't have write access to the repo, make the change and if it
works in your tests, i can apply the patch.
-- juha
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Daniel-Constantin Mierla
2014-08-18 11:25:47 UTC
Permalink
Thanks. It should have been fixed a while agon with commit
67fa31e3f01c4d70ad9561949bca4aaa230d0f46

Cheers,
Daniel
Post by Kelvin Chua
forgot to give feedback on this issue, here's a patch.
--- modules/htable/htable.c2014-08-15 23:49:34.064455715 -0700
+++ modules/htable.c 2014-08-15 23:50:17.640626126 -0700
@@ -1105,7 +1105,7 @@
}
rpc_export_t htable_rpc[] = {
-{"htable.dump", htable_rpc_dump, htable_dump_doc, 0},
+{"htable.dump", htable_rpc_dump, htable_dump_doc, RET_ARRAY},
{"htable.delete", htable_rpc_delete, htable_delete_doc, 0},
{"htable.get", htable_rpc_get, htable_get_doc, 0},
{"htable.sets", htable_rpc_sets, htable_sets_doc, 0},
Kelvin Chua
Post by Kelvin Chua
i was able to apply the RET_ARRAY fix to htable.dump in 4.0.5
however unable to share the patch as htable_rpc[] is nowhere to
be found on
Post by Kelvin Chua
trunk
was there any changes from 4.0.x to trunk with regards to rpc?
see
rpc_export_t htable_rpc[] = {
{"htable.dump", htable_rpc_dump, htable_dump_doc, 0},
{"htable.delete", htable_rpc_delete, htable_delete_doc, 0},
{"htable.get", htable_rpc_get, htable_get_doc, 0},
{"htable.sets", htable_rpc_sets, htable_sets_doc, 0},
{"htable.seti", htable_rpc_seti, htable_seti_doc, 0},
{"htable.listTables", htable_rpc_list, htable_list_doc, 0},
{"htable.reload", htable_rpc_reload, htable_reload_doc, 0},
{"htable.stats", htable_rpc_stats, htable_stats_doc, 0},
{0, 0, 0, 0}
};
in htable.c.
if you don't have write access to the repo, make the change and if it
works in your tests, i can apply the patch.
-- juha
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Continue reading on narkive:
Loading...