The PSTN trunk turns on/off as polarity changes in theory. Sometime it(OK, sip trunk also) strikes
To avoid this, we might use other mechanics to limit the loss.
1. In sip.conf, set
rtptimeout=xx ;rtp time out after xx seconds of no rtp package sent/received
or
rtpholdtimeout=xxx ;time out of rtp activity when on hold(must larger than rtptimeout)
I am not sure if it works as some voip phones/ATAs have comfortable noise genertion
2. The opion in Dial command could limit the length of time:
Dial(DAHDI/1|120|L(3600000:60000:20000)) ; max one hour, peep every 20 seconds at the last minute
# L(x[:y][:z]): Limit the call to 'x' ms, warning when 'y' ms are left, repeated every 'z' ms) Only 'x' is required, 'y' and 'z' are optional. Numbers must be integers- beware of AGI scripts that may return long integers in scientific notation (esp PHP 5.2.5&6) The following special variables are optional for limit calls: (pasted from app_dial.c)
* LIMIT_PLAYAUDIO_CALLER - yes|no (default yes) - Play sounds to the caller.
* LIMIT_PLAYAUDIO_CALLEE - yes|no - Play sounds to the callee.
* LIMIT_TIMEOUT_FILE - File to play when time is up.
* LIMIT_CONNECT_FILE - File to play when call begins.
* LIMIT_WARNING_FILE - File to play as warning if 'y' is defined. If LIMIT_WARNING_FILE is not defined, then the default behaviour is to announce ("You have [XX minutes] YY seconds").
http://www.voip-info.org/wiki/view/Asterisk+cmd+Dial
This one seems to me an advanced version of timeout
http://www.voip-info.org/wiki/view/Asterisk+func+timeout |