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
SessionDescriptionImpl constructor prepends a -u corrupting the field in sdp #112
Comments
@amitch would you like to try to contribute a Pull Request fixing the code with a non regression test ? |
Hey Jean, Not in near term. Will wait for release if and when happens. Please add it to your roadmap as appropriate. There is a non trival ramp up to get jain-sip compiling locally and then trying out. Amit |
@xhoaluu @jaimecasero can you review as time permits ? |
adding test to assert on cloned sdp for verification... |
Confirmed there is a later when the URI is actually parsed during get()... The "u=" should be removed as suggested by @amitch |
The original code mentions:
But an URL is final in Java, so there is no way to modify the object itself. Why do we require deep copy of final objects?? -> I think we could live by reusing same object here ( this is the suggested approach from reporter) |
Patch with test on its way |
(cherry picked from commit bdfd5e0ee76fa2c8b44e63e56307a8ae57fbd5c2)
(cherry picked from commit bdfd5e0ee76fa2c8b44e63e56307a8ae57fbd5c2)
Hello,
The SessionDescriptionImpl copy constructor prepends an -u due to bug
This is at
https://github.com/RestComm/jain-sip/blob/master/src/gov/nist/javax/sdp/SessionDescriptionImpl.java#L129
Looking at
https://github.com/amitch/jain-sip/blob/master/src/gov/nist/javax/sdp/fields/URIField.java
newUF.setURI(otherUriField.toString());
should be replaced by
newUF.set(otherUriField.get());
which will cover both URI or string being set as well as fix case of extra -u. Changing it to below fixes only -u issue.
newUF.setURI(otherUriField.getURI());
Amit
The text was updated successfully, but these errors were encountered: