<!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> </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> at
org.apache.xmlrpc.client.XmlRpcSunHttpTransport.newInputStream(XmlRpc<BR>SunHttpTransport.java:79)<BR>
at
org.apache.xmlrpc.client.XmlRpcStreamTransport.getInputStream(XmlRpcS<BR>treamTransport.java:159)<BR>
at
org.apache.xmlrpc.client.XmlRpcHttpTransport.getInputStream(XmlRpcHtt<BR>pTransport.java:49)<BR>
at
org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStre<BR>amTransport.java:213)<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)<BR><STRONG>Caused
by:<BR>java.net.ConnectException: Connection refused:
connect<BR></STRONG> at
java.net.PlainSocketImpl.socketConnect(Native
Method)<BR> at
java.net.PlainSocketImpl.doConnect(Unknown
Source)<BR> at
java.net.PlainSocketImpl.connectToAddress(Unknown
Source)<BR> at
java.net.PlainSocketImpl.connect(Unknown
Source)<BR> at
java.net.Socket.connect(Unknown
Source)<BR> at
java.net.Socket.connect(Unknown
Source)<BR> at
sun.net.NetworkClient.doConnect(Unknown
Source)<BR> at
sun.net.www.http.HttpClient.openServer(Unknown
Source)<BR> at
sun.net.www.http.HttpClient.openServer(Unknown
Source)<BR> at
sun.net.www.http.HttpClient.<init>(Unknown
Source)<BR> at
sun.net.www.http.HttpClient.New(Unknown
Source)<BR> at
sun.net.www.http.HttpClient.New(Unknown
Source)<BR> at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown<BR>Source)<BR>
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown
Sour<BR>ce)<BR> at
sun.net.www.protocol.http.HttpURLConnection.connect(Unknown
Source)<BR> at
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown
S<BR>ource)<BR> at
org.apache.xmlrpc.client.XmlRpcSunHttpTransport.newInputStream(XmlRpc<BR>SunHttpTransport.java:75)<BR>
at
org.apache.xmlrpc.client.XmlRpcStreamTransport.getInputStream(XmlRpcS<BR>treamTransport.java:159)<BR>
at
org.apache.xmlrpc.client.XmlRpcHttpTransport.getInputStream(XmlRpcHtt<BR>pTransport.java:49)<BR>
at
org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStre<BR>amTransport.java:213)<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)<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> </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><<A
href="mailto:boris.krivonog@gmail.com">boris.krivonog@gmail.com</A>></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://<freeswitchip>: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
&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 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> Boris<BR><BR><BR>On Fri, Aug 22, 2008 at 12:24 PM, Boris
Krivonog<BR><<A
href="mailto:boris.krivonog@gmail.com">boris.krivonog@gmail.com</A>>
wrote:<BR>><BR>> 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>><BR>> XmlRpcClientConfigImpl config = new
XmlRpcClientConfigImpl();<BR>> config.setServerURL( new
URL("http://<freeswitchip>:8080/RPC2") );<BR>> XmlRpcClient client =
new XmlRpcClient();<BR>> client.setConfig(config);<BR>> Object[] params
= new Object[]{ "originate", "sofia/gateway/gizmo2/01160176xxxxxx &park()"
};<BR>> client.execute( "freeswitch.api", params );<BR>><BR>> Since
the code above is written "from my memory",<BR>
<DIV>
<DIV></DIV>
<DIV class=Wj3C7c>><BR>><BR>><BR>> Adeel Ansari
wrote:<BR>><BR>> Hi All,<BR>><BR>> 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>><BR>> ===<BR>> -->
originate sofia/gateway/gizmo2/01160176xxxxxx
&java(net.digitalapps.freeswitch.CallTest)<BR>> ===<BR>><BR>> 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>><BR>> 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 another.<BR>><BR>>
Thanks.<BR>><BR>> --<BR>> Best,<BR>> Adeel Ansari<BR>><BR>>
<A href="http://www.linkedin.com/in/adeelansari"
target=_blank>http://www.linkedin.com/in/adeelansari</A><BR>><BR></DIV></DIV>
<DIV>
<DIV></DIV>
<DIV class=Wj3C7c>> ________________________________<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><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>