aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-31 22:03:05 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-31 22:03:05 +0000
commit3d86cf82e50a9569179552331887fb5b268679e4 (patch)
treecad44794f7a4964c43d586f4365929ce895de056 /channels
parent348671cec7f3fcc3772c49d6786d0aab2aea510a (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@38631 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 49a5cb077..53ba0086a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11549,7 +11549,11 @@ static void *do_monitor(void *data)
restartsearch:
time(&t);
sip = iflist;
- while(sip) {
+ /* don't scan the interface list if it hasn't been a reasonable period
+ of time since the last time we did it (when MWI is being sent, we can
+ get back to this point every millisecond or less)
+ */
+ while(!fastrestart && sip) {
ast_mutex_lock(&sip->lock);
if (sip->rtp && sip->owner && (sip->owner->_state == AST_STATE_UP) && !sip->redirip.sin_addr.s_addr) {
if (sip->lastrtptx && sip->rtpkeepalive && t > sip->lastrtptx + sip->rtpkeepalive) {
@@ -11574,8 +11578,14 @@ restartsearch:
if (sip->owner) {
ast_log(LOG_NOTICE, "Disconnecting call '%s' for lack of RTP activity in %ld seconds\n", sip->owner->name, (long)(t - sip->lastrtprx));
/* Issue a softhangup */
- ast_softhangup(sip->owner, AST_SOFTHANGUP_DEV);
+ ast_softhangup_nolock(sip->owner, AST_SOFTHANGUP_DEV);
ast_mutex_unlock(&sip->owner->lock);
+ /* forget the timeouts for this call, since a hangup
+ has already been requested and we don't want to
+ repeatedly request hangups
+ */
+ sip->rtptimeout = 0;
+ sip->rtpholdtimeout = 0;
}
}
}