[Freeswitch-users] Unable to get events from freeswitch using java ESL client

Yungwei Chen yungwei at resolvity.com
Thu Jun 2 18:34:56 MSD 2011


I missed the following:
client.setEventSubscriptions("plain", "ALL");


From: freeswitch-users-bounces at lists.freeswitch.org [freeswitch-users-bounces at lists.freeswitch.org] 
Sent: Wednesday, June 01, 2011 6:28 PM
To: freeswitch-users at lists.freeswitch.org
Subject: [Freeswitch-users] Unable to get events from freeswitch using java ESL client


Hi,

I am using org.freeswitch.esl.client-0.9.2 to ask freeswitch to make an outbound call in the following java class.
I want to be able to get notified when a call is not answered for whatever reason.
However, I don't get any events from freeswitch. What am I missing here?
Thanks.

public class esl implements IEslEventListener {
 
 /**
  * @param args
  */
 public static void main(String[] args) {
  esl e = new esl();
  Client client = new Client();
  EslMessage response = null;
  
  try {
   client.connect("192.168.6.18", 8021, "ClueCon", 10);
   client.addEventListener(e);
   
   response = client.sendSyncApiCommand("originate", "{ignore_early_media=true}sofia/gateway/broadvoice/1112223333 9886");
   
   CommandResponse cr = client.close();
   System.out.println("Done.");
   
  } catch (InboundConnectionFailure ex) {
   ex.printStackTrace();
  }
 }
 @Override
 public void backgroundJobResultReceived(EslEvent arg0) {
  System.out.println("backgroundJobResultReceived");
 }
 @Override
 public void eventReceived(EslEvent arg0) {
  System.out.println(String.format("eventReceived, event name=%s", arg0.getEventName()));
 }
}


More information about the FreeSWITCH-users mailing list