<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1>
<META content="MSHTML 6.00.6000.16705" name=GENERATOR></HEAD>
<BODY id=MailContainerBody 
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" 
bgColor=#ffffff leftMargin=0 topMargin=0 CanvasTabStop="true" 
name="Compose message area">
<DIV><FONT face=Arial size=2>Also, how to originate calls between endpoints 
registered to 2 different FSs??</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks a lot in advance,</FONT></DIV>
<DIV><FONT face=Arial size=2>Regards,<BR>Gayatri Kulkarni</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>-----<BR>Whenever you find yourself on the side of 
the majority, it is time to pause and reflect.<BR></FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=xtpl.gayatri@gmail.com 
href="mailto:xtpl.gayatri@gmail.com">Gayatri Kulkarni</A> </DIV>
<DIV><B>Sent:</B> Tuesday, September 02, 2008 2:45 AM</DIV>
<DIV><B>To:</B> <A title=freeswitch-users@lists.freeswitch.org 
href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</A> 
</DIV>
<DIV><B>Subject:</B> API info</DIV></DIV></DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>Hi all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Is there a way to find out what all&nbsp;API are 
accepted through the XML-RPC module and the list of parameters that each API 
would require?</FONT></DIV>
<DIV><FONT face=Arial size=2>Is there a way to find out the syntax expected by 
the XML-RPC module for invoking the API</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I tried a code in Java to find out as 
follows:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&lt;code&gt;</FONT></DIV>
<DIV><FONT size=2>
<P align=left>getSipServices(XmlRpcClientConfigImpl conf, PrintStream 
services_file) </FONT><FONT size=2>{</P>
<P align=left></FONT><B><FONT color=#7f0055 size=2>try</B></FONT><FONT size=2> 
{</P>
<P align=left></FONT><FONT color=#3f7f5f size=2>//create client:</FONT></P>
<P align=left><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;XmlRpcClient registryClient = 
</FONT><B><FONT color=#7f0055 size=2>new</B></FONT><FONT size=2> 
XmlRpcClient(conf.getServerURL());</P>
<P align=left></FONT><FONT size=2>String url_str = 
conf.getServerURL().toString();</P>
<P align=left></FONT><FONT color=#3f7f5f size=2>//create 
collection</P></FONT><FONT size=2>
<P align=left>RemoteCollection Switch = </FONT><B><FONT color=#7f0055 
size=2>new</B></FONT><FONT size=2> RemoteCollection(registryClient, 
<I>getUri</I>(url_str));</P>
<P align=left></FONT><FONT color=#3f7f5f size=2>//actually obtain 
services:</P></FONT><FONT size=2>
<P align=left>.</FONT><I><FONT color=#0000c0 size=2>services</I></FONT><FONT 
size=2> = Switch.getServices();</P>
<P align=left>.</FONT><I><FONT color=#0000c0 size=2>props</I></FONT><FONT 
size=2> = Switch.getProperties();</P>
<P align=left>.</FONT><I><FONT color=#0000c0 size=2>props</I></FONT><FONT 
size=2>.list(services_file);</P>
<P align=left><U>Enumeration</U> prop_enum = </FONT><I><FONT color=#0000c0 
size=2>props</I></FONT><FONT size=2>.elements();</P>
<P align=left>System.</FONT><I><FONT color=#0000c0 size=2>out</I></FONT><FONT 
size=2>.println(</FONT><FONT color=#2a00ff 
size=2>"--------------Properties----------------"</FONT><FONT size=2>);</P>
<P align=left></FONT><B><FONT color=#7f0055 size=2>while</B></FONT><FONT size=2> 
(prop_enum.hasMoreElements()){</P>
<P align=left>System.</FONT><I><FONT color=#0000c0 size=2>out</I></FONT><FONT 
size=2>.println(prop_enum.nextElement());</P>
<P align=left>}</P>
<P align=left>System.</FONT><I><FONT color=#0000c0 size=2>out</I></FONT><FONT 
size=2>.println(</FONT><FONT color=#2a00ff 
size=2>"----------------------------------------"</FONT><FONT size=2>);</P>
<P align=left></P>
<P align=left>String[] resources = Switch.listResources();</P>
<P align=left></FONT><B><FONT color=#7f0055 size=2>int</B></FONT><FONT size=2> i 
= 0;</P>
<P align=left>System.</FONT><I><FONT color=#0000c0 size=2>out</I></FONT><FONT 
size=2>.println(</FONT><FONT color=#2a00ff 
size=2>"--------------Resources----------------"</FONT><FONT size=2>);</P>
<P align=left></FONT><B><FONT color=#7f0055 size=2>while</B></FONT><FONT 
size=2>(i &lt; resources.</FONT><FONT color=#0000c0 size=2>length</FONT><FONT 
size=2>){</P>
<P align=left>System.</FONT><I><FONT color=#0000c0 size=2>out</I></FONT><FONT 
size=2>.println(resources[i]);</P>
<P align=left>}</P>
<P align=left>System.</FONT><I><FONT color=#0000c0 size=2>out</I></FONT><FONT 
size=2>.println(</FONT><FONT color=#2a00ff 
size=2>"----------------------------------------"</FONT><FONT size=2>);</P>
<P align=left></P></FONT><FONT size=2>
<P align=left>}</P>
<P align=left>catch (Exception e) { ....}</P></FONT><FONT size=2>
<P align=left></FONT><B><FONT color=#7f0055 size=2>return</B></FONT><FONT 
size=2> (</FONT><I><FONT color=#0000c0 size=2>services</I></FONT><FONT 
size=2>);</P>
<P align=left>}</P>
<P align=left>&lt;/code&gt;</P>
<P align=left><FONT face=Arial>Unfortunately, the it does not return any 
properties! for resources, it returns an exception: </FONT><FONT color=#ff0000 
size=2></P>
<P>java.lang.InstantiationError: org.apache.xmlrpc.XmlRpcRequest </P>
<P><FONT face=Arial color=#000000>and services returned are:</FONT></P>
<P><FONT face=Arial color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT 
size=2></P>
<P align=left><FONT face=Arial color=#000000>-----List of available 
services--------</FONT></P>
<P align=left><FONT face=Arial color=#000000>XPathQueryService</FONT></P>
<P align=left><FONT face=Arial 
color=#000000>CollectionManagementService</FONT></P>
<P align=left><FONT face=Arial color=#000000>UserManagementService</FONT></P>
<P align=left><FONT face=Arial color=#000000>DatabaseInstanceManager</FONT></P>
<P align=left><FONT face=Arial color=#000000>IndexQueryService</FONT></P>
<P align=left><FONT face=Arial color=#000000>XUpdateQueryService</FONT></P>
<P align=left><FONT face=Arial color=#000000>ValidationService</FONT></P>
<P><FONT face=Arial 
color=#000000>----------------------------------------</FONT></P>
<P><FONT face=Arial color=#000000>with these services, how do I originate a call 
from within my application</FONT></P>
<P>&nbsp;</P></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Regards,<BR>Gayatri Kulkarni</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>-----<BR>Whenever you find yourself on the side of 
the majority, it is time to pause and reflect.<BR></FONT></DIV></BODY></HTML>