[Freeswitch-users] How to originate a session from outside
Gayatri Kulkarni
xtpl.gayatri at gmail.com
Tue Sep 2 05:22:39 PDT 2008
Guys I made a stupid mistake again
guess what - I didn't specify the port number in the URL !!!
anyways, the code worked
the exception was because I was using an older version of XMLRPC API.
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!
I don't mean to offend you.
Thanks a lot anyways!
Regards,
Gayatri Kulkarni
-----
Whenever you find yourself on the side of the majority, it is time to pause and reflect.
From: Gayatri Kulkarni
Sent: Tuesday, September 02, 2008 4:29 AM
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] How to originate a session from outside
Hey Adeel,
Remember, originate sofia/internal/1001 &bridge(sofia/internal/1003) had worked the other day?
Well, now it isn't working!
FS is still saying No_ROUTE_DESTINATION
And, it is also giving me a SAXParseException!
You want to have a look at the code?
Here it is:
/**
*
*/
package localcall;
import java.lang.String;
import java.net.*;
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
/**
* @author Gayatri Kulkarni
*
*/
public class LocalCall {
/**
*
*/
public LocalCall() {
// TODO Auto-generated constructor stub
}
public XmlRpcClientConfigImpl setConfig(){
XmlRpcClientConfigImpl conf = new XmlRpcClientConfigImpl();
String server = "http://192.168.10.36/RPC2";
String uname = "freeswitch";
String pswd = "works";
try {
URL server_url = new URL(server);
conf.setServerURL(server_url);
}
catch (MalformedURLException e){
System.out.println("Cannot generate server URL");
}
conf.setBasicPassword(pswd);
conf.setBasicUserName(uname);
return (conf);
}
public void placeCall(XmlRpcClientConfigImpl conf){
XmlRpcClient rpcClient = new XmlRpcClient();
String api = "freeswitch.api";
rpcClient.setConfig(conf);
Object[] params = new Object[]{ "originate",
"sofia/internal/1001 &bridge(sofia/internal/1002)" };
try {
rpcClient.execute(api, params );
}
catch (XmlRpcException excpn){
System.out.println("Could not execute service. \n");
excpn.printStackTrace();
}
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
LocalCall call = new LocalCall();
call.placeCall(call.setConfig());
}
}
I have done load mod_xml_rpc on the CLI of FS.
Thanks a lot,
Regards,
Gayatri Kulkarni
-----
Whenever you find yourself on the side of the majority, it is time to pause and reflect.
From: Adeel Ansari
Sent: Wednesday, August 27, 2008 1:20 AM
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] How to originate a session from outside
Show your program. Further, try the example given in here after appropriate modification.
http://wiki.freeswitch.org/wiki/Freeswitch_XML-RPC#Java_Example
On Wed, Aug 27, 2008 at 3:56 PM, Gayatri Kulkarni <xtpl.gayatri at gmail.com> wrote:
Thanks a lot!
it worked - but why?
When I did the same thing through the program it gave me :
at RMIServer.main(RMIServer.java:49)
Caused by:
org.xml.sax.SAXParseException: Unknown type: string
at org.apache.xmlrpc.parser.RecursiveTypeParserImpl.startElement(Recursi
veTypeParserImpl.java:115)
at org.apache.xmlrpc.parser.XmlRpcResponseParser.startElement(XmlRpcResp
onseParser.java:126)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startEle
ment(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scan
StartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(U
nknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown So
urce)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Un
known Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p
arse(Unknown Source)
at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStr
eamTransport.java:265)
at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStre
amTransport.java:216)
at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorke
r.java:53)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:166)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:136)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:125)
at RMIServer.makeACall(RMIServer.java:36)
at RMIServer.main(RMIServer.java:49)
From: Adeel Ansari
Sent: Wednesday, August 27, 2008 12:21 AM
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] How to originate a session from outside
Try this,
originate sofia/internal/1001 &bridge(sofia/internal/1003)
Cheers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080902/e553942b/attachment-0002.html
More information about the FreeSWITCH-users
mailing list