RestComm / restcomm-android-sdk

Android Mobile SDK to easily integrate communication features (WebRTC, messaging, presence, voice, video, screensharing) based on RestComm into native Mobile Applications
http://www.restcomm.com/
GNU Affero General Public License v3.0
153 stars 109 forks source link

Transport other than TCP or TLS #602

Closed WolandPL closed 7 years ago

WolandPL commented 7 years ago

Is there a way to use WebSocket as transport? In jainSipClientBind method in org.restcomm.android.sdk.SignalingClient.JainSipClient I can see:

String transport = "tcp";
if (JainSipConfiguration.getBoolean(configuration, RCDevice.ParameterKeys.SIGNALING_SECURE_ENABLED)) {
            transport = "tls";
            //transport = "wss";
}

looking like you tried or plan to implement WebSockets, but currently it's not available. Is this right?

atsakiridis commented 7 years ago

Should be working @WolandPL. Jain SIP stack that runs underneath supports it and I tested it a couple of months back; just uncomment wss instead of tls ;)

WolandPL commented 7 years ago

I did uncomment wss and I get WSS in VIA header and "transport" in CONTACT header, but server still seems not to recognize it as a websocket traffic. Are you sure setting transport to WSS is enough to really send REGISTER to WebSocket? I tried adding "wss://" at the beginning of Signaling Domain but then it fails valdiation (and I saw exactly that - wss://... as a registrar in your javascript library. Maybe that's the problem?

atsakiridis commented 7 years ago

@WolandPL just tried again with WSS and it is working fine. You must not add wss:// in the beginning of signaling domain. For example in my case domain is:

cloud.restcomm.com:5063 

Notice that I had to explicitly use port 5063 in our case since the WSS port is 5063. If with these changes you still get issues, please share more information like android logcat