2

I am pretty new to Diameter and I need a test application to imitate HSS behavior and send some diameter requests to the MME on s6a interface.

I have checked out seagull tool but it has some problems as seagull assumes that the client always initiates the request. But in my case, there is a constraint that the MME always initiates the CER request.

I was checking for alternatives and I came across RestComm JDiameter but I have no clue on how to use it. The github repo doesnt provide any information on using it and I couldnt find out any information by googling either.

So kindly guide me on how to use Jdiameter for my application.

Pete
  • 57,112
  • 28
  • 117
  • 166
tej
  • 73
  • 12

1 Answers1

2

JDiameter as a very powerful framework, although quite complex to understand. You especially need to really read carefully through the diameter specs and how the messages and their value types are.

CER and CEA are diameter standard and will work out-of-the-box for JDiameter. So what you basically need to do is:

  • Setup your project and decide on a server to use for it. I chose wildfly, but had to give it access to some elsewise protected internal java classes (only required for SCTP). Secondly I doubt, that the JDiameter internal thread handling really matches the JEE standard, but at least it works.

  • include JDiameter as library. In maven terms, this looks like this:

    <dependency>
        <groupId>org.mobicents.diameter</groupId>
        <artifactId>jdiameter-api</artifactId>
        <version>1.7.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>org.mobicents.diameter</groupId>
        <artifactId>jdiameter-impl</artifactId>
        <version>1.7.0-SNAPSHOT</version>
        <exclusions>
            <exclusion> 
                <groupId>org.mobicents.protocols.sctp</groupId>
                <artifactId>sctp-impl</artifactId>
            </exclusion>
        </exclusions> 
    </dependency>        
    <dependency>
        <groupId>org.mobicents.diameter</groupId>
        <artifactId>mobicents-diameter-mux-jar</artifactId>
        <version>1.7.0-SNAPSHOT</version>
        <type>jar</type>
    </dependency>
    
  • Create a working jdiameter-something.xml file for the configuration. You can place it within the resources directory or external of your application, but it needs to be accessible.

  • If your application will run in an application server and not standalone, create a java class that will be instantiated at startup and initialize the JDiameter stack there. Initializing consists of reading the xml configuration using e.g.

    stack = new StackImpl(); Configuration serverConfig = new org.jdiameter.server.impl.helpers.XMLConfiguration(serverConfigInputStream); factory = stack.init(serverConfig);

After that, register the NetWorkReqListeners for your custom messages as well as:

 stack.start();
 ISessionFactory isf = (ISessionFactory) factory;
 isf.registerAppFacory(ServerS6aSession.class, new S6aSessionFactory(1000, factory));
mbauer
  • 183
  • 10
  • Forgot to mention: In the jdiameter.xml configuration, you will specifiy if your application should initiate the connection or if it should just wait for incoming connections – mbauer Jan 15 '16 at 14:18
  • 1
    But in Maven I see jdiamter-api, jdiameter-impl jars in multiple groups org.mobicents.diameter and org.mobicents.servers.diameter . What is the difference between the jars of these two ? – tej Jan 21 '16 at 10:36
  • Cant I use Jdiameter to build a standalone s6a application without the Jboss server ? The S6aSessionFactory, ServerS6aSession are from jboss mobicents slee library (I dont know what this slee library is). – tej Jan 21 '16 at 10:58
  • Yes, you can also build a standalone application with JDiameter, however you then have to also put focus on resource management, database backend, caching etc. The -api defines the interfaces, while -impl provides the concrete implementations. This originates from design principles used in the JEE world. Mobicents is AFAIK a whole JBoss based framework with working implementations for a lot of network components. It contains re-implemented versions of JDiameter which are incompatible to the standalone older JDiameter libraries. – mbauer Jan 22 '16 at 13:03
  • Apologies for not being more clear. What is the difference between "org.mobicents.diameter" jdiameter-api.jar and "org.mobicents.servers.diameter" jdiameter-api.jar ? There are jars with the same name under two different groups. – tej Jan 25 '16 at 11:58
  • 1
    JDiameter is the original implementation, meant to work standalone. Mobicents on the other hand is part of the whole mobicents stack. It is lot further developed, but will (most likely) only work together with the rest of mobicents. In addition to that, the last version of the mobicents stack that I saw still ran on a quite old JBoss version and would not run on wildlfy. – mbauer Jan 26 '16 at 08:34
  • Great. Now I get it. I am facing another issue. I posted it as another question here. Have you faced such problem before ? http://stackoverflow.com/questions/35033222/restcomm-jdiameter-error-creating-sctp-socket – tej Jan 27 '16 at 09:22
  • Is there a way to check if CER is established before sending other messages to the server. In the examples given on jdiameter github, the client just waits for 10 seconds or so before sending any requests. – tej Mar 18 '16 at 09:11