Revision: 22761
Author: [email protected]
Date: Wed Jul 4 01:56:49 2012
Log: New Isup Release
http://code.google.com/p/mobicents/source/detail?r=22761
Added:
/trunk/servers/jain-slee/resources/isup/du/src
/trunk/servers/jain-slee/resources/isup/du/src/main
/trunk/servers/jain-slee/resources/isup/du/src/main/resources
/trunk/servers/jain-slee/resources/isup/du/src/main/resources/META-INF
/trunk/servers/jain-slee/resources/isup/du/src/main/resources/META-INF/deploy-config.xml
/trunk/servers/jain-slee/resources/isup/du/src/main/resources/META-INF/jboss-dependency.xml
/trunk/servers/jain-slee/resources/isup/events/src/main/java/org/mobicents/slee/resources/ss7/isup/events/TimeoutEvent.java
/trunk/servers/jain-slee/resources/isup/ratype/src/main/java/org/mobicents/slee/resources/ss7/isup/ratype/CircuitActivity.java
Deleted:
/trunk/servers/jain-slee/resources/isup/events/src/main/java/org/mobicents/slee/resources/ss7/isup/events/TransactionEnded.java
Modified:
/trunk/servers/jain-slee/resources/isup/du/pom.xml
/trunk/servers/jain-slee/resources/isup/events/src/main/resources/META-INF/event-jar.xml
/trunk/servers/jain-slee/resources/isup/library/pom.xml
/trunk/servers/jain-slee/resources/isup/pom.xml
/trunk/servers/jain-slee/resources/isup/ra/src/main/java/org/mobicents/slee/resources/isup/ra/ISUPActivityHandle.java
/trunk/servers/jain-slee/resources/isup/ra/src/main/java/org/mobicents/slee/resources/isup/ra/IsupResourceAdaptor.java
/trunk/servers/jain-slee/resources/isup/ra/src/main/resources/META-INF/resource-adaptor-jar.xml
/trunk/servers/jain-slee/resources/isup/ratype/src/main/java/org/mobicents/slee/resources/ss7/isup/ratype/ActivityContextInterfaceFactory.java
/trunk/servers/jain-slee/resources/isup/ratype/src/main/java/org/mobicents/slee/resources/ss7/isup/ratype/RAISUPProvider.java
/trunk/servers/jain-slee/resources/isup/ratype/src/main/resources/META-INF/resource-adaptor-type-jar.xml
=======================================
--- /dev/null
+++
/trunk/servers/jain-slee/resources/isup/du/src/main/resources/META-INF/deploy-config.xml
Wed Jul 4 01:56:49 2012
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deploy-config>
+ <ra-entity
resource-adaptor-id="ResourceAdaptorID[name=ISUPResourceAdaptor,vendor=org.mobicents,version=2.0]"
entity-name="ISUPRA">
+ <properties />
+ <ra-link name="ISUPRA" />
+ </ra-entity>
+</deploy-config>
=======================================
--- /dev/null
+++
/trunk/servers/jain-slee/resources/isup/du/src/main/resources/META-INF/jboss-dependency.xml
Wed Jul 4 01:56:49 2012
@@ -0,0 +1,3 @@
+<dependency xmlns="urn:jboss:dependency:1.0">
+ <item whenRequired="Real"
dependentState="Installed">ISUPSS7Service</item>
+</dependency>
=======================================
--- /dev/null
+++
/trunk/servers/jain-slee/resources/isup/events/src/main/java/org/mobicents/slee/resources/ss7/isup/events/TimeoutEvent.java
Wed Jul 4 01:56:49 2012
@@ -0,0 +1,36 @@
+/**
+ *
+ */
+package org.mobicents.slee.resources.ss7.isup.events;
+
+import java.io.Serializable;
+
+import org.mobicents.protocols.ss7.isup.message.ISUPMessage;
+
+/**
+ * @author baranowb
+ *
+ */
+public class TimeoutEvent implements Serializable {
+
+ private ISUPMessage message;
+ private int timerID;
+
+ public TimeoutEvent(ISUPMessage message, int timerID) {
+ super();
+ this.message = message;
+ this.timerID = timerID;
+ }
+ /**
+ * @return the transaction
+ */
+ public ISUPMessage getMessage() {
+ return message;
+ }
+ /**
+ * @return the timedOut
+ */
+ public int getTimerID() {
+ return timerID;
+ }
+}
=======================================
--- /dev/null
+++
/trunk/servers/jain-slee/resources/isup/ratype/src/main/java/org/mobicents/slee/resources/ss7/isup/ratype/CircuitActivity.java
Wed Jul 4 01:56:49 2012
@@ -0,0 +1,69 @@
+package org.mobicents.slee.resources.ss7.isup.ratype;
+
+import java.io.IOException;
+import java.io.Serializable;
+import javax.slee.SLEEException;
+import javax.slee.resource.ActivityAlreadyExistsException;
+import javax.slee.resource.StartActivityException;
+
+import org.mobicents.protocols.ss7.isup.message.ISUPMessage;
+import org.mobicents.protocols.ss7.isup.ParameterException;
+
+public class CircuitActivity implements Serializable {
+
+ private RAISUPProvider isupProvider;
+ private int cic;
+ private int dpc;
+
+ /**
+ * Create client transaction activity
+ * @param arg0
+ * @return
+ * @throws TransactionAlredyExistsException
+ * @throws IllegalArgumentException
+ * @throws ActivityAlreadyExistsException
+ * @throws NullPointerException
+ * @throws IllegalStateException
+ * @throws SLEEException
+ * @throws StartActivityException
+ */
+ public CircuitActivity(ISUPMessage message,int dpc,RAISUPProvider
isupProvider) {
+ this.cic=message.getCircuitIdentificationCode().getCIC();
+ this.dpc=dpc;
+ this.isupProvider=isupProvider;
+ }
+
+ public void sendMessage(ISUPMessage arg0) throws ParameterException,
IOException
+ {
+ this.isupProvider.sendMessage(arg0,dpc);
+ }
+
+ public void cancelTimer(int timerID)
+ {
+ this.isupProvider.cancelTimer(cic,dpc,timerID);
+ }
+
+ public int getDPC()
+ {
+ return this.dpc;
+ }
+
+ public int getCIC()
+ {
+ return this.cic;
+ }
+
+ public long getTransactionKey()
+ {
+ long currValue=dpc;
+ currValue=currValue<<14 + cic;
+ return currValue;
+ }
+
+ public static long generateTransactionKey(int cic,int dpc)
+ {
+ long currValue=dpc;
+ currValue=currValue<<14 + cic;
+ return currValue;
+ }
+}
=======================================
---
/trunk/servers/jain-slee/resources/isup/events/src/main/java/org/mobicents/slee/resources/ss7/isup/events/TransactionEnded.java
Mon Jun 7 11:58:24 2010
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- *
- */
-package org.mobicents.slee.resources.ss7.isup.events;
-
-import java.io.Serializable;
-
-import org.mobicents.protocols.ss7.isup.ISUPTransaction;
-
-/**
- * @author baranowb
- *
- */
-public class TransactionEnded implements Serializable {
-
- private ISUPTransaction transaction;
- private boolean timedOut;
- public TransactionEnded(ISUPTransaction transaction, boolean timedOut) {
- super();
- this.transaction = transaction;
- this.timedOut = timedOut;
- }
- /**
- * @return the transaction
- */
- public ISUPTransaction getTransaction() {
- return transaction;
- }
- /**
- * @return the timedOut
- */
- public boolean isTimedOut() {
- return timedOut;
- }
-
-
-
-
-}
=======================================
--- /trunk/servers/jain-slee/resources/isup/du/pom.xml Mon Jun 7 11:58:24
2010
+++ /trunk/servers/jain-slee/resources/isup/du/pom.xml Wed Jul 4 01:56:49
2012
@@ -40,20 +40,19 @@
<build>
<plugins>
- <plugin>
- <groupId>org.mobicents.tools</groupId>
- <artifactId>maven-du-plugin</artifactId>
- <extensions>true</extensions>
- <configuration />
- <executions>
- <execution>
-
<phase>generate-resources</phase>
- <goals>
- <goal>create</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <groupId>org.mobicents.tools</groupId>
+ <artifactId>maven-du-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>copy-dependencies</goal>
+ <goal>generate-descriptor</goal>
+ <goal>generate-ant-management-script</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
=======================================
---
/trunk/servers/jain-slee/resources/isup/events/src/main/resources/META-INF/event-jar.xml
Tue Jun 8 00:52:40 2010
+++
/trunk/servers/jain-slee/resources/isup/events/src/main/resources/META-INF/event-jar.xml
Wed Jul 4 01:56:49 2012
@@ -314,10 +314,10 @@
<!-- TERM EVENT -->
<event-definition>
-
<event-type-name>net.java.slee.resource.isup.TRANSACTION_ENDED</event-type-name>
+
<event-type-name>net.java.slee.resource.isup.TRANSACTION_TIMEOUT</event-type-name>
<event-type-vendor>net.java</event-type-vendor>
<event-type-version>1.0</event-type-version>
-
<event-class-name>org.mobicents.slee.resources.ss7.isup.events.TransactionEnded</event-class-name>
+
<event-class-name>org.mobicents.slee.resources.ss7.isup.events.TimeoutEvent</event-class-name>
</event-definition>
</event-jar>
=======================================
--- /trunk/servers/jain-slee/resources/isup/library/pom.xml Wed May 2
03:27:09 2012
+++ /trunk/servers/jain-slee/resources/isup/library/pom.xml Wed Jul 4
01:56:49 2012
@@ -1,68 +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>isup-parent</artifactId>
- <groupId>org.mobicents.resources</groupId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>isup-library</artifactId>
-
- <name>Mobicents :: Resources :: ${pom.artifactId}</name>
-
- <dependencies>
- <dependency>
- <groupId>org.mobicents.protocols.ss7.isup</groupId>
- <artifactId>isup-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mobicents.protocols.ss7.isup</groupId>
- <artifactId>isup-impl</artifactId>
- </dependency>
-
- <!-- Dep for M3UA -->
- <dependency>
- <groupId>org.mobicents.protocols.ss7.mtp</groupId>
- <artifactId>MTP</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mobicents.protocols.stream</groupId>
- <artifactId>stream</artifactId>
- </dependency>
- <dependency>
- <artifactId>m3ua-api</artifactId>
- <groupId>org.mobicents.protocols.ss7.m3ua</groupId>
- </dependency>
- <dependency>
- <artifactId>m3ua-impl</artifactId>
- <groupId>org.mobicents.protocols.ss7.m3ua</groupId>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.mobicents.tools</groupId>
- <artifactId>maven-library-plugin</artifactId>
- <executions>
- <execution>
- <goals>
-
<goal>copy-dependencies</goal>
-
<goal>generate-descriptor</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <library-name>isup</library-name>
-
<library-vendor>mobicents.org</library-vendor>
- <library-version>1.0</library-version>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>isup-parent</artifactId>
+ <groupId>org.mobicents.resources</groupId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>isup-library</artifactId>
+
+ <name>Mobicents :: Resources :: ${pom.artifactId}</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.mobicents.protocols.ss7.isup</groupId>
+ <artifactId>isup-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mobicents.protocols.ss7.isup</groupId>
+ <artifactId>isup-impl</artifactId>
+ </dependency>
+
+ <!-- Dep for M3UA -->
+ <dependency>
+ <groupId>org.mobicents.protocols.ss7.mtp</groupId>
+ <artifactId>MTP</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mobicents.protocols.stream</groupId>
+ <artifactId>stream</artifactId>
+ </dependency>
+ <dependency>
+ <artifactId>m3ua-api</artifactId>
+ <groupId>org.mobicents.protocols.ss7.m3ua</groupId>
+ </dependency>
+ <dependency>
+ <artifactId>m3ua-impl</artifactId>
+ <groupId>org.mobicents.protocols.ss7.m3ua</groupId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.mobicents.tools</groupId>
+ <artifactId>maven-library-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>copy-dependencies</goal>
+ <goal>generate-descriptor</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library-name>isup</library-name>
+ <library-vendor>mobicents.org</library-vendor>
+ <library-version>1.0</library-version>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
=======================================
--- /trunk/servers/jain-slee/resources/isup/pom.xml Wed Apr 27 06:40:56 2011
+++ /trunk/servers/jain-slee/resources/isup/pom.xml Wed Jul 4 01:56:49 2012
@@ -5,7 +5,7 @@
<parent>
<artifactId>mobicents-parent</artifactId>
<groupId>org.mobicents</groupId>
- <version>2.18-SNAPSHOT</version>
+ <version>2.21</version>
</parent>
<artifactId>isup-parent</artifactId>
@@ -16,10 +16,10 @@
<packaging>pom</packaging>
<properties>
- <isup.version>1.0.0.BETA3</isup.version>
- <mtp.version>1.0.0.BETA4</mtp.version>
+ <isup.version>2.0.0-SNAPSHOT</isup.version>
+ <mtp.version>2.0.0-SNAPSHOT</mtp.version>
<stream.version>1.0.0.BETA1</stream.version>
- <m3ua.version>1.0.0.BETA1</m3ua.version>
+ <m3ua.version>2.0.0-SNAPSHOT</m3ua.version>
</properties>
<dependencyManagement>
=======================================
---
/trunk/servers/jain-slee/resources/isup/ra/src/main/java/org/mobicents/slee/resources/isup/ra/ISUPActivityHandle.java
Mon Jun 7 11:58:24 2010
+++
/trunk/servers/jain-slee/resources/isup/ra/src/main/java/org/mobicents/slee/resources/isup/ra/ISUPActivityHandle.java
Wed Jul 4 01:56:49 2012
@@ -5,17 +5,15 @@
import javax.slee.resource.ActivityHandle;
-import org.mobicents.protocols.ss7.isup.TransactionKey;
-
/**
* @author baranowb
*
*/
public class ISUPActivityHandle implements ActivityHandle {
- private TransactionKey key;
-
- ISUPActivityHandle(TransactionKey key) {
+ private long key;
+
+ ISUPActivityHandle(long key) {
super();
this.key = key;
}
@@ -27,7 +25,7 @@
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + ((key == null) ? 0 : key.hashCode());
+ result = (int)(prime * result + key);
return result;
}
@@ -43,11 +41,9 @@
if (getClass() != obj.getClass())
return false;
ISUPActivityHandle other = (ISUPActivityHandle) obj;
- if (key == null) {
- if (other.key != null)
- return false;
- } else if (!key.equals(other.key))
+ if (key !=other.key)
return false;
+
return true;
}
=======================================
---
/trunk/servers/jain-slee/resources/isup/ra/src/main/java/org/mobicents/slee/resources/isup/ra/IsupResourceAdaptor.java
Thu Oct 7 10:29:04 2010
+++
/trunk/servers/jain-slee/resources/isup/ra/src/main/java/org/mobicents/slee/resources/isup/ra/IsupResourceAdaptor.java
Wed Jul 4 01:56:49 2012
@@ -15,6 +15,7 @@
import java.util.Map;
import java.util.Properties;
+import javax.naming.InitialContext;
import javax.slee.Address;
import javax.slee.SLEEException;
import javax.slee.facilities.EventLookupFacility;
@@ -35,19 +36,14 @@
import javax.slee.resource.StartActivityException;
import javax.slee.resource.ConfigProperties.Property;
-import org.mobicents.protocols.ConfigurationException;
-import org.mobicents.protocols.StartFailedException;
-import org.mobicents.protocols.ss7.isup.ISUPClientTransaction;
import org.mobicents.protocols.ss7.isup.ISUPListener;
import org.mobicents.protocols.ss7.isup.ISUPMessageFactory;
import org.mobicents.protocols.ss7.isup.ISUPParameterFactory;
import org.mobicents.protocols.ss7.isup.ISUPProvider;
-import org.mobicents.protocols.ss7.isup.ISUPServerTransaction;
import org.mobicents.protocols.ss7.isup.ISUPStack;
-import org.mobicents.protocols.ss7.isup.ISUPTransaction;
-import org.mobicents.protocols.ss7.isup.ParameterRangeInvalidException;
-import org.mobicents.protocols.ss7.isup.TransactionAlredyExistsException;
-import org.mobicents.protocols.ss7.isup.TransactionKey;
+import org.mobicents.protocols.ss7.isup.ISUPEvent;
+import org.mobicents.protocols.ss7.isup.ISUPTimeoutEvent;
+import org.mobicents.protocols.ss7.isup.ParameterException;
import org.mobicents.protocols.ss7.isup.impl.ISUPStackImpl;
import org.mobicents.protocols.ss7.isup.message.AddressCompleteMessage;
import org.mobicents.protocols.ss7.isup.message.AnswerMessage;
@@ -93,10 +89,9 @@
import
org.mobicents.protocols.ss7.isup.message.User2UserInformationMessage;
import org.mobicents.protocols.ss7.isup.message.UserPartAvailableMessage;
import org.mobicents.protocols.ss7.isup.message.UserPartTestMessage;
-import org.mobicents.protocols.ss7.mtp.provider.MtpProviderFactory;
-import org.mobicents.protocols.ss7.mtp.provider.m3ua.Provider;
-import org.mobicents.slee.resources.ss7.isup.events.TransactionEnded;
+import org.mobicents.slee.resources.ss7.isup.events.TimeoutEvent;
import org.mobicents.slee.resources.ss7.isup.ratype.RAISUPProvider;
+import org.mobicents.slee.resources.ss7.isup.ratype.CircuitActivity;
/**
*
@@ -120,41 +115,26 @@
////////////
private static final int EVENT_FLAGS = getEventFlags();
private static final int ACTIVITY_FLAGS = getActivityFlags();
- private Map<ActivityHandle, ISUPTransaction> activities = new
HashMap<ActivityHandle, ISUPTransaction>();
-
+ private Map<ActivityHandle, CircuitActivity> activities = new
HashMap<ActivityHandle, CircuitActivity>();
+
/////////////////
// RA Provider //
/////////////////
private RAISUPProviderImpl raProvider;
+ // ////////////////////////////
+ // Configuration parameters //
+ // ////////////////////////////
+ private static final String CONF_ISUP_JNDI = "isupJndi";
+ private String isupJndi = null;
+
/////////////////
// ISUP stack //
- /////////////////
- private ISUPStack stack;
+ /////////////////
private ISUPProvider isupProvider;
private boolean transportUp = false;
- //////////////////
- // MTP provider //
- //////////////////
- //private M3UserConnector mtpProvider;
- //config for provider
- private static final String _DEFAULT_serverAddress = "localhost";
- private static final String _DEFAULT_serverPort = "1345";
- private static final String _DEFAULT_clientAddress = "localhost";
- private static final String _DEFAULT_clientPort = "8998";
- private static final String _DEFAULT_driver =
MtpProviderFactory.DRIVER_M3UA;
-
- private String serverAddress =
_DEFAULT_serverAddress+":"+_DEFAULT_serverPort;
- private String clientAddress =
_DEFAULT_clientAddress+":"+_DEFAULT_clientPort;
- private String driver = _DEFAULT_driver;
-
-
-
- ////////////////////////
- // MTP Provider props //
- ////////////////////////
- private static final String PROPERTY_OPC = "mtp.opc";
- private static final String PROPERTY_DPC = "mtp.apc";
+
+ private int localspc,ni;
private static int getEventFlags() {
int eventFlags = EventFlags.REQUEST_EVENT_UNREFERENCED_CALLBACK;
@@ -185,28 +165,16 @@
}
public void raConfigure(ConfigProperties configProperties) {
-
- if(tracer.isInfoEnabled())
- {
- tracer.info("Configuring ISUP RA:
"+this.raContext.getEntityName());
- }
- //Its good to follow standards, why there is no proper method for
that?
- Properties props = new Properties();
- for(Property p: configProperties.getProperties())
- {
- props.put(p.getName(), p.getValue());
- }
-
- this.stack = new ISUPStackImpl();
try {
- this.stack.configure(props);
- this.isupProvider = this.stack.getIsupProvider();
- this.raProvider = new RAISUPProviderImpl();
- } catch (ConfigurationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
+ if (tracer.isInfoEnabled()) {
+ tracer.info("Configuring ISUPRA: " +
this.raContext.getEntityName());
+ }
+ this.isupJndi = (String)
configProperties.getProperty(CONF_ISUP_JNDI).getValue();
+ } catch (Exception e) {
+ tracer.severe("Configuring of ISUP RA failed ", e);
+ }
+
+ this.raProvider = new RAISUPProviderImpl();
}
public void raUnconfigure() {
@@ -214,19 +182,16 @@
}
public void raActive() {
-
try {
- this.stack.start();
- this.stack.getIsupProvider().addListener(this);
- } catch (IllegalStateException e) {
+ InitialContext ic = new InitialContext();
+ this.isupProvider = (ISUPProvider) ic.lookup(this.isupJndi);
+ tracer.info("Sucssefully connected to ISUP service[" +
this.isupJndi + "]");
+
+ this.isupProvider.addListener(this);
+ } catch (Exception e) {
// TODO Auto-generated catch block
- e.printStackTrace();
- } catch (StartFailedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
+ this.tracer.severe("Failed to activate ISUP RA ", e);
+ }
}
public void raStopping() {
@@ -238,56 +203,20 @@
}
public void raVerifyConfiguration(ConfigProperties configProperties)
throws InvalidConfigurationException {
-
try {
- Property p =
configProperties.getProperty(Provider.PROPERTY_RADDRESS);
- if (p != null) {
- this.serverAddress = (String) p.getValue();
- }
-
-
- p =
configProperties.getProperty(Provider.PROPERTY_RADDRESS);
- if (p != null) {
- this.clientAddress = (String) p.getValue();
- }
- String[] address = this.clientAddress.split(":");
- // check if we can bind
- InetSocketAddress sockAddress = new InetSocketAddress(address[0],
Integer.parseInt(address[1]));
- new DatagramSocket(sockAddress).close();
-
- p =
configProperties.getProperty(MtpProviderFactory.PROPERTY_MTP_DRIVER);
- if (p != null) {
- this.driver = (String) p.getValue();
- }
- } catch (Throwable t) {
- throw new InvalidConfigurationException("", t);
- }
-
- //try to start and stop stack
- try
- {
- Properties props = new Properties();
- for(Property p: configProperties.getProperties())
- {
- props.put(p.getName(), p.getValue());
- }
-
- this.stack = new ISUPStackImpl();
- this.stack.configure(props);
- this.stack.start();
- this.stack.stop();
- this.stack = null;
- } catch (Throwable t) {
- throw new InvalidConfigurationException("Failed to start and stop
stack", t);
- }
- if (configProperties.getProperty(PROPERTY_DPC) == null) {
- throw new InvalidConfigurationException("No DPC set!");
- }
-
- if (configProperties.getProperty(PROPERTY_OPC) == null) {
- throw new InvalidConfigurationException("No OPC set!");
- }
-
+
+ if (tracer.isInfoEnabled()) {
+ tracer.info("Verifying configuring ISUPA: " +
this.raContext.getEntityName());
+ }
+
+ this.isupJndi = (String)
configProperties.getProperty(CONF_ISUP_JNDI).getValue();
+ if (this.isupJndi == null) {
+ throw new InvalidConfigurationException("ISUP JNDI
lookup name cannot be null");
+ }
+
+ } catch (Exception e) {
+ throw new InvalidConfigurationException("Failed to test
configuration options!", e);
+ }
}
public void raConfigurationUpdate(ConfigProperties arg0) {
@@ -302,16 +231,16 @@
return null;
}
- public void serviceActive(ReceivableService arg0) {
- //throw new UnsupportedOperationException("Not supported yet.");
+ public void serviceActive(ReceivableService receivableService) {
+ eventTypeFilter.serviceActive(receivableService);
}
- public void serviceStopping(ReceivableService arg0) {
- //throw new UnsupportedOperationException("Not supported yet.");
+ public void serviceStopping(ReceivableService receivableService) {
+ eventTypeFilter.serviceStopping(receivableService);
}
- public void serviceInactive(ReceivableService arg0) {
- //throw new UnsupportedOperationException("Not supported yet.");
+ public void serviceInactive(ReceivableService receivableService) {
+ eventTypeFilter.serviceInactive(receivableService);
}
public void queryLiveness(ActivityHandle arg0) {
@@ -323,9 +252,9 @@
}
public ActivityHandle getActivityHandle(Object act) {
- if(act instanceof ISUPTransaction)
- {
- ISUPTransaction activity = (ISUPTransaction) act;
+ if(act instanceof CircuitActivity)
+ {
+ CircuitActivity activity = (CircuitActivity) act;
return createActivityHandle(activity);
}
return null;
@@ -339,15 +268,15 @@
}
public void eventProcessingSuccessful(ActivityHandle arg0,
FireableEventType arg1, Object arg2, Address arg3, ReceivableService arg4,
int arg5) {
- //throw new UnsupportedOperationException("Not supported yet.");
+ //throw new UnsupportedOperationException("Not supported yet.");
}
public void eventProcessingFailed(ActivityHandle arg0,
FireableEventType arg1, Object arg2, Address arg3, ReceivableService arg4,
int arg5, FailureReason arg6) {
- //throw new UnsupportedOperationException("Not supported yet.");
+ //throw new UnsupportedOperationException("Not supported yet.");
}
public void eventUnreferenced(ActivityHandle arg0, FireableEventType
arg1, Object arg2, Address arg3, ReceivableService arg4, int arg5) {
- //throw new UnsupportedOperationException("Not supported yet.");
+ //throw new UnsupportedOperationException("Not supported yet.");
}
public void activityEnded(ActivityHandle handle) {
@@ -356,38 +285,30 @@
}
public void activityUnreferenced(ActivityHandle handle) {
- //throw new UnsupportedOperationException("Not supported yet.");
-
+ //throw new UnsupportedOperationException("Not supported yet.");
}
- protected void fireEvent(String eventName, Object activity, Object
event) {
- final ActivityHandle handle = this.getActivityHandle(activity);
- final FireableEventType eventType =
eventTypeCache.getEventType(eventLookupFacility, eventName);
-// if (eventTypeFilter.filterEvent(eventType)) {
-// if (tracer.isFineEnabled()) {
-// tracer.fine("event " + eventName + " filtered");
-// }
-// return;
-// }
+ protected void fireEvent(FireableEventType eventType, Object activity,
Object event) {
+ final ActivityHandle handle = this.getActivityHandle(activity);
//TODO insert global title.
//this causes failure
// final Address address = new Address(AddressPlan.GT, "");
try {
sleeEndpoint.fireEvent(handle, eventType, event, null, null,
EVENT_FLAGS);
- tracer.info("Firde event: " + eventType);
+ tracer.info("Fired event: " + eventType);
} catch (Throwable e) {
tracer.severe("Failed to fire event", e);
}
- }
+ }
//////////////////
// Some private //
//////////////////
- private ActivityHandle createActivityHandle(ISUPTransaction tx)
- {
- TransactionKey txKey = tx.getTransactionKey();
+ private ActivityHandle createActivityHandle(CircuitActivity ca)
+ {
+ long txKey = ca.getTransactionKey();
return new ISUPActivityHandle(txKey);
}
@@ -399,41 +320,11 @@
/* (non-Javadoc)
* @see
org.mobicents.protocols.ss7.isup.ISUPListener#onMessage(org.mobicents.protocols.ss7.isup.message.ISUPMessage)
*/
- public void onMessage(ISUPMessage message) {
+ public void onEvent(ISUPEvent event) {
if(tracer.isInfoEnabled())
{
- tracer.info("Received Message,
code: "+message.getMessageType().getCode());
- }
- //if there is no TX, lets create STX
- ISUPTransaction tx = message.getTransaction();
- if(tx == null)
- {
- //FIXME: determine in Qs if there is error msg to be sent.... can be
extremly complciated since there is 40+ messages
- try {
- tx =
this.raProvider.createServerTransaction(message);
- } catch (ActivityAlreadyExistsException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalArgumentException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (NullPointerException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalStateException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SLEEException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (TransactionAlredyExistsException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (StartActivityException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ tracer.info("Received Message,
code: "+event.getMessage().getMessageType().getCode());
}
//we have activity, now:
@@ -442,7 +333,7 @@
// 3. fire
//ActivityHandle handle = createActivityHandle(tx);
String eventName = null;
- switch(message.getMessageType().getCode())
+ switch(event.getMessage().getMessageType().getCode())
{
case AnswerMessage.MESSAGE_CODE:
eventName = "ANSWER";
@@ -574,71 +465,63 @@
case UserPartTestMessage.MESSAGE_CODE:
eventName = "USER_PART_TEST";
break;
-
-
- default:
- tracer.severe("Received unkown event
code: "+message.getMessageType().getCode());
- return;
-
- }
-
-
- this.fireEvent(eventName, tx, message);
-
-
- }
- /* (non-Javadoc)
- * @see
org.mobicents.protocols.ss7.isup.ISUPListener#onTransactionEnded(org.mobicents.protocols.ss7.isup.ISUPClientTransaction)
- */
- public void onTransactionEnded(ISUPClientTransaction ctx) {
- ActivityHandle handle = createActivityHandle(ctx);
- if(this.activities.containsKey(handle))
- {
- TransactionEnded te = new TransactionEnded(ctx,false);
- this.fireEvent("TRANSACTION_ENDED", ctx, te);
- this.sleeEndpoint.endActivity(handle);
+ default:
+ tracer.severe("Received unkown event
code: "+event.getMessage().getMessageType().getCode());
+ return;
+
+ }
+
+ final FireableEventType eventType =
eventTypeCache.getEventType(eventLookupFacility, eventName);
+ if (eventTypeFilter.filterEvent(eventType)) {
+ tracer.info("event " + eventName + " filtered");
+ return;
+ }
+
+ //if there is no TX, lets create STX
+ CircuitActivity ca = (CircuitActivity)getActivity(new
ISUPActivityHandle(CircuitActivity.generateTransactionKey(event.getMessage().getCircuitIdentificationCode().getCIC(),event.getDpc())));
+ if(ca == null)
+ {
+ //FIXME: determine in Qs if there is error msg to be sent.... can be
extremly complciated since there is 40+ messages
+ try {
+ ca =
this.raProvider.createCircuitActivity(event.getMessage(),event.getDpc());
+ } catch (ActivityAlreadyExistsException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IllegalArgumentException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (NullPointerException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IllegalStateException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (SLEEException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (StartActivityException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
- }
- /* (non-Javadoc)
- * @see
org.mobicents.protocols.ss7.isup.ISUPListener#onTransactionEnded(org.mobicents.protocols.ss7.isup.ISUPServerTransaction)
- */
- public void onTransactionEnded(ISUPServerTransaction stx) {
- ActivityHandle handle = createActivityHandle(stx);
- if(this.activities.containsKey(handle))
- {
- TransactionEnded te = new TransactionEnded(stx,false);
- this.fireEvent("TRANSACTION_ENDED", stx, te);
- this.sleeEndpoint.endActivity(handle);
- }
-
- }
- /* (non-Javadoc)
- * @see
org.mobicents.protocols.ss7.isup.ISUPListener#onTransactionTimeout(org.mobicents.protocols.ss7.isup.ISUPClientTransaction)
- */
- public void onTransactionTimeout(ISUPClientTransaction ctx) {
- ActivityHandle handle = createActivityHandle(ctx);
- if(this.activities.containsKey(handle))
- {
- TransactionEnded te = new TransactionEnded(ctx,true);
- this.fireEvent("TRANSACTION_ENDED", ctx, te);
- this.sleeEndpoint.endActivity(handle);
- }
-
- }
- /* (non-Javadoc)
- * @see
org.mobicents.protocols.ss7.isup.ISUPListener#onTransactionTimeout(org.mobicents.protocols.ss7.isup.ISUPServerTransaction)
- */
- public void onTransactionTimeout(ISUPServerTransaction stx) {
- ActivityHandle handle = createActivityHandle(stx);
- if(this.activities.containsKey(handle))
- {
- TransactionEnded te = new TransactionEnded(stx,true);
- this.fireEvent("TRANSACTION_ENDED", stx, te);
- this.sleeEndpoint.endActivity(handle);
- }
-
- }
+ this.fireEvent(eventType, ca, event.getMessage());
+ }
+
+ public void onTimeout(ISUPTimeoutEvent event) {
+ ActivityHandle handle=new
ISUPActivityHandle(CircuitActivity.generateTransactionKey(event.getMessage().getCircuitIdentificationCode().getCIC(),event.getDpc()));
+ if(this.activities.containsKey(handle))
+ {
+ TimeoutEvent te = new
TimeoutEvent(event.getMessage(),event.getTimerId());
+ final FireableEventType eventType =
eventTypeCache.getEventType(eventLookupFacility, "TRANSACTION_TIMEOUT");
+ if (eventTypeFilter.filterEvent(eventType)) {
+ tracer.info("event TRANSACTION_TIMEOUT filtered");
+ return;
+ }
+ this.fireEvent(eventType, getActivity(handle), te);
+ }
+ }
+
/* (non-Javadoc)
* @see org.mobicents.protocols.ss7.isup.ISUPListener#onTransportDown()
*/
@@ -653,40 +536,24 @@
// TODO Auto-generated method stub
this.transportUp = true;
}
-
-
-
-
-
-
-
-
-
///////////////////////
// RA Provider Class //
///////////////////////
private class RAISUPProviderImpl implements RAISUPProvider
- {
-
-
- public ISUPClientTransaction createClientTransaction(ISUPMessage arg0)
throws TransactionAlredyExistsException,
- IllegalArgumentException, ActivityAlreadyExistsException,
NullPointerException, IllegalStateException, SLEEException,
StartActivityException {
-
- ISUPClientTransaction ctx =
isupProvider.createClientTransaction(arg0);
- ActivityHandle handle = createActivityHandle(ctx);
- sleeEndpoint.startActivity(handle, ctx,ACTIVITY_FLAGS);
- activities.put(handle,ctx);
- return ctx;
- }
-
- public ISUPServerTransaction createServerTransaction(ISUPMessage arg0)
throws TransactionAlredyExistsException,
- IllegalArgumentException, ActivityAlreadyExistsException,
NullPointerException, IllegalStateException, SLEEException,
StartActivityException {
- ISUPServerTransaction stx =
isupProvider.createServerTransaction(arg0);
- ActivityHandle handle = createActivityHandle(stx);
- sleeEndpoint.startActivity(handle, stx,ACTIVITY_FLAGS);
- activities.put(handle,stx);
- return stx;
+ {
+ public CircuitActivity createCircuitActivity(ISUPMessage arg0,int dpc)
throws IllegalArgumentException, ActivityAlreadyExistsException,
+ NullPointerException, IllegalStateException, SLEEException,
StartActivityException {
+
+ ActivityHandle handle=new
ISUPActivityHandle(CircuitActivity.generateTransactionKey(arg0.getCircuitIdentificationCode().getCIC(),dpc));
+ if(activities.containsKey(handle))
+ throw new ActivityAlreadyExistsException("Circuit activity
already exists");
+
+ CircuitActivity activity = new
CircuitActivity(arg0,dpc,this);
+ handle = createActivityHandle(activity);
+ sleeEndpoint.startActivity(handle,
activity,ACTIVITY_FLAGS);
+ activities.put(handle,activity);
+ return activity;
}
public ISUPMessageFactory getMessageFactory() {
@@ -698,11 +565,24 @@
}
- public void sendMessage(ISUPMessage arg0) throws
ParameterRangeInvalidException, IOException {
- isupProvider.sendMessage(arg0);
+ public void sendMessage(ISUPMessage arg0,int dpc) throws
ParameterException, IOException {
+ isupProvider.sendMessage(arg0,dpc);
}
+ public void cancelTimer(int cic, int dpc, int timerId)
+ {
+ isupProvider.cancelTimer(cic,dpc,timerId);
+ }
+
+ public void endActivity(CircuitActivity ac)
+ {
+ isupProvider.cancelAllTimers(ac.getCIC(),ac.getDPC());
+ ActivityHandle handle=getActivityHandle(ac);
+ sleeEndpoint.endActivity(handle);
+ activityEnded(handle);
+ }
+
/* (non-Javadoc)
* @see
org.mobicents.slee.resources.ss7.isup.ratype.RAISUPProvider#isTransportUp()
*/
=======================================
---
/trunk/servers/jain-slee/resources/isup/ra/src/main/resources/META-INF/resource-adaptor-jar.xml
Thu Oct 7 10:29:04 2010
+++
/trunk/servers/jain-slee/resources/isup/ra/src/main/resources/META-INF/resource-adaptor-jar.xml
Wed Jul 4 01:56:49 2012
@@ -6,7 +6,7 @@
<description>ISUP resource adaptor</description>
<resource-adaptor-name>ISUPResourceAdaptor</resource-adaptor-name>
<resource-adaptor-vendor>org.mobicents</resource-adaptor-vendor>
- <resource-adaptor-version>1.0</resource-adaptor-version>
+ <resource-adaptor-version>2.0</resource-adaptor-version>
<resource-adaptor-type-ref>
<resource-adaptor-type-name>ISUPResourceAdaptorType</resource-adaptor-type-name>
@@ -21,38 +21,15 @@
</resource-adaptor-class-name>
</resource-adaptor-class>
</resource-adaptor-classes>
-
<config-property>
- <description>Driver for MTP layer</description>
- <config-property-name>mtp.driver</config-property-name>
-
<config-property-type>java.lang.String</config-property-type>
- <config-property-value>m3ua</config-property-value>
+ <config-property-name>isupJndi</config-property-name>
+ <config-property-type>
+ java.lang.String
+ </config-property-type>
+ <config-property-value>
+ java:/mobicents/ss7/isup
+ </config-property-value>
</config-property>
- <config-property>
- <description>Streaming server address</description>
-
<config-property-name>mtp.address.local</config-property-name>
-
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>127.0.0.1:8998</config-property-value>
- </config-property>
- <config-property>
- <description>Streaming server port</description>
-
<config-property-name>mtp.address.remote</config-property-name>
-
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>127.0.0.1:1345</config-property-value>
- </config-property>
- <config-property>
- <description>Default APC(DPC)</description>
- <config-property-name>mtp.apc</config-property-name>
-
<config-property-type>java.lang.String</config-property-type>
- <config-property-value>12345</config-property-value>
- </config-property>
- <config-property>
- <description>Default OPC</description>
- <config-property-name>mtp.opc</config-property-name>
-
<config-property-type>java.lang.String</config-property-type>
- <config-property-value>54321</config-property-value>
- </config-property>
-
<config-property>
<description>Value of timeout in milisecond. It
controls timeout of
client
=======================================
---
/trunk/servers/jain-slee/resources/isup/ratype/src/main/java/org/mobicents/slee/resources/ss7/isup/ratype/ActivityContextInterfaceFactory.java
Mon Jun 7 11:58:24 2010
+++
/trunk/servers/jain-slee/resources/isup/ratype/src/main/java/org/mobicents/slee/resources/ss7/isup/ratype/ActivityContextInterfaceFactory.java
Wed Jul 4 01:56:49 2012
@@ -22,8 +22,6 @@
import javax.slee.ActivityContextInterface;
import javax.slee.FactoryException;
import javax.slee.UnrecognizedActivityException;
-import org.mobicents.protocols.ss7.isup.ISUPClientTransaction;
-import org.mobicents.protocols.ss7.isup.ISUPServerTransaction;
/**
*
@@ -32,23 +30,12 @@
public interface ActivityContextInterfaceFactory{
/**
- * Gets ActivityContextInterface for client transaction activity.
+ * Gets ActivityContextInterface for circuit activity.
*
* @param activity
* the endpoint activity object.
* @return the ActivityContextInterface.
*/
- public ActivityContextInterface
getActivityContextInterface(ISUPClientTransaction activity)
+ public ActivityContextInterface
getActivityContextInterface(CircuitActivity activity)
throws NullPointerException, UnrecognizedActivityException,
FactoryException;
-
- /**
- * Gets ActivityContextInterface for server transaction activity.
- *
- * @param activity
- * the endpoint activity object.
- * @return the ActivityContextInterface.
- */
- public ActivityContextInterface
getActivityContextInterface(ISUPServerTransaction activity)
- throws NullPointerException, UnrecognizedActivityException,
FactoryException;
-
-}
+}
=======================================
---
/trunk/servers/jain-slee/resources/isup/ratype/src/main/java/org/mobicents/slee/resources/ss7/isup/ratype/RAISUPProvider.java
Tue Jun 8 10:58:22 2010
+++
/trunk/servers/jain-slee/resources/isup/ratype/src/main/java/org/mobicents/slee/resources/ss7/isup/ratype/RAISUPProvider.java
Wed Jul 4 01:56:49 2012
@@ -1,21 +1,18 @@
package org.mobicents.slee.resources.ss7.isup.ratype;
import java.io.IOException;
-
+import java.io.Serializable;
import javax.slee.SLEEException;
import javax.slee.resource.ActivityAlreadyExistsException;
import javax.slee.resource.StartActivityException;
-import org.mobicents.protocols.ss7.isup.ISUPClientTransaction;
import org.mobicents.protocols.ss7.isup.ISUPMessageFactory;
import org.mobicents.protocols.ss7.isup.ISUPParameterFactory;
-import org.mobicents.protocols.ss7.isup.ISUPServerTransaction;
-import org.mobicents.protocols.ss7.isup.ParameterRangeInvalidException;
-import org.mobicents.protocols.ss7.isup.TransactionAlredyExistsException;
import org.mobicents.protocols.ss7.isup.message.ISUPMessage;
-
-public interface RAISUPProvider {
+import org.mobicents.protocols.ss7.isup.ParameterException;
+
+public interface RAISUPProvider extends Serializable {
/**
* Create client transaction activity
@@ -29,24 +26,8 @@
* @throws SLEEException
* @throws StartActivityException
*/
- public ISUPClientTransaction createClientTransaction(ISUPMessage arg0)
throws TransactionAlredyExistsException,
- IllegalArgumentException, ActivityAlreadyExistsException,
NullPointerException, IllegalStateException, SLEEException,
- StartActivityException;
- /**
- * Create server transaction activity
- * @param arg0
- * @return
- * @throws TransactionAlredyExistsException
- * @throws IllegalArgumentException
- * @throws ActivityAlreadyExistsException
- * @throws NullPointerException
- * @throws IllegalStateException
- * @throws SLEEException
- * @throws StartActivityException
- */
- public ISUPServerTransaction createServerTransaction(ISUPMessage arg0)
throws TransactionAlredyExistsException,
- IllegalArgumentException, ActivityAlreadyExistsException,
NullPointerException, IllegalStateException, SLEEException,
- StartActivityException;
+ public CircuitActivity createCircuitActivity(ISUPMessage arg0,int dpc)
throws IllegalArgumentException, ActivityAlreadyExistsException,
+ NullPointerException, IllegalStateException,
SLEEException,StartActivityException;
/**
* Get message factory.
@@ -64,7 +45,20 @@
* @throws ParameterRangeInvalidException
* @throws IOException
*/
- public void sendMessage(ISUPMessage arg0) throws
ParameterRangeInvalidException, IOException;
+ public void sendMessage(ISUPMessage arg0, int dpc) throws
ParameterException, IOException;
+
+ /**
+ * Ends circuit activity
+ * @return
+ */
+ public void cancelTimer(int cic, int dpc, int timerId);
+
+ /**
+ * Ends circuit activity
+ * @return
+ */
+ public void endActivity(CircuitActivity ac);
+
/**
* Determine if transport layer is connected and links are up.
* @return
=======================================
---
/trunk/servers/jain-slee/resources/isup/ratype/src/main/resources/META-INF/resource-adaptor-type-jar.xml
Tue Jun 8 00:52:40 2010
+++
/trunk/servers/jain-slee/resources/isup/ratype/src/main/resources/META-INF/resource-adaptor-type-jar.xml
Wed Jul 4 01:56:49 2012
@@ -11,13 +11,8 @@
<resource-adaptor-type-classes>
<activity-type>
<activity-type-name>
-
org.mobicents.protocols.ss7.isup.ISUPClientTransaction
- </activity-type-name>
- </activity-type>
- <activity-type>
- <activity-type-name>
-
org.mobicents.protocols.ss7.isup.ISUPServerTransaction
- </activity-type-name>
+ org.mobicents.slee.resources.ss7.isup.ratype.CircuitActivity
+ </activity-type-name>
</activity-type>
<activity-context-interface-factory-interface>
<activity-context-interface-factory-interface-name>
@@ -249,7 +244,7 @@
<event-type-version>1.0</event-type-version>
</event-type-ref>
<event-type-ref>
-
<event-type-name>net.java.slee.resource.isup.TRANSACTION_ENDED</event-type-name>
+
<event-type-name>net.java.slee.resource.isup.TRANSACTION_TIMEOUT</event-type-name>
<event-type-vendor>net.java</event-type-vendor>
<event-type-version>1.0</event-type-version>
</event-type-ref>