Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for Diameter Ro event #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions example/diameter-ro/diameter-stack-config/jdiameter-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0"?>
<Configuration xmlns="http://www.jdiameter.org/jdiameter-server">

<LocalPeer>
<URI value="aaa://mob-chaser:3868" />
<IPAddresses>
<IPAddress value="127.0.0.1" />
</IPAddresses>
<Realm value="mobicents.org" />
<VendorID value="18016" />
<ProductName value="jDiameter" />
<FirmwareRevision value="1" />
<OverloadMonitor>
<Entry index="1" lowThreshold="0.5" highThreshold="0.6">
<ApplicationID>
<VendorId value="0" />
<AuthApplId value="4" />
<AcctApplId value="0" />
</ApplicationID>
</Entry>
</OverloadMonitor>
</LocalPeer>

<Parameters>
<AcceptUndefinedPeer value="true" />
<DuplicateProtection value="false" />
<DuplicateTimer value="240000" />
<DuplicateSize value="5000" />
<UseUriAsFqdn value="false" />
<QueueSize value="100000" />

<!-- Timeouts -->
<MessageTimeOut value="60000" />
<StopTimeOut value="10000" />
<CeaTimeOut value="10000" />
<IacTimeOut value="30000" />
<DwaTimeOut value="10000" />
<DpaTimeOut value="5000" />
<RecTimeOut value="10000" />

<!-- Statistics Configuration -->
<Statistics pause="30000" delay="30000" enabled="false" active_records="Concurrent,ScheduledExecService,Network,ScheduledExecService,AppGenRequestPerSecond,NetGenRequestPerSecond,Peer,Peer.local,PeerFSM"/>

<Concurrent>
<Entity name="ThreadGroup" size="64"/> <!-- Common Thread Pool -->
<Entity name="ProcessingMessageTimer" size="1"/>
<Entity name="DuplicationMessageTimer" size="1"/>
<Entity name="RedirectMessageTimer" size="1"/>
<Entity name="PeerOverloadTimer" size="1"/>
<Entity name="ConnectionTimer" size="1"/>
<Entity name="StatisticTimer" size="1"/>
</Concurrent>

<Dictionary enabled="false" sendLevel="MESSAGE" receiveLevel="OFF" />

<!-- Router Request Table Cache Size and ClearSize -->
<RequestTable size="10240" clear_size="2048" />
</Parameters>

<Network>
<Peers>
<Peer name="aaa://chacli-01" attempt_connect="false" rating="1" />
</Peers>
<Realms>
<Realm name="mobicents.org" peers="127.0.0.1" local_action="LOCAL" dynamic="false" exp_time="1">
<ApplicationID>
<VendorId value="0" />
<AuthApplId value="4" />
<AcctApplId value="0" />
</ApplicationID>
</Realm>

<Realm name="rnd.charging.pt" peers="127.0.0.100" local_action="LOCAL" dynamic="false" exp_time="1">
<ApplicationID>
<VendorId value="0" />
<AuthApplId value="4" />
<AcctApplId value="0" />
</ApplicationID>
</Realm>
</Realms>
</Network>

<Extensions>
<!-- To enable clustering uncomment the following lines
<SessionDatasource value="org.mobicents.diameter.impl.ha.data.ReplicatedSessionDatasource"/>
<TimerFacility value="org.mobicents.diameter.impl.ha.timer.ReplicatedTimerFacilityImpl"/>
-->
<RouterEngine value="org.jdiameter.client.impl.router.WeightedRoundRobinRouter" />
</Extensions>

</Configuration>
68 changes: 68 additions & 0 deletions example/diameter-ro/du/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>example-DiameterRo-parent</artifactId>
<groupId>org.mobicents.examples</groupId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>example-DiameterRo-DU</artifactId>

<dependencies>
<dependency>
<artifactId>example-DiameterRo-sbb</artifactId>
<groupId>org.mobicents.examples</groupId>
<version>${pom.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.mobicents.tools</groupId>
<artifactId>maven-du-plugin</artifactId>
<extensions>true</extensions>
<configuration />
<executions>
<execution>
<goals>
<goal>copy-dependencies</goal>
<goal>generate-descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>deploy-DU</id>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy overwrite="true" file="target/${project.build.finalName}.jar" todir="${jboss.home}/server/${node}/deploy" />
</tasks>
</configuration>
</execution>
<execution>
<id>undeploy-DU</id>
<phase>clean</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<delete file="${jboss.home}/server/${node}/deploy/${project.build.finalName}.jar" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
21 changes: 21 additions & 0 deletions example/diameter-ro/du/src/main/resources/services/service.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE service-xml PUBLIC "-//Sun Microsystems, Inc.//DTD JAIN SLEE Service 1.0//EN" "http://java.sun.com/dtd/slee-service_1_0.dtd">

<service-xml>
<service>

<service-name>Example DiameterRo Service</service-name>
<service-vendor>org.mobicents</service-vendor>
<service-version>1.0</service-version>

<root-sbb>
<sbb-name>TrainingexampleDiameterRo</sbb-name>
<sbb-vendor>org.mobicents</sbb-vendor>
<sbb-version>2.0</sbb-version>
</root-sbb>

<default-priority>0</default-priority>

</service>
</service-xml>
46 changes: 46 additions & 0 deletions example/diameter-ro/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<parent>
<groupId>org.mobicents.servers.jainslee</groupId>
<artifactId>restcomm-slee-parent</artifactId>
<version>7.0.11</version>
</parent>

<artifactId>example-DiameterRo-parent</artifactId>
<groupId>org.mobicents.examples</groupId>
<version>2.0.0-SNAPSHOT</version>

<name>Mobicents :: Examples :: ${pom.artifactId}</name>

<modules>
<module>sbb</module>
<module>du</module>
</modules>

<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<groupId>org.mobicents.tools</groupId>
<inherited>false</inherited>
<executions />
<configuration>
<excludePoms />
<classpathExcludes>
<exclude>xml-apis:xml-apis</exclude>
<exclude>jtidy:jtidy</exclude>
</classpathExcludes>
<resolveTransitiveDependencies>
true
</resolveTransitiveDependencies>
<eclipseProjectName>
mobicents-slee-ex1
</eclipseProjectName>
</configuration>
</plugin>
</plugins>
</build>

</project>
33 changes: 33 additions & 0 deletions example/diameter-ro/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

Overview:
In this example we will see how services are deployed
How Sbb handle DiameterRo events like : RoCreditControlRequest, RoCreditControlAnswer


Prerequisites:
++ Deploy Diameter-base Resource Adaptor
++ Deploy Diameter-Ro Resource Adaptor
++ Deploy Diameter Stack
++ Download seagull to simulate diameter traffic

How to deploy this example:
++ Go to jain-slee.diameter/example/diameter-ro and enter "mvn clean install" .
++ Copy the jar file to JBOSS deployment directory.
++ Check and confirm the SBB is installed successfullly to JAIN-SLEE through console http://localhost:8080/slee-management-console/

How to configure diameter stack at jain-slee:

++ cp jain-slee.diameter/example/diameter-ro/diameter-stack-config* <JBOSS_WILDFLY_DIR>/modules/system/layers/base/org/restcomm/diameter/lib/main/config/
++ start jain-slee

How to generate diameter traffic by seagull:

++ Download seagull and unzip at jain-slee.diameter/example/diameter-ro/seagull
++ Go to jain-slee.diameter/example/diameter-ro/seagull/scenario
++ export LD_LIBRARY_PATH=<pathto>jain-slee.diameter/example/diameter-ro/seagull/
++ mkdir <pathto>jain-slee.diameter/example/diameter-ro/seagull/logs
++ touch ../scenario/msisdn.csv
++ ../seagull -bg -conf ../config/mem_conf.client.xml -dico ../config/base_cc.xml -scen ../scenario/ccr-cca.long.client.xml -log ../logs/car-caa.client.log -llevel T -ctrl 127.0.0.1:9090 -ctrldicopath ../config



39 changes: 39 additions & 0 deletions example/diameter-ro/sbb/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>example-DiameterRo-parent</artifactId>
<groupId>org.mobicents.examples</groupId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>example-DiameterRo-sbb</artifactId>

<dependencies>
<dependency>
<groupId>org.mobicents.resources</groupId>
<artifactId>lab-ratype</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>org.mobicents.resources</groupId>
<artifactId>mobicents-slee-ra-diameter-ro-events</artifactId>
<version>2.8.18</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.mobicents.resources</groupId>
<artifactId>restcomm-slee-ra-diameter-ro-ratype</artifactId>
<version>7.1.24</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.mobicents.servers.jainslee.api</groupId>
<artifactId>jain-slee-11-ext</artifactId>
<version>7.1.83</version>
<type>jar</type>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* ***************************************************
* *
* Mobicents: The Open Source JSLEE Platform *
* *
* Distributable under LGPL license. *
* See terms of license at gnu.org. *
* *
***************************************************
*/
package org.mobicents.slee.training.examplediameterro;

import javax.slee.ActivityContextInterface;

import net.java.slee.resource.diameter.ro.events.RoCreditControlRequest;

/**
* @author Anh Dao
*/
public abstract class BounceSbb extends CommonSbb {

public BounceSbb() {
super(BounceSbb.class.getSimpleName());
}

public void sbbRolledBack(javax.slee.RolledBackContext rolledBackContext) {
tracer.info("sbbRolledBack called.");
tracer.info("--> "+rolledBackContext.getActivityContextInterface());
tracer.info("--> "+rolledBackContext.getEvent());
tracer.info("--> "+rolledBackContext.isRemoveRolledBack());
}

public void sbbExceptionThrown(Exception exception, Object obj,
javax.slee.ActivityContextInterface activityContextInterface) {
tracer.info("sbbExceptionThrown called.");
exception.printStackTrace();
tracer.info("--> "+obj);
tracer.info("--> "+activityContextInterface);
}
public void onCreditControlRequest(RoCreditControlRequest event, ActivityContextInterface ac) {
tracer.info("onCreditControlRequest called.");
tracer.info("--> "+event.getSessionId());
tracer.info("--> "+event.toString());
}
}
Loading