Hi, It's necessary to pay attention to the modularity of the system and overall scoping concerns when making this type of decision. The XMLRPC is a loadable module loaded by the core at runtime. "show" is an API command registered by mod_commands.so Because of this, it is not possible to extend the knowledge of XMLRPC to the 'show' command because there is no guarantee either module will be loaded. So, it's the API interface that is designed with a [string-in / string-out] prototype and the XMLRPC is only providing an interface to the API interface of freeswitch. This independance is mandatory and a fundamental of my design principle and anything else must be abandoned despite how tempting because the API interface is called from other methods such as a direct http connection, an event socket or from a scripting language such as javascript. However, It is completely possible to add support to the show command to parse a special input param and deliver that string-out as XML for instance: "show channels as xml" "show channels as csv" Each API command must provide it's own complete interpretation of the input and decision about what to output and since the entire system only has one "show" command it is not very difficult to implement this and it would be happily accepted as a patch to mod_commands.c Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ AIM: anthm MSN:anthony_minessale@hotmail.com JABBER:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org pstn:213-799-1400 ----- Original Message ---- From: Jonas Gauffin <jonas.gauffin@gmail.com> To: freeswitch-dev@lists.freeswitch.org Sent: Tuesday, March 6, 2007 4:08:42 AM Subject: Re: [Freeswitch-dev] XML-RPC Correction: <array> <data> <value><string>0983de41-2562-fa44-8c0c-a6e5747b2c17,2007-03-06</string></value> <value><dateTime.iso8601>20070306T10:42:01</dateTime.iso8601></value> <value><string>PortAudio/1234</string></value> </data> </array> You can also use the <struct> tag to be able to assign names to each value. More info: http://www.xmlrpc.com/spec/ On 3/6/07, Jonas Gauffin <jonas.gauffin@gmail.com> wrote:
Hello
I've played around with the XML-RPC implementation and I have some suggestions. The output of all commands are now simple text strings. That makes the result parsing quite hard for applications that would like to use the interface (and it's really telnet commands wrapped into a xmlrpc body).
For instance, take the "show channels" result. It currently looks like this (have removed the xml rpc body):
uuid,created,name,state,cid_name,cid_num,ip_addr,dest,application,application_data,read_codec,read_rate,write_codec,write_rate 0983de41-2562-fa44-8c0c-a6e5747b2c17,2007-03-06 10:42:01,PortAudio/1234,CS_EXECUTE,FreeSwitch,5555551212,,1234,bridge,sofia/mydomain.com/1234@conference.freeswitch.org,L16,8000,L16,8000 37138427-cdb7-324c-b200-7123c063d473,2007-03-06 10:42:02,sofia/mydomain.com/1234@conference.freeswitch.org,CS_LOOPBACK,FreeSwitch,5555551212,,mydomain.com/1234@conference.freeswitch.org,,,PCMU,8000,PCMU,8000
2 total.
That should have been wrapped into xml instead:
<channels count="2"> <channel> <uuid>0983de41-2562-fa44-8c0c-a6e5747b2c17,2007-03-06</uuid> <created>2007-03-06 10:42:01</created> <name>PortAudio/1234</name> [... and all other information ...] </channel> </channels>
Same goes for all other commands implemented in XML-RPC.
Best regards, Jonas
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org ____________________________________________________________________________________ Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL