JBoss.orgCommunity Documentation

Chapter 6. Getting started with CTF

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>
        

Note

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:

To build issue mvn clean compile package for each project and deploy accordingly

Note

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:

Summary of CTF dependencies to use