Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 69 by [email protected]: Processing requests for the same Diameter session
https://code.google.com/p/jdiameter/issues/detail?id=69

Mail list item:
https://groups.google.com/forum/#!topic/mobicents-public/zt05tnTQYBI


I had a problem a while ago if you get two Diameter requests quite close together (e.g. Ro CCR-U's for same session ID but different rate-group) - the RA processing uses the "last-request" concept and can mix up the end-to-end and hop-by-hop id.

I fixed this with the following when processing CCR's in my SBB:
RoCreditControlAnswer CCA = null;
        try {
RoServerSessionActivity serverSession = (RoServerSessionActivity) aci.getActivity();
            CCA = serverSession.createRoCreditControlAnswer();
CCA.getHeader().setEndToEndId(event.getHeader().getEndToEndId()); CCA.getHeader().setHopByHopId(event.getHeader().getHopByHopId());

This ensures the correct values are used in the CCA and works fine.

Next issue I noted is that CC-Request-Number AVP suffered from exactly the same problem - if you get two very close CCR-Us for the same session-ID the cc-request-number can get mixed up.

I fixed this with the following in my SBB:
CCA.setCcRequestNumber(event.getCcRequestNumber());

But this causes an issue:

setCcRequestNumber() does not replace the cc-request-number AVP - it adds another one.

Having 2 cc-request-number AVP in a CCA can have issues with vendor Diameter clients.

I've fixed this with the following change:
+++ main/java/org/mobicents/slee/resource/diameter/ro/events/RoCreditControlMessageImpl.java (working copy)
@@ -27,6 +27,7 @@
import net.java.slee.resource.diameter.cca.events.avp.MultipleServicesCreditControlAvp;
 import net.java.slee.resource.diameter.ro.events.RoCreditControlMessage;
 import net.java.slee.resource.diameter.ro.events.avp.ServiceInformation;
+import org.jdiameter.api.Avp;

 import org.jdiameter.api.Message;
import org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl;
@@ -63,7 +64,10 @@
    */
   @Override
public void setCcRequestNumber(long ccRequestNumber) throws IllegalStateException {
-    addAvp(CreditControlAVPCodes.CC_Request_Number, ccRequestNumber);
+      if(hasCcRequestNumber()) {
+ this.message.getAvps().removeAvp(CreditControlAVPCodes.CC_Request_Number);
+      }
+      addAvp(CreditControlAVPCodes.CC_Request_Number, ccRequestNumber);
   }


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--

--- You received this message because you are subscribed to the Google Groups "mobicents-all-issues-changes" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to