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,

  1. 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>
    
  1. 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

Sipapp Configuration
<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>