Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Grouped Datatype #1

Closed
dwilkie opened this issue Apr 23, 2014 · 3 comments
Closed

Using Grouped Datatype #1

dwilkie opened this issue Apr 23, 2014 · 3 comments

Comments

@dwilkie
Copy link
Contributor

dwilkie commented Apr 23, 2014

Hi @fiorix, firstly may thanks for this library. I just started using it today and I'm having some trouble with the Grouped datatype.

I added the following AVP definitions to the dictionary according to http://tools.ietf.org/html/rfc4006#section-8.46

<diameter>
  <application id="0">
    <avp name="Subscription-Id" code="443" must="M" may="P" must-not="V" may-encrypt="-">
      <data type="Grouped"/>
    </avp>

    <avp name="Subscription-Id-Type" code="450" must="M" may="P" must-not="V" may-encrypt="Y">
      <data type="Enumerated">
        <item code="0" name="END_USER_E164"/>
        <item code="1" name="END_USER_IMSI"/>
        <item code="2" name="END_USER_SIP_URI"/>
        <item code="3" name="END_USER_NAI"/>
      </data>
    </avp>

    <avp name="Subscription-Id-Data" code="444" must="M" may="P" must-not="V" may-encrypt="Y">
      <data type="UTF8String"/>
    </avp>

  </application>
</diameter>

In my client I've done this:

const (
  SubscriptionIdType = datatypes.Enumerated(0x00)
  SubscriptionIdData = datatypes.UTF8String("85560234567")
)

func NewClient(c diam.Conn) {
  m := diam.NewRequest(272, 0, nil)
  m.NewAVP("Subscription-Id", 0x40, 0x0, datatypes.Grouped([SubscriptionIdType, SubscriptionIdData]))

Just having a problem with the last line. How to make a NewAVP which is of type Grouped and contains the other two types?

@fiorix fiorix closed this as completed in 3dca812 Apr 23, 2014
@fiorix
Copy link
Owner

fiorix commented Apr 23, 2014

Hi David. I've added a test case for that and it serves as an example. Let me know if you still have questions.

fiorix added a commit that referenced this issue Apr 23, 2014
@dwilkie
Copy link
Contributor Author

dwilkie commented Apr 23, 2014

Thanks for that. Great example.

I'm adding some AVPs to diam/dict/default.go in https://github.com/dwilkie/go-diameter/ with respect to http://tools.ietf.org/html/rfc4006. I'm not sure if this is in the right place, but either way let me know and I can send a pull request if you're happy to have this included.

@fiorix
Copy link
Owner

fiorix commented Apr 23, 2014

The dictionary in default.go is actually the base dictionary from rfc6733. Maybe it should be renamed to basedict.go and the one for rfc4006 could be named ccdict.go.

The contents of the default.go is actually a copy of dict/testdata/base.xml. Would be great to have dict/testdata/cc.xml for credit control apps. Also, would be great to track this on its own issue - not on this closed one.

fiorix pushed a commit that referenced this issue Jan 20, 2017
fiorix pushed a commit that referenced this issue Feb 5, 2017
ilius pushed a commit to ParspooyeshFanavar/go-diameter that referenced this issue Oct 8, 2023
…o-diameter:bugfix/IBSNG-2980-fix-race-condition-in-byteArray-dataTypes to master

* commit '169edfded0922cdbec3e9215518e609758fb729f':
  Bug: #IBSNG-2980 Fix race condition in byteArray dataTypes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants