This documentation relates to an unstable version of Cipango.
visit the current release documentation home.
Cipango Maven Plugin
Cipango Maven Plugin Configuration Guide
This plugin is based on Jetty Maven Plugin, most of the options available on jetty plugin are also available.
To run a sip application from a maven project,
- add it in your POM file:
<build> ... <plugins> <plugin> <groupId>org.cipango</groupId> <artifactId>cipango-maven-plugin</artifactId> </plugin> </plugins> </build> <repositories> <repository> <id>cipango.org</id> <name>Cipango Plugin Repository</name> <url>http://repository.cipango.org</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>cipango.org</id> <name>Cipango Plugin Repository</name> <url>http://repository.cipango.org</url> </pluginRepository> </pluginRepositories>
- start the plugin:
mvn cipango:run
Supported Goals
The Cipango Maven plugin has a number of distinct Maven goals. Arguably the most useful is the run goal which runs Jetty on your unassembled sipapp. T
To see a list of all goals supported by the Cipango Maven plugin, do:
mvn cipango:help
To see the detailed list of parameters that can be configured for a particular goal, in addition to its description, do:
mvn cipango:help -Ddetail=true -Dgoal=[goal-name]
How to configure the plugin
Container Configuration
- sipConnectors optional. List of sip connectors to use. If none are configured then UDP and TCP connectors at port 5060 and on first public address. You can override this default port number and host by using the system properties
sip.port
andsip.host
on the command line, eg:mvn -Dsip.port=9999 -Dsip.host=localhost cipango:run
. - messageLog optional. The sip messages logger to use. If none are configured, then a file message logger is created in the directory <code>target/logs</code>.
- connectors, jettyConfig, scanIntervalSeconds, systemProperties, userRealms As described in the Maven Jetty Plugin.
Sipapp Configuration
- sipapp Represents an extension to the class
org.cipango.server.sipapp.SipAppContext
. You can use any of the setter methods on this object to configure your webapp. Here are a few of the most useful ones:- defaultsDescriptor optional. A sipdefault.xml file to use instead of the default for the sipapp.
- overrideDescriptor optional. A sip.xml file to be applied AFTER the webapp's sip.xml file. Useful for applying different build profiles, eg test, production etc.
- extraConfigurationClasses optional. Configuration classes to add to default Jetty configuration classes. If not set,
org.cipango.server.sipapp.SipXmlConfiguration
andorg.cipango.plugin.MavenAnnotationConfiguration
are used. - annotationsEnabled optional. Allow to disable annotations parsing.
true
by default. - contextXml, webapp As described in the Maven Jetty Plugin.
<project> ... <plugins> ... <plugin> <groupId>org.cipango</groupId> <artifactId>cipango-maven-plugin</artifactId> <configuration> <scanIntervalSeconds>5</scanIntervalSeconds> <!-- Http configuration --> <httpConnector implementation="org.eclipse.jetty.maven.plugin.MavenServerConnector"> <host>localhost</host> <port>8078</port> </httpConnector> <!-- SIP configuration --> <sipConnectors> <sipConnector implementation="org.cipango.plugin.MavenUdpConnector"> <port>5060</port> </sipConnector> </sipConnectors> <messageLog implementation="org.cipango.server.log.FileMessageLog"> <filename>target/logs/yyyy_mm_dd.message.log</filename> <retainDays>90</retainDays> <append>true</append> </messageLog> </configuration> </plugin> </plugins> </project>
Configure with websocket support
To enable Web Sockets SIP Connector support with maven plugin, the following configuration should be used.
<project> ... <plugins> ... <plugin> <groupId>org.cipango</groupId> <artifactId>cipango-maven-plugin</artifactId> <configuration> <sipConnectors> <sipConnector implementation="org.cipango.plugin.MavenUdpConnector"> <port>5060</port> </sipConnector> <sipConnector implementation="org.cipango.plugin.MavenWebSocketConnector"> <port>8080</port> </sipConnector> </sipConnectors> </configuration> <dependencies> <dependency> <groupId>org.cipango</groupId> <artifactId>cipango-websocket</artifactId> <version>${project.version}</version> </dependency> </dependencies> </plugin> </plugins> </project>
Configure with diameter support
To enable diameter support with maven plugin, the following configuration should be used.
<project> ... <plugins> ... <plugin> <groupId>org.cipango</groupId> <artifactId>cipango-maven-plugin</artifactId> <configuration> <jettyConfig>etc/diameter-mavenPlugin.xml</jettyConfig> <extraConfigurationClasses> <extraConfigurationClasse>org.cipango.server.sipapp.SipXmlConfiguration</extraConfigurationClasse> <extraConfigurationClasse>org.cipango.diameter.app.DiameterConfiguration</extraConfigurationClasse> </extraConfigurationClasses> <webAppConfig> <contextPath>/</contextPath> </webAppConfig> </configuration> <dependencies> <dependency> <groupId>org.cipango</groupId> <artifactId>cipango-diameter</artifactId> <version>3.0.0-SNAPSHOT</version> </dependency> </dependencies> </plugin> </plugins> </project>
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <Configure id="Server" class="org.eclipse.jetty.server.Server"> <Call name="addBean"> <Arg> <New id="node" class="org.cipango.diameter.node.Node"> <Call name="addConnector"> <Arg> <New class="org.cipango.diameter.bio.DiameterSocketConnector" id="DiameterSocketConnector"> <Set name="host"><Property name="diameter.host"/></Set> <Set name="port"><Property default="3868" name="diameter.port"/></Set> <Set name="messageListener"> <New class="org.cipango.diameter.log.FileMessageLogger" id="FileMessageLogger"> <Set name="filename"><Property default="." name="jetty.home"/>/logs/yyyy_mm_dd.diameter.log</Set> <Set name="append">true</Set> <Set name="retainDays">31</Set> </New> </Set> </New> </Arg> </Call> <!-- Add supported applications --> <!-- Uncomment to set the applications supported --> <!-- <Call name="addSupportedApplication"> <Arg> <Get name="SH_APPLICATION_ID" class="org.cipango.diameter.ims.Sh"/> </Arg> </Call> --> <Call name="addPeer"> <Arg> <New class="org.cipango.diameter.node.Peer"> <Arg>sip1.nexcom.voip</Arg> </New> </Arg> </Call> <Set name="statsOn">true</Set> </New> </Arg> </Call> </Configure>