<div dir="ltr">Glad it worked for you. Actually, its not really a big deal in changing that example on the wiki. But IMO, the example should show exactly the concerned thing, just like any other example over there. In your example you got separate methods to make a call and to set the configuration, thats good. In fact, we should make the code clear, readable, and maintainable. But here its not the concern. So, I came up with the shortest code snippet, as possible. Moreover, the example is showing one more thing, if you notice, that is Java is as good as anyother language, if not superior. And we can do things in Java very precisely with a few line of codes.<br>
<br>P.S. Setters should not return any thing, at least in Java Naming Convention. You should rename your method "setConfig" to "getConfig", or comeup with something else.<br><br><div class="gmail_quote">
On Tue, Sep 2, 2008 at 8:22 PM, Gayatri Kulkarni <span dir="ltr"><<a href="mailto:xtpl.gayatri@gmail.com">xtpl.gayatri@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="padding-right: 10px; padding-left: 10px; padding-top: 15px;" bgcolor="#ffffff" name="Compose message area">
<div><font face="Arial" size="2">Guys I made a stupid mistake again</font></div>
<div><font face="Arial" size="2">guess what - I didn't specify the port number in
the URL !!!</font></div>
<div><font face="Arial" size="2">anyways, the code worked</font></div>
<div><font face="Arial" size="2">the exception was because I was using an older
version of XMLRPC API.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Anyways, Adeel you can modify the Java example on
the wiki with this one. I think this one's better than what you already have
posted there - if you don't mind that is!</font></div>
<div><font face="Arial" size="2">I don't mean to offend you.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Thanks a lot anyways!</font></div><div class="Ih2E3d">
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Regards,<br>Gayatri Kulkarni</font></div>
<div> </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><div style="font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<div><br></div>
<div style="background: rgb(245, 245, 245) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<div><b>From:</b> <a title="xtpl.gayatri@gmail.com" href="mailto:xtpl.gayatri@gmail.com" target="_blank">Gayatri Kulkarni</a> </div>
<div><b>Sent:</b> Tuesday, September 02, 2008 4:29 AM</div><div><div></div><div class="Wj3C7c">
<div><b>To:</b> <a title="freeswitch-users@lists.freeswitch.org" href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>
</div>
<div><b>Subject:</b> Re: [Freeswitch-users] How to originate a session from
outside</div></div></div></div></div><div><div></div><div class="Wj3C7c">
<div><br></div>
<div><font face="Arial" size="2">Hey Adeel,</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Remember, <b><font face="Courier">originate
sofia/internal/1001 &bridge(sofia/internal/1003</font></b><font face="Times New Roman" size="3">) had worked the other day?</font></font></div>
<div> </div>
<div>Well, now it isn't working!</div>
<div>FS is still saying No_ROUTE_DESTINATION</div>
<div><font face="Arial" size="2">And, it is also giving me a
SAXParseException!</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">You want to have a look at the code?</font></div>
<div><font face="Arial" size="2">Here it is:</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Courier" size="2">/**<br> * <br> */<br>package
localcall;</font></div>
<div><font face="Courier"></font> </div>
<div><font face="Courier" size="2">import java.lang.String;<br>import
java.net.*;</font></div>
<div><font face="Courier"></font> </div>
<div><font face="Courier" size="2">import
org.apache.xmlrpc.XmlRpcException;<br>import
org.apache.xmlrpc.client.XmlRpcClient;<br>import
org.apache.xmlrpc.client.XmlRpcClientConfigImpl;</font></div>
<div><font face="Courier"></font> </div>
<div><font face="Courier" size="2">/**<br> * @author Gayatri
Kulkarni<br> *<br> */<br>public class LocalCall {</font></div>
<div><font face="Courier"></font> </div>
<div><font face="Courier" size="2"> /**<br> * <br>
*/<br> public LocalCall() {<br> // TODO Auto-generated
constructor stub<br> }</font></div>
<div><font face="Courier"></font> </div>
<div><font size="2"><font face="Courier"> public XmlRpcClientConfigImpl
setConfig(){<br> XmlRpcClientConfigImpl conf = new
XmlRpcClientConfigImpl();<br> String server = "</font><a href="http://192.168.10.36/RPC2" target="_blank"><font title="http://192.168.10.36/RPC2
CTRL + Click to follow link" face="Courier">http://192.168.10.36/RPC2</font></a><font face="Courier">";<br> String uname =
"freeswitch";<br> String pswd = "works";<br> try
{<br> URL server_url = new
URL(server);<br> conf.setServerURL(server_url);<br> }<br> catch
(MalformedURLException e){<br> System.out.println("Cannot
generate server
URL");<br> }<br> conf.setBasicPassword(pswd);<br> conf.setBasicUserName(uname);<br> <br> return
(conf);<br> }<br> <br> public void
placeCall(XmlRpcClientConfigImpl conf){<br> XmlRpcClient rpcClient =
new XmlRpcClient();<br> String api =
"freeswitch.api";<br> rpcClient.setConfig(conf);<br>
Object[] params = new Object[]{
"originate",<br> "sofia/internal/1001
&bridge(sofia/internal/1002)" };<br> try
{<br> rpcClient.execute(api, params
);<br> }<br> catch
(XmlRpcException excpn){<br>
System.out.println("Could not execute service.
\n");<br>
excpn.printStackTrace();<br>
}<br> }</font></font></div>
<div><font face="Courier"></font> </div>
<div><font face="Courier" size="2"> /**<br> * @param args<br>
*/<br> public static void main(String[] args) {<br> // TODO
Auto-generated method stub<br> <br> LocalCall call = new
LocalCall();</font></div>
<div><font face="Courier"></font> </div>
<div><font face="Courier" size="2"> call.placeCall(call.setConfig());<br> }</font></div>
<div><font face="Courier"></font> </div>
<div><font face="Courier" size="2">}</font></div>
<div><font face="Courier" size="2"></font> </div>
<div><font face="Arial" size="2">I have done load mod_xml_rpc on the CLI of
FS.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Thanks a lot,</font></div>
<div><font face="Arial" size="2">Regards,<br>Gayatri Kulkarni</font></div>
<div><font face="Arial" size="2"></font> </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-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<div><font face="Arial"></font><br></div>
<div style="background: rgb(245, 245, 245) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<div><b>From:</b> <a title="adeel.gnome@gmail.com" href="mailto:adeel.gnome@gmail.com" target="_blank">Adeel Ansari</a> </div>
<div><b>Sent:</b> Wednesday, August 27, 2008 1:20 AM</div>
<div><b>To:</b> <a title="freeswitch-users@lists.freeswitch.org" href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>
</div>
<div><b>Subject:</b> Re: [Freeswitch-users] How to originate a session from
outside</div></div></div>
<div><font face="Arial" size="2"></font><br></div>
<div dir="ltr">Show your program. Further, try the example given in here after
appropriate modification.<br><a title="http://wiki.freeswitch.org/wiki/Freeswitch_XML-RPC#Java_Example
CTRL + Click to follow link" href="http://wiki.freeswitch.org/wiki/Freeswitch_XML-RPC#Java_Example" target="_blank">http://wiki.freeswitch.org/wiki/Freeswitch_XML-RPC#Java_Example</a><br><br>
<div class="gmail_quote">On Wed, Aug 27, 2008 at 3:56 PM, Gayatri Kulkarni <span dir="ltr"><<a title="mailto:xtpl.gayatri@gmail.com
CTRL + Click to follow link" href="mailto:xtpl.gayatri@gmail.com" target="_blank">xtpl.gayatri@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="padding-right: 10px; padding-left: 10px; padding-top: 15px;" name="Compose message area" bgcolor="#ffffff">
<div><font face="Arial" size="2">Thanks a lot!</font></div>
<div><font face="Arial" size="2">it worked - <b><i>but why?</i></b></font></div>
<div><font face="Arial" size="2">When I did the same thing through the program it
gave me :</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Courier" size="2">
<div> at
RMIServer.main(RMIServer.java:49)<br></div>Caused
by:<br>org.xml.sax.<b>SAXParseException</b>: Unknown type:
string<br> at
org.apache.xmlrpc.parser.RecursiveTypeParserImpl.startElement(Recursi<br>veTypeParserImpl.java:115)<br>
at
org.apache.xmlrpc.parser.XmlRpcResponseParser.startElement(XmlRpcResp<br>onseParser.java:126)<br>
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startEle<br>ment(Unknown
Source)<br> at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scan<br>StartElement(Unknown
Source)<br> at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp<br>l$FragmentContentDriver.next(Unknown
Source)<br> at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(U<br>nknown
Source)<br> at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next<br>(Unknown
Source)<br> at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp<br>l.scanDocument(Unknown
Source)<br> at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U<br>nknown
Source)<br> at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U<br>nknown
Source)<br> at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
So<br>urce)<br> at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Un<br>known
Source)<br> at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p<br>arse(Unknown
Source)<br> at
org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStr<br>eamTransport.java:265)
<div><font face="Arial"></font><br> at
org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStre<br></div>amTransport.java:216)
<div><font face="Arial"></font><br> at
org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorke<br>r.java:53)<br>
at
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:166)<br>
at
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:136)<br>
at
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:125)<br>
at
RMIServer.makeACall(RMIServer.java:36)<br>
at RMIServer.main(RMIServer.java:49)</div></font></div>
<div style="font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<div><font face="Arial"></font><br></div>
<div style="background: rgb(245, 245, 245) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<div><b>From:</b> <a title="adeel.gnome@gmail.com" href="mailto:adeel.gnome@gmail.com" target="_blank">Adeel Ansari</a> </div>
<div><b>Sent:</b> Wednesday, August 27, 2008 12:21 AM</div>
<div>
<div></div>
<div>
<div><b>To:</b> <a title="freeswitch-users@lists.freeswitch.org" href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a> </div>
<div><b>Subject:</b> Re: [Freeswitch-users] How to originate a session from
outside</div></div></div></div></div>
<div>
<div></div>
<div>
<div><font face="Arial" size="2"></font><font face="Arial" size="2"></font><font face="Arial" size="2"></font><br></div>
<div dir="ltr">Try this,<br><font face="Arial" size="2"><font face="Courier"><b>originate sofia/internal/1001
&bridge(sofia/internal/1003</b></font></font>)<br><br>Cheers.<br><br></div></div></div></div></blockquote></div></div></div></div></div>
<br>_______________________________________________<br>
Freeswitch-users mailing list<br>
<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Best,<br>Adeel Ansari<br><br><a href="http://www.linkedin.com/in/adeelansari">http://www.linkedin.com/in/adeelansari</a><br>
</div>