Coder Social home page Coder Social logo

restcomm / jain-slee.diameter Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 33.0 10.4 MB

JAIN SLEE jDiameter Resource Adaptors Repository

Home Page: http://www.restcomm.com/

License: GNU Affero General Public License v3.0

Java 100.00% Shell 0.01% Batchfile 0.01%

jain-slee.diameter's Introduction

jain-slee.diameter's People

Contributors

ammendonca avatar anatolysatanovskiy-mobius avatar brainslog avatar deruelle avatar emmartins avatar ivelin avatar sergeylee avatar yulianoifa-mobius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jain-slee.diameter's Issues

Ending Diameter activity explicitly from SBB

@richardgood commented on Thu Apr 07 2016

One thing I have noted is that unless Diameter activities are ended by their state machine (e.g. a CCR-T message is received) the activities never expire and there is no way for the SBB to remove them.

In the event of (non-Mobicents!) Diameter clients malfunctioning or rebooting this can cause a memory leak.

e.g.
Diameter Gx Client sends CCR-INIT for a certain IP address with session ID ABC
Diameter Gx Client malfunctions and sends CCR-INIT for the same IP address with session ID DEF
Gx Client never every terminate session ID ABC and it stays forever and is never free-ed.

The SBB application actually knows that session ID ABC needs to be removed when it receives a CCR-INIT for the same IP.

If you edit the Diameter GX RA by adding to GxServerSessionActivityImpl.java:

public void delayedEndActivity() {
this.setTerminateAfterProcessing(true);
super.baseListener.startActivityRemoveTimer(getActivityHandle());

}

And to GxServerSessionActivity.java

void delayedEndActivity();

The SBB can explicitly end an activity if it needs to by calling delayedEndActivity on the activity.

This could be applied to all session based Diameter RAs


@chathsuom commented on Fri Apr 08 2016

I guess this issue should be list under the RA's ?
https://github.com/RestComm/jain-slee.diameter

On Thu, Apr 7, 2016 at 7:01 PM, Jean Deruelle [email protected]
wrote:

Assigned #33 RestComm/jdiameter#33 to
@chathsuom https://github.com/chathsuom.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
RestComm/jdiameter#33 (comment)


@deruelle commented on Tue Apr 12 2016

@chathsuom yes, indeed. Can you create an issue there linking to this one and fixing/udpating the RAs and do a pull request ?

@brainslog please review


@deruelle commented on Fri May 20 2016

@chathsuom any news here ?


@xphudin commented on Sun Nov 06 2016

@deruelle
Can I continue and PR ?


@deruelle commented on Mon Nov 07 2016

@xphudin yes please.

release-wildfly compile fails due to pom typo

In restcomm-slee-ra-diameter-base-ra-release.pom.xml there is a typo that causes compiliation failure when building the release-wildfly profile. "tofile" should be used instead of "todir". See below. This should be fixed in all Diameter resource release pom.xml.

- <copy overwrite="true" file="${basedir}/build-wildfly.xml" todir="${release.dir}/resources/diameter-base/build.xml">
+ <copy overwrite="true" file="${basedir}/build-wildfly.xml" tofile="${release.dir}/resources/diameter-base/build.xml">

Operator specific Trigger-Type Ro interface AVP value

Hello,
We have implemented extensions to diameter Ro RA. In scope of the project we implemented additional (non-standard) value for Trigger-Type AVP.
The value is 999 (new emum created) and causes diameter session to be served in degraded mode.

We agreed our Customer to contribute this extension so the question is to community now... Shall we include non-standard extensions to current diameter implementation?

testsuite compilation fails

Hi

I have noted that with latest master branch as of May 18 the resources fail to compile due to:
java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;

I had to add:

<dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.21</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

To all the resource pom files for compilation to work.

Implement delivery of message timeout to SLEE applications

When there's a message (request) timeout, the application doesn't get informed of it and instead, either it waits infinitely for the answer or it needs to set it's own timer for "guessing" when the timeout occurred and take it's own measures regarding it.

The Diameter RAs should deliver these timeout messages to the application and terminate the activity, where appropriate.

Ending Diameter activity explicitly from SBB

"One thing I have noted is that unless Diameter activities are ended by their state machine (e.g. a CCR-T message is received) the activities never expire and there is no way for the SBB to remove them.

In the event of (non-Mobicents!) Diameter clients malfunctioning or rebooting this can cause a memory leak.

e.g.
Diameter Gx Client sends CCR-INIT for a certain IP address with session ID ABC
Diameter Gx Client malfunctions and sends CCR-INIT for the same IP address with session ID DEF
Gx Client never every terminate session ID ABC and it stays forever and is never free-ed.

The SBB application actually knows that session ID ABC needs to be removed when it receives a CCR-INIT for the same IP.

If you edit the Diameter GX RA by adding to GxServerSessionActivityImpl.java:

public void delayedEndActivity() {
this.setTerminateAfterProcessing(true);
super.baseListener.startActivityRemoveTimer(getActivityHandle());

}

And to GxServerSessionActivity.java

void delayedEndActivity();

The SBB can explicitly end an activity if it needs to by calling delayedEndActivity on the activity.

This could be applied to all session based Diameter RAs"
This issue broghut here from jdiameter project issue log

Two activities created when an ACR is received

The activity is being created by calling sessionCreated from createRfClientSessionActivity but then it is being returned yet another created activity:

public RfClientSessionActivity createRfClientSessionActivity(DiameterIdentity destinationHost, DiameterIdentity destinationRealm) throws CreateActivityException {
try {
ClientRfSession session = ((ISessionFactory) stack.getSessionFactory()).getNewAppSession(null, acctApplicationIds.get(0), ClientRfSession.class);
if (session == null) {
throw new CreateActivityException("Got NULL Session while creating Client Accounting Activity");
}
sessionCreated(session);
return new RfClientSessionActivityImpl(rfMessageFactory, rfAvpFactory, session, destinationHost, destinationRealm, stack);
}
catch (Exception e) {
throw new CreateActivityException("Internal exception while creating Client Accounting Activity", e);
}
}

The createRfClientSessionActivity method should return the activity created by sessionCreated.

restcomm-slee-ra-diameter-sh-client-testsuite failure when trying to build

If project is cloned and then mvn clean install is attempted, the build fails as shown next

....
[INFO] ------------------------------------------------------------------------
[INFO] Building Restcomm :: Diameter Resources :: restcomm-slee-ra-diameter-sh-client-testsuite 7.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] restcomm-slee-diameter ............................. SUCCESS [ 0.379 s]
....
....
....
[INFO] Restcomm :: Diameter Resources :: restcomm-slee-ra-diameter-sh-client-ra SUCCESS [ 0.522 s]
[INFO] Restcomm :: Diameter Resources :: restcomm-slee-ra-diameter-sh-client-testsuite FAILURE [ 0.029 s]
[INFO] Restcomm :: Diameter Resources :: restcomm-slee-ra-diameter-sh-client-ra-DU SKIPPED
....
....
....
[INFO] hss-client ......................................... SKIPPED
[INFO] hss-client-sbb ..................................... SKIPPED
[INFO] hss-client-DU ...................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.000 s
[INFO] Finished at: 2018-01-10T11:32:58-05:00
[INFO] Final Memory: 87M/997M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project restcomm-slee-ra-diameter-sh-client-testsuite: Could not resolve dependencies for project org.mobicents.resources:restcomm-slee-ra-diameter-sh-client-testsuite:jar:7.0.0-SNAPSHOT: Failure to find org.mobicents.resources:restcomm-slee-ra-diameter-base-testsuite:jar:tests:7.0.0-SNAPSHOT in https://oss.sonatype.org/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of restcomm-public-repository-group has elapsed or updates are forced -> [Help 1]**
....

NonSerializableException for diameter-mobicents-slee-ra-diameter-rf-ra

When deployed in cluster, Diameter-Rf-Ra throws NonSerializableException, when jboss tries to replicate state of Rf-Ra.

java.io.NotSerializableException: org.mobicents.slee.resource.diameter.rf.RfMessageFactoryImpl 
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183) 
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) 
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)

The cause of this behaviour is that RfClientSessionActivityImpl extends RfSessionActivityImpl which has declaration:

protected RfMessageFactory rfMessageFactory;

RfMessageFactory is not serializable.

Solution
Declare rfMessageFactory field as transient in RfSessionActivityImpl.

(From Zendesk Issue 34342)

Session-ID AVP can be added more than once

Session-ID AVP (263) in current implementation of Diameter base can be added more that once against

The fix will check first if the AVP is set and in that case it will overwrite the existing AVP value.

Implement additional AVPs for Ro interface and AVPs extensions

Addiitional AVPs implemented according to 3GPP TS 32.299 (allign with Rel. 8 ver. 8.25.0):
Application-Service-Type
Destination-Interface
Interface-Type
Multiple-Services-Credit-Control
Originator-Interface
Originator-Received-Address
Recipient-Info
Recipient-Received-Address
Remaining-Balance
Reply-Path-Requested
Service-Generic-Information
Service-Specific-Info
SMS-Information
Sm-Message-Type
Sm-Service-Type
Sms-Information
Sms-Node
Trigger

Existing AVP extensions:
Service-Information extension
Ims-Information extension
Used-Service-Unit extension
Unit-Quota-Threshold extension
Trigger-Type extension

Existing AVP management extensions:
CC-Request-Number overwrite (can be present once only)
Auth-Application-Id overwrite (can be present once only)

Support serializable for Diameter message

It is derived from ticket 34494.

When storing an object in CMP field. This object need to be implemented serialize/deserialized interface. This is the requirement in jain-slee spec 1.1

From SBB point of view. When receiving incoming event. I want to store it in CMP field and then it could be able to get back to create response later. Currently we can't do it by this way because most of our Diameter Request (CapabilitiesExchangeRequest, AccountingRequest, SessionRequest...) unable to serialize.

As a workaround solution now , When receiving a Request, I need to getAvps() -> from returned array get need information and put in CMP field. And create a response by
https://github.com/RestComm/jain-slee.diameter/blob/master/resources/diameter-base/common/ratype/src/main/java/net/java/slee/resource/diameter/base/DiameterMessageFactory.java#L68
It is not useful enough from customer point of view.

Or at least , We can support Diameter HEADER can be serialized, then SBB can use
https://github.com/RestComm/jain-slee.diameter/blob/master/resources/diameter-base/common/ratype/src/main/java/net/java/slee/resource/diameter/base/DiameterMessageFactory.java#L81

to create response

For more information please see 34494.

Diameter Ro RA - race when creating DiameterActivity

Exception bt
2017-09-06 14:13:27,281 ERROR [javax.slee.RAEntityNotification[entity=DiameterRo].DiameterRoResourceAdaptor] [ApplicationSession-1] [TracerImpl::severe::412] Error firing event.
java.lang.IllegalStateException: No activity for handle: Diameter Session ID[localhost;350;1460764936]
at org.mobicents.slee.resource.diameter.ro.DiameterRoResourceAdaptor.fireEvent(DiameterRoResourceAdaptor.java:608)
at org.mobicents.slee.resource.diameter.ro.DiameterRoResourceAdaptor.fireEvent(DiameterRoResourceAdaptor.java:635)
at org.mobicents.slee.resource.diameter.ro.handlers.RoSessionFactory.doCreditControlAnswer(RoSessionFactory.java:64)
at org.jdiameter.client.impl.app.ro.ClientRoSessionImpl.deliverRoAnswer(ClientRoSessionImpl.java:1158)
at org.jdiameter.client.impl.app.ro.ClientRoSessionImpl.handleEventForSessionBased(ClientRoSessionImpl.java:344)
at org.jdiameter.client.impl.app.ro.ClientRoSessionImpl.handleEvent(ClientRoSessionImpl.java:196)
at org.jdiameter.client.impl.app.ro.ClientRoSessionImpl$AnswerDelivery.run(ClientRoSessionImpl.java:1340)
at org.jdiameter.common.impl.concurrent.DefaultRunnable.run(DefaultRunnable.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

How to reproduce issue.

// -------------------------------------------------------------------------------------
Step by step operations (relevant) flow

  1. SBB: Create client activity [RoClientSessionActivity session = roProvider.createRoClientSessionActivity();]
  2. SBB: Create aci
  3. SBB: attach sbbLocalObject to aci
  4. Create CCR-I object [ RoCreditControlRequest creditControlRequest = session.createRoCreditControlRequest(ccRequestType);]
  5. Send CCR-I to OCS: [session.sendInitialRoCreditControlRequest(creditControlRequestHw);]
  6. Some loging and data persisting operations (make this step time consuming to reproduce issue)
  7. OCS responds before step 6) ends.
  8. RA receives CCA and attempts to fire it
    8.1) activieties.getActivity(ActivityHandle) fails, stacktrace in attached log
  9. SBB finishes operations, SLEE Transaction commits

// -------------------------------------------------------------------------------------

Analisys:
The creation of ACH in jboss cache with suspending and resumming the transaction. But the creation of Activity is put in transaction (without suspend and resume). The result is ACH is in cache immediately while Activity wait until the transaction is committed. If the CCR response come back quickly, Then we have another thread will trying to fetch the information of ACH and activity in jboss cache. At this time we have no Activity because the transaction is not comited in thread 1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.