JBoss.orgCommunity Documentation
In order to get started with CTF, the only thing you have to do is to define few maven dependencies in your project and register the CTF listener in the sip.xml or web.xml or your application.
First dependency is Weld, the CDI reference implementation by JBoss and more specific the weld-servlet module.
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet</artifactId>
<version>1.1.0.Final</version>
</dependency>
Second is the framework itself:
<dependency>
<groupId>org.mobicents.servlet.sip.weld</groupId>
<artifactId>sip-servlets-weld</artifactId>
<version>1.0.0.ALPHA1</version>
</dependency>
Make sure you use the JBoss public maven repository:
<repository> <id>jboss-public-repository-group</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public</url> <layout>default</layout> <releases> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </snapshots> </repository>
The CTF listener that you have to register in your application is:
<listener> <listener-class> org.mobicents.servlet.sip.weld.environment.servlet.SipServletsWeldListener </listener-class> </listener>
To get the source code along with the examples:
checkout project from svn repository: svn co https://mobicents.googlecode.com/svn/trunk/frameworks/sip-servlets/cdi-telco-framework
In the folder core/sip-servlets-weld/ you will find the project responsible to bootstrap the framework, in order to build it: mvn clean compile install
In the folder core/sip-servlets-weld-jboss5/ you will find the the project responsible to bootstrap the framework for the JBoss AS5, in order to build it: mvn clean compile install
In the folder examples/ you will find the examples of the framework, build according to the notes of every example. The examples contain the following:
click2call-servlet3.0-cdi . The Click2Call application with asynchronous processing of request feature and CTF. Deploy to MSS 2.x Tomcat 7.0.8 only
click2call-servlet25-cdi. The Click2Call application with CTF. Deploy to Servlet 2.5 container such as MSS 1.x Tomcat 6.0.29. The example can be deployed to JBoss AS5 also, build using : mvn clean compile package -Pjboss5
SipRegistration.
SipRegistarClient - SIP registration example for java servlets 3.0. Deploy to MSS 2.x Tomcat 7.0.8 only.
SipRegistarClient25 - SIP registration example for java servlets 2.5. Deploy to MSS 1.x Tomcat 6.0.29. The example can be deployed to JBoss AS5 also, build using : mvn clean compile package -Pjboss5
To build issue mvn clean compile package for each project and deploy accordingly
For JBoss AS5 special maven dependency needed for MSS 1.x JBoss AS5 version for the JBoss Weld dependency, that will be:
<dependency> <groupId>org.jboss.weld.servlet</groupId> <artifactId>weld-servlet</artifactId> <scope>runtime</scope> <classifier>jboss5</classifier> <version>1.1.0.Final</version> </dependency> <dependency> <groupId>org.mobicents.servlet.sip.weld</groupId> <artifactId>sip-servlets-weld-jboss5</artifactId> <version>1.0.0.ALPHA1</version> </dependency> </note>
CTF have been tested and verified working in the following MSS containers:
MSS 1.5 JBoss AS5
MSS 1.5 Tomcat 6.0.29
MSS 1.6-Trunk JBoss AS5
MSS 1.6-Trunk Tomcat 6.0.29
MSS 2.0-Trunk Tomcat 7.0.8
Summary of CTF dependencies to use
MSS 1.x on Tomcat 6.x
CDI
<dependency> <groupId>org.jboss.weld.servlet</groupId> <artifactId>weld-servlet</artifactId> <version>1.1.0.Final</version> </dependency>
CTF
<dependency> <groupId>org.mobicents.servlet.sip.weld</groupId> <artifactId>sip-servlets-weld</artifactId> <version>1.0.0.ALPHA1</version> </dependency>
MSS 1.x on JBoss AS5
CDI
<dependency> <groupId>org.jboss.weld.servlet</groupId> <artifactId>weld-servlet</artifactId> <scope>runtime</scope> <classifier>jboss5</classifier> <version>1.1.0.Final</version> </dependency>
CTF
<dependency> <groupId>org.mobicents.servlet.sip.weld</groupId> <artifactId>sip-servlets-weld-jboss5</artifactId> <version>1.0.0.ALPHA1</version> </dependency>
MSS 2.x on Tomcat 7.x
CDI
<dependency> <groupId>org.jboss.weld.servlet</groupId> <artifactId>weld-servlet</artifactId> <version>1.1.0.Final</version> </dependency>
CTF
<dependency> <groupId>org.mobicents.servlet.sip.weld</groupId> <artifactId>sip-servlets-weld</artifactId> <version>1.0.0.ALPHA1</version> </dependency>