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

Default UDP transport makes Contact header constructed incorrectly for TCP transport #23

Closed
yarel79 opened this Issue Sep 6, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@yarel79
Contributor

yarel79 commented Sep 6, 2016

Why in RA, there is "udp" transport added by default?

https://github.com/RestComm/jain-slee.sip/blob/master/resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/SipResourceAdaptor.java#L224

If one chooses to use only TCP transport, then UDP transport still will be present anyway in transports. After RA initialization transports contains ('UDP','TCP') and two listening points will be created (for TCP and UDP).

raActive():
https://github.com/RestComm/jain-slee.sip/blob/master/resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/SipResourceAdaptor.java#L1255-L1264

This brings an issue when retrieving listening point:
https://github.com/RestComm/jain-slee.sip/blob/master/resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/wrappers/ClientDialogWrapper.java#L425

Since map doesn't have an order defined, then getting one random entry from the map makes Contact header contain sometimes UDP instead of desired TCP.

Some details:

org.mobicents.slee.resource.sip11.SleeSipProviderImpl:

    public ListeningPoint getListeningPoint() {
        checkState();
        return this.provider.getListeningPoint();
    }

gov.nist.javax.sip.SipProviderImpl.getListeningPoint():

    public ListeningPoint getListeningPoint() {
        if (this.listeningPoints.size() > 0) {
            return ((ListeningPoint) this.listeningPoints.values().iterator().next());
        }

        return null;
    }

listeningPoints will have UDP, TCP transports. and getListeningPoint() will return most likely UDP (most likely, since it depends per map behaviour, in my case it is always UDP).

For me it looks like a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment