[asterisk-users] RTP timeout if the asterisk box behind NAT

Stelios Koroneos skoroneos at digital-opsis.com
Mon Feb 4 01:17:58 CST 2013

On Sun, 2013-02-03 at 15:38 -0800, bilal ghayyad wrote:
> Dears;
> I am facing a problem in disconnecting the calls, it is related to the rtptimeout (disconnecting if there is no RTP packets from both sides).
> My Asterisk Box is behind NAT but there is a static real IP address at the ADSL router. We call from the Mobile to the PSTN analogue numbers which are connected to Asterisk Analogue card (the telephone lines are analoge), and then we dial the overseas number, so the asterisk is sending the call to a VoIP service provider which will route the call to the destination. Sometime the destination is connected while ringing !! And this is a problem from the SIP service provider route, then we hangup our mobile (as no one answering our call) but asterisk is not detecting the hangup (it is because the telephone lines are analoge and this problem is common in analoge lines that some hangup are not detected). In that case, the call will stay open and charging and this is a wrong.
> This problem was not appearing when Asterisk machine was having static real IP address because I was enabling the rtptimeout paramters. But now as the asterisk box IP address is private and it is behind NATing then it is appearing even I enabled the (rtptimeout=50 and rtpholdtimeout=120).
> What should I do?

My advice is to first try to fix your pstn hangup detection problem.
Relying on rtptimeout assumes that the voip side has hanged up and the
voip provider has also terminated the call and no rtp is coming.
Which means that if your pstn caller terminates the call and the voip
side does not (for any reason) you will still be charging the pstn

To see why rtptimeout does not work get a wireshark capture and see if
there is still traffic going on 
Stelios S. Koroneos

More information about the asterisk-users mailing list