Skip to content

Commit

Permalink
- merge-in latest fs-java-esl from freeswitch-contrib
Browse files Browse the repository at this point in the history
  • Loading branch information
ritzalam committed Jan 17, 2011
1 parent 18130b3 commit 26c1a82
Show file tree
Hide file tree
Showing 37 changed files with 657 additions and 222 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public class FreeswitchApplication extends Observable implements ConferenceServi
private static final Map<String, Integer> ESL_EVENT_ACTIONS_MAP = createMap();
private static final int ESL_ACTION_START_TALKING = 1;
private static final int ESL_ACTION_STOP_TALKING = 2;
private static final int ESL_ACTION_START_RECORDING = 3;
private static final int ESL_ACTION_STOP_RECORDING = 4;

/* this must be replaced for a method which will check if the file exists */
private boolean recording = false;
Expand All @@ -71,6 +73,8 @@ private static Map<String, Integer> createMap() {
Map<String,Integer> result = new HashMap<String,Integer>();
result.put("start-talking", ESL_ACTION_START_TALKING);
result.put("stop-talking", ESL_ACTION_STOP_TALKING);
result.put("start-recording", ESL_ACTION_START_RECORDING);
result.put("stop-recording", ESL_ACTION_STOP_RECORDING);
return Collections.unmodifiableMap(result);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void handleResponse(EslMessage response, ConferenceEventListener eventLis
log.debug("conf list member [{}] for room [{}].", member.getId(), confXML.getConferenceRoom());
//Foreach found member in conference create a JoinedEvent
pj = new ParticipantJoinedEvent(member.getId(), confXML.getConferenceRoom(),
member.getCallerId(), member.getCallerIdName(), member.getMuted(), member.getSpeeking());
member.getCallerId(), member.getCallerIdName(), member.getMuted(), member.getSpeaking());
eventListener.handleConferenceEvent(pj);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void handleResponse(EslMessage response, ConferenceEventListener eventLis
log.debug("conf list member [{}] for room [{}].", member.getId(), confXML.getConferenceRoom());
//Foreach found member in conference create a JoinedEvent
pj = new ParticipantJoinedEvent(member.getId(), confXML.getConferenceRoom(),
member.getCallerId(), member.getCallerIdName(), member.getMuted(), member.getSpeeking());
member.getCallerId(), member.getCallerIdName(), member.getMuted(), member.getSpeaking());
eventListener.handleConferenceEvent(pj);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public boolean getMuted() {
return flags.getIsMuted();
}

public boolean getSpeeking() {
return flags.getIsSpeeking();
public boolean getSpeaking() {
return flags.getIsSpeaking();
}

public void setFlags(ConferenceMemberFlags flags) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class ConferenceMemberFlags {
//private boolean isModerator = false;
//private boolean endConference = false;

boolean getIsSpeeking() {
boolean getIsSpeaking() {
return talking;
}

Expand Down
12 changes: 6 additions & 6 deletions esl-client-bbb/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
usePlugin 'eclipse'
usePlugin 'java'

version = '0.7'
version = '0.8'
jar.enabled = true

def appName = 'fs-esl-client'
Expand Down Expand Up @@ -35,7 +35,7 @@ repositories {
add(new org.apache.ivy.plugins.resolver.URLResolver()) {
name = "netty-dependency"
m2compatible = true
addArtifactPattern "http://repository.jboss.org/maven2/[organisation]/[module]/[revision]/[artifact](-[revision]).[ext]"
addArtifactPattern "http://repository.jboss.org/nexus/content/groups/public-jboss/[organisation]/[module]/[revision]/[artifact](-[revision]).[ext]"
addArtifactPattern "http://repo1.maven.org/maven2/[organisation]/[artifact]/[revision]/[artifact](-[revision]).[ext]"
}
}
Expand All @@ -45,13 +45,13 @@ repositories {
dependencies {

// Logging
compile ':slf4j-api:1.5.10@jar'
compile ':slf4j-api:1.6.1@jar'
compile ':logback-core:0.9.18@jar'
compile ':logback-classic:0.9.18@jar'
compile ':jcl-over-slf4j:1.5.10@jar'
compile ':log4j-over-slf4j:1.5.10@jar'

compile 'org.jboss.netty:netty:3.1.5.GA@jar'
testRuntime 'junit:junit:4.8.1.@jar'
compile 'org.jboss.netty:netty:3.2.1.Final@jar'
}


Expand All @@ -66,4 +66,4 @@ task resolveDeps(dependsOn: configurations.default.buildArtifacts, type: Copy) {
into('lib')
from configurations.default
from configurations.default.allArtifacts*.file
}
}
4 changes: 2 additions & 2 deletions esl-client-bbb/org.freeswitch.esl.client.example/.classpath
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Expand Down
6 changes: 3 additions & 3 deletions esl-client-bbb/org.freeswitch.esl.client.example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.freeswitch.esl.client</groupId>
<artifactId>esl-client-parent</artifactId>
<version>0.9.0-SNAPSHOT</version>
<artifactId>java-esl-client</artifactId>
<version>0.9.1-SNAPSHOT</version>
</parent>
<artifactId>org.freeswitch.esl.client.example</artifactId>
<name>FreeSWITCH Event Socket Library - Java Client example usage</name>
<dependencies>
<dependency>
<groupId>org.freeswitch.esl.client</groupId>
<artifactId>org.freeswitch.esl.client</artifactId>
<version>0.9.0-SNAPSHOT</version>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
4 changes: 2 additions & 2 deletions esl-client-bbb/org.freeswitch.esl.client/.classpath
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Expand Down
12 changes: 9 additions & 3 deletions esl-client-bbb/org.freeswitch.esl.client/TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
As at 2010.01.03

Features still to be implemented
* [Fixed]: Fix the event parser to properly use Content-Length header, reports of misshandling missing \n
* Problem using latest netty release in an OSGi container
* Chase down the apparent issue with Netty when using executor in pipeline (wierd).
* Improve exception handling - implement exceptionCaught()
* More testing of the outbound socket client template code
* Implement Send event command
* Testing of SendMsg command
Expand All @@ -12,15 +16,17 @@ Features still to be implemented
* Provide timeout protection on the client.sendSyncApiCommand(). It will currently block for ever if get no response from server.
* Working examples in an example project (started).
* Add OSGi example
* Chase down the apparent issue with Netty when using executor in pipeline (wierd).

Distribution
* [Fixed - using Sonatype] Find out how (if ok) to put binary distribution on files.freeswitch.org
* [Done] Cut a release, look at usage of tags in FS git repo.
* [Started] FreeSWITCH wiki pages
* Basic usage docs
* Package jar, javadocs, source and dependencies (slf4j, netty) for people to trial without having to build.
* Find out how (if ok) to put binary distribution on files.freeswitch.org
* Cut a release, look at usage of tags in FS svn repo.
* Host the javadoc API somewhere in the org.freeswitch domain .. files ?

Quality items
* [No] Is there a git equivalent to svn $Id$ tag ?
* Ask FS dev team for any ESL event generation test strategies/suites.
* Are all message header names in the enum ?
* Improve Javadoc coverage
Expand Down
95 changes: 42 additions & 53 deletions esl-client-bbb/org.freeswitch.esl.client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,109 +18,98 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.freeswitch.esl.client</groupId>
<artifactId>esl-client-parent</artifactId>
<version>0.9.0-SNAPSHOT</version>
<artifactId>java-esl-client</artifactId>
<version>0.9.3-SNAPSHOT</version>
</parent>
<artifactId>org.freeswitch.esl.client</artifactId>
<name>FreeSWITCH Event Socket Library - Java Client</name>
<packaging>bundle</packaging>
<build>

<plugins>

<!-- this plugin will create the target jar as a correct OSGi bundle -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.0.1</version>
<version>2.1.0</version>
<extensions>true</extensions>
<configuration>
<unpackBundle>true</unpackBundle>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-DocURL>http://www.freeswitch.org</Bundle-DocURL>
<Import-Package>*</Import-Package>
<Export-Package>
org.freeswitch.esl.client,
org.freeswitch.esl.client.transport,
org.freeswitch.esl.client.transport.event,
org.freeswitch.esl.client.transport.message,
org.freeswitch.esl.client.inbound,
org.freeswitch.esl.client.internal.debug,
org.freeswitch.esl.client.manager,
org.freeswitch.esl.client.manager.internal,
!org.freeswitch.esl.client.internal,
!org.freeswitch.esl.client.internal.debug,
org.freeswitch.esl.client.*
</Export-Package>
<!-- the debug package is a temporary hack -->
<Private-Package>
org.freeswitch.esl.client.internal,
org.freeswitch.esl.client.debug
</Private-Package>
</instructions>
</configuration>
</plugin>

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/ClientTest.java</exclude>
<exclude>**/SocketClientTest.java</exclude>
<excludes>
<exclude>**/ClientTest.java</exclude>
<exclude>**/SocketClientTest.java</exclude>
</excludes>
</configuration>
</plugin>

</plugins>

</build>
<dependencies>

<!-- tcp socket and codec library see http://jboss.org/netty -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.10</version>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
<version>3.2.1.Final</version>
</dependency>

<!-- logging library see http://slf4j.org -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.8</version>
</dependency>

<dependency>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
<version>3.1.5.GA</version>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>

<!-- test dependencies -->

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<version>4.8.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.18</version>
<version>0.9.24</version>
<scope>test</scope>
</dependency>

</dependencies>

<repositories>
<!-- for netty dependency -->
<repository>
<id>repository.jboss.org</id>
<url>http://repository.jboss.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<profiles>
<profile>
<id>jboss-public-repository</id>
<!-- for netty dependency -->
<repositories>
<repository>
<id>jboss-public-repository-group</id>
<url>http://repository.jboss.org/nexus/content/groups/public-jboss</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>

</project>

Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,19 @@

/**
* Interface for observers wanting to be notified of incoming FreeSWITCH Event Socket events.
* </p>
* <p>
* Incoming events arrive asynchronously and are processed into two queues, one for server
* initiated events, and one for the results of client requested background jobs.
* </p>
* <p>
* Each queue is serviced by a different thread pool (to ensure lowest latency for event-driven events)
* and each queue is guaranteed to be processed (and listeners notified) in the order in which the
* events are received off the wire.
* </p>
* <p>
* This design ensures that incoming event processing is not blocked by any long-running listener process.
* However multiple listeners will be notified sequentially, and so one slow listener can cause latency
* to other listeners.
*
* @author david varnes
* @version $Id$
*/
public interface IEslEventListener
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@

/**
* Entry point to connect to a running FreeSWITCH Event Socket Library module, as a client.
* </p>
* <p>
* This class provides what the FreeSWITCH documentation refers to as an 'Inbound' connection
* to the Event Socket module. That is, with reference to the socket listening on the FreeSWITCH
* server, this client occurs as an inbound connection to the server.
* </p>
* See http://wiki.freeswitch.org/wiki/Mod_event_socket
* <p>
* See <a href="http://wiki.freeswitch.org/wiki/Mod_event_socket">http://wiki.freeswitch.org/wiki/Mod_event_socket</a>
*
* @author david varnes
* @version $Id$
*/
public class Client
{
Expand Down
Loading

0 comments on commit 26c1a82

Please sign in to comment.