Rammbock icon indicating copy to clipboard operation
Rammbock copied to clipboard

Issues with receiving Diameter messages containing multiple grouped AVPs

Open sonacart opened this issue 5 years ago • 0 comments

I am using Rammbock (Ver. 0.4.0.2) to decode Diameter messages. And I seek for help to receive a Credit-Control-Answer (CCA) containing 2 Multiple-Service-Credit-Control (MSCC) AVPs. MSCC AVP is by itself a grouped AVP containing other AVPs. (I am using the pattern for AVP definition as shown in https://github.com/robotframework/Rammbock/blob/master/atest/diameter.robot )

My (stripped down) message definitions look like this:

    New message    CCA    Diameter
    Start bag    avps
	    Case    1      AVP    sessionId              Session-id
	    Case    1      AVP    originHost             Origin-Host
	    Case    1      AVP    originRealm            Origin-Realm
	    Case    1      AVP    authApplicationId      Auth-Application-Id
	    Case    1      AVP    reqType                CC-Request-Type
	    Case    1      AVP    reqNum                 CC-Request-Number    
	    Case    0-2    AVP    mmsc                   Multiple-Service-Credit-Control-CCA
	    Case    1      AVP    resultCode             Result-Code
    End bag
    Save template    CCA

Multiple-Service-Credit-Control-CCA
    Start bag    avps
	    Case    0-1    AVP    ratingGroup            Rating-Group
	    Case    0-1    AVP    resultCode             Result-Code
	    Case    0-1    AVP    grantedServiceUnit     Granted-Service-Unit
	    Case    0-1    AVP    finalUnitIndication    Final-Unit-Indication
    End bag

Client receives CCA
    Load template    CCA
    ${msg}=   Client receives message

Everything is working fine as long as both received MMSCs are of the same length (including the of sub-AVPs). But Rammbock starts complaining if the 2 MMSCs contain a different number of sub-AVPs.

If the first MSCC has more sub-AVPs than the second, then I get the error message: Received 'CCA', message too long. Expected 288 but got 356 If I change the order of received MSCCs so that the first has less AVPs, I get the error message: Unable to decode bag value.

I get the same error messages if I use Client receives without validation, so the issue must already occur before the message validation.

I already tried to define the CCA message with a fixed number of MSCCs or in another attempt with 2 individually named MMSCs, but this did not change the error messages in any way.

Doing an alternative test, I have put 2 MSCCs with the same number of sub-AVPs into the CCA, but one of the sub-AVPs being smaller than the other. But independent of the order of these MSCCs I always get the error message: Unable to decode bag value.

As a final test I defined the CCA message with 2 identical AVPs which are not of type grouped; i.e. this AVP does not contain other AVPs. In this case Rammbock is not complaining even if the length of both AVPs is different.

So to me it looks like there is a problem with decoding the grouped AVP. Somehow the first grouped AVP seems to get decoded and by that "predefines" what the next one of the same type has to look like ... if that makes any sense.

Maybe the problem is due to my way of defining the message and AVPs. Then please advise on how to improve the definitions. Or, if it's actually a problem to handle such messages with Rammbock, I would be very glad if you could provide some help how I could work around this problem.

sonacart avatar May 06 '20 19:05 sonacart