Changes between Initial Version and Version 1 of Audio_Problems/Getting_Around_Nat


Ignore:
Timestamp:
Dec 23, 2006 4:42:05 PM (18 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Audio_Problems/Getting_Around_Nat

    v1 v1  
     1= Audio Problems: Getting Around NAT = 
     2 
     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.  
     4 
     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.  
     7 
     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: 
     9{{{ 
     10 $ ./pjsua --use-stun1 stun.example.com --use-stun2 stun.example.com 
     11}}} 
     12 
     13 
     14 
     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. 
     17 
     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. 
     19 
     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). 
     22 
     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. 
     24 
     25