Changes between Initial Version and Version 1 of Audio_Problems/Getting_Around_Nat

Dec 23, 2006 4:42:05 PM (15 years ago)



  • Audio_Problems/Getting_Around_Nat

    v1 v1  
     1= Audio Problems: Getting Around NAT = 
     3If [wiki:audio-check-rx-rtp no RTP packet is received] (or [wiki:audio-problem-local-no-audio you can't any hear audio]), perhaps it's because of the NAT device is blocking the incoming RTP packets.  
     5== Use STUN == 
     6One of the obvious reason why no incoming packet is received is because the application sends private IP address as its RTP address. This can be verified by looking at the SDP {{{c=}}} line that is sent by the application.  
     8If the SDP {{{c=}}} line contains private address, then probably you need to use STUN. You can enable STUN support in ''pjsua'' by using '''{{{--use-stun1}}}''' and '''{{{--use-stun2}}}''' options from the command line. For example: 
     10 $ ./pjsua --use-stun1 --use-stun2 
     15== Disabling VAD == 
     16Normally NAT router only forwards incoming packets to internal network after the internal host has sent some packets to remote destination. But this may not happen if Voice Activity Detector (VAD)/Silence Detector is enabled, because then no RTP packet will be transmitted when there is no voice activity on the microphone. 
     18So as workaround solution, try to disable VAD to see if this is the case. You can disable VAD in ''pjsua'' by using '''{{{--no-vad}}}''' option from the command line. 
     20== Using Port Forwarding == 
     21''pjsua'' can also be configured in port forwarding environment, for both SIP UDP/TCP and media (RTP) transports. To do this, you have to configure your router to forward UDP/TCP port 5060 to the application, and also UDP ports for RTP. By default, ''pjsua'' (and ''PJSUA-API'') allocates UDP ports for RTP/RTCP from port 4000 for RTP and 4001 for RTCP, and upwards up to the maximum number of calls configured in pjsua (for example, if ''max-calls'' is 10, then the port range allocated for RTP/RTCP will be UDP ports 4000 - 4019, since each call will need two UDP sockets). 
     23After port forwarding has been configured in the router, you just need to specify the router's public IP address to pjsua, with '''{{{--ip-addr}}}''' command line option. With this option, all addresses advertised by ''pjsua'' will use this address rather than the internal IP address.