<!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>Hey guys,</FONT></DIV>
<DIV><FONT face=Arial size=2>I got an XmlRpcClientException when I executed this 
code!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The stacktrace goes this way:</FONT></DIV>
<DIV><FONT face=Courier 
size=2><STRONG>org.apache.xmlrpc.client.XmlRpcClientException: Failed to send 
request to server<BR>: Connection refused: 
connect</STRONG><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
org.apache.xmlrpc.client.XmlRpcSunHttpTransport.newInputStream(XmlRpc<BR>SunHttpTransport.java:79)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.xmlrpc.client.XmlRpcStreamTransport.getInputStream(XmlRpcS<BR>treamTransport.java:159)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.xmlrpc.client.XmlRpcHttpTransport.getInputStream(XmlRpcHtt<BR>pTransport.java:49)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStre<BR>amTransport.java:213)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorke<BR>r.java:53)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:166)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:136)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:125)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
RMIServer.makeACall(RMIServer.java:36)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at RMIServer.main(RMIServer.java:49)<BR><STRONG>Caused 
by:<BR>java.net.ConnectException: Connection refused: 
connect<BR></STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
java.net.PlainSocketImpl.socketConnect(Native 
Method)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
java.net.PlainSocketImpl.doConnect(Unknown 
Source)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
java.net.PlainSocketImpl.connectToAddress(Unknown 
Source)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
java.net.PlainSocketImpl.connect(Unknown 
Source)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
java.net.Socket.connect(Unknown 
Source)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
java.net.Socket.connect(Unknown 
Source)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
sun.net.NetworkClient.doConnect(Unknown 
Source)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
sun.net.www.http.HttpClient.openServer(Unknown 
Source)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
sun.net.www.http.HttpClient.openServer(Unknown 
Source)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
sun.net.www.http.HttpClient.&lt;init&gt;(Unknown 
Source)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
sun.net.www.http.HttpClient.New(Unknown 
Source)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
sun.net.www.http.HttpClient.New(Unknown 
Source)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown<BR>Source)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown 
Sour<BR>ce)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
sun.net.www.protocol.http.HttpURLConnection.connect(Unknown 
Source)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown 
S<BR>ource)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at 
org.apache.xmlrpc.client.XmlRpcSunHttpTransport.newInputStream(XmlRpc<BR>SunHttpTransport.java:75)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.xmlrpc.client.XmlRpcStreamTransport.getInputStream(XmlRpcS<BR>treamTransport.java:159)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.xmlrpc.client.XmlRpcHttpTransport.getInputStream(XmlRpcHtt<BR>pTransport.java:49)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStre<BR>amTransport.java:213)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorke<BR>r.java:53)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:166)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:136)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:125)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
RMIServer.makeACall(RMIServer.java:36)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at RMIServer.main(RMIServer.java:49)<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Do I need to do any special configuration? 
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Regards,</FONT></DIV>
<DIV><FONT face=Arial size=2>Gayatri Kulkarni</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=adeel.gnome@gmail.com 
href="mailto:adeel.gnome@gmail.com">Adeel Ansari</A> </DIV>
<DIV><B>Sent:</B> Friday, August 22, 2008 5:58 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> Re: [Freeswitch-users] How to originate a session from 
outside</DIV></DIV></DIV>
<DIV><BR></DIV>
<DIV dir=ltr>Borris, you are great. Actually, this code worked like charm, with 
no changes.<BR>I will edit the xmlrpc-example wiki page to include the Java 
example, shortly.<BR><BR>Thanks once again.<BR><BR>
<DIV class=gmail_quote>On Fri, Aug 22, 2008 at 6:26 PM, Boris Krivonog <SPAN 
dir=ltr>&lt;<A 
href="mailto:boris.krivonog@gmail.com">boris.krivonog@gmail.com</A>&gt;</SPAN> 
wrote:<BR>
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">The 
  easiest way would be using XML-RPC<BR>(<A 
  href="http://wiki.freeswitch.org/wiki/Freeswitch_XML-RPC" 
  target=_blank>http://wiki.freeswitch.org/wiki/Freeswitch_XML-RPC</A>), with 
  Apache<BR>XML-RPC (<A href="http://ws.apache.org/xmlrpc/client.html" 
  target=_blank>http://ws.apache.org/xmlrpc/client.html</A>) libraries the 
  code<BR>would look something like:<BR><BR>XmlRpcClientConfigImpl config = new 
  XmlRpcClientConfigImpl();<BR>config.setServerURL( new 
  URL("http://&lt;freeswitchip&gt;:8080/RPC2") 
  );<BR>config.setBasicPassword("freeswitch");<BR>config.setBasicUserName("works");<BR>XmlRpcClient 
  client = new XmlRpcClient();<BR>client.setConfig(config);<BR>Object[] params = 
  new Object[]{ "originate",<BR>"sofia/gateway/gizmo2/01160176xxxxxx 
  &amp;park()" };<BR>client.execute( "freeswitch.api", params );<BR><BR>Since 
  the code above is written "from my memory", take it for<BR>illustrative 
  purpose only, however you should get the idea.<BR><BR>If you need more control 
  over the call(s), consider using<BR><A 
  title="http://wiki.freeswitch.org/wiki/Event_Socket&#10;CTRL + Click to follow link" 
  href="http://wiki.freeswitch.org/wiki/Event_Socket" 
  target=_blank>http://wiki.freeswitch.org/wiki/Event_Socket</A>.<BR><BR>Hope 
  this helps,<BR>&nbsp;Boris<BR><BR><BR>On Fri, Aug 22, 2008 at 12:24 PM, Boris 
  Krivonog<BR>&lt;<A 
  href="mailto:boris.krivonog@gmail.com">boris.krivonog@gmail.com</A>&gt; 
  wrote:<BR>&gt;<BR>&gt; The easiest way would be using XML-RPC (<A 
  href="http://wiki.freeswitch.org/wiki/Freeswitch_XML-RPC" 
  target=_blank>http://wiki.freeswitch.org/wiki/Freeswitch_XML-RPC</A>), with 
  Apache XML-RPC (<A href="http://ws.apache.org/xmlrpc/client.html" 
  target=_blank>http://ws.apache.org/xmlrpc/client.html</A>) libraries the code 
  would look something like:<BR>&gt;<BR>&gt; XmlRpcClientConfigImpl config = new 
  XmlRpcClientConfigImpl();<BR>&gt; config.setServerURL( new 
  URL("http://&lt;freeswitchip&gt;:8080/RPC2") );<BR>&gt; XmlRpcClient client = 
  new XmlRpcClient();<BR>&gt; client.setConfig(config);<BR>&gt; Object[] params 
  = new Object[]{ "originate", "sofia/gateway/gizmo2/01160176xxxxxx &amp;park()" 
  };<BR>&gt; client.execute( "freeswitch.api", params );<BR>&gt;<BR>&gt; Since 
  the code above is written "from my memory",<BR>
  <DIV>
  <DIV></DIV>
  <DIV class=Wj3C7c>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Adeel Ansari 
  wrote:<BR>&gt;<BR>&gt; Hi All,<BR>&gt;<BR>&gt; I had success in bridging a 
  session, using my Java Program as a hook, and manage to connect one mobile 
  phone to another. It goes like below.<BR>&gt;<BR>&gt; ===<BR>&gt; --&gt; 
  originate sofia/gateway/gizmo2/01160176xxxxxx 
  &amp;java(net.digitalapps.freeswitch.CallTest)<BR>&gt; ===<BR>&gt;<BR>&gt; In 
  this case, freeswitch call my Java program. Now, My intension is to not use 
  console at all, instead use my java program to originate a session in 
  freeswitch and then bridge the session. So, call freeswitch from my program, 
  not the other way around.<BR>&gt;<BR>&gt; Is it possible? Need suggestions in 
  any case. I mean if I need to come up with my own client. Actually, I was 
  looking JAIN-SIP to achieve this. But then thought of asking your suggestions. 
  With JAIN I might go like this, place a call, hit the dial plan invoke my Java 
  Hook Program and bridge the call. But I am afraid that it might connect my 
  client with the mobile phone, not one phone to &nbsp;another.<BR>&gt;<BR>&gt; 
  Thanks.<BR>&gt;<BR>&gt; --<BR>&gt; Best,<BR>&gt; Adeel Ansari<BR>&gt;<BR>&gt; 
  <A href="http://www.linkedin.com/in/adeelansari" 
  target=_blank>http://www.linkedin.com/in/adeelansari</A><BR>&gt;<BR></DIV></DIV>
  <DIV>
  <DIV></DIV>
  <DIV class=Wj3C7c>&gt; ________________________________<BR>&gt; 
  _______________________________________________<BR>&gt; Freeswitch-users 
  mailing list<BR>&gt; <A 
  href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</A><BR>&gt; 
  <A href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" 
  target=_blank>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>&gt; 
  UNSUBSCRIBE:<A 
  href="http://lists.freeswitch.org/mailman/options/freeswitch-users" 
  target=_blank>http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR>&gt; 
  <A href="http://www.freeswitch.org" 
  target=_blank>http://www.freeswitch.org</A><BR>&gt;<BR><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></DIV></DIV></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>
<P>
<HR>

<P></P>_______________________________________________<BR>Freeswitch-users 
mailing 
list<BR>Freeswitch-users@lists.freeswitch.org<BR>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<BR>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<BR>http://www.freeswitch.org<BR></BODY></HTML>