pquiring / javaforce

JavaForce library for building powerful Apps and Services (Native Bindings for Camera, OpenGL, ffmpeg). Includes VoIP stack, PLC I/O and many apps.
http://pquiring.github.io/javaforce
GNU Lesser General Public License v3.0
55 stars 24 forks source link

Allow usage of any custom attribute (a=...) #10

Closed tobias-herkert closed 2 years ago

tobias-herkert commented 2 years ago

Hello,

for my SIP demo application I need different attributes than already implemented in javaforce (and not all attributes are finally specified yet).

To go ahead, I added a array list called "otherAttributes" to the SDP class. The array list is filled in the SIP class if the attribute is not recognized as one of your specific attributes. This also means that there is a final else to the if-elseif-structure and no data is discarded any more.

I also considered putting all attributes in a list or dictionary type, but that was too invasiv from my point of few. Also I was not sure on how to name the list: otherAttributes, unknownAttributes, ...

Looking forward to hearing from you. Ideas, suggestions, improvements are welcome! :)

Best regards, Tobias

pquiring commented 2 years ago

I'll accept it but make some modifications to it for completeness and coding style.

pquiring commented 2 years ago

I removed the substring(2) and also added another else {} section at the end to capture any other unknown attributes.

Thanks for contributing!

pquiring commented 2 years ago

After reviewing SDP definitions on wikipedia attributes only start with a= and anything else would be a parameter. So I put your substring(2) back and created another list for unknown parameters. Sorry for confusion.

Thanks,