{"action":"opened","issue":{"url":"https://api.github.com/repos/node-diameter/node-diameter/issues/16","repository_url":"https://api.github.com/repos/node-diameter/node-diameter","labels_url":"https://api.github.com/repos/node-diameter/node-diameter/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/node-diameter/node-diameter/issues/16/comments","events_url":"https://api.github.com/repos/node-diameter/node-diameter/issues/16/events","html_url":"https://github.com/node-diameter/node-diameter/issues/16","id":159721850,"number":16,"title":"AVP encoding/decoding application/vendor-specificity","user":{"login":"atesgoral","id":50832,"avatar_url":"https://avatars.githubusercontent.com/u/50832?v=3","gravatar_id":"","url":"https://api.github.com/users/atesgoral","html_url":"https://github.com/atesgoral","followers_url":"https://api.github.com/users/atesgoral/followers","following_url":"https://api.github.com/users/atesgoral/following{/other_user}","gists_url":"https://api.github.com/users/atesgoral/gists{/gist_id}","starred_url":"https://api.github.com/users/atesgoral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atesgoral/subscriptions","organizations_url":"https://api.github.com/users/atesgoral/orgs","repos_url":"https://api.github.com/users/atesgoral/repos","events_url":"https://api.github.com/users/atesgoral/events{/privacy}","received_events_url":"https://api.github.com/users/atesgoral/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-10T20:55:44Z","updated_at":"2016-06-10T20:55:44Z","closed_at":null,"body":"Take for instance the CC-Request-Type AVP entry in dictionary.json. It's sharing the AVP code 416 with these entries:\r\n\r\n```\r\n{\r\n    \"code\": 416,\r\n    \"name\": \"Not defined in .xml\",\r\n    \"vendorId\": 13019,\r\n    \"type\": \"OctetString\",\r\n    \"flags\": {\r\n        \"mandatory\": true,\r\n        \"protected\": false,\r\n        \"mayEncrypt\": true,\r\n        \"vendorBit\": true\r\n    }\r\n},\r\n{\r\n    \"code\": 416,\r\n    \"name\": \"Private-Identity-Request\",\r\n    \"vendorId\": 10415,\r\n    \"type\": \"Integer32\",\r\n    \"flags\": {\r\n        \"mandatory\": false,\r\n        \"protected\": false,\r\n        \"mayEncrypt\": false,\r\n        \"vendorBit\": true\r\n    },\r\n    \"enums\": [\r\n        {\r\n            \"code\": 0,\r\n            \"name\": \"Private identity requested\"\r\n        },\r\n        {\r\n            \"code\": 1,\r\n            \"name\": \"Private identity not requested\"\r\n        }\r\n    ]\r\n},\r\n{\r\n    \"code\": 416,\r\n    \"name\": \"CC-Request-Type\",\r\n    \"vendorId\": 0,\r\n    \"type\": \"Unsigned32\",\r\n    \"flags\": {\r\n        \"mandatory\": true,\r\n        \"protected\": true,\r\n        \"mayEncrypt\": true,\r\n        \"vendorBit\": false\r\n    },\r\n    \"enums\": [\r\n        {\r\n            \"code\": 1,\r\n            \"name\": \"INITIAL_REQUEST\"\r\n        },\r\n        {\r\n            \"code\": 2,\r\n            \"name\": \"UPDATE_REQUEST\"\r\n        },\r\n        {\r\n            \"code\": 3,\r\n            \"name\": \"TERMINATION_REQUEST\"\r\n        },\r\n        {\r\n            \"code\": 4,\r\n            \"name\": \"EVENT_REQUEST\"\r\n        }\r\n    ]\r\n},\r\n```\r\n\r\nThis is causing in my application because the CC-Request-Type AVP erroneously gets mapped to the very first entry with code 416.\r\n\r\nShouldn't `getAvpByCode()` in lib/diameter-dictionary.js be actually something like `getAvpByCodeAndVendorId()` so that it just returns the AVP with the matching vendor ID? For this, the `decodeAvp()` function in lib/diameter-codec.js might have to take in a `vendorId` argument instead of (or in addition to) `appId`. Is my understanding correct?"}}
{"actor":{"display_login":"atesgoral"}}