Quobis / QoffeeSIP

QoffeeSIP is a complete Javascript SIP stack that can be used in a website to exploit all the multimedia capabilities of WebRTC technology. Instead of using pure Javascript, QoffeeSIP has been coded with CoffeeScript so you can easily modify it to suit your needs.
GNU Lesser General Public License v3.0
27 stars 5 forks source link

Qoffee interop with stun/turn server #5

Open prasaddp5 opened 11 years ago

prasaddp5 commented 11 years ago

Hi, When I make webrtc call, stun request sent from Qoffee do get a response for mapped-IP address, however the candidate lines sent in INVITE still points to the browser IP ( source IP) and not the changed-IP address or XOR-Mapped IP address. Though the call is successful, this would be an issue to make webrtc call in Internet( behind NAT).

How do we achieve this? any pointers would be appreciated. In other words, how can I set the "changeIP" and "changePort" flag to true or "1" currently its set to "0". Stun request/response looks as shown below:

STUN request/response:

received on A1:P1 Got a request (len=20) from 10.70.54.80:51916 Received stun message: 20 bytes Request parsed ok BindRequest does not contain MessageIntegrity Request is valid: flags=0 changeIp=0 changePort=0 from = 10.70.54.80:51916 respond to = 10.70.54.80:51916 mapped = 10.70.54.80:51916 Encoding stun message: Encoding MappedAddress: 10.70.54.80:51916 Encoding SourceAddress: 192.168.192.23:3478 Encoding ChangedAddress: 192.168.192.30:3479 Encoding XorMappedAddress: 43.84.146.18:60382 Encoding ServerName: Vovida.org 0.97

Are you able to make webrtc call using Qoffee interoping with public STUN/TURN server.

Thanks, Padma Prasad

prasaddp5 commented 10 years ago

I retested with STUN server, when STUN server returns the public IP of the browser Qoffee does use this IP to communicate to its peer. However not sure how does TURN server response is handled by Qoffee,

I am interested to understand the Qoffee behaviour when it interops with public relay (TURN) server. Has any tested being performed with Symmetric NAT's

antonroman commented 10 years ago

Hi Padma,

sorry for my late reply. Regarding the management of ICE candidates, QoffeeSIP gathers all the ICE candidates provided as events by PeerConnection and sends them in the SDP. All these candidates are discovered by the browser. QoffeeSIP includes all the candidates generated. If any candidate is missing it shouldn't be a QoffeeSIP issue at first glance.

In our example webphone (examples/webphone/public/js/ui.coffee) we use a Google's public STUN server (74.125.132.127) by default. It should work for you. Please, use that STUN server when you instantiate the API and check if the reflexive address is included in the ICE candidates. Please note that it won't work in any NAT scenario, when the call is made between two symmetric NATs you are very likely to need a TURN server.

I hope this helps. Thank you very much for your feedback, regards, Anton