dect
/
asterisk
Archived
13
0
Fork 0

Fix SIP/IAX caching (bug #3671)

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5249 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
markster 2005-03-24 05:02:49 +00:00
parent 3139c0e05c
commit f203c9dcf6
2 changed files with 8 additions and 1 deletions

View File

@ -2566,8 +2566,12 @@ static struct iax2_peer *realtime_peer(const char *peername)
peerl.peers = peer;
ast_mutex_unlock(&peerl.lock);
ast_copy_flags(peer, &globalflags, IAX_RTAUTOCLEAR|IAX_RTCACHEFRIENDS);
if (ast_test_flag(peer, IAX_RTAUTOCLEAR))
if (ast_test_flag(peer, IAX_RTAUTOCLEAR)) {
if (peer->expire > -1) {
ast_sched_del(sched, peer->expire);
}
peer->expire = ast_sched_add(sched, (global_rtautoclear) * 1000, expire_registry, (void *)peer);
}
} else {
ast_set_flag(peer, IAX_TEMPONLY);
}

View File

@ -1292,6 +1292,9 @@ static struct sip_peer *realtime_peer(const char *peername, struct sockaddr_in *
if(ast_test_flag((&global_flags_page2), SIP_PAGE2_RTCACHEFRIENDS)) {
ast_copy_flags((&peer->flags_page2),(&global_flags_page2), SIP_PAGE2_RTAUTOCLEAR|SIP_PAGE2_RTCACHEFRIENDS);
if(ast_test_flag((&global_flags_page2), SIP_PAGE2_RTAUTOCLEAR)) {
if (peer->expire > -1) {
ast_sched_del(sched, peer->expire);
}
peer->expire = ast_sched_add(sched, (global_rtautoclear) * 1000, expire_register, (void *)peer);
}
ASTOBJ_CONTAINER_LINK(&peerl,peer);