r3gis3r / CSipSimple

CSipSimple Mirror (no pull-requests here)
http://www.csipsimple.com
GNU Lesser General Public License v3.0
302 stars 227 forks source link

Audio partially missing on vpn 3g connection android 6.0 #49

Closed kukulo2011 closed 8 years ago

kukulo2011 commented 8 years ago

Given is following configuration: asterisk openwrt server with openvpn running on the same node two clients using csipsimple, one on wifi vpn, second on 3g vpn the client with 3g vpn is not passing audio to wifi vpn client. the wifi vpn is running android 4.4 and 3g vpn is running android 6.0. Configuration with two android 4.4 clients is working.

kukulo2011 commented 8 years ago

the wifi vpn on android 6.0 is working

zipcom commented 8 years ago

3g configuration varies for different carriers. Even with the same carrier, the NAT/firewall settings may be different in various areas, and at various times. Please make sure that It is not by chance that Android 4.4 works better than 6.0. Asterisk usually performs "server relay" for audios. But in your case, it seems that the server is behind symmetric NAT with VPN. In most cases, it is recommended to place Asterisk with public, fixed IP.

Of course, you may be able to resolve the issue with ICE/TURN/STUN. The TURN server needs public IP, so it is about the same as you put Asterisk with public IP.

kukulo2011 commented 8 years ago

The issue is that with the same settings the client with android 4.4 works.

I checked the android 6.0 with enabled tethering and connected with linux box to the same vpn. Empathy client on the linux box worked flawlessly.

So I assume it is the android 6.0 Sip client which handles the audio stream on android 6.0 somehow strange.

I already tried to enable various settings, but without any success.

The vpn is activated via openvpn client directly on android client. So the android client gets directly connected to the asterisk node.

zipcom commented 8 years ago

It is time to use Wireshark to trace the SIP messages, as well as the rtp/rtcp packets. One-way audio is usually associated with NAT/firewall, and should have nothing to do with Android versions. Wireshark may provide a good insight to resolve the mystery.

zipcom commented 8 years ago

There are several different kinds of problems:

  1. unable to register
  2. unable to complete call setup
  3. no audio
  4. one-way audio
  5. choppy voice quality

Your problem of "audio partially missing" corresponds to 4 (one-way audio) or 5 (choppy voice)? Please be specific. For 4 one-way audio, most likely it is NAT problem. For 5 choppy voice, the codec, network bandwidth, CPU computing power, and echo cancellation scheme are the problem.

For 1 unable to register, tcp/tls with random port (and lucky enough), instead of udp, may be the solution. However, there are many situations where Skype, LINE work fine but CsipSimple fails to register. Skype obviously uses better algorithm than standard CsipSimple.

kukulo2011 commented 8 years ago

It is the one way audio. I tested on a different carrier with different audio codec and I got two way audio. I will be more testing. I will get back as soon as I have more test results.

kukulo2011 commented 8 years ago

Strange, on a different carrier I have two way audio. The issue is either related to networking on the previous carrier or to the fact that there was not enough upload speed on it during the call. That might explain the issue. I will close this issue as it is not related to csipsimple itself.